Enlightenment CVS committal

Author  : stffrdhrn
Project : e17
Module  : apps/e

Dir     : e17/apps/e/src/bin


Modified Files:
        e_ipc_handlers.h e_ipc_handlers_list.h e_theme.c e_theme.h 


Log Message:
You can now change the theme for different parts of your desktop; menus/borders 
etc. (requires a restart for now)
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_ipc_handlers.h,v
retrieving revision 1.52
retrieving revision 1.53
diff -u -3 -r1.52 -r1.53
--- e_ipc_handlers.h    10 Jul 2005 23:26:50 -0000      1.52
+++ e_ipc_handlers.h    11 Jul 2005 12:43:27 -0000      1.53
@@ -4116,35 +4116,98 @@
 #undef HDL
 
 /****************************************************************************/
-#define HDL E_IPC_OP_THEMES_LIST
+#define HDL E_IPC_OP_THEME_LIST
 #if (TYPE == E_REMOTE_OPTIONS)
-   OP("-themes-list", 0, "List themes and associated categories", 1, HDL)
+   OP("-theme-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);
+   END_SEND_STRING2_LIST(v, E_IPC_OP_THEME_LIST_REPLY);
 #elif (TYPE == E_REMOTE_IN)
 #endif
 #undef HDL
-     
+    
 /****************************************************************************/
-#define HDL E_IPC_OP_THEMES_LIST_REPLY
+#define HDL E_IPC_OP_THEME_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);
+   printf("REPLY: CATEGORY=\"%s\" FILE=\"%s\"\n", v->str1, v->str2);
    END_STRING2_LIST(v);
 #endif
 #undef HDL
      
 /****************************************************************************/
 
+#define HDL E_IPC_OP_THEME_SET
+#if (TYPE == E_REMOTE_OPTIONS)
+   OP("-theme-set", 2, "Set theme category (OPT1) and edje file (OPT2)", 0, 
HDL)
+#elif (TYPE == E_REMOTE_OUT)
+   REQ_2STRING(params[0], params[1], HDL) 
+#elif (TYPE == E_WM_IN)
+   STRING2(category, file, e_2str, HDL);
+   e_theme_config_set(category, file);
+   SAVE;   
+   END_STRING2(e_2str);
+#elif (TYPE == E_REMOTE_IN)
+#endif
+#undef HDL
 
+/****************************************************************************/
+#define HDL E_IPC_OP_THEME_GET
+#if (TYPE == E_REMOTE_OPTIONS)
+   OP("-theme-get", 1, "List the theme associated with the category OPT1", 1, 
HDL)
+#elif (TYPE == E_REMOTE_OUT)
+   REQ_STRING(params[0], HDL);
+#elif (TYPE == E_WM_IN)
+   STRING(category, HDL);
+   E_Config_Theme *ect;
+   void *data;
+   int bytes;
+   
+   ect = e_theme_config_get(category);
+   data = e_ipc_codec_2str_enc(ect->category, ect->file, &bytes);   
+   SEND_DATA(E_IPC_OP_THEME_GET_REPLY);
+
+   END_STRING(category);
+#elif (TYPE == E_REMOTE_IN)
+#endif
+#undef HDL
+
+/****************************************************************************/
+#define HDL E_IPC_OP_THEME_GET_REPLY
+#if (TYPE == E_REMOTE_OPTIONS)
+#elif (TYPE == E_REMOTE_OUT)
+#elif (TYPE == E_WM_IN)
+#elif (TYPE == E_REMOTE_IN)
+   STRING2(category, file, e_2str, HDL);
+   printf("REPLY: DEFAULT CATEGORY=\"%s\" FILE=\"%s\"\n",
+                    category, file); 
+   END_STRING2(e_2str);
+#endif
+#undef HDL
+
+/****************************************************************************/
+#define HDL E_IPC_OP_THEME_REMOVE
+#if (TYPE == E_REMOTE_OPTIONS)
+   OP("-theme-remove", 1, "Remove the theme category OPT1", 0, HDL)
+#elif (TYPE == E_REMOTE_OUT)
+   REQ_STRING(params[0], HDL);
+#elif (TYPE == E_WM_IN)
+   STRING(category, HDL);
+   e_theme_config_remove(category);
+   SAVE;
+   END_STRING(category);
+#elif (TYPE == E_REMOTE_IN)
+#endif
+#undef HDL
+
+/****************************************************************************/
 
 #if 0
 }
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_ipc_handlers_list.h,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -3 -r1.11 -r1.12
--- e_ipc_handlers_list.h       10 Jul 2005 23:26:51 -0000      1.11
+++ e_ipc_handlers_list.h       11 Jul 2005 12:43:27 -0000      1.12
@@ -197,5 +197,9 @@
 #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
