diff --git a/src/daemon/Makefile.mk b/src/daemon/Makefile.mk index 537bece..cebee5a 100644 --- a/src/daemon/Makefile.mk +++ b/src/daemon/Makefile.mk @@ -20,6 +20,8 @@ src/daemon/entrance_action.h \ src/daemon/entrance_action.c \ src/daemon/entrance_image.h \ src/daemon/entrance_image.c \ +src/daemon/entrance_theme.h \ +src/daemon/entrance_theme.c \ src/daemon/entrance.h \ src/daemon/entrance.c diff --git a/src/daemon/entrance.h b/src/daemon/entrance.h index 97d669c..5b9cf8b 100644 --- a/src/daemon/entrance.h +++ b/src/daemon/entrance.h @@ -24,6 +24,7 @@ #include "entrance_history.h" #include "entrance_action.h" #include "entrance_image.h" +#include "entrance_theme.h" #define PT(f, x...) \ do \ diff --git a/src/daemon/entrance_server.c b/src/daemon/entrance_server.c index 4e9b4f8..42cce8d 100644 --- a/src/daemon/entrance_server.c +++ b/src/daemon/entrance_server.c @@ -46,6 +46,10 @@ _entrance_server_add(void *data EINA_UNUSED, int type EINA_UNUSED, void *event E eev.event.pools.icon_pool = entrance_image_system_icons(); eev.event.pools.background_pool = entrance_image_system_backgrounds(); entrance_event_send(&eev); + PT("Sending themes\n"); + eev.type = ENTRANCE_EVENT_THEMES; + eev.event.themes.themes = entrance_theme_themes_get(); + entrance_event_send(&eev); return ECORE_CALLBACK_RENEW; } diff --git a/src/daemon/entrance_theme.c b/src/daemon/entrance_theme.c new file mode 100644 index 0000000..c7ffc6a --- /dev/null +++ b/src/daemon/entrance_theme.c @@ -0,0 +1,25 @@ +#include "entrance.h" + +Eina_List * +entrance_theme_themes_get(void) +{ + Eina_Iterator *themes; + Eina_List *targets = NULL; + Eina_File_Direct_Info *file_stat; + char *basename; + + themes = eina_file_stat_ls(PACKAGE_DATA_DIR"/themes/"); + if (!themes) + return NULL; + EINA_ITERATOR_FOREACH(themes, file_stat) + { + basename = eina_str_split(&file_stat->path[file_stat->name_start], ".",2)[0]; + if (basename[0] != '.' + && file_stat->type == EINA_FILE_REG + && eina_str_has_extension(file_stat->path, ".edj")) + targets = eina_list_append(targets, eina_stringshare_add(basename)); + } + eina_iterator_free(themes); + return targets; +} + diff --git a/src/daemon/entrance_theme.h b/src/daemon/entrance_theme.h new file mode 100644 index 0000000..81ce62b --- /dev/null +++ b/src/daemon/entrance_theme.h @@ -0,0 +1,7 @@ +#ifndef ENTRANCE_THEME_H_ +#define ENTRANCE_THEME_H_ +#include "entrance.h" + +Eina_List* entrance_theme_themes_get(void); + +#endif /* ENTRANCE_H_ */