Hi,

In an app I'm writing, I needed to get what is the current theme used in e17, but that functionality is not available in E_Lib.h
here's a patch that adds e_lib_theme_get() call.

this is diffed from the src/ folder, hope this is fine.

--
Chady Kassouf
http://chady.net/
Index: bin/e_ipc_handlers.h
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_ipc_handlers.h,v
retrieving revision 1.56
diff -u -r1.56 e_ipc_handlers.h
--- bin/e_ipc_handlers.h	13 Jul 2005 04:46:33 -0000	1.56
+++ bin/e_ipc_handlers.h	18 Jul 2005 19:39:51 -0000
@@ -4190,6 +4190,13 @@
    printf("REPLY: DEFAULT CATEGORY=\"%s\" FILE=\"%s\"\n",
                     category, file); 
    END_STRING2(e_2str);
+#elif (TYPE == E_LIB_IN)
+   STRING2(category, file, e_2str, HDL);
+   RESPONSE(r, E_Response_Theme_Get, HDL);
+   r->file = strdup(file);
+   r->category = strdup(category);
+   END_RESPONSE(r, E_RESPONSE_THEME_GET);
+   END_STRING2(e_2str);
 #endif
 #undef HDL
 
Index: lib/E_Lib.h
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/e/src/lib/E_Lib.h,v
retrieving revision 1.2
diff -u -r1.2 E_Lib.h
--- lib/E_Lib.h	8 Jun 2005 20:43:46 -0000	1.2
+++ lib/E_Lib.h	18 Jul 2005 19:40:16 -0000
@@ -24,6 +24,7 @@
 typedef struct _E_Response_Dirs_List	E_Response_Dirs_List;
 typedef struct _E_Response_Background_Get E_Response_Background_Get;
 typedef struct _E_Response_Language_Get E_Response_Language_Get;
+typedef struct _E_Response_Theme_Get E_Response_Theme_Get;
 
 struct _E_Response_Module_List
 {
@@ -48,6 +49,12 @@
    char   *file;
 };
 
+struct _E_Response_Theme_Get
+{
+   char   *file;
+   char   *category;
+};
+
 struct _E_Response_Language_Get
 {
    char   *lang;
@@ -56,6 +63,7 @@
 extern EAPI int E_RESPONSE_MODULE_LIST;
 extern EAPI int E_RESPONSE_BACKGROUND_GET;
 extern EAPI int E_RESPONSE_LANGUAGE_GET;
+extern EAPI int E_RESPONSE_THEME_GET;
 
 extern EAPI int E_RESPONSE_DATA_DIRS_LIST;
 extern EAPI int E_RESPONSE_IMAGE_DIRS_LIST;
@@ -87,6 +95,9 @@
    EAPI void         e_lib_background_set             (const char *bgfile);
    EAPI void         e_lib_background_get             (void);
 
+   /* E current theme manipulation */
+   EAPI void         e_lib_theme_get                  (const char *category);
+
    /* languages */
    EAPI void         e_lib_language_set               (const char *lang);
    EAPI void         e_lib_language_get               (void);
Index: lib/e_main.c
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/e/src/lib/e_main.c,v
retrieving revision 1.24
diff -u -r1.24 e_main.c
--- lib/e_main.c	8 Jun 2005 20:43:46 -0000	1.24
+++ lib/e_main.c	18 Jul 2005 19:40:17 -0000
@@ -56,6 +56,7 @@
 int E_RESPONSE_MODULE_LIST = 0;
 int E_RESPONSE_BACKGROUND_GET = 0;
 int E_RESPONSE_LANGUAGE_GET = 0;
+int E_RESPONSE_THEME_GET = 0;
 
 int E_RESPONSE_DATA_DIRS_LIST = 0;
 int E_RESPONSE_IMAGE_DIRS_LIST = 0;
@@ -140,6 +141,7 @@
      {
 	E_RESPONSE_MODULE_LIST = ecore_event_type_new();
 	E_RESPONSE_BACKGROUND_GET = ecore_event_type_new();
+	E_RESPONSE_THEME_GET = ecore_event_type_new();
 	E_RESPONSE_LANGUAGE_GET = ecore_event_type_new();
 
 	E_RESPONSE_DATA_DIRS_LIST = ecore_event_type_new();
@@ -241,6 +243,18 @@
 }
 
 void
+e_lib_theme_get(const char *category)
+{
+   char *tmp;
+   if (!category)
+     return;
+
+   tmp = strdup(category);
+   _e_ipc_call(E_IPC_OP_THEME_GET, &tmp);
+   free(tmp);
+}
+
+void
 e_lib_language_set(const char *lang)
 {
    char *tmp;

Reply via email to