You can now change the theme for different parts of your desktop; menus/borders etc. (requires a restart for now)

SVN revision: 15733
This commit is contained in:
stffrdhrn 2005-07-11 12:43:27 +00:00 committed by stffrdhrn
parent ee64605f0c
commit 8a4ecb99ce
4 changed files with 155 additions and 8 deletions

View File

@ -4116,35 +4116,98 @@ break;
#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
}

View File

@ -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

View File

@ -242,6 +242,81 @@ e_theme_file_set(char *category, char *file)
mappings = evas_hash_add(mappings, category, res);
}
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)
{

View File

@ -12,6 +12,11 @@ EAPI int e_theme_shutdown(void);
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