From 7716bedab3233c314f53cacee2c81f3f2c60c3c8 Mon Sep 17 00:00:00 2001 From: handyande Date: Thu, 2 Jun 2005 21:55:12 +0000 Subject: [PATCH] Please can someone say why the E_IPC_OP_DIRS_LIST_REPLY always seems to return a blank -data- ? Other than that, this is dir listing (basics) in SVN revision: 15068 --- src/bin/e.h | 1 + src/bin/e_ipc_handlers.h | 62 +++++++++++++++++++++++++++++++++------- src/lib/e_private.h | 1 + 3 files changed, 53 insertions(+), 11 deletions(-) diff --git a/src/bin/e.h b/src/bin/e.h index 4eb2fb09a..ac1dfbc39 100644 --- a/src/bin/e.h +++ b/src/bin/e.h @@ -71,6 +71,7 @@ typedef struct _E_Rect E_Rect; #define E_WM_IN 3 #define E_REMOTE_IN 4 #define E_ENUM 5 +#define E_LIB_IN 6 #define E_TYPEDEFS 1 #include "e_includes.h" diff --git a/src/bin/e_ipc_handlers.h b/src/bin/e_ipc_handlers.h index f2cc7a7ab..8ef0f156d 100644 --- a/src/bin/e_ipc_handlers.h +++ b/src/bin/e_ipc_handlers.h @@ -124,16 +124,7 @@ break; Evas_List *dat = NULL, *l; #define DECODE(__dec) \ - if (__dec(e->data, e->size, &dat)) - -#define SEND_DIR_LIST(__pathtype, __replytype) \ - GENERIC(HDL); \ - Evas_List *dir_list; \ - dir_list = e_path_dir_list_get(__pathtype); \ - ENCODE(dir_list, e_ipc_codec_str_list_enc); \ - SEND_DATA(__replytype); \ - END_GENERIC(); - + if (dat && __dec(e->data, e->size, &dat)) #endif @@ -450,7 +441,7 @@ break; /****************************************************************************/ #define HDL E_IPC_OP_SHUTDOWN #if (TYPE == E_REMOTE_OPTIONS) - OP("-shutdown", 0, "Shutdown (exit) Enlightenment", 1, HDL) + OP("-shutdown", 0, "Shutdown (exit) Enlightenment", 0, HDL) #elif (TYPE == E_REMOTE_OUT) REQ_NULL(HDL); #elif (TYPE == E_WM_IN) @@ -465,6 +456,55 @@ break; +/****************************************************************************/ +#define HDL E_IPC_OP_DIRS_LIST +#if (TYPE == E_REMOTE_OPTIONS) + OP("-dirs-list", 1, "List the directory of type specified by 'OPT1', try 'backgrounds'", 1, HDL) +#elif (TYPE == E_REMOTE_OUT) + REQ_STRING(params[0], HDL); +#elif (TYPE == E_WM_IN) + STRING(s, HDL); + LIST_DATA() + Evas_List *dir_list = NULL; + if (!strcmp(s, "backgrounds")) + dir_list = e_path_dir_list_get(path_backgrounds); + E_Path_Dir *p; + FOR(dir_list) { p = l->data; + dat = evas_list_append(dat, p->dir); + } + + ENCODE(dat, e_ipc_codec_str_list_enc); + SEND_DATA(E_IPC_OP_DIRS_LIST_REPLY); + evas_list_free(dat); + e_path_dir_list_free(dir_list); + END_STRING(s) +#elif (TYPE == E_REMOTE_IN) +#elif (TYPE == E_LIB_IN) +#endif +#undef HDL + +/****************************************************************************/ +#define HDL E_IPC_OP_DIRS_LIST_REPLY +#if (TYPE == E_REMOTE_OPTIONS) +#elif (TYPE == E_REMOTE_OUT) +#elif (TYPE == E_WM_IN) +#elif (TYPE == E_REMOTE_IN) + GENERIC(HDL); + LIST(); + DECODE(e_ipc_codec_str_list_dec) { + FOR(dat) { + printf("REPLY: \"%s\"\n", (char *)(l->data)); + } + FREE_LIST(dat); + } + END_GENERIC(); +#endif +#undef HDL + + + + + #if 0 } #endif diff --git a/src/lib/e_private.h b/src/lib/e_private.h index 7e980ba08..e88ee5f6b 100644 --- a/src/lib/e_private.h +++ b/src/lib/e_private.h @@ -16,6 +16,7 @@ #define E_WM_IN 3 #define E_REMOTE_IN 4 #define E_ENUM 5 +#define E_LIB_IN 6 #define E_TYPEDEFS 1 #include "e_ipc.h"