6 #define FNAME text_change_start
7 #define NAME "Text Change"
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 for (i = 0; i < OBNUM; i++)
35 o = evas_object_text_add(evas);
38 efl_text_font_family_set(o, "Vera-Bold");
39 efl_text_font_size_set(o, 20);
40 snprintf(buf, sizeof(buf), "%s %s %s %s.",
41 strs[rnd() % (sizeof(strs) / sizeof(char *))],
42 strs[rnd() % (sizeof(strs) / sizeof(char *))],
43 strs[rnd() % (sizeof(strs) / sizeof(char *))],
44 strs[rnd() % (sizeof(strs) / sizeof(char *))]);
47 evas_object_text_font_set(o, "Vera-Bold", 20);
48 evas_object_text_text_set(o, buf);
50 efl_gfx_color_set(o, 0, 0, 0, 255);
51 exp_size_get(o, &w, &h);
52 x = (win_w / 2) - (w / 2);
53 x += sin((double)((i * 13)) / (36.7 * SLOW)) * (w / 2);
54 y = (win_h / 2) - (h / 2);
55 y += cos((double)((i * 28)) / (43.8 * SLOW)) * (w / 2);
56 efl_gfx_entity_position_set(o, EINA_POSITION2D(x, y));
57 efl_gfx_entity_visible_set(o, EINA_TRUE);
63 static void _cleanup(void)
66 for (i = 0; i < OBNUM; i++) efl_del(o_texts[i]);
69 /* loop - do things */
70 static void _loop(double t, int f)
74 const char *strs[] = {
75 "Big", "Smelly", "Fish", "Pants", "Octopus", "Garden", "There", "I",
76 "Am", "You", "Are", "Erogenous", "We", "Stick", "Wet", "Fishy",
77 "Fiddly", "Family", "Lair", "Monkeys", "Magazine"
79 for (i = 0; i < OBNUM; i++)
81 snprintf(buf, sizeof(buf), "%s %s %s %s.",
82 strs[rnd() % (sizeof(strs) / sizeof(char *))],
83 strs[rnd() % (sizeof(strs) / sizeof(char *))],
84 strs[rnd() % (sizeof(strs) / sizeof(char *))],
85 strs[rnd() % (sizeof(strs) / sizeof(char *))]);
86 efl_text_set(o_texts[i], buf);
91 /* prepend special key handlers if interactive (before STD) */
92 static void _key(const char *key)
108 /* template stuff - ignore */
113 _ui_menu_item_add(ICON, NAME, FNAME);
124 ui_func_set(_key, _loop, _setup);