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