Enlightenment CVS committal

Author  : stffrdhrn
Project : e17
Module  : apps/e

Dir     : e17/apps/e/src/bin


Modified Files:
        e_bg.c e_config.c e_ipc_codec.c e_ipc_codec.h e_ipc_handlers.h 
        e_ipc_handlers_list.h 


Log Message:
Begin adding e_themes to ipc
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_bg.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -3 -r1.6 -r1.7
--- e_bg.c      8 Jul 2005 04:42:50 -0000       1.6
+++ e_bg.c      10 Jul 2005 23:26:50 -0000      1.7
@@ -98,8 +98,8 @@
        
        edje_object_file_get(zone->prev_bg_object, &pfile, &pgroup);
        edje_object_file_get(zone->bg_object, &file, &group);
-       if ((!e_util_strcmp(pfile, file)) &&
-           (!e_util_strcmp(pgroup, group)))
+       if ((!e_util_strcmp((char *)pfile, (char *)file)) &&
+           (!e_util_strcmp((char *)pgroup, (char *)group)))
          {
             evas_object_del(zone->bg_object);
             zone->bg_object = zone->prev_bg_object;
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_config.c,v
retrieving revision 1.78
retrieving revision 1.79
diff -u -3 -r1.78 -r1.79
--- e_config.c  9 Jul 2005 15:37:28 -0000       1.78
+++ e_config.c  10 Jul 2005 23:26:50 -0000      1.79
@@ -3,11 +3,6 @@
  */
 #include "e.h"
 
-/* TODO List
- *
- * * setting up a new config value and a listener callback is too long winded 
- need to have helper funcs and macros do this so it's more like 1 line per new 
config value or 2
- */
-
 #if ((E17_PROFILE >= LOWRES_PDA) && (E17_PROFILE <= HIRES_PDA))
 #define DEF_MENUCLICK 1.25
 #else
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_ipc_codec.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -3 -r1.8 -r1.9
--- e_ipc_codec.c       27 Jun 2005 13:50:10 -0000      1.8
+++ e_ipc_codec.c       10 Jul 2005 23:26:50 -0000      1.9
@@ -9,8 +9,9 @@
 static Eet_Data_Descriptor *_e_ipc_double_edd = NULL;
 static Eet_Data_Descriptor *_e_ipc_2int_edd = NULL;
 static Eet_Data_Descriptor *_e_ipc_str_edd = NULL;
-static Eet_Data_Descriptor *_e_ipc_2str_edd = NULL;
 static Eet_Data_Descriptor *_e_ipc_str_list_edd = NULL;
+static Eet_Data_Descriptor *_e_ipc_2str_edd = NULL;
+static Eet_Data_Descriptor *_e_ipc_2str_list_edd = NULL;
 static Eet_Data_Descriptor *_e_ipc_str_int_edd = NULL;
 static Eet_Data_Descriptor *_e_ipc_str_int_list_edd = NULL;
 static Eet_Data_Descriptor *_e_ipc_2str_int_edd = NULL;
@@ -37,12 +38,15 @@
    _e_ipc_str_edd = E_CONFIG_DD_NEW("str", E_Ipc_Str);
    E_CONFIG_VAL(_e_ipc_str_edd, E_Ipc_Str, str, STR);
 
+   _e_ipc_str_list_edd = E_CONFIG_DD_NEW("str_list", E_Ipc_List);
+   E_CONFIG_LIST(_e_ipc_str_list_edd, E_Ipc_List, list, _e_ipc_str_edd);
+
    _e_ipc_2str_edd = E_CONFIG_DD_NEW("2str", E_Ipc_2Str);
    E_CONFIG_VAL(_e_ipc_2str_edd, E_Ipc_2Str, str1, STR);
    E_CONFIG_VAL(_e_ipc_2str_edd, E_Ipc_2Str, str2, STR);
    
-   _e_ipc_str_list_edd = E_CONFIG_DD_NEW("str_list", E_Ipc_List);
-   E_CONFIG_LIST(_e_ipc_str_list_edd, E_Ipc_List, list, _e_ipc_str_edd);
+   _e_ipc_2str_list_edd = E_CONFIG_DD_NEW("2str_list", E_Ipc_List);
+   E_CONFIG_LIST(_e_ipc_2str_list_edd, E_Ipc_List, list, _e_ipc_2str_edd);
 
    _e_ipc_str_int_edd = E_CONFIG_DD_NEW("str_int", E_Ipc_Str_Int);
    E_CONFIG_VAL(_e_ipc_str_int_edd, E_Ipc_Str_Int, str, STR);
@@ -90,8 +94,9 @@
    E_CONFIG_DD_FREE(_e_ipc_double_edd);
    E_CONFIG_DD_FREE(_e_ipc_2int_edd);
    E_CONFIG_DD_FREE(_e_ipc_str_edd);
-   E_CONFIG_DD_FREE(_e_ipc_2str_edd);
    E_CONFIG_DD_FREE(_e_ipc_str_list_edd);
+   E_CONFIG_DD_FREE(_e_ipc_2str_edd);
+   E_CONFIG_DD_FREE(_e_ipc_2str_list_edd);
    E_CONFIG_DD_FREE(_e_ipc_str_int_edd);
    E_CONFIG_DD_FREE(_e_ipc_str_int_list_edd);
    E_CONFIG_DD_FREE(_e_ipc_2str_int_edd);
@@ -215,6 +220,27 @@
 }
 
 int
