Fixed cxx/image_blend_border test.

This commit is contained in:
Savio Sena 2014-08-24 08:21:57 -03:00
parent 155888f2c5
commit 6b928ebec4
2 changed files with 25 additions and 22 deletions

View File

@ -3,28 +3,19 @@
# include <config.h> # include <config.h>
#endif #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 "Eo.h"
#include "Evas.h" #include "Evas.h"
#include "main.hh"
#include "Eo.hh" #include "Eo.hh"
#include "Eina.hh" #include "Eina.hh"
#include "Evas.hh" #include "Evas.hh"
namespace _ctx { #include "main.h"
evas::canvas evas;
#define EXPEDITE_CXX_TEST_IMPL
#include "image_blend_border_cxx.h"
efl::eina::list<evas::image> images; efl::eina::list<evas::image> images;
}
/* standard var */ /* standard var */
static int done = 0; static int done = 0;
@ -34,10 +25,12 @@ static void _setup()
{ {
int i; int i;
Evas_Object *o; Evas_Object *o;
evas::canvas canvas(G_evas);
for (i = 0; i < OBNUM; i++) for (i = 0; i < OBNUM; i++)
{ {
evas::image o(efl::eo::parent = _ctx::evas); evas::image o(efl::eo::parent = canvas);
_ctx::images.push_back(o); images.push_back(o);
o.file_set(::build_path("bar.png"), ""); // XXX o.file_set(::build_path("bar.png"), ""); // XXX
o.border_set(6, 6, 6, 6); o.border_set(6, 6, 6, 6);
o.visibility_set(true); o.visibility_set(true);
@ -48,7 +41,7 @@ static void _setup()
/* cleanup */ /* cleanup */
static void _cleanup() static void _cleanup()
{ {
_ctx::images.clear(); images.clear();
} }
/* loop - do things */ /* loop - do things */
@ -57,7 +50,7 @@ static void _loop(double t, int f)
int i = 0; int i = 0;
Evas_Coord x, y, w, h, w0, h0; 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; w0 = 80;
h0 = 80; h0 = 80;

View File

@ -1,6 +1,8 @@
#ifndef IMAGE_BLEND_BORDER_CXX_HH
#define IMAGE_BLEND_BORDER_CXX_HH
#ifdef HAVE_CONFIG_H #ifdef __cplusplus
# include <config.h> extern "C" {
#endif #endif
#undef FNAME #undef FNAME
@ -8,8 +10,8 @@
#undef ICON #undef ICON
/* metadata */ /* metadata */
#define FNAME image_blend_border_start #define FNAME image_blend_border_cxx_start
#define NAME "Image Blend Border" #define NAME "Image Blend Border (C++)"
#define ICON "blend.png" #define ICON "blend.png"
#ifdef UI #ifdef UI
@ -20,6 +22,14 @@ _ui_menu_item_add(ICON, NAME, FNAME);
void FNAME(void); void FNAME(void);
#endif #endif
#ifndef EXPEDITE_CXX_TEST_IMPL
#undef FNAME #undef FNAME
#undef NAME #undef NAME
#undef ICON #undef ICON
#endif
#ifdef __cplusplus
}
#endif
#endif // IMAGE_BLEND_BORDER_CXX_HH