1 #include <Elementary.h>
3 # include "elementary_config.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, *bg, *gl;
67 win = elm_win_add(NULL, "icon-desktops", ELM_WIN_BASIC);
68 elm_win_title_set(win, "Icon Desktops");
69 elm_win_autodel_set(win, EINA_TRUE);
72 evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
73 elm_win_resize_object_add(win, bg);
76 it_desk.item_style = "default";
77 it_desk.func.text_get = desk_gl_text_get;
78 it_desk.func.content_get = desk_gl_content_get;
79 it_desk.func.state_get = NULL;
80 it_desk.func.del = desk_gl_del;
82 gl = elm_genlist_add(win);
83 evas_object_size_hint_weight_set(gl, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
84 elm_win_resize_object_add(win, gl);
88 if (elm_need_efreet())
90 desktops = efreet_util_desktop_name_glob_list("*");
95 EINA_LIST_FREE(desktops, d)
96 elm_genlist_item_append(gl, &it_desk, d,
97 NULL, ELM_GENLIST_ITEM_NONE,
103 evas_object_resize(win, 320, 480);
104 evas_object_show(win);