diff options
author | Savio Sena <savio.sena@acm.org> | 2014-08-27 05:44:59 -0300 |
---|---|---|
committer | Savio Sena <savio.sena@acm.org> | 2014-08-27 05:44:59 -0300 |
commit | ef9f34edfd0429bdb76849eab59d0ad2aaa0ca51 (patch) | |
tree | 17a2fea3c7a52306708eb7d1036514a07a4124ba | |
parent | a35c3791add7e967c9f7860eaf04ada675d244f2 (diff) |
Added C++ image_blend_border_recolor.
-rw-r--r-- | src/bin/Makefile.am | 4 | ||||
-rw-r--r-- | src/bin/cxx/image_blend_border.cc | 2 | ||||
-rw-r--r-- | src/bin/cxx/image_blend_border_recolor.cc | 72 | ||||
-rw-r--r-- | src/bin/cxx/image_blend_border_recolor_cxx.c | 32 | ||||
-rw-r--r-- | src/bin/tests.h | 3 |
5 files changed, 110 insertions, 3 deletions
diff --git a/src/bin/Makefile.am b/src/bin/Makefile.am index edb9e2a..135d261 100644 --- a/src/bin/Makefile.am +++ b/src/bin/Makefile.am | |||
@@ -51,9 +51,11 @@ image_blend_smooth_solid_same_scaled.c \ | |||
51 | image_blend_border.c \ | 51 | image_blend_border.c \ |
52 | cxx/image_blend_border.cc \ | 52 | cxx/image_blend_border.cc \ |
53 | cxx/image_blend_border_cxx.c \ | 53 | cxx/image_blend_border_cxx.c \ |
54 | image_blend_border_recolor.c \ | ||
55 | cxx/image_blend_border_recolor.cc \ | ||
56 | cxx/image_blend_border_recolor_cxx.c \ | ||
54 | image_blend_solid_middle_border.c \ | 57 | image_blend_solid_middle_border.c \ |
55 | image_blend_solid_border.c \ | 58 | image_blend_solid_border.c \ |
56 | image_blend_border_recolor.c \ | ||
57 | image_map_rotate.c \ | 59 | image_map_rotate.c \ |
58 | image_map_solid_rotate.c \ | 60 | image_map_solid_rotate.c \ |
59 | image_map_nearest_rotate.c \ | 61 | image_map_nearest_rotate.c \ |
diff --git a/src/bin/cxx/image_blend_border.cc b/src/bin/cxx/image_blend_border.cc index 1be72c8..18d5dea 100644 --- a/src/bin/cxx/image_blend_border.cc +++ b/src/bin/cxx/image_blend_border.cc | |||
@@ -15,7 +15,7 @@ | |||
15 | #define EXPEDITE_CXX_TEST_IMPL | 15 | #define EXPEDITE_CXX_TEST_IMPL |
16 | #include "image_blend_border_cxx.c" | 16 | #include "image_blend_border_cxx.c" |
17 | 17 | ||
18 | efl::eina::list<evas::image> images; | 18 | static efl::eina::list<evas::image> images; |
19 | 19 | ||
20 | /* standard var */ | 20 | /* standard var */ |
21 | static int done = 0; | 21 | static int done = 0; |
diff --git a/src/bin/cxx/image_blend_border_recolor.cc b/src/bin/cxx/image_blend_border_recolor.cc new file mode 100644 index 0000000..94b0d16 --- /dev/null +++ b/src/bin/cxx/image_blend_border_recolor.cc | |||
@@ -0,0 +1,72 @@ | |||
1 | |||
2 | #ifdef HAVE_CONFIG_H | ||
3 | # include <config.h> | ||
4 | #endif | ||
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 "image_blend_border_recolor_cxx.c" | ||
17 | |||
18 | efl::eina::list<evas::image> images; | ||
19 | |||
20 | /* standard var */ | ||
21 | static int done = 0; | ||
22 | |||
23 | /* setup */ | ||
24 | static void _setup(void) | ||
25 | { | ||
26 | evas::canvas canvas(::eo_ref(G_evas)); | ||
27 | for (int i = 0; i < OBNUM; i++) | ||
28 | { | ||
29 | evas::image o(efl::eo::parent = canvas); | ||
30 | images.push_back(o); | ||
31 | o.file_set(::build_path("bar.png"), ""); | ||
32 | o.color_set(64, 64, 64, 255); | ||
33 | o.border_set(3, 3, 3, 3); | ||
34 | o.visibility_set(true); | ||
35 | } | ||
36 | done = 0; | ||
37 | } | ||
38 | |||
39 | /* cleanup */ | ||
40 | static void _cleanup(void) | ||
41 | { | ||
42 | images.clear(); | ||
43 | } | ||
44 | |||
45 | /* loop - do things */ | ||
46 | static void _loop(double t, int f) | ||
47 | { | ||
48 | int i = 0; | ||
49 | Evas_Coord x, y, w, h, w0, h0; | ||
50 | for (auto it = images.begin(), end = images.end(); it != end; it++, i++) | ||
51 | { | ||
52 | w0 = 80; | ||
53 | h0 = 80; | ||
54 | w = 5 + ((1.0 + cos((double)(f + (i * 10)) / (7.4 * SLOW) )) * w0 * 2); | ||
55 | h = 5 + ((1.0 + sin((double)(f + (i * 19)) / (12.6 * SLOW) )) * h0 * 2); | ||
56 | x = (win_w / 2) - (w / 2); | ||
57 | x += sin((double)(f + (i * 13)) / (36.7 * SLOW)) * (w0 / 2); | ||
58 | y = (win_h / 2) - (h / 2); | ||
59 | y += cos((double)(f + (i * 28)) / (43.8 * SLOW)) * (h0 / 2); | ||
60 | |||
61 | (*it).position_set(x, y); | ||
62 | (*it).evas::object::size_set(w, h); | ||
63 | (*it).fill_set(0, 0, w, h); | ||
64 | } | ||
65 | FPS_STD(NAME); | ||
66 | } | ||
67 | |||
68 | /* prepend special key handlers if interactive (before STD) */ | ||
69 | static void _key(char *key) | ||
70 | { | ||
71 | KEY_STD; | ||
72 | } | ||
diff --git a/src/bin/cxx/image_blend_border_recolor_cxx.c b/src/bin/cxx/image_blend_border_recolor_cxx.c new file mode 100644 index 0000000..b8685ba --- /dev/null +++ b/src/bin/cxx/image_blend_border_recolor_cxx.c | |||
@@ -0,0 +1,32 @@ | |||
1 | |||
2 | #ifdef __cplusplus | ||
3 | extern "C" { | ||
4 | #endif | ||
5 | |||
6 | #undef FNAME | ||
7 | #undef NAME | ||
8 | #undef ICON | ||
9 | |||
10 | /* metadata */ | ||
11 | #define FNAME image_blend_border_recolor_cxx_start | ||
12 | #define NAME "Image Blend Border Recolor (C++)" | ||
13 | #define ICON "blend.png" | ||
14 | |||
15 | #ifdef UI | ||
16 | _ui_menu_item_add(ICON, NAME, FNAME); | ||
17 | #endif | ||
18 | |||
19 | #ifdef PROTO | ||
20 | void FNAME(void); | ||
21 | #endif | ||
22 | |||
23 | #ifndef EXPEDITE_CXX_TEST_IMPL | ||
24 | #undef FNAME | ||
25 | #undef NAME | ||
26 | #undef ICON | ||
27 | #endif | ||
28 | |||
29 | #ifdef __cplusplus | ||
30 | } | ||
31 | #endif | ||
32 | |||
diff --git a/src/bin/tests.h b/src/bin/tests.h index bbc5929..338c0f2 100644 --- a/src/bin/tests.h +++ b/src/bin/tests.h | |||
@@ -5,6 +5,7 @@ extern "C" { | |||
5 | 5 | ||
6 | // C++ tests | 6 | // C++ tests |
7 | #include "cxx/image_blend_border_cxx.c" | 7 | #include "cxx/image_blend_border_cxx.c" |
8 | #include "cxx/image_blend_border_recolor_cxx.c" | ||
8 | 9 | ||
9 | // C tests | 10 | // C tests |
10 | /* #include "widgets_file_icons.c" */ | 11 | /* #include "widgets_file_icons.c" */ |
@@ -38,9 +39,9 @@ extern "C" { | |||
38 | /* #include "image_blend_smooth_same_scaled.c" */ | 39 | /* #include "image_blend_smooth_same_scaled.c" */ |
39 | /* #include "image_blend_smooth_solid_same_scaled.c" */ | 40 | /* #include "image_blend_smooth_solid_same_scaled.c" */ |
40 | #include "image_blend_border.c" | 41 | #include "image_blend_border.c" |
42 | #include "image_blend_border_recolor.c" | ||
41 | /* #include "image_blend_solid_middle_border.c" */ | 43 | /* #include "image_blend_solid_middle_border.c" */ |
42 | /* #include "image_blend_solid_border.c" */ | 44 | /* #include "image_blend_solid_border.c" */ |
43 | /* #include "image_blend_border_recolor.c" */ | ||
44 | /* #include "image_map_rotate.c" */ | 45 | /* #include "image_map_rotate.c" */ |
45 | /* #include "image_map_solid_rotate.c" */ | 46 | /* #include "image_map_solid_rotate.c" */ |
46 | /* #include "image_map_nearest_rotate.c" */ | 47 | /* #include "image_map_nearest_rotate.c" */ |