summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorstffrdhrn <stffrdhrn>2005-07-11 12:43:27 +0000
committerstffrdhrn <stffrdhrn@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>2005-07-11 12:43:27 +0000
commit8a4ecb99cea3259f26d4b4d57cf0ef40733641ab (patch)
treebe7b440e70780f19337b20f275aaf55b2e479d2d
parentee64605f0c3ae6ba93aa9c2a2ea2bae7bd4373ee (diff)
You can now change the theme for different parts of your desktop; menus/borders etc. (requires a restart for now)
SVN revision: 15733
-rw-r--r--src/bin/e_ipc_handlers.h75
-rw-r--r--src/bin/e_ipc_handlers_list.h8
-rw-r--r--src/bin/e_theme.c75
-rw-r--r--src/bin/e_theme.h5
4 files changed, 155 insertions, 8 deletions
diff --git a/src/bin/e_ipc_handlers.h b/src/bin/e_ipc_handlers.h
index 60501ef50..5d1631b2d 100644
--- a/src/bin/e_ipc_handlers.h
+++ b/src/bin/e_ipc_handlers.h
@@ -4116,35 +4116,98 @@ break;
4116#undef HDL 4116#undef HDL
4117 4117
4118/****************************************************************************/ 4118/****************************************************************************/
4119#define HDL E_IPC_OP_THEMES_LIST 4119#define HDL E_IPC_OP_THEME_LIST
4120#if (TYPE == E_REMOTE_OPTIONS) 4120#if (TYPE == E_REMOTE_OPTIONS)
4121 OP("-themes-list", 0, "List themes and associated categories", 1, HDL) 4121 OP("-theme-list", 0, "List themes and associated categories", 1, HDL)
4122#elif (TYPE == E_REMOTE_OUT) 4122#elif (TYPE == E_REMOTE_OUT)
4123 REQ_NULL(HDL); 4123 REQ_NULL(HDL);
4124#elif (TYPE == E_WM_IN) 4124#elif (TYPE == E_WM_IN)
4125 SEND_STRING2_LIST(e_config->themes, E_Config_Theme, theme, v, HDL); 4125 SEND_STRING2_LIST(e_config->themes, E_Config_Theme, theme, v, HDL);
4126 v->str1 = theme->category; 4126 v->str1 = theme->category;
4127 v->str2 = theme->file; 4127 v->str2 = theme->file;
4128 END_SEND_STRING2_LIST(v, E_IPC_OP_THEMES_LIST_REPLY); 4128 END_SEND_STRING2_LIST(v, E_IPC_OP_THEME_LIST_REPLY);
4129#elif (TYPE == E_REMOTE_IN) 4129#elif (TYPE == E_REMOTE_IN)
4130#endif 4130#endif
4131#undef HDL 4131#undef HDL
4132 4132
4133/****************************************************************************/ 4133/****************************************************************************/
4134#define HDL E_IPC_OP_THEMES_LIST_REPLY 4134#define HDL E_IPC_OP_THEME_LIST_REPLY
4135#if (TYPE == E_REMOTE_OPTIONS) 4135#if (TYPE == E_REMOTE_OPTIONS)
4136#elif (TYPE == E_REMOTE_OUT) 4136#elif (TYPE == E_REMOTE_OUT)
4137#elif (TYPE == E_WM_IN) 4137#elif (TYPE == E_WM_IN)
4138#elif (TYPE == E_REMOTE_IN) 4138#elif (TYPE == E_REMOTE_IN)
4139 STRING2_LIST(v, HDL); 4139 STRING2_LIST(v, HDL);
4140 printf("REPLY: CATEGORY=\"%s\" EDJE=\"%s\"\n", v->str1, v->str2); 4140 printf("REPLY: CATEGORY=\"%s\" FILE=\"%s\"\n", v->str1, v->str2);
4141 END_STRING2_LIST(v); 4141 END_STRING2_LIST(v);
4142#endif 4142#endif
4143#undef HDL 4143#undef HDL
4144 4144
4145/****************************************************************************/ 4145/****************************************************************************/
4146 4146
4147#define HDL E_IPC_OP_THEME_SET
4148#if (TYPE == E_REMOTE_OPTIONS)
4149 OP("-theme-set", 2, "Set theme category (OPT1) and edje file (OPT2)", 0, HDL)
4150#elif (TYPE == E_REMOTE_OUT)
4151 REQ_2STRING(params[0], params[1], HDL)
4152#elif (TYPE == E_WM_IN)
4153 STRING2(category, file, e_2str, HDL);
4154 e_theme_config_set(category, file);
4155 SAVE;
4156 END_STRING2(e_2str);
4157#elif (TYPE == E_REMOTE_IN)
4158#endif
4159#undef HDL
4160
4161/****************************************************************************/
4162#define HDL E_IPC_OP_THEME_GET
4163#if (TYPE == E_REMOTE_OPTIONS)
4164 OP("-theme-get", 1, "List the theme associated with the category OPT1", 1, HDL)
4165#elif (TYPE == E_REMOTE_OUT)
4166 REQ_STRING(params[0], HDL);
4167#elif (TYPE == E_WM_IN)
4168 STRING(category, HDL);
4169 E_Config_Theme *ect;
4170 void *data;
4171 int bytes;
4172
4173 ect = e_theme_config_get(category);
4174 data = e_ipc_codec_2str_enc(ect->category, ect->file, &bytes);
4175 SEND_DATA(E_IPC_OP_THEME_GET_REPLY);
4176
4177 END_STRING(category);
4178#elif (TYPE == E_REMOTE_IN)
4179#endif
4180#undef HDL
4181
4182/****************************************************************************/
4183#define HDL E_IPC_OP_THEME_GET_REPLY
4184#if (TYPE == E_REMOTE_OPTIONS)
4185#elif (TYPE == E_REMOTE_OUT)
4186#elif (TYPE == E_WM_IN)
4187#elif (TYPE == E_REMOTE_IN)
4188 STRING2(category, file, e_2str, HDL);
4189 printf("REPLY: DEFAULT CATEGORY=\"%s\" FILE=\"%s\"\n",
4190 category, file);
4191 END_STRING2(e_2str);
4192#endif
4193#undef HDL
4194
4195/****************************************************************************/
4196#define HDL E_IPC_OP_THEME_REMOVE
4197#if (TYPE == E_REMOTE_OPTIONS)
4198 OP("-theme-remove", 1, "Remove the theme category OPT1", 0, HDL)
4199#elif (TYPE == E_REMOTE_OUT)
4200 REQ_STRING(params[0], HDL);
4201#elif (TYPE == E_WM_IN)
4202 STRING(category, HDL);
4203 e_theme_config_remove(category);
4204 SAVE;
4205 END_STRING(category);
4206#elif (TYPE == E_REMOTE_IN)
4207#endif
4208#undef HDL
4147 4209
4210/****************************************************************************/
4148 4211
4149#if 0 4212#if 0
4150} 4213}
diff --git a/src/bin/e_ipc_handlers_list.h b/src/bin/e_ipc_handlers_list.h
index 6d650b3b0..77f06b43d 100644
--- a/src/bin/e_ipc_handlers_list.h
+++ b/src/bin/e_ipc_handlers_list.h
@@ -197,5 +197,9 @@
197#define E_IPC_OP_FOCUS_SETTING_GET 197 197#define E_IPC_OP_FOCUS_SETTING_GET 197
198#define E_IPC_OP_FOCUS_SETTING_GET_REPLY 198 198#define E_IPC_OP_FOCUS_SETTING_GET_REPLY 198
199#define E_IPC_OP_EXEC_ACTION 199 199#define E_IPC_OP_EXEC_ACTION 199
200#define E_IPC_OP_THEMES_LIST 200 200#define E_IPC_OP_THEME_LIST 200
201#define E_IPC_OP_THEMES_LIST_REPLY 201 201#define E_IPC_OP_THEME_LIST_REPLY 201
202#define E_IPC_OP_THEME_GET 202
203#define E_IPC_OP_THEME_GET_REPLY 203
204#define E_IPC_OP_THEME_REMOVE 204
205#define E_IPC_OP_THEME_SET 205
diff --git a/src/bin/e_theme.c b/src/bin/e_theme.c
index 70b9b3cb6..9915197ad 100644
--- a/src/bin/e_theme.c
+++ b/src/bin/e_theme.c
@@ -243,6 +243,81 @@ e_theme_file_set(char *category, char *file)
243} 243}
244 244
245void 245void
246e_theme_config_set(const char *category, const char *file)
247{
248 E_Config_Theme *ect;
249 Evas_List *next;
250
251 /* search for the category */
252 for (next = e_config->themes; next; next = next->next)
253 {
254 ect = evas_list_data(next);
255 if (!strcmp(ect->category, category))
256 {
257 E_FREE(ect->file);
258 ect->file = strdup(file);
259 return;
260 }
261 }
262
263 /* the text class doesnt exist */
264 ect = E_NEW(E_Config_Theme, 1);
265 ect->category = strdup(category);
266 ect->file = strdup(file);
267
268 e_config->themes = evas_list_append(e_config->themes, ect);
269}
270
271/*
272 * returns a pointer to the data, return null if nothing if found.
273 */
274E_Config_Theme *
275e_theme_config_get(const char *category)
276{
277 E_Config_Theme *ect = NULL;
278 Evas_List *next;
279
280 /* search for the category */
281 for (next = e_config->themes; next; next = next->next)
282 {
283 ect = evas_list_data(next);
284 if (!strcmp(ect->category, category))
285 {
286 return ect;
287 }
288 }
289 return NULL;
290}
291
292void
293e_theme_config_remove(const char *category)
294{
295 E_Config_Theme *ect;
296 Evas_List *next;
297
298 /* search for the category */
299 for (next = e_config->themes; next; next = next->next)
300 {
301 ect = evas_list_data(next);
302 if (!strcmp(ect->category, category))
303 {
304 e_config->themes = evas_list_remove_list(
305 e_config->themes, next);
306 E_FREE(ect->category);
307 E_FREE(ect->file);
308 E_FREE(ect);
309 return;
310 }
311 }
312}
313
314Evas_List *
315e_theme_config_list(void)
316{
317 return e_config->themes;
318}
319
320void
246e_theme_about(E_Zone *zone, const char *file) 321e_theme_about(E_Zone *zone, const char *file)
247{ 322{
248 static E_Popup *pop = NULL; 323 static E_Popup *pop = NULL;
diff --git a/src/bin/e_theme.h b/src/bin/e_theme.h
index bf3987c0d..a865fa104 100644
--- a/src/bin/e_theme.h
+++ b/src/bin/e_theme.h
@@ -12,6 +12,11 @@ EAPI int e_theme_shutdown(void);
12EAPI int e_theme_edje_object_set(Evas_Object *o, char *category, char *group); 12EAPI int e_theme_edje_object_set(Evas_Object *o, char *category, char *group);
13EAPI const char *e_theme_edje_file_get(char *category, char *group); 13EAPI const char *e_theme_edje_file_get(char *category, char *group);
14EAPI void e_theme_file_set(char *category, char *file); 14EAPI void e_theme_file_set(char *category, char *file);
15
16EAPI void e_theme_config_set(const char *category, const char *file);
17EAPI E_Config_Theme *e_theme_config_get(const char *category);
18EAPI void e_theme_config_remove(const char *category);
19EAPI Evas_List *e_theme_config_list(void);
15 20
16#endif 21#endif
17#endif 22#endif