2 # include "elementary_config.h"
4 #include <Elementary.h>
5 #ifndef ELM_LIB_QUICKLAUNCH
6 static Elm_Genlist_Item_Class it_desk;
9 desk_gl_text_get(void *data, Evas_Object *obj __UNUSED__, const char *part __UNUSED__)
12 Efreet_Desktop *d = (Efreet_Desktop *)data;
13 return strdup(d->name);
20 desk_gl_content_get(void *data, Evas_Object *obj, const char *part)
23 Efreet_Desktop *d = (Efreet_Desktop *)data;
26 ic = elm_icon_add(obj);
27 evas_object_size_hint_aspect_set(ic, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1);
28 if (!(!strcmp(part, "elm.swallow.icon"))) return ic;
29 if (!d->icon) return ic;
30 elm_icon_standard_set(ic, d->icon);
40 desk_gl_del(void *data, Evas_Object *obj __UNUSED__)
43 Efreet_Desktop *d = (Efreet_Desktop *)data;
44 efreet_desktop_free(d);
53 desktop_sel(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
60 test_icon_desktops(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
62 Evas_Object *win, *gl;
67 win = elm_win_util_standard_add("icon-desktops", "Icon Desktops");
68 elm_win_autodel_set(win, EINA_TRUE);
70 it_desk.item_style = "default";
71 it_desk.func.text_get = desk_gl_text_get;
72 it_desk.func.content_get = desk_gl_content_get;
73 it_desk.func.state_get = NULL;
74 it_desk.func.del = desk_gl_del;
76 gl = elm_genlist_add(win);
77 evas_object_size_hint_weight_set(gl, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
78 elm_win_resize_object_add(win, gl);
82 if (elm_need_efreet())
84 desktops = efreet_util_desktop_name_glob_list("*");
89 EINA_LIST_FREE(desktops, d)
90 elm_genlist_item_append(gl, &it_desk, d,
91 NULL, ELM_GENLIST_ITEM_NONE,
97 evas_object_resize(win, 320, 480);
98 evas_object_show(win);