expedite-cxx: Added remaining tests.

This commit is contained in:
Savio S. Machado 2014-10-13 12:27:58 -03:00
parent 2360632b37
commit 3434b132b8
34 changed files with 410 additions and 506 deletions

View File

@ -30,7 +30,7 @@ static void _setup(void)
images.push_back(o); images.push_back(o);
eo_do(o._eo_ptr(), efl_file_set(build_path("image.png"), NULL)); // XXX eo_do(o._eo_ptr(), efl_file_set(build_path("image.png"), NULL)); // XXX
o.smooth_scale_set(0); o.smooth_scale_set(0);
o.visibility_set(EINA_TRUE); o.visibility_set(true);
} }
done = 0; done = 0;
} }
@ -38,8 +38,8 @@ static void _setup(void)
/* cleanup */ /* cleanup */
static void _cleanup() static void _cleanup()
{ {
for (evas::image& i : images) for (evas::image& img : images)
i.parent_set(efl::eo::base(nullptr)); img.parent_set(efl::eo::base(nullptr));
images.clear(); images.clear();
} }

View File

@ -37,9 +37,9 @@ static void _setup(void)
o.fill_set(0, 0, 640, 480); o.fill_set(0, 0, 640, 480);
o.evas::object::size_set(640, 480); o.evas::object::size_set(640, 480);
o.visibility_set(true); o.visibility_set(true);
yp = static_cast<unsigned char*>(malloc(640 * 480)); yp = new unsigned char[640 * 480];
up = static_cast<unsigned char*>(malloc(320 * 240)); up = new unsigned char[320 * 240];
vp = static_cast<unsigned char*>(malloc(320 * 240)); vp = new unsigned char[320 * 240];
FILE *f = fopen(build_path("tp.yuv"), "rb"); FILE *f = fopen(build_path("tp.yuv"), "rb");
if (f) if (f)
{ {
@ -76,9 +76,10 @@ static void _cleanup(void)
for (evas::image& i : images) for (evas::image& i : images)
i.parent_set(efl::eo::base(nullptr)); i.parent_set(efl::eo::base(nullptr));
images.clear(); images.clear();
free(yp);
free(up); delete yp;
free(vp); delete up;
delete vp;
} }
/* loop - do things */ /* loop - do things */

View File

@ -38,9 +38,9 @@ static void _setup(void)
o.evas::object::size_set(640, 480); o.evas::object::size_set(640, 480);
o.smooth_scale_set(0); o.smooth_scale_set(0);
o.visibility_set(true); o.visibility_set(true);
yp = static_cast<unsigned char*>(malloc(640 * 480)); yp = new unsigned char[640 * 480];
up = static_cast<unsigned char*>(malloc(320 * 240)); up = new unsigned char[320 * 240];
vp = static_cast<unsigned char*>(malloc(320 * 240)); vp = new unsigned char[320 * 240];
FILE *f = fopen(build_path("tp.yuv"), "rb"); FILE *f = fopen(build_path("tp.yuv"), "rb");
if (f) if (f)
{ {
@ -77,9 +77,10 @@ static void _cleanup(void)
for (evas::image& i : images) for (evas::image& i : images)
i.parent_set(efl::eo::base(nullptr)); i.parent_set(efl::eo::base(nullptr));
images.clear(); images.clear();
free(yp);
free(up); delete yp;
free(vp); delete up;
delete vp;
} }
/* loop - do things */ /* loop - do things */

View File

@ -37,9 +37,9 @@ static void _setup(void)
o.fill_set(0, 0, 640, 480); o.fill_set(0, 0, 640, 480);
o.evas::object::size_set(640, 480); o.evas::object::size_set(640, 480);
o.evas::object::visibility_set(true); o.evas::object::visibility_set(true);
yp = static_cast<unsigned char*>(malloc(640 * 480)); yp = new unsigned char[640 * 480];
up = static_cast<unsigned char*>(malloc(320 * 240)); up = new unsigned char[320 * 240];
vp = static_cast<unsigned char*>(malloc(320 * 240)); vp = new unsigned char[320 * 240];
FILE *f = fopen(build_path("tp.yuv"), "rb"); FILE *f = fopen(build_path("tp.yuv"), "rb");
if (f) if (f)
{ {
@ -76,9 +76,10 @@ static void _cleanup(void)
for (evas::image& i : images) for (evas::image& i : images)
i.parent_set(efl::eo::base(nullptr)); i.parent_set(efl::eo::base(nullptr));
images.clear(); images.clear();
free(yp);
free(up); delete yp;
free(vp); delete up;
delete vp;
} }
/* loop - do things */ /* loop - do things */

View File

@ -37,9 +37,9 @@ static void _setup(void)
o.fill_set(0, 0, 640, 480); o.fill_set(0, 0, 640, 480);
o.evas::object::size_set(640, 480); o.evas::object::size_set(640, 480);
o.evas::object::visibility_set(true); o.evas::object::visibility_set(true);
yp = static_cast<unsigned char*>(malloc(640 * 480)); yp = new unsigned char[640 * 480];
up = static_cast<unsigned char*>(malloc(320 * 240)); up = new unsigned char[320 * 240];
vp = static_cast<unsigned char*>(malloc(320 * 240)); vp = new unsigned char[320 * 240];
FILE *f = fopen(build_path("tp.yuv"), "rb"); FILE *f = fopen(build_path("tp.yuv"), "rb");
if (f) if (f)
{ {
@ -80,9 +80,10 @@ static void _cleanup(void)
for (evas::image& i : images) for (evas::image& i : images)
i.parent_set(efl::eo::base(nullptr)); i.parent_set(efl::eo::base(nullptr));
images.clear(); images.clear();
free(yp);
free(up); delete yp;
free(vp); delete up;
delete vp;
} }
/* loop - do things */ /* loop - do things */

View File

