From 3743c25e1d560309977c0a435c22f2b67e791c36 Mon Sep 17 00:00:00 2001 From: Carsten Haitzler Date: Tue, 31 May 2005 07:02:09 +0000 Subject: [PATCH] dirs handlers shoudl just become 1 dirs handler then specify what path dir list you want to modify in params - as they are all identical except as to what path variablew they modify - just make that a state setup phase SVN revision: 15035 --- src/bin/e_ipc_handlers.h | 54 +++++++++++++++++++++++++++++++-- src/bin/e_ipc_handlers_list.h | 57 +++++++---------------------------- src/lib/e_main.c | 56 ++++++++++++++++++---------------- 3 files changed, 93 insertions(+), 74 deletions(-) diff --git a/src/bin/e_ipc_handlers.h b/src/bin/e_ipc_handlers.h index b123ebda9..3a3329e7a 100644 --- a/src/bin/e_ipc_handlers.h +++ b/src/bin/e_ipc_handlers.h @@ -47,7 +47,8 @@ while (__list) { \ } # define SEND_DATA(__opcode) \ -ecore_ipc_client_send(e->client, E_IPC_DOMAIN_REPLY, __opcode, 0, 0, 0, data, bytes) +ecore_ipc_client_send(e->client, E_IPC_DOMAIN_REPLY, __opcode, 0, 0, 0, data, bytes); \ +free(data); # define STRING_INT_LIST(__v, HANDLER) \ case HANDLER: { \ @@ -80,7 +81,6 @@ ecore_ipc_client_send(e->client, E_IPC_DOMAIN_REPLY, __opcode, 0, 0, 0, data, by } \ data = e_ipc_codec_str_int_list_enc(dat, &bytes); \ SEND_DATA(__op); \ - free(data); \ FREE_LIST(dat); \ } \ break; @@ -95,6 +95,22 @@ case HANDLER: { void *data; int bytes; \ } \ break; +#define LIST_DATA() \ + Evas_List *dat = NULL, *l; \ + void *data; int bytes; + +#define ENCODE(__dat, __enc) \ + data = __enc(__dat, &bytes); + +#define FOR(__start) \ + for (l = __start; l; l = l->next) +#define GENERIC(HANDLER) \ + case HANDLER: { + +#define END_GENERIC() \ + } \ +break; + #endif @@ -284,6 +300,40 @@ break; #endif #undef HANDLER +/****************************************************************************/ +#define HANDLER E_IPC_OP_FONT_AVAILABLE_LIST +#if (TYPE == E_REMOTE_OPTIONS) + {"-font-available-list", 0, "List all available fonts", 1, HANDLER}, +#elif (TYPE == E_REMOTE_OUT) + REQ_NULL(HANDLER); +#elif (TYPE == E_WM_IN) + GENERIC(HANDLER); + LIST_DATA(); + E_Font_Available *fa; + Evas_List *fa_list; + fa_list = e_font_available_list(); + FOR(fa_list) { fa = l->data; + dat = evas_list_append(dat, fa->name); + } + ENCODE(dat, e_ipc_codec_str_list_enc); + SEND_DATA(E_IPC_OP_FONT_AVAILABLE_LIST_REPLY); + evas_list_free(dat); + e_font_available_list_free(fa_list); + END_GENERIC(); +#elif (TYPE == E_REMOTE_IN) +#endif +#undef HANDLER + +/****************************************************************************/ +#define HANDLER E_IPC_OP_FONT_AVAILABLE_LIST_REPLY +#if (TYPE == E_REMOTE_OPTIONS) +#elif (TYPE == E_REMOTE_OUT) +#elif (TYPE == E_WM_IN) +#elif (TYPE == E_REMOTE_IN) +// +#endif +#undef HANDLER + diff --git a/src/bin/e_ipc_handlers_list.h b/src/bin/e_ipc_handlers_list.h index 4ffe4f37b..0d006829c 100644 --- a/src/bin/e_ipc_handlers_list.h +++ b/src/bin/e_ipc_handlers_list.h @@ -70,49 +70,14 @@ #define E_IPC_OP_EDGE_FLIP_TIMEOUT_SET 70 #define E_IPC_OP_EDGE_FLIP_TIMEOUT_GET 71 #define E_IPC_OP_EDGE_FLIP_TIMEOUT_GET_REPLY 72 -#define E_IPC_OP_MODULE_DIRS_LIST 73 -#define E_IPC_OP_MODULE_DIRS_LIST_REPLY 74 -#define E_IPC_OP_MODULE_DIRS_APPEND 75 -#define E_IPC_OP_MODULE_DIRS_PREPEND 76 -#define E_IPC_OP_MODULE_DIRS_REMOVE 77 -#define E_IPC_OP_THEME_DIRS_LIST 78 -#define E_IPC_OP_THEME_DIRS_LIST_REPLY 79 -#define E_IPC_OP_THEME_DIRS_APPEND 80 -#define E_IPC_OP_THEME_DIRS_PREPEND 81 -#define E_IPC_OP_THEME_DIRS_REMOVE 82 -#define E_IPC_OP_FONT_DIRS_LIST 83 -#define E_IPC_OP_FONT_DIRS_LIST_REPLY 84 -#define E_IPC_OP_FONT_DIRS_APPEND 85 -#define E_IPC_OP_FONT_DIRS_PREPEND 86 -#define E_IPC_OP_FONT_DIRS_REMOVE 87 -#define E_IPC_OP_DATA_DIRS_LIST 88 -#define E_IPC_OP_DATA_DIRS_LIST_REPLY 89 -#define E_IPC_OP_DATA_DIRS_APPEND 90 -#define E_IPC_OP_DATA_DIRS_PREPEND 91 -#define E_IPC_OP_DATA_DIRS_REMOVE 92 -#define E_IPC_OP_IMAGE_DIRS_LIST 93 -#define E_IPC_OP_IMAGE_DIRS_LIST_REPLY 94 -#define E_IPC_OP_IMAGE_DIRS_APPEND 95 -#define E_IPC_OP_IMAGE_DIRS_PREPEND 96 -#define E_IPC_OP_IMAGE_DIRS_REMOVE 97 -#define E_IPC_OP_INIT_DIRS_LIST 98 -#define E_IPC_OP_INIT_DIRS_LIST_REPLY 99 -#define E_IPC_OP_INIT_DIRS_APPEND 100 -#define E_IPC_OP_INIT_DIRS_PREPEND 101 -#define E_IPC_OP_INIT_DIRS_REMOVE 102 -#define E_IPC_OP_ICON_DIRS_LIST 103 -#define E_IPC_OP_ICON_DIRS_LIST_REPLY 104 -#define E_IPC_OP_ICON_DIRS_APPEND 105 -#define E_IPC_OP_ICON_DIRS_PREPEND 106 -#define E_IPC_OP_ICON_DIRS_REMOVE 107 -#define E_IPC_OP_BG_DIRS_LIST 108 -#define E_IPC_OP_BG_DIRS_LIST_REPLY 109 -#define E_IPC_OP_BG_DIRS_APPEND 110 -#define E_IPC_OP_BG_DIRS_PREPEND 111 -#define E_IPC_OP_BG_DIRS_REMOVE 112 -#define E_IPC_OP_DESKS_SET 113 -#define E_IPC_OP_DESKS_GET 114 -#define E_IPC_OP_DESKS_GET_REPLY 115 -#define E_IPC_OP_FOCUS_POLICY_SET 116 -#define E_IPC_OP_FOCUS_POLICY_GET 117 -#define E_IPC_OP_FOCUS_POLICY_GET_REPLY 118 +#define E_IPC_OP_DIRS_LIST 73 +#define E_IPC_OP_DIRS_LIST_REPLY 74 +#define E_IPC_OP_DIRS_APPEND 75 +#define E_IPC_OP_DIRS_PREPEND 76 +#define E_IPC_OP_DIRS_REMOVE 77 +#define E_IPC_OP_DESKS_SET 78 +#define E_IPC_OP_DESKS_GET 79 +#define E_IPC_OP_DESKS_GET_REPLY 80 +#define E_IPC_OP_FOCUS_POLICY_SET 81 +#define E_IPC_OP_FOCUS_POLICY_GET 82 +#define E_IPC_OP_FOCUS_POLICY_GET_REPLY 83 diff --git a/src/lib/e_main.c b/src/lib/e_main.c index 696aba188..1af452cae 100644 --- a/src/lib/e_main.c +++ b/src/lib/e_main.c @@ -33,10 +33,10 @@ static void _e_cb_theme_dir_list_free(void *data __UNUSED__, void *ev); static Ecore_Ipc_Server *_e_ipc_server = NULL; int E_RESPONSE_MODULE_LIST = 0; -int E_RESPONSE_MODULE_DIRS_LIST = 0; +//int E_RESPONSE_MODULE_DIRS_LIST = 0; int E_RESPONSE_BACKGROUND_GET = 0; -int E_RESPONSE_BACKGROUND_DIRS_LIST = 0; -int E_RESPONSE_THEME_DIRS_LIST = 0; +//int E_RESPONSE_BACKGROUND_DIRS_LIST = 0; +//int E_RESPONSE_THEME_DIRS_LIST = 0; /* * initialise connection to the current E running on "display". @@ -109,10 +109,10 @@ e_init(const char* display) if (!E_RESPONSE_MODULE_LIST) { E_RESPONSE_MODULE_LIST = ecore_event_type_new(); - E_RESPONSE_MODULE_DIRS_LIST = ecore_event_type_new(); +// E_RESPONSE_MODULE_DIRS_LIST = ecore_event_type_new(); E_RESPONSE_BACKGROUND_GET = ecore_event_type_new(); - E_RESPONSE_BACKGROUND_DIRS_LIST = ecore_event_type_new(); - E_RESPONSE_THEME_DIRS_LIST = ecore_event_type_new(); +// E_RESPONSE_BACKGROUND_DIRS_LIST = ecore_event_type_new(); +// E_RESPONSE_THEME_DIRS_LIST = ecore_event_type_new(); } if (free_disp) @@ -197,9 +197,9 @@ e_module_list(void) void e_module_dirs_list(void) { - ecore_ipc_server_send(_e_ipc_server, E_IPC_DOMAIN_REQUEST, - E_IPC_OP_MODULE_DIRS_LIST, 0/*ref*/, 0/*ref_to*/, - 0/*response*/, NULL, 0); +// ecore_ipc_server_send(_e_ipc_server, E_IPC_DOMAIN_REQUEST, +// E_IPC_OP_MODULE_DIRS_LIST, 0/*ref*/, 0/*ref_to*/, +// 0/*response*/, NULL, 0); } void @@ -224,17 +224,17 @@ e_background_get(void) void e_background_dirs_list(void) { - ecore_ipc_server_send(_e_ipc_server, E_IPC_DOMAIN_REQUEST, - E_IPC_OP_BG_DIRS_LIST, 0/*ref*/, - 0/*ref_to*/, 0/*response*/, NULL, 0); +// ecore_ipc_server_send(_e_ipc_server, E_IPC_DOMAIN_REQUEST, +// E_IPC_OP_BG_DIRS_LIST, 0/*ref*/, +// 0/*ref_to*/, 0/*response*/, NULL, 0); } void e_theme_dirs_list(void) { - ecore_ipc_server_send(_e_ipc_server, E_IPC_DOMAIN_REQUEST, - E_IPC_OP_THEME_DIRS_LIST, 0/*ref*/, - 0/*ref_to*/, 0/*response*/, NULL, 0); +// ecore_ipc_server_send(_e_ipc_server, E_IPC_DOMAIN_REQUEST, +// E_IPC_OP_THEME_DIRS_LIST, 0/*ref*/, +// 0/*ref_to*/, 0/*response*/, NULL, 0); } static int @@ -320,6 +320,7 @@ _e_cb_server_data(void *data __UNUSED__, int type, void *event) _e_cb_module_list_free, NULL); } break; +/* case E_IPC_OP_MODULE_DIRS_LIST_REPLY: if (e->data) { @@ -351,16 +352,17 @@ _e_cb_server_data(void *data __UNUSED__, int type, void *event) _e_cb_module_dir_list_free, NULL); } break; - case E_IPC_OP_BG_GET_REPLY: - { - E_Response_Background_Get *res; - - res = calloc(1, sizeof(E_Response_Background_Get)); - res->file = e->data; - ecore_event_add(E_RESPONSE_BACKGROUND_GET, res, NULL, NULL); - break; - } - case E_IPC_OP_BG_DIRS_LIST_REPLY: + */ + case E_IPC_OP_BG_GET_REPLY: + { + E_Response_Background_Get *res; + + res = calloc(1, sizeof(E_Response_Background_Get)); + res->file = e->data; + ecore_event_add(E_RESPONSE_BACKGROUND_GET, res, NULL, NULL); + } + break; +/* case E_IPC_OP_BG_DIRS_LIST_REPLY: if (e->data) { E_Response_Background_Dirs_List *res; @@ -391,7 +393,8 @@ _e_cb_server_data(void *data __UNUSED__, int type, void *event) _e_cb_bg_dir_list_free, NULL); } break; - case E_IPC_OP_THEME_DIRS_LIST_REPLY: + */ +/* case E_IPC_OP_THEME_DIRS_LIST_REPLY: if (e->data) { E_Response_Theme_Dirs_List *res; @@ -422,6 +425,7 @@ _e_cb_server_data(void *data __UNUSED__, int type, void *event) _e_cb_theme_dir_list_free, NULL); } break; + */ default: break; }