Revert "Setup before starting fps measurement"
[platform/upstream/expedite.git] / src / bin / text_styles.c
1 #undef FNAME
2 #undef NAME
3 #undef ICON
4
5 /* metadata */
6 #define FNAME text_styles_start
7 #define NAME "Text Styles"
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
27    st = EVAS_TEXT_STYLE_SHADOW;
28    for (i = 0; i < OBNUM; i++)
29      {
30         o = evas_object_text_add(evas);
31         o_texts[i] = o;
32 #if 0
33         efl_text_font_family_set(o, "Vera-Bold");
34         efl_text_font_size_set(o, 20);
35         efl_text_set(o, "This is a test string");
36 #else
37         evas_object_text_font_set(o, "Vera-Bold", 20);
38         evas_object_text_text_set(o, "This is a test string");
39 #endif
40         evas_object_text_style_set(o, st);
41         efl_gfx_color_set(o, 255, 255, 255, 255);
42         evas_object_text_shadow_color_set(o, 0, 0, 0, 24);
43         evas_object_text_glow_color_set(o, 100, 80, 40, 100);
44         evas_object_text_glow2_color_set(o, 50, 10, 5, 50);
45         evas_object_text_outline_color_set(o, 0, 0, 0, 255);
46         efl_gfx_entity_visible_set(o, EINA_TRUE);
47         st++;
48         if (st > EVAS_TEXT_STYLE_FAR_SOFT_SHADOW) st = EVAS_TEXT_STYLE_SHADOW;
49      }
50    done = 0;
51 }
52
53 /* cleanup */
54 static void _cleanup(void)
55 {
56    int i;
57    for (i = 0; i < OBNUM; i++) efl_del(o_texts[i]);
58 }
59
60 /* loop - do things */
61 static void _loop(double t, int f)
62 {
63    int i;
64    Evas_Coord x, y, w, h;
65    for (i = 0; i < OBNUM; i++)
66      {
67         exp_size_get(o_texts[i], &w, &h);
68         x = (win_w / 2) - (w / 2);
69         x += sin((double)(f + (i * 13)) / (36.7 * SLOW)) * (w / 2);
70         y = (win_h / 2) - (h / 2);
71         y += cos((double)(f + (i * 28)) / (43.8 * SLOW)) * (w / 2);
72         efl_gfx_entity_position_set(o_texts[i], EINA_POSITION2D(x, y));
73      }
74    FPS_STD(NAME);
75 }
76
77 /* prepend special key handlers if interactive (before STD) */
78 static void _key(const char *key)
79 {
80    KEY_STD;
81 }
82
83
84
85
86
87
88
89
90
91
92
93
94 /* template stuff - ignore */
95 # endif
96 #endif
97
98 #ifdef UI
99 _ui_menu_item_add(ICON, NAME, FNAME);
100 #endif
101
102 #ifdef PROTO
103 void FNAME(void);
104 #endif
105
106 #ifndef PROTO
107 # ifndef UI
108 void FNAME(void)
109 {
110    ui_func_set(_key, _loop);
111    _setup();
112 }
113 # endif
114 #endif
115 #undef FNAME
116 #undef NAME
117 #undef ICON