@ -22,7 +22,7 @@ typedef struct _Point
typedef struct _Side typedef struct _Side
{ {
evas::image o; evas::image *o;
Point pt[4]; Point pt[4];
} Side; } Side;
@ -48,22 +48,20 @@ static Cube *
_cube_new(Evas_Coord w, Evas_Coord h, Evas_Coord d) _cube_new(Evas_Coord w, Evas_Coord h, Evas_Coord d)
{ {
evas::canvas canvas(::eo_ref(G_evas)); evas::canvas canvas(::eo_ref(G_evas));
Cube *c;
w -= (w / 2); w -= (w / 2);
h -= (h / 2); h -= (h / 2);
d -= (d / 2); d -= (d / 2);
c = static_cast<Cube*>(calloc(1, sizeof(Cube))); Cube *c = new Cube {};
for (int i = 0; i < 6; i++) for (int i = 0; i < 6; i++)
{ {
char buf[256]; char buf[256];
c->side[i].o = evas::image(efl::eo::parent = canvas); c->side[i].o = new evas::image(efl::eo::parent = canvas);
snprintf(buf, sizeof(buf), "cube%i.png", i + 1); snprintf(buf, sizeof(buf), "cube%i.png", i + 1);
eo_do(c->side[i].o._eo_ptr(), efl_file_set(build_path(buf), NULL)); // XXX eo_do(c->side[i].o->_eo_ptr(), efl_file_set(build_path(buf), NULL)); // XXX
c->side[i].o.fill_set(0, 0, 256, 256); c->side[i].o->fill_set(0, 0, 256, 256);
c->side[i].o.evas::object::size_set(256, 256); c->side[i].o->evas::object::size_set(256, 256);
c->side[i].o.smooth_scale_set(0); c->side[i].o->smooth_scale_set(0);
c->side[i].o.visibility_set(true); c->side[i].o->visibility_set(true);
} }
POINT(0, 0, -w, -h, -d, 0, 0); POINT(0, 0, -w, -h, -d, 0, 0);
POINT(0, 1, w, -h, -d, 256, 0); POINT(0, 1, w, -h, -d, 256, 0);
@ -107,8 +105,8 @@ _cube_pos(Cube *c,
int i, j, order[6], sorted; int i, j, order[6], sorted;
Evas_Coord mz[6]; Evas_Coord mz[6];
if (!m) m = evas_map_new(4); if (!m) m = ::evas_map_new(4);
evas_map_smooth_set(m, 0); ::evas_map_smooth_set(m, 0);
for (i = 0; i < 6; i++) for (i = 0; i < 6; i++)
{ {
@ -116,34 +114,34 @@ _cube_pos(Cube *c,
for (j = 0; j < 4; j++) for (j = 0; j < 4; j++)
{ {
evas_map_point_coord_set(m, j, ::evas_map_point_coord_set(m, j,
c->side[i].pt[j].x + x, c->side[i].pt[j].x + x,
c->side[i].pt[j].y + y, c->side[i].pt[j].y + y,
c->side[i].pt[j].z + z); c->side[i].pt[j].z + z);
evas_map_point_image_uv_set(m, j, ::evas_map_point_image_uv_set(m, j,
c->side[i].pt[j].u, c->side[i].pt[j].u,
c->side[i].pt[j].v); c->side[i].pt[j].v);
evas_map_point_color_set(m, j, 255, 255, 255, 255); ::evas_map_point_color_set(m, j, 255, 255, 255, 255);
} }
evas_map_util_3d_rotate(m, dx, dy, dz, x, y, z); ::evas_map_util_3d_rotate(m, dx, dy, dz, x, y, z);
evas_map_util_3d_lighting(m, -1000, -1000, -1000, ::evas_map_util_3d_lighting(m, -1000, -1000, -1000,
255, 255, 255, 255, 255, 255,
20, 20, 20); 20, 20, 20);
evas_map_util_3d_perspective(m, (win_w / 2), (win_h / 2), 0, 512); ::evas_map_util_3d_perspective(m, (win_w / 2), (win_h / 2), 0, 512);
if (evas_map_util_clockwise_get(m)) if (evas_map_util_clockwise_get(m))
{ {
c->side[i].o.map_enable_set(1); c->side[i].o->map_enable_set(1);
c->side[i].o.map_set(m); c->side[i].o->map_set(m);
c->side[i].o.visibility_set(true); c->side[i].o->visibility_set(true);
} }
else else
{ {
c->side[i].o.visibility_set(false); c->side[i].o->visibility_set(false);
} }
order[i] = i; order[i] = i;
for (j = 0; j < 4; j++) for (j = 0; j < 4; j++)
evas_map_point_coord_get(m, j, NULL, NULL, &(tz[j])); ::evas_map_point_coord_get(m, j, NULL, NULL, &(tz[j]));
mz[i] = (tz[0] + tz[1] + tz[2] + tz[3]) / 4; mz[i] = (tz[0] + tz[1] + tz[2] + tz[3]) / 4;
} }
sorted = 0; sorted = 0;
@ -163,9 +161,9 @@ _cube_pos(Cube *c,
} }
while (!sorted); while (!sorted);
c->side[order[0]].o.evas::object::raise(); c->side[order[0]].o->evas::object::raise();
for (i = 1; i < 6; i++) for (i = 1; i < 6; i++)
c->side[order[i]].o.evas::object::stack_below(c->side[order[i - 1]].o); c->side[order[i]].o->evas::object::stack_below(*c->side[order[i - 1]].o);
} }
static void static void
@ -173,11 +171,11 @@ _cube_free(Cube *c)
{ {
for (int i = 0; i < 6; i++) for (int i = 0; i < 6; i++)
{ {
c->side[i].o.visibility_set(false); // XXX c->side[i].o->visibility_set(false); // XXX
c->side[i].o.parent_set(efl::eo::base(nullptr)); c->side[i].o->parent_set(efl::eo::base(nullptr));
::eo_unref(c->side[i].o._release()); delete c->side[i].o;
} }
free(c); delete c;
} }
/* setup */ /* setup */

View File

@ -22,7 +22,7 @@ typedef struct _Point
typedef struct _Side typedef struct _Side
{ {
evas::image o; evas::image *o;
Point pt[4]; Point pt[4];
} Side; } Side;
@ -48,20 +48,19 @@ static Cube *
_cube_new(Evas_Coord w, Evas_Coord h, Evas_Coord d) _cube_new(Evas_Coord w, Evas_Coord h, Evas_Coord d)
{ {
evas::canvas canvas(::eo_ref(G_evas)); evas::canvas canvas(::eo_ref(G_evas));
Cube *c;
w -= (w / 2); w -= (w / 2);
h -= (h / 2); h -= (h / 2);
d -= (d / 2); d -= (d / 2);
c = static_cast<Cube*>(calloc(1, sizeof(Cube))); Cube *c = new Cube {};
for (int i = 0; i < 6; i++) for (int i = 0; i < 6; i++)
{ {
char buf[256]; char buf[256];
c->side[i].o = evas::image(efl::eo::parent = canvas); c->side[i].o = new evas::image(efl::eo::parent = canvas);
snprintf(buf, sizeof(buf), "cube%i.png", i + 1); snprintf(buf, sizeof(buf), "cube%i.png", i + 1);
eo_do(c->side[i].o._eo_ptr(), efl_file_set(build_path(buf), NULL)); // XXX eo_do(c->side[i].o->_eo_ptr(), efl_file_set(build_path(buf), NULL)); // XXX
c->side[i].o.fill_set(0, 0, 256, 256); c->side[i].o->fill_set(0, 0, 256, 256);
c->side[i].o.evas::object::size_set(256, 256); c->side[i].o->evas::object::size_set(256, 256);
c->side[i].o.visibility_set(true); c->side[i].o->evas::object::visibility_set(true);
} }
POINT(0, 0, -w, -h, -d, 0, 0); POINT(0, 0, -w, -h, -d, 0, 0);
POINT(0, 1, w, -h, -d, 256, 0); POINT(0, 1, w, -h, -d, 256, 0);
@ -113,34 +112,34 @@ _cube_pos(Cube *c,
for (j = 0; j < 4; j++) for (j = 0; j < 4; j++)
{ {
evas_map_point_coord_set(m, j, ::evas_map_point_coord_set(m, j,
c->side[i].pt[j].x + x, c->side[i].pt[j].x + x,
c->side[i].pt[j].y + y, c->side[i].pt[j].y + y,
c->side[i].pt[j].z + z); c->side[i].pt[j].z + z);
evas_map_point_image_uv_set(m, j, ::evas_map_point_image_uv_set(m, j,
c->side[i].pt[j].u, c->side[i].pt[j].u,
c->side[i].pt[j].v); c->side[i].pt[j].v);
evas_map_point_color_set(m, j, 255, 255, 255, 255); ::evas_map_point_color_set(m, j, 255, 255, 255, 255);
} }
evas_map_util_3d_rotate(m, dx, dy, dz, x, y, z); ::evas_map_util_3d_rotate(m, dx, dy, dz, x, y, z);
evas_map_util_3d_lighting(m, -1000, -1000, -1000, ::evas_map_util_3d_lighting(m, -1000, -1000, -1000,
255, 255, 255, 255, 255, 255,
20, 20, 20); 20, 20, 20);
evas_map_util_3d_perspective(m, (win_w / 2), (win_h / 2), 0, 512); ::evas_map_util_3d_perspective(m, (win_w / 2), (win_h / 2), 0, 512);
if (evas_map_util_clockwise_get(m)) if (::evas_map_util_clockwise_get(m))
{ {
c->side[i].o.map_enable_set(1); c->side[i].o->map_enable_set(1);
c->side[i].o.map_set(m); c->side[i].o->map_set(m);
c->side[i].o.visibility_set(true); c->side[i].o->visibility_set(true);
} }
else else
{ {
c->side[i].o.visibility_set(false); c->side[i].o->visibility_set(false);
} }
order[i] = i; order[i] = i;
for (j = 0; j < 4; j++) for (j = 0; j < 4; j++)
evas_map_point_coord_get(m, j, NULL, NULL, &(tz[j])); ::evas_map_point_coord_get(m, j, NULL, NULL, &(tz[j]));
mz[i] = (tz[0] + tz[1] + tz[2] + tz[3]) / 4; mz[i] = (tz[0] + tz[1] + tz[2] + tz[3]) / 4;
} }
sorted = 0; sorted = 0;
@ -160,9 +159,9 @@ _cube_pos(Cube *c,
} }
while (!sorted); while (!sorted);
c->side[order[0]].o.raise(); c->side[order[0]].o->raise();
for (i = 1; i < 6; i++) for (i = 1; i < 6; i++)
c->side[order[i]].o.stack_below(c->side[order[i - 1]].o); c->side[order[i]].o->stack_below(*c->side[order[i - 1]].o);
} }
static void static void
@ -170,11 +169,11 @@ _cube_free(Cube *c)
{ {
for (int i = 0; i < 6; i++) for (int i = 0; i < 6; i++)
{ {
c->side[i].o.visibility_set(false); // XXX c->side[i].o->visibility_set(false); // XXX
c->side[i].o.parent_set(efl::eo::base(nullptr)); c->side[i].o->parent_set(efl::eo::base(nullptr));
::eo_unref(c->side[i].o._release()); delete c->side[i].o;
} }
free(c); delete c;
} }
/* setup */ /* setup */

View File

@ -22,7 +22,7 @@ typedef struct _Point
typedef struct _Side typedef struct _Side
{ {
evas::image o; evas::image *o;
Point pt[4]; Point pt[4];
} Side; } Side;
@ -53,17 +53,17 @@ _cube_new(Evas_Coord w, Evas_Coord h, Evas_Coord d)
w -= (w / 2); w -= (w / 2);
h -= (h / 2); h -= (h / 2);
d -= (d / 2); d -= (d / 2);
c = static_cast<Cube*>(calloc(1, sizeof(Cube))); c = new Cube {};
for (int i = 0; i < 6; i++) for (int i = 0; i < 6; i++)
{ {
char buf[256]; char buf[256];
c->side[i].o = evas::image(efl::eo::parent = canvas); c->side[i].o = new evas::image(efl::eo::parent = canvas);
snprintf(buf, sizeof(buf), "cube%i.png", i + 1); snprintf(buf, sizeof(buf), "cube%i.png", i + 1);
eo_do(c->side[i].o._eo_ptr(), efl_file_set(build_path(buf), NULL)); // XXX eo_do(c->side[i].o->_eo_ptr(), efl_file_set(build_path(buf), NULL)); // XXX
c->side[i].o.fill_set(0, 0, 256, 256); c->side[i].o->fill_set(0, 0, 256, 256);
c->side[i].o.evas::object::size_set(256, 256); c->side[i].o->evas::object::size_set(256, 256);
c->side[i].o.smooth_scale_set(0); c->side[i].o->smooth_scale_set(0);
c->side[i].o.visibility_set(true); c->side[i].o->visibility_set(true);
} }
POINT(0, 0, -w, -h, -d, 0, 0); POINT(0, 0, -w, -h, -d, 0, 0);
POINT(0, 1, w, -h, -d, 256, 0); POINT(0, 1, w, -h, -d, 256, 0);
@ -108,7 +108,7 @@ _cube_pos(Cube *c,
Evas_Coord mz[6]; Evas_Coord mz[6];
if (!m) m = evas_map_new(4); if (!m) m = evas_map_new(4);
evas_map_smooth_set(m, 0); ::evas_map_smooth_set(m, 0);
for (i = 0; i < 6; i++) for (i = 0; i < 6; i++)
{ {
@ -116,26 +116,26 @@ _cube_pos(Cube *c,
for (j = 0; j < 4; j++) for (j = 0; j < 4; j++)
{ {
evas_map_point_coord_set(m, j, ::evas_map_point_coord_set(m, j,
c->side[i].pt[j].x + x, c->side[i].pt[j].x + x,
c->side[i].pt[j].y + y, c->side[i].pt[j].y + y,
c->side[i].pt[j].z + z); c->side[i].pt[j].z + z);
evas_map_point_image_uv_set(m, j, ::evas_map_point_image_uv_set(m, j,
c->side[i].pt[j].u, c->side[i].pt[j].u,
c->side[i].pt[j].v); c->side[i].pt[j].v);
evas_map_point_color_set(m, j, 255, 255, 255, 128); ::evas_map_point_color_set(m, j, 255, 255, 255, 128);
} }
evas_map_util_3d_rotate(m, dx, dy, dz, x, y, z); ::evas_map_util_3d_rotate(m, dx, dy, dz, x, y, z);
evas_map_util_3d_lighting(m, -1000, -1000, -1000, ::evas_map_util_3d_lighting(m, -1000, -1000, -1000,
255, 255, 255, 255, 255, 255,
20, 20, 20); 20, 20, 20);
evas_map_util_3d_perspective(m, (win_w / 2), (win_h / 2), 0, 512); ::evas_map_util_3d_perspective(m, (win_w / 2), (win_h / 2), 0, 512);
c->side[i].o.map_enable_set(1); c->side[i].o->map_enable_set(1);
c->side[i].o.map_set(m); c->side[i].o->map_set(m);
order[i] = i; order[i] = i;
for (j = 0; j < 4; j++) for (j = 0; j < 4; j++)
evas_map_point_coord_get(m, j, NULL, NULL, &(tz[j])); ::evas_map_point_coord_get(m, j, NULL, NULL, &(tz[j]));
mz[i] = (tz[0] + tz[1] + tz[2] + tz[3]) / 4; mz[i] = (tz[0] + tz[1] + tz[2] + tz[3]) / 4;
} }
sorted = 0; sorted = 0;
@ -155,9 +155,9 @@ _cube_pos(Cube *c,
} }
while (!sorted); while (!sorted);
c->side[order[0]].o.raise(); c->side[order[0]].o->raise();
for (i = 1; i < 6; i++) for (i = 1; i < 6; i++)
c->side[order[i]].o.stack_below(c->side[order[i - 1]].o); c->side[order[i]].o->stack_below(*c->side[order[i - 1]].o);
} }
static void static void
@ -165,11 +165,11 @@ _cube_free(Cube *c)
{ {
for (int i = 0; i < 6; i++) for (int i = 0; i < 6; i++)
{ {
c->side[i].o.visibility_set(false); // XXX c->side[i].o->visibility_set(false); // XXX
c->side[i].o.parent_set(efl::eo::base(nullptr)); c->side[i].o->parent_set(efl::eo::base(nullptr));
::eo_unref(c->side[i].o._release()); delete c->side[i].o;
} }
free(c); delete c;
} }
/* setup */ /* setup */

