Enlightenment CVS committal
Author : raster
Project : e17
Module : apps/e
Dir : e17/apps/e/src/bin
Modified Files:
e_config.c e_config.h e_container.c e_hints.c e_ipc_handlers.h
e_ipc_handlers_list.h e_main.c e_menu.c e_test.c
Log Message:
1. id3 album cover loader patches
2. i reduced list note memory usage by 20% - shoudl work better with malloc
as ti is now a power of 2 as well
3. optimised evas internals to make use of event freezes to make e17'sw menu
popups a LOT snappier
4. fixed using last member of list nodes - bad - shoudl use api as this is
private stuff really
5. added config profile stuff to e17 u can literally maintain multiple
config profiles and choose which one at any time etc.
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_config.c,v
retrieving revision 1.83
retrieving revision 1.84
diff -u -3 -r1.83 -r1.84
--- e_config.c 19 Jul 2005 08:04:19 -0000 1.83
+++ e_config.c 22 Jul 2005 10:28:08 -0000 1.84
@@ -18,6 +18,7 @@
/* local subsystem globals */
static Ecore_Job *_e_config_save_job = NULL;
+static char *_e_config_profile = NULL;
static E_Config_DD *_e_config_edd = NULL;
static E_Config_DD *_e_config_module_edd = NULL;
@@ -34,6 +35,40 @@
int
e_config_init(void)
{
+ _e_config_profile = getenv("CONF_PROFILE");
+ if (!_e_config_profile)
+ {
+ Eet_File *ef;
+ char buf[4096];
+ char *homedir;
+
+ homedir = e_user_homedir_get();
+ snprintf(buf, sizeof(buf), "%s/.e/e/config/profile.cfg",
+ homedir);
+ ef = eet_open(buf, EET_FILE_MODE_READ);
+ E_FREE(homedir);
+ if (ef)
+ {
+ char *data;
+ int data_len = 0;
+
+ data = eet_read(ef, "config", &data_len);
+ if ((data) && (data_len > 0))
+ {
+ _e_config_profile = malloc(data_len + 1);
+ if (_e_config_profile)
+ {
+ memcpy(_e_config_profile, data, data_len);
+ _e_config_profile[data_len] = 0;
+ }
+ free(data);
+ }
+ eet_close(ef);
+ }
+ else
+ _e_config_profile = strdup("default");
+ }
+ else _e_config_profile = strdup(_e_config_profile);
_e_config_desktop_bg_edd = E_CONFIG_DD_NEW("E_Config_Desktop_Background",
E_Config_Desktop_Background);
#undef T
#undef D
@@ -898,6 +933,7 @@
int
e_config_shutdown(void)
{
+ IF_FREE(_e_config_profile);
E_CONFIG_DD_FREE(_e_config_edd);
E_CONFIG_DD_FREE(_e_config_module_edd);
E_CONFIG_DD_FREE(_e_config_font_default_edd);
@@ -940,6 +976,90 @@
_e_config_save_job = ecore_job_add(_e_config_save_cb, NULL);
}
+char *
+e_config_profile_get(void)
+{
+ return _e_config_profile;
+}
+
+void e_config_profile_set(char *prof)
+{
+ IF_FREE(_e_config_profile);
+ _e_config_profile = strdup(prof);
+}
+
+Evas_List *
+e_config_profile_list(void)
+{
+ Ecore_List *files;
+ char buf[4096];
+ char *homedir;
+ Evas_List *flist = NULL;
+
+ homedir = e_user_homedir_get();
+ snprintf(buf, sizeof(buf), "%s/.e/e/config/", homedir);
+ files = ecore_file_ls(buf);
+ if (files)
+ {
+ char *file;
+
+ ecore_list_goto_first(files);
+ while ((file = ecore_list_current(files)))
+ {
+ snprintf(buf, sizeof(buf), "%s/.e/e/config/%s", homedir, file);
+ if (ecore_file_is_dir(buf))
+ flist = evas_list_append(flist, strdup(file));
+ ecore_list_next(files);
+ }
+ ecore_list_destroy(files);
+ }
+ E_FREE(homedir);
+ return flist;
+}
+
+void
+e_config_profile_add(char *prof)
+{
+ char buf[4096];
+ char *homedir;
+
+ homedir = e_user_homedir_get();
+ snprintf(buf, sizeof(buf), "%s/.e/e/config/%s",
+ homedir, prof);
+ ecore_file_mkpath(buf);
+ E_FREE(homedir);
+}
+
+void
+e_config_profile_del(char *prof)
+{
+ Ecore_List *files;
+ char buf[4096];
+ char *homedir;
+
+ homedir = e_user_homedir_get();
+ snprintf(buf, sizeof(buf), "%s/.e/e/config/%s", homedir, prof);
+ files = ecore_file_ls(buf);
+ if (files)
+ {
+ char *file;
+
+ ecore_list_goto_first(files);
+ while ((file = ecore_list_current(files)))
+ {
+ snprintf(buf, sizeof(buf), "%s/.e/e/config/%s/%s",
+ homedir, prof, file);
+ ecore_file_unlink(buf);
+ ecore_list_next(files);
+ }
+ ecore_list_destroy(files);
+ }
+ snprintf(buf, sizeof(buf), "%s/.e/e/config/%s", homedir, prof);
+ ecore_file_rmdir(buf);
+ E_FREE(homedir);
+}
+
+
void *
e_config_domain_load(char *domain, E_Config_DD *edd)
{
@@ -949,9 +1069,16 @@
void *data = NULL;
homedir = e_user_homedir_get();
- snprintf(buf, sizeof(buf), "%s/.e/e/config/%s.cfg", homedir, domain);
- E_FREE(homedir);
+ snprintf(buf, sizeof(buf), "%s/.e/e/config/%s/%s.cfg",
+ homedir, _e_config_profile, domain);
ef = eet_open(buf, EET_FILE_MODE_READ);
+ if (!ef)
+ {
+ snprintf(buf, sizeof(buf), "%s/.e/e/config/%s/%s.cfg",
+ homedir, "default", domain);
+ ef = eet_open(buf, EET_FILE_MODE_READ);
+ }
+ E_FREE(homedir);
if (ef)
{
data = eet_data_read(ef, edd, "config");
@@ -970,7 +1097,20 @@
/* FIXME: check for other sessions fo E runing */
homedir = e_user_homedir_get();
- snprintf(buf, sizeof(buf), "%s/.e/e/config/%s.cfg", homedir, domain);
+ snprintf(buf, sizeof(buf), "%s/.e/e/config/profile.cfg",
+ homedir);
+ ef = eet_open(buf, EET_FILE_MODE_WRITE);
+ if (ef)
+ {
+ ok = eet_write(ef, "config", _e_config_profile,
+ strlen(_e_config_profile), 0);
+ eet_close(ef);
+ }
+ snprintf(buf, sizeof(buf), "%s/.e/e/config/%s",
+ homedir, _e_config_profile);
+ ecore_file_mkpath(buf);
+ snprintf(buf, sizeof(buf), "%s/.e/e/config/%s/%s.cfg",
+ homedir, _e_config_profile, domain);
E_FREE(homedir);
ef = eet_open(buf, EET_FILE_MODE_WRITE);
if (ef)
@@ -1163,6 +1303,10 @@
E_FREE(e_config->desktop_default_background);
E_FREE(e_config->language);
+ E_FREE(e_config->transition_start);
+ E_FREE(e_config->transition_desk);
+ E_FREE(e_config->transition_change);
+ /* FIXME: free e_config->remembers */
E_FREE(e_config);
}
}
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_config.h,v
retrieving revision 1.41
retrieving revision 1.42
diff -u -3 -r1.41 -r1.42
--- e_config.h 12 Jul 2005 11:07:57 -0000 1.41
+++ e_config.h 22 Jul 2005 10:28:09 -0000 1.42
@@ -185,13 +185,19 @@
EAPI int e_config_init(void);
EAPI int e_config_shutdown(void);
-EAPI void *e_config_domain_load(char *domain, E_Config_DD *edd);
-EAPI int e_config_domain_save(char *domain, E_Config_DD *edd, void *data);
-
EAPI int e_config_save(void);
EAPI void e_config_save_flush(void);
EAPI void e_config_save_queue(void);
+EAPI char *e_config_profile_get(void);
+EAPI void e_config_profile_set(char *prof);
+EAPI Evas_List *e_config_profile_list(void);
+EAPI void e_config_profile_add(char *prof);
+EAPI void e_config_profile_del(char *prof);
+
+EAPI void *e_config_domain_load(char *domain, E_Config_DD *edd);
+EAPI int e_config_domain_save(char *domain, E_Config_DD *edd, void *data);
+
EAPI E_Config_Binding_Mouse
*e_config_binding_mouse_match(E_Config_Binding_Mouse *eb_in);
EAPI E_Config_Binding_Key *e_config_binding_key_match(E_Config_Binding_Key
*eb_in);
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_container.c,v
retrieving revision 1.72
retrieving revision 1.73
diff -u -3 -r1.72 -r1.73
--- e_container.c 2 Jul 2005 05:22:58 -0000 1.72
+++ e_container.c 22 Jul 2005 10:28:09 -0000 1.73
@@ -764,12 +764,12 @@
e_object_ref(E_OBJECT(con));
list->layer = 6;
if (list->container->layers[list->layer].clients)
- list->clients = list->container->layers[list->layer].clients->last;
+ list->clients =
evas_list_last(list->container->layers[list->layer].clients);
while ((list->layer > 0) && (!list->clients))
{
list->layer--;
if (list->container->layers[list->layer].clients)
- list->clients = list->container->layers[list->layer].clients->last;
+ list->clients =
evas_list_last(list->container->layers[list->layer].clients);
}
return list;
}
@@ -803,7 +803,7 @@
{
list->layer--;
if (list->container->layers[list->layer].clients)
- list->clients = list->container->layers[list->layer].clients->last;
+ list->clients =
evas_list_last(list->container->layers[list->layer].clients);
}
return bd;
}
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_hints.c,v
retrieving revision 1.60
retrieving revision 1.61
diff -u -3 -r1.60 -r1.61
--- e_hints.c 21 Jul 2005 12:07:11 -0000 1.60
+++ e_hints.c 22 Jul 2005 10:28:09 -0000 1.61
@@ -32,8 +32,8 @@
* depending on what wm it thinks there is... so if we pretend to be Kwin...
* it tries to use kde preferences, if found.
*/
-/* I have disabled tyhis now by pretending to be E16 with e16 comms. this
- * means java plays nice and uses our FRAMe property.. but we had to do other
+/* I have disabled this now by pretending to be E16 with e16 comms. this
+ * means java plays nice and uses our FRAME property.. but we had to do other
* evil stuff as java EXPECTS all this at REPARENT time... i've deferred
* reparenting... i hate java!
*/
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_ipc_handlers.h,v
retrieving revision 1.57
retrieving revision 1.58
diff -u -3 -r1.57 -r1.58
--- e_ipc_handlers.h 19 Jul 2005 07:07:15 -0000 1.57
+++ e_ipc_handlers.h 22 Jul 2005 10:28:09 -0000 1.58
@@ -4381,6 +4381,44 @@
/****************************************************************************/
+/****************************************************************************/
+#define HDL E_IPC_OP_PROFILE_SET
+#if (TYPE == E_REMOTE_OPTIONS)
+ OP("-default-profile-set", 1, "Set the default configuration profile to
OPT1", 0, HDL)
+#elif (TYPE == E_REMOTE_OUT)
+ REQ_STRING(params[0], HDL);
+#elif (TYPE == E_WM_IN)
+ STRING(s, HDL);
+ e_config_profile_set(s);
+ SAVE;
+ END_STRING(s);
+#elif (TYPE == E_REMOTE_IN)
+#endif
+#undef HDL
+
+/****************************************************************************/
+#define HDL E_IPC_OP_PROFILE_GET
+#if (TYPE == E_REMOTE_OPTIONS)
+ OP("-default-profile-get", 0, "Get the default configuration profile", 1,
HDL)
+#elif (TYPE == E_REMOTE_OUT)
+ REQ_NULL(HDL);
+#elif (TYPE == E_WM_IN)
+ SEND_STRING(e_config_profile_get(), E_IPC_OP_PROFILE_GET_REPLY, HDL);
+#elif (TYPE == E_REMOTE_IN)
+#endif
+#undef HDL
+
+/****************************************************************************/
+#define HDL E_IPC_OP_PROFILE_GET_REPLY
+#if (TYPE == E_REMOTE_OPTIONS)
+#elif (TYPE == E_REMOTE_OUT)
+#elif (TYPE == E_WM_IN)
+#elif (TYPE == E_REMOTE_IN)
+ STRING(s, HDL);
+ printf("REPLY: \"%s\"\n", s);
+ END_STRING(s);
+#endif
+#undef HDL
#if 0
}
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_ipc_handlers_list.h,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -3 -r1.13 -r1.14
--- e_ipc_handlers_list.h 12 Jul 2005 15:22:43 -0000 1.13
+++ e_ipc_handlers_list.h 22 Jul 2005 10:28:09 -0000 1.14
@@ -215,3 +215,6 @@
#define E_IPC_OP_FOCUS_REVERT_ON_HIDE_OR_CLOSE_SET 215
#define E_IPC_OP_FOCUS_REVERT_ON_HIDE_OR_CLOSE_GET 216
#define E_IPC_OP_FOCUS_REVERT_ON_HIDE_OR_CLOSE_GET_REPLY 217
+#define E_IPC_OP_PROFILE_SET 218
+#define E_IPC_OP_PROFILE_GET 219
+#define E_IPC_OP_PROFILE_GET_REPLY 220
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_main.c,v
retrieving revision 1.112
retrieving revision 1.113
diff -u -3 -r1.112 -r1.113
--- e_main.c 12 Jul 2005 17:37:28 -0000 1.112
+++ e_main.c 22 Jul 2005 10:28:09 -0000 1.113
@@ -157,6 +157,12 @@
good = 1;
evil = 1;
}
+ else if ((!strcmp(argv[i], "-profile")) && (i < (argc - 1)))
+ {
+ i++;
+
+ e_util_env_set("CONF_PROFILE", argv[i]);
+ }
else if ((!strcmp(argv[i], "-h")) ||
(!strcmp(argv[i], "-help")) ||
(!strcmp(argv[i], "--help")))
@@ -173,6 +179,8 @@
"\t\treplace the real xinerama screens, if any. This can\n"
"\t\tbe used to simulate xinerama.\n"
"\t\tEG: -fake-xinerama-screen 800x600+0+0
-fake-xinerama-screen 800x600+800+0\n"
+ "\t-profile CONF_PROFILE\n"
+ "\t\tUse the configuration profile CONF_PROFILE instead of
the the user delected default ot just \"default\".\n"
"\t-good\n"
"\t\tBe good.\n"
"\t-evil\n"
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_menu.c,v
retrieving revision 1.36
retrieving revision 1.37
diff -u -3 -r1.36 -r1.37
--- e_menu.c 27 Jun 2005 10:08:53 -0000 1.36
+++ e_menu.c 22 Jul 2005 10:28:09 -0000 1.37
@@ -1776,7 +1776,7 @@
}
else
{
- ll = m->items->last;
+ ll = evas_list_last(m->items);
mi = ll->data;
while ((mi->separator) && (ll->prev))
{
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_test.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -3 -r1.8 -r1.9
--- e_test.c 13 Jul 2005 04:32:52 -0000 1.8
+++ e_test.c 22 Jul 2005 10:28:10 -0000 1.9
@@ -182,7 +182,7 @@
{
e_menu_deactivate(m);
e_object_del(E_OBJECT(m));
- ecore_timer_add(0.2, _e_test_timer, NULL);
+ ecore_timer_add(0.05, _e_test_timer, NULL);
return 0;
}
managers = e_manager_list();
@@ -195,7 +195,7 @@
e_menu_activate_mouse(m,
e_container_zone_number_get(e_container_current_get(man), 0),
0, 0, 1, 1, E_MENU_POP_DIRECTION_DOWN);
- ecore_timer_add(0.2, _e_test_timer, m);
+ ecore_timer_add(0.05, _e_test_timer, m);
return 0;
}
return 0;
@@ -248,6 +248,40 @@
win->data = o;
}
+#elif 0
+static int
+_e_test_timer(void *data)
+{
+ E_Menu *m;
+ static int y = 0;
+
+ m = data;
+ ecore_x_pointer_warp(m->evas_win, 20, y);
+ y += 10;
+ if (y > m->cur.h) y = 0;
+ return 1;
+}
+
+static void
+_e_test_internal(E_Container *con)
+{
+ E_Menu *m;
+ Evas_List *managers, *l;
+
+ managers = e_manager_list();
+ for (l = managers; l; l = l->next)
+ {
+ E_Manager *man;
+
+ man = l->data;
+ m = e_int_menus_main_new();
+ e_menu_activate_mouse(m,
+
e_container_zone_number_get(e_container_current_get(man), 0),
+ 0, 0, 1, 1, E_MENU_POP_DIRECTION_DOWN);
+ ecore_timer_add(0.02, _e_test_timer, m);
+ }
+}
+#elif 0
#else
static void
_e_test_internal(E_Container *con)
-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
_______________________________________________
enlightenment-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs