Hello,
I have done some work on exporting all of the paths through IPC.
These are the current paths.
E_Path *path_data = NULL;
E_Path *path_images = NULL;
E_Path *path_fonts = NULL;
E_Path *path_themes = NULL;
E_Path *path_init = NULL;
E_Path *path_icons = NULL;
E_Path *path_modules = NULL;
Implementation:
The search path is now implemented by using two evas lists, one for
hardcoded directories and one for user directories. The user
directories are stored in e_config and can be manipulated through IPC
(enlightenment_remote). The user directory of an E_Path is a reference
to the path in e_config and should be associated while initializing a
new E_Path.
example commands:
-theme-dirs-list
-theme-dirs-remove <OP>
-theme-dirs-append <OP>
-theme-dirs-prepend <OP>
[EMAIL PROTECTED] bin]$ enlightenment_remote -display :0.0 -theme-dirs-list
REPLY: BEGIN
REPLY: THEME DIR="/home/shorne/.e/e/themes"
REPLY: THEME DIR="/home/shorne/.e/e/backgrounds"
REPLY: THEME DIR="/home/shorne/local/share/enlightenment/data/themes"
REPLY: END
[EMAIL PROTECTED] bin]$ enlightenment_remote -display :0.0 -theme-dirs-append
~/misc/Pictures/
[EMAIL PROTECTED] bin]$ enlightenment_remote -display :0.0 -theme-dirs-list
REPLY: BEGIN
REPLY: THEME DIR="/home/shorne/.e/e/themes"
REPLY: THEME DIR="/home/shorne/.e/e/backgrounds"
REPLY: THEME DIR="/home/shorne/local/share/enlightenment/data/themes"
REPLY: THEME DIR="/home/shorne/misc/Pictures/"
REPLY: END
Notes:
I have gotten rid of the -bg-dirs-list, the background dirs are now part
of the theme dirs. The good thing is this does not break libe things
like emblem.
Stafford
--
? e_path_config.diff
Index: e.h
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e.h,v
retrieving revision 1.16
diff -u -r1.16 e.h
--- e.h 12 May 2005 14:46:28 -0000 1.16
+++ e.h 15 May 2005 06:42:34 -0000
@@ -94,6 +94,7 @@
extern EAPI E_Path *path_themes;
extern EAPI E_Path *path_icons;
extern EAPI E_Path *path_init;
+extern EAPI E_Path *path_modules;
extern EAPI int restart;
#endif
Index: e_config.c
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_config.c,v
retrieving revision 1.48
diff -u -r1.48 e_config.c
--- e_config.c 13 May 2005 17:21:04 -0000 1.48
+++ e_config.c 15 May 2005 06:42:36 -0000
@@ -31,11 +31,19 @@
static E_Config_DD *_e_config_theme_edd = NULL;
static E_Config_DD *_e_config_bindings_mouse_edd = NULL;
static E_Config_DD *_e_config_bindings_key_edd = NULL;
+static E_Config_DD *_e_config_path_append_edd = NULL;
/* externally accessible functions */
int
e_config_init(void)
{
+ _e_config_path_append_edd = E_CONFIG_DD_NEW("E_Path_Dir", E_Path_Dir);
+#undef T
+#undef D
+#define T E_Path_Dir
+#define D _e_config_path_append_edd
+ E_CONFIG_VAL(D, T, dir, STR);
+
_e_config_theme_edd = E_CONFIG_DD_NEW("E_Config_Theme", E_Config_Theme);
#undef T
#undef D
@@ -123,6 +131,13 @@
E_CONFIG_LIST(D, T, themes, _e_config_theme_edd); /**/
E_CONFIG_LIST(D, T, mouse_bindings, _e_config_bindings_mouse_edd); /**/
E_CONFIG_LIST(D, T, key_bindings, _e_config_bindings_key_edd); /**/
+ E_CONFIG_LIST(D, T, path_append_data, _e_config_path_append_edd); /**/
+ E_CONFIG_LIST(D, T, path_append_images, _e_config_path_append_edd); /**/
+ E_CONFIG_LIST(D, T, path_append_fonts, _e_config_path_append_edd); /**/
+ E_CONFIG_LIST(D, T, path_append_themes, _e_config_path_append_edd); /**/
+ E_CONFIG_LIST(D, T, path_append_init, _e_config_path_append_edd); /**/
+ E_CONFIG_LIST(D, T, path_append_icons, _e_config_path_append_edd); /**/
+ E_CONFIG_LIST(D, T, path_append_modules, _e_config_path_append_edd); /**/
e_config = e_config_domain_load("e", _e_config_edd);
if (e_config)
@@ -862,6 +877,62 @@
E_FREE(eb->params);
E_FREE(eb);
}
+ while (e_config->path_append_data)
+ {
+ E_Path_Dir *epd;
+ epd = e_config->path_append_data->data;
+ e_config->path_append_data = evas_list_remove_list(e_config->path_append_data, e_config->path_append_data);
+ E_FREE(epd->dir);
+ E_FREE(epd);
+ }
+ while (e_config->path_append_images)
+ {
+ E_Path_Dir *epd;
+ epd = e_config->path_append_images->data;
+ e_config->path_append_images = evas_list_remove_list(e_config->path_append_images, e_config->path_append_images);
+ E_FREE(epd->dir);
+ E_FREE(epd);
+ }
+while (e_config->path_append_fonts)
+ {
+ E_Path_Dir *epd;
+ epd = e_config->path_append_fonts->data;
+ e_config->path_append_fonts = evas_list_remove_list(e_config->path_append_fonts, e_config->path_append_fonts);
+ E_FREE(epd->dir);
+ E_FREE(epd);
+ }
+while (e_config->path_append_themes)
+ {
+ E_Path_Dir *epd;
+ epd = e_config->path_append_themes->data;
+ e_config->path_append_themes = evas_list_remove_list(e_config->path_append_themes, e_config->path_append_themes);
+ E_FREE(epd->dir);
+ E_FREE(epd);
+ }
+while (e_config->path_append_init)
+ {
+ E_Path_Dir *epd;
+ epd = e_config->path_append_init->data;
+ e_config->path_append_init = evas_list_remove_list(e_config->path_append_init, e_config->path_append_init);
+ E_FREE(epd->dir);
+ E_FREE(epd);
+ }
+while (e_config->path_append_icons)
+ {
+ E_Path_Dir *epd;
+ epd = e_config->path_append_icons->data;
+ e_config->path_append_icons = evas_list_remove_list(e_config->path_append_icons, e_config->path_append_icons);
+ E_FREE(epd->dir);
+ E_FREE(epd);
+ }
+while (e_config->path_append_modules)
+ {
+ E_Path_Dir *epd;
+ epd = e_config->path_append_modules->data;
+ e_config->path_append_modules = evas_list_remove_list(e_config->path_append_modules, e_config->path_append_modules);
+ E_FREE(epd->dir);
+ E_FREE(epd);
+ }
E_FREE(e_config->desktop_default_background);
E_FREE(e_config->language);
Index: e_config.h
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_config.h,v
retrieving revision 1.22
diff -u -r1.22 e_config.h
--- e_config.h 12 May 2005 09:28:58 -0000 1.22
+++ e_config.h 15 May 2005 06:42:36 -0000
@@ -46,7 +46,7 @@
* defaults for e to work - started at 100 when we introduced this config
* versioning feature
*/
-#define E_CONFIG_FILE_VERSION 103
+#define E_CONFIG_FILE_VERSION 104
#define E_EVAS_ENGINE_DEFAULT 0
#define E_EVAS_ENGINE_SOFTWARE_X11 1
@@ -85,6 +85,14 @@
Evas_List *themes;
Evas_List *mouse_bindings;
Evas_List *key_bindings;
+ Evas_List *path_append_data;
+ Evas_List *path_append_images;
+ Evas_List *path_append_fonts;
+ Evas_List *path_append_themes;
+ Evas_List *path_append_init;
+ Evas_List *path_append_icons;
+ Evas_List *path_append_modules;
+
};
struct _E_Config_Module
Index: e_font.c
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_font.c,v
retrieving revision 1.8
diff -u -r1.8 e_font.c
--- e_font.c 29 Apr 2005 19:42:18 -0000 1.8
+++ e_font.c 15 May 2005 06:42:36 -0000
@@ -83,12 +83,19 @@
Evas_List *
e_font_available_list(void)
{
- Evas_List *available;
-
+ Evas_List *dir_list;
+ Evas_List *next;
+ Evas_List *available;
+
+ dir_list = e_path_dir_list_get(path_fonts);
available = NULL;
- /* use e_path for this */
- available = _e_font_font_dir_available_get(available, "~/.e/e/fonts");
- available = _e_font_font_dir_available_get(available, PACKAGE_DATA_DIR "/data/fonts");
+ for ( next = dir_list; next; next = next->next)
+ {
+ E_Path_Dir *epd = next->data;
+ available = _e_font_font_dir_available_get(available, epd->dir);
+ }
+
+ e_path_dir_list_free(dir_list);
return available;
}
Index: e_ipc.c
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_ipc.c,v
retrieving revision 1.25
diff -u -r1.25 e_ipc.c
--- e_ipc.c 13 May 2005 17:21:04 -0000 1.25
+++ e_ipc.c 15 May 2005 06:42:36 -0000
@@ -7,7 +7,6 @@
static void _e_ipc_reply_double_send(Ecore_Ipc_Client *client, double val, int opcode);
static void _e_ipc_reply_int_send(Ecore_Ipc_Client *client, int val, int opcode);
static void _e_ipc_reply_2int_send(Ecore_Ipc_Client *client, int val1, int val2, int opcode);
-static char *_e_ipc_path_str_get(char **paths, int *bytes);
static char *_e_ipc_str_list_get(Evas_List *strs, int *bytes);
static char *_e_ipc_simple_str_dec(char *data, int bytes);
static char **_e_ipc_multi_str_dec(char *data, int bytes, int str_count);
@@ -27,6 +26,7 @@
ECORE_IPC_ENC_EVAS_LIST_PROTO(_e_ipc_key_binding_list_enc);
ECORE_IPC_ENC_STRUCT_PROTO(_e_ipc_key_binding_enc);
ECORE_IPC_DEC_STRUCT_PROTO(_e_ipc_key_binding_dec);
+ECORE_IPC_ENC_EVAS_LIST_PROTO(_e_ipc_path_list_enc);
/* local subsystem globals */
static Ecore_Ipc_Server *_e_ipc_server = NULL;
@@ -180,26 +180,6 @@
free(data);
}
break;
- case E_IPC_OP_MODULE_DIRS_LIST:
- {
- char *dirs[] = {
- PACKAGE_LIB_DIR"/enlightenment/modules",
- PACKAGE_LIB_DIR"/enlightenment/modules_extra",
- "~/.e/e/modules",
- NULL
- };
- char *data;
- int bytes = 0;
-
- data = _e_ipc_path_str_get(dirs, &bytes);
- ecore_ipc_client_send(e->client,
- E_IPC_DOMAIN_REPLY,
- E_IPC_OP_MODULE_DIRS_LIST_REPLY,
- 0/*ref*/, 0/*ref_to*/, 0/*response*/,
- data, bytes);
- free(data);
- }
- break;
case E_IPC_OP_BG_SET:
{
char *file;
@@ -390,26 +370,6 @@
}
break;
- case E_IPC_OP_BG_DIRS_LIST:
- {
- char *dirs[] = {
- PACKAGE_DATA_DIR"/data/themes",
- "~/.e/e/backgrounds",
- "~/.e/e/themes",
- NULL
- };
- char *data;
- int bytes = 0;
-
- data = _e_ipc_path_str_get(dirs, &bytes);
- ecore_ipc_client_send(e->client,
- E_IPC_DOMAIN_REPLY,
- E_IPC_OP_BG_DIRS_LIST_REPLY,
- 0/*ref*/, 0/*ref_to*/, 0/*response*/,
- data, bytes);
- free(data);
- }
- break;
case E_IPC_OP_RESTART:
{
restart = 1;
@@ -775,6 +735,378 @@
e_config->zone_desks_y_count,
E_IPC_OP_DESKS_GET_REPLY);
break;
+
+ /* Module PATH IPC */
+ case E_IPC_OP_MODULE_DIRS_LIST:
+ {
+ Evas_List *dir_list;
+ char *data;
+ int bytes = 0;
+
+ dir_list = e_path_dir_list_get(path_modules);
+ data = _e_ipc_path_list_enc(dir_list, &bytes);
+ ecore_ipc_client_send(e->client,
+ E_IPC_DOMAIN_REPLY,
+ E_IPC_OP_MODULE_DIRS_LIST_REPLY,
+ 0/*ref*/, 0/*ref_to*/, 0/*response*/,
+ data, bytes);
+
+ e_path_dir_list_free(dir_list);
+ free(data);
+ break;
+ }
+ case E_IPC_OP_MODULE_DIRS_APPEND:
+ {
+ char * dir;
+
+ dir = _e_ipc_simple_str_dec(e->data, e->size);
+ e_path_user_path_append(path_modules, dir);
+
+ free(dir);
+ e_config_save_queue();
+ break;
+ }
+ case E_IPC_OP_MODULE_DIRS_PREPEND:
+ {
+ char * dir;
+
+ dir = _e_ipc_simple_str_dec(e->data, e->size);
+ e_path_user_path_prepend(path_modules, dir);
+
+ free(dir);
+ e_config_save_queue();
+ break;
+ }
+ case E_IPC_OP_MODULE_DIRS_REMOVE:
+ {
+ char * dir;
+
+ dir = _e_ipc_simple_str_dec(e->data, e->size);
+ e_path_user_path_remove(path_modules, dir);
+
+ free(dir);
+ e_config_save_queue();
+ break;
+ }
+
+ /* Theme PATH IPC */
+ case E_IPC_OP_THEME_DIRS_LIST:
+ {
+ Evas_List *dir_list;
+ char *data;
+ int bytes = 0;
+
+ dir_list = e_path_dir_list_get(path_themes);
+ data = _e_ipc_path_list_enc(dir_list, &bytes);
+ ecore_ipc_client_send(e->client,
+ E_IPC_DOMAIN_REPLY,
+ E_IPC_OP_THEME_DIRS_LIST_REPLY,
+ 0/*ref*/, 0/*ref_to*/, 0/*response*/,
+ data, bytes);
+
+ e_path_dir_list_free(dir_list);
+ free(data);
+ break;
+ }
+ case E_IPC_OP_THEME_DIRS_APPEND:
+ {
+ char * dir;
+
+ dir = _e_ipc_simple_str_dec(e->data, e->size);
+ e_path_user_path_append(path_themes, dir);
+
+ free(dir);
+ e_config_save_queue();
+ break;
+ }
+ case E_IPC_OP_THEME_DIRS_PREPEND:
+ {
+ char * dir;
+
+ dir = _e_ipc_simple_str_dec(e->data, e->size);
+ e_path_user_path_prepend(path_themes, dir);
+
+ free(dir);
+ e_config_save_queue();
+ break;
+ }
+ case E_IPC_OP_THEME_DIRS_REMOVE:
+ {
+ char * dir;
+
+ dir = _e_ipc_simple_str_dec(e->data, e->size);
+ e_path_user_path_remove(path_themes, dir);
+
+ free(dir);
+ e_config_save_queue();
+ break;
+ }
+
+ /* Font Path IPC */
+ case E_IPC_OP_FONT_DIRS_LIST:
+ {
+ Evas_List *dir_list;
+ char *data;
+ int bytes = 0;
+
+ dir_list = e_path_dir_list_get(path_fonts);
+ data = _e_ipc_path_list_enc(dir_list, &bytes);
+ ecore_ipc_client_send(e->client,
+ E_IPC_DOMAIN_REPLY,
+ E_IPC_OP_FONT_DIRS_LIST_REPLY,
+ 0/*ref*/, 0/*ref_to*/, 0/*response*/,
+ data, bytes);
+
+ e_path_dir_list_free(dir_list);
+ free(data);
+ break;
+ }
+ case E_IPC_OP_FONT_DIRS_APPEND:
+ {
+ char * dir;
+
+ dir = _e_ipc_simple_str_dec(e->data, e->size);
+ e_path_user_path_append(path_fonts, dir);
+
+ free(dir);
+ e_config_save_queue();
+ break;
+ }
+ case E_IPC_OP_FONT_DIRS_PREPEND:
+ {
+ char * dir;
+
+ dir = _e_ipc_simple_str_dec(e->data, e->size);
+ e_path_user_path_prepend(path_fonts, dir);
+
+ free(dir);
+ e_config_save_queue();
+ break;
+ }
+ case E_IPC_OP_FONT_DIRS_REMOVE:
+ {
+ char * dir;
+
+ dir = _e_ipc_simple_str_dec(e->data, e->size);
+ e_path_user_path_remove(path_fonts, dir);
+
+ free(dir);
+ e_config_save_queue();
+ break;
+ }
+
+ /* data Path IPC */
+ case E_IPC_OP_DATA_DIRS_LIST:
+ {
+ Evas_List *dir_list;
+ char *data;
+ int bytes = 0;
+
+ dir_list = e_path_dir_list_get(path_data);
+ data = _e_ipc_path_list_enc(dir_list, &bytes);
+ ecore_ipc_client_send(e->client,
+ E_IPC_DOMAIN_REPLY,
+ E_IPC_OP_DATA_DIRS_LIST_REPLY,
+ 0/*ref*/, 0/*ref_to*/, 0/*response*/,
+ data, bytes);
+
+ e_path_dir_list_free(dir_list);
+ free(data);
+ break;
+ }
+ case E_IPC_OP_DATA_DIRS_APPEND:
+ {
+ char * dir;
+
+ dir = _e_ipc_simple_str_dec(e->data, e->size);
+ e_path_user_path_append(path_data, dir);
+
+ free(dir);
+ e_config_save_queue();
+ break;
+ }
+ case E_IPC_OP_DATA_DIRS_PREPEND:
+ {
+ char * dir;
+
+ dir = _e_ipc_simple_str_dec(e->data, e->size);
+ e_path_user_path_prepend(path_data, dir);
+
+ free(dir);
+ e_config_save_queue();
+ break;
+ }
+ case E_IPC_OP_DATA_DIRS_REMOVE:
+ {
+ char * dir;
+
+ dir = _e_ipc_simple_str_dec(e->data, e->size);
+ e_path_user_path_remove(path_data, dir);
+
+ free(dir);
+ e_config_save_queue();
+ break;
+ }
+
+ /* Images Path IPC */
+ case E_IPC_OP_IMAGE_DIRS_LIST:
+ {
+ Evas_List *dir_list;
+ char *data;
+ int bytes = 0;
+
+ dir_list = e_path_dir_list_get(path_images);
+ data = _e_ipc_path_list_enc(dir_list, &bytes);
+ ecore_ipc_client_send(e->client,
+ E_IPC_DOMAIN_REPLY,
+ E_IPC_OP_IMAGE_DIRS_LIST_REPLY,
+ 0/*ref*/, 0/*ref_to*/, 0/*response*/,
+ data, bytes);
+
+ e_path_dir_list_free(dir_list);
+ free(data);
+ break;
+ }
+ case E_IPC_OP_IMAGE_DIRS_APPEND:
+ {
+ char * dir;
+
+ dir = _e_ipc_simple_str_dec(e->data, e->size);
+ e_path_user_path_append(path_images, dir);
+
+ free(dir);
+ e_config_save_queue();
+ break;
+ }
+ case E_IPC_OP_IMAGE_DIRS_PREPEND:
+ {
+ char * dir;
+
+ dir = _e_ipc_simple_str_dec(e->data, e->size);
+ e_path_user_path_prepend(path_images, dir);
+
+ free(dir);
+ e_config_save_queue();
+ break;
+ }
+ case E_IPC_OP_IMAGE_DIRS_REMOVE:
+ {
+ char * dir;
+
+ dir = _e_ipc_simple_str_dec(e->data, e->size);
+ e_path_user_path_remove(path_images, dir);
+
+ free(dir);
+ e_config_save_queue();
+ break;
+ }
+
+ /* Init Path IPC */
+ case E_IPC_OP_INIT_DIRS_LIST:
+ {
+ Evas_List *dir_list;
+ char *data;
+ int bytes = 0;
+
+ dir_list = e_path_dir_list_get(path_init);
+ data = _e_ipc_path_list_enc(dir_list, &bytes);
+ ecore_ipc_client_send(e->client,
+ E_IPC_DOMAIN_REPLY,
+ E_IPC_OP_INIT_DIRS_LIST_REPLY,
+ 0/*ref*/, 0/*ref_to*/, 0/*response*/,
+ data, bytes);
+
+ e_path_dir_list_free(dir_list);
+ free(data);
+ break;
+ }
+ case E_IPC_OP_INIT_DIRS_APPEND:
+ {
+ char * dir;
+
+ dir = _e_ipc_simple_str_dec(e->data, e->size);
+ e_path_user_path_append(path_init, dir);
+
+ free(dir);
+ e_config_save_queue();
+ break;
+ }
+ case E_IPC_OP_INIT_DIRS_PREPEND:
+ {
+ char * dir;
+
+ dir = _e_ipc_simple_str_dec(e->data, e->size);
+ e_path_user_path_prepend(path_init, dir);
+
+ free(dir);
+ e_config_save_queue();
+ break;
+ }
+ case E_IPC_OP_INIT_DIRS_REMOVE:
+ {
+ char * dir;
+
+ dir = _e_ipc_simple_str_dec(e->data, e->size);
+ e_path_user_path_remove(path_init, dir);
+
+ free(dir);
+ e_config_save_queue();
+ break;
+ }
+
+ /* Icon Path IPC */
+ case E_IPC_OP_ICON_DIRS_LIST:
+ {
+ Evas_List *dir_list;
+ char *data;
+ int bytes = 0;
+
+ dir_list = e_path_dir_list_get(path_icons);
+ data = _e_ipc_path_list_enc(dir_list, &bytes);
+ ecore_ipc_client_send(e->client,
+ E_IPC_DOMAIN_REPLY,
+ E_IPC_OP_ICON_DIRS_LIST_REPLY,
+ 0/*ref*/, 0/*ref_to*/, 0/*response*/,
+ data, bytes);
+
+ e_path_dir_list_free(dir_list);
+ free(data);
+ break;
+ }
+ case E_IPC_OP_ICON_DIRS_APPEND:
+ {
+ char * dir;
+
+ dir = _e_ipc_simple_str_dec(e->data, e->size);
+ e_path_user_path_append(path_icons, dir);
+
+ free(dir);
+ e_config_save_queue();
+ break;
+ }
+ case E_IPC_OP_ICON_DIRS_PREPEND:
+ {
+ char * dir;
+
+ dir = _e_ipc_simple_str_dec(e->data, e->size);
+ e_path_user_path_prepend(path_icons, dir);
+
+ free(dir);
+ e_config_save_queue();
+ break;
+ }
+ case E_IPC_OP_ICON_DIRS_REMOVE:
+ {
+ char * dir;
+
+ dir = _e_ipc_simple_str_dec(e->data, e->size);
+ e_path_user_path_remove(path_icons, dir);
+
+ free(dir);
+ e_config_save_queue();
+ break;
+ }
+
default:
break;
}
@@ -838,39 +1170,6 @@
}
}
-/*
- * FIXME: This dosen't handle the case where one of the paths is of the
- * form: ~moo/bar/baz need to figure out the correct path to the
- * specified users homedir
- */
-static char *
-_e_ipc_path_str_get(char **paths, int *bytes)
-{
- char *data = NULL, **cur, *home;
- int pos = 0;
- char tmp[PATH_MAX];
-
- *bytes = 0;
- home = e_user_homedir_get();
- for (cur = paths; *cur != NULL; cur++)
- {
- char *p;
-
- p = *cur;
- if (*p == '~') snprintf(tmp, PATH_MAX, "%s%s", home, ++p);
- else snprintf(tmp, PATH_MAX, "%s", p);
-
- *bytes += strlen(tmp) + 1;
- data = realloc(data, *bytes);
-
- memcpy(data + pos, tmp, strlen(tmp));
- pos = *bytes;
- data[pos - 1] = 0;
- }
- free(home);
- return data;
-}
-
/**
* Encode a list of strings into a flattened data block that looks like
* <str>0<str>0... (ie string chars - nul byte in between until the end)
@@ -1126,3 +1425,13 @@
ECORE_IPC_DEC_STRUCT_FOOT();
}
+ECORE_IPC_ENC_EVAS_LIST_PROTO(_e_ipc_path_list_enc)
+{
+ ECORE_IPC_ENC_EVAS_LIST_HEAD_START(E_Path_Dir);
+ ECORE_IPC_CNTS(dir);
+ ECORE_IPC_ENC_EVAS_LIST_HEAD_FINISH();
+ int l1;
+ ECORE_IPC_SLEN(l1, dir);
+ ECORE_IPC_PUTS(dir, l1);
+ ECORE_IPC_ENC_EVAS_LIST_FOOT();
+}
Index: e_ipc.h
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_ipc.h,v
retrieving revision 1.16
diff -u -r1.16 e_ipc.h
--- e_ipc.h 13 May 2005 17:21:04 -0000 1.16
+++ e_ipc.h 15 May 2005 06:42:36 -0000
@@ -22,13 +22,10 @@
E_IPC_OP_MODULE_DISABLE,
E_IPC_OP_MODULE_LIST,
E_IPC_OP_MODULE_LIST_REPLY,
- E_IPC_OP_MODULE_DIRS_LIST,
- E_IPC_OP_MODULE_DIRS_LIST_REPLY,
E_IPC_OP_BG_SET,
E_IPC_OP_BG_GET,
E_IPC_OP_BG_GET_REPLY,
- E_IPC_OP_BG_DIRS_LIST,
- E_IPC_OP_BG_DIRS_LIST_REPLY,
+
E_IPC_OP_FONT_AVAILABLE_LIST,
E_IPC_OP_FONT_AVAILABLE_LIST_REPLY,
E_IPC_OP_FONT_APPLY,
@@ -92,14 +89,62 @@
E_IPC_OP_EDGE_FLIP_TIMEOUT_SET,
E_IPC_OP_EDGE_FLIP_TIMEOUT_GET,
E_IPC_OP_EDGE_FLIP_TIMEOUT_GET_REPLY,
+
+ /* Module PATH IPC */
+ E_IPC_OP_MODULE_DIRS_LIST,
+ E_IPC_OP_MODULE_DIRS_LIST_REPLY,
+ E_IPC_OP_MODULE_DIRS_APPEND,
+ E_IPC_OP_MODULE_DIRS_PREPEND,
+ E_IPC_OP_MODULE_DIRS_REMOVE,
+
+ /* Theme PATH IPC */
+ E_IPC_OP_THEME_DIRS_LIST,
+ E_IPC_OP_THEME_DIRS_LIST_REPLY,
+ E_IPC_OP_THEME_DIRS_APPEND,
+ E_IPC_OP_THEME_DIRS_PREPEND,
+ E_IPC_OP_THEME_DIRS_REMOVE,
+
+ /* Font Path IPC */
+ E_IPC_OP_FONT_DIRS_LIST,
+ E_IPC_OP_FONT_DIRS_LIST_REPLY,
+ E_IPC_OP_FONT_DIRS_APPEND,
+ E_IPC_OP_FONT_DIRS_PREPEND,
+ E_IPC_OP_FONT_DIRS_REMOVE,
+
+ /* data Path IPC */
+ E_IPC_OP_DATA_DIRS_LIST,
+ E_IPC_OP_DATA_DIRS_LIST_REPLY,
+ E_IPC_OP_DATA_DIRS_APPEND,
+ E_IPC_OP_DATA_DIRS_PREPEND,
+ E_IPC_OP_DATA_DIRS_REMOVE,
+
+ /* Images Path IPC */
+ E_IPC_OP_IMAGE_DIRS_LIST,
+ E_IPC_OP_IMAGE_DIRS_LIST_REPLY,
+ E_IPC_OP_IMAGE_DIRS_APPEND,
+ E_IPC_OP_IMAGE_DIRS_PREPEND,
+ E_IPC_OP_IMAGE_DIRS_REMOVE,
+
+ /* Init Path IPC */
+ E_IPC_OP_INIT_DIRS_LIST,
+ E_IPC_OP_INIT_DIRS_LIST_REPLY,
+ E_IPC_OP_INIT_DIRS_APPEND,
+ E_IPC_OP_INIT_DIRS_PREPEND,
+ E_IPC_OP_INIT_DIRS_REMOVE,
+
+ /* Icon Path IPC */
+ E_IPC_OP_ICON_DIRS_LIST,
+ E_IPC_OP_ICON_DIRS_LIST_REPLY,
+ E_IPC_OP_ICON_DIRS_APPEND,
+ E_IPC_OP_ICON_DIRS_PREPEND,
+ E_IPC_OP_ICON_DIRS_REMOVE,
+
E_IPC_OP_DESKS_SET,
E_IPC_OP_DESKS_GET,
E_IPC_OP_DESKS_GET_REPLY,
E_IPC_OP_LAST
/* FIXME: add ipc: */
/* get list of actions */
- /* get list of paths */
- /* add/del extra paths */
} E_Ipc_Op;
#else
Index: e_main.c
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_main.c,v
retrieving revision 1.78
diff -u -r1.78 e_main.c
--- e_main.c 11 May 2005 21:33:54 -0000 1.78
+++ e_main.c 15 May 2005 06:42:37 -0000
@@ -33,6 +33,7 @@
E_Path *path_themes = NULL;
E_Path *path_init = NULL;
E_Path *path_icons = NULL;
+E_Path *path_modules = NULL;
int restart = 0;
int good = 0;
int evil = 0;
@@ -269,6 +270,13 @@
_e_main_shutdown(-1);
}
_e_main_shutdown_push(_e_main_dirs_shutdown);
+ /* init config system */
+ if (!e_config_init())
+ {
+ e_error_message_show(_("Enlightenment cannot set up its config system."));
+ _e_main_shutdown(-1);
+ }
+ _e_main_shutdown_push(e_config_shutdown);
/* setup paths for finding things */
if (!_e_main_path_init())
{
@@ -277,13 +285,6 @@
_e_main_shutdown(-1);
}
_e_main_shutdown_push(_e_main_path_shutdown);
- /* init config system */
- if (!e_config_init())
- {
- e_error_message_show(_("Enlightenment cannot set up its config system."));
- _e_main_shutdown(-1);
- }
- _e_main_shutdown_push(e_config_shutdown);
/* init actions system */
if (!e_actions_init())
{
@@ -667,53 +668,84 @@
static int
_e_main_path_init(void)
{
+ /* setup data paths */
path_data = e_path_new();
if (!path_data)
{
e_error_message_show("Cannot allocate path for path_data\n");
return 0;
}
- e_path_path_append(path_data, PACKAGE_DATA_DIR"/data");
+ e_path_default_path_append(path_data, PACKAGE_DATA_DIR"/data");
+ e_path_user_path_set(path_data, &(e_config->path_append_data));
+
+ /* setup image paths */
path_images = e_path_new();
if (!path_images)
{
e_error_message_show("Cannot allocate path for path_images\n");
return 0;
}
- e_path_path_append(path_images, "~/.e/e/images");
- e_path_path_append(path_images, PACKAGE_DATA_DIR"/data/images");
+ e_path_default_path_append(path_images, "~/.e/e/images");
+ e_path_default_path_append(path_images, PACKAGE_DATA_DIR"/data/images");
+ e_path_user_path_set(path_images, &(e_config->path_append_images));
+
+ /* setup font paths */
path_fonts = e_path_new();
if (!path_fonts)
{
e_error_message_show("Cannot allocate path for path_fonts\n");
return 0;
}
- e_path_path_append(path_fonts, "~/.e/e/fonts");
- e_path_path_append(path_fonts, PACKAGE_DATA_DIR"/data/fonts");
+ e_path_default_path_append(path_fonts, "~/.e/e/fonts");
+ e_path_default_path_append(path_fonts, PACKAGE_DATA_DIR"/data/fonts");
+ e_path_user_path_set(path_fonts, &(e_config->path_append_fonts));
+
+ /* setup theme paths */
path_themes = e_path_new();
if (!path_themes)
{
e_error_message_show("Cannot allocate path for path_themes\n");
return 0;
}
- e_path_path_append(path_themes, "~/.e/e/themes");
- e_path_path_append(path_themes, PACKAGE_DATA_DIR"/data/themes");
+ e_path_default_path_append(path_themes, "~/.e/e/themes");
+ e_path_default_path_append(path_themes, "~/.e/e/backgrounds");
+ e_path_default_path_append(path_themes, PACKAGE_DATA_DIR"/data/themes");
+ e_path_user_path_set(path_themes, &(e_config->path_append_themes));
+
+ /* setup icon paths */
path_icons = e_path_new();
if (!path_icons)
{
e_error_message_show("Cannot allocate path for path_icons\n");
return 0;
}
- e_path_path_append(path_icons, "~/.e/e/icons");
- e_path_path_append(path_icons, PACKAGE_DATA_DIR"/data/icons");
+ e_path_default_path_append(path_icons, "~/.e/e/icons");
+ e_path_default_path_append(path_icons, PACKAGE_DATA_DIR"/data/icons");
+ e_path_user_path_set(path_icons, &(e_config->path_append_icons));
+
+ /* setup init paths */
path_init = e_path_new();
if (!path_init)
{
e_error_message_show("Cannot allocate path for path_init\n");
return 0;
}
- e_path_path_append(path_init, "~/.e/e/init");
- e_path_path_append(path_init, PACKAGE_DATA_DIR"/data/init");
+ e_path_default_path_append(path_init, "~/.e/e/init");
+ e_path_default_path_append(path_init, PACKAGE_DATA_DIR"/data/init");
+ e_path_user_path_set(path_init, &(e_config->path_append_init));
+
+ /* setup module paths */
+ path_modules = e_path_new();
+ if (!path_modules)
+ {
+ e_error_message_show("Cannot allocate path for path_modules\n");
+ return 0;
+ }
+ e_path_default_path_append(path_modules, "~/.e/e/modules");
+ e_path_default_path_append(path_modules, PACKAGE_LIB_DIR"/enlightenment/modules");
+ e_path_default_path_append(path_modules, PACKAGE_LIB_DIR"/enlightenment/modules_extra");
+ e_path_user_path_set(path_modules, &(e_config->path_append_modules));
+
return 1;
}
@@ -750,6 +782,11 @@
e_object_del(E_OBJECT(path_init));
path_init = NULL;
}
+ if (path_modules)
+ {
+ e_object_del(E_OBJECT(path_modules));
+ path_modules = NULL;
+ }
return 1;
}
Index: e_manager.c
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_manager.c,v
retrieving revision 1.25
diff -u -r1.25 e_manager.c
--- e_manager.c 13 May 2005 07:27:41 -0000 1.25
+++ e_manager.c 15 May 2005 06:42:37 -0000
@@ -102,6 +102,8 @@
Ecore_X_Window *windows;
int wnum;
+ /* a manager is designated for each root. lets get all the windows in
+ the managers root */
windows = ecore_x_window_children_get(man->root, &wnum);
if (windows)
{
Index: e_menu.c
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_menu.c,v
retrieving revision 1.29
diff -u -r1.29 e_menu.c
--- e_menu.c 12 May 2005 09:28:58 -0000 1.29
+++ e_menu.c 15 May 2005 06:42:37 -0000
@@ -319,7 +319,7 @@
}
void
-e_menu_item_icon_file_set(E_Menu_Item *mi, char *icon)
+e_menu_item_icon_file_set(E_Menu_Item *mi, const char *icon)
{
E_OBJECT_CHECK(mi);
E_OBJECT_TYPE_CHECK(mi, E_MENU_ITEM_TYPE);
@@ -336,7 +336,7 @@
}
void
-e_menu_item_icon_edje_set(E_Menu_Item *mi, char *icon, char *key)
+e_menu_item_icon_edje_set(E_Menu_Item *mi, const char *icon, const char *key)
{
E_OBJECT_CHECK(mi);
E_OBJECT_TYPE_CHECK(mi, E_MENU_ITEM_TYPE);
@@ -355,7 +355,7 @@
}
void
-e_menu_item_label_set(E_Menu_Item *mi, char *label)
+e_menu_item_label_set(E_Menu_Item *mi, const char *label)
{
E_OBJECT_CHECK(mi);
E_OBJECT_TYPE_CHECK(mi, E_MENU_ITEM_TYPE);
Index: e_menu.h
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_menu.h,v
retrieving revision 1.11
diff -u -r1.11 e_menu.h
--- e_menu.h 21 Apr 2005 07:19:49 -0000 1.11
+++ e_menu.h 15 May 2005 06:42:38 -0000
@@ -146,9 +146,9 @@
EAPI E_Menu_Item *e_menu_item_new(E_Menu *m);
EAPI E_Menu_Item *e_menu_item_nth(E_Menu *m, int n);
EAPI int e_menu_item_num_get(E_Menu_Item *mi);
-EAPI void e_menu_item_icon_file_set(E_Menu_Item *mi, char *icon);
-EAPI void e_menu_item_icon_edje_set(E_Menu_Item *mi, char *icon, char *key);
-EAPI void e_menu_item_label_set(E_Menu_Item *mi, char *label);
+EAPI void e_menu_item_icon_file_set(E_Menu_Item *mi, const char *icon);
+EAPI void e_menu_item_icon_edje_set(E_Menu_Item *mi, const char *icon, const char *key);
+EAPI void e_menu_item_label_set(E_Menu_Item *mi, const char *label);
EAPI void e_menu_item_submenu_set(E_Menu_Item *mi, E_Menu *sub);
EAPI void e_menu_item_separator_set(E_Menu_Item *mi, int sep);
EAPI void e_menu_item_check_set(E_Menu_Item *mi, int chk);
Index: e_module.c
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_module.c,v
retrieving revision 1.26
diff -u -r1.26 e_module.c
--- e_module.c 4 May 2005 09:59:02 -0000 1.26
+++ e_module.c 15 May 2005 06:42:38 -0000
@@ -26,7 +26,6 @@
/* local subsystem globals */
static Evas_List *_e_modules = NULL;
-static E_Path *_e_path_modules = NULL;
static E_Module_Api _e_module_api =
{
@@ -39,12 +38,6 @@
{
Evas_List *pl = NULL, *l;
- _e_path_modules = e_path_new();
- if (!_e_path_modules) return 0;
- e_path_path_append(_e_path_modules, "~/.e/e/modules");
- e_path_path_append(_e_path_modules, PACKAGE_LIB_DIR"/enlightenment/modules");
- e_path_path_append(_e_path_modules, PACKAGE_LIB_DIR"/enlightenment/modules_extra");
-
for (l = e_config->modules; l;)
{
E_Config_Module *em;
@@ -80,8 +73,6 @@
l = l->next;
e_object_del(E_OBJECT(tmp->data));
}
- e_object_del(E_OBJECT(_e_path_modules));
- _e_path_modules = NULL;
return 1;
}
@@ -100,7 +91,7 @@
if (name[0] != '/')
{
snprintf(buf, sizeof(buf), "%s/%s/module.so", name, MODULE_ARCH);
- modpath = e_path_find(_e_path_modules, buf);
+ modpath = e_path_find(path_modules, buf);
}
else
modpath = name;
Index: e_path.c
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_path.c,v
retrieving revision 1.9
diff -u -r1.9 e_path.c
--- e_path.c 22 Apr 2005 03:06:27 -0000 1.9
+++ e_path.c 15 May 2005 06:42:38 -0000
@@ -22,13 +22,14 @@
}
void
-e_path_path_append(E_Path *ep, const char *path)
+e_path_default_path_append(E_Path *ep, const char *path)
{
E_OBJECT_CHECK(ep);
E_OBJECT_TYPE_CHECK(ep, E_PATH_TYPE);
if (!path) return;
if (path[0] == '~')
{
+ E_Path_Dir *epd;
char *new_path;
char *home_dir;
int len1, len2;
@@ -43,24 +44,52 @@
free(home_dir);
return;
}
+ epd = malloc(sizeof(E_Path_Dir));
+ if (!epd)
+ {
+ free(home_dir);
+ free(new_path);
+ return;
+ }
+
+ epd->dir = new_path;
strcpy(new_path, home_dir);
strcat(new_path, path + 1);
free(home_dir);
- ep->dir_list = evas_list_append(ep->dir_list, new_path);
+ ep->default_dir_list = evas_list_append(ep->default_dir_list, epd);
}
else
- ep->dir_list = evas_list_append(ep->dir_list, strdup(path));
+ {
+ E_Path_Dir *epd;
+ epd = malloc(sizeof(E_Path_Dir));
+ if (!epd)
+ return;
+ epd->dir = strdup(path);
+ ep->default_dir_list = evas_list_append(ep->default_dir_list, epd);
+ }
+ _e_path_cache_free(ep);
+}
+
+void
+e_path_user_path_set(E_Path *ep, Evas_List **user_dir_list)
+{
+
+ E_OBJECT_CHECK(ep);
+ E_OBJECT_TYPE_CHECK(ep, E_PATH_TYPE);
+ /* FIXME: should I clear out the old user_dir_list? */
+ ep->user_dir_list = user_dir_list;
_e_path_cache_free(ep);
}
void
-e_path_path_prepend(E_Path *ep, const char *path)
+e_path_user_path_append(E_Path *ep, const char *path)
{
E_OBJECT_CHECK(ep);
E_OBJECT_TYPE_CHECK(ep, E_PATH_TYPE);
if (!path) return;
if (path[0] == '~')
{
+ E_Path_Dir *epd;
char *new_path;
char *home_dir;
int len1, len2;
@@ -75,18 +104,83 @@
free(home_dir);
return;
}
+ epd = malloc(sizeof(E_Path_Dir));
+ if (!epd)
+ {
+ free(home_dir);
+ free(new_path);
+ return;
+ }
+
+ epd->dir = new_path;
strcpy(new_path, home_dir);
strcat(new_path, path + 1);
free(home_dir);
- ep->dir_list = evas_list_prepend(ep->dir_list, new_path);
+ *(ep->user_dir_list) = evas_list_append(*(ep->user_dir_list), epd);
}
else
- ep->dir_list = evas_list_prepend(ep->dir_list, strdup(path));
+ {
+ E_Path_Dir *epd;
+ epd = malloc(sizeof(E_Path_Dir));
+ if (!epd)
+ return;
+ epd->dir = strdup(path);
+ *(ep->user_dir_list) = evas_list_append(*(ep->user_dir_list), epd);
+ }
_e_path_cache_free(ep);
}
void
-e_path_path_remove(E_Path *ep, const char *path)
+e_path_user_path_prepend(E_Path *ep, const char *path)
+{
+ E_OBJECT_CHECK(ep);
+ E_OBJECT_TYPE_CHECK(ep, E_PATH_TYPE);
+ if (!path) return;
+ if (path[0] == '~')
+ {
+ E_Path_Dir *epd;
+ char *new_path;
+ char *home_dir;
+ int len1, len2;
+
+ home_dir = e_user_homedir_get();
+ if (!home_dir) return;
+ len1 = strlen(home_dir);
+ len2 = strlen(path);
+ new_path = malloc(len1 + len2 + 1);
+ if (!new_path)
+ {
+ free(home_dir);
+ return;
+ }
+ epd = malloc(sizeof(E_Path_Dir));
+ if (!epd)
+ {
+ free(home_dir);
+ free(new_path);
+ return;
+ }
+
+ epd->dir = new_path;
+ strcpy(new_path, home_dir);
+ strcat(new_path, path + 1);
+ free(home_dir);
+ *(ep->user_dir_list) = evas_list_prepend(*(ep->user_dir_list), epd);
+ }
+ else
+ {
+ E_Path_Dir *epd;
+ epd = malloc(sizeof(E_Path_Dir));
+ if (!epd)
+ return;
+ epd->dir = strdup(path);
+ *(ep->user_dir_list) = evas_list_prepend(*(ep->user_dir_list), epd);
+ }
+ _e_path_cache_free(ep);
+}
+
+void
+e_path_user_path_remove(E_Path *ep, const char *path)
{
Evas_List *l;
@@ -112,16 +206,19 @@
strcpy(new_path, home_dir);
strcat(new_path, path + 1);
free(home_dir);
- for (l = ep->dir_list; l; l = l->next)
+ for (l = *(ep->user_dir_list); l; l = l->next)
{
- char *p;
+ E_Path_Dir *epd;
- p = l->data;
- if (p)
+ epd = l->data;
+ if (epd->dir)
{
- if (!strcmp(p, new_path))
+ if (!strcmp(epd->dir, new_path))
{
- ep->dir_list = evas_list_prepend(ep->dir_list, l->data);
+ *(ep->user_dir_list) = evas_list_remove_list(
+ *(ep->user_dir_list), l);
+ free(epd->dir);
+ free(epd);
free(new_path);
_e_path_cache_free(ep);
return;
@@ -132,16 +229,18 @@
}
else
{
- for (l = ep->dir_list; l; l = l->next)
+ for (l = *(ep->user_dir_list); l; l = l->next)
{
- char *p;
-
- p = l->data;
- if (p)
+ E_Path_Dir *epd;
+ epd = l->data;
+ if (epd->dir)
{
- if (!strcmp(p, path))
+ if (!strcmp(epd->dir, path))
{
- ep->dir_list = evas_list_prepend(ep->dir_list, l->data);
+ *(ep->user_dir_list) = evas_list_remove_list(
+ *(ep->user_dir_list), l);
+ free(epd->dir);
+ free(epd);
_e_path_cache_free(ep);
return;
}
@@ -166,14 +265,40 @@
strcpy(_e_path_buf, str);
return _e_path_buf;
}
- for (l = ep->dir_list; l; l = l->next)
+ /* Look in the default dir list */
+ for (l = ep->default_dir_list; l; l = l->next)
+ {
+ E_Path_Dir *epd;
+ char *rp;
+
+ epd = l->data;
+ if (epd->dir)
+ {
+ snprintf(_e_path_buf, sizeof(_e_path_buf), "%s/%s", epd->dir, file);
+ rp = ecore_file_realpath(_e_path_buf);
+ if ((rp) && (rp[0] != 0))
+ {
+ strncpy(_e_path_buf, rp, sizeof(_e_path_buf) - 1);
+ _e_path_buf[sizeof(_e_path_buf) - 1] = 0;
+ free(rp);
+ if (evas_hash_size(ep->hash) >= 512)
+ _e_path_cache_free(ep);
+ ep->hash = evas_hash_add(ep->hash, file, strdup(_e_path_buf));
+ return _e_path_buf;
+ }
+ if (rp) free(rp);
+ }
+ }
+ /* Look in the users dir list */
+ for (l = *(ep->user_dir_list); l; l = l->next)
{
- char *p, *rp;
+ E_Path_Dir *epd;
+ char *rp;
- p = l->data;
- if (p)
+ epd = l->data;
+ if (epd->dir)
{
- snprintf(_e_path_buf, sizeof(_e_path_buf), "%s/%s", p, file);
+ snprintf(_e_path_buf, sizeof(_e_path_buf), "%s/%s", epd->dir, file);
rp = ecore_file_realpath(_e_path_buf);
if ((rp) && (rp[0] != 0))
{
@@ -199,12 +324,55 @@
E_OBJECT_CHECK(ep);
E_OBJECT_TYPE_CHECK(ep, E_PATH_TYPE);
if (!evas) return;
- for (l = ep->dir_list; l; l = l->next)
+ for (l = ep->default_dir_list; l; l = l->next)
{
- char *p;
+ E_Path_Dir *epd;
- p = l->data;
- if (p) evas_font_path_append(evas, p);
+ epd = l->data;
+ if (epd->dir) evas_font_path_append(evas, epd->dir);
+ }
+}
+
+/* compine default_list and and user_list int and easy to use list */
+Evas_List *
+e_path_dir_list_get(E_Path *ep)
+{
+ Evas_List *dir_list;
+ Evas_List *l;
+ E_Path_Dir *new_epd;
+ E_Path_Dir *epd;
+
+ dir_list = NULL;
+
+ for (l = ep->default_dir_list; l; l = l->next)
+ {
+ epd = l->data;
+ new_epd = malloc(sizeof(E_Path_Dir));
+ new_epd->dir = strdup(epd->dir);
+ dir_list = evas_list_append(dir_list, new_epd);
+ }
+ for (l = *(ep->user_dir_list); l; l = l->next)
+ {
+ epd = l->data;
+ new_epd = malloc(sizeof(E_Path_Dir));
+ new_epd->dir = strdup(epd->dir);
+ dir_list = evas_list_append(dir_list, new_epd);
+ }
+
+ return dir_list;
+}
+
+void
+e_path_dir_list_free(Evas_List *dir_list)
+{
+ E_Path_Dir *epd;
+
+ while (dir_list)
+ {
+ epd = dir_list->data;
+ dir_list = evas_list_remove_list(dir_list, dir_list);
+ free(epd->dir);
+ free(epd);
}
}
@@ -213,10 +381,14 @@
_e_path_free(E_Path *ep)
{
_e_path_cache_free(ep);
- while (ep->dir_list)
+ while (ep->default_dir_list)
{
- free(ep->dir_list->data);
- ep->dir_list = evas_list_remove_list(ep->dir_list, ep->dir_list);
+ E_Path_Dir *epd;
+ epd = ep->default_dir_list->data;
+ free(epd->dir);
+ free(epd);
+ ep->default_dir_list = evas_list_remove_list(ep->default_dir_list,
+ ep->default_dir_list);
}
free(ep);
}
@@ -227,6 +399,7 @@
if (!ep->hash) return;
evas_hash_foreach(ep->hash, _e_path_cache_free_cb, NULL);
evas_hash_free(ep->hash);
+ ep->hash = NULL;
}
static Evas_Bool
Index: e_path.h
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_path.h,v
retrieving revision 1.6
diff -u -r1.6 e_path.h
--- e_path.h 7 Feb 2005 13:51:09 -0000 1.6
+++ e_path.h 15 May 2005 06:42:38 -0000
@@ -4,28 +4,42 @@
#ifdef E_TYPEDEFS
typedef struct _E_Path E_Path;
-
+typedef struct _E_Path_Dir E_Path_Dir;
+
#else
#ifndef E_PATH_H
#define E_PATH_H
#define E_PATH_TYPE 0xE0b0100c
+struct _E_Path_Dir
+{
+ char * dir;
+};
+
struct _E_Path
{
E_Object e_obj_inherit;
Evas_Hash *hash;
- Evas_List *dir_list;
+ Evas_List *default_dir_list;
+ /* keep track of the associated e_config path */
+ Evas_List **user_dir_list;
};
EAPI E_Path *e_path_new(void);
-EAPI void e_path_path_append(E_Path *ep, const char *path);
-EAPI void e_path_path_prepend(E_Path *ep, const char *path);
-EAPI void e_path_path_remove(E_Path *ep, const char *path);
-EAPI char *e_path_find(E_Path *ep, const char *file); /* for conveience this doesnt return a malloc'd string. it's a static buffer, so a new call will replace this buffer, but thsi means there is no need to free the return */
+/* append a hardcoded path */
+EAPI void e_path_default_path_append(E_Path *ep, const char *path);
+/* e_config path manipulation */
+EAPI void e_path_user_path_set(E_Path *ep, Evas_List **user_dir_list);
+EAPI void e_path_user_path_append(E_Path *ep, const char *path);
+EAPI void e_path_user_path_prepend(E_Path *ep, const char *path);
+EAPI void e_path_user_path_remove(E_Path *ep, const char *path);
+EAPI char *e_path_find(E_Path *ep, const char *file); /* for conveience this doesnt return a malloc'd string. it's a static buffer, so a new call will replace this buffer, but thsi means there is no need to free the return */
EAPI void e_path_evas_append(E_Path *ep, Evas *evas);
+EAPI Evas_List *e_path_dir_list_get(E_Path *ep);
+EAPI void e_path_dir_list_free(Evas_List *dir_list);
#endif
#endif
Index: e_remote_main.c
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_remote_main.c,v
retrieving revision 1.23
diff -u -r1.23 e_remote_main.c
--- e_remote_main.c 13 May 2005 17:21:04 -0000 1.23
+++ e_remote_main.c 15 May 2005 06:42:38 -0000
@@ -42,6 +42,7 @@
ECORE_IPC_DEC_EVAS_LIST_PROTO(_e_ipc_key_binding_list_dec);
ECORE_IPC_ENC_STRUCT_PROTO(_e_ipc_key_binding_enc);
ECORE_IPC_DEC_STRUCT_PROTO(_e_ipc_key_binding_dec);
+ECORE_IPC_DEC_EVAS_LIST_PROTO(_e_ipc_path_list_dec);
/* local subsystem globals */
static Ecore_Ipc_Server *_e_ipc_server = NULL;
@@ -260,10 +261,8 @@
OSTR("-module-enable", "Enable module OPT1 if not enabled", E_IPC_OP_MODULE_ENABLE, 0),
OSTR("-module-disable", "Disable module OPT1 if not disabled", E_IPC_OP_MODULE_DISABLE, 0),
OREQ("-module-list", "List all loaded modules and their states", E_IPC_OP_MODULE_LIST, 1),
- OREQ("-module-dirs-list", "List all modules directories", E_IPC_OP_MODULE_DIRS_LIST, 1),
- OSTR("-bg-set", "Set the background edje file to be OPT1", E_IPC_OP_BG_SET, 0),
+ OSTR("-bg-set", "Set the background edje file to be OPT1", E_IPC_OP_BG_SET, 0),
OREQ("-bg-get", "Get the background edje file", E_IPC_OP_BG_GET, 1),
- OREQ("-bg-dirs-list", "Get the background directories", E_IPC_OP_BG_DIRS_LIST, 1),
OSTR("-font-fallback-remove", "Remove OPT1 from the fontset", E_IPC_OP_FONT_FALLBACK_REMOVE, 0),
OSTR("-font-fallback-prepend", "Prepend OPT1 to the fontset", E_IPC_OP_FONT_FALLBACK_PREPEND, 0),
OSTR("-font-fallback-append", "Append OPT1 to the fontset", E_IPC_OP_FONT_FALLBACK_APPEND, 0),
@@ -286,6 +285,35 @@
OREQ("-binding-key-list", "List all key bindings", E_IPC_OP_BINDING_KEY_LIST, 1),
OFNC("-binding-key-add", "Add or replace an existing key binding. OPT1 = Context, OPT2 = key, OPT3 = modifiers, OPT4 = any modifier ok, OPT5 = action, OPT6 = action parameters", 6, _e_opt_binding_key_add, 0),
OFNC("-binding-key-del", "Delete an existing key binding. OPT1 = Context, OPT2 = key, OPT3 = modifiers, OPT4 = any modifier ok, OPT5 = action, OPT6 = action parameters", 6, _e_opt_binding_key_del, 0),
+ OREQ("-module-dirs-list", "List all module directories", E_IPC_OP_MODULE_DIRS_LIST, 1),
+ OSTR("-module-dirs-append", "Append OPT1 to the user module path", E_IPC_OP_MODULE_DIRS_APPEND, 0),
+ OSTR("-module-dirs-prepend", "Prepend OPT1 to the user module path", E_IPC_OP_MODULE_DIRS_PREPEND, 0),
+ OSTR("-module-dirs-remove", "Remove OPT1 from the user module path", E_IPC_OP_MODULE_DIRS_REMOVE, 0),
+ OREQ("-data-dirs-list", "List all data directories", E_IPC_OP_DATA_DIRS_LIST, 1),
+ OSTR("-data-dirs-append", "Append OPT1 to the user data path", E_IPC_OP_DATA_DIRS_APPEND, 0),
+ OSTR("-data-dirs-prepend", "Prepend OPT1 to the user data path", E_IPC_OP_DATA_DIRS_PREPEND, 0),
+ OSTR("-data-dirs-remove", "Remove OPT1 from the user data path", E_IPC_OP_DATA_DIRS_REMOVE, 0),
+ OREQ("-font-dirs-list", "List all font directories", E_IPC_OP_FONT_DIRS_LIST, 1),
+ OSTR("-font-dirs-append", "Append OPT1 to the user font path", E_IPC_OP_FONT_DIRS_APPEND, 0),
+ OSTR("-font-dirs-prepend", "Prepend OPT1 to the user font path", E_IPC_OP_FONT_DIRS_PREPEND, 0),
+ OSTR("-font-dirs-remove", "Remove OPT1 from the user font path", E_IPC_OP_FONT_DIRS_REMOVE, 0),
+ OREQ("-theme-dirs-list", "List all theme directories", E_IPC_OP_THEME_DIRS_LIST, 1),
+ OSTR("-theme-dirs-append", "Append OPT1 to the user theme path", E_IPC_OP_THEME_DIRS_APPEND, 0),
+ OSTR("-theme-dirs-prepend", "Prepend OPT1 to the user theme path", E_IPC_OP_THEME_DIRS_PREPEND, 0),
+ OSTR("-theme-dirs-remove", "Remove OPT1 from the user theme path", E_IPC_OP_THEME_DIRS_REMOVE, 0),
+ OREQ("-init-dirs-list", "List all init directories", E_IPC_OP_INIT_DIRS_LIST, 1),
+ OSTR("-init-dirs-append", "Append OPT1 to the user init path", E_IPC_OP_INIT_DIRS_APPEND, 0),
+ OSTR("-init-dirs-prepend", "Prepend OPT1 to the user init path", E_IPC_OP_INIT_DIRS_PREPEND, 0),
+ OSTR("-init-dirs-remove", "Remove OPT1 from the user init path", E_IPC_OP_INIT_DIRS_REMOVE, 0),
+ OREQ("-icon-dirs-list", "List all icon directories", E_IPC_OP_ICON_DIRS_LIST, 1),
+ OSTR("-icon-dirs-append", "Append OPT1 to the user icon path", E_IPC_OP_ICON_DIRS_APPEND, 0),
+ OSTR("-icon-dirs-prepend", "Prepend OPT1 to the user icon path", E_IPC_OP_ICON_DIRS_PREPEND, 0),
+ OSTR("-icon-dirs-remove", "Remove OPT1 from the user icon path", E_IPC_OP_ICON_DIRS_REMOVE, 0),
+ OREQ("-image-dirs-list", "List all image directories", E_IPC_OP_IMAGE_DIRS_LIST, 1),
+ OSTR("-image-dirs-append", "Append OPT1 to the user image path", E_IPC_OP_IMAGE_DIRS_APPEND, 0),
+ OSTR("-image-dirs-prepend", "Prepend OPT1 to the user image path", E_IPC_OP_IMAGE_DIRS_PREPEND, 0),
+ OSTR("-image-dirs-remove", "Remove OPT1 from the user image path", E_IPC_OP_IMAGE_DIRS_REMOVE, 0),
+ OFNC("-binding-key-del", "Delete an existing key binding. OPT1 = Context, OPT2 = key, OPT3 = modifiers, OPT4 = any modifier ok, OPT5 = action, OPT6 = action parameters", 6, _e_opt_binding_key_del, 0),
ODBL("-menus-scroll-speed-set", "Set the scroll speed of menus (pixels/sec)", E_IPC_OP_MENUS_SCROLL_SPEED_SET, 0),
OREQ("-menus-scroll-speed-get", "Get the scroll speed of menus (pixels/sec)", E_IPC_OP_MENUS_SCROLL_SPEED_GET, 1),
ODBL("-menus-fast-move-threshhold-set", "Set the mouse speed in pixels per second that is considered a 'fast move'", E_IPC_OP_MENUS_FAST_MOVE_THRESHHOLD_SET, 0),
@@ -598,7 +626,7 @@
E_Module *m;
modules = _e_ipc_module_list_dec(e->data, e->size);
- while(modules)
+ while (modules)
{
m = modules->data;
printf("REPLY: MODULE NAME=\"%s\" ENABLED=%i\n",
@@ -610,44 +638,12 @@
else
printf("REPLY: MODULE NONE\n");
break;
- case E_IPC_OP_MODULE_DIRS_LIST_REPLY:
- if (e->data)
- {
- char *p;
-
- p = e->data;
- while (p < (char *)(e->data + e->size))
- {
- char *dir;
-
- dir = p;
- printf("REPLY: MODULE DIR=%s\n", dir);
- p += strlen(dir) + 1;
- }
- }
- break;
case E_IPC_OP_BG_GET_REPLY:
if (e->data)
{
printf("REPLY: %s\n", (char *)e->data);
}
break;
- case E_IPC_OP_BG_DIRS_LIST_REPLY:
- if (e->data)
- {
- char *p;
-
- p = e->data;
- while (p < (char *)(e->data + e->size))
- {
- char *dir;
-
- dir = p;
- printf("REPLY: BG DIR=%s\n", dir);
- p += strlen(dir) + 1;
- }
- }
- break;
case E_IPC_OP_FONT_FALLBACK_LIST_REPLY:
if (e->data)
{
@@ -788,6 +784,118 @@
else
printf("REPLY: AVAILABLE NONE\n");
break;
+ case E_IPC_OP_DATA_DIRS_LIST_REPLY:
+ if (e->data)
+ {
+ Evas_List *dirs;
+ E_Path_Dir *dir;
+
+ dirs = _e_ipc_path_list_dec(e->data, e->size);
+ while (dirs)
+ {
+ dir = dirs->data;
+ printf("REPLY: DATA DIR=\"%s\"\n", dir->dir);
+ dirs = evas_list_remove_list(dirs, dirs);
+ E_FREE(dir);
+ }
+ }
+ break;
+ case E_IPC_OP_IMAGE_DIRS_LIST_REPLY:
+ if (e->data)
+ {
+ Evas_List *dirs;
+ E_Path_Dir *dir;
+
+ dirs = _e_ipc_path_list_dec(e->data, e->size);
+ while (dirs)
+ {
+ dir = dirs->data;
+ printf("REPLY: IMAGE DIR=\"%s\"\n", dir->dir);
+ dirs = evas_list_remove_list(dirs, dirs);
+ E_FREE(dir);
+ }
+ }
+ break;
+ case E_IPC_OP_FONT_DIRS_LIST_REPLY:
+ if (e->data)
+ {
+ Evas_List *dirs;
+ E_Path_Dir *dir;
+
+ dirs = _e_ipc_path_list_dec(e->data, e->size);
+ while (dirs)
+ {
+ dir = dirs->data;
+ printf("REPLY: FONT DIR=\"%s\"\n", dir->dir);
+ dirs = evas_list_remove_list(dirs, dirs);
+ E_FREE(dir);
+ }
+ }
+ break;
+ case E_IPC_OP_THEME_DIRS_LIST_REPLY:
+ if (e->data)
+ {
+ Evas_List *dirs;
+ E_Path_Dir *dir;
+
+ dirs = _e_ipc_path_list_dec(e->data, e->size);
+ while (dirs)
+ {
+ dir = dirs->data;
+ printf("REPLY: THEME DIR=\"%s\"\n", dir->dir);
+ dirs = evas_list_remove_list(dirs, dirs);
+ E_FREE(dir);
+ }
+ }
+ break;
+ case E_IPC_OP_INIT_DIRS_LIST_REPLY:
+ if (e->data)
+ {
+ Evas_List *dirs;
+ E_Path_Dir *dir;
+
+ dirs = _e_ipc_path_list_dec(e->data, e->size);
+ while (dirs)
+ {
+ dir = dirs->data;
+ printf("REPLY: INIT DIR=\"%s\"\n", dir->dir);
+ dirs = evas_list_remove_list(dirs, dirs);
+ E_FREE(dir);
+ }
+ }
+ break;
+ case E_IPC_OP_ICON_DIRS_LIST_REPLY:
+ if (e->data)
+ {
+ Evas_List *dirs;
+ E_Path_Dir *dir;
+
+ dirs = _e_ipc_path_list_dec(e->data, e->size);
+ while (dirs)
+ {
+ dir = dirs->data;
+ printf("REPLY: ICON DIR=\"%s\"\n", dir->dir);
+ dirs = evas_list_remove_list(dirs, dirs);
+ E_FREE(dir);
+ }
+ }
+ break;
+ case E_IPC_OP_MODULE_DIRS_LIST_REPLY:
+ if (e->data)
+ {
+ Evas_List *dirs;
+ E_Path_Dir *dir;
+
+ dirs = _e_ipc_path_list_dec(e->data, e->size);
+ while (dirs)
+ {
+ dir = dirs->data;
+ printf("REPLY: MODULE DIR=\"%s\"\n", dir->dir);
+ dirs = evas_list_remove_list(dirs, dirs);
+ E_FREE(dir);
+ }
+ }
+ break;
case E_IPC_OP_MENUS_SCROLL_SPEED_GET_REPLY:
if (e->data)
{
@@ -1145,3 +1253,9 @@
ECORE_IPC_GET8(any_mod);
ECORE_IPC_DEC_STRUCT_FOOT();
}
+ECORE_IPC_DEC_EVAS_LIST_PROTO(_e_ipc_path_list_dec)
+{
+ ECORE_IPC_DEC_EVAS_LIST_HEAD(E_Path_Dir);
+ ECORE_IPC_GETS(dir);
+ ECORE_IPC_DEC_EVAS_LIST_FOOT();
+}