View File

@ -21,7 +21,7 @@ typedef struct _Point
typedef struct _Side typedef struct _Side
{ {
evas::image o; evas::image *o;
Point pt[4]; Point pt[4];
} Side; } Side;
@ -47,21 +47,19 @@ static Cube *
_cube_new(Evas_Coord w, Evas_Coord h, Evas_Coord d) _cube_new(Evas_Coord w, Evas_Coord h, Evas_Coord d)
{ {
evas::canvas canvas(::eo_ref(G_evas)); evas::canvas canvas(::eo_ref(G_evas));
Cube *c;
w -= (w / 2); w -= (w / 2);
h -= (h / 2); h -= (h / 2);
d -= (d / 2); d -= (d / 2);
c = static_cast<Cube*>(calloc(1, sizeof(Cube))); Cube *c = new Cube {};
for (int i = 0; i < 6; i++) for (int i = 0; i < 6; i++)
{ {
char buf[256]; char buf[256];
c->side[i].o = evas::image(efl::eo::parent = canvas); c->side[i].o = new evas::image(efl::eo::parent = canvas);
snprintf(buf, sizeof(buf), "cube%i.png", i + 1); snprintf(buf, sizeof(buf), "cube%i.png", i + 1);
eo_do(c->side[i].o._eo_ptr(), efl_file_set(build_path(buf), NULL)); // XXX eo_do(c->side[i].o->_eo_ptr(), efl_file_set(build_path(buf), NULL)); // XXX
c->side[i].o.fill_set(0, 0, 256, 256); c->side[i].o->fill_set(0, 0, 256, 256);
c->side[i].o.evas::object::size_set(256, 256); c->side[i].o->evas::object::size_set(256, 256);
c->side[i].o.visibility_set(true); c->side[i].o->visibility_set(true);
} }
POINT(0, 0, -w, -h, -d, 0, 0); POINT(0, 0, -w, -h, -d, 0, 0);
POINT(0, 1, w, -h, -d, 256, 0); POINT(0, 1, w, -h, -d, 256, 0);
@ -127,8 +125,8 @@ _cube_pos(Cube *c,
255, 255, 255, 255, 255, 255,
20, 20, 20); 20, 20, 20);
evas_map_util_3d_perspective(m, (win_w / 2), (win_h / 2), 0, 512); evas_map_util_3d_perspective(m, (win_w / 2), (win_h / 2), 0, 512);
c->side[i].o.map_enable_set(1); c->side[i].o->map_enable_set(1);
c->side[i].o.map_set(m); c->side[i].o->map_set(m);
order[i] = i; order[i] = i;
for (j = 0; j < 4; j++) for (j = 0; j < 4; j++)
@ -152,9 +150,9 @@ _cube_pos(Cube *c,
} }
while (!sorted); while (!sorted);
c->side[order[0]].o.raise(); c->side[order[0]].o->raise();
for (i = 1; i < 6; i++) for (i = 1; i < 6; i++)
c->side[order[i]].o.stack_below(c->side[order[i - 1]].o); c->side[order[i]].o->stack_below(*c->side[order[i - 1]].o);
} }
static void static void
@ -162,11 +160,11 @@ _cube_free(Cube *c)
{ {
for (int i = 0; i < 6; i++) for (int i = 0; i < 6; i++)
{ {
c->side[i].o.visibility_set(false); // XXX c->side[i].o->visibility_set(false); // XXX
c->side[i].o.parent_set(efl::eo::base(nullptr)); c->side[i].o->parent_set(efl::eo::base(nullptr));
::eo_unref(c->side[i].o._release()); delete c->side[i].o;
} }
free(c); delete c;
} }
/* setup */ /* setup */

View File