+e_ipc_codec_2str_list_dec(char *data, int bytes, Evas_List **dest)
+{
+   E_Ipc_List *dat;
+   
+   if (!data) return 0;
+   dat = eet_data_descriptor_decode(_e_ipc_2str_list_edd, data, bytes);
+   if (!dat) return 0;
+   if (dest) *dest = dat->list;
+   free(dat);
+   return 1;
+}
+
+void *
+e_ipc_codec_2str_list_enc(Evas_List *list, int *size_ret)
+{
+   E_Ipc_List dat;
+   dat.list = list;
+   return eet_data_descriptor_encode(_e_ipc_2str_list_edd, &dat, size_ret);
+}
+
+int
 e_ipc_codec_str_list_dec(char *data, int bytes, Evas_List **dest)
 {
    E_Ipc_List *dat;
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_ipc_codec.h,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -3 -r1.6 -r1.7
--- e_ipc_codec.h       27 Jun 2005 13:50:10 -0000      1.6
+++ e_ipc_codec.h       10 Jul 2005 23:26:50 -0000      1.7
@@ -83,12 +83,17 @@
 EAPI void    *e_ipc_codec_double_enc(double val, int *size_ret);
 EAPI int      e_ipc_codec_2int_dec(char *data, int bytes, int *dest, int 
*dest2x);
 EAPI void    *e_ipc_codec_2int_enc(int val1, int val2, int *size_ret);
+
 EAPI int      e_ipc_codec_str_dec(char *data, int bytes, char **dest);
 EAPI void    *e_ipc_codec_str_enc(char *str, int *size_ret);
-EAPI int      e_ipc_codec_2str_dec(char *data, int bytes, E_Ipc_2Str **dest);
-EAPI void    *e_ipc_codec_2str_enc(char *str1, char *str2, int *size_ret);
 EAPI int      e_ipc_codec_str_list_dec(char *data, int bytes, Evas_List 
**dest);
 EAPI void    *e_ipc_codec_str_list_enc(Evas_List *list, int *size_ret);
+
+EAPI int      e_ipc_codec_2str_dec(char *data, int bytes, E_Ipc_2Str **dest);
+EAPI void    *e_ipc_codec_2str_enc(char *str1, char *str2, int *size_ret);
+EAPI int      e_ipc_codec_2str_list_dec(char *data, int bytes, Evas_List 
**dest);
+EAPI void    *e_ipc_codec_2str_list_enc(Evas_List *list, int *size_ret);
+
 EAPI int      e_ipc_codec_str_int_dec(char *data, int bytes, E_Ipc_Str_Int 
**dest);
 EAPI void    *e_ipc_codec_str_int_enc(char *str, int val, int *size_ret);
 EAPI int      e_ipc_codec_str_int_list_dec(char *data, int bytes, Evas_List 
**dest);
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_ipc_handlers.h,v
retrieving revision 1.51
retrieving revision 1.52
diff -u -3 -r1.51 -r1.52
--- e_ipc_handlers.h    9 Jul 2005 01:00:44 -0000       1.51
+++ e_ipc_handlers.h    10 Jul 2005 23:26:50 -0000      1.52
@@ -34,6 +34,10 @@
 } \
 break;
 
+/**
+ * STRING2:
+ * decode event data of type E_Ipc_2Str
+ */
 # define STRING2(__str1, __str2, __2str, HDL) \
 case HDL: \
 if (e->data) { \
@@ -138,6 +142,9 @@
 } \
 break;
 
+/**
+ * Get event data for libe processing
+ */
 # define RESPONSE(__res, __store, HDL) \
    __store *__res = calloc(1, sizeof(__store)); \
    if (e->data) {
@@ -448,6 +455,60 @@
  } \
    break;
 
