int _ex_file_is_ebg(char *file) { int val; char *ext; Eina_List *groups, *l; ext = strrchr(file, '.'); if (!ext) return 0; if (strcasecmp(ext, ".edj")) return 0; val = 0; groups = edje_file_collection_list(file); if (!groups) return 0; for (l = groups; l; l = l->next) { if (!strcmp(l->data, "e/desktop/background")) { val = 1; break; } } edje_file_collection_list_free(groups); return val; }
void tree_combobox_populate(void) { Eina_List *groups, *l; char *data; //Stop signal propagation etk_signal_block("active-item-changed", ETK_OBJECT(UI_GroupsComboBox), ETK_CALLBACK(_tree_combobox_active_item_changed_cb), NULL); etk_signal_block("item-activated",ETK_OBJECT(UI_PartSourceComboBox), _part_SourceComboBox_item_activated_cb, NULL); etk_combobox_entry_autosearch_set(ETK_COMBOBOX_ENTRY(UI_GroupsComboBox), -1, NULL); //Clear the combos etk_combobox_entry_clear(ETK_COMBOBOX_ENTRY(UI_GroupsComboBox)); etk_combobox_clear(ETK_COMBOBOX(UI_PartSourceComboBox)); etk_combobox_item_append(ETK_COMBOBOX(UI_PartSourceComboBox), "None"); //Populate UI_GroupsComboBox & UI_PartSourceComboBox groups = edje_file_collection_list(Cur.edj_temp_name->string); EINA_LIST_FOREACH(groups, l, data) { etk_combobox_entry_item_append(ETK_COMBOBOX_ENTRY(UI_GroupsComboBox), data, NULL); etk_combobox_item_append(ETK_COMBOBOX(UI_PartSourceComboBox), data); }
static Evas_Object * _page_grid_add(Evas_Object *parent, App_Inwin_Data *aid) { Evas_Object *grid; char *theme, *emo; Eina_List *emos, *it; static Elm_Gengrid_Item_Class *it_class; it_class = elm_gengrid_item_class_new(); it_class->item_style = "default"; it_class->func.text_get = _emo_label_get; it_class->func.content_get = _emo_content_get; it_class->func.del = _emo_del; theme = elm_theme_list_item_path_get("default", NULL); if (!theme) return NULL; emos = edje_file_collection_list(theme); free(theme); if (!emos) return NULL; grid = elm_gengrid_add(parent); elm_gengrid_item_size_set(grid, 64, 80); evas_object_size_hint_weight_set(grid, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_size_hint_align_set(grid, EVAS_HINT_FILL, EVAS_HINT_FILL); EINA_LIST_FOREACH(emos, it, emo) { char name[512]; if (strncmp(emo, "elm/entry/emoticon/", 19)) continue; sscanf(emo, "elm/entry/emoticon/%[^/]/default", name); elm_gengrid_item_append(grid, it_class, strdup(name), _it_sel_cb, aid); }
PREFIX value ml_edje_file_collection_list(value v_theme) { Eina_List* list = edje_file_collection_list(String_val(v_theme)); value v_list = copy_Eina_List_string(list); edje_file_collection_list_free(list); return v_list; }
void theme_load(const char *edje_file) { Eina_List *l = NULL, *ll = NULL; char *group = NULL, *token = NULL; char *style = NULL; char buf[PATH_MAX] = {0, }; Widget_Data *wd = NULL; Eina_Compare_Cb cmp_func = (Eina_Compare_Cb)strcmp; if (!edje_file) return; l = edje_file_collection_list(edje_file); if (!l) return; EINA_LIST_FOREACH(l, ll, group) { strncpy(buf, group, sizeof(buf)); token = strtok(buf, "/"); if (strncmp("elm", token, 5)) { //ERR("%s is not a proper elementary style.", token); continue; } // get the widget name token = strtok(NULL, "/"); if (!token) continue; // get the widget data of the widget wd = NULL; EINA_LIST_FOREACH(widget_list, l, wd) { if (!strcmp(widget_name_get_by_type(wd->type), token)) break; } if (!wd) { //ERR("%s is not a proper elementary widget.", token); continue; } // get the style name style = strstr(group, "/"); style = strstr(style + 1, "/"); style++; //INF("%s %s %p", group, style, wd); wd->styles = eina_list_sorted_insert(wd->styles, cmp_func, style); }
E_API int e_util_edje_collection_exists(const char *file, const char *coll) { Eina_List *clist; Eina_Stringshare *str; Eina_Bool ret = EINA_FALSE; clist = edje_file_collection_list(file); EINA_LIST_FREE(clist, str) { if ((!ret) && (!strcmp(coll, str))) ret = EINA_TRUE; eina_stringshare_del(str); } return ret; }