@ -22,7 +22,7 @@ typedef struct _Point
typedef struct _Side typedef struct _Side
{ {
evas::image o; evas::image *o;
Point pt[4]; Point pt[4];
} Side; } Side;
@ -48,22 +48,20 @@ static Cube *
_cube_new(Evas_Coord w, Evas_Coord h, Evas_Coord d) _cube_new(Evas_Coord w, Evas_Coord h, Evas_Coord d)
{ {
evas::canvas canvas(::eo_ref(G_evas)); evas::canvas canvas(::eo_ref(G_evas));
Cube *c;
w -= (w / 2); w -= (w / 2);
h -= (h / 2); h -= (h / 2);
d -= (d / 2); d -= (d / 2);
c = static_cast<Cube*>(calloc(1, sizeof(Cube))); Cube *c = new Cube {};
for (int i = 0; i < 6; i++) for (int i = 0; i < 6; i++)
{ {
char buf[256]; char buf[256];
c->side[i].o = evas::image(efl::eo::parent = canvas); c->side[i].o = new evas::image(efl::eo::parent = canvas);
snprintf(buf, sizeof(buf), "im%i.png", (i % 2) + 1); snprintf(buf, sizeof(buf), "im%i.png", (i % 2) + 1);
eo_do(c->side[i].o._eo_ptr(), efl_file_set(build_path(buf), NULL)); // XXX eo_do(c->side[i].o->_eo_ptr(), efl_file_set(build_path(buf), NULL)); // XXX
c->side[i].o.fill_set(0, 0, 720, 420); c->side[i].o->fill_set(0, 0, 720, 420);
c->side[i].o.evas::object::size_set(720, 420); c->side[i].o->evas::object::size_set(720, 420);
c->side[i].o.smooth_scale_set(0); c->side[i].o->smooth_scale_set(0);
c->side[i].o.visibility_set(true); c->side[i].o->visibility_set(true);
} }
POINT(0, 0, -w, -h, -d, 0, 0); POINT(0, 0, -w, -h, -d, 0, 0);
POINT(0, 1, w, -h, -d, 720, 0); POINT(0, 1, w, -h, -d, 720, 0);
@ -107,8 +105,8 @@ _cube_pos(Cube *c,
int i, j, order[6], sorted; int i, j, order[6], sorted;
Evas_Coord mz[6]; Evas_Coord mz[6];
if (!m) m = evas_map_new(4); if (!m) m = ::evas_map_new(4);
evas_map_smooth_set(m, 0); ::evas_map_smooth_set(m, 0);
for (i = 0; i < 6; i++) for (i = 0; i < 6; i++)
{ {
@ -116,34 +114,34 @@ _cube_pos(Cube *c,
for (j = 0; j < 4; j++) for (j = 0; j < 4; j++)
{ {
evas_map_point_coord_set(m, j, ::evas_map_point_coord_set(m, j,
c->side[i].pt[j].x + x, c->side[i].pt[j].x + x,
c->side[i].pt[j].y + y, c->side[i].pt[j].y + y,
c->side[i].pt[j].z + z); c->side[i].pt[j].z + z);
evas_map_point_image_uv_set(m, j, ::evas_map_point_image_uv_set(m, j,
c->side[i].pt[j].u, c->side[i].pt[j].u,
c->side[i].pt[j].v); c->side[i].pt[j].v);
evas_map_point_color_set(m, j, 255, 255, 255, 255); ::evas_map_point_color_set(m, j, 255, 255, 255, 255);
} }
evas_map_util_3d_rotate(m, dx, dy, dz, x, y, z); ::evas_map_util_3d_rotate(m, dx, dy, dz, x, y, z);
evas_map_util_3d_lighting(m, -1000, win_h / 2, -1000, ::evas_map_util_3d_lighting(m, -1000, win_h / 2, -1000,
255, 255, 255, 255, 255, 255,
20, 20, 20); 20, 20, 20);
evas_map_util_3d_perspective(m, (win_w / 2), (win_h / 2), -360, 720); ::evas_map_util_3d_perspective(m, (win_w / 2), (win_h / 2), -360, 720);
if (evas_map_util_clockwise_get(m)) if (::evas_map_util_clockwise_get(m))
{ {
c->side[i].o.map_enable_set(1); c->side[i].o->map_enable_set(1);
c->side[i].o.map_set(m); c->side[i].o->map_set(m);
c->side[i].o.visibility_set(true); c->side[i].o->visibility_set(true);
} }
else else
{ {
c->side[i].o.visibility_set(false); c->side[i].o->visibility_set(false);
} }
order[i] = i; order[i] = i;
for (j = 0; j < 4; j++) for (j = 0; j < 4; j++)
evas_map_point_coord_get(m, j, NULL, NULL, &(tz[j])); ::evas_map_point_coord_get(m, j, NULL, NULL, &(tz[j]));
mz[i] = (tz[0] + tz[1] + tz[2] + tz[3]) / 4; mz[i] = (tz[0] + tz[1] + tz[2] + tz[3]) / 4;
} }
sorted = 0; sorted = 0;
@ -163,9 +161,9 @@ _cube_pos(Cube *c,
} }
while (!sorted); while (!sorted);
c->side[order[0]].o.raise(); c->side[order[0]].o->raise();
for (i = 1; i < 6; i++) for (i = 1; i < 6; i++)
c->side[order[i]].o.stack_below(c->side[order[i - 1]].o); c->side[order[i]].o->stack_below(*c->side[order[i - 1]].o);
} }
static void static void
@ -173,11 +171,11 @@ _cube_free(Cube *c)
{ {
for (int i = 0; i < 6; i++) for (int i = 0; i < 6; i++)
{ {
c->side[i].o.visibility_set(false); // XXX c->side[i].o->visibility_set(false); // XXX
c->side[i].o.parent_set(efl::eo::base(nullptr)); c->side[i].o->parent_set(efl::eo::base(nullptr));
::eo_unref(c->side[i].o._release()); delete c->side[i].o;
} }
free(c); delete c;
} }
/* setup */ /* setup */

View File

@ -22,7 +22,7 @@ typedef struct _Point
typedef struct _Side typedef struct _Side
{ {
evas::image o; evas::image *o;
Point pt[4]; Point pt[4];
} Side; } Side;
@ -48,22 +48,20 @@ static Cube *
_cube_new(Evas_Coord w, Evas_Coord h, Evas_Coord d) _cube_new(Evas_Coord w, Evas_Coord h, Evas_Coord d)
{ {
evas::canvas canvas(::eo_ref(G_evas)); evas::canvas canvas(::eo_ref(G_evas));
Cube *c;
w -= (w / 2); w -= (w / 2);
h -= (h / 2); h -= (h / 2);
d -= (d / 2); d -= (d / 2);
c = static_cast<Cube*>(calloc(1, sizeof(Cube))); Cube *c = new Cube {};
for (int i = 0; i < 6; i++) for (int i = 0; i < 6; i++)
{ {
char buf[256]; char buf[256];
c->side[i].o = evas::image(efl::eo::parent = canvas); c->side[i].o = new evas::image(efl::eo::parent = canvas);
snprintf(buf, sizeof(buf), "im%i.png", (i % 2) + 1); snprintf(buf, sizeof(buf), "im%i.png", (i % 2) + 1);
eo_do(c->side[i].o._eo_ptr(), efl_file_set(build_path(buf), NULL)); // XXX eo_do(c->side[i].o->_eo_ptr(), efl_file_set(build_path(buf), NULL)); // XXX
c->side[i].o.fill_set(0, 0, 720, 420); c->side[i].o->fill_set(0, 0, 720, 420);
c->side[i].o.evas::object::size_set(720, 420); c->side[i].o->evas::object::size_set(720, 420);
c->side[i].o.smooth_scale_set(0); c->side[i].o->smooth_scale_set(0);
c->side[i].o.visibility_set(true); c->side[i].o->visibility_set(true);
} }
POINT(0, 0, -w, -h, -d, 0, 0); POINT(0, 0, -w, -h, -d, 0, 0);
POINT(0, 1, w, -h, -d, 720, 0); POINT(0, 1, w, -h, -d, 720, 0);
@ -107,8 +105,8 @@ _cube_pos(Cube *c,
int i, j, order[6], sorted; int i, j, order[6], sorted;
Evas_Coord mz[6]; Evas_Coord mz[6];
if (!m) m = evas_map_new(4); if (!m) m = ::evas_map_new(4);
evas_map_smooth_set(m, 0); ::evas_map_smooth_set(m, 0);
for (i = 0; i < 6; i++) for (i = 0; i < 6; i++)
{ {
@ -116,31 +114,31 @@ _cube_pos(Cube *c,
for (j = 0; j < 4; j++) for (j = 0; j < 4; j++)
{ {
evas_map_point_coord_set(m, j, ::evas_map_point_coord_set(m, j,
c->side[i].pt[j].x + x, c->side[i].pt[j].x + x,
c->side[i].pt[j].y + y, c->side[i].pt[j].y + y,
c->side[i].pt[j].z + z); c->side[i].pt[j].z + z);
evas_map_point_image_uv_set(m, j, ::evas_map_point_image_uv_set(m, j,
c->side[i].pt[j].u, c->side[i].pt[j].u,
c->side[i].pt[j].v); c->side[i].pt[j].v);
evas_map_point_color_set(m, j, 255, 255, 255, 255); ::evas_map_point_color_set(m, j, 255, 255, 255, 255);
} }
evas_map_util_3d_rotate(m, dx, dy, dz, x, y, z); ::evas_map_util_3d_rotate(m, dx, dy, dz, x, y, z);
evas_map_util_3d_perspective(m, (win_w / 2), (win_h / 2), -360, 720); ::evas_map_util_3d_perspective(m, (win_w / 2), (win_h / 2), -360, 720);
if (evas_map_util_clockwise_get(m)) if (::evas_map_util_clockwise_get(m))
{ {
c->side[i].o.map_enable_set(1); c->side[i].o->map_enable_set(1);
c->side[i].o.map_set(m); c->side[i].o->map_set(m);
c->side[i].o.visibility_set(true); c->side[i].o->visibility_set(true);
} }
else else
{ {
c->side[i].o.visibility_set(false); c->side[i].o->visibility_set(false);
} }
order[i] = i; order[i] = i;
for (j = 0; j < 4; j++) for (j = 0; j < 4; j++)
evas_map_point_coord_get(m, j, NULL, NULL, &(tz[j])); ::evas_map_point_coord_get(m, j, NULL, NULL, &(tz[j]));
mz[i] = (tz[0] + tz[1] + tz[2] + tz[3]) / 4; mz[i] = (tz[0] + tz[1] + tz[2] + tz[3]) / 4;
} }
sorted = 0; sorted = 0;
@ -160,9 +158,9 @@ _cube_pos(Cube *c,
} }
while (!sorted); while (!sorted);
c->side[order[0]].o.raise(); c->side[order[0]].o->raise();
for (i = 1; i < 6; i++) for (i = 1; i < 6; i++)
c->side[order[i]].o.stack_below(c->side[order[i - 1]].o); c->side[order[i]].o->stack_below(*c->side[order[i - 1]].o);
} }
static void static void
@ -170,11 +168,11 @@ _cube_free(Cube *c)
{ {
for (int i = 0; i < 6; i++) for (int i = 0; i < 6; i++)
{ {
c->side[i].o.visibility_set(false); // XXX c->side[i].o->visibility_set(false); // XXX
c->side[i].o.parent_set(efl::eo::base(nullptr)); c->side[i].o->parent_set(efl::eo::base(nullptr));
::eo_unref(c->side[i].o._release()); delete c->side[i].o;
} }
free(c); delete c;
} }
/* setup */ /* setup */

View File

@ -32,7 +32,7 @@ static void _setup(void)
eo_do(o._eo_ptr(), efl_file_set(build_path("image.png"), NULL)); // XXX eo_do(o._eo_ptr(), efl_file_set(build_path("image.png"), NULL)); // XXX
o.fill_set(0, 0, 120, 160); o.fill_set(0, 0, 120, 160);
o.evas::object::size_set(120, 160); o.evas::object::size_set(120, 160);
o.evas::object::visibility_set(EINA_TRUE); o.evas::object::visibility_set(true);
} }
done = 0; done = 0;
} }
@ -40,8 +40,8 @@ static void _setup(void)
/* cleanup */ /* cleanup */
static void _cleanup(void) static void _cleanup(void)
{ {
for (evas::image& i : images) for (evas::image& img : images)
i.parent_set(efl::eo::base(nullptr)); img.parent_set(efl::eo::base(nullptr));
images.clear(); images.clear();
} }

View File