+#define E_IPC_OP_THEME_LIST 200
+#define E_IPC_OP_THEME_LIST_REPLY 201
+#define E_IPC_OP_THEME_GET 202
+#define E_IPC_OP_THEME_GET_REPLY 203
+#define E_IPC_OP_THEME_REMOVE 204
+#define E_IPC_OP_THEME_SET 205
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_theme.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -3 -r1.10 -r1.11
--- e_theme.c   29 Jun 2005 14:28:47 -0000      1.10
+++ e_theme.c   11 Jul 2005 12:43:27 -0000      1.11
@@ -243,6 +243,81 @@
 }
 
 void
+e_theme_config_set(const char *category, const char *file)
+{
+   E_Config_Theme *ect;
+   Evas_List *next;
+
+   /* search for the category */
+   for (next = e_config->themes; next; next = next->next)
+     {
+       ect = evas_list_data(next);
+       if (!strcmp(ect->category, category))
+         {
+            E_FREE(ect->file);
+            ect->file = strdup(file);
+            return;
+         }
+     }
+
+   /* the text class doesnt exist */
+   ect = E_NEW(E_Config_Theme, 1);
+   ect->category = strdup(category);
+   ect->file = strdup(file);
+   
+   e_config->themes = evas_list_append(e_config->themes, ect);
+}
+
+/*
+ * returns a pointer to the data, return null if nothing if found.
+ */
+E_Config_Theme *
+e_theme_config_get(const char *category)
+{
+   E_Config_Theme *ect = NULL;
+   Evas_List *next;
+
+   /* search for the category */
+   for (next = e_config->themes; next; next = next->next)
+     {
+       ect = evas_list_data(next);
+       if (!strcmp(ect->category, category))
+         {
+            return ect;
+         }
+     }
+   return NULL;
+}
+
+void
+e_theme_config_remove(const char *category)
+{
+   E_Config_Theme *ect;
+   Evas_List *next;
+   
+   /* search for the category */
+   for (next = e_config->themes; next; next = next->next)
+     {
+       ect = evas_list_data(next);
+       if (!strcmp(ect->category, category))
+         {
+            e_config->themes = evas_list_remove_list(
+                                       e_config->themes, next);
+            E_FREE(ect->category);
+            E_FREE(ect->file);
+            E_FREE(ect);
+            return;
+         }
+    }
+}
+
+Evas_List *
+e_theme_config_list(void)
+{
+   return e_config->themes;
+}
+
+void
 e_theme_about(E_Zone *zone, const char *file)
 {
    static E_Popup *pop = NULL;
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_theme.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -3 -r1.2 -r1.3
--- e_theme.h   23 Apr 2005 05:16:24 -0000      1.2
+++ e_theme.h   11 Jul 2005 12:43:27 -0000      1.3
@@ -12,6 +12,11 @@
 EAPI int         e_theme_edje_object_set(Evas_Object *o, char *category, char 
*group);
 EAPI const char *e_theme_edje_file_get(char *category, char *group);
 EAPI void        e_theme_file_set(char *category, char *file);
+
+EAPI void       e_theme_config_set(const char *category, const char *file);
+EAPI E_Config_Theme *e_theme_config_get(const char *category);
+EAPI void       e_theme_config_remove(const char *category);
+EAPI Evas_List *e_theme_config_list(void);
     
 #endif
 #endif




-------------------------------------------------------
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
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to