summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSavio Sena <savio@expertisesolutions.com.br>2014-08-28 18:03:08 -0300
committerSavio Sena <savio@expertisesolutions.com.br>2014-08-28 18:03:08 -0300
commit3f32d142fcb3dc875c2f62c24690ddd8c88c5237 (patch)
tree05c4ef6513177b1614c0ab10a221b368b665d05b
parentbbb0568606a6206c54acd87698c5b3d6a96fb656 (diff)
Added more image/C++ tests.
-rw-r--r--src/bin/Makefile.am8
-rw-r--r--src/bin/cxx/image_blend_border.cc2
-rw-r--r--src/bin/cxx/image_blend_border_capi.h (renamed from src/bin/cxx/image_blend_border_cxx.c)0
-rw-r--r--src/bin/cxx/image_blend_border_recolor.cc4
-rw-r--r--src/bin/cxx/image_blend_border_recolor_capi.h (renamed from src/bin/cxx/image_blend_border_recolor_cxx.c)0
-rw-r--r--src/bin/cxx/image_blend_fade_pow2_unscaled.cc79
-rw-r--r--src/bin/cxx/image_blend_fade_pow2_unscaled_capi.h33
-rw-r--r--src/bin/cxx/image_blend_fade_unscaled.cc76
-rw-r--r--src/bin/cxx/image_blend_fade_unscaled_capi.h33
-rw-r--r--src/bin/tests.h6
10 files changed, 234 insertions, 7 deletions
diff --git a/src/bin/Makefile.am b/src/bin/Makefile.am
index 135d261..1ce1509 100644
--- a/src/bin/Makefile.am
+++ b/src/bin/Makefile.am
@@ -36,7 +36,11 @@ widgets_list_4_grouped.c \
36image_blend_unscaled.c \ 36image_blend_unscaled.c \
37image_blend_solid_middle_unscaled.c \ 37image_blend_solid_middle_unscaled.c \
38image_blend_fade_unscaled.c \ 38image_blend_fade_unscaled.c \
39cxx/image_blend_fade_unscaled.cc \
40cxx/image_blend_fade_unscaled_capi.h \
39image_blend_fade_pow2_unscaled.c \ 41image_blend_fade_pow2_unscaled.c \
42cxx/image_blend_fade_pow2_unscaled.cc \
43ocxx/image_blend_fade_pow2_unscaled_capi.h \
40image_blend_solid_unscaled.c \ 44image_blend_solid_unscaled.c \
41image_blend_solid_fade_unscaled.c \ 45image_blend_solid_fade_unscaled.c \
42image_blend_solid_fade_pow2_unscaled.c \ 46image_blend_solid_fade_pow2_unscaled.c \
@@ -50,10 +54,10 @@ image_blend_smooth_same_scaled.c \
50image_blend_smooth_solid_same_scaled.c \ 54image_blend_smooth_solid_same_scaled.c \
51image_blend_border.c \ 55image_blend_border.c \
52cxx/image_blend_border.cc \ 56cxx/image_blend_border.cc \
53cxx/image_blend_border_cxx.c \ 57cxx/image_blend_border_capi.h \
54image_blend_border_recolor.c \ 58image_blend_border_recolor.c \
55cxx/image_blend_border_recolor.cc \ 59cxx/image_blend_border_recolor.cc \
56cxx/image_blend_border_recolor_cxx.c \ 60cxx/image_blend_border_recolor_capi.h \
57image_blend_solid_middle_border.c \ 61image_blend_solid_middle_border.c \
58image_blend_solid_border.c \ 62image_blend_solid_border.c \
59image_map_rotate.c \ 63image_map_rotate.c \
diff --git a/src/bin/cxx/image_blend_border.cc b/src/bin/cxx/image_blend_border.cc
index 18d5dea..4fdfeee 100644
--- a/src/bin/cxx/image_blend_border.cc
+++ b/src/bin/cxx/image_blend_border.cc
@@ -13,7 +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_border_cxx.c" 16#include "image_blend_border_capi.h"
17 17
18static efl::eina::list<evas::image> images; 18static efl::eina::list<evas::image> images;
19 19
diff --git a/src/bin/cxx/image_blend_border_cxx.c b/src/bin/cxx/image_blend_border_capi.h
index 1e3258a..1e3258a 100644
--- a/src/bin/cxx/image_blend_border_cxx.c
+++ b/src/bin/cxx/image_blend_border_capi.h
diff --git a/src/bin/cxx/image_blend_border_recolor.cc b/src/bin/cxx/image_blend_border_recolor.cc
index 4841b65..049fa95 100644
--- a/src/bin/cxx/image_blend_border_recolor.cc
+++ b/src/bin/cxx/image_blend_border_recolor.cc
@@ -13,7 +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_border_recolor_cxx.c" 16#include "image_blend_border_recolor_capi.h"
17 17
18efl::eina::list<evas::image> images; 18efl::eina::list<evas::image> images;
19 19
@@ -28,7 +28,7 @@ static void _setup(void)
28 { 28 {
29 evas::image o(efl::eo::parent = canvas); 29 evas::image o(efl::eo::parent = canvas);
30 images.push_back(o); 30 images.push_back(o);
31 o.file_set(::build_path("bar.png"), ""); 31 o.file_set(::build_path("pan.png"), "");
32 o.color_set(64, 64, 64, 255); 32 o.color_set(64, 64, 64, 255);
33 o.border_set(3, 3, 3, 3); 33 o.border_set(3, 3, 3, 3);
34 o.visibility_set(true); 34 o.visibility_set(true);
diff --git a/src/bin/cxx/image_blend_border_recolor_cxx.c b/src/bin/cxx/image_blend_border_recolor_capi.h
index b8685ba..b8685ba 100644
--- a/src/bin/cxx/image_blend_border_recolor_cxx.c
+++ b/src/bin/cxx/image_blend_border_recolor_capi.h
diff --git a/src/bin/cxx/image_blend_fade_pow2_unscaled.cc b/src/bin/cxx/image_blend_fade_pow2_unscaled.cc
new file mode 100644
index 0000000..d194b41
--- /dev/null
+++ b/src/bin/cxx/image_blend_fade_pow2_unscaled.cc
@@ -0,0 +1,79 @@
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_fade_pow2_unscaled_capi.h"
17
18static efl::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
32 o.file_set(::build_path("logo.png"), "");
33 o.fill_set(0, 0, 120, 160);
34 o.evas::object::size_set(120, 160);
35
36 int a = 256 - (1 << ((rnd() % 8) + 1));
37 if (a < 128) a = 128;
38
39 o.color_set(a, a, a, a);
40 o.visibility_set(true);
41 }
42 done = 0;
43}
44
45/* cleanup */
46static void _cleanup(void)
47{
48 images.clear();
49}
50
51/* loop - do things */
52static void _loop(double t, int f)
53{
54 int i = 0;
55 Evas_Coord x, y, w, h;
56 for (auto it = images.begin(), end = images.end(); it != end; it++, i++)
57 {
58 w = 120;
59 h = 160;
60 x = (win_w / 2) - (w / 2);
61 x += sin((double)(f + (i * 13)) / (36.7 * SLOW)) * (w / 2);
62 y = (win_h / 2) - (h / 2);
63 y += cos((double)(f + (i * 28)) / (43.8 * SLOW)) * (h / 2);
64 (*it).position_set(x, y);
65 }
66 FPS_STD(NAME);
67}
68
69/* prepend special key handlers if interactive (before STD) */
70static void _key(char *key)
71{
72 KEY_STD;
73}
74
75extern "C" void FNAME(void)
76{
77 ui_func_set(_key, _loop);
78 _setup();
79}
diff --git a/src/bin/cxx/image_blend_fade_pow2_unscaled_capi.h b/src/bin/cxx/image_blend_fade_pow2_unscaled_capi.h
new file mode 100644
index 0000000..38b8657
--- /dev/null
+++ b/src/bin/cxx/image_blend_fade_pow2_unscaled_capi.h
@@ -0,0 +1,33 @@
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_fade_pow2_unscaled_cxx_start
12#define NAME "Image Blend Fade Power 2 Unscaled (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
33
diff --git a/src/bin/cxx/image_blend_fade_unscaled.cc b/src/bin/cxx/image_blend_fade_unscaled.cc
new file mode 100644
index 0000000..93564b8
--- /dev/null
+++ b/src/bin/cxx/image_blend_fade_unscaled.cc
@@ -0,0 +1,76 @@
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_fade_unscaled_capi.h"
17
18/* standard var */
19static int done = 0;
20/* private data */
21static efl::eina::list<evas::image> images;
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("logo.png"), "");
32 o.fill_set(0, 0, 120, 160);
33 o.evas::object::size_set(120, 160);
34
35 int a = rnd()&0xff;
36 o.color_set(a, a, a, a);
37 o.visibility_set(true);
38 }
39 done = 0;
40}
41
42/* cleanup */
43static void _cleanup(void)
44{
45 images.clear();
46}
47
48/* loop - do things */
49static void _loop(double t, int f)
50{
51 int i = 0;
52 Evas_Coord x, y, w, h;
53 for (auto it = images.begin(), end = images.end(); it != end; it++, i++)
54 {
55 w = 120;
56 h = 160;
57 x = (win_w / 2) - (w / 2);
58 x += sin((double)(f + (i * 13)) / (36.7 * SLOW)) * (w / 2);
59 y = (win_h / 2) - (h / 2);
60 y += cos((double)(f + (i * 28)) / (43.8 * SLOW)) * (h / 2);
61 (*it).position_set(x, y);
62 }
63 FPS_STD(NAME);
64}
65
66/* prepend special key handlers if interactive (before STD) */
67static void _key(char *key)
68{
69 KEY_STD;
70}
71
72extern "C" void FNAME(void)
73{
74 ui_func_set(_key, _loop);
75 _setup();
76}
diff --git a/src/bin/cxx/image_blend_fade_unscaled_capi.h b/src/bin/cxx/image_blend_fade_unscaled_capi.h
new file mode 100644
index 0000000..3afcb1a
--- /dev/null
+++ b/src/bin/cxx/image_blend_fade_unscaled_capi.h
@@ -0,0 +1,33 @@
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_fade_unscaled_cxx_start
12#define NAME "Image Blend Fade Unscaled (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
33
diff --git a/src/bin/tests.h b/src/bin/tests.h
index 338c0f2..936bf46 100644
--- a/src/bin/tests.h
+++ b/src/bin/tests.h
@@ -4,8 +4,10 @@ extern "C" {
4#endif 4#endif
5 5
6// C++ tests 6// C++ tests
7#include "cxx/image_blend_border_cxx.c" 7#include "cxx/image_blend_fade_unscaled_capi.h"
8#include "cxx/image_blend_border_recolor_cxx.c" 8#include "cxx/image_blend_fade_pow2_unscaled_capi.h"
9#include "cxx/image_blend_border_capi.h"
10#include "cxx/image_blend_border_recolor_capi.h"
9 11
10// C tests 12// C tests
11/* #include "widgets_file_icons.c" */ 13/* #include "widgets_file_icons.c" */