@ -25,13 +25,11 @@ static void _setup(void)
{ {
evas::canvas canvas(::eo_ref(G_evas)); evas::canvas canvas(::eo_ref(G_evas));
evas::image o(efl::eo::parent = canvas); evas::image o(efl::eo::parent = canvas);
eo_do(o._eo_ptr(), efl_file_set(build_path("logo.png"), NULL)); // XXX eo_do(o._eo_ptr(), efl_file_set(build_path("logo.png"), NULL)); // XXX
o.fill_set(0, 0, 120, 160); o.fill_set(0, 0, 120, 160);
o.evas::object::size_set(120, 160); o.evas::object::size_set(120, 160);
o.evas::object::position_set(-400, -300); o.evas::object::position_set(-400, -300);
evas::image src = o; evas::image src = o;
for (int i = 0; i < OBNUM / 2; i++) for (int i = 0; i < OBNUM / 2; i++)
{ {
evas::image o(efl::eo::parent = canvas); evas::image o(efl::eo::parent = canvas);

View File

@ -19,52 +19,42 @@
static int done = 0; static int done = 0;
/* private data */ /* private data */
static evas::object *texts[OBNUM]; static efl::eina::array<evas::object> texts;
inline Evas_Text_Style_Type
operator++(Evas_Text_Style_Type const& x)
{
int val = static_cast<int>(x);
return static_cast<Evas_Text_Style_Type>(val++);
}
/* setup */ /* setup */
static void _setup(void) static void _setup(void)
{ {
evas::canvas canvas(::eo_ref(G_evas)); evas::canvas canvas(::eo_ref(G_evas));
Evas_Text_Style_Type st, i; int w, h, i = 0;
Evas_Text_Style_Type st = EVAS_TEXT_STYLE_SHADOW;
st = EVAS_TEXT_STYLE_SHADOW;
for (; st <= EVAS_TEXT_STYLE_FAR_SOFT_SHADOW; ++i) for (; st <= EVAS_TEXT_STYLE_FAR_SOFT_SHADOW; ++i)
{ {
evas::text* o = new evas::text(efl::eo::parent = canvas); evas::text o(efl::eo::parent = canvas);
o->font_set("Vera-Bold", 20); texts.push_back(o);
o->text_set("This is a test string"); o.font_set("Vera-Bold", 20);
o->style_set(st); o.text_set("This is a test string");
o->evas::object::color_set(255, 255, 255, 255); o.style_set(st);
o->shadow_color_set(0, 0, 0, 24); o.evas::object::color_set(255, 255, 255, 255);
o->glow_color_set(100, 80, 40, 100); o.shadow_color_set(0, 0, 0, 24);
o->glow2_color_set(50, 10, 5, 50); o.glow_color_set(100, 80, 40, 100);
o->outline_color_set(0, 0, 0, 255); o.glow2_color_set(50, 10, 5, 50);
o->visibility_set(true); o.outline_color_set(0, 0, 0, 255);
texts[i] = o; o.visibility_set(true);
++st; st = static_cast<Evas_Text_Style_Type>(static_cast<int>(st) + 1);
} }
st = i; st = static_cast<Evas_Text_Style_Type>(i);
for ( ; i < OBNUM ; ++i) for ( ; i < OBNUM ; ++i)
{ {
evas::text s(::eo_ref(texts[i % st]->_eo_ptr())); evas::image o(efl::eo::parent = canvas);
evas::image *o = new evas::image(efl::eo::parent = canvas); evas::object s = texts[i % st];
o->source_set(s); texts.push_back(o);
/* FIXME s == NULL*/ o.source_set(s);
int w,h; s.size_get(&w, &h);
s.evas::object::size_get(&w, &h); o.evas::object::size_set(w, h);
o->evas::object::size_set(w, h); o.fill_set(0, 0, w, h);
o->fill_set(0, 0, w, h); o.evas::object::visibility_set(true);
o->visibility_set(true);
if (texts[i]) delete texts[i];
texts[i] = o;
} }
done = 0; done = 0;
@ -73,26 +63,28 @@ static void _setup(void)
/* cleanup */ /* cleanup */
static void _cleanup(void) static void _cleanup(void)
{ {
for (int i = 0; i < OBNUM; i++) // XXX for (evas::object& obj : texts)
{ {
texts[i]->parent_set(efl::eo::base(nullptr)); obj.visibility_set(false); // XXX
texts[i]->_reset(nullptr); obj.parent_set(efl::eo::base(nullptr));
delete texts[i];
} }
texts.clear();
} }
/* loop - do things */ /* loop - do things */
static void _loop(double t, int f) static void _loop(double t, int f)
{ {
Evas_Coord x, y, w, h; Evas_Coord x, y, w, h;
for (int i = 0; i < OBNUM; i++) int i = 0;
for (evas::object& text : texts)
{ {
texts[i]->evas::object::size_get(&w, &h); text.size_get(&w, &h);
x = (win_w / 2) - (w / 2); x = (win_w / 2) - (w / 2);
x += ::sin((double)(f + (i * 13)) / (36.7 * SLOW)) * (w / 2); x += ::sin((double)(f + (i * 13)) / (36.7 * SLOW)) * (w / 2);
y = (win_h / 2) - (h / 2); y = (win_h / 2) - (h / 2);
y += ::cos((double)(f + (i * 28)) / (43.8 * SLOW)) * (w / 2); y += ::cos((double)(f + (i * 28)) / (43.8 * SLOW)) * (w / 2);
texts[i]->evas::object::position_set(x, y); text.position_set(x, y);
++i;
} }
FPS_STD(NAME); FPS_STD(NAME);
} }

View File

@ -19,13 +19,13 @@
static int done = 0; static int done = 0;
/* private data */ /* private data */
static Evas_Object *o_texts[OBNUM]; static efl::eina::list<evas::object> texts;
/* setup */ /* setup */
static void _setup(void) static void _setup(void)
{ {
int i = 0; int i = 0;
Evas_Object *o; evas::canvas canvas(::eo_ref(G_evas));
Evas_Coord x, y, w, h; Evas_Coord x, y, w, h;
char buf[1024]; char buf[1024];
const char *strs[] = { const char *strs[] = {
@ -34,41 +34,38 @@ static void _setup(void)
"Fiddly", "Family", "Lair", "Monkeys", "Magazine" "Fiddly", "Family", "Lair", "Monkeys", "Magazine"
}; };
srnd(); srnd();
o = eo_add(EVAS_TEXT_CLASS, G_evas); evas::text o(efl::eo::parent = canvas);
o_texts[0] = o; texts.push_back(o);
snprintf(buf, sizeof(buf), "%s %s %s %s.", snprintf(buf, sizeof(buf), "%s %s %s %s.",
strs[rnd() % (sizeof(strs) / sizeof(char *))], strs[rnd() % (sizeof(strs) / sizeof(char *))],
strs[rnd() % (sizeof(strs) / sizeof(char *))], strs[rnd() % (sizeof(strs) / sizeof(char *))],
strs[rnd() % (sizeof(strs) / sizeof(char *))], strs[rnd() % (sizeof(strs) / sizeof(char *))],
strs[rnd() % (sizeof(strs) / sizeof(char *))]); strs[rnd() % (sizeof(strs) / sizeof(char *))]);
eo_do(o, o.font_set("Vera-Bold", 20);
efl_text_properties_font_set("Vera-Bold", 20), o.text_set(buf);
efl_text_set(buf), o.evas::object::color_set(0, 0, 0, 255);
evas_obj_color_set(0, 0, 0, 255), o.evas::object::size_get(&w, &h);
evas_obj_size_get(&w, &h));
x = (win_w / 2) - (w / 2); x = (win_w / 2) - (w / 2);
x += sin((double)((i * 13)) / (36.7 * SLOW)) * (w / 2); x += ::sin((double)((i * 13)) / (36.7 * SLOW)) * (w / 2);
y = (win_h / 2) - (h / 2); y = (win_h / 2) - (h / 2);
y += cos((double)((i * 28)) / (43.8 * SLOW)) * (w / 2); y += ::cos((double)((i * 28)) / (43.8 * SLOW)) * (w / 2);
eo_do(o, o.evas::object::position_set(x, y);
evas_obj_position_set(x, y), o.evas::object::visibility_set(true);
evas_obj_visibility_set(EINA_TRUE)); for (i = 1; i < OBNUM ; i ++)
for (i = 1 ; i < OBNUM ; i ++)
{ {
o = eo_add(EVAS_IMAGE_CLASS, G_evas); evas::image o2(efl::eo::parent = canvas);
o_texts[i] = o; texts.push_back(o2);
eo_do(o, o2.source_set(texts.front());
evas_obj_image_source_set(o_texts[0])); texts.front().evas::object::size_get(&w, &h);
eo_do(o_texts[0], evas_obj_size_get(&w, &h)); o2.evas::object::size_set(w, h);
eo_do(o, evas_obj_size_set(w, h), o2.fill_set(0, 0, w, h);
evas_obj_image_fill_set(0, 0, w, h));
x = (win_w / 2) - (w / 2); x = (win_w / 2) - (w / 2);
x += sin((double)((i * 13)) / (36.7 * SLOW)) * (w / 2); x += sin((double)((i * 13)) / (36.7 * SLOW)) * (w / 2);
y = (win_h / 2) - (h / 2); y = (win_h / 2) - (h / 2);
y += cos((double)((i * 28)) / (43.8 * SLOW)) * (w / 2); y += cos((double)((i * 28)) / (43.8 * SLOW)) * (w / 2);
eo_do(o, evas_obj_position_set(x, y), o2.evas::object::position_set(x, y);
evas_obj_visibility_set(EINA_TRUE)); o2.evas::object::visibility_set(true);
} }
done = 0; done = 0;
@ -77,8 +74,12 @@ static void _setup(void)
/* cleanup */ /* cleanup */
static void _cleanup(void) static void _cleanup(void)
{ {
int i; for (evas::object& obj : texts)
for (i = 0; i < OBNUM; i++) eo_del(o_texts[i]); {
obj.visibility_set(false); // XXX
obj.parent_set(efl::eo::base(nullptr));
}
texts.clear();
} }
/* loop - do things */ /* loop - do things */
@ -96,14 +97,18 @@ static void _loop(double t, int f)
strs[rnd() % (sizeof(strs) / sizeof(char *))], strs[rnd() % (sizeof(strs) / sizeof(char *))],
strs[rnd() % (sizeof(strs) / sizeof(char *))], strs[rnd() % (sizeof(strs) / sizeof(char *))],
strs[rnd() % (sizeof(strs) / sizeof(char *))]); strs[rnd() % (sizeof(strs) / sizeof(char *))]);
eo_do(o_texts[0], efl::eina::list<evas::object>::iterator
efl_text_set(buf), it = texts.begin(),
evas_obj_size_get(&w, &h)); end = texts.end();
for (i = 1; i < OBNUM; i++) if (it != end)
{ {
eo_do(o_texts[i], efl::eo::downcast<evas::text>(*it).text_set(buf);
evas_obj_size_set(w,h), (*it++).evas::object::size_get(&w, &h);
evas_obj_image_fill_set(0,0,w,h)); }
for (; it != end; ++it)
{
(*it).evas::object::size_set(w, h);
efl::eo::downcast<evas::image>(*it).fill_set(0, 0, w, h);
} }
FPS_STD(NAME); FPS_STD(NAME);
} }

View File

@ -63,10 +63,10 @@ extern "C" {
#include "image_map_solid_rotate_capi.h" #include "image_map_solid_rotate_capi.h"
#include "image_quality_scale_capi.h" #include "image_quality_scale_capi.h"
#include "line_blend_capi.h" #include "line_blend_capi.h"
/* #include "proxy_image_capi.h" */ #include "proxy_image_capi.h"
/* #include "proxy_image_offscreen_capi.h" */ #include "proxy_image_offscreen_capi.h"
/* #include "proxy_text_fixed_capi.h" */ #include "proxy_text_fixed_capi.h"
/* #include "proxy_text_random_capi.h" */ #include "proxy_text_random_capi.h"
#include "rect_blend_capi.h" #include "rect_blend_capi.h"
#include "rect_blend_few_capi.h" #include "rect_blend_few_capi.h"
#include "rect_blend_pow2_capi.h" #include "rect_blend_pow2_capi.h"

View File

@ -59,8 +59,8 @@ static void _setup(void)
/* cleanup */ /* cleanup */
static void _cleanup(void) static void _cleanup(void)
{ {
for (evas::text& t : texts) for (evas::text& txt : texts)
t.parent_set(efl::eo::base(nullptr)); txt.parent_set(efl::eo::base(nullptr));
texts.clear(); texts.clear();
} }
@ -73,14 +73,14 @@ static void _loop(double t, int f)
"Am", "You", "Are", "Erogenous", "We", "Stick", "Wet", "Fishy", "Am", "You", "Are", "Erogenous", "We", "Stick", "Wet", "Fishy",
"Fiddly", "Family", "Lair", "Monkeys", "Magazine" "Fiddly", "Family", "Lair", "Monkeys", "Magazine"
}; };
for (evas::text& text : texts) for (evas::text& txt : texts)
{ {
snprintf(buf, sizeof(buf), "%s %s %s %s.", snprintf(buf, sizeof(buf), "%s %s %s %s.",
strs[rnd() % (sizeof(strs) / sizeof(char *))], strs[rnd() % (sizeof(strs) / sizeof(char *))],
strs[rnd() % (sizeof(strs) / sizeof(char *))], strs[rnd() % (sizeof(strs) / sizeof(char *))],
strs[rnd() % (sizeof(strs) / sizeof(char *))], strs[rnd() % (sizeof(strs) / sizeof(char *))],
strs[rnd() % (sizeof(strs) / sizeof(char *))]); strs[rnd() % (sizeof(strs) / sizeof(char *))]);
text.text_set(buf); txt.text_set(buf);
} }
FPS_STD(NAME); FPS_STD(NAME);
} }

View File

@ -55,8 +55,8 @@ static void _setup(void)
/* cleanup */ /* cleanup */
static void _cleanup(void) static void _cleanup(void)
{ {
for (evas::text& t : texts) for (evas::text& txt : texts)
t.parent_set(efl::eo::base(nullptr)); txt.parent_set(efl::eo::base(nullptr));
texts.clear(); texts.clear();
} }

View File

@ -67,19 +67,19 @@ static void _cleanup(void)
/* loop - do things */ /* loop - do things */
static void _loop(double t, int f) static void _loop(double t, int f)
{ {
Evas_Coord x, y, w, h, w0, h0; if (text_block)
int i = 0; {
if (!text_block) goto fps; // XXX Evas_Coord x, y, w, h, w0, h0;
int i = 0;
text_block->size_native_get(&w0, &h0); text_block->size_native_get(&w0, &h0);
w = w0; w = w0;
h = h0; h = h0;
w += fabs(sin((double)(f + (i * 13)) / (31.1 * SLOW))) * (w0); w += fabs(sin((double)(f + (i * 13)) / (31.1 * SLOW))) * (w0);
x = (win_w / 2) - (w / 2); x = (win_w / 2) - (w / 2);
y = (win_h / 2) - (h0 / 2); y = (win_h / 2) - (h0 / 2);
text_block->evas::object::position_set(x, y); text_block->evas::object::position_set(x, y);
text_block->evas::object::size_set(w, h); text_block->evas::object::size_set(w, h);
fps: }
FPS_STD(NAME); FPS_STD(NAME);
} }

View File

@ -88,18 +88,13 @@ static void _loop(double t, int f)
Evas_Coord x, y, tw, th, cent; Evas_Coord x, y, tw, th, cent;
x = 0; x = 0;
y = 0 - f; y = 0 - f;
efl::eina::list<evas::image>::iterator efl::eina::list<evas::image>::iterator img = images.begin();
it1 = images.begin(), for (evas::text& txt : texts)
end1 = images.end();
efl::eina::list<evas::text>::iterator
it2 = texts.begin(),
end2 = texts.end();
for (; it1 != end1 && it2 != end2; ++it1, ++it2)
{ {
(*it1).evas::object::position_set(x + 8, y); (*img++).evas::object::position_set(x + 8, y);
(*it2).evas::object::size_get(&tw, &th); txt.evas::object::size_get(&tw, &th);
cent = (ICON_SIZE + 16 - tw) / 2; cent = (ICON_SIZE + 16 - tw) / 2;
(*it2).evas::object::position_set(x + cent, y + ICON_SIZE + 4); txt.evas::object::position_set(x + cent, y + ICON_SIZE + 4);
x += ICON_SIZE + 16; x += ICON_SIZE + 16;
if (x > win_w) if (x > win_w)
{ {

View File

@ -84,19 +84,14 @@ static void _loop(double t, int f)
Evas_Coord x, y, tw, th, cent; Evas_Coord x, y, tw, th, cent;
x = 0; x = 0;
y = 0 - f; y = 0 - f;
efl::eina::list<evas::image>::iterator
it1 = images.begin(), efl::eina::list<evas::image>::iterator img = images.begin();
end1 = images.end(); for (evas::text& txt : texts)
efl::eina::list<evas::text>::iterator
it2 = texts.begin(),
end2 = texts.end();
if (images.empty() || texts.empty()) goto fps; // XXX
for (int i = 0; i < NUM; i++)
{ {
(*it1).evas::object::position_set(x + 8, y); (*img++).evas::object::position_set(x + 8, y);
(*it2).evas::object::size_get(&tw, &th); txt.evas::object::size_get(&tw, &th);
cent = (ICON_SIZE + 16 - tw) / 2; cent = (ICON_SIZE + 16 - tw) / 2;
(*it2).evas::object::position_set(x + cent, y + ICON_SIZE + 4); txt.evas::object::position_set(x + cent, y + ICON_SIZE + 4);
x += ICON_SIZE + 16; x += ICON_SIZE + 16;
if (x > win_w) if (x > win_w)
{ {

View File

@ -21,7 +21,7 @@ static int done = 0;
#define NUM 512 #define NUM 512
#define ICON_SIZE 64 #define ICON_SIZE 64
static efl::eina::list<evas::image> images; static efl::eina::array<evas::image> images;
static efl::eina::list<evas::text> texts; static efl::eina::list<evas::text> texts;
static const char *icons[] = static const char *icons[] =
@ -54,7 +54,7 @@ static void _setup(void)
images.push_back(o1); images.push_back(o1);
eo_do(o1._eo_ptr(), efl_file_set(build_path(icons[i % 13]), NULL)); // XXX eo_do(o1._eo_ptr(), efl_file_set(build_path(icons[i % 13]), NULL)); // XXX
o1.fill_set(0, 0, ICON_SIZE, ICON_SIZE); o1.fill_set(0, 0, ICON_SIZE, ICON_SIZE);
o1.evas::object::size_set(win_w, ICON_SIZE); o1.evas::object::size_set(ICON_SIZE, ICON_SIZE);
o1.visibility_set(true); o1.visibility_set(true);
evas::text o2(efl::eo::parent = canvas); evas::text o2(efl::eo::parent = canvas);
@ -68,16 +68,10 @@ static void _setup(void)
{ {
img.evas::object::raise(); img.evas::object::raise();
} }
efl::eina::list<evas::image>::iterator for (int i = 0; i < NUM; i++)
it1 = images.begin(),
it2 = images.begin();
for (int i = 0; i < NUM; i++, ++it1)
{ {
if (i > 13) if (i > 13)
{ images[i].evas::object::stack_above(images[i - 13]);
(*it1).evas::object::stack_above(*it2);
++it2; // XXX
}
} }
done = 0; done = 0;
} }
@ -94,7 +88,7 @@ static void _cleanup(void)
for (evas::text& t : texts) for (evas::text& t : texts)
{ {
t.visibility_set(false); // XXX //t.visibility_set(false); // XXX
t.parent_set(efl::eo::base(nullptr)); t.parent_set(efl::eo::base(nullptr));
} }
texts.clear(); texts.clear();
@ -106,18 +100,13 @@ static void _loop(double t, int f)
Evas_Coord x, y, tw, th, cent; Evas_Coord x, y, tw, th, cent;
x = 0; x = 0;
y = 0 - f; y = 0 - f;
efl::eina::list<evas::image>::iterator efl::eina::array<evas::image>::iterator img = images.begin();
it1 = images.begin(), for (evas::text& txt : texts)
end1 = images.end();
efl::eina::list<evas::text>::iterator
it2 = texts.begin(),
end2 = texts.end();
for (; it1 != end1 && it2 != end2; ++it1, ++it2)
{ {
(*it1).evas::object::position_set(x + 8, y); (*img++).evas::object::position_set(x + 8, y);
(*it2).evas::object::size_get(&tw, &th); txt.evas::object::size_get(&tw, &th);
cent = (ICON_SIZE + 16 - tw) / 2; cent = (ICON_SIZE + 16 - tw) / 2;
(*it2).evas::object::position_set(x + cent, y + ICON_SIZE + 4); txt.evas::object::position_set(x + cent, y + ICON_SIZE + 4);
x += ICON_SIZE + 16; x += ICON_SIZE + 16;
if (x > win_w) if (x > win_w)
{ {

View File

@ -69,18 +69,13 @@ static void _loop(double t, int f)
Evas_Coord x, y, tw, th, cent; Evas_Coord x, y, tw, th, cent;
x = 0; x = 0;
y = 0 - f; y = 0 - f;
efl::eina::list<evas::image>::iterator efl::eina::list<evas::image>::iterator img = images.begin();
it1 = images.begin(), for (evas::text& txt : texts)
end1 = images.end();
efl::eina::list<evas::text>::iterator
it2 = texts.begin(),
end2 = texts.end();
for (; it1 != end1 && it2 != end2; ++it1, ++it2)
{ {
(*it1).evas::object::position_set(x + 8, y); (*img++).evas::object::position_set(x + 8, y);
(*it2).evas::object::size_get(&tw, &th); txt.evas::object::size_get(&tw, &th);
cent = (ICON_SIZE + 16 - tw) / 2; cent = (ICON_SIZE + 16 - tw) / 2;
(*it2).evas::object::position_set(x + cent, y + ICON_SIZE + 4); txt.evas::object::position_set(x + cent, y + ICON_SIZE + 4);
x += ICON_SIZE + 16; x += ICON_SIZE + 16;
if (x > win_w) if (x > win_w)
{ {

View File

@ -48,9 +48,9 @@ static void _setup(void)
o2.evas::object::color_set(0, 0, 0, 255); o2.evas::object::color_set(0, 0, 0, 255);
o2.visibility_set(true); o2.visibility_set(true);
} }
for (evas::image img : images) for (evas::image& img : images)
{ {
img.raise(); img.evas::object::raise();
} }
done = 0; done = 0;
@ -59,12 +59,12 @@ static void _setup(void)
/* cleanup */ /* cleanup */
static void _cleanup(void) static void _cleanup(void)
{ {
for (evas::image& i : images) for (evas::image& img : images)
i.parent_set(efl::eo::base(nullptr)); img.parent_set(efl::eo::base(nullptr));
images.clear(); images.clear();
for (evas::text& t : texts) for (evas::text& txt : texts)
t.parent_set(efl::eo::base(nullptr)); txt.parent_set(efl::eo::base(nullptr));
texts.clear(); texts.clear();
} }
@ -74,18 +74,13 @@ static void _loop(double t, int f)
Evas_Coord x, y, tw, th, cent; Evas_Coord x, y, tw, th, cent;
x = 0; x = 0;
y = 0 - f; y = 0 - f;
efl::eina::list<evas::image>::iterator efl::eina::list<evas::image>::iterator img = images.begin();
it1 = images.begin(), for (evas::text& txt : texts)
end1 = images.end();
efl::eina::list<evas::text>::iterator
it2 = texts.begin(),
end2 = texts.end();
for (; it1 != end1 && it2 != end2; ++it1, ++it2)
{ {
(*it1).evas::object::position_set(x + 8, y); (*img++).evas::object::position_set(x + 8, y);
(*it2).evas::object::size_get(&tw, &th); txt.evas::object::size_get(&tw, &th);
cent = (ICON_SIZE + 16 - tw) / 2; cent = (ICON_SIZE + 16 - tw) / 2;
(*it2).evas::object::position_set(x + cent, y + ICON_SIZE + 4); txt.evas::object::position_set(x + cent, y + ICON_SIZE + 4);
x += ICON_SIZE + 16; x += ICON_SIZE + 16;
if (x > win_w) if (x > win_w)
{ {

View File

@ -83,19 +83,13 @@ static void _loop(double t, int f)
Evas_Coord x, y, tw, th, cent; Evas_Coord x, y, tw, th, cent;
x = 0; x = 0;
y = 0 - f; y = 0 - f;
efl::eina::list<evas::image>::iterator efl::eina::list<evas::image>::iterator img = images.begin();
it1 = images.begin(), for (evas::text& txt : texts)
end1 = images.end();
efl::eina::list<evas::text>::iterator
it2 = texts.begin(),
end2 = texts.end();
for (; it1 != end1 && it2 != end2; ++it1, ++it2)
{ {
(*it1).evas::object::position_set(x + 8, y); (*img++).evas::object::position_set(x + 8, y);
(*it2).evas::object::size_get(&tw, &th); txt.evas::object::size_get(&tw, &th);
cent = (ICON_SIZE + 16 - tw) / 2; cent = (ICON_SIZE + 16 - tw) / 2;
(*it2).evas::object::position_set(x + cent, y + ICON_SIZE + 4); txt.evas::object::position_set(x + cent, y + ICON_SIZE + 4);
x += ICON_SIZE + 16; x += ICON_SIZE + 16;
if (x > win_w) if (x > win_w)
{ {

View File

@ -53,7 +53,7 @@ static void _setup(void)
images.push_back(o1); images.push_back(o1);
eo_do(o1._eo_ptr(), efl_file_set(build_path(icons[i % 13]), NULL)); eo_do(o1._eo_ptr(), efl_file_set(build_path(icons[i % 13]), NULL));
o1.fill_set(0, 0, ICON_SIZE, ICON_SIZE); o1.fill_set(0, 0, ICON_SIZE, ICON_SIZE);
o1.size_set(ICON_SIZE, ICON_SIZE); o1.evas::object::size_set(ICON_SIZE, ICON_SIZE);
o1.visibility_set(true); o1.visibility_set(true);
evas::text o2(efl::eo::parent = canvas); evas::text o2(efl::eo::parent = canvas);
@ -72,6 +72,7 @@ static void _cleanup(void)
for (evas::image& i : images) for (evas::image& i : images)
i.parent_set(efl::eo::base(nullptr)); i.parent_set(efl::eo::base(nullptr));
images.clear(); images.clear();
for (evas::text& t : texts) for (evas::text& t : texts)
t.parent_set(efl::eo::base(nullptr)); t.parent_set(efl::eo::base(nullptr));
texts.clear(); texts.clear();
@ -83,18 +84,13 @@ static void _loop(double t, int f)
Evas_Coord x, y, tw, th, cent; Evas_Coord x, y, tw, th, cent;
x = 0; x = 0;
y = 0 - f; y = 0 - f;
efl::eina::list<evas::image>::iterator efl::eina::list<evas::image>::iterator img = images.begin();
it1 = images.begin(), for (evas::text& txt : texts)
end1 = images.end();
efl::eina::list<evas::text>::iterator
it2 = texts.begin(),
end2 = texts.end();
for (; it1 != end1 && it2 != end2; ++it1, ++it2)
{ {
(*it1).evas::object::position_set(x + 8, y); (*img++).evas::object::position_set(x + 8, y);
(*it2).evas::object::size_get(&tw, &th); txt.evas::object::size_get(&tw, &th);
cent = (ICON_SIZE + 16 - tw) / 2; cent = (ICON_SIZE + 16 - tw) / 2;
(*it2).evas::object::position_set(x + cent, y + ICON_SIZE + 4); txt.evas::object::position_set(x + cent, y + ICON_SIZE + 4);
x += ICON_SIZE + 16; x += ICON_SIZE + 16;
if (x > win_w) if (x > win_w)
{ {

View File

@ -70,7 +70,7 @@ static void _setup(void)
images.push_back(o1); images.push_back(o1);
o1.filled_set(1); o1.filled_set(1);
o1.border_set(2, 2, 2, 2); o1.border_set(2, 2, 2, 2);
eo_do(o1._eo_ptr(), efl_file_set(build_path("pan.png"), NULL)); eo_do(o1._eo_ptr(), efl_file_set(build_path("pan.png"), NULL)); // XXX
o1.evas::object::size_set(win_w, ICON_SIZE); o1.evas::object::size_set(win_w, ICON_SIZE);
o1.visibility_set(true); o1.visibility_set(true);
@ -103,18 +103,13 @@ static void _loop(double t, int f)
Evas_Coord x, y, tw, th, cent; Evas_Coord x, y, tw, th, cent;
x = 0; x = 0;
y = 0 - f; y = 0 - f;
efl::eina::list<evas::image>::iterator efl::eina::list<evas::image>::iterator img = images.begin();
it1 = images.begin(), for (evas::text& txt : texts)
end1 = images.end();
efl::eina::list<evas::text>::iterator
it2 = texts.begin(),
end2 = texts.end();
for (; it1 != end1 && it2 != end2; ++it1, ++it2)
{ {
(*it1).evas::object::position_set(x, y); (*img++).evas::object::position_set(x, y);
(*it2).evas::object::size_get(&tw, &th); txt.evas::object::size_get(&tw, &th);
cent = (ICON_SIZE - th) / 2; cent = (ICON_SIZE - th) / 2;
(*it2).evas::object::position_set(x + 8, y + cent); txt.evas::object::position_set(x + 8, y + cent);
y += ICON_SIZE; y += ICON_SIZE;
} }
FPS_STD(NAME); FPS_STD(NAME);

View File

@ -109,18 +109,13 @@ static void _loop(double t, int f)
Evas_Coord x, y, tw, th, cent; Evas_Coord x, y, tw, th, cent;
x = 0; x = 0;
y = 0 - f; y = 0 - f;
efl::eina::list<evas::image>::iterator efl::eina::list<evas::image>::iterator img = images.begin();
it1 = images.begin(), for (evas::text& txt : texts)
end1 = images.end(); {
efl::eina::list<evas::text>::iterator (*img++).evas::object::position_set(x, y);
it2 = texts.begin(), txt.evas::object::size_get(&tw, &th);
end2 = texts.end();
for (; it1 != end1 && it2 != end2; ++it1, ++it2)
{
(*it1).evas::object::position_set(x, y);
(*it2).evas::object::size_get(&tw, &th);
cent = (ICON_SIZE - th) / 2; cent = (ICON_SIZE - th) / 2;
(*it2).evas::object::position_set(x + 8 + ICON_SIZE + 8, y + cent); txt.evas::object::position_set(x + 8 + ICON_SIZE + 8, y + cent);
y += ICON_SIZE; y += ICON_SIZE;
} }
FPS_STD(NAME); FPS_STD(NAME);

View File

@ -102,18 +102,13 @@ static void _loop(double t, int f)
Evas_Coord x, y, tw, th, cent; Evas_Coord x, y, tw, th, cent;
x = 0; x = 0;
y = 0 - f; y = 0 - f;
efl::eina::list<evas::image>::iterator efl::eina::list<evas::image>::iterator img = images.begin();
it1 = images.begin(), for (evas::text& txt : texts)
end1 = images.end();
efl::eina::list<evas::text>::iterator
it2 = texts.begin(),
end2 = texts.end();
for (; it1 != end1 && it2 != end2; ++it1, ++it2)
{ {
(*it1).evas::object::position_set(x, y); (*img++).evas::object::position_set(x, y);
(*it2).evas::object::size_get(&tw, &th); txt.evas::object::size_get(&tw, &th);
cent = (ICON_SIZE - th) / 2; cent = (ICON_SIZE - th) / 2;
(*it2).evas::object::position_set(x + 8, y + cent); txt.evas::object::position_set(x + 8, y + cent);
y += ICON_SIZE; y += ICON_SIZE;
} }
FPS_STD(NAME); FPS_STD(NAME);

View File

@ -110,18 +110,13 @@ static void _loop(double t, int f)
Evas_Coord x, y, tw, th, cent; Evas_Coord x, y, tw, th, cent;
x = 0; x = 0;
y = 0 - f; y = 0 - f;
efl::eina::list<evas::image>::iterator efl::eina::list<evas::image>::iterator img = images.begin();
it1 = images.begin(), for (evas::text& txt : texts)
end1 = images.end();
efl::eina::list<evas::text>::iterator
it2 = texts.begin(),
end2 = texts.end();
for (; it1 != end1 && it2 != end2; ++it1, ++it2)
{ {
(*it1).evas::object::position_set(x, y); (*img++).evas::object::position_set(x, y);
(*it2).evas::object::size_get(&tw, &th); txt.evas::object::size_get(&tw, &th);
cent = (ICON_SIZE - th) / 2; cent = (ICON_SIZE - th) / 2;
(*it2).evas::object::position_set(x + 8, y + cent); txt.evas::object::position_set(x + 8, y + cent);
y += ICON_SIZE; y += ICON_SIZE;
} }
FPS_STD(NAME); FPS_STD(NAME);

View File

@ -134,24 +134,17 @@ static void _loop(double t, int f)
Evas_Coord x, y, tw, th, cent; Evas_Coord x, y, tw, th, cent;
x = 0; x = 0;
y = 0 - f; y = 0 - f;
efl::eina::list<evas::image>::iterator
it1 = images.begin(), efl::eina::list<evas::image>::iterator img = images.begin();
end1 = images.end(); efl::eina::list<evas::image>::iterator ico = icons.begin();
efl::eina::list<evas::image>::iterator for (evas::text& txt : texts)
it2 = icons.begin(),
end2 = icons.end();
efl::eina::list<evas::text>::iterator
it3 = texts.begin(),
end3 = texts.end();
while (it1 != end1 && it2 != end2 && it3 != end3)
{ {
(*it1).evas::object::position_set(x, y); (*img++).evas::object::position_set(x, y);
(*it2).evas::object::position_set(x + 4, y + 4); (*ico++).evas::object::position_set(x + 4, y + 4);
(*it3).evas::object::size_get(&tw, &th); txt.evas::object::size_get(&tw, &th);
cent = (ICON_SIZE - th) / 2; cent = (ICON_SIZE - th) / 2;
(*it3).evas::object::position_set(x + 8 + ICON_SIZE + 8, y + cent); txt.evas::object::position_set(x + 8 + ICON_SIZE + 8, y + cent);
y += ICON_SIZE; y += ICON_SIZE;
++it1; ++it2; ++it3;
} }
FPS_STD(NAME); FPS_STD(NAME);
} }

View File

@ -22,10 +22,10 @@ static int done = 0;
#define ICON_SIZE 64 #define ICON_SIZE 64
static efl::eina::list<evas::image> images; static efl::eina::list<evas::image> images;
static evas::image *icons[NUM]; // XXX static efl::eina::array<evas::image> icons;
static efl::eina::list<evas::text> texts; static efl::eina::list<evas::text> texts;
static const char *_icons[] = static const char* _icons[] =
{ {
"bug.png", "bug.png",
"bulb.png", "bulb.png",
@ -95,13 +95,13 @@ static void _setup(void)
o1.evas::object::size_set(win_w, ICON_SIZE); o1.evas::object::size_set(win_w, ICON_SIZE);
o1.visibility_set(true); o1.visibility_set(true);
evas::image *o2 = new evas::image(efl::eo::parent = canvas); evas::image o2(efl::eo::parent = canvas);
icons[i] = o2; icons.push_back(o2);
o2->filled_set(1); o2.filled_set(1);
o2->border_set(2, 2, 2, 2); o2.border_set(2, 2, 2, 2);
eo_do(o2->_eo_ptr(), efl_file_set(build_path(_icons[i % 13]), NULL)); // XXX eo_do(o2._eo_ptr(), efl_file_set(build_path(_icons[i % 13]), NULL)); // XXX
o2->evas::object::size_set(ICON_SIZE - 8, ICON_SIZE - 8); o2.evas::object::size_set(ICON_SIZE - 8, ICON_SIZE - 8);
o2->visibility_set(true); o2.visibility_set(true);
evas::text o3(efl::eo::parent = canvas); evas::text o3(efl::eo::parent = canvas);
texts.push_back(o3); texts.push_back(o3);
@ -114,14 +114,14 @@ static void _setup(void)
{ {
img.raise(); img.raise();
} }
for (int i = 0; i < NUM; i++) // XXX for (int i = 0; i < NUM; i++)
{ {
icons[i]->raise(); icons[i].raise();
} }
for (int i = 0; i < NUM; i++) // XXX for (int i = 0; i < NUM; i++)
{ {
if (i > 13) if (i > 13)
icons[i]->stack_above(*icons[i - 13]); icons[i].stack_above(icons[i - 13]);
} }
for (evas::text& text : texts) for (evas::text& text : texts)
{ {
@ -137,12 +137,12 @@ static void _cleanup(void)
i.parent_set(efl::eo::base(nullptr)); i.parent_set(efl::eo::base(nullptr));
images.clear(); images.clear();
for (int i = 0; i < NUM; ++i) // XXX for (evas::image& i : icons)
{ {
icons[i]->parent_set(efl::eo::base(nullptr)); i.visibility_set(false); // XXX
icons[i]->_reset(nullptr); i.parent_set(efl::eo::base(nullptr));
delete icons[i];
} }
icons.clear();
for (evas::text& t : texts) for (evas::text& t : texts)
t.parent_set(efl::eo::base(nullptr)); t.parent_set(efl::eo::base(nullptr));
@ -155,22 +155,16 @@ static void _loop(double t, int f)
Evas_Coord x, y, tw, th, cent; Evas_Coord x, y, tw, th, cent;
x = 0; x = 0;
y = 0 - f; y = 0 - f;
efl::eina::list<evas::image>::iterator efl::eina::list<evas::image>::iterator img = images.begin();
it1 = images.begin(), efl::eina::array<evas::image>::iterator ico = icons.begin();
end1 = images.end(); for (evas::text& txt : texts)
efl::eina::list<evas::text>::iterator {
it3 = texts.begin(), (*img++).evas::object::position_set(x, y);
end3 = texts.end(); (*ico++).evas::object::position_set(x + 4, y + 4);
int i2 = 0; txt.evas::object::size_get(&tw, &th);
while(it1 != end1 && i2 != NUM && it3 != end3)
{
(*it1).evas::object::position_set(x, y);
icons[i2]->evas::object::position_set(x + 4, y + 4);
(*it3).evas::object::size_get(&tw, &th);
cent = (ICON_SIZE - th) / 2; cent = (ICON_SIZE - th) / 2;
(*it3).evas::object::position_set(x + 8 + ICON_SIZE + 8, y + cent); txt.evas::object::position_set(x + 8 + ICON_SIZE + 8, y + cent);
y += ICON_SIZE; y += ICON_SIZE;
++it1; ++i2; ++it3;
} }
FPS_STD(NAME); FPS_STD(NAME);
} }

View File

@ -135,24 +135,16 @@ static void _loop(double t, int f)
Evas_Coord x, y, tw, th, cent; Evas_Coord x, y, tw, th, cent;
x = 0; x = 0;
y = 0 - f; y = 0 - f;
efl::eina::list<evas::image>::iterator efl::eina::list<evas::image>::iterator img = images.begin();
it1 = images.begin(), efl::eina::list<evas::image>::iterator ico = icons.begin();
end1 = images.end(); for (evas::text& txt : texts)
efl::eina::list<evas::image>::iterator
it2 = icons.begin(),
end2 = icons.end();
efl::eina::list<evas::text>::iterator
it3 = texts.begin(),
end3 = texts.end();
while(it1 != end1 && it2 != end2 && it3 != end3)
{ {
(*it1).evas::object::position_set(x, y); (*img++).evas::object::position_set(x, y);
(*it2).evas::object::position_set(x + 4, y + 4); (*ico++).evas::object::position_set(x + 4, y + 4);
(*it3).evas::object::size_get(&tw, &th); txt.evas::object::size_get(&tw, &th);
cent = (ICON_SIZE - th) / 2; cent = (ICON_SIZE - th) / 2;
(*it3).evas::object::position_set(x + 8 + ICON_SIZE + 8, y + cent); txt.evas::object::position_set(x + 8 + ICON_SIZE + 8, y + cent);
y += ICON_SIZE; y += ICON_SIZE;
++it1; ++it2; ++it3;
} }
FPS_STD(NAME); FPS_STD(NAME);
} }

View File

@ -21,7 +21,7 @@ static int done = 0;
#define NUM 512 #define NUM 512
#define ICON_SIZE 32 #define ICON_SIZE 32
static efl::eina::list<evas::image> images; static efl::eina::list<evas::image> images;
static evas::image *icons[NUM]; // XXX static efl::eina::array<evas::image> icons;
static efl::eina::list<evas::text> texts; static efl::eina::list<evas::text> texts;
static const char *_icons[] = static const char *_icons[] =
@ -94,13 +94,13 @@ static void _setup(void)
o1.evas::object::size_set(win_w, ICON_SIZE); o1.evas::object::size_set(win_w, ICON_SIZE);
o1.visibility_set(true); o1.visibility_set(true);
evas::image *o2 = new evas::image(efl::eo::parent = canvas); evas::image o2(efl::eo::parent = canvas);
icons[i] = o2; icons.push_back(o2);
o2->filled_set(1); o2.filled_set(1);
o2->border_set(2, 2, 2, 2); o2.border_set(2, 2, 2, 2);
eo_do(o2->_eo_ptr(), efl_file_set(build_path(_icons[i % 13]), NULL)); // XXX eo_do(o2._eo_ptr(), efl_file_set(build_path(_icons[i % 13]), NULL)); // XXX
o2->evas::object::size_set(ICON_SIZE - 8, ICON_SIZE - 8); o2.evas::object::size_set(ICON_SIZE - 8, ICON_SIZE - 8);
o2->visibility_set(true); o2.visibility_set(true);
evas::text o3(efl::eo::parent = canvas); evas::text o3(efl::eo::parent = canvas);
texts.push_back(o3); texts.push_back(o3);
@ -114,14 +114,16 @@ static void _setup(void)
{ {
img.raise(); img.raise();
} }
for (int i = 0; i < NUM; i++) // XXX for (evas::image& ico : icons)
{ {
icons[i]->raise(); ico.raise();
} }
for (int i = 0; i < NUM; i++) // XXX for (int i = 0; i < NUM; i++)
{ {
if (i > 13) if (i > 13)
icons[i]->stack_above(*icons[i - 13]); {
icons[i].stack_above(icons[i - 13]);
}
} }
for (evas::text& text : texts) for (evas::text& text : texts)
{ {
@ -136,12 +138,12 @@ static void _cleanup()
i.parent_set(efl::eo::base(nullptr)); i.parent_set(efl::eo::base(nullptr));
images.clear(); images.clear();
for (int i = 0; i < NUM; i++) // XXX for (evas::image& i : icons)
{ {
icons[i]->parent_set(efl::eo::base(nullptr)); i.visibility_set(false); // XXX
icons[i]->_reset(nullptr); i.parent_set(efl::eo::base(nullptr));
delete icons[i];
} }
icons.clear();
for (evas::text& t : texts) for (evas::text& t : texts)
t.parent_set(efl::eo::base(nullptr)); t.parent_set(efl::eo::base(nullptr));
@ -154,22 +156,16 @@ static void _loop(double t, int f)
Evas_Coord x, y, tw, th, cent; Evas_Coord x, y, tw, th, cent;
x = 0; x = 0;
y = 0 - f; y = 0 - f;
efl::eina::list<evas::image>::iterator efl::eina::list<evas::image>::iterator img = images.begin();
it1 = images.begin(), efl::eina::array<evas::image>::iterator ico = icons.begin();
end1 = images.end(); for (evas::text& txt : texts)
efl::eina::list<evas::text>::iterator
it3 = texts.begin(),
end3 = texts.end();
int i2 = 0;
while(it1 != end1 && i2 != NUM && it3 != end3)
{ {
(*it1).evas::object::position_set(x, y); (*img++).evas::object::position_set(x, y);
icons[i2]->evas::object::position_set(x + 4, y + 4); (*ico++).evas::object::position_set(x + 4, y + 4);
(*it3).evas::object::size_get(&tw, &th); txt.evas::object::size_get(&tw, &th);
cent = (ICON_SIZE - th) / 2; cent = (ICON_SIZE - th) / 2;
(*it3).evas::object::position_set(x + 8 + ICON_SIZE + 8, y + cent); txt.evas::object::position_set(x + 8 + ICON_SIZE + 8, y + cent);
y += ICON_SIZE; y += ICON_SIZE;
++it1; ++i2; ++it3;
} }
FPS_STD(NAME); FPS_STD(NAME);
} }