+/**
+ * STRING2_LIST:
+ * Decode event data which is a list of E_Ipc_2Str objects and iterate 
+ * the list. For each iteration the object __v will contain a decoded list
+ * element. 
+ *
+ * Use END_STRING2_LIST to terminate the loop and free all data.
+ */
+#define STRING2_LIST(__v, HDL) \
+ case HDL: { \
+    Evas_List *dat = NULL, *l; \
+    if (e_ipc_codec_2str_list_dec(e->data, e->size, &dat)) { \
+       for (l = dat; l; l = l->next) { \
+         E_Ipc_2Str *__v; \
+         __v = l->data;
+#define END_STRING2_LIST(__v) \
+         free(__v->str1); \
+         free(__v->str2); \
+         free(__v); \
+       } \
+       evas_list_free(dat); \
+    } \
+    reply_count++; \
+ } \
+   break;
+
+/** 
+ * SEND_STRING2_LIST:
+ * Start to encode a list of objects to prepare them for sending via
+ * ipc. The object __v1 will be of type __typ1 and __v2 will be of type
+ * E_Ipc_2Str. 
+ *
+ * Use END_SEND_STRING2_LIST to terminate the encode iteration and 
+ * send that data. The list will be freed.
+ */
+#define SEND_STRING2_LIST(__list, __typ1, __v1, __v2, HDL) \
+ case HDL: { \
+    Evas_List *dat = NULL, *l; \
+    void *data; int bytes; \
+    for (l = __list; l; l = l->next) { \
+       __typ1 *__v1; \
+       E_Ipc_2Str *__v2; \
+       __v1 = l->data; \
+       __v2 = calloc(1, sizeof(E_Ipc_2Str));
+#define END_SEND_STRING2_LIST(__v1, __op) \
+       dat = evas_list_append(dat, __v1); \
+    } \
+    data = e_ipc_codec_2str_list_enc(dat, &bytes); \
+    SEND_DATA(__op); \
+    FREE_LIST(dat); \
+ } \
+   break;
+
+
 #define SEND_STRING(__str, __op, HDL) \
 case HDL: { void *data; int bytes; \
    data = e_ipc_codec_str_enc(__str, &bytes); \
@@ -4054,6 +4115,37 @@
 #endif
 #undef HDL
 
+/****************************************************************************/
+#define HDL E_IPC_OP_THEMES_LIST
+#if (TYPE == E_REMOTE_OPTIONS)
+   OP("-themes-list", 0, "List themes and associated categories", 1, HDL)
+#elif (TYPE == E_REMOTE_OUT)
+   REQ_NULL(HDL);
+#elif (TYPE == E_WM_IN)
+   SEND_STRING2_LIST(e_config->themes, E_Config_Theme, theme, v, HDL);
+   v->str1 = theme->category;
+   v->str2 = theme->file;
+   END_SEND_STRING2_LIST(v, E_IPC_OP_THEMES_LIST_REPLY);
+#elif (TYPE == E_REMOTE_IN)
+#endif
+#undef HDL
+     
+/****************************************************************************/
+#define HDL E_IPC_OP_THEMES_LIST_REPLY
+#if (TYPE == E_REMOTE_OPTIONS)
+#elif (TYPE == E_REMOTE_OUT)
+#elif (TYPE == E_WM_IN)
+#elif (TYPE == E_REMOTE_IN)
+   STRING2_LIST(v, HDL);
+   printf("REPLY: CATEGORY=\"%s\" EDJE=\"%s\"\n", v->str1, v->str2);
+   END_STRING2_LIST(v);
+#endif
+#undef HDL
+     
+/****************************************************************************/
+
+
+
 #if 0
 }
 #endif
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_ipc_handlers_list.h,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -3 -r1.10 -r1.11
--- e_ipc_handlers_list.h       9 Jul 2005 01:00:44 -0000       1.10
+++ e_ipc_handlers_list.h       10 Jul 2005 23:26:51 -0000      1.11
@@ -197,3 +197,5 @@
 #define E_IPC_OP_FOCUS_SETTING_GET 197
 #define E_IPC_OP_FOCUS_SETTING_GET_REPLY 198
 #define E_IPC_OP_EXEC_ACTION 199
+#define E_IPC_OP_THEMES_LIST 200
+#define E_IPC_OP_THEMES_LIST_REPLY 201




-------------------------------------------------------
This SF.Net email is sponsored by the 'Do More With Dual!' webinar happening
July 14 at 8am PDT/11am EDT. We invite you to explore the latest in dual
core and dual graphics technology at this free one hour event hosted by HP,
AMD, and NVIDIA.  To register visit http://www.hp.com/go/dualwebinar
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to