containing ui setup steps in the profiling again.
[platform/upstream/expedite.git] / src / bin / text_styles_different_strings.c
1 #undef FNAME
2 #undef NAME
3 #undef ICON
4
5 /* metadata */
6 #define FNAME text_styles_different_strings_start
7 #define NAME "Text Styles Different Strings"
8 #define ICON "text.png"
9
10 #ifndef PROTO
11 # ifndef UI
12 #  include "main.h"
13
14 /* standard var */
15 static int done = 0;
16
17 /* private data */
18 static Evas_Object *o_texts[OBNUM];
19
20 /* setup */
21 static void _setup(void)
22 {
23    int i;
24    Evas_Object *o;
25    Evas_Text_Style_Type st;
26    char buf[1024];
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"
31    };
32
33    srnd();
34    st = EVAS_TEXT_STYLE_SHADOW;
35    for (i = 0; i < OBNUM; i++)
36      {
37         o = evas_object_text_add(evas);
38         o_texts[i] = o;
39         snprintf(buf, sizeof(buf), "%s %s %s %s.",
40                  strs[rnd() % (sizeof(strs) / sizeof(char *))],
41                  strs[rnd() % (sizeof(strs) / sizeof(char *))],
42                  strs[rnd() % (sizeof(strs) / sizeof(char *))],
43                  strs[rnd() % (sizeof(strs) / sizeof(char *))]);
44 #if 0
45         efl_text_font_family_set(o, "Vera-Bold");
46         efl_text_font_size_set(o, 20);
47         efl_text_set(o, buf);
48 #else
49         evas_object_text_font_set(o, "Vera-Bold", 20);
50         evas_object_text_text_set(o, buf);
51 #endif
52         evas_object_text_style_set(o, st);
53         efl_gfx_color_set(o, 255, 255, 255, 255);
54         evas_object_text_shadow_color_set(o, 0, 0, 0, 24);
55         evas_object_text_glow_color_set(o, 100, 80, 40, 100);
56         evas_object_text_glow2_color_set(o, 50, 10, 5, 50);
57         evas_object_text_outline_color_set(o, 0, 0, 0, 255);
58         efl_gfx_entity_visible_set(o, EINA_TRUE);
59         st++;
60         if (st > EVAS_TEXT_STYLE_FAR_SOFT_SHADOW) st = EVAS_TEXT_STYLE_SHADOW;
61      }
62    done = 0;
63 }
64
65 /* cleanup */
66 static void _cleanup(void)
67 {
68    int i;
69    for (i = 0; i < OBNUM; i++) efl_del(o_texts[i]);
70 }
71
72 /* loop - do things */
73 static void _loop(double t, int f)
74 {
75    static int k = 0;
76    int i;
77    Evas_Coord x, y, w, h;
78    for (i = 0; i < OBNUM; i++)
79      {
80         exp_size_get(o_texts[i], &w, &h);
81         x = (win_w / 2) - (w / 2);
82         x += sin((double)(f + ((i + k) * 13)) / (36.7 * SLOW)) * (w / 2);
83         y = (win_h / 2) - (h / 2);
84         y += cos((double)(f + ((i + k) * 28)) / (43.8 * SLOW)) * (w / 2);
85         efl_gfx_entity_position_set(o_texts[i], EINA_POSITION2D(x, y));
86      }
87    ++k;
88    FPS_STD(NAME);
89 }
90
91 /* prepend special key handlers if interactive (before STD) */
92 static void _key(const char *key)
93 {
94    KEY_STD;
95 }
96
97
98
99
100
101
102
103
104
105
106
107
108 /* template stuff - ignore */
109 # endif
110 #endif
111
112 #ifdef UI
113 _ui_menu_item_add(ICON, NAME, FNAME);
114 #endif
115
116 #ifdef PROTO
117 void FNAME(void);
118 #endif
119
120 #ifndef PROTO
121 # ifndef UI
122 void FNAME(void)
123 {
124    ui_func_set(_key, _loop, _setup);
125 }
126 # endif
127 #endif
128 #undef FNAME
129 #undef NAME
130 #undef ICON