1 #include <Elementary.h>
3 # include "elementary_config.h"
5 #ifndef ELM_LIB_QUICKLAUNCH
6 typedef struct _Testitem
8 Elm_Genlist_Item *item;
14 static Elm_Genlist_Item_Class itc1;
15 static char *glf_label_get(void *data, Evas_Object *obj __UNUSED__, const char *part __UNUSED__)
18 snprintf(buf, sizeof(buf), "Item # %i", (int)(long)data);
22 static Evas_Object *glf_content_get(void *data __UNUSED__, Evas_Object *obj, const char *part __UNUSED__)
25 Evas_Object *ic = elm_icon_add(obj);
26 snprintf(buf, sizeof(buf), "%s/images/logo_small.png", elm_app_data_dir_get());
27 elm_icon_file_set(ic, buf, NULL);
28 evas_object_size_hint_aspect_set(ic, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1);
31 static Eina_Bool glf_state_get(void *data __UNUSED__, Evas_Object *obj __UNUSED__, const char *part __UNUSED__)
35 static void glf_del(void *data __UNUSED__, Evas_Object *obj __UNUSED__)
40 gl_sel(void *data, Evas_Object *obj, void *event_info)
42 printf("sel item data [%p] on genlist obj [%p], item pointer [%p]\n", data, obj, event_info);
48 Evas_Object *gl = data;
52 x = (sin(ecore_loop_time_get()) * 500);
53 evas_object_move(gl, x, y);
54 return ECORE_CALLBACK_RENEW;
58 _del(void *data, Evas *evas __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
60 Ecore_Animator *ani = data;
62 ecore_animator_del(ani);
66 test_floating(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
68 Evas_Object *win, *bg, *gl;
72 win = elm_win_add(NULL, "floating", ELM_WIN_BASIC);
73 elm_win_title_set(win, "Floating");
74 elm_win_autodel_set(win, EINA_TRUE);
77 elm_win_resize_object_add(win, bg);
78 evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
81 gl = elm_genlist_add(win);
82 evas_object_size_hint_weight_set(gl, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
83 evas_object_size_hint_align_set(gl, EVAS_HINT_FILL, EVAS_HINT_FILL);
84 evas_object_move(gl, 800, 0);
85 evas_object_resize(gl, 480, 800);
88 itc1.item_style = "default";
89 itc1.func.label_get = glf_label_get;
90 itc1.func.content_get = glf_content_get;
91 itc1.func.state_get = glf_state_get;
92 itc1.func.del = glf_del;
94 for (i = 0; i < 20; i++)
96 elm_genlist_item_append(gl, &itc1,
97 (void *)(long)i/* item data */,
99 ELM_GENLIST_ITEM_NONE,
101 (void *)(long)(i * 10)/* func data */);
103 evas_object_resize(win, 480, 800);
104 evas_object_show(win);
106 ani = ecore_animator_add(anim, gl);
107 evas_object_event_callback_add(win, EVAS_CALLBACK_DEL, _del, ani);