diff options
author | Savio Sena <savio.sena@acm.org> | 2014-09-23 22:34:56 -0300 |
---|---|---|
committer | Savio Sena <savio.sena@acm.org> | 2014-09-23 23:45:43 -0300 |
commit | ad066eb17e24e90abfbec7ac199a3ef62a94517e (patch) | |
tree | d651747eecb74b5686e24fa25d9724f19140a50a /src | |
parent | bbb7e27b033933cb9b235c11ad9f17103923a3d1 (diff) |
Add missing _loop and FNAME.
Convert o_texts[] to eina::list<evas::text>.
Convert o_icons[] to eina::list<evas::image>.
Diffstat (limited to 'src')
31 files changed, 850 insertions, 267 deletions
diff --git a/src/bin/cxx/image_blend_many_smooth_same_scaled.cc b/src/bin/cxx/image_blend_many_smooth_same_scaled.cc index 18a0e8d..6ca5619 100644 --- a/src/bin/cxx/image_blend_many_smooth_same_scaled.cc +++ b/src/bin/cxx/image_blend_many_smooth_same_scaled.cc | |||
@@ -44,9 +44,36 @@ static void _setup(void) | |||
44 | done = 0; | 44 | done = 0; |
45 | } | 45 | } |
46 | 46 | ||
47 | /* cleanup */ | ||
48 | static void _cleanup() | ||
49 | { | ||
50 | images.clear(); | ||
51 | } | ||
52 | |||
53 | /* loop - do things */ | ||
54 | static void _loop(double t, int f) | ||
55 | { | ||
56 | int i; | ||
57 | Evas_Coord x, y, w, h; | ||
58 | for (i = 0; i < MANYNUM; i++) | ||
59 | { | ||
60 | eo_do(o_images[i], evas_obj_size_get(&w, &h)); | ||
61 | x = (win_w / 2) - (w / 2); | ||
62 | x += sin((double)(f + (i * 13)) / (36.7 * SLOW)) * (win_w / 2); | ||
63 | y = (win_h / 2) - (h / 2); | ||
64 | y += cos((double)(f + (i * 28)) / (43.8 * SLOW)) * (win_h / 2); | ||
65 | eo_do(o_images[i], evas_obj_position_set(x, y)); | ||
66 | } | ||
67 | FPS_STD(NAME); | ||
68 | } | ||
47 | 69 | ||
48 | extern "C" static void _key(char *key) | 70 | static void _key(char *key) |
49 | { | 71 | { |
50 | KEY_STD; | 72 | KEY_STD; |
51 | } | 73 | } |
52 | 74 | ||
75 | extern "C" void FNAME(void) | ||
76 | { | ||
77 | ui_func_set(_key, _loop); | ||
78 | _setup(); | ||
79 | } | ||
diff --git a/src/bin/cxx/image_blend_nearest_same_scaled.cc b/src/bin/cxx/image_blend_nearest_same_scaled.cc index d5f46ac..71ed8ab 100644 --- a/src/bin/cxx/image_blend_nearest_same_scaled.cc +++ b/src/bin/cxx/image_blend_nearest_same_scaled.cc | |||
@@ -23,16 +23,14 @@ static efl::eina::list<evas::image> images; | |||
23 | /* setup */ | 23 | /* setup */ |
24 | static void _setup(void) | 24 | static void _setup(void) |
25 | { | 25 | { |
26 | int i; | 26 | evas::canvas canvas(::eo_ref(G_evas)); |
27 | Evas_Object *o; | 27 | for (int i = 0; i < OBNUM; i++) |
28 | for (i = 0; i < OBNUM; i++) | ||
29 | { | 28 | { |
30 | evas::image o(efl::eo::parent = canvas); | 29 | evas::image o(efl::eo::parent = canvas); |
31 | images.push_back(o); | 30 | images.push_back(o); |
32 | eo_do(o, | 31 | o.file_set(build_path("logo.png"), ""); |
33 | efl_file_set(build_path("logo.png"), NULL), | 32 | o.smooth_scale_set(0); |
34 | efl_image_smooth_scale_set(0), | 33 | o.visibility_set(true); |
35 | evas_obj_visibility_set(EINA_TRUE)); | ||
36 | } | 34 | } |
37 | done = 0; | 35 | done = 0; |
38 | } | 36 | } |
@@ -66,6 +64,12 @@ static void _loop(double t, int f) | |||
66 | FPS_STD(NAME); | 64 | FPS_STD(NAME); |
67 | } | 65 | } |
68 | 66 | ||
67 | /* cleanup */ | ||
68 | static void _cleanup(void) | ||
69 | { | ||
70 | images.clear(); | ||
71 | } | ||
72 | |||
69 | /* prepend special key handlers if interactive (before STD) */ | 73 | /* prepend special key handlers if interactive (before STD) */ |
70 | static void _key(char *key) | 74 | static void _key(char *key) |
71 | { | 75 | { |
diff --git a/src/bin/cxx/image_blend_solid_middle_unscaled.cc b/src/bin/cxx/image_blend_solid_middle_unscaled.cc index 6f61ec6..d02117b 100644 --- a/src/bin/cxx/image_blend_solid_middle_unscaled.cc +++ b/src/bin/cxx/image_blend_solid_middle_unscaled.cc | |||
@@ -13,6 +13,7 @@ | |||
13 | #include "main.h" | 13 | #include "main.h" |
14 | 14 | ||
15 | #define EXPEDITE_CXX_TEST_IMPL | 15 | #define EXPEDITE_CXX_TEST_IMPL |
16 | #include "image_blend_solid_middle_unscaled_capi.h" | ||
16 | 17 | ||
17 | /* standard var */ | 18 | /* standard var */ |
18 | static int done = 0; | 19 | static int done = 0; |
diff --git a/src/bin/cxx/rect_blend.cc b/src/bin/cxx/rect_blend.cc index c047a0f..5d22b0c 100644 --- a/src/bin/cxx/rect_blend.cc +++ b/src/bin/cxx/rect_blend.cc | |||
@@ -1,15 +1,19 @@ | |||
1 | #undef FNAME | ||
2 | #undef NAME | ||
3 | #undef ICON | ||
4 | 1 | ||
5 | /* metadata */ | 2 | #ifdef HAVE_CONFIG_H |
6 | #define FNAME rect_blend_start | 3 | # include <config.h> |
7 | #define NAME "Rect Blend" | 4 | #endif |
8 | #define ICON "rect.png" | ||
9 | 5 | ||
10 | #ifndef PROTO | 6 | #include "Eo.h" |
11 | # ifndef UI | 7 | #include "Evas.h" |
12 | # include "main.h" | 8 | |
9 | #include "Eo.hh" | ||
10 | #include "Eina.hh" | ||
11 | #include "Evas.hh" | ||
12 | |||
13 | #include "main.h" | ||
14 | |||
15 | #define EXPEDITE_CXX_TEST_IMPL | ||
16 | #include "rect_blend_capi.h" | ||
13 | 17 | ||
14 | /* standard var */ | 18 | /* standard var */ |
15 | static int done = 0; | 19 | static int done = 0; |
@@ -19,15 +23,14 @@ static efl::eina::list<evas::image> images; | |||
19 | /* setup */ | 23 | /* setup */ |
20 | static void _setup(void) | 24 | static void _setup(void) |
21 | { | 25 | { |
22 | int i; | ||
23 | evas::canvas canvas(::eo_ref(G_evas)); | 26 | evas::canvas canvas(::eo_ref(G_evas)); |
24 | srnd(); | 27 | srnd(); |
25 | for (i = 0; i < OBNUM; i++) | 28 | for (int i = 0; i < OBNUM; i++) |
26 | { | 29 | { |
27 | int r, g, b, a; | 30 | int r, g, b, a; |
28 | 31 | ||
29 | evas::image o(efl::eo::parent = canvas); | 32 | o = eo_add(EVAS_RECTANGLE_CLASS, G_evas); |
30 | images.push_back(o); | 33 | images[i] = o; |
31 | a = rnd()&0xff; | 34 | a = rnd()&0xff; |
32 | r = ((rnd()&0xff) * a) / 255; | 35 | r = ((rnd()&0xff) * a) / 255; |
33 | g = ((rnd()&0xff) * a) / 255; | 36 | g = ((rnd()&0xff) * a) / 255; |
@@ -40,13 +43,41 @@ static void _setup(void) | |||
40 | } | 43 | } |
41 | 44 | ||
42 | /* cleanup */ | 45 | /* cleanup */ |
43 | static void _cleanup(void) | 46 | static void _cleanup() |
47 | { | ||
48 | images.clear(); | ||
49 | } | ||
50 | |||
51 | /* loop - do things */ | ||
52 | static void _loop(double t, int f) | ||
44 | { | 53 | { |
45 | int i; | 54 | int i; |
46 | for (i = 0; i < OBNUM; i++) eo_del(images[i]); | 55 | Evas_Coord x, y, w, h, w0, h0; |
56 | for (i = 0; i < OBNUM; i++) | ||
57 | { | ||
58 | w0 = 80; | ||
59 | h0 = 80; | ||
60 | w = 5 + ((1.0 + cos((double)(f + (i * 10)) / (7.4 * SLOW) )) * w0 * 2); | ||
61 | h = 5 + ((1.0 + sin((double)(f + (i * 19)) / (12.6 * SLOW) )) * h0 * 2); | ||
62 | x = (win_w / 2) - (w / 2); | ||
63 | x += sin((double)(f + (i * 13)) / (36.7 * SLOW)) * (w0 / 2); | ||
64 | y = (win_h / 2) - (h / 2); | ||
65 | y += cos((double)(f + (i * 28)) / (43.8 * SLOW)) * (h0 / 2); | ||
66 | eo_do(o_images[i], | ||
67 | evas_obj_position_set(x, y), | ||
68 | evas_obj_size_set(w, h)); | ||
69 | } | ||
70 | FPS_STD(NAME); | ||
71 | } | ||
47 | 72 | ||
48 | extern "C" static void _key(char *key) | 73 | static void _key(char *key) |
49 | { | 74 | { |
50 | KEY_STD; | 75 | KEY_STD; |
51 | } | 76 | } |
52 | 77 | ||
78 | extern "C" void FNAME(void) | ||
79 | { | ||
80 | ui_func_set(_key, _loop); | ||
81 | _setup(); | ||
82 | } | ||
83 | |||
diff --git a/src/bin/cxx/rect_blend_few.cc b/src/bin/cxx/rect_blend_few.cc index 382389a..62705d6 100644 --- a/src/bin/cxx/rect_blend_few.cc +++ b/src/bin/cxx/rect_blend_few.cc | |||
@@ -1,15 +1,19 @@ | |||
1 | #undef FNAME | ||
2 | #undef NAME | ||
3 | #undef ICON | ||
4 | 1 | ||
5 | /* metadata */ | 2 | #ifdef HAVE_CONFIG_H |
6 | #define FNAME rect_blend_few_start | 3 | # include <config.h> |
7 | #define NAME "Rect Blend Few" | 4 | #endif |
8 | #define ICON "rect.png" | ||
9 | 5 | ||
10 | #ifndef PROTO | 6 | #include "Eo.h" |
11 | # ifndef UI | 7 | #include "Evas.h" |
12 | # include "main.h" | 8 | |
9 | #include "Eo.hh" | ||
10 | #include "Eina.hh" | ||
11 | #include "Evas.hh" | ||
12 | |||
13 | #include "main.h" | ||
14 | |||
15 | #define EXPEDITE_CXX_TEST_IMPL | ||
16 | #include "rect_blend_few_capi.h" | ||
13 | 17 | ||
14 | #undef OBNUM | 18 | #undef OBNUM |
15 | #define OBNUM 3 | 19 | #define OBNUM 3 |
@@ -44,10 +48,38 @@ static void _setup(void) | |||
44 | /* cleanup */ | 48 | /* cleanup */ |
45 | static void _cleanup(void) | 49 | static void _cleanup(void) |
46 | { | 50 | { |
51 | images.clear(); | ||
52 | } | ||
53 | |||
54 | /* loop - do things */ | ||
55 | static void _loop(double t, int f) | ||
56 | { | ||
47 | int i; | 57 | int i; |
58 | Evas_Coord x, y, w, h, w0, h0; | ||
59 | for (i = 0; i < OBNUM; i++) | ||
60 | { | ||
61 | w0 = 80; | ||
62 | h0 = 80; | ||
63 | w = 5 + ((1.0 + cos((double)(f + (i * 10)) / (7.4 * SLOW) )) * w0 * 2); | ||
64 | h = 5 + ((1.0 + sin((double)(f + (i * 19)) / (12.6 * SLOW) )) * h0 * 2); | ||
65 | x = (win_w / 2) - (w / 2); | ||
66 | x += sin((double)(f + (i * 113)) / (36.7 * SLOW)) * (w0 / 2); | ||
67 | y = (win_h / 2) - (h / 2); | ||
68 | y += cos((double)(f + (i * 228)) / (43.8 * SLOW)) * (h0 / 2); | ||
69 | eo_do(o_images[i], evas_obj_position_set(x, y), | ||
70 | evas_obj_size_set(w, h)); | ||
71 | } | ||
72 | FPS_STD(NAME); | ||
73 | } | ||
48 | 74 | ||
49 | extern "C" static void _key(char *key) | 75 | |
76 | static void _key(char *key) | ||
50 | { | 77 | { |
51 | KEY_STD; | 78 | KEY_STD; |
52 | } | 79 | } |
53 | 80 | ||
81 | extern "C" void FNAME(void) | ||
82 | { | ||
83 | ui_func_set(_key, _loop); | ||
84 | _setup(); | ||
85 | } | ||
diff --git a/src/bin/cxx/rect_blend_pow2.cc b/src/bin/cxx/rect_blend_pow2.cc index 55e536c..99216a2 100644 --- a/src/bin/cxx/rect_blend_pow2.cc +++ b/src/bin/cxx/rect_blend_pow2.cc | |||
@@ -1,15 +1,19 @@ | |||
1 | #undef FNAME | ||
2 | #undef NAME | ||
3 | #undef ICON | ||
4 | 1 | ||
5 | /* metadata */ | 2 | #ifdef HAVE_CONFIG_H |
6 | #define FNAME rect_blend_pow2_start | 3 | # include <config.h> |
7 | #define NAME "Rect Blend Power 2" | 4 | #endif |
8 | #define ICON "rect.png" | ||
9 | 5 | ||
10 | #ifndef PROTO | 6 | #include "Eo.h" |
11 | # ifndef UI | 7 | #include "Evas.h" |
12 | # include "main.h" | 8 | |
9 | #include "Eo.hh" | ||
10 | #include "Eina.hh" | ||
11 | #include "Evas.hh" | ||
12 | |||
13 | #include "main.h" | ||
14 | |||
15 | #define EXPEDITE_CXX_TEST_IMPL | ||
16 | #include "rect_blend_pow2_capi.h" | ||
13 | 17 | ||
14 | /* standard var */ | 18 | /* standard var */ |
15 | static int done = 0; | 19 | static int done = 0; |
@@ -19,10 +23,9 @@ static efl::eina::list<evas::image> images; | |||
19 | /* setup */ | 23 | /* setup */ |
20 | static void _setup(void) | 24 | static void _setup(void) |
21 | { | 25 | { |
22 | int i; | ||
23 | evas::canvas canvas(::eo_ref(G_evas)); | 26 | evas::canvas canvas(::eo_ref(G_evas)); |
24 | srnd(); | 27 | srnd(); |
25 | for (i = 0; i < OBNUM; i++) | 28 | for (int i = 0; i < OBNUM; i++) |
26 | { | 29 | { |
27 | int r, g, b, a; | 30 | int r, g, b, a; |
28 | 31 | ||
@@ -43,11 +46,38 @@ static void _setup(void) | |||
43 | /* cleanup */ | 46 | /* cleanup */ |
44 | static void _cleanup(void) | 47 | static void _cleanup(void) |
45 | { | 48 | { |
49 | images.clear(); | ||
50 | } | ||
51 | |||
52 | /* loop - do things */ | ||
53 | static void _loop(double t, int f) | ||
54 | { | ||
46 | int i; | 55 | int i; |
47 | for (i = 0; i < OBNUM; i++) eo_del(images[i]); | 56 | Evas_Coord x, y, w, h, w0, h0; |
57 | for (i = 0; i < OBNUM; i++) | ||
58 | { | ||
59 | w0 = 80; | ||
60 | h0 = 80; | ||
61 | w = 5 + ((1.0 + cos((double)(f + (i * 10)) / (7.4 * SLOW) )) * w0 * 2); | ||
62 | h = 5 + ((1.0 + sin((double)(f + (i * 19)) / (12.6 * SLOW) )) * h0 * 2); | ||
63 | x = (win_w / 2) - (w / 2); | ||
64 | x += sin((double)(f + (i * 13)) / (36.7 * SLOW)) * (w0 / 2); | ||
65 | y = (win_h / 2) - (h / 2); | ||
66 | y += cos((double)(f + (i * 28)) / (43.8 * SLOW)) * (h0 / 2); | ||
67 | eo_do(o_images[i], | ||
68 | evas_obj_position_set(x, y), | ||
69 | evas_obj_size_set(w, h)); | ||
70 | } | ||
71 | FPS_STD(NAME); | ||
72 | } | ||
48 | 73 | ||
49 | extern "C" static void _key(char *key) | 74 | static void _key(char *key) |
50 | { | 75 | { |
51 | KEY_STD; | 76 | KEY_STD; |
52 | } | 77 | } |
53 | 78 | ||
79 | extern "C" void FNAME(void) | ||
80 | { | ||
81 | ui_func_set(_key, _loop); | ||
82 | _setup(); | ||
83 | } | ||
diff --git a/src/bin/cxx/rect_blend_pow2_few.cc b/src/bin/cxx/rect_blend_pow2_few.cc index 9cd6f39..e959b95 100644 --- a/src/bin/cxx/rect_blend_pow2_few.cc +++ b/src/bin/cxx/rect_blend_pow2_few.cc | |||
@@ -46,9 +46,13 @@ static void _setup(void) | |||
46 | static void _cleanup(void) | 46 | static void _cleanup(void) |
47 | { | 47 | { |
48 | int i; | 48 | int i; |
49 | 49 | static void _key(char *key) | |
50 | extern "C" static void _key(char *key) | ||
51 | { | 50 | { |
52 | KEY_STD; | 51 | KEY_STD; |
53 | } | 52 | } |
54 | 53 | ||
54 | extern "C" void FNAME(void) | ||
55 | { | ||
56 | ui_func_set(_key, _loop); | ||
57 | _setup(); | ||
58 | } | ||
diff --git a/src/bin/cxx/rect_solid.cc b/src/bin/cxx/rect_solid.cc index 63a3b20..9e7bef7 100644 --- a/src/bin/cxx/rect_solid.cc +++ b/src/bin/cxx/rect_solid.cc | |||
@@ -1,15 +1,19 @@ | |||
1 | #undef FNAME | ||
2 | #undef NAME | ||
3 | #undef ICON | ||
4 | 1 | ||
5 | /* metadata */ | 2 | #ifdef HAVE_CONFIG_H |
6 | #define FNAME rect_solid_start | 3 | # include <config.h> |
7 | #define NAME "Rect Solid" | 4 | #endif |
8 | #define ICON "rect.png" | ||
9 | 5 | ||
10 | #ifndef PROTO | 6 | #include "Eo.h" |
11 | # ifndef UI | 7 | #include "Evas.h" |
12 | # include "main.h" | 8 | |
9 | #include "Eo.hh" | ||
10 | #include "Eina.hh" | ||
11 | #include "Evas.hh" | ||
12 | |||
13 | #include "main.h" | ||
14 | |||
15 | #define EXPEDITE_CXX_TEST_IMPL | ||
16 | #include "rect_solid_capi.h" | ||
13 | 17 | ||
14 | /* standard var */ | 18 | /* standard var */ |
15 | static int done = 0; | 19 | static int done = 0; |
@@ -19,22 +23,19 @@ static efl::eina::list<evas::image> images; | |||
19 | /* setup */ | 23 | /* setup */ |
20 | static void _setup(void) | 24 | static void _setup(void) |
21 | { | 25 | { |
22 | int i; | ||
23 | evas::canvas canvas(::eo_ref(G_evas)); | 26 | evas::canvas canvas(::eo_ref(G_evas)); |
24 | srnd(); | 27 | srnd(); |
25 | for (i = 0; i < OBNUM; i++) | 28 | for (int i = 0; i < OBNUM; i++) |
26 | { | 29 | { |
27 | int r, g, b, a; | 30 | int r, g, b, a; |
28 | |||
29 | evas::image o(efl::eo::parent = canvas); | 31 | evas::image o(efl::eo::parent = canvas); |
30 | images.push_back(o); | 32 | images.push_back(o); |
31 | a = 0xff; | 33 | a = 0xff; |
32 | r = ((rnd()&0xff) * a) / 255; | 34 | r = ((rnd()&0xff) * a) / 255; |
33 | g = ((rnd()&0xff) * a) / 255; | 35 | g = ((rnd()&0xff) * a) / 255; |
34 | b = ((rnd()&0xff) * a) / 255; | 36 | b = ((rnd()&0xff) * a) / 255; |
35 | eo_do(o, | 37 | o.color_set(r, g, b, a); |
36 | evas_obj_color_set(r, g, b, a), | 38 | o.visibility_set(true); |
37 | evas_obj_visibility_set(EINA_TRUE)); | ||
38 | } | 39 | } |
39 | done = 0; | 40 | done = 0; |
40 | } | 41 | } |
@@ -42,11 +43,38 @@ static void _setup(void) | |||
42 | /* cleanup */ | 43 | /* cleanup */ |
43 | static void _cleanup(void) | 44 | static void _cleanup(void) |
44 | { | 45 | { |
46 | images.clear(); | ||
47 | } | ||
48 | |||
49 | /* loop - do things */ | ||
50 | static void _loop(double t, int f) | ||
51 | { | ||
45 | int i; | 52 | int i; |
46 | for (i = 0; i < OBNUM; i++) eo_del(images[i]); | 53 | Evas_Coord x, y, w, h, w0, h0; |
54 | for (i = 0; i < OBNUM; i++) | ||
55 | { | ||
56 | w0 = 80; | ||
57 | h0 = 80; | ||
58 | w = 5 + ((1.0 + cos((double)(f + (i * 10)) / (7.4 * SLOW) )) * w0 * 2); | ||
59 | h = 5 + ((1.0 + sin((double)(f + (i * 19)) / (12.6 * SLOW) )) * h0 * 2); | ||
60 | x = (win_w / 2) - (w / 2); | ||
61 | x += sin((double)(f + (i * 13)) / (36.7 * SLOW)) * (w0 / 2); | ||
62 | y = (win_h / 2) - (h / 2); | ||
63 | y += cos((double)(f + (i * 28)) / (43.8 * SLOW)) * (h0 / 2); | ||
64 | eo_do(o_images[i], | ||
65 | evas_obj_position_set(x, y), | ||
66 | evas_obj_size_set(w, h)); | ||
67 | } | ||
68 | FPS_STD(NAME); | ||
69 | } | ||
47 | 70 | ||
48 | extern "C" static void _key(char *key) | 71 | static void _key(char *key) |
49 | { | 72 | { |
50 | KEY_STD; | 73 | KEY_STD; |
51 | } | 74 | } |
52 | 75 | ||
76 | extern "C" void FNAME(void) | ||
77 | { | ||
78 | ui_func_set(_key, _loop); | ||
79 | _setup(); | ||
80 | } | ||
diff --git a/src/bin/cxx/rect_solid_few.cc b/src/bin/cxx/rect_solid_few.cc index 3766bda..cdee5a6 100644 --- a/src/bin/cxx/rect_solid_few.cc +++ b/src/bin/cxx/rect_solid_few.cc | |||
@@ -45,8 +45,31 @@ static void _setup(void) | |||
45 | static void _cleanup(void) | 45 | static void _cleanup(void) |
46 | { | 46 | { |
47 | int i; | 47 | int i; |
48 | for (i = 0; i < OBNUM; i++) eo_del(o_images[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, w0, h0; | ||
56 | for (i = 0; i < OBNUM; i++) | ||
57 | { | ||
58 | w0 = 80; | ||
59 | h0 = 80; | ||
60 | w = 5 + ((1.0 + cos((double)(f + (i * 10)) / (7.4 * SLOW) )) * w0 * 2); | ||
61 | h = 5 + ((1.0 + sin((double)(f + (i * 19)) / (12.6 * SLOW) )) * h0 * 2); | ||
62 | x = (win_w / 2) - (w / 2); | ||
63 | x += sin((double)(f + (i * 113)) / (36.7 * SLOW)) * (w0 / 2); | ||
64 | y = (win_h / 2) - (h / 2); | ||
65 | y += cos((double)(f + (i * 228)) / (43.8 * SLOW)) * (h0 / 2); | ||
66 | eo_do(o_images[i], evas_obj_position_set(x, y), | ||
67 | evas_obj_size_set(w, h)); | ||
68 | } | ||
69 | FPS_STD(NAME); | ||
70 | } | ||
48 | 71 | ||
49 | extern "C" static void _key(char *key) | 72 | static void _key(char *key) |
50 | { | 73 | { |
51 | KEY_STD; | 74 | KEY_STD; |
52 | } | 75 | } |
diff --git a/src/bin/cxx/text_basic.cc b/src/bin/cxx/text_basic.cc index 5611888..c1f565a 100644 --- a/src/bin/cxx/text_basic.cc +++ b/src/bin/cxx/text_basic.cc | |||
@@ -35,9 +35,13 @@ static void _setup(void) | |||
35 | done = 0; | 35 | done = 0; |
36 | } | 36 | } |
37 | 37 | ||
38 | 38 | static void _key(char *key) | |
39 | extern "C" static void _key(char *key) | ||
40 | { | 39 | { |
41 | KEY_STD; | 40 | KEY_STD; |
42 | } | 41 | } |
43 | 42 | ||
43 | extern "C" void FNAME(void) | ||
44 | { | ||
45 | ui_func_set(_key, _loop); | ||
46 | _setup(); | ||
47 | } | ||
diff --git a/src/bin/cxx/text_change.cc b/src/bin/cxx/text_change.cc index aabbd0e..34dea5c 100644 --- a/src/bin/cxx/text_change.cc +++ b/src/bin/cxx/text_change.cc | |||
@@ -53,14 +53,41 @@ static void _setup(void) | |||
53 | done = 0; | 53 | done = 0; |
54 | } | 54 | } |
55 | 55 | ||
56 | /* cleanup */ | 56 | |
57 | static void _cleanup(void) | 57 | |
58 | |||
59 | |||
60 | |||
61 | /* loop - do things */ | ||
62 | static void _loop(double t, int f) | ||
58 | { | 63 | { |
59 | int i; | 64 | int i; |
60 | for (i = 0; i < OBNUM; i++) eo_del(o_texts[i]); | 65 | char buf[1024]; |
66 | const char *strs[] = { | ||
67 | "Big", "Smelly", "Fish", "Pants", "Octopus", "Garden", "There", "I", | ||
68 | "Am", "You", "Are", "Erogenous", "We", "Stick", "Wet", "Fishy", | ||
69 | "Fiddly", "Family", "Lair", "Monkeys", "Magazine" | ||
70 | }; | ||
71 | for (i = 0; i < OBNUM; i++) | ||
72 | { | ||
73 | snprintf(buf, sizeof(buf), "%s %s %s %s.", | ||
74 | strs[rnd() % (sizeof(strs) / sizeof(char *))], | ||
75 | strs[rnd() % (sizeof(strs) / sizeof(char *))], | ||
76 | strs[rnd() % (sizeof(strs) / sizeof(char *))], | ||
77 | strs[rnd() % (sizeof(strs) / sizeof(char *))]); | ||
78 | eo_do(o_texts[i], efl_text_set(buf)); | ||
79 | } | ||
80 | FPS_STD(NAME); | ||
81 | } | ||
82 | |||
61 | 83 | ||
62 | extern "C" static void _key(char *key) | 84 | static void _key(char *key) |
63 | { | 85 | { |
64 | KEY_STD; | 86 | KEY_STD; |
65 | } | 87 | } |
66 | 88 | ||
89 | extern "C" void FNAME(void) | ||
90 | { | ||
91 | ui_func_set(_key, _loop); | ||
92 | _setup(); | ||
93 | } | ||
diff --git a/src/bin/cxx/text_styles.cc b/src/bin/cxx/text_styles.cc index 0d5111c..d874b1c 100644 --- a/src/bin/cxx/text_styles.cc +++ b/src/bin/cxx/text_styles.cc | |||
@@ -1,21 +1,25 @@ | |||
1 | #undef FNAME | ||
2 | #undef NAME | ||
3 | #undef ICON | ||
4 | 1 | ||
5 | /* metadata */ | 2 | #ifdef HAVE_CONFIG_H |
6 | #define FNAME text_styles_start | 3 | # include <config.h> |
7 | #define NAME "Text Styles" | 4 | #endif |
8 | #define ICON "text.png" | ||
9 | 5 | ||
10 | #ifndef PROTO | 6 | #include "Eo.h" |
11 | # ifndef UI | 7 | #include "Evas.h" |
12 | # include "main.h" | 8 | |
9 | #include "Eo.hh" | ||
10 | #include "Eina.hh" | ||
11 | #include "Evas.hh" | ||
12 | |||
13 | #include "main.h" | ||
14 | |||
15 | #define EXPEDITE_CXX_TEST_IMPL | ||
16 | #include "text_styles_capi.h" | ||
13 | 17 | ||
14 | /* standard var */ | 18 | /* standard var */ |
15 | static int done = 0; | 19 | static int done = 0; |
16 | 20 | ||
17 | /* private data */ | 21 | /* private data */ |
18 | static Evas_Object *o_texts[OBNUM]; | 22 | static eina::list<evas::text> texts; |
19 | 23 | ||
20 | /* setup */ | 24 | /* setup */ |
21 | static void _setup(void) | 25 | static void _setup(void) |
@@ -45,9 +49,36 @@ static void _setup(void) | |||
45 | done = 0; | 49 | done = 0; |
46 | } | 50 | } |
47 | 51 | ||
52 | /* cleanup */ | ||
53 | static void _cleanup(void) | ||
54 | { | ||
55 | texts.clear(); | ||
56 | } | ||
57 | |||
58 | /* loop - do things */ | ||
59 | static void _loop(double t, int f) | ||
60 | { | ||
61 | int i; | ||
62 | Evas_Coord x, y, w, h; | ||
63 | for (i = 0; i < OBNUM; i++) | ||
64 | { | ||
65 | eo_do(o_texts[i], evas_obj_size_get(&w, &h)); | ||
66 | x = (win_w / 2) - (w / 2); | ||
67 | x += sin((double)(f + (i * 13)) / (36.7 * SLOW)) * (w / 2); | ||
68 | y = (win_h / 2) - (h / 2); | ||
69 | y += cos((double)(f + (i * 28)) / (43.8 * SLOW)) * (w / 2); | ||
70 | eo_do(o_texts[i], evas_obj_position_set(x, y)); | ||
71 | } | ||
72 | FPS_STD(NAME); | ||
73 | } | ||
48 | 74 | ||
49 | extern "C" static void _key(char *key) | 75 | static void _key(char *key) |
50 | { | 76 | { |
51 | KEY_STD; | 77 | KEY_STD; |
52 | } | 78 | } |
53 | 79 | ||
80 | extern "C" void FNAME(void) | ||
81 | { | ||
82 | ui_func_set(_key, _loop); | ||
83 | _setup(); | ||
84 | } | ||
diff --git a/src/bin/cxx/text_styles_different_strings.cc b/src/bin/cxx/text_styles_different_strings.cc index 71e8306..24087e3 100644 --- a/src/bin/cxx/text_styles_different_strings.cc +++ b/src/bin/cxx/text_styles_different_strings.cc | |||
@@ -56,9 +56,13 @@ static void _setup(void) | |||
56 | done = 0; | 56 | done = 0; |
57 | } | 57 | } |
58 | 58 | ||
59 | 59 | static void _key(char *key) | |
60 | extern "C" static void _key(char *key) | ||
61 | { | 60 | { |
62 | KEY_STD; | 61 | KEY_STD; |
63 | } | 62 | } |
64 | 63 | ||
64 | extern "C" void FNAME(void) | ||
65 | { | ||
66 | ui_func_set(_key, _loop); | ||
67 | _setup(); | ||
68 | } | ||
diff --git a/src/bin/cxx/textblock_auto_align.cc b/src/bin/cxx/textblock_auto_align.cc index 9aaeda3..082d135 100644 --- a/src/bin/cxx/textblock_auto_align.cc +++ b/src/bin/cxx/textblock_auto_align.cc | |||
@@ -59,8 +59,12 @@ static void _setup(void) | |||
59 | } | 59 | } |
60 | 60 | ||
61 | /* cleanup */ | 61 | /* cleanup */ |
62 | static void _cleanup(void) | ||
63 | { | ||
64 | eo_del(o_text); | ||
65 | } | ||
62 | 66 | ||
63 | extern "C" static void _key(char *key) | 67 | static void _key(char *key) |
64 | { | 68 | { |
65 | KEY_STD; | 69 | KEY_STD; |
66 | } | 70 | } |
diff --git a/src/bin/cxx/textblock_basic.cc b/src/bin/cxx/textblock_basic.cc index 928034d..085b56f 100644 --- a/src/bin/cxx/textblock_basic.cc +++ b/src/bin/cxx/textblock_basic.cc | |||
@@ -1,21 +1,25 @@ | |||
1 | #undef FNAME | ||
2 | #undef NAME | ||
3 | #undef ICON | ||
4 | 1 | ||
5 | /* metadata */ | 2 | #ifdef HAVE_CONFIG_H |
6 | #define FNAME textblock_basic_start | 3 | # include <config.h> |
7 | #define NAME "Textblock Basic" | 4 | #endif |
8 | #define ICON "text.png" | ||
9 | 5 | ||
10 | #ifndef PROTO | 6 | #include "Eo.h" |
11 | # ifndef UI | 7 | #include "Evas.h" |
12 | # include "main.h" | 8 | |
9 | #include "Eo.hh" | ||
10 | #include "Eina.hh" | ||
11 | #include "Evas.hh" | ||
12 | |||
13 | #include "main.h" | ||
14 | |||
15 | #define EXPEDITE_CXX_TEST_IMPL | ||
16 | #include "textblock_basic_capi.h" | ||
13 | 17 | ||
14 | /* standard var */ | 18 | /* standard var */ |
15 | static int done = 0; | 19 | static int done = 0; |
16 | 20 | ||
17 | /* private data */ | 21 | /* private data */ |
18 | static Evas_Object *o_text; | 22 | static evas::text text; |
19 | 23 | ||
20 | /* setup */ | 24 | /* setup */ |
21 | static void _setup(void) | 25 | static void _setup(void) |
@@ -122,9 +126,37 @@ static void _setup(void) | |||
122 | /* cleanup */ | 126 | /* cleanup */ |
123 | static void _cleanup(void) | 127 | static void _cleanup(void) |
124 | { | 128 | { |
129 | } | ||
130 | |||
131 | /* loop - do things */ | ||
132 | static void _loop(double t, int f) | ||
133 | { | ||
134 | Evas_Coord x, y, w, h, w0, h0; | ||
135 | int i = 0; | ||
125 | 136 | ||
126 | extern "C" static void _key(char *key) | 137 | w0 = 160; |
138 | h0 = 120; | ||
139 | w = 150 + ((1.0 + cos((double)(f + (i * 10)) / (37.4 * SLOW) )) * w0 * 2); | ||
140 | h = 50 + ((1.0 + sin((double)(f + (i * 19)) / (52.6 * SLOW) )) * h0 * 2); | ||
141 | x = (win_w / 2) - (w / 2); | ||
142 | x += sin((double)(f + (i * 13)) / (86.7 * SLOW)) * (w0 / 2); | ||
143 | y = (win_h / 2) - (h / 2); | ||
144 | y += cos((double)(f + (i * 28)) / (93.8 * SLOW)) * (h0 / 2); | ||
145 | eo_do(o_text, | ||
146 | evas_obj_position_set(x, y), | ||
147 | evas_obj_size_set(w, 5000)); | ||
148 | |||
149 | FPS_STD(NAME); | ||
150 | } | ||
151 | |||
152 | static void _key(char *key) | ||
127 | { | 153 | { |
128 | KEY_STD; | 154 | KEY_STD; |
129 | } | 155 | } |
130 | 156 | ||
157 | extern "C" void FNAME(void) | ||
158 | { | ||
159 | ui_func_set(_key, _loop); | ||
160 | _setup(); | ||
161 | } | ||
162 | |||
diff --git a/src/bin/cxx/textblock_intl.cc b/src/bin/cxx/textblock_intl.cc index bf177ef..eae2cc2 100644 --- a/src/bin/cxx/textblock_intl.cc +++ b/src/bin/cxx/textblock_intl.cc | |||
@@ -91,9 +91,13 @@ static void _setup(void) | |||
91 | } | 91 | } |
92 | 92 | ||
93 | /* cleanup */ | 93 | /* cleanup */ |
94 | 94 | static void _key(char *key) | |
95 | extern "C" static void _key(char *key) | ||
96 | { | 95 | { |
97 | KEY_STD; | 96 | KEY_STD; |
98 | } | 97 | } |
99 | 98 | ||
99 | extern "C" void FNAME(void) | ||
100 | { | ||
101 | ui_func_set(_key, _loop); | ||
102 | _setup(); | ||
103 | } | ||
diff --git a/src/bin/cxx/textblock_text_append.cc b/src/bin/cxx/textblock_text_append.cc index 16830cd..ad88732 100644 --- a/src/bin/cxx/textblock_text_append.cc +++ b/src/bin/cxx/textblock_text_append.cc | |||
@@ -1,21 +1,25 @@ | |||
1 | #undef FNAME | ||
2 | #undef NAME | ||
3 | #undef ICON | ||
4 | 1 | ||
5 | /* metadata */ | 2 | #ifdef HAVE_CONFIG_H |
6 | #define FNAME textblock_text_append_start | 3 | # include <config.h> |
7 | #define NAME "Textblock text_append" | 4 | #endif |
8 | #define ICON "text.png" | ||
9 | 5 | ||
10 | #ifndef PROTO | 6 | #include "Eo.h" |
11 | # ifndef UI | 7 | #include "Evas.h" |
12 | # include "main.h" | 8 | |
9 | #include "Eo.hh" | ||
10 | #include "Eina.hh" | ||
11 | #include "Evas.hh" | ||
12 | |||
13 | #include "main.h" | ||
14 | |||
15 | #define EXPEDITE_CXX_TEST_IMPL | ||
16 | #include "textblock_text_append_capi.h" | ||
13 | 17 | ||
14 | /* standard var */ | 18 | /* standard var */ |
15 | static int done = 0; | 19 | static int done = 0; |
16 | 20 | ||
17 | /* private data */ | 21 | /* private data */ |
18 | static Evas_Object *o_text; | 22 | static evas::text text; |
19 | 23 | ||
20 | /* setup */ | 24 | /* setup */ |
21 | static void _setup(void) | 25 | static void _setup(void) |
@@ -105,12 +109,39 @@ static void _setup(void) | |||
105 | /* cleanup */ | 109 | /* cleanup */ |
106 | static void _cleanup(void) | 110 | static void _cleanup(void) |
107 | { | 111 | { |
108 | eo_del(o_text); | ||
109 | } | 112 | } |
110 | 113 | ||
114 | /* loop - do things */ | ||
115 | static void _loop(double t, int f) | ||
116 | { | ||
117 | Evas_Textblock_Cursor *cur; | ||
118 | static Evas_Textblock_Cursor *cur2; | ||
119 | eo_do(o_text, cur = evas_obj_textblock_cursor_get()); | ||
120 | evas_textblock_cursor_text_append(cur, "*"); | ||
121 | evas_textblock_cursor_char_delete(cur); | ||
122 | |||
123 | evas_textblock_cursor_paragraph_char_first(cur); | ||
124 | if (!cur2) | ||
125 | { | ||
126 | eo_do(o_text, cur2 = evas_obj_textblock_cursor_new()); | ||
127 | evas_textblock_cursor_paragraph_last(cur2); | ||
128 | evas_textblock_cursor_paragraph_char_first(cur2); | ||
129 | } | ||
130 | if (!evas_textblock_cursor_compare(cur, cur2)) | ||
131 | evas_textblock_cursor_paragraph_first(cur); | ||
132 | else | ||
133 | evas_textblock_cursor_paragraph_next(cur); | ||
111 | 134 | ||
112 | extern "C" static void _key(char *key) | 135 | FPS_STD(NAME); |
136 | } | ||
137 | |||
138 | static void _key(char *key) | ||
113 | { | 139 | { |
114 | KEY_STD; | 140 | KEY_STD; |
115 | } | 141 | } |
116 | 142 | ||
143 | extern "C" void FNAME(void) | ||
144 | { | ||
145 | ui_func_set(_key, _loop); | ||
146 | _setup(); | ||
147 | } | ||
diff --git a/src/bin/cxx/widgets_file_icons.cc b/src/bin/cxx/widgets_file_icons.cc index 16d10d6..c556779 100644 --- a/src/bin/cxx/widgets_file_icons.cc +++ b/src/bin/cxx/widgets_file_icons.cc | |||
@@ -1,25 +1,30 @@ | |||
1 | #undef FNAME | ||
2 | #undef NAME | ||
3 | #undef ICON | ||
4 | 1 | ||
5 | /* metadata */ | 2 | #ifdef HAVE_CONFIG_H |
6 | #define FNAME widgets_file_icons_start | 3 | # include <config.h> |
7 | #define NAME "Widgets File Icons" | 4 | #endif |
8 | #define ICON "widgets.png" | ||
9 | 5 | ||
10 | #ifndef PROTO | 6 | #include "Eo.h" |
11 | # ifndef UI | 7 | #include "Evas.h" |
12 | # include "main.h" | 8 | |
9 | #include "Eo.hh" | ||
10 | #include "Eina.hh" | ||
11 | #include "Evas.hh" | ||
12 | |||
13 | #include "main.h" | ||
14 | |||
15 | #define EXPEDITE_CXX_TEST_IMPL | ||
16 | #include "widgets_file_icons_capi.h" | ||
13 | 17 | ||
14 | /* standard var */ | 18 | /* standard var */ |
15 | static int done = 0; | 19 | static int done = 0; |
16 | /* private data */ | 20 | /* private data */ |
17 | #define NUM 512 | 21 | #define NUM 512 |
18 | #define ICON_SIZE 64 | 22 | #define ICON_SIZE 64 |
23 | |||
19 | static efl::eina::list<evas::image> images; | 24 | static efl::eina::list<evas::image> images; |
20 | static Evas_Object *o_texts[NUM]; | 25 | static efl::eina::list<evas::text> text; |
21 | 26 | ||
22 | static const char *icons[] = | 27 | static const char *icons[] = // XXX |
23 | { | 28 | { |
24 | "bug.png", | 29 | "bug.png", |
25 | "bulb.png", | 30 | "bulb.png", |
@@ -42,9 +47,8 @@ static const char *icons[] = | |||
42 | /* setup */ | 47 | /* setup */ |
43 | static void _setup(void) | 48 | static void _setup(void) |
44 | { | 49 | { |
45 | int i; | ||
46 | evas::canvas canvas(::eo_ref(G_evas)); | 50 | evas::canvas canvas(::eo_ref(G_evas)); |
47 | for (i = 0; i < NUM; i++) | 51 | for (int i = 0; i < NUM; i++) |
48 | { | 52 | { |
49 | evas::image o(efl::eo::parent = canvas); | 53 | evas::image o(efl::eo::parent = canvas); |
50 | images.push_back(o); | 54 | images.push_back(o); |
@@ -68,16 +72,17 @@ static void _setup(void) | |||
68 | /* cleanup */ | 72 | /* cleanup */ |
69 | static void _cleanup(void) | 73 | static void _cleanup(void) |
70 | { | 74 | { |
71 | int i; | 75 | images.clear(); |
72 | for (i = 0; i < NUM; i++) | 76 | texts.clear(); |
73 | { | ||
74 | eo_del(images[i]); | ||
75 | eo_del(o_texts[i]); | ||
76 | } | ||
77 | } | 77 | } |
78 | 78 | ||
79 | extern "C" static void _key(char *key) | 79 | static void _key(char *key) |
80 | { | 80 | { |
81 | KEY_STD; | 81 | KEY_STD; |
82 | } | 82 | } |
83 | 83 | ||
84 | extern "C" void FNAME(void) | ||
85 | { | ||
86 | ui_func_set(_key, _loop); | ||
87 | _setup(); | ||
88 | } | ||
diff --git a/src/bin/cxx/widgets_file_icons_2.cc b/src/bin/cxx/widgets_file_icons_2.cc index 1144e3f..7ad890f 100644 --- a/src/bin/cxx/widgets_file_icons_2.cc +++ b/src/bin/cxx/widgets_file_icons_2.cc | |||
@@ -73,9 +73,13 @@ static void _cleanup(void) | |||
73 | eo_del(o_texts[i]); | 73 | eo_del(o_texts[i]); |
74 | } | 74 | } |
75 | } | 75 | } |
76 | 76 | static void _key(char *key) | |
77 | extern "C" static void _key(char *key) | ||
78 | { | 77 | { |
79 | KEY_STD; | 78 | KEY_STD; |
80 | } | 79 | } |
81 | 80 | ||
81 | extern "C" void FNAME(void) | ||
82 | { | ||
83 | ui_func_set(_key, _loop); | ||
84 | _setup(); | ||
85 | } | ||
diff --git a/src/bin/cxx/widgets_file_icons_2_grouped.cc b/src/bin/cxx/widgets_file_icons_2_grouped.cc index 3a568e0..a46e442 100644 --- a/src/bin/cxx/widgets_file_icons_2_grouped.cc +++ b/src/bin/cxx/widgets_file_icons_2_grouped.cc | |||
@@ -1,23 +1,28 @@ | |||
1 | #undef FNAME | ||
2 | #undef NAME | ||
3 | #undef ICON | ||
4 | 1 | ||
5 | /* metadata */ | 2 | #ifdef HAVE_CONFIG_H |
6 | #define FNAME widgets_file_icons_2_grouped_start | 3 | # include <config.h> |
7 | #define NAME "Widgets File Icons 2 Grouped" | 4 | #endif |
8 | #define ICON "widgets.png" | ||
9 | 5 | ||
10 | #ifndef PROTO | 6 | #include "Eo.h" |
11 | # ifndef UI | 7 | #include "Evas.h" |
12 | # include "main.h" | 8 | |
9 | #include "Eo.hh" | ||
10 | #include "Eina.hh" | ||
11 | #include "Evas.hh" | ||
12 | |||
13 | #include "main.h" | ||
14 | |||
15 | #define EXPEDITE_CXX_TEST_IMPL | ||
16 | #include "widgets_file_icons_2_grouped_capi.h" | ||
13 | 17 | ||
14 | /* standard var */ | 18 | /* standard var */ |
15 | static int done = 0; | 19 | static int done = 0; |
16 | /* private data */ | 20 | /* private data */ |
17 | #define NUM 512 | 21 | #define NUM 512 |
18 | #define ICON_SIZE 64 | 22 | #define ICON_SIZE 64 |
23 | |||
19 | static efl::eina::list<evas::image> images; | 24 | static efl::eina::list<evas::image> images; |
20 | static Evas_Object *o_texts[NUM]; | 25 | static efl::eina::list<evas::text> texts; |
21 | 26 | ||
22 | static const char *icons[] = | 27 | static const char *icons[] = |
23 | { | 28 | { |
@@ -75,16 +80,40 @@ static void _setup(void) | |||
75 | /* cleanup */ | 80 | /* cleanup */ |
76 | static void _cleanup(void) | 81 | static void _cleanup(void) |
77 | { | 82 | { |
83 | images.clear(); | ||
84 | texts.clear(); | ||
85 | } | ||
86 | |||
87 | /* loop - do things */ | ||
88 | static void _loop(double t, int f) | ||
89 | { | ||
78 | int i; | 90 | int i; |
91 | Evas_Coord x, y, tw, th, cent; | ||
92 | x = 0; | ||
93 | y = 0 - f; | ||
79 | for (i = 0; i < NUM; i++) | 94 | for (i = 0; i < NUM; i++) |
80 | { | 95 | { |
81 | eo_del(images[i]); | 96 | eo_do(o_images[i], evas_obj_position_set(x + 8, y)); |
82 | eo_del(o_texts[i]); | 97 | eo_do(o_texts[i], evas_obj_size_get(&tw, &th)); |
98 | cent = (ICON_SIZE + 16 - tw) / 2; | ||
99 | eo_do(o_texts[i], evas_obj_position_set(x + cent, y + ICON_SIZE + 4)); | ||
100 | x += ICON_SIZE + 16; | ||
101 | if (x > win_w) | ||
102 | { | ||
103 | x = 0; | ||
104 | y += ICON_SIZE + 16; | ||
105 | } | ||
83 | } | 106 | } |
107 | FPS_STD(NAME); | ||
84 | } | 108 | } |
85 | 109 | ||
86 | extern "C" static void _key(char *key) | 110 | static void _key(char *key) |
87 | { | 111 | { |
88 | KEY_STD; | 112 | KEY_STD; |
89 | } | 113 | } |
90 | 114 | ||
115 | extern "C" void FNAME(void) | ||
116 | { | ||
117 | ui_func_set(_key, _loop); | ||
118 | _setup(); | ||
119 | } | ||
diff --git a/src/bin/cxx/widgets_file_icons_2_same.cc b/src/bin/cxx/widgets_file_icons_2_same.cc index e2bb8c1..d89113b 100644 --- a/src/bin/cxx/widgets_file_icons_2_same.cc +++ b/src/bin/cxx/widgets_file_icons_2_same.cc | |||
@@ -16,10 +16,11 @@ static int done = 0; | |||
16 | /* private data */ | 16 | /* private data */ |
17 | #define NUM 512 | 17 | #define NUM 512 |
18 | #define ICON_SIZE 64 | 18 | #define ICON_SIZE 64 |
19 | |||
19 | static efl::eina::list<evas::image> images; | 20 | static efl::eina::list<evas::image> images; |
20 | static Evas_Object *o_texts[NUM]; | 21 | static efl::eina::list<evas::text> texts; |
21 | 22 | ||
22 | static const char *icons[] = | 23 | static const char *icons[] = // XXX |
23 | { | 24 | { |
24 | "e.png", | 25 | "e.png", |
25 | }; | 26 | }; |
@@ -51,16 +52,40 @@ static void _setup(void) | |||
51 | /* cleanup */ | 52 | /* cleanup */ |
52 | static void _cleanup(void) | 53 | static void _cleanup(void) |
53 | { | 54 | { |
55 | images.clear(); | ||
56 | texts.clear(); | ||
57 | } | ||
58 | |||
59 | /* loop - do things */ | ||
60 | static void _loop(double t, int f) | ||
61 | { | ||
54 | int i; | 62 | int i; |
63 | Evas_Coord x, y, tw, th, cent; | ||
64 | x = 0; | ||
65 | y = 0 - f; | ||
55 | for (i = 0; i < NUM; i++) | 66 | for (i = 0; i < NUM; i++) |
56 | { | 67 | { |
57 | eo_del(images[i]); | 68 | eo_do(o_images[i], evas_obj_position_set(x + 8, y)); |
58 | eo_del(o_texts[i]); | 69 | eo_do(o_texts[i], evas_obj_size_get(&tw, &th)); |
70 | cent = (ICON_SIZE + 16 - tw) / 2; | ||
71 | eo_do(o_texts[i], evas_obj_position_set(x + cent, y + ICON_SIZE + 4)); | ||
72 | x += ICON_SIZE + 16; | ||
73 | if (x > win_w) | ||
74 | { | ||
75 | x = 0; | ||
76 | y += ICON_SIZE + 16; | ||
77 | } | ||
59 | } | 78 | } |
79 | FPS_STD(NAME); | ||
60 | } | 80 | } |
61 | 81 | ||
62 | extern "C" static void _key(char *key) | 82 | static void _key(char *key) |
63 | { | 83 | { |
64 | KEY_STD; | 84 | KEY_STD; |
65 | } | 85 | } |
66 | 86 | ||
87 | extern "C" void FNAME(void) | ||
88 | { | ||
89 | ui_func_set(_key, _loop); | ||
90 | _setup(); | ||
91 | } | ||
diff --git a/src/bin/cxx/widgets_file_icons_3.cc b/src/bin/cxx/widgets_file_icons_3.cc index d6c683d..f41eaa5 100644 --- a/src/bin/cxx/widgets_file_icons_3.cc +++ b/src/bin/cxx/widgets_file_icons_3.cc | |||
@@ -73,9 +73,13 @@ static void _cleanup(void) | |||
73 | eo_del(o_texts[i]); | 73 | eo_del(o_texts[i]); |
74 | } | 74 | } |
75 | } | 75 | } |
76 | 76 | static void _key(char *key) | |
77 | extern "C" static void _key(char *key) | ||
78 | { | 77 | { |
79 | KEY_STD; | 78 | KEY_STD; |
80 | } | 79 | } |
81 | 80 | ||
81 | extern "C" void FNAME(void) | ||
82 | { | ||
83 | ui_func_set(_key, _loop); | ||
84 | _setup(); | ||
85 | } | ||
diff --git a/src/bin/cxx/widgets_file_icons_4.cc b/src/bin/cxx/widgets_file_icons_4.cc index 93955bd..71997f2 100644 --- a/src/bin/cxx/widgets_file_icons_4.cc +++ b/src/bin/cxx/widgets_file_icons_4.cc | |||
@@ -1,15 +1,19 @@ | |||
1 | #undef FNAME | ||
2 | #undef NAME | ||
3 | #undef ICON | ||
4 | 1 | ||
5 | /* metadata */ | 2 | #ifdef HAVE_CONFIG_H |
6 | #define FNAME widgets_file_icons_4_start | 3 | # include <config.h> |
7 | #define NAME "Widgets File Icons 4" | 4 | #endif |
8 | #define ICON "widgets.png" | ||
9 | 5 | ||
10 | #ifndef PROTO | 6 | #include "Eo.h" |
11 | # ifndef UI | 7 | #include "Evas.h" |
12 | # include "main.h" | 8 | |
9 | #include "Eo.hh" | ||
10 | #include "Eina.hh" | ||
11 | #include "Evas.hh" | ||
12 | |||
13 | #include "main.h" | ||
14 | |||
15 | #define EXPEDITE_CXX_TEST_IMPL | ||
16 | #include "widgets_file_icons_4_capi.h" | ||
13 | 17 | ||
14 | /* standard var */ | 18 | /* standard var */ |
15 | static int done = 0; | 19 | static int done = 0; |
@@ -17,7 +21,7 @@ static int done = 0; | |||
17 | #define NUM 512 | 21 | #define NUM 512 |
18 | #define ICON_SIZE 96 | 22 | #define ICON_SIZE 96 |
19 | static efl::eina::list<evas::image> images; | 23 | static efl::eina::list<evas::image> images; |
20 | static Evas_Object *o_texts[NUM]; | 24 | static efl::eina::list<evas::text> texts; |
21 | 25 | ||
22 | static const char *icons[] = | 26 | static const char *icons[] = |
23 | { | 27 | { |
@@ -66,16 +70,40 @@ static void _setup(void) | |||
66 | /* cleanup */ | 70 | /* cleanup */ |
67 | static void _cleanup(void) | 71 | static void _cleanup(void) |
68 | { | 72 | { |
73 | images.clear(); | ||
74 | texts.clear(); | ||
75 | } | ||
76 | |||
77 | /* loop - do things */ | ||
78 | static void _loop(double t, int f) | ||
79 | { | ||
69 | int i; | 80 | int i; |
81 | Evas_Coord x, y, tw, th, cent; | ||
82 | x = 0; | ||
83 | y = 0 - f; | ||
70 | for (i = 0; i < NUM; i++) | 84 | for (i = 0; i < NUM; i++) |
71 | { | 85 | { |
72 | eo_del(images[i]); | 86 | eo_do(o_images[i], evas_obj_position_set(x + 8, y)); |
73 | eo_del(o_texts[i]); | 87 | eo_do(o_texts[i], evas_obj_size_get(&tw, &th)); |
88 | cent = (ICON_SIZE + 16 - tw) / 2; | ||
89 | eo_do(o_texts[i], evas_obj_position_set(x + cent, y + ICON_SIZE + 4)); | ||
90 | x += ICON_SIZE + 16; | ||
91 | if (x > win_w) | ||
92 | { | ||
93 | x = 0; | ||
94 | y += ICON_SIZE + 16; | ||
95 | } | ||
74 | } | 96 | } |
97 | FPS_STD(NAME); | ||
75 | } | 98 | } |
76 | 99 | ||
77 | extern "C" static void _key(char *key) | 100 | static void _key(char *key) |
78 | { | 101 | { |
79 | KEY_STD; | 102 | KEY_STD; |
80 | } | 103 | } |
81 | 104 | ||
105 | extern "C" void FNAME(void) | ||
106 | { | ||
107 | ui_func_set(_key, _loop); | ||
108 | _setup(); | ||
109 | } | ||
diff --git a/src/bin/cxx/widgets_list_1.cc b/src/bin/cxx/widgets_list_1.cc index dc0a05f..8087488 100644 --- a/src/bin/cxx/widgets_list_1.cc +++ b/src/bin/cxx/widgets_list_1.cc | |||
@@ -1,23 +1,29 @@ | |||
1 | #undef FNAME | ||
2 | #undef NAME | ||
3 | #undef ICON | ||
4 | 1 | ||
5 | /* metadata */ | 2 | #ifdef HAVE_CONFIG_H |
6 | #define FNAME widgets_list_1_start | 3 | # include <config.h> |
7 | #define NAME "Widgets List" | 4 | #endif |
8 | #define ICON "widgets.png" | 5 | |
6 | #include "Eo.h" | ||
7 | #include "Evas.h" | ||
8 | |||
9 | #include "Eo.hh" | ||
10 | #include "Eina.hh" | ||
11 | #include "Evas.hh" | ||
12 | |||
13 | #include "main.h" | ||
14 | |||
15 | #define EXPEDITE_CXX_TEST_IMPL | ||
16 | #include "cxx/widgets_list_1._capich" | ||
9 | 17 | ||
10 | #ifndef PROTO | ||
11 | # ifndef UI | ||
12 | # include "main.h" | ||
13 | 18 | ||
14 | /* standard var */ | 19 | /* standard var */ |
15 | static int done = 0; | 20 | static int done = 0; |
16 | /* private data */ | 21 | /* private data */ |
17 | #define NUM 512 | 22 | #define NUM 512 |
18 | #define ICON_SIZE 64 | 23 | #define ICON_SIZE 64 |
24 | |||
19 | static efl::eina::list<evas::image> images; | 25 | static efl::eina::list<evas::image> images; |
20 | static Evas_Object *o_texts[NUM]; | 26 | static efl::eina::list<evas::text> texts; |
21 | 27 | ||
22 | static const char *labels[] = | 28 | static const char *labels[] = |
23 | { | 29 | { |
@@ -83,11 +89,35 @@ static void _setup(void) | |||
83 | /* cleanup */ | 89 | /* cleanup */ |
84 | static void _cleanup(void) | 90 | static void _cleanup(void) |
85 | { | 91 | { |
92 | images.clear(); | ||
93 | texts.clear(); | ||
94 | } | ||
95 | |||
96 | /* loop - do things */ | ||
97 | static void _loop(double t, int f) | ||
98 | { | ||
86 | int i; | 99 | int i; |
100 | Evas_Coord x, y, tw, th, cent; | ||
101 | x = 0; | ||
102 | y = 0 - f; | ||
87 | for (i = 0; i < NUM; i++) | 103 | for (i = 0; i < NUM; i++) |
104 | { | ||
105 | eo_do(o_images[i], evas_obj_position_set(x, y)); | ||
106 | eo_do(o_texts[i], evas_obj_size_get(&tw, &th)); | ||
107 | cent = (ICON_SIZE - th) / 2; | ||
108 | eo_do(o_texts[i], evas_obj_position_set(x + 8, y + cent)); | ||
109 | y += ICON_SIZE; | ||
110 | } | ||
111 | FPS_STD(NAME); | ||
112 | } | ||
88 | 113 | ||
89 | extern "C" static void _key(char *key) | 114 | static void _key(char *key) |
90 | { | 115 | { |
91 | KEY_STD; | 116 | KEY_STD; |
92 | } | 117 | } |
93 | 118 | ||
119 | extern "C" void FNAME(void) | ||
120 | { | ||
121 | ui_func_set(_key, _loop); | ||
122 | _setup(); | ||
123 | } | ||
diff --git a/src/bin/cxx/widgets_list_1_grouped.cc b/src/bin/cxx/widgets_list_1_grouped.cc index ea41dc5..4681a24 100644 --- a/src/bin/cxx/widgets_list_1_grouped.cc +++ b/src/bin/cxx/widgets_list_1_grouped.cc | |||
@@ -93,9 +93,13 @@ static void _cleanup(void) | |||
93 | { | 93 | { |
94 | int i; | 94 | int i; |
95 | for (i = 0; i < NUM; i++) | 95 | for (i = 0; i < NUM; i++) |
96 | 96 | static void _key(char *key) | |
97 | extern "C" static void _key(char *key) | ||
98 | { | 97 | { |
99 | KEY_STD; | 98 | KEY_STD; |
100 | } | 99 | } |
101 | 100 | ||
101 | extern "C" void FNAME(void) | ||
102 | { | ||
103 | ui_func_set(_key, _loop); | ||
104 | _setup(); | ||
105 | } | ||
diff --git a/src/bin/cxx/widgets_list_2.cc b/src/bin/cxx/widgets_list_2.cc index b24baaf..48bc2f8 100644 --- a/src/bin/cxx/widgets_list_2.cc +++ b/src/bin/cxx/widgets_list_2.cc | |||
@@ -1,25 +1,30 @@ | |||
1 | #undef FNAME | ||
2 | #undef NAME | ||
3 | #undef ICON | ||
4 | 1 | ||
5 | /* metadata */ | 2 | #ifdef HAVE_CONFIG_H |
6 | #define FNAME widgets_list_2_start | 3 | # include <config.h> |
7 | #define NAME "Widgets List 2" | 4 | #endif |
8 | #define ICON "widgets.png" | ||
9 | 5 | ||
10 | #ifndef PROTO | 6 | #include "Eo.h" |
11 | # ifndef UI | 7 | #include "Evas.h" |
12 | # include "main.h" | 8 | |
9 | #include "Eo.hh" | ||
10 | #include "Eina.hh" | ||
11 | #include "Evas.hh" | ||
12 | |||
13 | #include "main.h" | ||
14 | |||
15 | #define EXPEDITE_CXX_TEST_IMPL | ||
16 | #include "widgets_list_2_capi.h" | ||
13 | 17 | ||
14 | /* standard var */ | 18 | /* standard var */ |
15 | static int done = 0; | 19 | static int done = 0; |
16 | /* private data */ | 20 | /* private data */ |
17 | #define NUM 512 | 21 | #define NUM 512 |
18 | #define ICON_SIZE 32 | 22 | #define ICON_SIZE 32 |
23 | |||
19 | static efl::eina::list<evas::image> images; | 24 | static efl::eina::list<evas::image> images; |
20 | static Evas_Object *o_texts[NUM]; | 25 | static efl::eina::list<evas::text> texts; |
21 | 26 | ||
22 | static const char *labels[] = | 27 | static const char *labels[] = // XXX |
23 | { | 28 | { |
24 | "Andrew", | 29 | "Andrew", |
25 | "Alex", | 30 | "Alex", |
@@ -83,11 +88,35 @@ static void _setup(void) | |||
83 | /* cleanup */ | 88 | /* cleanup */ |
84 | static void _cleanup(void) | 89 | static void _cleanup(void) |
85 | { | 90 | { |
91 | images.clear(); | ||
92 | texts.clear(); | ||
93 | } | ||
94 | |||
95 | /* loop - do things */ | ||
96 | static void _loop(double t, int f) | ||
97 | { | ||
86 | int i; | 98 | int i; |
99 | Evas_Coord x, y, tw, th, cent; | ||
100 | x = 0; | ||
101 | y = 0 - f; | ||
87 | for (i = 0; i < NUM; i++) | 102 | for (i = 0; i < NUM; i++) |
103 | { | ||
104 | eo_do(o_images[i], evas_obj_position_set(x, y)); | ||
105 | eo_do(o_texts[i], evas_obj_size_get(&tw, &th)); | ||
106 | cent = (ICON_SIZE - th) / 2; | ||
107 | eo_do(o_texts[i], evas_obj_position_set(x + 8, y + cent)); | ||
108 | y += ICON_SIZE; | ||
109 | } | ||
110 | FPS_STD(NAME); | ||
111 | } | ||
88 | 112 | ||
89 | extern "C" static void _key(char *key) | 113 | static void _key(char *key) |
90 | { | 114 | { |
91 | KEY_STD; | 115 | KEY_STD; |
92 | } | 116 | } |
93 | 117 | ||
118 | extern "C" void FNAME(void) | ||
119 | { | ||
120 | ui_func_set(_key, _loop); | ||
121 | _setup(); | ||
122 | } | ||
diff --git a/src/bin/cxx/widgets_list_2_grouped.cc b/src/bin/cxx/widgets_list_2_grouped.cc index cd472df..015850a 100644 --- a/src/bin/cxx/widgets_list_2_grouped.cc +++ b/src/bin/cxx/widgets_list_2_grouped.cc | |||
@@ -1,25 +1,30 @@ | |||
1 | #undef FNAME | ||
2 | #undef NAME | ||
3 | #undef ICON | ||
4 | 1 | ||
5 | /* metadata */ | 2 | #ifdef HAVE_CONFIG_H |
6 | #define FNAME widgets_list_2_grouped_start | 3 | # include <config.h> |
7 | #define NAME "Widgets List 2 Grouped" | 4 | #endif |
8 | #define ICON "widgets.png" | ||
9 | 5 | ||
10 | #ifndef PROTO | 6 | #include "Eo.h" |
11 | # ifndef UI | 7 | #include "Evas.h" |
12 | # include "main.h" | 8 | |
9 | #include "Eo.hh" | ||
10 | #include "Eina.hh" | ||
11 | #include "Evas.hh" | ||
12 | |||
13 | #include "main.h" | ||
14 | |||
15 | #define EXPEDITE_CXX_TEST_IMPL | ||
16 | #include "widgets_list_2_grouped_capi.h" | ||
13 | 17 | ||
14 | /* standard var */ | 18 | /* standard var */ |
15 | static int done = 0; | 19 | static int done = 0; |
16 | /* private data */ | 20 | /* private data */ |
17 | #define NUM 512 | 21 | #define NUM 512 |
18 | #define ICON_SIZE 64 | 22 | #define ICON_SIZE 64 |
23 | |||
19 | static efl::eina::list<evas::image> images; | 24 | static efl::eina::list<evas::image> images; |
20 | static Evas_Object *o_texts[NUM]; | 25 | static efl::eina::list<evas::text> texts; |
21 | 26 | ||
22 | static const char *labels[] = | 27 | static const char *labels[] = // XXX |
23 | { | 28 | { |
24 | "Andrew", | 29 | "Andrew", |
25 | "Alex", | 30 | "Alex", |
@@ -91,11 +96,35 @@ static void _setup(void) | |||
91 | /* cleanup */ | 96 | /* cleanup */ |
92 | static void _cleanup(void) | 97 | static void _cleanup(void) |
93 | { | 98 | { |
99 | images.clear(); | ||
100 | texts.clear(); | ||
101 | } | ||
102 | |||
103 | /* loop - do things */ | ||
104 | static void _loop(double t, int f) | ||
105 | { | ||
94 | int i; | 106 | int i; |
107 | Evas_Coord x, y, tw, th, cent; | ||
108 | x = 0; | ||
109 | y = 0 - f; | ||
95 | for (i = 0; i < NUM; i++) | 110 | for (i = 0; i < NUM; i++) |
111 | { | ||
112 | eo_do(o_images[i], evas_obj_position_set(x, y)); | ||
113 | eo_do(o_texts[i], evas_obj_size_get(&tw, &th)); | ||
114 | cent = (ICON_SIZE - th) / 2; | ||
115 | eo_do(o_texts[i], evas_obj_position_set(x + 8, y + cent)); | ||
116 | y += ICON_SIZE; | ||
117 | } | ||
118 | FPS_STD(NAME); | ||
119 | } | ||
96 | 120 | ||
97 | extern "C" static void _key(char *key) | 121 | static void _key(char *key) |
98 | { | 122 | { |
99 | KEY_STD; | 123 | KEY_STD; |
100 | } | 124 | } |
101 | 125 | ||
126 | extern "C" void FNAME(void) | ||
127 | { | ||
128 | ui_func_set(_key, _loop); | ||
129 | _setup(); | ||
130 | } | ||
diff --git a/src/bin/cxx/widgets_list_3.cc b/src/bin/cxx/widgets_list_3.cc index 2b1aca9..cb41048 100644 --- a/src/bin/cxx/widgets_list_3.cc +++ b/src/bin/cxx/widgets_list_3.cc | |||
@@ -1,15 +1,4 @@ | |||
1 | #undef FNAME | ||
2 | #undef NAME | ||
3 | #undef ICON | ||
4 | 1 | ||
5 | /* metadata */ | ||
6 | #define FNAME widgets_list_3_start | ||
7 | #define NAME "Widgets List 3" | ||
8 | #define ICON "widgets.png" | ||
9 | |||
10 | #ifndef PROTO | ||
11 | # ifndef UI | ||
12 | # include "main.h" | ||
13 | 2 | ||
14 | /* standard var */ | 3 | /* standard var */ |
15 | static int done = 0; | 4 | static int done = 0; |
@@ -79,9 +68,8 @@ static const char *labels[] = | |||
79 | /* setup */ | 68 | /* setup */ |
80 | static void _setup(void) | 69 | static void _setup(void) |
81 | { | 70 | { |
82 | int i; | ||
83 | evas::canvas canvas(::eo_ref(G_evas)); | 71 | evas::canvas canvas(::eo_ref(G_evas)); |
84 | for (i = 0; i < NUM; i++) | 72 | for (int i = 0; i < NUM; i++) |
85 | { | 73 | { |
86 | evas::image o(efl::eo::parent = canvas); | 74 | evas::image o(efl::eo::parent = canvas); |
87 | images.push_back(o); | 75 | images.push_back(o); |
@@ -115,10 +103,39 @@ static void _cleanup(void) | |||
115 | int i; | 103 | int i; |
116 | for (i = 0; i < NUM; i++) | 104 | for (i = 0; i < NUM; i++) |
117 | { | 105 | { |
118 | eo_del(images[i]); | 106 | eo_del(o_images[i]); |
107 | eo_del(o_icons[i]); | ||
108 | eo_del(o_texts[i]); | ||
109 | } | ||
110 | } | ||
111 | |||
112 | /* loop - do things */ | ||
113 | static void _loop(double t, int f) | ||
114 | { | ||
115 | int i; | ||
116 | Evas_Coord x, y, tw, th, cent; | ||
117 | x = 0; | ||
118 | y = 0 - f; | ||
119 | for (i = 0; i < NUM; i++) | ||
120 | { | ||
121 | eo_do(o_images[i], evas_obj_position_set(x, y)); | ||
122 | eo_do(o_icons[i], evas_obj_position_set(x + 4, y + 4)); | ||
123 | eo_do(o_texts[i], evas_obj_size_get(&tw, &th)); | ||
124 | cent = (ICON_SIZE - th) / 2; | ||
125 | eo_do(o_texts[i], evas_obj_position_set(x + 8 + ICON_SIZE + 8, y + cent)); | ||
126 | y += ICON_SIZE; | ||
127 | } | ||
128 | FPS_STD(NAME); | ||
129 | } | ||
119 | 130 | ||
120 | extern "C" static void _key(char *key) | 131 | /* prepend special key handlers if interactive (before STD) */ |
132 | static void _key(char *key) | ||
121 | { | 133 | { |
122 | KEY_STD; | 134 | KEY_STD; |
123 | } | 135 | } |
124 | 136 | ||
137 | extern "C" void FNAME(void) | ||
138 | { | ||
139 | ui_func_set(_key, _loop); | ||
140 | _setup(); | ||
141 | } | ||
diff --git a/src/bin/cxx/widgets_list_3_grouped.cc b/src/bin/cxx/widgets_list_3_grouped.cc index a42eade..9f7fd95 100644 --- a/src/bin/cxx/widgets_list_3_grouped.cc +++ b/src/bin/cxx/widgets_list_3_grouped.cc | |||
@@ -1,24 +1,29 @@ | |||
1 | #undef FNAME | ||
2 | #undef NAME | ||
3 | #undef ICON | ||
4 | 1 | ||
5 | /* metadata */ | 2 | #ifdef HAVE_CONFIG_H |
6 | #define FNAME widgets_list_3_grouped_start | 3 | # include <config.h> |
7 | #define NAME "Widgets List 3 Grouped" | 4 | #endif |
8 | #define ICON "widgets.png" | ||
9 | 5 | ||
10 | #ifndef PROTO | 6 | #include "Eo.h" |
11 | # ifndef UI | 7 | #include "Evas.h" |
12 | # include "main.h" | 8 | |
9 | #include "Eo.hh" | ||
10 | #include "Eina.hh" | ||
11 | #include "Evas.hh" | ||
12 | |||
13 | #include "main.h" | ||
14 | |||
15 | #define EXPEDITE_CXX_TEST_IMPL | ||
16 | #include "widgets_list_3_grouped_capi.h" | ||
13 | 17 | ||
14 | /* standard var */ | 18 | /* standard var */ |
15 | static int done = 0; | 19 | static int done = 0; |
16 | /* private data */ | 20 | /* private data */ |
17 | #define NUM 512 | 21 | #define NUM 512 |
18 | #define ICON_SIZE 64 | 22 | #define ICON_SIZE 64 |
23 | |||
19 | static efl::eina::list<evas::image> images; | 24 | static efl::eina::list<evas::image> images; |
20 | static Evas_Object *o_icons[NUM]; | 25 | static efl::eina::list<evas::image> icons; |
21 | static Evas_Object *o_texts[NUM]; | 26 | static efl::eina::list<evas::text> texts; |
22 | 27 | ||
23 | static const char *icons[] = | 28 | static const char *icons[] = |
24 | { | 29 | { |
@@ -129,13 +134,37 @@ static void _setup(void) | |||
129 | /* cleanup */ | 134 | /* cleanup */ |
130 | static void _cleanup(void) | 135 | static void _cleanup(void) |
131 | { | 136 | { |
137 | images.clear(); | ||
138 | icons.clear(); | ||
139 | texts.clear(); | ||
140 | } | ||
141 | |||
142 | /* loop - do things */ | ||
143 | static void _loop(double t, int f) | ||
144 | { | ||
132 | int i; | 145 | int i; |
146 | Evas_Coord x, y, tw, th, cent; | ||
147 | x = 0; | ||
148 | y = 0 - f; | ||
133 | for (i = 0; i < NUM; i++) | 149 | for (i = 0; i < NUM; i++) |
134 | { | 150 | { |
135 | eo_del(images[i]); | 151 | eo_do(o_images[i], evas_obj_position_set(x, y)); |
152 | eo_do(o_icons[i], evas_obj_position_set(x + 4, y + 4)); | ||
153 | eo_do(o_texts[i], evas_obj_size_get(&tw, &th)); | ||
154 | cent = (ICON_SIZE - th) / 2; | ||
155 | eo_do(o_texts[i], evas_obj_position_set(x + 8 + ICON_SIZE + 8, y + cent)); | ||
156 | y += ICON_SIZE; | ||
157 | } | ||
158 | FPS_STD(NAME); | ||
159 | } | ||
136 | 160 | ||
137 | extern "C" static void _key(char *key) | 161 | static void _key(char *key) |
138 | { | 162 | { |
139 | KEY_STD; | 163 | KEY_STD; |
140 | } | 164 | } |
141 | 165 | ||
166 | extern "C" void FNAME(void) | ||
167 | { | ||
168 | ui_func_set(_key, _loop); | ||
169 | _setup(); | ||
170 | } | ||
diff --git a/src/bin/cxx/widgets_list_4.cc b/src/bin/cxx/widgets_list_4.cc index 4beb5ae..548202f 100644 --- a/src/bin/cxx/widgets_list_4.cc +++ b/src/bin/cxx/widgets_list_4.cc | |||
@@ -1,26 +1,31 @@ | |||
1 | #undef FNAME | ||
2 | #undef NAME | ||
3 | #undef ICON | ||
4 | 1 | ||
5 | /* metadata */ | 2 | #ifdef HAVE_CONFIG_H |
6 | #define FNAME widgets_list_4_start | 3 | # include <config.h> |
7 | #define NAME "Widgets List 4" | 4 | #endif |
8 | #define ICON "widgets.png" | ||
9 | 5 | ||
10 | #ifndef PROTO | 6 | #include "Eo.h" |
11 | # ifndef UI | 7 | #include "Evas.h" |
12 | # include "main.h" | 8 | |
9 | #include "Eo.hh" | ||
10 | #include "Eina.hh" | ||
11 | #include "Evas.hh" | ||
12 | |||
13 | #include "main.h" | ||
14 | |||
15 | #define EXPEDITE_CXX_TEST_IMPL | ||
16 | #include "widgets_list_4_capi.h" | ||
13 | 17 | ||
14 | /* standard var */ | 18 | /* standard var */ |
15 | static int done = 0; | 19 | static int done = 0; |
16 | /* private data */ | 20 | /* private data */ |
17 | #define NUM 512 | 21 | #define NUM 512 |
18 | #define ICON_SIZE 32 | 22 | #define ICON_SIZE 32 |
23 | |||
19 | static efl::eina::list<evas::image> images; | 24 | static efl::eina::list<evas::image> images; |
20 | static Evas_Object *o_icons[NUM]; | 25 | static efl::eina::list<evas::image> icons; |
21 | static Evas_Object *o_texts[NUM]; | 26 | static efl::eina::list<evas::text> texts; |
22 | 27 | ||
23 | static const char *icons[] = | 28 | static const char *icons[] = // XXX |
24 | { | 29 | { |
25 | "bug.png", | 30 | "bug.png", |
26 | "bulb.png", | 31 | "bulb.png", |
@@ -112,10 +117,18 @@ static void _setup(void) | |||
112 | /* cleanup */ | 117 | /* cleanup */ |
113 | static void _cleanup(void) | 118 | static void _cleanup(void) |
114 | { | 119 | { |
115 | int i; | 120 | images.clear(); |
121 | icons.clear(); | ||
122 | texts.clear(); | ||
123 | } | ||
116 | 124 | ||
117 | extern "C" static void _key(char *key) | 125 | static void _key(char *key) |
118 | { | 126 | { |
119 | KEY_STD; | 127 | KEY_STD; |
120 | } | 128 | } |
121 | 129 | ||
130 | extern "C" void FNAME(void) | ||
131 | { | ||
132 | ui_func_set(_key, _loop); | ||
133 | _setup(); | ||
134 | } | ||
diff --git a/src/bin/cxx/widgets_list_4_grouped.cc b/src/bin/cxx/widgets_list_4_grouped.cc index 5483606..d09b6a1 100644 --- a/src/bin/cxx/widgets_list_4_grouped.cc +++ b/src/bin/cxx/widgets_list_4_grouped.cc | |||
@@ -79,9 +79,8 @@ static const char *labels[] = | |||
79 | /* setup */ | 79 | /* setup */ |
80 | static void _setup(void) | 80 | static void _setup(void) |
81 | { | 81 | { |
82 | int i; | ||
83 | evas::canvas canvas(::eo_ref(G_evas)); | 82 | evas::canvas canvas(::eo_ref(G_evas)); |
84 | for (i = 0; i < NUM; i++) | 83 | for (int i = 0; i < NUM; i++) |
85 | { | 84 | { |
86 | evas::image o(efl::eo::parent = canvas); | 85 | evas::image o(efl::eo::parent = canvas); |
87 | images.push_back(o); | 86 | images.push_back(o); |
@@ -125,16 +124,37 @@ static void _setup(void) | |||
125 | done = 0; | 124 | done = 0; |
126 | } | 125 | } |
127 | 126 | ||
128 | /* cleanup */ | 127 | static void _cleanup() |
129 | static void _cleanup(void) | 128 | { |
129 | images.clear(); | ||
130 | } | ||
131 | |||
132 | /* loop - do things */ | ||
133 | static void _loop(double t, int f) | ||
130 | { | 134 | { |
131 | int i; | 135 | int i; |
136 | Evas_Coord x, y, tw, th, cent; | ||
137 | x = 0; | ||
138 | y = 0 - f; | ||
132 | for (i = 0; i < NUM; i++) | 139 | for (i = 0; i < NUM; i++) |
133 | { | 140 | { |
134 | eo_del(images[i]); | 141 | eo_do(o_images[i], evas_obj_position_set(x, y)); |
142 | eo_do(o_icons[i], evas_obj_position_set(x + 4, y + 4)); | ||
143 | eo_do(o_texts[i], evas_obj_size_get(&tw, &th)); | ||
144 | cent = (ICON_SIZE - th) / 2; | ||
145 | eo_do(o_texts[i], evas_obj_position_set(x + 8 + ICON_SIZE + 8, y + cent)); | ||
146 | y += ICON_SIZE; | ||
147 | } | ||
148 | FPS_STD(NAME); | ||
149 | } | ||
135 | 150 | ||
136 | extern "C" static void _key(char *key) | 151 | static void _key(char *key) |
137 | { | 152 | { |
138 | KEY_STD; | 153 | KEY_STD; |
139 | } | 154 | } |
140 | 155 | ||
156 | extern "C" void FNAME(void) | ||
157 | { | ||
158 | ui_func_set(_key, _loop); | ||
159 | _setup(); | ||
160 | } | ||