1 #define EFL_GFX_FILTER_BETA
8 #define FNAME snapshot_widgets_file_icons_start
9 #define NAME "Snapshot Widgets File Icons"
10 #define ICON "widgets.png"
21 static Evas_Object *o_images[NUM];
22 static Evas_Object *o_texts[NUM];
23 static Evas_Object *o_snap;
25 static const char *icons[] =
46 static void _setup(void)
53 for (i = 0; i < NUM; i++)
55 Evas_Coord tw, th, cent;
57 o = efl_add(EFL_CANVAS_IMAGE_CLASS, evas);
59 efl_file_simple_load(o, build_path(icons[i % 13]), NULL);
60 efl_gfx_fill_set(o, EINA_RECT(0, 0, ICON_SIZE, ICON_SIZE));
61 efl_gfx_entity_size_set(o, EINA_SIZE2D(ICON_SIZE, ICON_SIZE));
62 efl_gfx_entity_position_set(o, EINA_POSITION2D(x + 8, y));
63 efl_gfx_entity_visible_set(o, EINA_TRUE);
65 o = evas_object_text_add(evas);
67 efl_text_font_family_set(o, "Vera-Bold");
68 efl_text_font_size_set(o, 10);
69 efl_text_set(o, icons[i % 13]);
70 evas_object_text_style_set(o, EVAS_TEXT_STYLE_FAR_SOFT_SHADOW);
71 efl_gfx_color_set(o, 255, 255, 255, 255);
72 evas_object_text_shadow_color_set(o, 0, 0, 0, 24);
73 efl_gfx_entity_visible_set(o, EINA_TRUE);
74 exp_size_get(o, &tw, &th);
75 cent = ICON_SIZE + 16 - tw / 2;
76 efl_gfx_entity_position_set(o, EINA_POSITION2D(x + cent, y + ICON_SIZE + 4));
86 "blur { 5, dst = a, color = '#ff0' }"
89 o = efl_add(EFL_CANVAS_SNAPSHOT_CLASS, evas);
91 efl_gfx_entity_visible_set(o, EINA_TRUE);
92 efl_gfx_entity_position_set(o, EINA_POSITION2D(50, 50));
93 efl_gfx_entity_size_set(o, EINA_SIZE2D(200, 200));
94 efl_gfx_fill_set(o, EINA_RECT(0, 0, 200, 200));
95 efl_gfx_filter_program_set(o, filter, "test");
101 static void _cleanup(void)
104 for (i = 0; i < NUM; i++)
106 efl_del(o_images[i]);
112 /* loop - do things */
116 static void _loop(double t, int f)
119 Evas_Coord x, y, tw, th, cent;
122 for (i = 0; i < NUM; i++)
124 efl_gfx_entity_position_set(o_images[i], EINA_POSITION2D(x + 8, y));
125 exp_size_get(o_texts[i], &tw, &th);
126 cent = (ICON_SIZE + 16 - tw) / 2;
127 efl_gfx_entity_position_set(o_texts[i], EINA_POSITION2D(x + cent, y + ICON_SIZE + 4));
138 evas_object_geometry_get(o_snap, &x, &y, NULL, NULL);
141 if (x + dx >= win_w) dx = -dx;
145 if (x + dx <= 0) dx = -dx;
151 if (y + dy >= win_h) dy = -dy;
155 if (y + dy <= 0) dy = -dy;
159 evas_object_move(o_snap, x, y);
165 /* prepend special key handlers if interactive (before STD) */
166 static void _key(const char *key)
182 /* template stuff - ignore */
187 _ui_menu_item_add(ICON, NAME, FNAME);
199 ui_func_set(_key, _loop);