summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSavio Sena <savio.sena@acm.org>2014-08-27 05:44:59 -0300
committerSavio Sena <savio.sena@acm.org>2014-08-27 05:44:59 -0300
commitef9f34edfd0429bdb76849eab59d0ad2aaa0ca51 (patch)
tree17a2fea3c7a52306708eb7d1036514a07a4124ba
parenta35c3791add7e967c9f7860eaf04ada675d244f2 (diff)
Added C++ image_blend_border_recolor.
-rw-r--r--src/bin/Makefile.am4
-rw-r--r--src/bin/cxx/image_blend_border.cc2
-rw-r--r--src/bin/cxx/image_blend_border_recolor.cc72
-rw-r--r--src/bin/cxx/image_blend_border_recolor_cxx.c32
-rw-r--r--src/bin/tests.h3
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 \
51image_blend_border.c \ 51image_blend_border.c \
52cxx/image_blend_border.cc \ 52cxx/image_blend_border.cc \
53cxx/image_blend_border_cxx.c \ 53cxx/image_blend_border_cxx.c \
54image_blend_border_recolor.c \
55cxx/image_blend_border_recolor.cc \
56cxx/image_blend_border_recolor_cxx.c \
54image_blend_solid_middle_border.c \ 57image_blend_solid_middle_border.c \
55image_blend_solid_border.c \ 58image_blend_solid_border.c \
56image_blend_border_recolor.c \
57image_map_rotate.c \ 59image_map_rotate.c \
58image_map_solid_rotate.c \ 60image_map_solid_rotate.c \
59image_map_nearest_rotate.c \ 61image_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
18efl::eina::list<evas::image> images; 18static efl::eina::list<evas::image> images;
19 19
20/* standard var */ 20/* standard var */
21static int done = 0; 21static 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
18efl::eina::list<evas::image> images;
19
20/* standard var */
21static int done = 0;
22
23/* setup */
24static 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 */
40static void _cleanup(void)
41{
42 images.clear();
43}
44
45/* loop - do things */
46static 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) */
69static 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
3extern "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
20void 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" */