expedite-cxx: Added remaining tests.
This commit is contained in:
parent
2360632b37
commit
3434b132b8
|
@ -30,7 +30,7 @@ static void _setup(void)
|
|||
images.push_back(o);
|
||||
eo_do(o._eo_ptr(), efl_file_set(build_path("image.png"), NULL)); // XXX
|
||||
o.smooth_scale_set(0);
|
||||
o.visibility_set(EINA_TRUE);
|
||||
o.visibility_set(true);
|
||||
}
|
||||
done = 0;
|
||||
}
|
||||
|
@ -38,8 +38,8 @@ static void _setup(void)
|
|||
/* cleanup */
|
||||
static void _cleanup()
|
||||
{
|
||||
for (evas::image& i : images)
|
||||
i.parent_set(efl::eo::base(nullptr));
|
||||
for (evas::image& img : images)
|
||||
img.parent_set(efl::eo::base(nullptr));
|
||||
images.clear();
|
||||
}
|
||||
|
||||
|
|
|
@ -37,9 +37,9 @@ static void _setup(void)
|
|||
o.fill_set(0, 0, 640, 480);
|
||||
o.evas::object::size_set(640, 480);
|
||||
o.visibility_set(true);
|
||||
yp = static_cast<unsigned char*>(malloc(640 * 480));
|
||||
up = static_cast<unsigned char*>(malloc(320 * 240));
|
||||
vp = static_cast<unsigned char*>(malloc(320 * 240));
|
||||
yp = new unsigned char[640 * 480];
|
||||
up = new unsigned char[320 * 240];
|
||||
vp = new unsigned char[320 * 240];
|
||||
FILE *f = fopen(build_path("tp.yuv"), "rb");
|
||||
if (f)
|
||||
{
|
||||
|
@ -76,9 +76,10 @@ static void _cleanup(void)
|
|||
for (evas::image& i : images)
|
||||
i.parent_set(efl::eo::base(nullptr));
|
||||
images.clear();
|
||||
free(yp);
|
||||
free(up);
|
||||
free(vp);
|
||||
|
||||
delete yp;
|
||||
delete up;
|
||||
delete vp;
|
||||
}
|
||||
|
||||
/* loop - do things */
|
||||
|
|
|
@ -38,9 +38,9 @@ static void _setup(void)
|
|||
o.evas::object::size_set(640, 480);
|
||||
o.smooth_scale_set(0);
|
||||
o.visibility_set(true);
|
||||
yp = static_cast<unsigned char*>(malloc(640 * 480));
|
||||
up = static_cast<unsigned char*>(malloc(320 * 240));
|
||||
vp = static_cast<unsigned char*>(malloc(320 * 240));
|
||||
yp = new unsigned char[640 * 480];
|
||||
up = new unsigned char[320 * 240];
|
||||
vp = new unsigned char[320 * 240];
|
||||
FILE *f = fopen(build_path("tp.yuv"), "rb");
|
||||
if (f)
|
||||
{
|
||||
|
@ -77,9 +77,10 @@ static void _cleanup(void)
|
|||
for (evas::image& i : images)
|
||||
i.parent_set(efl::eo::base(nullptr));
|
||||
images.clear();
|
||||
free(yp);
|
||||
free(up);
|
||||
free(vp);
|
||||
|
||||
delete yp;
|
||||
delete up;
|
||||
delete vp;
|
||||
}
|
||||
|
||||
/* loop - do things */
|
||||
|
|
|
@ -37,9 +37,9 @@ static void _setup(void)
|
|||
o.fill_set(0, 0, 640, 480);
|
||||
o.evas::object::size_set(640, 480);
|
||||
o.evas::object::visibility_set(true);
|
||||
yp = static_cast<unsigned char*>(malloc(640 * 480));
|
||||
up = static_cast<unsigned char*>(malloc(320 * 240));
|
||||
vp = static_cast<unsigned char*>(malloc(320 * 240));
|
||||
yp = new unsigned char[640 * 480];
|
||||
up = new unsigned char[320 * 240];
|
||||
vp = new unsigned char[320 * 240];
|
||||
FILE *f = fopen(build_path("tp.yuv"), "rb");
|
||||
if (f)
|
||||
{
|
||||
|
@ -76,9 +76,10 @@ static void _cleanup(void)
|
|||
for (evas::image& i : images)
|
||||
i.parent_set(efl::eo::base(nullptr));
|
||||
images.clear();
|
||||
free(yp);
|
||||
free(up);
|
||||
free(vp);
|
||||
|
||||
delete yp;
|
||||
delete up;
|
||||
delete vp;
|
||||
}
|
||||
|
||||
/* loop - do things */
|
||||
|
|
|
@ -37,9 +37,9 @@ static void _setup(void)
|
|||
o.fill_set(0, 0, 640, 480);
|
||||
o.evas::object::size_set(640, 480);
|
||||
o.evas::object::visibility_set(true);
|
||||
yp = static_cast<unsigned char*>(malloc(640 * 480));
|
||||
up = static_cast<unsigned char*>(malloc(320 * 240));
|
||||
vp = static_cast<unsigned char*>(malloc(320 * 240));
|
||||
yp = new unsigned char[640 * 480];
|
||||
up = new unsigned char[320 * 240];
|
||||
vp = new unsigned char[320 * 240];
|
||||
FILE *f = fopen(build_path("tp.yuv"), "rb");
|
||||
if (f)
|
||||
{
|
||||
|
@ -80,9 +80,10 @@ static void _cleanup(void)
|
|||
for (evas::image& i : images)
|
||||
i.parent_set(efl::eo::base(nullptr));
|
||||
images.clear();
|
||||
free(yp);
|
||||
free(up);
|
||||
free(vp);
|
||||
|
||||
delete yp;
|
||||
delete up;
|
||||
delete vp;
|
||||
}
|
||||
|
||||
/* loop - do things */
|
||||
|
|
|
@ -22,7 +22,7 @@ typedef struct _Point
|
|||
|
||||
typedef struct _Side
|
||||
{
|
||||
evas::image o;
|
||||
evas::image *o;
|
||||
Point pt[4];
|
||||
} Side;
|
||||
|
||||
|
@ -48,22 +48,20 @@ static Cube *
|
|||
_cube_new(Evas_Coord w, Evas_Coord h, Evas_Coord d)
|
||||
{
|
||||
evas::canvas canvas(::eo_ref(G_evas));
|
||||
Cube *c;
|
||||
|
||||
w -= (w / 2);
|
||||
h -= (h / 2);
|
||||
d -= (d / 2);
|
||||
c = static_cast<Cube*>(calloc(1, sizeof(Cube)));
|
||||
Cube *c = new Cube {};
|
||||
for (int i = 0; i < 6; i++)
|
||||
{
|
||||
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);
|
||||
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.evas::object::size_set(256, 256);
|
||||
c->side[i].o.smooth_scale_set(0);
|
||||
c->side[i].o.visibility_set(true);
|
||||
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->evas::object::size_set(256, 256);
|
||||
c->side[i].o->smooth_scale_set(0);
|
||||
c->side[i].o->visibility_set(true);
|
||||
}
|
||||
POINT(0, 0, -w, -h, -d, 0, 0);
|
||||
POINT(0, 1, w, -h, -d, 256, 0);
|
||||
|
@ -107,8 +105,8 @@ _cube_pos(Cube *c,
|
|||
int i, j, order[6], sorted;
|
||||
Evas_Coord mz[6];
|
||||
|
||||
if (!m) m = evas_map_new(4);
|
||||
evas_map_smooth_set(m, 0);
|
||||
if (!m) m = ::evas_map_new(4);
|
||||
::evas_map_smooth_set(m, 0);
|
||||
|
||||
for (i = 0; i < 6; i++)
|
||||
{
|
||||
|
@ -116,34 +114,34 @@ _cube_pos(Cube *c,
|
|||
|
||||
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].y + y,
|
||||
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].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_lighting(m, -1000, -1000, -1000,
|
||||
::evas_map_util_3d_rotate(m, dx, dy, dz, x, y, z);
|
||||
::evas_map_util_3d_lighting(m, -1000, -1000, -1000,
|
||||
255, 255, 255,
|
||||
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))
|
||||
{
|
||||
c->side[i].o.map_enable_set(1);
|
||||
c->side[i].o.map_set(m);
|
||||
c->side[i].o.visibility_set(true);
|
||||
c->side[i].o->map_enable_set(1);
|
||||
c->side[i].o->map_set(m);
|
||||
c->side[i].o->visibility_set(true);
|
||||
}
|
||||
else
|
||||
{
|
||||
c->side[i].o.visibility_set(false);
|
||||
c->side[i].o->visibility_set(false);
|
||||
}
|
||||
|
||||
order[i] = i;
|
||||
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;
|
||||
}
|
||||
sorted = 0;
|
||||
|
@ -163,9 +161,9 @@ _cube_pos(Cube *c,
|
|||
}
|
||||
while (!sorted);
|
||||
|
||||
c->side[order[0]].o.evas::object::raise();
|
||||
c->side[order[0]].o->evas::object::raise();
|
||||
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
|
||||
|
@ -173,11 +171,11 @@ _cube_free(Cube *c)
|
|||
{
|
||||
for (int i = 0; i < 6; i++)
|
||||
{
|
||||
c->side[i].o.visibility_set(false); // XXX
|
||||
c->side[i].o.parent_set(efl::eo::base(nullptr));
|
||||
::eo_unref(c->side[i].o._release());
|
||||
c->side[i].o->visibility_set(false); // XXX
|
||||
c->side[i].o->parent_set(efl::eo::base(nullptr));
|
||||
delete c->side[i].o;
|
||||
}
|
||||
free(c);
|
||||
delete c;
|
||||
}
|
||||
|
||||
/* setup */
|
||||
|
|
|
@ -22,7 +22,7 @@ typedef struct _Point
|
|||
|
||||
typedef struct _Side
|
||||
{
|
||||
evas::image o;
|
||||
evas::image *o;
|
||||
Point pt[4];
|
||||
} Side;
|
||||
|
||||
|
@ -48,20 +48,19 @@ static Cube *
|
|||
_cube_new(Evas_Coord w, Evas_Coord h, Evas_Coord d)
|
||||
{
|
||||
evas::canvas canvas(::eo_ref(G_evas));
|
||||
Cube *c;
|
||||
w -= (w / 2);
|
||||
h -= (h / 2);
|
||||
d -= (d / 2);
|
||||
c = static_cast<Cube*>(calloc(1, sizeof(Cube)));
|
||||
Cube *c = new Cube {};
|
||||
for (int i = 0; i < 6; i++)
|
||||
{
|
||||
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);
|
||||
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.evas::object::size_set(256, 256);
|
||||
c->side[i].o.visibility_set(true);
|
||||
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->evas::object::size_set(256, 256);
|
||||
c->side[i].o->evas::object::visibility_set(true);
|
||||
}
|
||||
POINT(0, 0, -w, -h, -d, 0, 0);
|
||||
POINT(0, 1, w, -h, -d, 256, 0);
|
||||
|
@ -113,34 +112,34 @@ _cube_pos(Cube *c,
|
|||
|
||||
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].y + y,
|
||||
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].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_lighting(m, -1000, -1000, -1000,
|
||||
::evas_map_util_3d_rotate(m, dx, dy, dz, x, y, z);
|
||||
::evas_map_util_3d_lighting(m, -1000, -1000, -1000,
|
||||
255, 255, 255,
|
||||
20, 20, 20);
|
||||
evas_map_util_3d_perspective(m, (win_w / 2), (win_h / 2), 0, 512);
|
||||
if (evas_map_util_clockwise_get(m))
|
||||
::evas_map_util_3d_perspective(m, (win_w / 2), (win_h / 2), 0, 512);
|
||||
if (::evas_map_util_clockwise_get(m))
|
||||
{
|
||||
c->side[i].o.map_enable_set(1);
|
||||
c->side[i].o.map_set(m);
|
||||
c->side[i].o.visibility_set(true);
|
||||
c->side[i].o->map_enable_set(1);
|
||||
c->side[i].o->map_set(m);
|
||||
c->side[i].o->visibility_set(true);
|
||||
}
|
||||
else
|
||||
{
|
||||
c->side[i].o.visibility_set(false);
|
||||
c->side[i].o->visibility_set(false);
|
||||
}
|
||||
|
||||
order[i] = i;
|
||||
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;
|
||||
}
|
||||
sorted = 0;
|
||||
|
@ -160,9 +159,9 @@ _cube_pos(Cube *c,
|
|||
}
|
||||
while (!sorted);
|
||||
|
||||
c->side[order[0]].o.raise();
|
||||
c->side[order[0]].o->raise();
|
||||
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
|
||||
|
@ -170,11 +169,11 @@ _cube_free(Cube *c)
|
|||
{
|
||||
for (int i = 0; i < 6; i++)
|
||||
{
|
||||
c->side[i].o.visibility_set(false); // XXX
|
||||
c->side[i].o.parent_set(efl::eo::base(nullptr));
|
||||
::eo_unref(c->side[i].o._release());
|
||||
c->side[i].o->visibility_set(false); // XXX
|
||||
c->side[i].o->parent_set(efl::eo::base(nullptr));
|
||||
delete c->side[i].o;
|
||||
}
|
||||
free(c);
|
||||
delete c;
|
||||
}
|
||||
|
||||
/* setup */
|
||||
|
|
|
@ -22,7 +22,7 @@ typedef struct _Point
|
|||
|
||||
typedef struct _Side
|
||||
{
|
||||
evas::image o;
|
||||
evas::image *o;
|
||||
Point pt[4];
|
||||
} Side;
|
||||
|
||||
|
@ -53,17 +53,17 @@ _cube_new(Evas_Coord w, Evas_Coord h, Evas_Coord d)
|
|||
w -= (w / 2);
|
||||
h -= (h / 2);
|
||||
d -= (d / 2);
|
||||
c = static_cast<Cube*>(calloc(1, sizeof(Cube)));
|
||||
c = new Cube {};
|
||||
for (int i = 0; i < 6; i++)
|
||||
{
|
||||
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);
|
||||
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.evas::object::size_set(256, 256);
|
||||
c->side[i].o.smooth_scale_set(0);
|
||||
c->side[i].o.visibility_set(true);
|
||||
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->evas::object::size_set(256, 256);
|
||||
c->side[i].o->smooth_scale_set(0);
|
||||
c->side[i].o->visibility_set(true);
|
||||
}
|
||||
POINT(0, 0, -w, -h, -d, 0, 0);
|
||||
POINT(0, 1, w, -h, -d, 256, 0);
|
||||
|
@ -108,7 +108,7 @@ _cube_pos(Cube *c,
|
|||
Evas_Coord mz[6];
|
||||
|
||||
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++)
|
||||
{
|
||||
|
@ -116,26 +116,26 @@ _cube_pos(Cube *c,
|
|||
|
||||
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].y + y,
|
||||
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].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_lighting(m, -1000, -1000, -1000,
|
||||
::evas_map_util_3d_rotate(m, dx, dy, dz, x, y, z);
|
||||
::evas_map_util_3d_lighting(m, -1000, -1000, -1000,
|
||||
255, 255, 255,
|
||||
20, 20, 20);
|
||||
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_set(m);
|
||||
::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_set(m);
|
||||
|
||||
order[i] = i;
|
||||
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;
|
||||
}
|
||||
sorted = 0;
|
||||
|
@ -155,9 +155,9 @@ _cube_pos(Cube *c,
|
|||
}
|
||||
while (!sorted);
|
||||
|
||||
c->side[order[0]].o.raise();
|
||||
c->side[order[0]].o->raise();
|
||||
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
|
||||
|
@ -165,11 +165,11 @@ _cube_free(Cube *c)
|
|||
{
|
||||
for (int i = 0; i < 6; i++)
|
||||
{
|
||||
c->side[i].o.visibility_set(false); // XXX
|
||||
c->side[i].o.parent_set(efl::eo::base(nullptr));
|
||||
::eo_unref(c->side[i].o._release());
|
||||
c->side[i].o->visibility_set(false); // XXX
|
||||
c->side[i].o->parent_set(efl::eo::base(nullptr));
|
||||
delete c->side[i].o;
|
||||
}
|
||||
free(c);
|
||||
delete c;
|
||||
}
|
||||
|
||||
/* setup */
|
||||
|
|
|
@ -21,7 +21,7 @@ typedef struct _Point
|
|||
|
||||
typedef struct _Side
|
||||
{
|
||||
evas::image o;
|
||||
evas::image *o;
|
||||
Point pt[4];
|
||||
} Side;
|
||||
|
||||
|
@ -47,21 +47,19 @@ static Cube *
|
|||
_cube_new(Evas_Coord w, Evas_Coord h, Evas_Coord d)
|
||||
{
|
||||
evas::canvas canvas(::eo_ref(G_evas));
|
||||
Cube *c;
|
||||
|
||||
w -= (w / 2);
|
||||
h -= (h / 2);
|
||||
d -= (d / 2);
|
||||
c = static_cast<Cube*>(calloc(1, sizeof(Cube)));
|
||||
Cube *c = new Cube {};
|
||||
for (int i = 0; i < 6; i++)
|
||||
{
|
||||
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);
|
||||
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.evas::object::size_set(256, 256);
|
||||
c->side[i].o.visibility_set(true);
|
||||
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->evas::object::size_set(256, 256);
|
||||
c->side[i].o->visibility_set(true);
|
||||
}
|
||||
POINT(0, 0, -w, -h, -d, 0, 0);
|
||||
POINT(0, 1, w, -h, -d, 256, 0);
|
||||
|
@ -127,8 +125,8 @@ _cube_pos(Cube *c,
|
|||
255, 255, 255,
|
||||
20, 20, 20);
|
||||
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_set(m);
|
||||
c->side[i].o->map_enable_set(1);
|
||||
c->side[i].o->map_set(m);
|
||||
|
||||
order[i] = i;
|
||||
for (j = 0; j < 4; j++)
|
||||
|
@ -152,9 +150,9 @@ _cube_pos(Cube *c,
|
|||
}
|
||||
while (!sorted);
|
||||
|
||||
c->side[order[0]].o.raise();
|
||||
c->side[order[0]].o->raise();
|
||||
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
|
||||
|
@ -162,11 +160,11 @@ _cube_free(Cube *c)
|
|||
{
|
||||
for (int i = 0; i < 6; i++)
|
||||
{
|
||||
c->side[i].o.visibility_set(false); // XXX
|
||||
c->side[i].o.parent_set(efl::eo::base(nullptr));
|
||||
::eo_unref(c->side[i].o._release());
|
||||
c->side[i].o->visibility_set(false); // XXX
|
||||
c->side[i].o->parent_set(efl::eo::base(nullptr));
|
||||
delete c->side[i].o;
|
||||
}
|
||||
free(c);
|
||||
delete c;
|
||||
}
|
||||
|
||||
/* setup */
|
||||
|
|
|
@ -22,7 +22,7 @@ typedef struct _Point
|
|||
|
||||
typedef struct _Side
|
||||
{
|
||||
evas::image o;
|
||||
evas::image *o;
|
||||
Point pt[4];
|
||||
} Side;
|
||||
|
||||
|
@ -48,22 +48,20 @@ static Cube *
|
|||
_cube_new(Evas_Coord w, Evas_Coord h, Evas_Coord d)
|
||||
{
|
||||
evas::canvas canvas(::eo_ref(G_evas));
|
||||
Cube *c;
|
||||
|
||||
w -= (w / 2);
|
||||
h -= (h / 2);
|
||||
d -= (d / 2);
|
||||
c = static_cast<Cube*>(calloc(1, sizeof(Cube)));
|
||||
Cube *c = new Cube {};
|
||||
for (int i = 0; i < 6; i++)
|
||||
{
|
||||
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);
|
||||
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.evas::object::size_set(720, 420);
|
||||
c->side[i].o.smooth_scale_set(0);
|
||||
c->side[i].o.visibility_set(true);
|
||||
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->evas::object::size_set(720, 420);
|
||||
c->side[i].o->smooth_scale_set(0);
|
||||
c->side[i].o->visibility_set(true);
|
||||
}
|
||||
POINT(0, 0, -w, -h, -d, 0, 0);
|
||||
POINT(0, 1, w, -h, -d, 720, 0);
|
||||
|
@ -107,8 +105,8 @@ _cube_pos(Cube *c,
|
|||
int i, j, order[6], sorted;
|
||||
Evas_Coord mz[6];
|
||||
|
||||
if (!m) m = evas_map_new(4);
|
||||
evas_map_smooth_set(m, 0);
|
||||
if (!m) m = ::evas_map_new(4);
|
||||
::evas_map_smooth_set(m, 0);
|
||||
|
||||
for (i = 0; i < 6; i++)
|
||||
{
|
||||
|
@ -116,34 +114,34 @@ _cube_pos(Cube *c,
|
|||
|
||||
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].y + y,
|
||||
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].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_lighting(m, -1000, win_h / 2, -1000,
|
||||
::evas_map_util_3d_rotate(m, dx, dy, dz, x, y, z);
|
||||
::evas_map_util_3d_lighting(m, -1000, win_h / 2, -1000,
|
||||
255, 255, 255,
|
||||
20, 20, 20);
|
||||
evas_map_util_3d_perspective(m, (win_w / 2), (win_h / 2), -360, 720);
|
||||
if (evas_map_util_clockwise_get(m))
|
||||
::evas_map_util_3d_perspective(m, (win_w / 2), (win_h / 2), -360, 720);
|
||||
if (::evas_map_util_clockwise_get(m))
|
||||
{
|
||||
c->side[i].o.map_enable_set(1);
|
||||
c->side[i].o.map_set(m);
|
||||
c->side[i].o.visibility_set(true);
|
||||
c->side[i].o->map_enable_set(1);
|
||||
c->side[i].o->map_set(m);
|
||||
c->side[i].o->visibility_set(true);
|
||||
}
|
||||
else
|
||||
{
|
||||
c->side[i].o.visibility_set(false);
|
||||
c->side[i].o->visibility_set(false);
|
||||
}
|
||||
|
||||
order[i] = i;
|
||||
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;
|
||||
}
|
||||
sorted = 0;
|
||||
|
@ -163,9 +161,9 @@ _cube_pos(Cube *c,
|
|||
}
|
||||
while (!sorted);
|
||||
|
||||
c->side[order[0]].o.raise();
|
||||
c->side[order[0]].o->raise();
|
||||
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
|
||||
|
@ -173,11 +171,11 @@ _cube_free(Cube *c)
|
|||
{
|
||||
for (int i = 0; i < 6; i++)
|
||||
{
|
||||
c->side[i].o.visibility_set(false); // XXX
|
||||
c->side[i].o.parent_set(efl::eo::base(nullptr));
|
||||
::eo_unref(c->side[i].o._release());
|
||||
c->side[i].o->visibility_set(false); // XXX
|
||||
c->side[i].o->parent_set(efl::eo::base(nullptr));
|
||||
delete c->side[i].o;
|
||||
}
|
||||
free(c);
|
||||
delete c;
|
||||
}
|
||||
|
||||
/* setup */
|
||||
|
|
|
@ -22,7 +22,7 @@ typedef struct _Point
|
|||
|
||||
typedef struct _Side
|
||||
{
|
||||
evas::image o;
|
||||
evas::image *o;
|
||||
Point pt[4];
|
||||
} Side;
|
||||
|
||||
|
@ -48,22 +48,20 @@ static Cube *
|
|||
_cube_new(Evas_Coord w, Evas_Coord h, Evas_Coord d)
|
||||
{
|
||||
evas::canvas canvas(::eo_ref(G_evas));
|
||||
Cube *c;
|
||||
|
||||
w -= (w / 2);
|
||||
h -= (h / 2);
|
||||
d -= (d / 2);
|
||||
c = static_cast<Cube*>(calloc(1, sizeof(Cube)));
|
||||
Cube *c = new Cube {};
|
||||
for (int i = 0; i < 6; i++)
|
||||
{
|
||||
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);
|
||||
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.evas::object::size_set(720, 420);
|
||||
c->side[i].o.smooth_scale_set(0);
|
||||
c->side[i].o.visibility_set(true);
|
||||
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->evas::object::size_set(720, 420);
|
||||
c->side[i].o->smooth_scale_set(0);
|
||||
c->side[i].o->visibility_set(true);
|
||||
}
|
||||
POINT(0, 0, -w, -h, -d, 0, 0);
|
||||
POINT(0, 1, w, -h, -d, 720, 0);
|
||||
|
@ -107,8 +105,8 @@ _cube_pos(Cube *c,
|
|||
int i, j, order[6], sorted;
|
||||
Evas_Coord mz[6];
|
||||
|
||||
if (!m) m = evas_map_new(4);
|
||||
evas_map_smooth_set(m, 0);
|
||||
if (!m) m = ::evas_map_new(4);
|
||||
::evas_map_smooth_set(m, 0);
|
||||
|
||||
for (i = 0; i < 6; i++)
|
||||
{
|
||||
|
@ -116,31 +114,31 @@ _cube_pos(Cube *c,
|
|||
|
||||
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].y + y,
|
||||
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].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_perspective(m, (win_w / 2), (win_h / 2), -360, 720);
|
||||
if (evas_map_util_clockwise_get(m))
|
||||
::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);
|
||||
if (::evas_map_util_clockwise_get(m))
|
||||
{
|
||||
c->side[i].o.map_enable_set(1);
|
||||
c->side[i].o.map_set(m);
|
||||
c->side[i].o.visibility_set(true);
|
||||
c->side[i].o->map_enable_set(1);
|
||||
c->side[i].o->map_set(m);
|
||||
c->side[i].o->visibility_set(true);
|
||||
}
|
||||
else
|
||||
{
|
||||
c->side[i].o.visibility_set(false);
|
||||
c->side[i].o->visibility_set(false);
|
||||
}
|
||||
|
||||
order[i] = i;
|
||||
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;
|
||||
}
|
||||
sorted = 0;
|
||||
|
@ -160,9 +158,9 @@ _cube_pos(Cube *c,
|
|||
}
|
||||
while (!sorted);
|
||||
|
||||
c->side[order[0]].o.raise();
|
||||
c->side[order[0]].o->raise();
|
||||
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
|
||||
|
@ -170,11 +168,11 @@ _cube_free(Cube *c)
|
|||
{
|
||||
for (int i = 0; i < 6; i++)
|
||||
{
|
||||
c->side[i].o.visibility_set(false); // XXX
|
||||
c->side[i].o.parent_set(efl::eo::base(nullptr));
|
||||
::eo_unref(c->side[i].o._release());
|
||||
c->side[i].o->visibility_set(false); // XXX
|
||||
c->side[i].o->parent_set(efl::eo::base(nullptr));
|
||||
delete c->side[i].o;
|
||||
}
|
||||
free(c);
|
||||
delete c;
|
||||
}
|
||||
|
||||
/* setup */
|
||||
|
|
|
@ -32,7 +32,7 @@ static void _setup(void)
|
|||
eo_do(o._eo_ptr(), efl_file_set(build_path("image.png"), NULL)); // XXX
|
||||
o.fill_set(0, 0, 120, 160);
|
||||
o.evas::object::size_set(120, 160);
|
||||
o.evas::object::visibility_set(EINA_TRUE);
|
||||
o.evas::object::visibility_set(true);
|
||||
}
|
||||
done = 0;
|
||||
}
|
||||
|
@ -40,8 +40,8 @@ static void _setup(void)
|
|||
/* cleanup */
|
||||
static void _cleanup(void)
|
||||
{
|
||||
for (evas::image& i : images)
|
||||
i.parent_set(efl::eo::base(nullptr));
|
||||
for (evas::image& img : images)
|
||||
img.parent_set(efl::eo::base(nullptr));
|
||||
images.clear();
|
||||
}
|
||||
|
||||
|
|
|
@ -25,13 +25,11 @@ static void _setup(void)
|
|||
{
|
||||
evas::canvas canvas(::eo_ref(G_evas));
|
||||
evas::image o(efl::eo::parent = canvas);
|
||||
|
||||
eo_do(o._eo_ptr(), efl_file_set(build_path("logo.png"), NULL)); // XXX
|
||||
o.fill_set(0, 0, 120, 160);
|
||||
o.evas::object::size_set(120, 160);
|
||||
o.evas::object::position_set(-400, -300);
|
||||
evas::image src = o;
|
||||
|
||||
for (int i = 0; i < OBNUM / 2; i++)
|
||||
{
|
||||
evas::image o(efl::eo::parent = canvas);
|
||||
|
|
|
@ -19,52 +19,42 @@
|
|||
static int done = 0;
|
||||
|
||||
/* private data */
|
||||
static evas::object *texts[OBNUM];
|
||||
|
||||
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++);
|
||||
}
|
||||
static efl::eina::array<evas::object> texts;
|
||||
|
||||
/* setup */
|
||||
static void _setup(void)
|
||||
{
|
||||
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)
|
||||
{
|
||||
evas::text* o = new evas::text(efl::eo::parent = canvas);
|
||||
o->font_set("Vera-Bold", 20);
|
||||
o->text_set("This is a test string");
|
||||
o->style_set(st);
|
||||
o->evas::object::color_set(255, 255, 255, 255);
|
||||
o->shadow_color_set(0, 0, 0, 24);
|
||||
o->glow_color_set(100, 80, 40, 100);
|
||||
o->glow2_color_set(50, 10, 5, 50);
|
||||
o->outline_color_set(0, 0, 0, 255);
|
||||
o->visibility_set(true);
|
||||
texts[i] = o;
|
||||
++st;
|
||||
evas::text o(efl::eo::parent = canvas);
|
||||
texts.push_back(o);
|
||||
o.font_set("Vera-Bold", 20);
|
||||
o.text_set("This is a test string");
|
||||
o.style_set(st);
|
||||
o.evas::object::color_set(255, 255, 255, 255);
|
||||
o.shadow_color_set(0, 0, 0, 24);
|
||||
o.glow_color_set(100, 80, 40, 100);
|
||||
o.glow2_color_set(50, 10, 5, 50);
|
||||
o.outline_color_set(0, 0, 0, 255);
|
||||
o.visibility_set(true);
|
||||
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)
|
||||
{
|
||||
evas::text s(::eo_ref(texts[i % st]->_eo_ptr()));
|
||||
evas::image *o = new evas::image(efl::eo::parent = canvas);
|
||||
o->source_set(s);
|
||||
/* FIXME s == NULL*/
|
||||
int w,h;
|
||||
s.evas::object::size_get(&w, &h);
|
||||
o->evas::object::size_set(w, h);
|
||||
o->fill_set(0, 0, w, h);
|
||||
o->visibility_set(true);
|
||||
if (texts[i]) delete texts[i];
|
||||
texts[i] = o;
|
||||
evas::image o(efl::eo::parent = canvas);
|
||||
evas::object s = texts[i % st];
|
||||
texts.push_back(o);
|
||||
o.source_set(s);
|
||||
s.size_get(&w, &h);
|
||||
o.evas::object::size_set(w, h);
|
||||
o.fill_set(0, 0, w, h);
|
||||
o.evas::object::visibility_set(true);
|
||||
}
|
||||
|
||||
done = 0;
|
||||
|
@ -73,26 +63,28 @@ static void _setup(void)
|
|||
/* cleanup */
|
||||
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));
|
||||
texts[i]->_reset(nullptr);
|
||||
delete texts[i];
|
||||
obj.visibility_set(false); // XXX
|
||||
obj.parent_set(efl::eo::base(nullptr));
|
||||
}
|
||||
texts.clear();
|
||||
}
|
||||
|
||||
/* loop - do things */
|
||||
static void _loop(double t, int f)
|
||||
{
|
||||
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 += ::sin((double)(f + (i * 13)) / (36.7 * SLOW)) * (w / 2);
|
||||
y = (win_h / 2) - (h / 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);
|
||||
}
|
||||
|
|
|
@ -19,13 +19,13 @@
|
|||
static int done = 0;
|
||||
|
||||
/* private data */
|
||||
static Evas_Object *o_texts[OBNUM];
|
||||
static efl::eina::list<evas::object> texts;
|
||||
|
||||
/* setup */
|
||||
static void _setup(void)
|
||||
{
|
||||
int i = 0;
|
||||
Evas_Object *o;
|
||||
evas::canvas canvas(::eo_ref(G_evas));
|
||||
Evas_Coord x, y, w, h;
|
||||
char buf[1024];
|
||||
const char *strs[] = {
|
||||
|
@ -34,41 +34,38 @@ static void _setup(void)
|
|||
"Fiddly", "Family", "Lair", "Monkeys", "Magazine"
|
||||
};
|
||||
srnd();
|
||||
o = eo_add(EVAS_TEXT_CLASS, G_evas);
|
||||
o_texts[0] = o;
|
||||
evas::text o(efl::eo::parent = canvas);
|
||||
texts.push_back(o);
|
||||
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 *))]);
|
||||
|
||||
eo_do(o,
|
||||
efl_text_properties_font_set("Vera-Bold", 20),
|
||||
efl_text_set(buf),
|
||||
evas_obj_color_set(0, 0, 0, 255),
|
||||
evas_obj_size_get(&w, &h));
|
||||
o.font_set("Vera-Bold", 20);
|
||||
o.text_set(buf);
|
||||
o.evas::object::color_set(0, 0, 0, 255);
|
||||
o.evas::object::size_get(&w, &h);
|
||||
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 += cos((double)((i * 28)) / (43.8 * SLOW)) * (w / 2);
|
||||
eo_do(o,
|
||||
evas_obj_position_set(x, y),
|
||||
evas_obj_visibility_set(EINA_TRUE));
|
||||
for (i = 1 ; i < OBNUM ; i ++)
|
||||
y += ::cos((double)((i * 28)) / (43.8 * SLOW)) * (w / 2);
|
||||
o.evas::object::position_set(x, y);
|
||||
o.evas::object::visibility_set(true);
|
||||
for (i = 1; i < OBNUM ; i ++)
|
||||
{
|
||||
o = eo_add(EVAS_IMAGE_CLASS, G_evas);
|
||||
o_texts[i] = o;
|
||||
eo_do(o,
|
||||
evas_obj_image_source_set(o_texts[0]));
|
||||
eo_do(o_texts[0], evas_obj_size_get(&w, &h));
|
||||
eo_do(o, evas_obj_size_set(w, h),
|
||||
evas_obj_image_fill_set(0, 0, w, h));
|
||||
evas::image o2(efl::eo::parent = canvas);
|
||||
texts.push_back(o2);
|
||||
o2.source_set(texts.front());
|
||||
texts.front().evas::object::size_get(&w, &h);
|
||||
o2.evas::object::size_set(w, h);
|
||||
o2.fill_set(0, 0, w, h);
|
||||
x = (win_w / 2) - (w / 2);
|
||||
x += sin((double)((i * 13)) / (36.7 * SLOW)) * (w / 2);
|
||||
y = (win_h / 2) - (h / 2);
|
||||
y += cos((double)((i * 28)) / (43.8 * SLOW)) * (w / 2);
|
||||
eo_do(o, evas_obj_position_set(x, y),
|
||||
evas_obj_visibility_set(EINA_TRUE));
|
||||
o2.evas::object::position_set(x, y);
|
||||
o2.evas::object::visibility_set(true);
|
||||
}
|
||||
|
||||
done = 0;
|
||||
|
@ -77,8 +74,12 @@ static void _setup(void)
|
|||
/* cleanup */
|
||||
static void _cleanup(void)
|
||||
{
|
||||
int i;
|
||||
for (i = 0; i < OBNUM; i++) eo_del(o_texts[i]);
|
||||
for (evas::object& obj : texts)
|
||||
{
|
||||
obj.visibility_set(false); // XXX
|
||||
obj.parent_set(efl::eo::base(nullptr));
|
||||
}
|
||||
texts.clear();
|
||||
}
|
||||
|
||||
/* 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 *))]);
|
||||
eo_do(o_texts[0],
|
||||
efl_text_set(buf),
|
||||
evas_obj_size_get(&w, &h));
|
||||
for (i = 1; i < OBNUM; i++)
|
||||
efl::eina::list<evas::object>::iterator
|
||||
it = texts.begin(),
|
||||
end = texts.end();
|
||||
if (it != end)
|
||||
{
|
||||
eo_do(o_texts[i],
|
||||
evas_obj_size_set(w,h),
|
||||
evas_obj_image_fill_set(0,0,w,h));
|
||||
efl::eo::downcast<evas::text>(*it).text_set(buf);
|
||||
(*it++).evas::object::size_get(&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);
|
||||
}
|
||||
|
|
|
@ -63,10 +63,10 @@ extern "C" {
|
|||
#include "image_map_solid_rotate_capi.h"
|
||||
#include "image_quality_scale_capi.h"
|
||||
#include "line_blend_capi.h"
|
||||
/* #include "proxy_image_capi.h" */
|
||||
/* #include "proxy_image_offscreen_capi.h" */
|
||||
/* #include "proxy_text_fixed_capi.h" */
|
||||
/* #include "proxy_text_random_capi.h" */
|
||||
#include "proxy_image_capi.h"
|
||||
#include "proxy_image_offscreen_capi.h"
|
||||
#include "proxy_text_fixed_capi.h"
|
||||
#include "proxy_text_random_capi.h"
|
||||
#include "rect_blend_capi.h"
|
||||
#include "rect_blend_few_capi.h"
|
||||
#include "rect_blend_pow2_capi.h"
|
||||
|
|
|
@ -59,8 +59,8 @@ static void _setup(void)
|
|||
/* cleanup */
|
||||
static void _cleanup(void)
|
||||
{
|
||||
for (evas::text& t : texts)
|
||||
t.parent_set(efl::eo::base(nullptr));
|
||||
for (evas::text& txt : texts)
|
||||
txt.parent_set(efl::eo::base(nullptr));
|
||||
texts.clear();
|
||||
}
|
||||
|
||||
|
@ -73,14 +73,14 @@ static void _loop(double t, int f)
|
|||
"Am", "You", "Are", "Erogenous", "We", "Stick", "Wet", "Fishy",
|
||||
"Fiddly", "Family", "Lair", "Monkeys", "Magazine"
|
||||
};
|
||||
for (evas::text& text : texts)
|
||||
for (evas::text& txt : texts)
|
||||
{
|
||||
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 *))]);
|
||||
text.text_set(buf);
|
||||
txt.text_set(buf);
|
||||
}
|
||||
FPS_STD(NAME);
|
||||
}
|
||||
|
|
|
@ -55,8 +55,8 @@ static void _setup(void)
|
|||
/* cleanup */
|
||||
static void _cleanup(void)
|
||||
{
|
||||
for (evas::text& t : texts)
|
||||
t.parent_set(efl::eo::base(nullptr));
|
||||
for (evas::text& txt : texts)
|
||||
txt.parent_set(efl::eo::base(nullptr));
|
||||
texts.clear();
|
||||
}
|
||||
|
||||
|
|
|
@ -67,19 +67,19 @@ static void _cleanup(void)
|
|||
/* loop - do things */
|
||||
static void _loop(double t, int f)
|
||||
{
|
||||
Evas_Coord x, y, w, h, w0, h0;
|
||||
int i = 0;
|
||||
if (!text_block) goto fps; // XXX
|
||||
|
||||
text_block->size_native_get(&w0, &h0);
|
||||
w = w0;
|
||||
h = h0;
|
||||
w += fabs(sin((double)(f + (i * 13)) / (31.1 * SLOW))) * (w0);
|
||||
x = (win_w / 2) - (w / 2);
|
||||
y = (win_h / 2) - (h0 / 2);
|
||||
text_block->evas::object::position_set(x, y);
|
||||
text_block->evas::object::size_set(w, h);
|
||||
fps:
|
||||
if (text_block)
|
||||
{
|
||||
Evas_Coord x, y, w, h, w0, h0;
|
||||
int i = 0;
|
||||
text_block->size_native_get(&w0, &h0);
|
||||
w = w0;
|
||||
h = h0;
|
||||
w += fabs(sin((double)(f + (i * 13)) / (31.1 * SLOW))) * (w0);
|
||||
x = (win_w / 2) - (w / 2);
|
||||
y = (win_h / 2) - (h0 / 2);
|
||||
text_block->evas::object::position_set(x, y);
|
||||
text_block->evas::object::size_set(w, h);
|
||||
}
|
||||
FPS_STD(NAME);
|
||||
}
|
||||
|
||||
|
|
|
@ -88,18 +88,13 @@ static void _loop(double t, int f)
|
|||
Evas_Coord x, y, tw, th, cent;
|
||||
x = 0;
|
||||
y = 0 - f;
|
||||
efl::eina::list<evas::image>::iterator
|
||||
it1 = images.begin(),
|
||||
end1 = images.end();
|
||||
efl::eina::list<evas::text>::iterator
|
||||
it2 = texts.begin(),
|
||||
end2 = texts.end();
|
||||
for (; it1 != end1 && it2 != end2; ++it1, ++it2)
|
||||
efl::eina::list<evas::image>::iterator img = images.begin();
|
||||
for (evas::text& txt : texts)
|
||||
{
|
||||
(*it1).evas::object::position_set(x + 8, y);
|
||||
(*it2).evas::object::size_get(&tw, &th);
|
||||
(*img++).evas::object::position_set(x + 8, y);
|
||||
txt.evas::object::size_get(&tw, &th);
|
||||
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;
|
||||
if (x > win_w)
|
||||
{
|
||||
|
|
|
@ -84,19 +84,14 @@ static void _loop(double t, int f)
|
|||
Evas_Coord x, y, tw, th, cent;
|
||||
x = 0;
|
||||
y = 0 - f;
|
||||
efl::eina::list<evas::image>::iterator
|
||||
it1 = images.begin(),
|
||||
end1 = images.end();
|
||||
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++)
|
||||
|
||||
efl::eina::list<evas::image>::iterator img = images.begin();
|
||||
for (evas::text& txt : texts)
|
||||
{
|
||||
(*it1).evas::object::position_set(x + 8, y);
|
||||
(*it2).evas::object::size_get(&tw, &th);
|
||||
(*img++).evas::object::position_set(x + 8, y);
|
||||
txt.evas::object::size_get(&tw, &th);
|
||||
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;
|
||||
if (x > win_w)
|
||||
{
|
||||
|
|
|
@ -21,7 +21,7 @@ static int done = 0;
|
|||
#define NUM 512
|
||||
#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 const char *icons[] =
|
||||
|
@ -54,7 +54,7 @@ static void _setup(void)
|
|||
images.push_back(o1);
|
||||
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.evas::object::size_set(win_w, ICON_SIZE);
|
||||
o1.evas::object::size_set(ICON_SIZE, ICON_SIZE);
|
||||
o1.visibility_set(true);
|
||||
|
||||
evas::text o2(efl::eo::parent = canvas);
|
||||
|
@ -68,16 +68,10 @@ static void _setup(void)
|
|||
{
|
||||
img.evas::object::raise();
|
||||
}
|
||||
efl::eina::list<evas::image>::iterator
|
||||
it1 = images.begin(),
|
||||
it2 = images.begin();
|
||||
for (int i = 0; i < NUM; i++, ++it1)
|
||||
for (int i = 0; i < NUM; i++)
|
||||
{
|
||||
if (i > 13)
|
||||
{
|
||||
(*it1).evas::object::stack_above(*it2);
|
||||
++it2; // XXX
|
||||
}
|
||||
images[i].evas::object::stack_above(images[i - 13]);
|
||||
}
|
||||
done = 0;
|
||||
}
|
||||
|
@ -94,7 +88,7 @@ static void _cleanup(void)
|
|||
|
||||
for (evas::text& t : texts)
|
||||
{
|
||||
t.visibility_set(false); // XXX
|
||||
//t.visibility_set(false); // XXX
|
||||
t.parent_set(efl::eo::base(nullptr));
|
||||
}
|
||||
texts.clear();
|
||||
|
@ -106,18 +100,13 @@ static void _loop(double t, int f)
|
|||
Evas_Coord x, y, tw, th, cent;
|
||||
x = 0;
|
||||
y = 0 - f;
|
||||
efl::eina::list<evas::image>::iterator
|
||||
it1 = images.begin(),
|
||||
end1 = images.end();
|
||||
efl::eina::list<evas::text>::iterator
|
||||
it2 = texts.begin(),
|
||||
end2 = texts.end();
|
||||
for (; it1 != end1 && it2 != end2; ++it1, ++it2)
|
||||
efl::eina::array<evas::image>::iterator img = images.begin();
|
||||
for (evas::text& txt : texts)
|
||||
{
|
||||
(*it1).evas::object::position_set(x + 8, y);
|
||||
(*it2).evas::object::size_get(&tw, &th);
|
||||
(*img++).evas::object::position_set(x + 8, y);
|
||||
txt.evas::object::size_get(&tw, &th);
|
||||
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;
|
||||
if (x > win_w)
|
||||
{
|
||||
|
|
|
@ -69,18 +69,13 @@ static void _loop(double t, int f)
|
|||
Evas_Coord x, y, tw, th, cent;
|
||||
x = 0;
|
||||
y = 0 - f;
|
||||
efl::eina::list<evas::image>::iterator
|
||||
it1 = images.begin(),
|
||||
end1 = images.end();
|
||||
efl::eina::list<evas::text>::iterator
|
||||
it2 = texts.begin(),
|
||||
end2 = texts.end();
|
||||
for (; it1 != end1 && it2 != end2; ++it1, ++it2)
|
||||
efl::eina::list<evas::image>::iterator img = images.begin();
|
||||
for (evas::text& txt : texts)
|
||||
{
|
||||
(*it1).evas::object::position_set(x + 8, y);
|
||||
(*it2).evas::object::size_get(&tw, &th);
|
||||
(*img++).evas::object::position_set(x + 8, y);
|
||||
txt.evas::object::size_get(&tw, &th);
|
||||
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;
|
||||
if (x > win_w)
|
||||
{
|
||||
|
|
|
@ -48,9 +48,9 @@ static void _setup(void)
|
|||
o2.evas::object::color_set(0, 0, 0, 255);
|
||||
o2.visibility_set(true);
|
||||
}
|
||||
for (evas::image img : images)
|
||||
for (evas::image& img : images)
|
||||
{
|
||||
img.raise();
|
||||
img.evas::object::raise();
|
||||
}
|
||||
|
||||
done = 0;
|
||||
|
@ -59,12 +59,12 @@ static void _setup(void)
|
|||
/* cleanup */
|
||||
static void _cleanup(void)
|
||||
{
|
||||
for (evas::image& i : images)
|
||||
i.parent_set(efl::eo::base(nullptr));
|
||||
for (evas::image& img : images)
|
||||
img.parent_set(efl::eo::base(nullptr));
|
||||
images.clear();
|
||||
|
||||
for (evas::text& t : texts)
|
||||
t.parent_set(efl::eo::base(nullptr));
|
||||
for (evas::text& txt : texts)
|
||||
txt.parent_set(efl::eo::base(nullptr));
|
||||
texts.clear();
|
||||
}
|
||||
|
||||
|
@ -74,18 +74,13 @@ static void _loop(double t, int f)
|
|||
Evas_Coord x, y, tw, th, cent;
|
||||
x = 0;
|
||||
y = 0 - f;
|
||||
efl::eina::list<evas::image>::iterator
|
||||
it1 = images.begin(),
|
||||
end1 = images.end();
|
||||
efl::eina::list<evas::text>::iterator
|
||||
it2 = texts.begin(),
|
||||
end2 = texts.end();
|
||||
for (; it1 != end1 && it2 != end2; ++it1, ++it2)
|
||||
efl::eina::list<evas::image>::iterator img = images.begin();
|
||||
for (evas::text& txt : texts)
|
||||
{
|
||||
(*it1).evas::object::position_set(x + 8, y);
|
||||
(*it2).evas::object::size_get(&tw, &th);
|
||||
(*img++).evas::object::position_set(x + 8, y);
|
||||
txt.evas::object::size_get(&tw, &th);
|
||||
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;
|
||||
if (x > win_w)
|
||||
{
|
||||
|
|
|
@ -83,19 +83,13 @@ static void _loop(double t, int f)
|
|||
Evas_Coord x, y, tw, th, cent;
|
||||
x = 0;
|
||||
y = 0 - f;
|
||||
efl::eina::list<evas::image>::iterator
|
||||
it1 = images.begin(),
|
||||
end1 = images.end();
|
||||
efl::eina::list<evas::text>::iterator
|
||||
it2 = texts.begin(),
|
||||
end2 = texts.end();
|
||||
for (; it1 != end1 && it2 != end2; ++it1, ++it2)
|
||||
efl::eina::list<evas::image>::iterator img = images.begin();
|
||||
for (evas::text& txt : texts)
|
||||
{
|
||||
(*it1).evas::object::position_set(x + 8, y);
|
||||
(*it2).evas::object::size_get(&tw, &th);
|
||||
(*img++).evas::object::position_set(x + 8, y);
|
||||
txt.evas::object::size_get(&tw, &th);
|
||||
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;
|
||||
if (x > win_w)
|
||||
{
|
||||
|
|
|
@ -53,7 +53,7 @@ static void _setup(void)
|
|||
images.push_back(o1);
|
||||
eo_do(o1._eo_ptr(), efl_file_set(build_path(icons[i % 13]), NULL));
|
||||
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);
|
||||
|
||||
evas::text o2(efl::eo::parent = canvas);
|
||||
|
@ -72,6 +72,7 @@ static void _cleanup(void)
|
|||
for (evas::image& i : images)
|
||||
i.parent_set(efl::eo::base(nullptr));
|
||||
images.clear();
|
||||
|
||||
for (evas::text& t : texts)
|
||||
t.parent_set(efl::eo::base(nullptr));
|
||||
texts.clear();
|
||||
|
@ -83,18 +84,13 @@ static void _loop(double t, int f)
|
|||
Evas_Coord x, y, tw, th, cent;
|
||||
x = 0;
|
||||
y = 0 - f;
|
||||
efl::eina::list<evas::image>::iterator
|
||||
it1 = images.begin(),
|
||||
end1 = images.end();
|
||||
efl::eina::list<evas::text>::iterator
|
||||
it2 = texts.begin(),
|
||||
end2 = texts.end();
|
||||
for (; it1 != end1 && it2 != end2; ++it1, ++it2)
|
||||
efl::eina::list<evas::image>::iterator img = images.begin();
|
||||
for (evas::text& txt : texts)
|
||||
{
|
||||
(*it1).evas::object::position_set(x + 8, y);
|
||||
(*it2).evas::object::size_get(&tw, &th);
|
||||
(*img++).evas::object::position_set(x + 8, y);
|
||||
txt.evas::object::size_get(&tw, &th);
|
||||
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;
|
||||
if (x > win_w)
|
||||
{
|
||||
|
|
|
@ -70,7 +70,7 @@ static void _setup(void)
|
|||
images.push_back(o1);
|
||||
o1.filled_set(1);
|
||||
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.visibility_set(true);
|
||||
|
||||
|
@ -103,18 +103,13 @@ static void _loop(double t, int f)
|
|||
Evas_Coord x, y, tw, th, cent;
|
||||
x = 0;
|
||||
y = 0 - f;
|
||||
efl::eina::list<evas::image>::iterator
|
||||
it1 = images.begin(),
|
||||
end1 = images.end();
|
||||
efl::eina::list<evas::text>::iterator
|
||||
it2 = texts.begin(),
|
||||
end2 = texts.end();
|
||||
for (; it1 != end1 && it2 != end2; ++it1, ++it2)
|
||||
efl::eina::list<evas::image>::iterator img = images.begin();
|
||||
for (evas::text& txt : texts)
|
||||
{
|
||||
(*it1).evas::object::position_set(x, y);
|
||||
(*it2).evas::object::size_get(&tw, &th);
|
||||
(*img++).evas::object::position_set(x, y);
|
||||
txt.evas::object::size_get(&tw, &th);
|
||||
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;
|
||||
}
|
||||
FPS_STD(NAME);
|
||||
|
|
|
@ -109,18 +109,13 @@ static void _loop(double t, int f)
|
|||
Evas_Coord x, y, tw, th, cent;
|
||||
x = 0;
|
||||
y = 0 - f;
|
||||
efl::eina::list<evas::image>::iterator
|
||||
it1 = images.begin(),
|
||||
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);
|
||||
(*it2).evas::object::size_get(&tw, &th);
|
||||
efl::eina::list<evas::image>::iterator img = images.begin();
|
||||
for (evas::text& txt : texts)
|
||||
{
|
||||
(*img++).evas::object::position_set(x, y);
|
||||
txt.evas::object::size_get(&tw, &th);
|
||||
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;
|
||||
}
|
||||
FPS_STD(NAME);
|
||||
|
|
|
@ -102,18 +102,13 @@ static void _loop(double t, int f)
|
|||
Evas_Coord x, y, tw, th, cent;
|
||||
x = 0;
|
||||
y = 0 - f;
|
||||
efl::eina::list<evas::image>::iterator
|
||||
it1 = images.begin(),
|
||||
end1 = images.end();
|
||||
efl::eina::list<evas::text>::iterator
|
||||
it2 = texts.begin(),
|
||||
end2 = texts.end();
|
||||
for (; it1 != end1 && it2 != end2; ++it1, ++it2)
|
||||
efl::eina::list<evas::image>::iterator img = images.begin();
|
||||
for (evas::text& txt : texts)
|
||||
{
|
||||
(*it1).evas::object::position_set(x, y);
|
||||
(*it2).evas::object::size_get(&tw, &th);
|
||||
(*img++).evas::object::position_set(x, y);
|
||||
txt.evas::object::size_get(&tw, &th);
|
||||
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;
|
||||
}
|
||||
FPS_STD(NAME);
|
||||
|
|
|
@ -110,18 +110,13 @@ static void _loop(double t, int f)
|
|||
Evas_Coord x, y, tw, th, cent;
|
||||
x = 0;
|
||||
y = 0 - f;
|
||||
efl::eina::list<evas::image>::iterator
|
||||
it1 = images.begin(),
|
||||
end1 = images.end();
|
||||
efl::eina::list<evas::text>::iterator
|
||||
it2 = texts.begin(),
|
||||
end2 = texts.end();
|
||||
for (; it1 != end1 && it2 != end2; ++it1, ++it2)
|
||||
efl::eina::list<evas::image>::iterator img = images.begin();
|
||||
for (evas::text& txt : texts)
|
||||
{
|
||||
(*it1).evas::object::position_set(x, y);
|
||||
(*it2).evas::object::size_get(&tw, &th);
|
||||
(*img++).evas::object::position_set(x, y);
|
||||
txt.evas::object::size_get(&tw, &th);
|
||||
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;
|
||||
}
|
||||
FPS_STD(NAME);
|
||||
|
|
|
@ -134,24 +134,17 @@ static void _loop(double t, int f)
|
|||
Evas_Coord x, y, tw, th, cent;
|
||||
x = 0;
|
||||
y = 0 - f;
|
||||
efl::eina::list<evas::image>::iterator
|
||||
it1 = images.begin(),
|
||||
end1 = images.end();
|
||||
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)
|
||||
|
||||
efl::eina::list<evas::image>::iterator img = images.begin();
|
||||
efl::eina::list<evas::image>::iterator ico = icons.begin();
|
||||
for (evas::text& txt : texts)
|
||||
{
|
||||
(*it1).evas::object::position_set(x, y);
|
||||
(*it2).evas::object::position_set(x + 4, y + 4);
|
||||
(*it3).evas::object::size_get(&tw, &th);
|
||||
(*img++).evas::object::position_set(x, y);
|
||||
(*ico++).evas::object::position_set(x + 4, y + 4);
|
||||
txt.evas::object::size_get(&tw, &th);
|
||||
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;
|
||||
++it1; ++it2; ++it3;
|
||||
}
|
||||
FPS_STD(NAME);
|
||||
}
|
||||
|
|
|
@ -22,10 +22,10 @@ static int done = 0;
|
|||
#define ICON_SIZE 64
|
||||
|
||||
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 const char *_icons[] =
|
||||
static const char* _icons[] =
|
||||
{
|
||||
"bug.png",
|
||||
"bulb.png",
|
||||
|
@ -95,13 +95,13 @@ static void _setup(void)
|
|||
o1.evas::object::size_set(win_w, ICON_SIZE);
|
||||
o1.visibility_set(true);
|
||||
|
||||
evas::image *o2 = new evas::image(efl::eo::parent = canvas);
|
||||
icons[i] = o2;
|
||||
o2->filled_set(1);
|
||||
o2->border_set(2, 2, 2, 2);
|
||||
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->visibility_set(true);
|
||||
evas::image o2(efl::eo::parent = canvas);
|
||||
icons.push_back(o2);
|
||||
o2.filled_set(1);
|
||||
o2.border_set(2, 2, 2, 2);
|
||||
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.visibility_set(true);
|
||||
|
||||
evas::text o3(efl::eo::parent = canvas);
|
||||
texts.push_back(o3);
|
||||
|
@ -114,14 +114,14 @@ static void _setup(void)
|
|||
{
|
||||
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)
|
||||
icons[i]->stack_above(*icons[i - 13]);
|
||||
icons[i].stack_above(icons[i - 13]);
|
||||
}
|
||||
for (evas::text& text : texts)
|
||||
{
|
||||
|
@ -137,12 +137,12 @@ static void _cleanup(void)
|
|||
i.parent_set(efl::eo::base(nullptr));
|
||||
images.clear();
|
||||
|
||||
for (int i = 0; i < NUM; ++i) // XXX
|
||||
for (evas::image& i : icons)
|
||||
{
|
||||
icons[i]->parent_set(efl::eo::base(nullptr));
|
||||
icons[i]->_reset(nullptr);
|
||||
delete icons[i];
|
||||
i.visibility_set(false); // XXX
|
||||
i.parent_set(efl::eo::base(nullptr));
|
||||
}
|
||||
icons.clear();
|
||||
|
||||
for (evas::text& t : texts)
|
||||
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;
|
||||
x = 0;
|
||||
y = 0 - f;
|
||||
efl::eina::list<evas::image>::iterator
|
||||
it1 = images.begin(),
|
||||
end1 = images.end();
|
||||
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);
|
||||
icons[i2]->evas::object::position_set(x + 4, y + 4);
|
||||
(*it3).evas::object::size_get(&tw, &th);
|
||||
efl::eina::list<evas::image>::iterator img = images.begin();
|
||||
efl::eina::array<evas::image>::iterator ico = icons.begin();
|
||||
for (evas::text& txt : texts)
|
||||
{
|
||||
(*img++).evas::object::position_set(x, y);
|
||||
(*ico++).evas::object::position_set(x + 4, y + 4);
|
||||
txt.evas::object::size_get(&tw, &th);
|
||||
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;
|
||||
++it1; ++i2; ++it3;
|
||||
}
|
||||
FPS_STD(NAME);
|
||||
}
|
||||
|
|
|
@ -135,24 +135,16 @@ static void _loop(double t, int f)
|
|||
Evas_Coord x, y, tw, th, cent;
|
||||
x = 0;
|
||||
y = 0 - f;
|
||||
efl::eina::list<evas::image>::iterator
|
||||
it1 = images.begin(),
|
||||
end1 = images.end();
|
||||
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)
|
||||
efl::eina::list<evas::image>::iterator img = images.begin();
|
||||
efl::eina::list<evas::image>::iterator ico = icons.begin();
|
||||
for (evas::text& txt : texts)
|
||||
{
|
||||
(*it1).evas::object::position_set(x, y);
|
||||
(*it2).evas::object::position_set(x + 4, y + 4);
|
||||
(*it3).evas::object::size_get(&tw, &th);
|
||||
(*img++).evas::object::position_set(x, y);
|
||||
(*ico++).evas::object::position_set(x + 4, y + 4);
|
||||
txt.evas::object::size_get(&tw, &th);
|
||||
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;
|
||||
++it1; ++it2; ++it3;
|
||||
}
|
||||
FPS_STD(NAME);
|
||||
}
|
||||
|
|
|
@ -21,7 +21,7 @@ static int done = 0;
|
|||
#define NUM 512
|
||||
#define ICON_SIZE 32
|
||||
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 const char *_icons[] =
|
||||
|
@ -94,13 +94,13 @@ static void _setup(void)
|
|||
o1.evas::object::size_set(win_w, ICON_SIZE);
|
||||
o1.visibility_set(true);
|
||||
|
||||
evas::image *o2 = new evas::image(efl::eo::parent = canvas);
|
||||
icons[i] = o2;
|
||||
o2->filled_set(1);
|
||||
o2->border_set(2, 2, 2, 2);
|
||||
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->visibility_set(true);
|
||||
evas::image o2(efl::eo::parent = canvas);
|
||||
icons.push_back(o2);
|
||||
o2.filled_set(1);
|
||||
o2.border_set(2, 2, 2, 2);
|
||||
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.visibility_set(true);
|
||||
|
||||
evas::text o3(efl::eo::parent = canvas);
|
||||
texts.push_back(o3);
|
||||
|
@ -114,14 +114,16 @@ static void _setup(void)
|
|||
{
|
||||
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)
|
||||
icons[i]->stack_above(*icons[i - 13]);
|
||||
{
|
||||
icons[i].stack_above(icons[i - 13]);
|
||||
}
|
||||
}
|
||||
for (evas::text& text : texts)
|
||||
{
|
||||
|
@ -136,12 +138,12 @@ static void _cleanup()
|
|||
i.parent_set(efl::eo::base(nullptr));
|
||||
images.clear();
|
||||
|
||||
for (int i = 0; i < NUM; i++) // XXX
|
||||
for (evas::image& i : icons)
|
||||
{
|
||||
icons[i]->parent_set(efl::eo::base(nullptr));
|
||||
icons[i]->_reset(nullptr);
|
||||
delete icons[i];
|
||||
i.visibility_set(false); // XXX
|
||||
i.parent_set(efl::eo::base(nullptr));
|
||||
}
|
||||
icons.clear();
|
||||
|
||||
for (evas::text& t : texts)
|
||||
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;
|
||||
x = 0;
|
||||
y = 0 - f;
|
||||
efl::eina::list<evas::image>::iterator
|
||||
it1 = images.begin(),
|
||||
end1 = images.end();
|
||||
efl::eina::list<evas::text>::iterator
|
||||
it3 = texts.begin(),
|
||||
end3 = texts.end();
|
||||
int i2 = 0;
|
||||
while(it1 != end1 && i2 != NUM && it3 != end3)
|
||||
efl::eina::list<evas::image>::iterator img = images.begin();
|
||||
efl::eina::array<evas::image>::iterator ico = icons.begin();
|
||||
for (evas::text& txt : texts)
|
||||
{
|
||||
(*it1).evas::object::position_set(x, y);
|
||||
icons[i2]->evas::object::position_set(x + 4, y + 4);
|
||||
(*it3).evas::object::size_get(&tw, &th);
|
||||
(*img++).evas::object::position_set(x, y);
|
||||
(*ico++).evas::object::position_set(x + 4, y + 4);
|
||||
txt.evas::object::size_get(&tw, &th);
|
||||
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;
|
||||
++it1; ++i2; ++it3;
|
||||
}
|
||||
FPS_STD(NAME);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue