6 #define FNAME text_styles_different_strings_start
7 #define NAME "Text Styles Different Strings"
8 #define ICON "text.png"
18 static Evas_Object *o_texts[OBNUM];
21 static void _setup(void)
25 Evas_Text_Style_Type st;
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"
34 st = EVAS_TEXT_STYLE_SHADOW;
35 for (i = 0; i < OBNUM; i++)
37 o = evas_object_text_add(evas);
39 evas_object_text_font_set(o, "Vera-Bold", 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 *))]);
45 evas_object_text_text_set(o, buf);
46 evas_object_text_style_set(o, st);
47 evas_object_color_set(o, 255, 255, 255, 255);
48 evas_object_text_shadow_color_set(o, 0, 0, 0, 24);
49 evas_object_text_glow_color_set(o, 100, 80, 40, 100);
50 evas_object_text_glow2_color_set(o, 50, 10, 5, 50);
51 evas_object_text_outline_color_set(o, 0, 0, 0, 255);
54 if (st > EVAS_TEXT_STYLE_FAR_SOFT_SHADOW) st = EVAS_TEXT_STYLE_SHADOW;
60 static void _cleanup(void)
63 for (i = 0; i < OBNUM; i++) evas_object_del(o_texts[i]);
66 /* loop - do things */
67 static void _loop(double t, int f)
70 Evas_Coord x, y, w, h;
71 for (i = 0; i < OBNUM; i++)
73 evas_object_geometry_get(o_texts[i], NULL, NULL, &w, &h);
74 x = (win_w / 2) - (w / 2);
75 x += sin((double)(f + (i * 13)) / (36.7 * SLOW)) * (w / 2);
76 y = (win_h / 2) - (h / 2);
77 y += cos((double)(f + (i * 28)) / (43.8 * SLOW)) * (w / 2);
78 evas_object_move(o_texts[i], x, y);
83 /* prepend special key handlers if interactive (before STD) */
84 static void _key(char *key)
100 /* template stuff - ignore */
105 _ui_menu_item_add(ICON, NAME, FNAME);
116 ui_func_set(_key, _loop);