6 #define FNAME proxy_text_random
7 #define NAME "Proxy Text Random"
8 #define ICON "text.png"
18 static Evas_Object *o_texts[OBNUM];
21 static void _setup(void)
25 Evas_Coord x, y, w, h;
27 const char *strs[] = {
28 "Big", "Smelly", "Fish", "Pants", "Octopus", "Garden", "There", "I",
29 "Am", "You", "Are", "Erogenous", "We", "Stick", "Wet", "Fishy",
30 "Fiddly", "Family", "Lair", "Monkeys", "Magazine"
33 o = evas_object_text_add(evas);
35 snprintf(buf, sizeof(buf), "%s %s %s %s.",
36 strs[rnd() % (sizeof(strs) / sizeof(char *))],
37 strs[rnd() % (sizeof(strs) / sizeof(char *))],
38 strs[rnd() % (sizeof(strs) / sizeof(char *))],
39 strs[rnd() % (sizeof(strs) / sizeof(char *))]);
41 efl_text_font_family_set(o, "Vera-Bold");
42 efl_text_font_size_set(o, 20);
45 evas_object_text_font_set(o, "Vera-Bold", 20);
46 evas_object_text_text_set(o, buf);
49 efl_gfx_color_set(o, 0, 0, 0, 255);
50 exp_size_get(o, &w, &h);
51 x = (win_w / 2) - (w / 2);
52 x += sin((double)((i * 13)) / (36.7 * SLOW)) * (w / 2);
53 y = (win_h / 2) - (h / 2);
54 y += cos((double)((i * 28)) / (43.8 * SLOW)) * (w / 2);
55 efl_gfx_entity_position_set(o, EINA_POSITION2D(x, y));
56 efl_gfx_entity_visible_set(o, EINA_TRUE);
57 for (i = 1 ; i < OBNUM ; i ++)
59 o = efl_add(EFL_CANVAS_PROXY_CLASS, evas);
61 efl_canvas_proxy_source_set(o, o_texts[0]);
62 exp_size_get(o_texts[0], &w, &h);
63 efl_gfx_entity_size_set(o, EINA_SIZE2D(w, h));
64 efl_gfx_fill_set(o, EINA_RECT(0, 0, w, h));
65 x = (win_w / 2) - (w / 2);
66 x += sin((double)((i * 13)) / (36.7 * SLOW)) * (w / 2);
67 y = (win_h / 2) - (h / 2);
68 y += cos((double)((i * 28)) / (43.8 * SLOW)) * (w / 2);
69 efl_gfx_entity_position_set(o, EINA_POSITION2D(x, y));
70 efl_gfx_entity_visible_set(o, EINA_TRUE);
77 static void _cleanup(void)
80 for (i = 0; i < OBNUM; i++) efl_del(o_texts[i]);
83 /* loop - do things */
84 static void _loop(double t, int f)
88 const char *strs[] = {
89 "Big", "Smelly", "Fish", "Pants", "Octopus", "Garden", "There", "I",
90 "Am", "You", "Are", "Erogenous", "We", "Stick", "Wet", "Fishy",
91 "Fiddly", "Family", "Lair", "Monkeys", "Magazine"
93 snprintf(buf, sizeof(buf), "%s %s %s %s.",
94 strs[rnd() % (sizeof(strs) / sizeof(char *))],
95 strs[rnd() % (sizeof(strs) / sizeof(char *))],
96 strs[rnd() % (sizeof(strs) / sizeof(char *))],
97 strs[rnd() % (sizeof(strs) / sizeof(char *))]);
98 efl_text_set(o_texts[0], buf);
99 exp_size_get(o_texts[0], &w, &h);
100 for (i = 1; i < OBNUM; i++)
102 efl_gfx_entity_size_set(o_texts[i], EINA_SIZE2D(w, h));
103 efl_gfx_fill_set(o_texts[i], EINA_RECT(0, 0, w, h));
108 /* prepend special key handlers if interactive (before STD) */
109 static void _key(const char *key)
125 /* template stuff - ignore */
130 _ui_menu_item_add(ICON, NAME, FNAME);
142 ui_func_set(_key, _loop);