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);
68 efl_text_font_family_set(o, "Vera-Bold");
69 efl_text_font_size_set(o, 10);
70 efl_text_set(o, icons[i % 13]);
72 evas_object_text_font_set(o, "Vera-Bold", 10);
73 evas_object_text_text_set(o, icons[i % 13]);
75 evas_object_text_style_set(o, EVAS_TEXT_STYLE_FAR_SOFT_SHADOW);
76 efl_gfx_color_set(o, 255, 255, 255, 255);
77 evas_object_text_shadow_color_set(o, 0, 0, 0, 24);
78 efl_gfx_entity_visible_set(o, EINA_TRUE);
79 exp_size_get(o, &tw, &th);
80 cent = ICON_SIZE + 16 - tw / 2;
81 efl_gfx_entity_position_set(o, EINA_POSITION2D(x + cent, y + ICON_SIZE + 4));
91 "blur { 5, dst = a, color = '#ff0' }"
94 o = efl_add(EFL_CANVAS_SNAPSHOT_CLASS, evas);
96 efl_gfx_entity_visible_set(o, EINA_TRUE);
97 efl_gfx_entity_position_set(o, EINA_POSITION2D(50, 50));
98 efl_gfx_entity_size_set(o, EINA_SIZE2D(200, 200));
99 efl_gfx_fill_set(o, EINA_RECT(0, 0, 200, 200));
100 efl_gfx_filter_program_set(o, filter, "test");
106 static void _cleanup(void)
109 for (i = 0; i < NUM; i++)
111 efl_del(o_images[i]);
117 /* loop - do things */
121 static void _loop(double t, int f)
124 Evas_Coord x, y, tw, th, cent;
127 for (i = 0; i < NUM; i++)
129 efl_gfx_entity_position_set(o_images[i], EINA_POSITION2D(x + 8, y));
130 exp_size_get(o_texts[i], &tw, &th);
131 cent = (ICON_SIZE + 16 - tw) / 2;
132 efl_gfx_entity_position_set(o_texts[i], EINA_POSITION2D(x + cent, y + ICON_SIZE + 4));
143 evas_object_geometry_get(o_snap, &x, &y, NULL, NULL);
146 if (x + dx >= win_w) dx = -dx;
150 if (x + dx <= 0) dx = -dx;
156 if (y + dy >= win_h) dy = -dy;
160 if (y + dy <= 0) dy = -dy;
164 evas_object_move(o_snap, x, y);
170 /* prepend special key handlers if interactive (before STD) */
171 static void _key(const char *key)
187 /* template stuff - ignore */
192 _ui_menu_item_add(ICON, NAME, FNAME);
204 ui_func_set(_key, _loop);