containing ui setup steps in the profiling again.
[platform/upstream/expedite.git] / src / bin / font_effect_blur_alpha.c
1 #define EFL_GFX_FILTER_BETA
2
3 #undef FNAME
4 #undef NAME
5 #undef ICON
6
7 /* metadata */
8 #define FNAME font_effect_blur_alpha_start
9 #define NAME "Font Effect Blur (Alpha)"
10 #define ICON "text.png"
11
12 #ifndef PROTO
13 # ifndef UI
14 #  include "main.h"
15
16 #include "ui.h"
17
18
19 /* standard var */
20 static int done = 0;
21 extern int win_w, win_h;
22 /* private data */
23 static Evas_Object *text;
24 static const int MAX_BLUR = 100;
25
26 /* setup */
27 static void _setup(void)
28 {
29
30    Evas_Object *o;
31    int w,h;
32
33    o = evas_object_text_add(evas);
34    evas_object_color_set(o, 0, 0, 0, 255);
35    evas_object_text_font_set(o, "Vera-Bold", 80);
36    evas_object_text_text_set(o, "Font Effect");
37    evas_object_show(o);
38    evas_object_geometry_get(o, NULL, NULL, &w, &h);
39    evas_object_move(o, (win_w / 2) - (w / 2) - MAX_BLUR, (win_h / 2) - (h / 2) - MAX_BLUR);
40    text = o;
41
42    done = 0;
43 }
44
45 /* cleanup */
46 static void _cleanup(void)
47 {
48    evas_object_del(text);
49 }
50
51 /* loop - do things */
52 static void _loop(double t, int f)
53 {
54    char buf[256];
55    char *str = "padding_set({ %d });blur({%d,color=black });";
56    sprintf(buf, str, MAX_BLUR, ((f % MAX_BLUR) + 1));
57    efl_gfx_filter_program_set(text, buf, "test");
58
59    FPS_STD(NAME);
60 }
61
62 /* prepend special key handlers if interactive (before STD) */
63 static void _key(const char *key)
64 {
65    KEY_STD;
66 }
67
68
69
70
71
72
73
74
75
76
77
78
79 /* template stuff - ignore */
80 # endif
81 #endif
82
83 #ifdef UI
84 _ui_menu_item_add(ICON, NAME, FNAME);
85 #endif
86
87 #ifdef PROTO
88 void FNAME(void);
89 #endif
90
91 #ifndef PROTO
92 # ifndef UI
93 void FNAME(void)
94 {
95    ui_func_set(_key, _loop, _setup);
96 }
97 # endif
98 #endif
99 #undef FNAME
100 #undef NAME
101 #undef ICON