From 6b928ebec479254f86dc3fc50cedd8a3b6fefbe7 Mon Sep 17 00:00:00 2001 From: Savio Sena Date: Sun, 24 Aug 2014 08:21:57 -0300 Subject: [PATCH] Fixed cxx/image_blend_border test. --- src/bin/cxx/image_blend_border.cc | 29 +++++++++++----------------- src/bin/cxx/image_blend_border_cxx.c | 18 +++++++++++++---- 2 files changed, 25 insertions(+), 22 deletions(-) diff --git a/src/bin/cxx/image_blend_border.cc b/src/bin/cxx/image_blend_border.cc index cf4970c..86e7490 100644 --- a/src/bin/cxx/image_blend_border.cc +++ b/src/bin/cxx/image_blend_border.cc @@ -3,28 +3,19 @@ # include #endif -#undef FNAME -#undef NAME -#undef ICON - -/* metadata */ -#define FNAME image_blend_border_start_cxx -#define NAME "Image Blend Border (C++)" -#define ICON "blend.png" - #include "Eo.h" #include "Evas.h" -#include "main.hh" - #include "Eo.hh" #include "Eina.hh" #include "Evas.hh" -namespace _ctx { -evas::canvas evas; +#include "main.h" + +#define EXPEDITE_CXX_TEST_IMPL +#include "image_blend_border_cxx.h" + efl::eina::list images; -} /* standard var */ static int done = 0; @@ -34,10 +25,12 @@ static void _setup() { int i; Evas_Object *o; + evas::canvas canvas(G_evas); + for (i = 0; i < OBNUM; i++) { - evas::image o(efl::eo::parent = _ctx::evas); - _ctx::images.push_back(o); + evas::image o(efl::eo::parent = canvas); + images.push_back(o); o.file_set(::build_path("bar.png"), ""); // XXX o.border_set(6, 6, 6, 6); o.visibility_set(true); @@ -48,7 +41,7 @@ static void _setup() /* cleanup */ static void _cleanup() { - _ctx::images.clear(); + images.clear(); } /* loop - do things */ @@ -57,7 +50,7 @@ static void _loop(double t, int f) int i = 0; Evas_Coord x, y, w, h, w0, h0; - for (auto it = _ctx::images.begin(), end = _ctx::images.end(); it != end; it++, i++) + for (auto it = images.begin(), end = images.end(); it != end; it++, i++) { w0 = 80; h0 = 80; diff --git a/src/bin/cxx/image_blend_border_cxx.c b/src/bin/cxx/image_blend_border_cxx.c index 73bb9ec..48bed1d 100644 --- a/src/bin/cxx/image_blend_border_cxx.c +++ b/src/bin/cxx/image_blend_border_cxx.c @@ -1,6 +1,8 @@ +#ifndef IMAGE_BLEND_BORDER_CXX_HH +#define IMAGE_BLEND_BORDER_CXX_HH -#ifdef HAVE_CONFIG_H -# include +#ifdef __cplusplus +extern "C" { #endif #undef FNAME @@ -8,8 +10,8 @@ #undef ICON /* metadata */ -#define FNAME image_blend_border_start -#define NAME "Image Blend Border" +#define FNAME image_blend_border_cxx_start +#define NAME "Image Blend Border (C++)" #define ICON "blend.png" #ifdef UI @@ -20,6 +22,14 @@ _ui_menu_item_add(ICON, NAME, FNAME); void FNAME(void); #endif +#ifndef EXPEDITE_CXX_TEST_IMPL #undef FNAME #undef NAME #undef ICON +#endif + +#ifdef __cplusplus +} +#endif + +#endif // IMAGE_BLEND_BORDER_CXX_HH