diff --git a/src/bin/Makefile.am b/src/bin/Makefile.am index c732326..feb4d93 100644 --- a/src/bin/Makefile.am +++ b/src/bin/Makefile.am @@ -13,9 +13,8 @@ AM_CPPFLAGS = \ bin_PROGRAMS = expedite bin_SCRIPTS = expedite-cmp +# XXX cxx_sources = \ -cxx/font_effect_blur_alpha.cc \ -cxx/font_effect_blur_alpha_capi.h \ cxx/image_blend_border.cc \ cxx/image_blend_border_capi.h \ cxx/image_blend_border_recolor.cc \ @@ -173,7 +172,6 @@ cxx/textblock_intl.cc \ cxx/textblock_intl_capi.h \ cxx/textblock_text_append.cc \ cxx/textblock_text_append_capi.h \ -cxx/widgets__*_capi.h \ cxx/widgets_file_icons.cc \ cxx/widgets_file_icons_2.cc \ cxx/widgets_file_icons_2_capi.h \ @@ -203,7 +201,9 @@ cxx/widgets_list_3_grouped_capi.h \ cxx/widgets_list_4.cc \ cxx/widgets_list_4_capi.h \ cxx/widgets_list_4_grouped.cc \ -cxx/widgets_list_4_grouped_capi.h +cxx/widgets_list_4_grouped_capi.h \ +cxx/font_effect_blur_alpha.cc \ +cxx/font_effect_blur_alpha_capi.h expedite_SOURCES = \ main.c main.h \ @@ -306,6 +306,7 @@ image_blend_many_smooth_same_scaled.c \ font_effect_blur_alpha.c \ font_effect_blur_color.c \ ${cxx_sources} + # \ # image_mask.c \ # image_mask_2.c \ diff --git a/src/bin/cxx/image_blend_border.cc b/src/bin/cxx/image_blend_border.cc index de4bde6..9f859fa 100644 --- a/src/bin/cxx/image_blend_border.cc +++ b/src/bin/cxx/image_blend_border.cc @@ -26,9 +26,9 @@ static void _setup() evas::canvas canvas(::eo_ref(G_evas)); for (int i = 0; i < OBNUM; i++) { - evas::image o(efl::eo::parent = canvas); // XXX + evas::image o(efl::eo::parent = canvas); // XXX: images.push_back(o); - o.file_set(::build_path("bar.png"), ""); // XXX + eo_do(o._eo_ptr(), efl_file_set(build_path("bar.png"), NULL)); // XXX o.border_set(6, 6, 6, 6); o.visibility_set(true); } diff --git a/src/bin/cxx/image_blend_border_recolor.cc b/src/bin/cxx/image_blend_border_recolor.cc index bf2b81d..e1435da 100644 --- a/src/bin/cxx/image_blend_border_recolor.cc +++ b/src/bin/cxx/image_blend_border_recolor.cc @@ -28,7 +28,7 @@ static void _setup(void) { evas::image o(efl::eo::parent = canvas); images.push_back(o); - o.file_set(::build_path("pan.png"), ""); + eo_do(o._eo_ptr(), efl_file_set(::build_path("pan.png"), NULL)); // XXX o.color_set(64, 64, 64, 255); o.border_set(3, 3, 3, 3); o.visibility_set(true); diff --git a/src/bin/cxx/image_blend_fade_pow2_unscaled.cc b/src/bin/cxx/image_blend_fade_pow2_unscaled.cc index ef82f70..82c6ce5 100644 --- a/src/bin/cxx/image_blend_fade_pow2_unscaled.cc +++ b/src/bin/cxx/image_blend_fade_pow2_unscaled.cc @@ -29,7 +29,7 @@ static void _setup(void) evas::image o(efl::eo::parent = canvas); images.push_back(o); - o.file_set(::build_path("logo.png"), ""); + 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); diff --git a/src/bin/cxx/image_blend_fade_unscaled.cc b/src/bin/cxx/image_blend_fade_unscaled.cc index 3a9405e..634f0dd 100644 --- a/src/bin/cxx/image_blend_fade_unscaled.cc +++ b/src/bin/cxx/image_blend_fade_unscaled.cc @@ -28,7 +28,7 @@ static void _setup(void) { evas::image o(efl::eo::parent = canvas); images.push_back(o); - o.file_set(::build_path("logo.png"), ""); + 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); diff --git a/src/bin/cxx/image_blend_many_smooth_same_scaled.cc b/src/bin/cxx/image_blend_many_smooth_same_scaled.cc index 5c5f076..fe3fdce 100644 --- a/src/bin/cxx/image_blend_many_smooth_same_scaled.cc +++ b/src/bin/cxx/image_blend_many_smooth_same_scaled.cc @@ -33,7 +33,7 @@ static void _setup(void) int n = rnd() % 100; int w = 3 + ((n * (60 - 3)) / 100); int h = 4 + ((n * (80 - 4)) / 100); - o.file_set(build_path("logo.png"), ""); + eo_do(o._eo_ptr(), efl_file_set(build_path("logo.png"), NULL)); // XXX o.smooth_scale_set(1); o.evas::object::size_set(w, h); o.fill_set(0, 0, w, h); @@ -59,9 +59,9 @@ static void _loop(double t, int f) Evas_Coord w, h; img.evas::object::size_get(&w, &h); Evas_Coord x = (win_w / 2) - (w / 2); - x += sin((double)(f + (i * 13)) / (36.7 * SLOW)) * (win_w / 2); + x += ::sin((double)(f + (i * 13)) / (36.7 * SLOW)) * (win_w / 2); Evas_Coord y = (win_h / 2) - (h / 2); - y += cos((double)(f + (i * 28)) / (43.8 * SLOW)) * (win_h / 2); + y += ::cos((double)(f + (i * 28)) / (43.8 * SLOW)) * (win_h / 2); img.evas::object::position_set(x, y); ++i; } diff --git a/src/bin/cxx/image_blend_nearest_same_scaled.cc b/src/bin/cxx/image_blend_nearest_same_scaled.cc index 4bb4353..8dba0c2 100644 --- a/src/bin/cxx/image_blend_nearest_same_scaled.cc +++ b/src/bin/cxx/image_blend_nearest_same_scaled.cc @@ -28,7 +28,7 @@ static void _setup(void) { evas::image o(efl::eo::parent = canvas); images.push_back(o); - o.file_set(build_path("logo.png"), ""); + eo_do(o._eo_ptr(), efl_file_set(build_path("logo.png"), NULL)); // XXX o.smooth_scale_set(0); o.visibility_set(true); } @@ -57,7 +57,7 @@ static void _loop(double t, int f) x += sin((double)(f + (i * 13)) / (36.7 * SLOW)) * (w0 / 2); Evas_Coord y = (win_h / 2) - (h / 2); y += cos((double)(f + (i * 28)) / (43.8 * SLOW)) * (h0 / 2); - img.position_set(x, y); + img.evas::object::position_set(x, y); img.evas::object::size_set(w, h); img.fill_set(0, 0, w, h); ++i; diff --git a/src/bin/cxx/image_blend_nearest_scaled.cc b/src/bin/cxx/image_blend_nearest_scaled.cc index 8bf8b63..47104fa 100644 --- a/src/bin/cxx/image_blend_nearest_scaled.cc +++ b/src/bin/cxx/image_blend_nearest_scaled.cc @@ -28,7 +28,7 @@ static void _setup(void) { evas::image o(efl::eo::parent = canvas); images.push_back(o); - o.file_set(build_path("logo.png"), ""); + eo_do(o._eo_ptr(), efl_file_set(build_path("logo.png"), NULL)); // XXX o.smooth_scale_set(0); o.visibility_set(true); } @@ -57,7 +57,7 @@ static void _loop(double t, int f) Evas_Coord y = (win_h / 2) - (h / 2); x += sin((double)(f + (i * 13)) / (36.7 * SLOW)) * (w0 / 2); y += cos((double)(f + (i * 28)) / (43.8 * SLOW)) * (h0 / 2); - img.position_set(x, y); + img.evas::object::position_set(x, y); img.evas::object::size_set(w, h); img.fill_set(0, 0, w, h); ++i; diff --git a/src/bin/cxx/image_blend_nearest_solid_same_scaled.cc b/src/bin/cxx/image_blend_nearest_solid_same_scaled.cc index d5e620e..8b30c7e 100644 --- a/src/bin/cxx/image_blend_nearest_solid_same_scaled.cc +++ b/src/bin/cxx/image_blend_nearest_solid_same_scaled.cc @@ -28,7 +28,7 @@ static void _setup(void) { evas::image o(efl::eo::parent = canvas); images.push_back(o); - o.file_set(build_path("image.png"), ""); + eo_do(o._eo_ptr(), efl_file_set(build_path("image.png"), NULL)); // XXX o.smooth_scale_set(0); o.visibility_set(EINA_TRUE); } @@ -57,7 +57,7 @@ static void _loop(double t, int f) x += sin((double)(f + (i * 13)) / (36.7 * SLOW)) * (w0 / 2); Evas_Coord y = (win_h / 2) - (h / 2); y += cos((double)(f + (i * 28)) / (43.8 * SLOW)) * (h0 / 2); - img.position_set(x, y); + img.evas::object::position_set(x, y); img.evas::object::size_set(w, h); img.fill_set(0, 0, w, h); ++i; diff --git a/src/bin/cxx/image_blend_nearest_solid_scaled.cc b/src/bin/cxx/image_blend_nearest_solid_scaled.cc index 0739b35..4522913 100644 --- a/src/bin/cxx/image_blend_nearest_solid_scaled.cc +++ b/src/bin/cxx/image_blend_nearest_solid_scaled.cc @@ -28,7 +28,7 @@ static void _setup(void) { evas::image o(efl::eo::parent = canvas); images.push_back(o); - o.file_set(build_path("image.png"), ""); + eo_do(o._eo_ptr(), efl_file_set(build_path("image.png"), NULL)); // XXX o.smooth_scale_set(0); o.visibility_set(true); } @@ -57,7 +57,7 @@ static void _loop(double t, int f) x += sin((double)(f + (i * 13)) / (36.7 * SLOW)) * (w0 / 2); Evas_Coord y = (win_h / 2) - (h / 2); y += cos((double)(f + (i * 28)) / (43.8 * SLOW)) * (h0 / 2); - img.position_set(x, y); + img.evas::object::position_set(x, y); img.evas::object::size_set(w, h); img.fill_set(0, 0, w, h); ++i; diff --git a/src/bin/cxx/image_blend_occlude1.cc b/src/bin/cxx/image_blend_occlude1.cc index 7615e29..bf2db13 100644 --- a/src/bin/cxx/image_blend_occlude1.cc +++ b/src/bin/cxx/image_blend_occlude1.cc @@ -31,7 +31,7 @@ static void _setup(void) images.push_back(o); if (i < (OBNUM / 2)) { - o.file_set(build_path("logo.png"), ""); + eo_do(o._eo_ptr(), efl_file_set(build_path("logo.png"), NULL)); // XXX } else { @@ -39,7 +39,7 @@ static void _setup(void) x = (win_w / 4) + (((rnd() & 0xff) * ((win_w / 2) - 120)) >> 8); y = (win_h / 4) + (((rnd() & 0xff) * ((win_h / 2) - 120)) >> 8); - o.file_set(build_path("image.png"), ""); + eo_do(o._eo_ptr(), efl_file_set(build_path("image.png"), NULL)); // XXX o.evas::object::position_set(x, y); } o.fill_set(0, 0, 120, 160); @@ -71,7 +71,7 @@ static void _loop(double t, int f) x += sin((double)(f + (i * 13)) / (36.7 * SLOW)) * (w / 2); Evas_Coord y = (win_h / 2) - (h / 2); y += cos((double)(f + (i * 28)) / (43.8 * SLOW)) * (h / 2); - img.position_set(x, y); + img.evas::object::position_set(x, y); } ++i; } diff --git a/src/bin/cxx/image_blend_occlude1_few.cc b/src/bin/cxx/image_blend_occlude1_few.cc index 6d88350..6be38fa 100644 --- a/src/bin/cxx/image_blend_occlude1_few.cc +++ b/src/bin/cxx/image_blend_occlude1_few.cc @@ -34,7 +34,7 @@ static void _setup(void) images.push_back(o); if (i < (OBNUM / 2)) { - o.file_set(PACKAGE_DATA_DIR"/data/logo.png", ""); + eo_do(o._eo_ptr(), efl_file_set(PACKAGE_DATA_DIR"/data/logo.png", NULL)); // XXX } else { @@ -42,7 +42,7 @@ static void _setup(void) x = (win_w / 4) + (((rnd() & 0xff) * ((win_w / 2) - 120)) >> 8); y = (win_h / 4) + (((rnd() & 0xff) * ((win_h / 2) - 120)) >> 8); - o.file_set(PACKAGE_DATA_DIR"/data/image.png", ""); + eo_do(o._eo_ptr(), efl_file_set(PACKAGE_DATA_DIR"/data/image.png", NULL)); // XXX o.evas::object::position_set(x, y); } o.fill_set(0, 0, 120, 160); @@ -74,7 +74,7 @@ static void _loop(double t, int f) Evas_Coord y = (win_h / 2) - (h / 2); x += sin((double)(f + (i * 13)) / (36.7 * SLOW)) * (w / 2); y += cos((double)(f + (i * 28)) / (43.8 * SLOW)) * (h / 2); - img.position_set(x, y); + img.evas::object::position_set(x, y); } ++i; } diff --git a/src/bin/cxx/image_blend_occlude1_many.cc b/src/bin/cxx/image_blend_occlude1_many.cc index ca441ac..e8a8a2d 100644 --- a/src/bin/cxx/image_blend_occlude1_many.cc +++ b/src/bin/cxx/image_blend_occlude1_many.cc @@ -34,14 +34,14 @@ static void _setup(void) images.push_back(o); if (i < (OBNUM / 2)) { - o.file_set(build_path("logo.png"), ""); + eo_do(o._eo_ptr(), efl_file_set(build_path("logo.png"), NULL)); // XXX } else { Evas_Coord x, y; x = (win_w / 4) + (((rnd() & 0xff) * ((win_w / 2) - 120)) >> 8); y = (win_h / 4) + (((rnd() & 0xff) * ((win_h / 2) - 120)) >> 8); - o.file_set(build_path("image.png"), ""); + eo_do(o._eo_ptr(), efl_file_set(build_path("image.png"), NULL)); // XXX o.evas::object::position_set(x, y); } o.fill_set(0, 0, 120, 160); @@ -73,7 +73,7 @@ static void _loop(double t, int f) Evas_Coord y = (win_h / 2) - (h / 2); x += sin((double)(f + (i * 13)) / (36.7 * SLOW)) * (w / 2); y += cos((double)(f + (i * 28)) / (43.8 * SLOW)) * (h / 2); - img.position_set(x, y); + img.evas::object::position_set(x, y); } ++i; } diff --git a/src/bin/cxx/image_blend_occlude1_very_many.cc b/src/bin/cxx/image_blend_occlude1_very_many.cc index 546ab20..985b636 100644 --- a/src/bin/cxx/image_blend_occlude1_very_many.cc +++ b/src/bin/cxx/image_blend_occlude1_very_many.cc @@ -36,13 +36,13 @@ static void _setup(void) images.push_back(o); if (i < (OBNUM / 2)) { - o.file_set(build_path("logo.png"), ""); + eo_do(o._eo_ptr(), efl_file_set(build_path("logo.png"), NULL)); // XXX } else { Evas_Coord x = (win_w / 4) + (((rnd() & 0xff) * ((win_w / 2) - 120)) >> 8); Evas_Coord y = (win_h / 4) + (((rnd() & 0xff) * ((win_h / 2) - 120)) >> 8); - o.file_set(build_path("image.png"), ""); + eo_do(o._eo_ptr(), efl_file_set(build_path("image.png"), NULL)); // XXX o.evas::object::position_set(x, y); } o.fill_set(0, 0, 120, 160); @@ -74,7 +74,7 @@ static void _loop(double t, int f) x += sin((double)(f + (i * 13)) / (36.7 * SLOW)) * (w / 2); Evas_Coord y = (win_h / 2) - (h / 2); y += cos((double)(f + (i * 28)) / (43.8 * SLOW)) * (h / 2); - img.position_set(x, y); + img.evas::object::position_set(x, y); } ++i; } diff --git a/src/bin/cxx/image_blend_occlude2.cc b/src/bin/cxx/image_blend_occlude2.cc index e5b786e..7b1c0f3 100644 --- a/src/bin/cxx/image_blend_occlude2.cc +++ b/src/bin/cxx/image_blend_occlude2.cc @@ -33,14 +33,14 @@ static void _setup(void) images.push_back(o); if (i & 0x1) { - o.file_set(build_path("logo.png"), ""); + eo_do(o._eo_ptr(), efl_file_set(build_path("logo.png"), NULL)); // XXX } else { Evas_Coord x, y; x = (win_w / 4) + (((rnd() & 0xff) * ((win_w / 2) - 120)) >> 8); y = (win_h / 4) + (((rnd() & 0xff) * ((win_h / 2) - 120)) >> 8); - o.file_set(build_path("image.png"), ""); + eo_do(o._eo_ptr(), efl_file_set(build_path("image.png"), NULL)); // XXX o.evas::object::position_set(x, y); } o.fill_set(0, 0, 120, 160); @@ -72,7 +72,7 @@ static void _loop(double t, int f) x += sin((double)(f + (i * 13)) / (36.7 * SLOW)) * (w / 2); Evas_Coord y = (win_h / 2) - (h / 2); y += cos((double)(f + (i * 28)) / (43.8 * SLOW)) * (h / 2); - img.position_set(x, y); + img.evas::object::position_set(x, y); } ++i; } diff --git a/src/bin/cxx/image_blend_occlude2_few.cc b/src/bin/cxx/image_blend_occlude2_few.cc index c2c458c..0f08934 100644 --- a/src/bin/cxx/image_blend_occlude2_few.cc +++ b/src/bin/cxx/image_blend_occlude2_few.cc @@ -36,13 +36,13 @@ static void _setup(void) images.push_back(o); if (i & 0x1) { - o.file_set(build_path("logo.png"), ""); + eo_do(o._eo_ptr(), efl_file_set(build_path("logo.png"), NULL)); // XXX } else { Evas_Coord x = (win_w / 4) + (((rnd() & 0xff) * ((win_w / 2) - 120)) >> 8); Evas_Coord y = (win_h / 4) + (((rnd() & 0xff) * ((win_h / 2) - 120)) >> 8); - o.file_set(build_path("image.png"), ""); + eo_do(o._eo_ptr(), efl_file_set(build_path("image.png"), NULL)); // XXX o.evas::object::position_set(x, y); } o.fill_set(0, 0, 120, 160); @@ -74,7 +74,7 @@ static void _loop(double t, int f) x += sin((double)(f + (i * 13)) / (36.7 * SLOW)) * (w / 2); Evas_Coord y = (win_h / 2) - (h / 2); y += cos((double)(f + (i * 28)) / (43.8 * SLOW)) * (h / 2); - img.position_set(x, y); + img.evas::object::position_set(x, y); } ++i; } diff --git a/src/bin/cxx/image_blend_occlude2_many.cc b/src/bin/cxx/image_blend_occlude2_many.cc index b98f161..4ab8cce 100644 --- a/src/bin/cxx/image_blend_occlude2_many.cc +++ b/src/bin/cxx/image_blend_occlude2_many.cc @@ -36,7 +36,7 @@ static void _setup(void) images.push_back(o); if (i & 0x1) { - o.file_set(build_path("logo.png"), ""); + eo_do(o._eo_ptr(), efl_file_set(build_path("logo.png"), NULL)); // XXX } else { @@ -44,7 +44,7 @@ static void _setup(void) x = (win_w / 4) + (((rnd() & 0xff) * ((win_w / 2) - 120)) >> 8); y = (win_h / 4) + (((rnd() & 0xff) * ((win_h / 2) - 120)) >> 8); - o.file_set(build_path("image.png"), ""); + eo_do(o._eo_ptr(), efl_file_set(build_path("image.png"), NULL)); // XXX o.evas::object::position_set(x, y); } o.fill_set(0, 0, 120, 160); @@ -76,7 +76,7 @@ static void _loop(double t, int f) x += sin((double)(f + (i * 13)) / (36.7 * SLOW)) * (w / 2); Evas_Coord y = (win_h / 2) - (h / 2); y += cos((double)(f + (i * 28)) / (43.8 * SLOW)) * (h / 2); - img.position_set(x, y); + img.evas::object::position_set(x, y); } ++i; } diff --git a/src/bin/cxx/image_blend_occlude2_very_many.cc b/src/bin/cxx/image_blend_occlude2_very_many.cc index 49ef504..cf34fb8 100644 --- a/src/bin/cxx/image_blend_occlude2_very_many.cc +++ b/src/bin/cxx/image_blend_occlude2_very_many.cc @@ -36,13 +36,13 @@ static void _setup(void) images.push_back(o); if (i & 0x1) { - o.file_set(build_path("logo.png"), ""); + eo_do(o._eo_ptr(), efl_file_set(build_path("logo.png"), NULL)); // XXX } else { Evas_Coord x = (win_w / 4) + (((rnd() & 0xff) * ((win_w / 2) - 120)) >> 8); Evas_Coord y = (win_h / 4) + (((rnd() & 0xff) * ((win_h / 2) - 120)) >> 8); - o.file_set(build_path("image.png"), ""); + eo_do(o._eo_ptr(), efl_file_set(build_path("image.png"), NULL)); // XXX o.evas::object::position_set(x, y); } o.fill_set(0, 0, 120, 160); @@ -74,7 +74,7 @@ static void _loop(double t, int f) x += sin((double)(f + (i * 13)) / (36.7 * SLOW)) * (w / 2); Evas_Coord y = (win_h / 2) - (h / 2); y += cos((double)(f + (i * 28)) / (43.8 * SLOW)) * (h / 2); - img.position_set(x, y); + img.evas::object::position_set(x, y); } ++i; } diff --git a/src/bin/cxx/image_blend_occlude3.cc b/src/bin/cxx/image_blend_occlude3.cc index 22dd3d9..86b6381 100644 --- a/src/bin/cxx/image_blend_occlude3.cc +++ b/src/bin/cxx/image_blend_occlude3.cc @@ -33,7 +33,7 @@ static void _setup(void) images.push_back(o); if (i > (OBNUM / 2)) { - o.file_set(build_path("logo.png"), ""); + eo_do(o._eo_ptr(), efl_file_set(build_path("logo.png"), NULL)); // XXX } else { @@ -41,7 +41,7 @@ static void _setup(void) x = (win_w / 4) + (((rnd() & 0xff) * ((win_w / 2) - 120)) >> 8); y = (win_h / 4) + (((rnd() & 0xff) * ((win_h / 2) - 120)) >> 8); - o.file_set(build_path("image.png"), ""); + eo_do(o._eo_ptr(), efl_file_set(build_path("image.png"), NULL)); // XXX o.evas::object::position_set(x, y); } o.fill_set(0, 0, 120, 160); @@ -73,7 +73,7 @@ static void _loop(double t, int f) x += sin((double)(f + (i * 13)) / (36.7 * SLOW)) * (w / 2); Evas_Coord y = (win_h / 2) - (h / 2); y += cos((double)(f + (i * 28)) / (43.8 * SLOW)) * (h / 2); - img.position_set(x, y); + img.evas::object::position_set(x, y); } ++i; } diff --git a/src/bin/cxx/image_blend_occlude3_few.cc b/src/bin/cxx/image_blend_occlude3_few.cc index bfcbee3..69cbabd 100644 --- a/src/bin/cxx/image_blend_occlude3_few.cc +++ b/src/bin/cxx/image_blend_occlude3_few.cc @@ -36,7 +36,7 @@ static void _setup(void) images.push_back(o); if (i > (OBNUM / 2)) { - o.file_set(build_path("logo.png"), ""); + eo_do(o._eo_ptr(), efl_file_set(build_path("logo.png"), NULL)); // XXX } else { @@ -44,7 +44,7 @@ static void _setup(void) x = (win_w / 4) + (((rnd() & 0xff) * ((win_w / 2) - 120)) >> 8); y = (win_h / 4) + (((rnd() & 0xff) * ((win_h / 2) - 120)) >> 8); - o.file_set(build_path("image.png"), ""); + eo_do(o._eo_ptr(), efl_file_set(build_path("image.png"), NULL)); // XXX o.evas::object::position_set(x, y); } o.fill_set(0, 0, 120, 160); @@ -76,7 +76,7 @@ static void _loop(double t, int f) x += sin((double)(f + (i * 13)) / (36.7 * SLOW)) * (w / 2); Evas_Coord y = (win_h / 2) - (h / 2); y += cos((double)(f + (i * 28)) / (43.8 * SLOW)) * (h / 2); - img.position_set(x, y); + img.evas::object::position_set(x, y); } ++i; } diff --git a/src/bin/cxx/image_blend_occlude3_many.cc b/src/bin/cxx/image_blend_occlude3_many.cc index b9a3df2..714d5eb 100644 --- a/src/bin/cxx/image_blend_occlude3_many.cc +++ b/src/bin/cxx/image_blend_occlude3_many.cc @@ -34,13 +34,13 @@ static void _setup(void) images.push_back(o); if (i > (OBNUM / 2)) { - o.file_set(build_path("logo.png"), ""); + eo_do(o._eo_ptr(), efl_file_set(build_path("logo.png"), NULL)); // XXX } else { Evas_Coord x = (win_w / 4) + (((rnd() & 0xff) * ((win_w / 2) - 120)) >> 8); Evas_Coord y = (win_h / 4) + (((rnd() & 0xff) * ((win_h / 2) - 120)) >> 8); - o.file_set(build_path("image.png"), ""); + eo_do(o._eo_ptr(), efl_file_set(build_path("image.png"), NULL)); // XXX o.evas::object::position_set(x, y); } o.fill_set(0, 0, 120, 160); @@ -72,7 +72,7 @@ static void _loop(double t, int f) x += sin((double)(f + (i * 13)) / (36.7 * SLOW)) * (w / 2); Evas_Coord y = (win_h / 2) - (h / 2); y += cos((double)(f + (i * 28)) / (43.8 * SLOW)) * (h / 2); - img.position_set(x, y); + img.evas::object::position_set(x, y); } ++i; } diff --git a/src/bin/cxx/image_blend_occlude3_very_many.cc b/src/bin/cxx/image_blend_occlude3_very_many.cc index e2326f9..36b51e2 100644 --- a/src/bin/cxx/image_blend_occlude3_very_many.cc +++ b/src/bin/cxx/image_blend_occlude3_very_many.cc @@ -35,13 +35,13 @@ static void _setup(void) images.push_back(o); if (i > (OBNUM / 2)) { - o.file_set(build_path("logo.png"), ""); + eo_do(o._eo_ptr(), efl_file_set(build_path("logo.png"), NULL)); // XXX } else { Evas_Coord x = (win_w / 4) + (((rnd() & 0xff) * ((win_w / 2) - 120)) >> 8); Evas_Coord y = (win_h / 4) + (((rnd() & 0xff) * ((win_h / 2) - 120)) >> 8); - o.file_set(build_path("image.png"), ""); + eo_do(o._eo_ptr(), efl_file_set(build_path("image.png"), NULL)); // XXX o.evas::object::position_set(x, y); } o.fill_set(0, 0, 120, 160); @@ -73,7 +73,7 @@ static void _loop(double t, int f) x += sin((double)(f + (i * 13)) / (36.7 * SLOW)) * (w / 2); Evas_Coord y = (win_h / 2) - (h / 2); y += cos((double)(f + (i * 28)) / (43.8 * SLOW)) * (h / 2); - img.position_set(x, y); + img.evas::object::position_set(x, y); } ++i; } diff --git a/src/bin/cxx/image_blend_smooth_same_scaled.cc b/src/bin/cxx/image_blend_smooth_same_scaled.cc index 7f992b7..c7a9a89 100644 --- a/src/bin/cxx/image_blend_smooth_same_scaled.cc +++ b/src/bin/cxx/image_blend_smooth_same_scaled.cc @@ -29,7 +29,7 @@ static void _setup(void) { evas::image o(efl::eo::parent = canvas); images.push_back(o); - o.file_set(build_path("logo.png"), ""); + eo_do(o._eo_ptr(), efl_file_set(build_path("logo.png"), NULL)); // XXX o.smooth_scale_set(1); o.visibility_set(true); } @@ -58,7 +58,7 @@ static void _loop(double t, int f) x += sin((double)(f + (i * 13)) / (36.7 * SLOW)) * (w0 / 2); Evas_Coord y = (win_h / 2) - (h / 2); y += cos((double)(f + (i * 28)) / (43.8 * SLOW)) * (h0 / 2); - img.position_set(x, y); + img.evas::object::position_set(x, y); img.evas::object::size_set(w, h); img.fill_set(0, 0, w, h); ++i; diff --git a/src/bin/cxx/image_blend_smooth_scaled.cc b/src/bin/cxx/image_blend_smooth_scaled.cc index e0ec1fd..ece6c14 100644 --- a/src/bin/cxx/image_blend_smooth_scaled.cc +++ b/src/bin/cxx/image_blend_smooth_scaled.cc @@ -28,7 +28,7 @@ static void _setup(void) { evas::image o(efl::eo::parent = canvas); images.push_back(o); - o.file_set(build_path("logo.png"), ""); + eo_do(o._eo_ptr(), efl_file_set(build_path("logo.png"), NULL)); // XXX o.smooth_scale_set(1); o.visibility_set(true); } @@ -54,11 +54,11 @@ static void _loop(double t, int f) Evas_Coord w = 5 + ((1.0 + cos((double)(f + (i * 10)) / (7.4 * SLOW) )) * w0 * 2); Evas_Coord h = 5 + ((1.0 + sin((double)(f + (i * 19)) / (12.6 * SLOW) )) * h0 * 2); Evas_Coord x = (win_w / 2) - (w / 2); - x += sin((double)(f + (i * 13)) / (36.7 * SLOW)) * (w0 / 2); + x += ::sin((double)(f + (i * 13)) / (36.7 * SLOW)) * (w0 / 2); Evas_Coord y = (win_h / 2) - (h / 2); - y += cos((double)(f + (i * 28)) / (43.8 * SLOW)) * (h0 / 2); - img.position_set(x, y); - img.size_set(w, h); + y += ::cos((double)(f + (i * 28)) / (43.8 * SLOW)) * (h0 / 2); + img.evas::object::position_set(x, y); + img.evas::object::size_set(w, h); img.fill_set(0, 0, w, h); ++i; } diff --git a/src/bin/cxx/image_blend_smooth_solid_same_scaled.cc b/src/bin/cxx/image_blend_smooth_solid_same_scaled.cc index d9939d9..bad5a53 100644 --- a/src/bin/cxx/image_blend_smooth_solid_same_scaled.cc +++ b/src/bin/cxx/image_blend_smooth_solid_same_scaled.cc @@ -28,7 +28,7 @@ static void _setup(void) { evas::image o(efl::eo::parent = canvas); images.push_back(o); - o.file_set(build_path("image.png"), ""); + eo_do(o._eo_ptr(), efl_file_set(build_path("image.png"), NULL)); // XXX o.smooth_scale_set(1); o.visibility_set(true); } @@ -57,8 +57,8 @@ static void _loop(double t, int f) x += sin((double)(f + (i * 13)) / (36.7 * SLOW)) * (w0 / 2); Evas_Coord y = (win_h / 2) - (h / 2); y += cos((double)(f + (i * 28)) / (43.8 * SLOW)) * (h0 / 2); - img.position_set(x, y); - img.size_set(w, h); + img.evas::object::position_set(x, y); + img.evas::object::size_set(w, h); img.fill_set(0, 0, w, h); ++i; } diff --git a/src/bin/cxx/image_blend_smooth_solid_scaled.cc b/src/bin/cxx/image_blend_smooth_solid_scaled.cc index 2322358..2bede1a 100644 --- a/src/bin/cxx/image_blend_smooth_solid_scaled.cc +++ b/src/bin/cxx/image_blend_smooth_solid_scaled.cc @@ -28,9 +28,9 @@ static void _setup(void) { evas::image o(efl::eo::parent = canvas); images.push_back(o); - efl_file_set(build_path("image.png"), ""); - efl_image_smooth_scale_set(1); - evas_obj_visibility_set(true); + eo_do(o._eo_ptr(), efl_file_set(build_path("image.png"), NULL)); // XXX + o.smooth_scale_set(1); + o.visibility_set(true); } done = 0; } @@ -54,11 +54,11 @@ static void _loop(double t, int f) Evas_Coord w = 5 + ((1.0 + cos((double)(f + (i * 10)) / (7.4 * SLOW) )) * w0 * 2); Evas_Coord h = 5 + ((1.0 + sin((double)(f + (i * 19)) / (12.6 * SLOW) )) * h0 * 2); Evas_Coord x = (win_w / 2) - (w / 2); - x += sin((double)(f + (i * 13)) / (36.7 * SLOW)) * (w0 / 2); + x += ::sin((double)(f + (i * 13)) / (36.7 * SLOW)) * (w0 / 2); Evas_Coord y = (win_h / 2) - (h / 2); - y += cos((double)(f + (i * 28)) / (43.8 * SLOW)) * (h0 / 2); - img.position_set(x, y); - img.size_set(w, h); + y += ::cos((double)(f + (i * 28)) / (43.8 * SLOW)) * (h0 / 2); + img.evas::object::position_set(x, y); + img.evas::object::size_set(w, h); img.fill_set(0, 0, w, h); ++i; } diff --git a/src/bin/cxx/image_blend_solid_border.cc b/src/bin/cxx/image_blend_solid_border.cc index b4abefe..c29eeeb 100644 --- a/src/bin/cxx/image_blend_solid_border.cc +++ b/src/bin/cxx/image_blend_solid_border.cc @@ -28,7 +28,7 @@ static void _setup(void) { evas::image o(efl::eo::parent = canvas); images.push_back(o); - o.file_set(::build_path("frame.png"), ""); + eo_do(o._eo_ptr(), efl_file_set(::build_path("frame.png"), NULL)); // XXX o.border_set(8, 8, 8, 8); o.visibility_set(true); } diff --git a/src/bin/cxx/image_blend_solid_fade_pow2_unscaled.cc b/src/bin/cxx/image_blend_solid_fade_pow2_unscaled.cc index 6830d65..832f0f2 100644 --- a/src/bin/cxx/image_blend_solid_fade_pow2_unscaled.cc +++ b/src/bin/cxx/image_blend_solid_fade_pow2_unscaled.cc @@ -28,7 +28,7 @@ static void _setup(void) { evas::image o(efl::eo::parent = canvas); images.push_back(o); - o.file_set(::build_path("image.png"), ""); + 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); int a = 256 - (1 << ((rnd() % 8) + 1)); diff --git a/src/bin/cxx/image_blend_solid_fade_unscaled.cc b/src/bin/cxx/image_blend_solid_fade_unscaled.cc index 7fa3ea1..5d63007 100644 --- a/src/bin/cxx/image_blend_solid_fade_unscaled.cc +++ b/src/bin/cxx/image_blend_solid_fade_unscaled.cc @@ -28,8 +28,7 @@ static void _setup(void) { evas::image o(efl::eo::parent = canvas); images.push_back(o); - - o.file_set(::build_path("image.png"), ""); + 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); int a = rnd()&0xff; diff --git a/src/bin/cxx/image_blend_solid_middle_border.cc b/src/bin/cxx/image_blend_solid_middle_border.cc index 80db5cb..24fec7f 100644 --- a/src/bin/cxx/image_blend_solid_middle_border.cc +++ b/src/bin/cxx/image_blend_solid_middle_border.cc @@ -28,7 +28,7 @@ static void _setup(void) { evas::image o(efl::eo::parent = canvas); images.push_back(o); - o.file_set(build_path("bar.png"), ""); + eo_do(o._eo_ptr(), efl_file_set(build_path("bar.png"), NULL)); // XXX o.border_set(6, 6, 6, 6); o.border_center_fill_set(EVAS_BORDER_FILL_SOLID); o.visibility_set(true); @@ -58,7 +58,7 @@ static void _loop(double t, int f) x += sin((double)(f + (i * 13)) / (36.7 * SLOW)) * (w0 / 2); Evas_Coord y = (win_h / 2) - (h / 2); y += cos((double)(f + (i * 28)) / (43.8 * SLOW)) * (h0 / 2); - img.position_set(x, y); + img.evas::object::position_set(x, y); img.evas::object::size_set(w, h); img.fill_set(0, 0, w, h); ++i; diff --git a/src/bin/cxx/image_blend_solid_middle_unscaled.cc b/src/bin/cxx/image_blend_solid_middle_unscaled.cc index 155d5cb..4cfb370 100644 --- a/src/bin/cxx/image_blend_solid_middle_unscaled.cc +++ b/src/bin/cxx/image_blend_solid_middle_unscaled.cc @@ -28,7 +28,7 @@ static void _setup(void) { evas::image o(efl::eo::parent = canvas); images.push_back(o); - o.file_set(build_path("logo.png"), ""); + 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.border_set(43, 48, 48, 83); @@ -58,7 +58,7 @@ static void _loop(double t, int f) x += sin((double)(f + (i * 13)) / (36.7 * SLOW)) * (w / 2); Evas_Coord y = (win_h / 2) - (h / 2); y += cos((double)(f + (i * 28)) / (43.8 * SLOW)) * (h / 2); - img.position_set(x, y); + img.evas::object::position_set(x, y); ++i; } FPS_STD(NAME); diff --git a/src/bin/cxx/image_blend_solid_unscaled.cc b/src/bin/cxx/image_blend_solid_unscaled.cc index 163ae85..5927bec 100644 --- a/src/bin/cxx/image_blend_solid_unscaled.cc +++ b/src/bin/cxx/image_blend_solid_unscaled.cc @@ -28,7 +28,7 @@ static void _setup(void) { evas::image o(efl::eo::parent = canvas); images.push_back(o); - o.file_set(::build_path("image.png"), ""); + 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.visibility_set(true); diff --git a/src/bin/cxx/image_blend_unscaled.cc b/src/bin/cxx/image_blend_unscaled.cc index 479825e..dc0c76f 100644 --- a/src/bin/cxx/image_blend_unscaled.cc +++ b/src/bin/cxx/image_blend_unscaled.cc @@ -28,7 +28,7 @@ static void _setup(void) { evas::image o(efl::eo::parent = canvas); images.push_back(o); - o.file_set(build_path("logo.png"), ""); + 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.visibility_set(true); @@ -56,7 +56,7 @@ static void _loop(double t, int f) x += sin((double)(f + (i * 13)) / (36.7 * SLOW)) * (w / 2); Evas_Coord y = (win_h / 2) - (h / 2); y += cos((double)(f + (i * 28)) / (43.8 * SLOW)) * (h / 2); - img.position_set(x, y); + img.evas::object::position_set(x, y); ++i; } FPS_STD(NAME); diff --git a/src/bin/cxx/image_crossfade.cc b/src/bin/cxx/image_crossfade.cc index e5a0136..f7036ed 100644 --- a/src/bin/cxx/image_crossfade.cc +++ b/src/bin/cxx/image_crossfade.cc @@ -28,14 +28,14 @@ static void _setup(void) evas::image o1(efl::eo::parent = canvas); images.push_back(o1); - o1.file_set(build_path("im1.png"), ""); + eo_do(o1._eo_ptr(), efl_file_set(build_path("im1.png"), NULL)); // XXX o1.fill_set(0, 0, 720, 420); o1.evas::object::size_set(720, 420); o1.visibility_set(true); evas::image o2(efl::eo::parent = canvas); images.push_back(o2); - o2.file_set(build_path("im2.png"), ""); + eo_do(o2._eo_ptr(), efl_file_set(build_path("im2.png"), NULL)); // XXX o2.fill_set(0, 0, 720, 420); o2.evas::object::size_set(720, 420); o2.visibility_set(true); @@ -54,13 +54,11 @@ static void _cleanup(void) /* loop - do things */ static void _loop(double t, int f) { - if (!images.empty()) // XXX - { - int a = f & 0x1f; - a = ((a << 3) | (a >> 2)) & 0xff; - evas::image& img = images.back(); - img.evas::object::color_set(a, a, a, a); - } + if (images.empty()) return; // XXX + int a = f & 0x1f; + a = ((a << 3) | (a >> 2)) & 0xff; + evas::image img = images.back(); + img.evas::object::color_set(a, a, a, a); FPS_STD(NAME); } diff --git a/src/bin/cxx/image_data_argb.cc b/src/bin/cxx/image_data_argb.cc index 5ec5211..2eecb82 100644 --- a/src/bin/cxx/image_data_argb.cc +++ b/src/bin/cxx/image_data_argb.cc @@ -43,6 +43,8 @@ static void _setup(void) /* cleanup */ static void _cleanup(void) { + for (evas::image& img : images) + img.parent_set(efl::eo::base(nullptr)); images.clear(); } @@ -57,7 +59,7 @@ static void _loop(double t, int f) Evas_Coord h = 480; Evas_Coord x = (win_w / 2) - (w / 2); Evas_Coord y = (win_h / 2) - (h / 2); - img.position_set(x, y); + img.evas::object::position_set(x, y); img.evas::object::size_set(w, h); img.fill_set(0, 0, w, h); data = static_cast(img.data_get(1)); diff --git a/src/bin/cxx/image_data_ycbcr601pl.cc b/src/bin/cxx/image_data_ycbcr601pl.cc index 59814bb..6491814 100644 --- a/src/bin/cxx/image_data_ycbcr601pl.cc +++ b/src/bin/cxx/image_data_ycbcr601pl.cc @@ -90,7 +90,7 @@ static void _loop(double t, int f) Evas_Coord h = 480; Evas_Coord x = (win_w / 2) - (w / 2); Evas_Coord y = (win_h / 2) - (h / 2); - img.position_set(x, y); + img.evas::object::position_set(x, y); img.evas::object::size_set(w, h); img.fill_set(0, 0, w, h); img.data_update_add( 0, 0, 640, 480); diff --git a/src/bin/cxx/image_map_3d_1.cc b/src/bin/cxx/image_map_3d_1.cc index 39e6204..4d3dd4f 100644 --- a/src/bin/cxx/image_map_3d_1.cc +++ b/src/bin/cxx/image_map_3d_1.cc @@ -22,7 +22,7 @@ typedef struct _Point typedef struct _Side { - Evas_Object *o; + evas::image o; Point pt[4]; } Side; @@ -47,6 +47,7 @@ static Cube *cubes[5]; 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); @@ -55,17 +56,14 @@ _cube_new(Evas_Coord w, Evas_Coord h, Evas_Coord d) c = static_cast(calloc(1, sizeof(Cube))); for (int i = 0; i < 6; i++) { - Evas_Object *o; char buf[256]; - o = eo_add(EVAS_IMAGE_CLASS, G_evas); - c->side[i].o = o; + c->side[i].o = evas::image(efl::eo::parent = canvas); snprintf(buf, sizeof(buf), "cube%i.png", i + 1); - eo_do(o, - efl_file_set(build_path(buf), NULL), - evas_obj_image_fill_set(0, 0, 256, 256), - evas_obj_size_set(256, 256), - efl_image_smooth_scale_set(0), - evas_obj_visibility_set(EINA_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); @@ -134,14 +132,13 @@ _cube_pos(Cube *c, evas_map_util_3d_perspective(m, (win_w / 2), (win_h / 2), 0, 512); if (evas_map_util_clockwise_get(m)) { - eo_do(c->side[i].o, - evas_obj_map_enable_set(1), - evas_obj_map_set(m), - evas_obj_visibility_set(EINA_TRUE)); + c->side[i].o.map_enable_set(1); + c->side[i].o.map_set(m); + c->side[i].o.visibility_set(true); } else { - eo_do(c->side[i].o, evas_obj_visibility_set(EINA_FALSE)); + c->side[i].o.visibility_set(false); } order[i] = i; @@ -166,16 +163,20 @@ _cube_pos(Cube *c, } while (!sorted); - eo_do(c->side[order[0]].o, evas_obj_raise()); + c->side[order[0]].o.evas::object::raise(); for (i = 1; i < 6; i++) - eo_do(c->side[order[i]].o, evas_obj_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 _cube_free(Cube *c) { - - for (int i = 0; i < 6; i++) eo_del(c->side[i].o); + 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()); + } free(c); } @@ -204,20 +205,20 @@ static void _cleanup(void) /* loop - do things */ static void _loop(double t, int f) { - _cube_pos(cubes[0], + _cube_pos(cubes[0], (win_w / 2) - 640, (win_h / 2) - 256, 512, f / 2.0, f, f / 3.0); - _cube_pos(cubes[1], + _cube_pos(cubes[1], (win_w / 2) + 512, (win_h / 2) - 128, 384, f / 3.0, f / 2.0, f / 4.0); - _cube_pos(cubes[2], - (win_w / 2) - 384, (win_h / 2) + 128, 256, + _cube_pos(cubes[2], + (win_w / 2) - 384, (win_h / 2) + 128, 256, f / 2.0, f / 3.0, f); - _cube_pos(cubes[3], - (win_w / 2) + 256, (win_h / 2) + 64, 128, + _cube_pos(cubes[3], + (win_w / 2) + 256, (win_h / 2) + 64, 128, f, f / 5.0, f / 2.0); - _cube_pos(cubes[4], - (win_w / 2), (win_h / 2), 0, + _cube_pos(cubes[4], + (win_w / 2), (win_h / 2), 0, f / 4.0, f / 3.0, f / 5.0); FPS_STD(NAME); } diff --git a/src/bin/cxx/image_map_3d_2.cc b/src/bin/cxx/image_map_3d_2.cc index 50b6030..f39531f 100644 --- a/src/bin/cxx/image_map_3d_2.cc +++ b/src/bin/cxx/image_map_3d_2.cc @@ -22,7 +22,7 @@ typedef struct _Point typedef struct _Side { - Evas_Object *o; + evas::image o; Point pt[4]; } Side; @@ -47,24 +47,21 @@ static Cube *cubes[5]; 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(calloc(1, sizeof(Cube))); for (int i = 0; i < 6; i++) { - Evas_Object *o; char buf[256]; - o = eo_add(EVAS_IMAGE_CLASS, G_evas); - c->side[i].o = o; + c->side[i].o = evas::image(efl::eo::parent = canvas); snprintf(buf, sizeof(buf), "cube%i.png", i + 1); - eo_do(o, - efl_file_set(build_path(buf), NULL), - evas_obj_image_fill_set(0, 0, 256, 256), - evas_obj_size_set(256, 256), - evas_obj_visibility_set(EINA_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); @@ -132,14 +129,13 @@ _cube_pos(Cube *c, evas_map_util_3d_perspective(m, (win_w / 2), (win_h / 2), 0, 512); if (evas_map_util_clockwise_get(m)) { - eo_do(c->side[i].o, - evas_obj_map_enable_set(1), - evas_obj_map_set(m), - evas_obj_visibility_set(EINA_TRUE)); + c->side[i].o.map_enable_set(1); + c->side[i].o.map_set(m); + c->side[i].o.visibility_set(true); } else { - eo_do(c->side[i].o, evas_obj_visibility_set(EINA_FALSE)); + c->side[i].o.visibility_set(false); } order[i] = i; @@ -164,16 +160,20 @@ _cube_pos(Cube *c, } while (!sorted); - eo_do(c->side[order[0]].o, evas_obj_raise()); + c->side[order[0]].o.raise(); for (i = 1; i < 6; i++) - eo_do(c->side[order[i]].o, evas_obj_stack_below(c->side[order[i - 1]].o)); + c->side[order[i]].o.stack_below(c->side[order[i - 1]].o); } static void _cube_free(Cube *c) { - - for (int i = 0; i < 6; i++) eo_del(c->side[i].o); + 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()); + } free(c); } diff --git a/src/bin/cxx/image_map_3d_3.cc b/src/bin/cxx/image_map_3d_3.cc index 3812c6d..9038e92 100644 --- a/src/bin/cxx/image_map_3d_3.cc +++ b/src/bin/cxx/image_map_3d_3.cc @@ -22,7 +22,7 @@ typedef struct _Point typedef struct _Side { - Evas_Object *o; + evas::image o; Point pt[4]; } Side; @@ -47,6 +47,7 @@ static Cube *cubes[5]; 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); @@ -55,17 +56,14 @@ _cube_new(Evas_Coord w, Evas_Coord h, Evas_Coord d) c = static_cast(calloc(1, sizeof(Cube))); for (int i = 0; i < 6; i++) { - Evas_Object *o; char buf[256]; - o = eo_add(EVAS_IMAGE_CLASS, G_evas); - c->side[i].o = o; + c->side[i].o = evas::image(efl::eo::parent = canvas); snprintf(buf, sizeof(buf), "cube%i.png", i + 1); - eo_do(o, - efl_file_set(build_path(buf), NULL), - evas_obj_image_fill_set(0, 0, 256, 256), - evas_obj_size_set(256, 256), - efl_image_smooth_scale_set(0), - evas_obj_visibility_set(EINA_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); @@ -132,9 +130,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); - eo_do(c->side[i].o, - evas_obj_map_enable_set(1), - evas_obj_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++) @@ -158,16 +155,20 @@ _cube_pos(Cube *c, } while (!sorted); - eo_do(c->side[order[0]].o, evas_obj_raise()); + c->side[order[0]].o.raise(); for (i = 1; i < 6; i++) - eo_do(c->side[order[i]].o, evas_obj_stack_below(c->side[order[i - 1]].o)); + c->side[order[i]].o.stack_below(c->side[order[i - 1]].o); } static void _cube_free(Cube *c) { - - for (int i = 0; i < 6; i++) eo_del(c->side[i].o); + 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()); + } free(c); } diff --git a/src/bin/cxx/image_map_3d_4.cc b/src/bin/cxx/image_map_3d_4.cc index 5e48a19..cd360b7 100644 --- a/src/bin/cxx/image_map_3d_4.cc +++ b/src/bin/cxx/image_map_3d_4.cc @@ -1,4 +1,3 @@ - #ifdef HAVE_CONFIG_H # include #endif @@ -22,7 +21,7 @@ typedef struct _Point typedef struct _Side { - Evas_Object *o; + evas::image o; Point pt[4]; } Side; @@ -47,6 +46,7 @@ static Cube *cubes[5]; 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); @@ -55,16 +55,13 @@ _cube_new(Evas_Coord w, Evas_Coord h, Evas_Coord d) c = static_cast(calloc(1, sizeof(Cube))); for (int i = 0; i < 6; i++) { - Evas_Object *o; char buf[256]; - o = eo_add(EVAS_IMAGE_CLASS, G_evas); - c->side[i].o = o; + c->side[i].o = evas::image(efl::eo::parent = canvas); snprintf(buf, sizeof(buf), "cube%i.png", i + 1); - eo_do(o, - efl_file_set(build_path(buf), NULL), - evas_obj_image_fill_set(0, 0, 256, 256), - evas_obj_size_set(256, 256), - evas_obj_visibility_set(EINA_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); @@ -130,9 +127,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); - eo_do(c->side[i].o, - evas_obj_map_enable_set(1), - evas_obj_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++) @@ -156,16 +152,20 @@ _cube_pos(Cube *c, } while (!sorted); - eo_do(c->side[order[0]].o, evas_obj_raise()); + c->side[order[0]].o.raise(); for (i = 1; i < 6; i++) - eo_do(c->side[order[i]].o, evas_obj_stack_below(c->side[order[i - 1]].o)); + c->side[order[i]].o.stack_below(c->side[order[i - 1]].o); } static void _cube_free(Cube *c) { - - for (int i = 0; i < 6; i++) eo_del(c->side[i].o); + 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()); + } free(c); } diff --git a/src/bin/cxx/image_map_3d_5.cc b/src/bin/cxx/image_map_3d_5.cc index fadb253..896ae8b 100644 --- a/src/bin/cxx/image_map_3d_5.cc +++ b/src/bin/cxx/image_map_3d_5.cc @@ -22,7 +22,7 @@ typedef struct _Point typedef struct _Side { - Evas_Object *o; + evas::image o; Point pt[4]; } Side; @@ -47,6 +47,7 @@ static Cube *cubes[1]; 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); @@ -55,17 +56,14 @@ _cube_new(Evas_Coord w, Evas_Coord h, Evas_Coord d) c = static_cast(calloc(1, sizeof(Cube))); for (int i = 0; i < 6; i++) { - Evas_Object *o; char buf[256]; - o = eo_add(EVAS_IMAGE_CLASS, G_evas); - c->side[i].o = o; + c->side[i].o = evas::image(efl::eo::parent = canvas); snprintf(buf, sizeof(buf), "im%i.png", (i % 2) + 1); - eo_do(o, - efl_file_set(build_path(buf), NULL), - evas_obj_image_fill_set(0, 0, 720, 420), - evas_obj_size_set(720, 420), - efl_image_smooth_scale_set(0), - evas_obj_visibility_set(EINA_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); @@ -134,14 +132,13 @@ _cube_pos(Cube *c, evas_map_util_3d_perspective(m, (win_w / 2), (win_h / 2), -360, 720); if (evas_map_util_clockwise_get(m)) { - eo_do(c->side[i].o, - evas_obj_map_enable_set(1), - evas_obj_map_set(m), - evas_obj_visibility_set(EINA_TRUE)); + c->side[i].o.map_enable_set(1); + c->side[i].o.map_set(m); + c->side[i].o.visibility_set(true); } else { - eo_do(c->side[i].o, evas_obj_visibility_set(EINA_FALSE)); + c->side[i].o.visibility_set(false); } order[i] = i; @@ -166,16 +163,20 @@ _cube_pos(Cube *c, } while (!sorted); - eo_do(c->side[order[0]].o, evas_obj_raise()); + c->side[order[0]].o.raise(); for (i = 1; i < 6; i++) - eo_do(c->side[order[i]].o, evas_obj_stack_below(c->side[order[i - 1]].o)); + c->side[order[i]].o.stack_below(c->side[order[i - 1]].o); } static void _cube_free(Cube *c) { - - for (int i = 0; i < 6; i++) eo_del(c->side[i].o); + 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()); + } free(c); } diff --git a/src/bin/cxx/image_map_3d_6.cc b/src/bin/cxx/image_map_3d_6.cc index fe5f671..72f8aaa 100644 --- a/src/bin/cxx/image_map_3d_6.cc +++ b/src/bin/cxx/image_map_3d_6.cc @@ -22,7 +22,7 @@ typedef struct _Point typedef struct _Side { - Evas_Object *o; + evas::image o; Point pt[4]; } Side; @@ -47,6 +47,7 @@ static Cube *cubes[1]; 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); @@ -55,17 +56,14 @@ _cube_new(Evas_Coord w, Evas_Coord h, Evas_Coord d) c = static_cast(calloc(1, sizeof(Cube))); for (int i = 0; i < 6; i++) { - Evas_Object *o; // XXX char buf[256]; - o = eo_add(EVAS_IMAGE_CLASS, G_evas); - c->side[i].o = o; + c->side[i].o = evas::image(efl::eo::parent = canvas); snprintf(buf, sizeof(buf), "im%i.png", (i % 2) + 1); - eo_do(o, - efl_file_set(build_path(buf), NULL), - evas_obj_image_fill_set(0, 0, 720, 420), - evas_obj_size_set(720, 420), - efl_image_smooth_scale_set(0), - evas_obj_visibility_set(EINA_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); @@ -131,14 +129,13 @@ _cube_pos(Cube *c, evas_map_util_3d_perspective(m, (win_w / 2), (win_h / 2), -360, 720); if (evas_map_util_clockwise_get(m)) { - eo_do(c->side[i].o, - evas_obj_map_enable_set(1), - evas_obj_map_set(m), - evas_obj_visibility_set(EINA_TRUE)); + c->side[i].o.map_enable_set(1); + c->side[i].o.map_set(m); + c->side[i].o.visibility_set(true); } else { - eo_do(c->side[i].o, evas_obj_visibility_set(EINA_FALSE)); + c->side[i].o.visibility_set(false); } order[i] = i; @@ -163,16 +160,20 @@ _cube_pos(Cube *c, } while (!sorted); - eo_do(c->side[order[0]].o, evas_obj_raise()); + c->side[order[0]].o.raise(); for (i = 1; i < 6; i++) - eo_do(c->side[order[i]].o, evas_obj_stack_below(c->side[order[i - 1]].o)); + c->side[order[i]].o.stack_below(c->side[order[i - 1]].o); } static void _cube_free(Cube *c) { - - for (int i = 0; i < 6; i++) eo_del(c->side[i].o); + 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()); + } free(c); } diff --git a/src/bin/cxx/image_map_3d_flow.cc b/src/bin/cxx/image_map_3d_flow.cc index 3c948eb..c8b22c0 100644 --- a/src/bin/cxx/image_map_3d_flow.cc +++ b/src/bin/cxx/image_map_3d_flow.cc @@ -34,7 +34,7 @@ static void _setup(void) evas::image o1(efl::eo::parent = canvas); snprintf(buf, sizeof(buf), "cube%i.png", (i % 6) + 1); // XXX - o1.file_set(build_path(buf), ""); + eo_do(o1._eo_ptr(), efl_file_set(build_path(buf), NULL)); // XXX o1.fill_set(0, 0, 256, 256); o1.evas::object::size_set(256, 256); o1.smooth_scale_set(0); @@ -43,7 +43,7 @@ static void _setup(void) evas::image o2(efl::eo::parent = canvas); snprintf(buf, sizeof(buf), "cube%i.png", (i % 6) + 1); // XXX - o2.file_set(build_path(buf), ""); + eo_do(o2._eo_ptr(), efl_file_set(build_path(buf), NULL)); // XXX o2.fill_set(0, 0, 256, 256); o2.size_set(256, 256); o2.smooth_scale_set(0); @@ -59,6 +59,7 @@ static void _cleanup(void) for (evas::image& i : images) i.parent_set(efl::eo::base(nullptr)); images.clear(); + for (evas::image& i : reflec) i.parent_set(efl::eo::base(nullptr)); reflec.clear(); diff --git a/src/bin/cxx/image_map_color_alpha_nearest_rotate.cc b/src/bin/cxx/image_map_color_alpha_nearest_rotate.cc index 6f9c403..754676c 100644 --- a/src/bin/cxx/image_map_color_alpha_nearest_rotate.cc +++ b/src/bin/cxx/image_map_color_alpha_nearest_rotate.cc @@ -29,7 +29,7 @@ static void _setup(void) { evas::image o(efl::eo::parent = canvas); images.push_back(o); - o.file_set(build_path("logo.png"), ""); + 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.smooth_scale_set(0); diff --git a/src/bin/cxx/image_map_color_alpha_nearest_solid_rotate.cc b/src/bin/cxx/image_map_color_alpha_nearest_solid_rotate.cc index 6ef910e..a08f090 100644 --- a/src/bin/cxx/image_map_color_alpha_nearest_solid_rotate.cc +++ b/src/bin/cxx/image_map_color_alpha_nearest_solid_rotate.cc @@ -29,7 +29,7 @@ static void _setup(void) { evas::image o(efl::eo::parent = canvas); images.push_back(o); - o.file_set(build_path("image.png"), ""); + 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.smooth_scale_set(0); diff --git a/src/bin/cxx/image_map_color_alpha_rotate.cc b/src/bin/cxx/image_map_color_alpha_rotate.cc index 4fc4c88..c57fc70 100644 --- a/src/bin/cxx/image_map_color_alpha_rotate.cc +++ b/src/bin/cxx/image_map_color_alpha_rotate.cc @@ -29,7 +29,7 @@ static void _setup(void) { evas::image o(efl::eo::parent = canvas); images.push_back(o); - efl_file_set(build_path("logo.png"), ""); + 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.visibility_set(true); diff --git a/src/bin/cxx/image_map_color_alpha_solid_rotate.cc b/src/bin/cxx/image_map_color_alpha_solid_rotate.cc index d8f0a1f..b600dbf 100644 --- a/src/bin/cxx/image_map_color_alpha_solid_rotate.cc +++ b/src/bin/cxx/image_map_color_alpha_solid_rotate.cc @@ -29,7 +29,7 @@ static void _setup(void) { evas::image o(efl::eo::parent = canvas); images.push_back(o); - o.file_set(build_path("image.png"), ""); + 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.visibility_set(true); diff --git a/src/bin/cxx/image_map_color_nearest_rotate.cc b/src/bin/cxx/image_map_color_nearest_rotate.cc index 28f3e7a..d225a15 100644 --- a/src/bin/cxx/image_map_color_nearest_rotate.cc +++ b/src/bin/cxx/image_map_color_nearest_rotate.cc @@ -29,7 +29,7 @@ static void _setup(void) { evas::image o(efl::eo::parent = canvas); images.push_back(o); - o.file_set(build_path("logo.png"), ""); + 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.smooth_scale_set(0); diff --git a/src/bin/cxx/image_map_color_nearest_solid_rotate.cc b/src/bin/cxx/image_map_color_nearest_solid_rotate.cc index 488414a..4908e39 100644 --- a/src/bin/cxx/image_map_color_nearest_solid_rotate.cc +++ b/src/bin/cxx/image_map_color_nearest_solid_rotate.cc @@ -29,7 +29,7 @@ static void _setup(void) { evas::image o(efl::eo::parent = canvas); images.push_back(o); - o.file_set(build_path("image.png"), ""); + 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.smooth_scale_set(0); diff --git a/src/bin/cxx/image_map_color_rotate.cc b/src/bin/cxx/image_map_color_rotate.cc index 23e906e..787681a 100644 --- a/src/bin/cxx/image_map_color_rotate.cc +++ b/src/bin/cxx/image_map_color_rotate.cc @@ -29,7 +29,7 @@ static void _setup(void) { evas::image o(efl::eo::parent = canvas); images.push_back(o); - o.file_set(build_path("logo.png"), ""); + 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.visibility_set(true); diff --git a/src/bin/cxx/image_map_color_solid_rotate.cc b/src/bin/cxx/image_map_color_solid_rotate.cc index 8a30a41..b4f1426 100644 --- a/src/bin/cxx/image_map_color_solid_rotate.cc +++ b/src/bin/cxx/image_map_color_solid_rotate.cc @@ -29,7 +29,7 @@ static void _setup(void) { evas::image o(efl::eo::parent = canvas); images.push_back(o); - o.file_set(build_path("image.png"), ""); + 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.visibility_set(true); diff --git a/src/bin/cxx/image_map_nearest_rotate.cc b/src/bin/cxx/image_map_nearest_rotate.cc index 92dd81c..8c6bb1f 100644 --- a/src/bin/cxx/image_map_nearest_rotate.cc +++ b/src/bin/cxx/image_map_nearest_rotate.cc @@ -29,7 +29,7 @@ static void _setup(void) { evas::image o(efl::eo::parent = canvas); images.push_back(o); - o.file_set(build_path("logo.png"), ""); + 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.smooth_scale_set(0); diff --git a/src/bin/cxx/image_map_nearest_solid_rotate.cc b/src/bin/cxx/image_map_nearest_solid_rotate.cc index f50eee7..b7ce0ef 100644 --- a/src/bin/cxx/image_map_nearest_solid_rotate.cc +++ b/src/bin/cxx/image_map_nearest_solid_rotate.cc @@ -29,7 +29,7 @@ static void _setup(void) { evas::image o(efl::eo::parent = canvas); images.push_back(o); - o.file_set(build_path("image.png"), ""); + 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.smooth_scale_set(0); diff --git a/src/bin/cxx/image_map_rotate.cc b/src/bin/cxx/image_map_rotate.cc index 527939e..ca2502c 100644 --- a/src/bin/cxx/image_map_rotate.cc +++ b/src/bin/cxx/image_map_rotate.cc @@ -29,7 +29,7 @@ static void _setup(void) { evas::image o(efl::eo::parent = canvas); images.push_back(o); - o.file_set(build_path("logo.png"), ""); + 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.visibility_set(true); diff --git a/src/bin/cxx/image_map_solid_rotate.cc b/src/bin/cxx/image_map_solid_rotate.cc index 30eef29..e570285 100644 --- a/src/bin/cxx/image_map_solid_rotate.cc +++ b/src/bin/cxx/image_map_solid_rotate.cc @@ -29,7 +29,7 @@ static void _setup(void) { evas::image o(efl::eo::parent = canvas); images.push_back(o); - o.file_set(build_path("image.png"), ""); + 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); diff --git a/src/bin/cxx/image_quality_scale.cc b/src/bin/cxx/image_quality_scale.cc index f3b42e9..35a0184 100644 --- a/src/bin/cxx/image_quality_scale.cc +++ b/src/bin/cxx/image_quality_scale.cc @@ -29,7 +29,7 @@ static void _setup(void) { evas::image o(efl::eo::parent = canvas); images.push_back(o); - o.file_set(build_path("tp.png"), ""); + eo_do(o._eo_ptr(), efl_file_set(build_path("tp.png"), NULL)); // XXX o.fill_set(0, 0, 640, 480); o.evas::object::size_set(640, 480); o.visibility_set(true); @@ -56,8 +56,8 @@ static void _loop(double t, int f) h *= (f / 100.0) * 4.0; Evas_Coord x = (win_w / 2) - (w / 2); Evas_Coord y = (win_h / 2) - (h / 2); - img.position_set(x, y); - img.size_set(w, h); + img.evas::object::position_set(x, y); + img.evas::object::size_set(w, h); img.fill_set(0, 0, w, h); } FPS_STD(NAME); diff --git a/src/bin/cxx/line_blend.cc b/src/bin/cxx/line_blend.cc index 2c2b655..41c71d3 100644 --- a/src/bin/cxx/line_blend.cc +++ b/src/bin/cxx/line_blend.cc @@ -33,7 +33,7 @@ static void _setup(void) int r = ((rnd()&0xff) * a) / 255; int g = ((rnd()&0xff) * a) / 255; int b = ((rnd()&0xff) * a) / 255; - o.color_set(r, g, b, a); + o.evas::object::color_set(r, g, b, a); o.xy_set(((win_w / 2) * (rnd()&0xff)) / 255, ((win_h / 2) * (rnd()&0xff)) / 255, ((win_w / 2) * (rnd()&0xff)) / 255 + (win_w / 2), @@ -46,6 +46,8 @@ static void _setup(void) /* cleanup */ static void _cleanup() { + for (evas::line l : lines) + l.parent_set(efl::eo::base(nullptr)); lines.clear(); } diff --git a/src/bin/cxx/proxy_image.cc b/src/bin/cxx/proxy_image.cc index c8582d1..c9dc678 100644 --- a/src/bin/cxx/proxy_image.cc +++ b/src/bin/cxx/proxy_image.cc @@ -26,7 +26,7 @@ static void _setup(void) evas::canvas canvas(::eo_ref(G_evas)); evas::image src(efl::eo::parent = canvas); - src.file_set(build_path("logo.png"), ""); + eo_do(src._eo_ptr(), efl_file_set(build_path("logo.png"), NULL)); // XXX src.fill_set(0, 0, 120, 160); src.evas::object::size_set(120, 160); images.push_back(src); @@ -62,7 +62,7 @@ static void _loop(double t, int f) x += sin((double)(f + (i * 13)) / (36.7 * SLOW)) * (w / 2); Evas_Coord y = (win_h / 2) - (h / 2); y += cos((double)(f + (i * 28)) / (43.8 * SLOW)) * (h / 2); - img.position_set(x, y); + img.evas::object::position_set(x, y); ++i; } FPS_STD(NAME); diff --git a/src/bin/cxx/proxy_image_offscreen.cc b/src/bin/cxx/proxy_image_offscreen.cc index 0a492d5..68b5d58 100644 --- a/src/bin/cxx/proxy_image_offscreen.cc +++ b/src/bin/cxx/proxy_image_offscreen.cc @@ -26,7 +26,7 @@ static void _setup(void) evas::canvas canvas(::eo_ref(G_evas)); evas::image o(efl::eo::parent = canvas); - o.file_set(build_path("logo.png"), ""); + 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); diff --git a/src/bin/cxx/proxy_text_fixed.cc b/src/bin/cxx/proxy_text_fixed.cc index 9d87d89..5eada1f 100644 --- a/src/bin/cxx/proxy_text_fixed.cc +++ b/src/bin/cxx/proxy_text_fixed.cc @@ -19,7 +19,7 @@ static int done = 0; /* private data */ -static efl::eina::list texts; +static evas::object *texts[OBNUM]; inline Evas_Text_Style_Type operator++(Evas_Text_Style_Type const& x) @@ -31,71 +31,70 @@ operator++(Evas_Text_Style_Type const& x) /* setup */ static void _setup(void) { -#if 0 - Evas_Object *o,*s; + evas::canvas canvas(::eo_ref(G_evas)); Evas_Text_Style_Type st, i; st = EVAS_TEXT_STYLE_SHADOW; - for (i = 0; st <= EVAS_TEXT_STYLE_FAR_SOFT_SHADOW; i++) + for (; st <= EVAS_TEXT_STYLE_FAR_SOFT_SHADOW; ++i) { - o = eo_add(EVAS_TEXT_CLASS, G_evas); - o_texts[i] = o; - efl_text_properties_font_set("Vera-Bold", 20); - efl_text_set("This is a test string"); - evas_obj_text_style_set(st); - evas_obj_color_set(255, 255, 255, 255); - evas_obj_text_shadow_color_set(0, 0, 0, 24); - evas_obj_text_glow_color_set(100, 80, 40, 100); - evas_obj_text_glow2_color_set(50, 10, 5, 50); - evas_obj_text_outline_color_set(0, 0, 0, 255); - evas_obj_visibility_set(true); - st++; + 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; } st = i; - for ( ; i < OBNUM ; i ++) + for ( ; i < OBNUM ; ++i) { - s = o_texts[i % st]; - o = eo_add(EVAS_IMAGE_CLASS, G_evas); - o_texts[i] = o; - eo_do(o, evas_obj_image_source_set(s)); + 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; - eo_do(s, 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_obj_visibility_set(EINA_TRUE)); + 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; } done = 0; -#endif // XXX } /* cleanup */ static void _cleanup(void) { - texts.clear(); + for (int i = 0; i < OBNUM; i++) // XXX + { + texts[i]->parent_set(efl::eo::base(nullptr)); + texts[i]->_reset(nullptr); + delete texts[i]; + } } /* loop - do things */ static void _loop(double t, int f) { -#if 0 - int i; Evas_Coord x, y, w, h; - for (i = 0; i < OBNUM; i++) + for (int i = 0; i < OBNUM; i++) { - eo_do(o_texts[i], evas_obj_size_get(&w, &h)); + texts[i]->evas::object::size_get(&w, &h); 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 += cos((double)(f + (i * 28)) / (43.8 * SLOW)) * (w / 2); - eo_do(o_texts[i], evas_obj_position_set(x, y)); + y += ::cos((double)(f + (i * 28)) / (43.8 * SLOW)) * (w / 2); + texts[i]->evas::object::position_set(x, y); } FPS_STD(NAME); -#endif // XXX - FPS_STD(NAME); } /* prepend special key handlers if interactive (before STD) */ diff --git a/src/bin/cxx/rect_blend_pow2.cc b/src/bin/cxx/rect_blend_pow2.cc index 4a3d9e2..1af953e 100644 --- a/src/bin/cxx/rect_blend_pow2.cc +++ b/src/bin/cxx/rect_blend_pow2.cc @@ -31,11 +31,11 @@ static void _setup(void) rectangles.push_back(o); int a = 256 - (1 << ((rnd() % 8) + 1)); if (a < 128) a = 128; - int r = ((rnd()&0xff) * a) / 255; - int g = ((rnd()&0xff) * a) / 255; - int b = ((rnd()&0xff) * a) / 255; + int r = ((::rnd()&0xff) * a) / 255; + int g = ((::rnd()&0xff) * a) / 255; + int b = ((::rnd()&0xff) * a) / 255; o.evas::object::color_set(r, g, b, a); - o.evas::object::visibility_set(true); + o.visibility_set(true); } done = 0; } @@ -56,12 +56,12 @@ static void _loop(double t, int f) { Evas_Coord w0 = 80; Evas_Coord h0 = 80; - Evas_Coord w = 5 + ((1.0 + cos((double)(f + (i * 10)) / (7.4 * SLOW) )) * w0 * 2); - Evas_Coord h = 5 + ((1.0 + sin((double)(f + (i * 19)) / (12.6 * SLOW) )) * h0 * 2); + Evas_Coord w = 5 + ((1.0 + ::cos((double)(f + (i * 10)) / (7.4 * SLOW) )) * w0 * 2); + Evas_Coord h = 5 + ((1.0 + ::sin((double)(f + (i * 19)) / (12.6 * SLOW) )) * h0 * 2); Evas_Coord x = (win_w / 2) - (w / 2); - x += sin((double)(f + (i * 13)) / (36.7 * SLOW)) * (w0 / 2); + x += ::sin((double)(f + (i * 13)) / (36.7 * SLOW)) * (w0 / 2); Evas_Coord y = (win_h / 2) - (h / 2); - y += cos((double)(f + (i * 28)) / (43.8 * SLOW)) * (h0 / 2); + y += ::cos((double)(f + (i * 28)) / (43.8 * SLOW)) * (h0 / 2); rec.evas::object::position_set(x, y); rec.evas::object::size_set(w, h); ++i; diff --git a/src/bin/cxx/rect_blend_pow2_few.cc b/src/bin/cxx/rect_blend_pow2_few.cc index a81d57d..5bcb1dc 100644 --- a/src/bin/cxx/rect_blend_pow2_few.cc +++ b/src/bin/cxx/rect_blend_pow2_few.cc @@ -21,7 +21,7 @@ /* standard var */ static int done = 0; /* private data */ -static efl::eina::list images; +static efl::eina::list rectangles; /* setup */ static void _setup(void) @@ -30,14 +30,14 @@ static void _setup(void) srnd(); for (int i = 0; i < OBNUM; i++) { - evas::image o(efl::eo::parent = canvas); - images.push_back(o); + evas::rectangle o(efl::eo::parent = canvas); + rectangles.push_back(o); int a = 256 - (1 << ((rnd() % 8) + 1)); if (a < 128) a = 128; int r = ((rnd()&0xff) * a) / 255; int g = ((rnd()&0xff) * a) / 255; int b = ((rnd()&0xff) * a) / 255; - o.color_set(r, g, b, a); + o.evas::object::color_set(r, g, b, a); o.visibility_set(true); } done = 0; @@ -47,9 +47,9 @@ static void _setup(void) /* cleanup */ static void _cleanup(void) { - for (evas::image& i : images) - i.parent_set(efl::eo::base(nullptr)); - images.clear(); + for (evas::rectangle& rec : rectangles) + rec.parent_set(efl::eo::base(nullptr)); + rectangles.clear(); } @@ -57,18 +57,18 @@ static void _cleanup(void) static void _loop(double t, int f) { int i = 0; - for (evas::image& img : images) + for (evas::rectangle& rec : rectangles) { Evas_Coord w0 = 80; Evas_Coord h0 = 80; - Evas_Coord w = 5 + ((1.0 + cos((double)(f + (i * 10)) / (7.4 * SLOW) )) * w0 * 2); - Evas_Coord h = 5 + ((1.0 + sin((double)(f + (i * 19)) / (12.6 * SLOW) )) * h0 * 2); + Evas_Coord w = 5 + ((1.0 + ::cos((double)(f + (i * 10)) / (7.4 * SLOW) )) * w0 * 2); + Evas_Coord h = 5 + ((1.0 + ::sin((double)(f + (i * 19)) / (12.6 * SLOW) )) * h0 * 2); Evas_Coord x = (win_w / 2) - (w / 2); - x += sin((double)(f + (i * 113)) / (36.7 * SLOW)) * (w0 / 2); + x += ::sin((double)(f + (i * 113)) / (36.7 * SLOW)) * (w0 / 2); Evas_Coord y = (win_h / 2) - (h / 2); - y += cos((double)(f + (i * 228)) / (43.8 * SLOW)) * (h0 / 2); - img.evas::object::position_set(x, y); - img.evas::object::size_set(w, h); + y += ::cos((double)(f + (i * 228)) / (43.8 * SLOW)) * (h0 / 2); + rec.evas::object::position_set(x, y); + rec.evas::object::size_set(w, h); ++i; } FPS_STD(NAME); diff --git a/src/bin/cxx/rect_solid.cc b/src/bin/cxx/rect_solid.cc index 05ddfaf..93d1d7b 100644 --- a/src/bin/cxx/rect_solid.cc +++ b/src/bin/cxx/rect_solid.cc @@ -18,7 +18,7 @@ /* standard var */ static int done = 0; /* private data */ -static efl::eina::list images; +static efl::eina::list rectangles; /* setup */ static void _setup(void) @@ -27,8 +27,8 @@ static void _setup(void) srnd(); for (int i = 0; i < OBNUM; i++) { - evas::image o(efl::eo::parent = canvas); - images.push_back(o); + evas::rectangle o(efl::eo::parent = canvas); + rectangles.push_back(o); int a = 0xff; int r = ((rnd()&0xff) * a) / 255; int g = ((rnd()&0xff) * a) / 255; @@ -42,16 +42,16 @@ static void _setup(void) /* cleanup */ static void _cleanup(void) { - for (evas::image& i : images) + for (evas::rectangle& i : rectangles) i.parent_set(efl::eo::base(nullptr)); - images.clear(); + rectangles.clear(); } /* loop - do things */ static void _loop(double t, int f) { int i = 0; - for (evas::image& img : images) + for (evas::rectangle& rec : rectangles) { Evas_Coord w0 = 80; Evas_Coord h0 = 80; @@ -61,8 +61,8 @@ static void _loop(double t, int f) x += sin((double)(f + (i * 13)) / (36.7 * SLOW)) * (w0 / 2); Evas_Coord y = (win_h / 2) - (h / 2); y += cos((double)(f + (i * 28)) / (43.8 * SLOW)) * (h0 / 2); - img.evas::object::position_set(x, y); - img.evas::object::size_set(w, h); + rec.evas::object::position_set(x, y); + rec.evas::object::size_set(w, h); ++i; } FPS_STD(NAME); diff --git a/src/bin/cxx/rect_solid_few.cc b/src/bin/cxx/rect_solid_few.cc index 47419d4..7fb7965 100644 --- a/src/bin/cxx/rect_solid_few.cc +++ b/src/bin/cxx/rect_solid_few.cc @@ -21,7 +21,7 @@ /* standard var */ static int done = 0; /* private data */ -static efl::eina::list images; +static efl::eina::list rectangles; /* setup */ static void _setup(void) @@ -30,14 +30,14 @@ static void _setup(void) srnd(); for (int i = 0; i < OBNUM; i++) { - evas::image o(efl::eo::parent = canvas); - images.push_back(o); + evas::rectangle o(efl::eo::parent = canvas); + rectangles.push_back(o); int a = 0xff; int r = ((rnd()&0xff) * a) / 255; int g = ((rnd()&0xff) * a) / 255; int b = ((rnd()&0xff) * a) / 255; - evas_obj_color_set(r, g, b, a); - evas_obj_visibility_set(true); + o.evas::object::color_set(r, g, b, a); + o.visibility_set(true); } done = 0; } @@ -45,27 +45,27 @@ static void _setup(void) /* cleanup */ static void _cleanup(void) { - for (evas::image& i : images) - i.parent_set(efl::eo::base(nullptr)); - images.clear(); + for (evas::rectangle& rec : rectangles) + rec.parent_set(efl::eo::base(nullptr)); + rectangles.clear(); } /* loop - do things */ static void _loop(double t, int f) { int i = 0; - for (evas::image& img : images) + for (evas::rectangle& rec : rectangles) { Evas_Coord w0 = 80; Evas_Coord h0 = 80; - Evas_Coord w = 5 + ((1.0 + cos((double)(f + (i * 10)) / (7.4 * SLOW) )) * w0 * 2); - Evas_Coord h = 5 + ((1.0 + sin((double)(f + (i * 19)) / (12.6 * SLOW) )) * h0 * 2); + Evas_Coord w = 5 + ((1.0 + ::cos((double)(f + (i * 10)) / (7.4 * SLOW) )) * w0 * 2); + Evas_Coord h = 5 + ((1.0 + ::sin((double)(f + (i * 19)) / (12.6 * SLOW) )) * h0 * 2); Evas_Coord x = (win_w / 2) - (w / 2); - x += sin((double)(f + (i * 113)) / (36.7 * SLOW)) * (w0 / 2); + x += ::sin((double)(f + (i * 113)) / (36.7 * SLOW)) * (w0 / 2); Evas_Coord y = (win_h / 2) - (h / 2); - y += cos((double)(f + (i * 228)) / (43.8 * SLOW)) * (h0 / 2); - img.evas::object::position_set(x, y); - img.evas::object::size_set(w, h); + y += ::cos((double)(f + (i * 228)) / (43.8 * SLOW)) * (h0 / 2); + rec.evas::object::position_set(x, y); + rec.evas::object::size_set(w, h); ++i; } FPS_STD(NAME); diff --git a/src/bin/cxx/tests.h b/src/bin/cxx/tests.h index a0d524e..c7839e0 100644 --- a/src/bin/cxx/tests.h +++ b/src/bin/cxx/tests.h @@ -3,7 +3,6 @@ extern "C" { #endif -#include "font_effect_blur_alpha_capi.h" #include "image_blend_border_capi.h" #include "image_blend_border_recolor_capi.h" #include "image_blend_fade_pow2_unscaled_capi.h" @@ -64,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" @@ -97,6 +96,7 @@ extern "C" { #include "widgets_list_3_grouped_capi.h" #include "widgets_list_4_capi.h" #include "widgets_list_4_grouped_capi.h" +#include "font_effect_blur_alpha_capi.h" #ifdef __cplusplus } diff --git a/src/bin/cxx/text_basic.cc b/src/bin/cxx/text_basic.cc index 825e936..c38834d 100644 --- a/src/bin/cxx/text_basic.cc +++ b/src/bin/cxx/text_basic.cc @@ -41,6 +41,8 @@ static void _setup(void) /* cleanup */ static void _cleanup(void) { + for (evas::text& t : texts) + t.parent_set(efl::eo::base(nullptr)); texts.clear(); } diff --git a/src/bin/cxx/text_change.cc b/src/bin/cxx/text_change.cc index d7ae2f1..723f242 100644 --- a/src/bin/cxx/text_change.cc +++ b/src/bin/cxx/text_change.cc @@ -59,6 +59,8 @@ static void _setup(void) /* cleanup */ static void _cleanup(void) { + for (evas::text& t : texts) + t.parent_set(efl::eo::base(nullptr)); texts.clear(); } diff --git a/src/bin/cxx/text_styles.cc b/src/bin/cxx/text_styles.cc index 446ec22..d5d5e82 100644 --- a/src/bin/cxx/text_styles.cc +++ b/src/bin/cxx/text_styles.cc @@ -21,60 +21,61 @@ static int done = 0; /* private data */ static efl::eina::list texts; +inline Evas_Text_Style_Type +operator++(Evas_Text_Style_Type const& x) +{ + int val = static_cast(x); + return static_cast(val++); +} + /* setup */ static void _setup(void) { -#if 0 - int i; - Evas_Object *o; - Evas_Text_Style_Type st; - - st = EVAS_TEXT_STYLE_SHADOW; - for (i = 0; i < OBNUM; i++) + evas::canvas canvas(::eo_ref(G_evas)); + Evas_Text_Style_Type st = EVAS_TEXT_STYLE_SHADOW; + for (int i = 0; i < OBNUM; i++) { - o = eo_add(EVAS_TEXT_CLASS, G_evas); - o_texts[i] = o; - eo_do(o, - efl_text_properties_font_set("Vera-Bold", 20), - efl_text_set("This is a test string"), - evas_obj_text_style_set(st), - evas_obj_color_set(255, 255, 255, 255), - evas_obj_text_shadow_color_set(0, 0, 0, 24), - evas_obj_text_glow_color_set(100, 80, 40, 100), - evas_obj_text_glow2_color_set(50, 10, 5, 50), - evas_obj_text_outline_color_set(0, 0, 0, 255), - evas_obj_visibility_set(EINA_TRUE)); - 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; if (st > EVAS_TEXT_STYLE_FAR_SOFT_SHADOW) st = EVAS_TEXT_STYLE_SHADOW; } done = 0; -#endif // XXX } /* cleanup */ static void _cleanup(void) { + for (evas::text& t : texts) + t.parent_set(efl::eo::base(nullptr)); texts.clear(); } /* loop - do things */ static void _loop(double t, int f) { -#if 0 - int i; Evas_Coord x, y, w, h; - for (i = 0; i < OBNUM; i++) + int i = 0; + for (evas::text& t : texts) { - eo_do(o_texts[i], evas_obj_size_get(&w, &h)); + t.evas::object::size_get(&w, &h); 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 += cos((double)(f + (i * 28)) / (43.8 * SLOW)) * (w / 2); - eo_do(o_texts[i], evas_obj_position_set(x, y)); + y += ::cos((double)(f + (i * 28)) / (43.8 * SLOW)) * (w / 2); + t.evas::object::position_set(x, y); + ++i; } FPS_STD(NAME); -#endif // XXX - FPS_STD(NAME); } static void _key(char *key) diff --git a/src/bin/cxx/text_styles_different_strings.cc b/src/bin/cxx/text_styles_different_strings.cc index 736c371..8f9af94 100644 --- a/src/bin/cxx/text_styles_different_strings.cc +++ b/src/bin/cxx/text_styles_different_strings.cc @@ -31,8 +31,7 @@ operator++(Evas_Text_Style_Type const& x) /* setup */ static void _setup(void) { -#if 0 - Evas_Object *o; + evas::canvas canvas(::eo_ref(G_evas)); Evas_Text_Style_Type st; char buf[1024]; const char *strs[] = { @@ -45,33 +44,34 @@ static void _setup(void) st = EVAS_TEXT_STYLE_SHADOW; for (int i = 0; i < OBNUM; i++) { - o = eo_add(EVAS_TEXT_CLASS, G_evas); - o_texts[i] = o; - eo_do(o, efl_text_properties_font_set("Vera-Bold", 20)); + evas::text o(efl::eo::parent = canvas); + texts.push_back(o); + o.font_set("Vera-Bold", 20); 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_set(buf), - evas_obj_text_style_set(st), - evas_obj_color_set(255, 255, 255, 255), - evas_obj_text_shadow_color_set(0, 0, 0, 24), - evas_obj_text_glow_color_set(100, 80, 40, 100), - evas_obj_text_glow2_color_set(50, 10, 5, 50), - evas_obj_text_outline_color_set(0, 0, 0, 255), - evas_obj_visibility_set(EINA_TRUE)); - st++; + o.text_set(buf); + 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; if (st > EVAS_TEXT_STYLE_FAR_SOFT_SHADOW) st = EVAS_TEXT_STYLE_SHADOW; } done = 0; -#endif } /* cleanup */ static void _cleanup(void) { + for (evas::text& t : texts) + t.parent_set(efl::eo::base(nullptr)); texts.clear(); } diff --git a/src/bin/cxx/widgets_file_icons.cc b/src/bin/cxx/widgets_file_icons.cc index 2c373f7..a3815cb 100644 --- a/src/bin/cxx/widgets_file_icons.cc +++ b/src/bin/cxx/widgets_file_icons.cc @@ -47,28 +47,26 @@ static const char *icons[] = // XXX /* setup */ static void _setup(void) { -#if 0 evas::canvas canvas(::eo_ref(G_evas)); for (int i = 0; i < NUM; i++) { - evas::image o(efl::eo::parent = canvas); - images.push_back(o); - eo_do(o, efl_file_set(build_path(icons[i % 13]), NULL), - evas_obj_image_fill_set(0, 0, ICON_SIZE, ICON_SIZE), - evas_obj_size_set(ICON_SIZE, ICON_SIZE), - evas_obj_visibility_set(EINA_TRUE)); + evas::image o1(efl::eo::parent = canvas); + 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(ICON_SIZE, ICON_SIZE); + o1.visibility_set(true); - o = eo_add(EVAS_TEXT_CLASS, G_evas); - o_texts[i] = o; - eo_do(o, efl_text_properties_font_set("Vera-Bold", 10), - efl_text_set(icons[i % 13]), - evas_obj_text_style_set(EVAS_TEXT_STYLE_FAR_SOFT_SHADOW), - evas_obj_color_set(255, 255, 255, 255), - evas_obj_text_shadow_color_set(0, 0, 0, 24), - evas_obj_visibility_set(EINA_TRUE)); + evas::text o2(efl::eo::parent = canvas); + texts.push_back(o2); + o2.font_set("Vera-Bold", 10); + o2.text_set(icons[i % 13]); + o2.style_set(EVAS_TEXT_STYLE_FAR_SOFT_SHADOW); + o2.evas::object::color_set(255, 255, 255, 255); + o2.shadow_color_set(0, 0, 0, 24); + o2.visibility_set(true); } done = 0; -#endif } /* cleanup */ @@ -77,6 +75,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(); @@ -86,17 +85,21 @@ static void _cleanup(void) /* loop - do things */ static void _loop(double t, int f) { -#if 0 - int i; Evas_Coord x, y, tw, th, cent; x = 0; y = 0 - f; - for (i = 0; i < NUM; i++) + efl::eina::list::iterator + it1 = images.begin(), + end1 = images.end(); + efl::eina::list::iterator + it2 = texts.begin(), + end2 = texts.end(); + for (; it1 != end1 && it2 != end2; ++it1, ++it2) { - eo_do(o_images[i], evas_obj_position_set(x + 8, y)); - eo_do(o_texts[i], evas_obj_size_get(&tw, &th)); + (*it1).evas::object::position_set(x + 8, y); + (*it2).evas::object::size_get(&tw, &th); cent = (ICON_SIZE + 16 - tw) / 2; - eo_do(o_texts[i], evas_obj_position_set(x + cent, y + ICON_SIZE + 4)); + (*it2).evas::object::position_set(x + cent, y + ICON_SIZE + 4); x += ICON_SIZE + 16; if (x > win_w) { @@ -105,8 +108,6 @@ static void _loop(double t, int f) } } FPS_STD(NAME); -#endif // XXX - FPS_STD(NAME); } static void _key(char *key) diff --git a/src/bin/cxx/widgets_file_icons_2.cc b/src/bin/cxx/widgets_file_icons_2.cc index b6766fd..5aa1e0c 100644 --- a/src/bin/cxx/widgets_file_icons_2.cc +++ b/src/bin/cxx/widgets_file_icons_2.cc @@ -46,27 +46,24 @@ static const char *icons[] = // XXX /* setup */ static void _setup(void) { -#if 0 - int i; evas::canvas canvas(::eo_ref(G_evas)); - for (i = 0; i < NUM; i++) + for (int i = 0; i < NUM; i++) { - evas::image o(efl::eo::parent = canvas); - images.push_back(o); - eo_do(o, efl_file_set(build_path(icons[i % 13]), NULL), - evas_obj_image_fill_set(0, 0, ICON_SIZE, ICON_SIZE), - evas_obj_size_set(ICON_SIZE, ICON_SIZE), - evas_obj_visibility_set(EINA_TRUE)); + evas::image o1(efl::eo::parent = canvas); + 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(ICON_SIZE, ICON_SIZE); + o1.visibility_set(true); - o = eo_add(EVAS_TEXT_CLASS, G_evas); - o_texts[i] = o; - eo_do(o, efl_text_properties_font_set("Vera-Bold", 10), - efl_text_set(icons[i % 13]), - evas_obj_color_set(0, 0, 0, 255), - evas_obj_visibility_set(EINA_TRUE)); + evas::text o2(efl::eo::parent = canvas); + texts.push_back(o2); + o2.font_set("Vera-Bold", 10); + o2.text_set(icons[i % 13]); + o2.evas::object::color_set(0, 0, 0, 255); + o2.visibility_set(true); } done = 0; -#endif } /* cleanup */ @@ -75,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,17 +81,22 @@ static void _cleanup(void) /* loop - do things */ static void _loop(double t, int f) { -#if 0 - int i; Evas_Coord x, y, tw, th, cent; x = 0; y = 0 - f; - for (i = 0; i < NUM; i++) + efl::eina::list::iterator + it1 = images.begin(), + end1 = images.end(); + efl::eina::list::iterator + it2 = texts.begin(), + end2 = texts.end(); + if (images.empty() || texts.empty()) goto fps; // XXX + for (int i = 0; i < NUM; i++) { - eo_do(o_images[i], evas_obj_position_set(x + 8, y)); - eo_do(o_texts[i], evas_obj_size_get(&tw, &th)); + (*it1).evas::object::position_set(x + 8, y); + (*it2).evas::object::size_get(&tw, &th); cent = (ICON_SIZE + 16 - tw) / 2; - eo_do(o_texts[i], evas_obj_position_set(x + cent, y + ICON_SIZE + 4)); + (*it2).evas::object::position_set(x + cent, y + ICON_SIZE + 4); x += ICON_SIZE + 16; if (x > win_w) { @@ -101,8 +104,7 @@ static void _loop(double t, int f) y += ICON_SIZE + 16; } } - FPS_STD(NAME); -#endif + fps: FPS_STD(NAME); } diff --git a/src/bin/cxx/widgets_file_icons_2_grouped.cc b/src/bin/cxx/widgets_file_icons_2_grouped.cc index 212b9e8..10f714b 100644 --- a/src/bin/cxx/widgets_file_icons_2_grouped.cc +++ b/src/bin/cxx/widgets_file_icons_2_grouped.cc @@ -47,36 +47,36 @@ static const char *icons[] = /* setup */ static void _setup(void) { -#if 0 - int i; evas::canvas canvas(::eo_ref(G_evas)); - for (i = 0; i < NUM; i++) + for (int i = 0; i < NUM; i++) { - evas::image o(efl::eo::parent = canvas); - images.push_back(o); - eo_do(o, efl_file_set(build_path(icons[i % 13]), NULL), - evas_obj_image_fill_set(0, 0, ICON_SIZE, ICON_SIZE), - evas_obj_size_set(ICON_SIZE, ICON_SIZE), - evas_obj_visibility_set(EINA_TRUE)); + evas::image o1(efl::eo::parent = canvas); + 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.visibility_set(true); - o = eo_add(EVAS_TEXT_CLASS, G_evas); - o_texts[i] = o; - eo_do(o, efl_text_properties_font_set("Vera-Bold", 10), - efl_text_set(icons[i % 13]), - evas_obj_color_set(0, 0, 0, 255), - evas_obj_visibility_set(EINA_TRUE)); + evas::text o2(efl::eo::parent = canvas); + texts.push_back(o2); + o2.font_set("Vera-Bold", 10); + o2.text_set(icons[i % 13]); + o2.evas::object::color_set(0, 0, 0, 255); + o2.visibility_set(true); } - for (i = 0; i < NUM; i++) + for (evas::image& img : images) { - eo_do(images[i], evas_obj_raise()); + img.raise(); } - for (i = 0; i < NUM; i++) + efl::eina::list::iterator + it1 = images.begin(), + it2 = images.begin(); + for (int i = 0; i < NUM; i++, ++it1) { if (i > 13) - eo_do(images[i], evas_obj_stack_above(images[i - 13])); + (*it1).stack_above(*it2++); } done = 0; -#endif // XXX } /* cleanup */ @@ -85,6 +85,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(); @@ -93,17 +94,21 @@ static void _cleanup(void) /* loop - do things */ static void _loop(double t, int f) { -#if 0 - int i; Evas_Coord x, y, tw, th, cent; x = 0; y = 0 - f; - for (i = 0; i < NUM; i++) + efl::eina::list::iterator + it1 = images.begin(), + end1 = images.end(); + efl::eina::list::iterator + it2 = texts.begin(), + end2 = texts.end(); + for (; it1 != end1 && it2 != end2; ++it1, ++it2) { - eo_do(o_images[i], evas_obj_position_set(x + 8, y)); - eo_do(o_texts[i], evas_obj_size_get(&tw, &th)); + (*it1).evas::object::position_set(x + 8, y); + (*it2).evas::object::size_get(&tw, &th); cent = (ICON_SIZE + 16 - tw) / 2; - eo_do(o_texts[i], evas_obj_position_set(x + cent, y + ICON_SIZE + 4)); + (*it2).evas::object::position_set(x + cent, y + ICON_SIZE + 4); x += ICON_SIZE + 16; if (x > win_w) { @@ -112,8 +117,6 @@ static void _loop(double t, int f) } } FPS_STD(NAME); -#endif // XXX - FPS_STD(NAME); } static void _key(char *key) diff --git a/src/bin/cxx/widgets_file_icons_2_same.cc b/src/bin/cxx/widgets_file_icons_2_same.cc index 373e938..3802c64 100644 --- a/src/bin/cxx/widgets_file_icons_2_same.cc +++ b/src/bin/cxx/widgets_file_icons_2_same.cc @@ -32,27 +32,24 @@ static const char *icons[] = // XXX /* setup */ static void _setup(void) { -#if 0 - int i; evas::canvas canvas(::eo_ref(G_evas)); - for (i = 0; i < NUM; i++) + for (int i = 0; i < NUM; i++) { - evas::image o(efl::eo::parent = canvas); - images.push_back(o); - eo_do(o, efl_file_set(build_path(icons[i % 1]), NULL), - evas_obj_image_fill_set(0, 0, ICON_SIZE, ICON_SIZE), - evas_obj_size_set(ICON_SIZE, ICON_SIZE), - evas_obj_visibility_set(EINA_TRUE)); + evas::image o1(efl::eo::parent = canvas); + images.push_back(o1); + eo_do(o1._eo_ptr(), efl_file_set(build_path(icons[i % 1]), NULL)); // XXX + o1.fill_set(0, 0, ICON_SIZE, ICON_SIZE); + o1.evas::object::size_set(ICON_SIZE, ICON_SIZE); + o1.visibility_set(true); - o = eo_add(EVAS_TEXT_CLASS, G_evas); - o_texts[i] = o; - eo_do(o, efl_text_properties_font_set("Vera-Bold", 10), - efl_text_set(icons[i % 1]), - evas_obj_color_set(0, 0, 0, 255), - evas_obj_visibility_set(EINA_TRUE)); + evas::text o2(efl::eo::parent = canvas); + texts.push_back(o2); + o2.font_set("Vera-Bold", 10); + o2.text_set(icons[i % 1]); + o2.evas::object::color_set(0, 0, 0, 255); + o2.visibility_set(true); } done = 0; -#endif // XXX } /* cleanup */ @@ -69,17 +66,21 @@ static void _cleanup(void) /* loop - do things */ static void _loop(double t, int f) { -#if 0 - int i; Evas_Coord x, y, tw, th, cent; x = 0; y = 0 - f; - for (i = 0; i < NUM; i++) + efl::eina::list::iterator + it1 = images.begin(), + end1 = images.end(); + efl::eina::list::iterator + it2 = texts.begin(), + end2 = texts.end(); + for (; it1 != end1 && it2 != end2; ++it1, ++it2) { - eo_do(o_images[i], evas_obj_position_set(x + 8, y)); - eo_do(o_texts[i], evas_obj_size_get(&tw, &th)); + (*it1).evas::object::position_set(x + 8, y); + (*it2).evas::object::size_get(&tw, &th); cent = (ICON_SIZE + 16 - tw) / 2; - eo_do(o_texts[i], evas_obj_position_set(x + cent, y + ICON_SIZE + 4)); + (*it2).evas::object::position_set(x + cent, y + ICON_SIZE + 4); x += ICON_SIZE + 16; if (x > win_w) { @@ -88,8 +89,6 @@ static void _loop(double t, int f) } } FPS_STD(NAME); -#endif - FPS_STD(NAME); } static void _key(char *key) diff --git a/src/bin/cxx/widgets_file_icons_2_same_grouped.cc b/src/bin/cxx/widgets_file_icons_2_same_grouped.cc index c0c72f8..688f705 100644 --- a/src/bin/cxx/widgets_file_icons_2_same_grouped.cc +++ b/src/bin/cxx/widgets_file_icons_2_same_grouped.cc @@ -31,60 +31,61 @@ static const char *icons[] = /* setup */ static void _setup(void) { -#if 0 - int i; evas::canvas canvas(::eo_ref(G_evas)); - for (i = 0; i < NUM; i++) + for (int i = 0; i < NUM; i++) { - evas::image o(efl::eo::parent = canvas); - images.push_back(o); - eo_do(o, efl_file_set(build_path(icons[i % 1]), NULL), - evas_obj_image_fill_set(0, 0, ICON_SIZE, ICON_SIZE), - evas_obj_size_set(ICON_SIZE, ICON_SIZE), - evas_obj_visibility_set(EINA_TRUE)); + evas::image o1(efl::eo::parent = canvas); + images.push_back(o1); + eo_do(o1._eo_ptr(), efl_file_set(build_path(icons[i % 1]), NULL)); // XXX + o1.fill_set(0, 0, ICON_SIZE, ICON_SIZE); + o1.evas::object::size_set(ICON_SIZE, ICON_SIZE); + o1.visibility_set(true); - o = eo_add(EVAS_TEXT_CLASS, G_evas); - o_texts[i] = o; - eo_do(o, efl_text_properties_font_set("Vera-Bold", 10), - efl_text_set(icons[i % 1]), - evas_obj_color_set(0, 0, 0, 255), - evas_obj_visibility_set(EINA_TRUE)); + evas::text o2(efl::eo::parent = canvas); + texts.push_back(o2); + o2.font_set("Vera-Bold", 10); + o2.text_set(icons[i % 1]); + o2.evas::object::color_set(0, 0, 0, 255); + o2.visibility_set(true); } - for (i = 0; i < NUM; i++) + for (evas::image img : images) { - eo_do(images[i], evas_obj_raise()); + img.raise(); } + done = 0; -#endif // XXX } /* cleanup */ static void _cleanup(void) { -#if 0 - int i; - for (i = 0; i < NUM; i++) - { - eo_del(images[i]); - eo_del(o_texts[i]); - } -#endif // XXX + 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(); } /* loop - do things */ static void _loop(double t, int f) { -#if 0 - int i; Evas_Coord x, y, tw, th, cent; x = 0; y = 0 - f; - for (i = 0; i < NUM; i++) + efl::eina::list::iterator + it1 = images.begin(), + end1 = images.end(); + efl::eina::list::iterator + it2 = texts.begin(), + end2 = texts.end(); + for (; it1 != end1 && it2 != end2; ++it1, ++it2) { - eo_do(images[i], evas_obj_position_set(x + 8, y)); - eo_do(o_texts[i], evas_obj_size_get(&tw, &th)); + (*it1).evas::object::position_set(x + 8, y); + (*it2).evas::object::size_get(&tw, &th); cent = (ICON_SIZE + 16 - tw) / 2; - eo_do(o_texts[i], evas_obj_position_set(x + cent, y + ICON_SIZE + 4)); + (*it2).evas::object::position_set(x + cent, y + ICON_SIZE + 4); x += ICON_SIZE + 16; if (x > win_w) { @@ -92,9 +93,7 @@ static void _loop(double t, int f) y += ICON_SIZE + 16; } } -#endif FPS_STD(NAME); - FPS_STD(NAME); } /* prepend special key handlers if interactive (before STD) */ diff --git a/src/bin/cxx/widgets_file_icons_3.cc b/src/bin/cxx/widgets_file_icons_3.cc index d7cfef8..56077ad 100644 --- a/src/bin/cxx/widgets_file_icons_3.cc +++ b/src/bin/cxx/widgets_file_icons_3.cc @@ -46,27 +46,24 @@ static const char *icons[] = /* setup */ static void _setup(void) { -#if 0 - int i; evas::canvas canvas(::eo_ref(G_evas)); - for (i = 0; i < NUM; i++) + for (int i = 0; i < NUM; i++) { - evas::image o(efl::eo::parent = canvas); - images.push_back(o); - eo_do(o, efl_file_set(build_path(icons[i % 13]), NULL), - evas_obj_image_fill_set(0, 0, ICON_SIZE, ICON_SIZE), - evas_obj_size_set(ICON_SIZE, ICON_SIZE), - evas_obj_visibility_set(EINA_TRUE)); + evas::image o1(efl::eo::parent = canvas); + 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(ICON_SIZE, ICON_SIZE); + o1.visibility_set(true); - o = eo_add(EVAS_TEXT_CLASS, G_evas); - o_texts[i] = o; - eo_do(o, efl_text_properties_font_set("Vera-Bold", 10), - efl_text_set(icons[i % 13]), - evas_obj_color_set(0, 0, 0, 255), - evas_obj_visibility_set(EINA_TRUE)); + evas::text o2(efl::eo::parent = canvas); + texts.push_back(o2); + o2.font_set("Vera-Bold", 10); + o2.text_set(icons[i % 13]); + o2.evas::object::color_set(0, 0, 0, 255); + o2.visibility_set(true); } done = 0; -#endif } /* cleanup */ @@ -83,17 +80,22 @@ static void _cleanup(void) /* loop - do things */ static void _loop(double t, int f) { -#if 0 - int i; Evas_Coord x, y, tw, th, cent; x = 0; y = 0 - f; - for (i = 0; i < NUM; i++) + efl::eina::list::iterator + it1 = images.begin(), + end1 = images.end(); + efl::eina::list::iterator + it2 = texts.begin(), + end2 = texts.end(); + for (; it1 != end1 && it2 != end2; ++it1, ++it2) { - eo_do(o_images[i], evas_obj_position_set(x + 8, y)); - eo_do(o_texts[i], evas_obj_size_get(&tw, &th)); + (*it1).evas::object::position_set(x + 8, y); + (*it2).evas::object::size_get(&tw, &th); cent = (ICON_SIZE + 16 - tw) / 2; - eo_do(o_texts[i], evas_obj_position_set(x + cent, y + ICON_SIZE + 4)); + (*it2).evas::object::position_set(x + cent, y + ICON_SIZE + 4); + x += ICON_SIZE + 16; if (x > win_w) { @@ -102,8 +104,6 @@ static void _loop(double t, int f) } } FPS_STD(NAME); -#endif // XXX - FPS_STD(NAME); } diff --git a/src/bin/cxx/widgets_file_icons_4.cc b/src/bin/cxx/widgets_file_icons_4.cc index d186c73..22ff1cd 100644 --- a/src/bin/cxx/widgets_file_icons_4.cc +++ b/src/bin/cxx/widgets_file_icons_4.cc @@ -46,27 +46,24 @@ static const char *icons[] = /* setup */ static void _setup(void) { -#if 0 - int i; evas::canvas canvas(::eo_ref(G_evas)); - for (i = 0; i < NUM; i++) + for (int i = 0; i < NUM; i++) { - evas::image o(efl::eo::parent = canvas); - images.push_back(o); - eo_do(o, efl_file_set(build_path(icons[i % 13]), NULL), - evas_obj_image_fill_set(0, 0, ICON_SIZE, ICON_SIZE), - evas_obj_size_set(ICON_SIZE, ICON_SIZE), - evas_obj_visibility_set(EINA_TRUE)); + evas::image o1(efl::eo::parent = canvas); + 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.visibility_set(true); - o = eo_add(EVAS_TEXT_CLASS, G_evas); - o_texts[i] = o; - eo_do(o, efl_text_properties_font_set("Vera-Bold", 10), - efl_text_set(icons[i % 13]), - evas_obj_color_set(0, 0, 0, 255), - evas_obj_visibility_set(EINA_TRUE)); + evas::text o2(efl::eo::parent = canvas); + texts.push_back(o2); + o2.font_set("Vera-Bold", 10); + o2.text_set(icons[i % 13]); + o2.evas::object::color_set(0, 0, 0, 255); + o2.visibility_set(true); } done = 0; -#endif } /* cleanup */ @@ -83,17 +80,21 @@ static void _cleanup(void) /* loop - do things */ static void _loop(double t, int f) { -#if 0 - int i; Evas_Coord x, y, tw, th, cent; x = 0; y = 0 - f; - for (i = 0; i < NUM; i++) + efl::eina::list::iterator + it1 = images.begin(), + end1 = images.end(); + efl::eina::list::iterator + it2 = texts.begin(), + end2 = texts.end(); + for (; it1 != end1 && it2 != end2; ++it1, ++it2) { - eo_do(o_images[i], evas_obj_position_set(x + 8, y)); - eo_do(o_texts[i], evas_obj_size_get(&tw, &th)); + (*it1).evas::object::position_set(x + 8, y); + (*it2).evas::object::size_get(&tw, &th); cent = (ICON_SIZE + 16 - tw) / 2; - eo_do(o_texts[i], evas_obj_position_set(x + cent, y + ICON_SIZE + 4)); + (*it2).evas::object::position_set(x + cent, y + ICON_SIZE + 4); x += ICON_SIZE + 16; if (x > win_w) { @@ -102,8 +103,6 @@ static void _loop(double t, int f) } } FPS_STD(NAME); -#endif - FPS_STD(NAME); } static void _key(char *key) diff --git a/src/bin/cxx/widgets_list_1.cc b/src/bin/cxx/widgets_list_1.cc index 15ce04c..2d820b6 100644 --- a/src/bin/cxx/widgets_list_1.cc +++ b/src/bin/cxx/widgets_list_1.cc @@ -63,28 +63,25 @@ static const char *labels[] = /* setup */ static void _setup(void) { -#if 0 - int i; evas::canvas canvas(::eo_ref(G_evas)); - for (i = 0; i < NUM; i++) + for (int i = 0; i < NUM; i++) { - evas::image o(efl::eo::parent = canvas); - images.push_back(o); - eo_do(o, evas_obj_image_filled_set(1), - evas_obj_image_border_set(2, 2, 2, 2), - efl_file_set(build_path("pan.png"), NULL), - evas_obj_size_set(win_w, ICON_SIZE), - evas_obj_visibility_set(EINA_TRUE)); + evas::image o1(efl::eo::parent = canvas); + 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)); + o1.evas::object::size_set(win_w, ICON_SIZE); + o1.visibility_set(true); - o = eo_add(EVAS_TEXT_CLASS, G_evas); - o_texts[i] = o; - eo_do(o, efl_text_properties_font_set("Vera-Bold", 10), - efl_text_set(labels[i % 26]), - evas_obj_color_set(0, 0, 0, 255), - evas_obj_visibility_set(EINA_TRUE)); + evas::text o2(efl::eo::parent = canvas); + texts.push_back(o2); + o2.font_set("Vera-Bold", 10); + o2.text_set(labels[i % 26]); + o2.evas::object::color_set(0, 0, 0, 255); + o2.visibility_set(true); } done = 0; -#endif // XXX } /* cleanup */ @@ -93,6 +90,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(); @@ -101,22 +99,25 @@ static void _cleanup(void) /* loop - do things */ static void _loop(double t, int f) { -#if 0 - int i; + Evas_Coord x, y, tw, th, cent; x = 0; y = 0 - f; - for (i = 0; i < NUM; i++) + efl::eina::list::iterator + it1 = images.begin(), + end1 = images.end(); + efl::eina::list::iterator + it2 = texts.begin(), + end2 = texts.end(); + for (; it1 != end1 && it2 != end2; ++it1, ++it2) { - eo_do(o_images[i], evas_obj_position_set(x, y)); - eo_do(o_texts[i], evas_obj_size_get(&tw, &th)); + (*it1).evas::object::position_set(x, y); + (*it2).evas::object::size_get(&tw, &th); cent = (ICON_SIZE - th) / 2; - eo_do(o_texts[i], evas_obj_position_set(x + 8, y + cent)); + (*it2).evas::object::position_set(x + 8, y + cent); y += ICON_SIZE; } FPS_STD(NAME); -#endif // XXX - FPS_STD(NAME); } static void _key(char *key) diff --git a/src/bin/cxx/widgets_list_1_grouped.cc b/src/bin/cxx/widgets_list_1_grouped.cc index 29db00d..11e9569 100644 --- a/src/bin/cxx/widgets_list_1_grouped.cc +++ b/src/bin/cxx/widgets_list_1_grouped.cc @@ -62,36 +62,33 @@ static const char *labels[] = /* setup */ static void _setup(void) { -#if 0 - int i; evas::canvas canvas(::eo_ref(G_evas)); - for (i = 0; i < NUM; i++) + for (int i = 0; i < NUM; i++) { - evas::image o(efl::eo::parent = canvas); - images.push_back(o); - eo_do(o, evas_obj_image_filled_set(1), - evas_obj_image_border_set(2, 2, 2, 2), - efl_file_set(build_path("pan.png"), NULL), - evas_obj_size_set(win_w, ICON_SIZE), - evas_obj_visibility_set(EINA_TRUE)); + evas::image o1(efl::eo::parent = canvas); + 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)); // XXX + o1.evas::object::size_set(win_w, ICON_SIZE); + o1.visibility_set(true); - o = eo_add(EVAS_TEXT_CLASS, G_evas); - o_texts[i] = o; - eo_do(o, efl_text_properties_font_set("Vera-Bold", 10), - efl_text_set(labels[i % 26]), - evas_obj_color_set(0, 0, 0, 255), - evas_obj_visibility_set(EINA_TRUE)); + evas::text o2(efl::eo::parent = canvas); + texts.push_back(o2); + o2.font_set("Vera-Bold", 10); + o2.text_set(labels[i % 26]); + o2.evas::object::color_set(0, 0, 0, 255); + o2.visibility_set(true); } - for (i = 0; i < NUM; i++) + for (evas::image& img : images) { - eo_do(images[i], evas_obj_raise()); + img.raise(); } - for (i = 0; i < NUM; i++) + for (evas::text& text : texts) { - eo_do(o_texts[i], evas_obj_raise()); + text.raise(); } done = 0; -#endif // XXX } /* cleanup */ @@ -100,6 +97,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(); @@ -108,22 +106,24 @@ static void _cleanup(void) /* loop - do things */ static void _loop(double t, int f) { -#if 0 - int i; Evas_Coord x, y, tw, th, cent; x = 0; y = 0 - f; - for (i = 0; i < NUM; i++) + efl::eina::list::iterator + it1 = images.begin(), + end1 = images.end(); + efl::eina::list::iterator + it2 = texts.begin(), + end2 = texts.end(); + for (; it1 != end1 && it2 != end2; ++it1, ++it2) { - eo_do(o_images[i], evas_obj_position_set(x, y)); - eo_do(o_texts[i], evas_obj_size_get(&tw, &th)); + (*it1).evas::object::position_set(x, y); + (*it2).evas::object::size_get(&tw, &th); cent = (ICON_SIZE - th) / 2; - eo_do(o_texts[i], evas_obj_position_set(x + 8, y + cent)); + (*it2).evas::object::position_set(x + 8 + ICON_SIZE + 8, y + cent); y += ICON_SIZE; } FPS_STD(NAME); -#endif // XXX - FPS_STD(NAME); } static void _key(char *key) diff --git a/src/bin/cxx/widgets_list_2.cc b/src/bin/cxx/widgets_list_2.cc index 20b7a80..06c3e13 100644 --- a/src/bin/cxx/widgets_list_2.cc +++ b/src/bin/cxx/widgets_list_2.cc @@ -63,28 +63,25 @@ static const char *labels[] = // XXX /* setup */ static void _setup(void) { -#if 0 - int i; evas::canvas canvas(::eo_ref(G_evas)); - for (i = 0; i < NUM; i++) + for (int i = 0; i < NUM; i++) { - evas::image o(efl::eo::parent = canvas); - images.push_back(o); - eo_do(o, evas_obj_image_filled_set(1), - evas_obj_image_border_set(2, 2, 2, 2), - efl_file_set(build_path("pan.png"), NULL), - evas_obj_size_set(win_w, ICON_SIZE), - evas_obj_visibility_set(EINA_TRUE)); + evas::image o1(efl::eo::parent = canvas); + 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)); // XXX + o1.evas::object::size_set(win_w, ICON_SIZE); + o1.visibility_set(true); - o = eo_add(EVAS_TEXT_CLASS, G_evas); - o_texts[i] = o; - eo_do(o, efl_text_properties_font_set("Vera-Bold", 10), - efl_text_set(labels[i % 26]), - evas_obj_color_set(0, 0, 0, 255), - evas_obj_visibility_set(EINA_TRUE)); + evas::text o2(efl::eo::parent = canvas); + texts.push_back(o2); + o2.font_set("Vera-Bold", 10); + o2.text_set(labels[i % 26]); + o2.evas::object::color_set(0, 0, 0, 255); + o2.visibility_set(true); } done = 0; -#endif } /* cleanup */ @@ -102,22 +99,24 @@ static void _cleanup(void) /* loop - do things */ static void _loop(double t, int f) { -#if 0 - int i; Evas_Coord x, y, tw, th, cent; x = 0; y = 0 - f; - for (i = 0; i < NUM; i++) + efl::eina::list::iterator + it1 = images.begin(), + end1 = images.end(); + efl::eina::list::iterator + it2 = texts.begin(), + end2 = texts.end(); + for (; it1 != end1 && it2 != end2; ++it1, ++it2) { - eo_do(o_images[i], evas_obj_position_set(x, y)); - eo_do(o_texts[i], evas_obj_size_get(&tw, &th)); + (*it1).evas::object::position_set(x, y); + (*it2).evas::object::size_get(&tw, &th); cent = (ICON_SIZE - th) / 2; - eo_do(o_texts[i], evas_obj_position_set(x + 8, y + cent)); + (*it2).evas::object::position_set(x + 8, y + cent); y += ICON_SIZE; } FPS_STD(NAME); -#endif - FPS_STD(NAME); } static void _key(char *key) diff --git a/src/bin/cxx/widgets_list_2_grouped.cc b/src/bin/cxx/widgets_list_2_grouped.cc index ff3769c..b86a5ab 100644 --- a/src/bin/cxx/widgets_list_2_grouped.cc +++ b/src/bin/cxx/widgets_list_2_grouped.cc @@ -63,36 +63,33 @@ static const char *labels[] = // XXX /* setup */ static void _setup(void) { -#if 0 - int i; evas::canvas canvas(::eo_ref(G_evas)); - for (i = 0; i < NUM; i++) + for (int i = 0; i < NUM; i++) { - evas::image o(efl::eo::parent = canvas); - images.push_back(o); - eo_do(o, evas_obj_image_filled_set(1), - evas_obj_image_border_set(2, 2, 2, 2), - efl_file_set(build_path("pan.png"), NULL), - evas_obj_size_set(win_w, ICON_SIZE), - evas_obj_visibility_set(EINA_TRUE)); + evas::image o1(efl::eo::parent = canvas); + 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)); // XXX + o1.evas::object::size_set(win_w, ICON_SIZE); + o1.visibility_set(true); - o = eo_add(EVAS_TEXT_CLASS, G_evas); - o_texts[i] = o; - eo_do(o, efl_text_properties_font_set("Vera-Bold", 10), - efl_text_set(labels[i % 26]), - evas_obj_color_set(0, 0, 0, 255), - evas_obj_visibility_set(EINA_TRUE)); + evas::text o2(efl::eo::parent = canvas); + texts.push_back(o2); + o2.font_set("Vera-Bold", 10); + o2.text_set(labels[i % 26]); + o2.evas::object::color_set(0, 0, 0, 255); + o2.visibility_set(true); } - for (i = 0; i < NUM; i++) + for (evas::image& img : images) { - eo_do(images[i], evas_obj_raise()); + img.raise(); } - for (i = 0; i < NUM; i++) + for (evas::text& text : texts) { - eo_do(o_texts[i], evas_obj_raise()); + text.raise(); } done = 0; -#endif // XXX } /* cleanup */ @@ -101,6 +98,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(); @@ -109,22 +107,24 @@ static void _cleanup(void) /* loop - do things */ static void _loop(double t, int f) { -#if 0 - int i; Evas_Coord x, y, tw, th, cent; x = 0; y = 0 - f; - for (i = 0; i < NUM; i++) + efl::eina::list::iterator + it1 = images.begin(), + end1 = images.end(); + efl::eina::list::iterator + it2 = texts.begin(), + end2 = texts.end(); + for (int i = 0; i < NUM; i++) { - eo_do(o_images[i], evas_obj_position_set(x, y)); - eo_do(o_texts[i], evas_obj_size_get(&tw, &th)); + (*it1).evas::object::position_set(x, y); + (*it2).evas::object::size_get(&tw, &th); cent = (ICON_SIZE - th) / 2; - eo_do(o_texts[i], evas_obj_position_set(x + 8, y + cent)); + (*it2).evas::object::position_set(x + 8, y + cent); y += ICON_SIZE; } FPS_STD(NAME); -#endif // XXX - FPS_STD(NAME); } static void _key(char *key) diff --git a/src/bin/cxx/widgets_list_3.cc b/src/bin/cxx/widgets_list_3.cc index cd6a44e..1528249 100644 --- a/src/bin/cxx/widgets_list_3.cc +++ b/src/bin/cxx/widgets_list_3.cc @@ -83,35 +83,33 @@ static const char *labels[] = /* setup */ static void _setup(void) { -#if 0 evas::canvas canvas(::eo_ref(G_evas)); for (int i = 0; i < NUM; i++) { - evas::image o(efl::eo::parent = canvas); - images.push_back(o); - eo_do(o, evas_obj_image_filled_set(1), - evas_obj_image_border_set(2, 2, 2, 2), - efl_file_set(build_path("pan.png"), NULL), - evas_obj_size_set(win_w, ICON_SIZE), - evas_obj_visibility_set(EINA_TRUE)); + evas::image o1(efl::eo::parent = canvas); + 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)); // XXX + o1.evas::object::size_set(win_w, ICON_SIZE); + o1.visibility_set(true); - o = eo_add(EVAS_IMAGE_CLASS, G_evas); - o_icons[i] = o; - eo_do(o, evas_obj_image_filled_set(1), - evas_obj_image_border_set(2, 2, 2, 2), - efl_file_set(build_path(_icons[i % 13]), NULL), - evas_obj_size_set(ICON_SIZE - 8, ICON_SIZE - 8), - evas_obj_visibility_set(EINA_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); - o = eo_add(EVAS_TEXT_CLASS, G_evas); - o_texts[i] = o; - eo_do(o, efl_text_properties_font_set("Vera-Bold", 10), - efl_text_set(labels[i % 26]), - evas_obj_color_set(0, 0, 0, 255), - evas_obj_visibility_set(EINA_TRUE)); + evas::text o3(efl::eo::parent = canvas); + texts.push_back(o3); + o3.font_set("Vera-Bold", 10); + o3.text_set(labels[i % 26]); + o3.evas::object::color_set(0, 0, 0, 255); + o3.visibility_set(true); } done = 0; -#endif // XXX } /* cleanup */ @@ -120,9 +118,11 @@ static void _cleanup(void) for (evas::image& i : images) i.parent_set(efl::eo::base(nullptr)); images.clear(); + for (evas::image& i : icons) i.parent_set(efl::eo::base(nullptr)); icons.clear(); + for (evas::text& t : texts) t.parent_set(efl::eo::base(nullptr)); texts.clear(); @@ -131,23 +131,28 @@ static void _cleanup(void) /* loop - do things */ static void _loop(double t, int f) { -#if 0 - int i; Evas_Coord x, y, tw, th, cent; x = 0; y = 0 - f; - for (i = 0; i < NUM; i++) + efl::eina::list::iterator + it1 = images.begin(), + end1 = images.end(); + efl::eina::list::iterator + it2 = icons.begin(), + end2 = icons.end(); + efl::eina::list::iterator + it3 = texts.begin(), + end3 = texts.end(); + for (int i = 0; i < NUM; i++) { - eo_do(o_images[i], evas_obj_position_set(x, y)); - eo_do(o_icons[i], evas_obj_position_set(x + 4, y + 4)); - eo_do(o_texts[i], evas_obj_size_get(&tw, &th)); + (*it1).evas::object::position_set(x, y); + (*it2).evas::object::position_set(x + 4, y + 4); + (*it3).evas::object::size_get(&tw, &th); cent = (ICON_SIZE - th) / 2; - eo_do(o_texts[i], evas_obj_position_set(x + 8 + ICON_SIZE + 8, y + cent)); + (*it3).evas::object::position_set(x + 8 + ICON_SIZE + 8, y + cent); y += ICON_SIZE; } FPS_STD(NAME); -#endif - FPS_STD(NAME); } /* prepend special key handlers if interactive (before STD) */ diff --git a/src/bin/cxx/widgets_list_3_grouped.cc b/src/bin/cxx/widgets_list_3_grouped.cc index 08322f6..d4828fc 100644 --- a/src/bin/cxx/widgets_list_3_grouped.cc +++ b/src/bin/cxx/widgets_list_3_grouped.cc @@ -22,7 +22,7 @@ static int done = 0; #define ICON_SIZE 64 static efl::eina::list images; -static efl::eina::list icons; +static evas::image *icons[NUM]; // XXX static efl::eina::list texts; static const char *_icons[] = @@ -84,53 +84,50 @@ static const char *labels[] = /* setup */ static void _setup(void) { -#if 0 - int i; evas::canvas canvas(::eo_ref(G_evas)); - for (i = 0; i < NUM; i++) + for (int i = 0; i < NUM; i++) { - evas::image o(efl::eo::parent = canvas); - images.push_back(o); - eo_do(o, evas_obj_image_filled_set(1), - evas_obj_image_border_set(2, 2, 2, 2), - efl_file_set(build_path("pan.png"), NULL), - evas_obj_size_set(win_w, ICON_SIZE), - evas_obj_visibility_set(EINA_TRUE)); + evas::image o1(efl::eo::parent = canvas); + 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)); // XXX + o1.evas::object::size_set(win_w, ICON_SIZE); + o1.visibility_set(true); - o = eo_add(EVAS_IMAGE_CLASS, G_evas); - icons[i] = o; - eo_do(o, evas_obj_image_filled_set(1), - evas_obj_image_border_set(2, 2, 2, 2), - efl_file_set(build_path(_icons[i % 13]), NULL), - evas_obj_size_set(ICON_SIZE - 8, ICON_SIZE - 8), - evas_obj_visibility_set(EINA_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); - o = eo_add(EVAS_TEXT_CLASS, G_evas); - o_texts[i] = o; - eo_do(o, efl_text_properties_font_set("Vera-Bold", 10), - efl_text_set(labels[i % 26]), - evas_obj_color_set(0, 0, 0, 255), - evas_obj_visibility_set(EINA_TRUE)); + evas::text o3(efl::eo::parent = canvas); + texts.push_back(o3); + o3.font_set("Vera-Bold", 10); + o3.text_set(labels[i % 26]); + o3.evas::object::color_set(0, 0, 0, 255); + o3.visibility_set(true); } - for (i = 0; i < NUM; i++) + for (evas::image& img : images) { - eo_do(images[i], evas_obj_raise()); + img.raise(); } - for (i = 0; i < NUM; i++) + for (int i = 0; i < NUM; i++) // XXX { - eo_do(icons[i], evas_obj_raise()); + icons[i]->raise(); } - for (i = 0; i < NUM; i++) + for (int i = 0; i < NUM; i++) // XXX { if (i > 13) - eo_do(icons[i], evas_obj_stack_above(icons[i - 13])); + icons[i]->stack_above(*icons[i - 13]); } - for (i = 0; i < NUM; i++) + for (evas::text& text : texts) { - eo_do(o_texts[i], evas_obj_raise()); + text.raise(); } done = 0; -#endif // XXX } /* cleanup */ @@ -140,9 +137,12 @@ static void _cleanup(void) i.parent_set(efl::eo::base(nullptr)); images.clear(); - for (evas::image& i : icons) - i.parent_set(efl::eo::base(nullptr)); - icons.clear(); + for (int i = 0; i < NUM; i++) // XXX + { + icons[i]->parent_set(efl::eo::base(nullptr)); + icons[i]->_reset(nullptr); + delete icons[i]; + } for (evas::text& t : texts) t.parent_set(efl::eo::base(nullptr)); @@ -152,23 +152,27 @@ static void _cleanup(void) /* loop - do things */ static void _loop(double t, int f) { -#if 0 - int i; Evas_Coord x, y, tw, th, cent; x = 0; y = 0 - f; - for (i = 0; i < NUM; i++) + efl::eina::list::iterator + it1 = images.begin(), + end1 = images.end(); + efl::eina::list::iterator + it3 = texts.begin(), + end3 = texts.end(); + int i2 = 0; + while(it1 != end1 && i2 != NUM && it3 != end3) { - eo_do(o_images[i], evas_obj_position_set(x, y)); - eo_do(icons[i], evas_obj_position_set(x + 4, y + 4)); - eo_do(o_texts[i], evas_obj_size_get(&tw, &th)); + (*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; - eo_do(o_texts[i], evas_obj_position_set(x + 8 + ICON_SIZE + 8, y + cent)); + (*it3).evas::object::position_set(x + 8 + ICON_SIZE + 8, y + cent); y += ICON_SIZE; + ++it1; ++i2; ++it3; } FPS_STD(NAME); -#endif // XXX - FPS_STD(NAME); } static void _key(char *key) diff --git a/src/bin/cxx/widgets_list_4.cc b/src/bin/cxx/widgets_list_4.cc index 7ae358f..71cac11 100644 --- a/src/bin/cxx/widgets_list_4.cc +++ b/src/bin/cxx/widgets_list_4.cc @@ -84,36 +84,33 @@ static const char *labels[] = /* setup */ static void _setup(void) { -#if 0 - int i; evas::canvas canvas(::eo_ref(G_evas)); - for (i = 0; i < NUM; i++) + for (int i = 0; i < NUM; i++) { - evas::image o(efl::eo::parent = canvas); - images.push_back(o); - eo_do(o, evas_obj_image_filled_set(1), - evas_obj_image_border_set(2, 2, 2, 2), - efl_file_set(build_path("pan.png"), NULL), - evas_obj_size_set(win_w, ICON_SIZE), - evas_obj_visibility_set(EINA_TRUE)); + evas::image o1(efl::eo::parent = canvas); + 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)); // XXX + o1.evas::object::size_set(win_w, ICON_SIZE); + o1.visibility_set(true); - o = eo_add(EVAS_IMAGE_CLASS, G_evas); - o_icons[i] = o; - eo_do(o, evas_obj_image_filled_set(1), - evas_obj_image_border_set(2, 2, 2, 2), - efl_file_set(build_path(_icons[i % 13]), NULL), - evas_obj_size_set(ICON_SIZE - 8, ICON_SIZE - 8), - evas_obj_visibility_set(EINA_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); - o = eo_add(EVAS_TEXT_CLASS, G_evas); - o_texts[i] = o; - eo_do(o, efl_text_properties_font_set("Vera-Bold", 10), - efl_text_set(labels[i % 26]), - evas_obj_color_set(0, 0, 0, 255), - evas_obj_visibility_set(EINA_TRUE)); + evas::text o3(efl::eo::parent = canvas); + texts.push_back(o3); + o3.font_set("Vera-Bold", 10); + o3.text_set(labels[i % 26]); + o3.evas::object::color_set(0, 0, 0, 255); + o3.visibility_set(true); } done = 0; -#endif // XXX } /* cleanup */ @@ -135,23 +132,29 @@ static void _cleanup(void) /* loop - do things */ static void _loop(double t, int f) { -#if 0 - int i; Evas_Coord x, y, tw, th, cent; x = 0; y = 0 - f; - for (i = 0; i < NUM; i++) + efl::eina::list::iterator + it1 = images.begin(), + end1 = images.end(); + efl::eina::list::iterator + it2 = icons.begin(), + end2 = icons.end(); + efl::eina::list::iterator + it3 = texts.begin(), + end3 = texts.end(); + while(it1 != end1 && it2 != end2 && it3 != end3) { - eo_do(o_images[i], evas_obj_position_set(x, y)); - eo_do(o_icons[i], evas_obj_position_set(x + 4, y + 4)); - eo_do(o_texts[i], evas_obj_size_get(&tw, &th)); + (*it1).evas::object::position_set(x, y); + (*it2).evas::object::position_set(x + 4, y + 4); + (*it3).evas::object::size_get(&tw, &th); cent = (ICON_SIZE - th) / 2; - eo_do(o_texts[i], evas_obj_position_set(x + 8 + ICON_SIZE + 8, y + cent)); + (*it3).evas::object::position_set(x + 8 + ICON_SIZE + 8, y + cent); y += ICON_SIZE; + ++it1; ++it2; ++it3; } FPS_STD(NAME); -#endif - FPS_STD(NAME); } diff --git a/src/bin/cxx/widgets_list_4_grouped.cc b/src/bin/cxx/widgets_list_4_grouped.cc index 485a8cc..3092108 100644 --- a/src/bin/cxx/widgets_list_4_grouped.cc +++ b/src/bin/cxx/widgets_list_4_grouped.cc @@ -21,7 +21,7 @@ static int done = 0; #define NUM 512 #define ICON_SIZE 32 static efl::eina::list images; -static efl::eina::list icons; +static evas::image *icons[NUM]; // XXX static efl::eina::list texts; static const char *_icons[] = @@ -83,51 +83,51 @@ static const char *labels[] = /* setup */ static void _setup(void) { -#if 0 evas::canvas canvas(::eo_ref(G_evas)); for (int i = 0; i < NUM; i++) { - evas::image o(efl::eo::parent = canvas); - images.push_back(o); - eo_do(o, evas_obj_image_filled_set(1), - evas_obj_image_border_set(2, 2, 2, 2), - efl_file_set(build_path("pan.png"), NULL), - evas_obj_size_set(win_w, ICON_SIZE), - evas_obj_visibility_set(EINA_TRUE)); + evas::image o1(efl::eo::parent = canvas); + 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)); // XXX + o1.evas::object::size_set(win_w, ICON_SIZE); + o1.visibility_set(true); - o = eo_add(EVAS_IMAGE_CLASS, G_evas); - o_icons[i] = o; - eo_do(o, evas_obj_image_filled_set(1), - evas_obj_image_border_set(2, 2, 2, 2), - efl_file_set(build_path(_icons[i % 13]), NULL), - evas_obj_size_set(ICON_SIZE - 8, ICON_SIZE - 8), - evas_obj_visibility_set(EINA_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); - o = eo_add(EVAS_TEXT_CLASS, G_evas); - o_texts[i] = o; - eo_do(o, efl_text_properties_font_set("Vera-Bold", 10), - efl_text_set(labels[i % 26]), - evas_obj_color_set(0, 0, 0, 255), - evas_obj_visibility_set(EINA_TRUE)); + evas::text o3(efl::eo::parent = canvas); + texts.push_back(o3); + o3.font_set("Vera-Bold", 10); + o3.text_set(labels[i % 26]); + o3.evas::object::color_set(0, 0, 0, 255); + o3.visibility_set(true); } - for (i = 0; i < NUM; i++) + + for (evas::image& img : images) { - eo_do(images[i], evas_obj_raise()); + img.raise(); } - for (i = 0; i < NUM; i++) + for (int i = 0; i < NUM; i++) // XXX { - eo_do(o_icons[i], evas_obj_raise()); + icons[i]->raise(); } - for (i = 0; i < NUM; i++) + for (int i = 0; i < NUM; i++) // XXX { - eo_do(o_icons[i], evas_obj_stack_above(o_icons[i - 13])); + if (i > 13) + icons[i]->stack_above(*icons[i - 13]); } - for (i = 0; i < NUM; i++) + for (evas::text& text : texts) { - eo_do(o_texts[i], evas_obj_raise()); + text.raise(); } done = 0; -#endif // XXX } static void _cleanup() @@ -135,28 +135,43 @@ static void _cleanup() for (evas::image& i : images) i.parent_set(efl::eo::base(nullptr)); images.clear(); + + for (int i = 0; i < NUM; i++) // XXX + { + icons[i]->parent_set(efl::eo::base(nullptr)); + icons[i]->_reset(nullptr); + delete icons[i]; + } + + for (evas::text& t : texts) + t.parent_set(efl::eo::base(nullptr)); + texts.clear(); } /* loop - do things */ static void _loop(double t, int f) { -#if 0 - int i; Evas_Coord x, y, tw, th, cent; x = 0; y = 0 - f; - for (i = 0; i < NUM; i++) + efl::eina::list::iterator + it1 = images.begin(), + end1 = images.end(); + efl::eina::list::iterator + it3 = texts.begin(), + end3 = texts.end(); + int i2 = 0; + while(it1 != end1 && i2 != NUM && it3 != end3) { - eo_do(o_images[i], evas_obj_position_set(x, y)); - eo_do(o_icons[i], evas_obj_position_set(x + 4, y + 4)); - eo_do(o_texts[i], evas_obj_size_get(&tw, &th)); + (*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; - eo_do(o_texts[i], evas_obj_position_set(x + 8 + ICON_SIZE + 8, y + cent)); + (*it3).evas::object::position_set(x + 8 + ICON_SIZE + 8, y + cent); y += ICON_SIZE; + ++it1; ++i2; ++it3; } FPS_STD(NAME); -#endif - FPS_STD(NAME); } static void _key(char *key) diff --git a/src/bin/tests.h b/src/bin/tests.h index e50daaa..d8427ab 100644 --- a/src/bin/tests.h +++ b/src/bin/tests.h @@ -34,9 +34,9 @@ extern "C" { /* #include "image_blend_smooth_same_scaled.c" */ /* #include "image_blend_smooth_solid_same_scaled.c" */ /* #include "image_blend_border.c" */ -/* #include "image_blend_border_recolor.c" */ /* #include "image_blend_solid_middle_border.c" */ /* #include "image_blend_solid_border.c" */ +/* #include "image_blend_border_recolor.c" */ /* #include "image_map_rotate.c" */ /* #include "image_map_solid_rotate.c" */ /* #include "image_map_nearest_rotate.c" */