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 evas_object_text_font_set(o, "Vera-Bold", 20);
36 snprintf(buf, sizeof(buf), "%s %s %s %s.",
37 strs[rnd() % (sizeof(strs) / sizeof(char *))],
38 strs[rnd() % (sizeof(strs) / sizeof(char *))],
39 strs[rnd() % (sizeof(strs) / sizeof(char *))],
40 strs[rnd() % (sizeof(strs) / sizeof(char *))]);
41 evas_object_text_text_set(o, buf);
42 evas_object_color_set(o, 0, 0, 0, 255);
43 evas_object_geometry_get(o, NULL, NULL, &w, &h);
44 x = (win_w / 2) - (w / 2);
45 x += sin((double)((i * 13)) / (36.7 * SLOW)) * (w / 2);
46 y = (win_h / 2) - (h / 2);
47 y += cos((double)((i * 28)) / (43.8 * SLOW)) * (w / 2);
48 evas_object_move(o, x, y);
50 for (i = 1 ; i < OBNUM ; i ++)
52 o = evas_object_image_add(evas);
54 evas_object_image_source_set(o, o_texts[0]);
55 evas_object_geometry_get(o_texts[0], NULL, NULL, &w, &h);
56 evas_object_resize(o, w, h);
57 evas_object_image_fill_set(o, 0, 0, w, h);
58 x = (win_w / 2) - (w / 2);
59 x += sin((double)((i * 13)) / (36.7 * SLOW)) * (w / 2);
60 y = (win_h / 2) - (h / 2);
61 y += cos((double)((i * 28)) / (43.8 * SLOW)) * (w / 2);
62 evas_object_move(o, x, y);
72 static void _cleanup(void)
75 for (i = 0; i < OBNUM; i++) evas_object_del(o_texts[i]);
78 /* loop - do things */
79 static void _loop(double t, int f)
83 const char *strs[] = {
84 "Big", "Smelly", "Fish", "Pants", "Octopus", "Garden", "There", "I",
85 "Am", "You", "Are", "Erogenous", "We", "Stick", "Wet", "Fishy",
86 "Fiddly", "Family", "Lair", "Monkeys", "Magazine"
88 snprintf(buf, sizeof(buf), "%s %s %s %s.",
89 strs[rnd() % (sizeof(strs) / sizeof(char *))],
90 strs[rnd() % (sizeof(strs) / sizeof(char *))],
91 strs[rnd() % (sizeof(strs) / sizeof(char *))],
92 strs[rnd() % (sizeof(strs) / sizeof(char *))]);
93 evas_object_text_text_set(o_texts[0], buf);
94 evas_object_geometry_get(o_texts[0], NULL, NULL, &w, &h);
95 for (i = 1; i < OBNUM; i++)
97 evas_object_resize(o_texts[i],w,h);
98 evas_object_image_fill_set(o_texts[i],0,0,w,h);
103 /* prepend special key handlers if interactive (before STD) */
104 static void _key(char *key)
120 /* template stuff - ignore */
125 _ui_menu_item_add(ICON, NAME, FNAME);
136 ui_func_set(_key, _loop);