diff --git a/configure.ac b/configure.ac index 039ce2d92b..ca828c242b 100644 --- a/configure.ac +++ b/configure.ac @@ -1349,6 +1349,17 @@ EFL_LIB_END_OPTIONAL([Eo_Js]) #### End of Eo JS #### Efl C Sharp Bindings +want_csharp_beta="no" +AC_ARG_ENABLE([csharp-beta], + [AS_HELP_STRING([--enable-csharp-beta],[enable C Sharp bindings. @<:@default=disabled@:>@])], + [ + if test "x${enableval}" = "xyes" ; then + want_csharp_beta="yes" + else + want_csharp_beta="no" + fi + ], + [want_csharp_beta="no"]) want_csharp="no" AC_ARG_ENABLE([csharp-bindings], @@ -1372,6 +1383,11 @@ AC_DEFINE_IF([HAVE_CSHARP], [test "x${want_csharp}" = "xyes"], [1], [Compiling bindings for C Sharp]) AC_SUBST([want_csharp]) +AM_CONDITIONAL([HAVE_CSHARP_BETA], [test "x${want_csharp_beta}" = "xyes"]) +AC_DEFINE_IF([HAVE_CSHARP_BETA], [test "x${want_csharp_beta}" = "xyes"], + [1], [Compiling bindings for C Sharp with beta methods, properties and classes]) +AC_SUBST([want_csharp_beta]) + if test "x${have_windows}" = "xyes"; then eflmonodlldir="$prefix/bin" else diff --git a/data/elementary/themes/edc/about-e.edc b/data/elementary/themes/edc/about-e.edc index 376fef65b8..7035813f07 100644 --- a/data/elementary/themes/edc/about-e.edc +++ b/data/elementary/themes/edc/about-e.edc @@ -270,13 +270,11 @@ group { name: "e/widgets/about/main"; signal: "mouse,down,1*"; source: "base"; action: STATE_SET "clicked" 0.0; target: "base"; - target: "e.text.label"; } program { signal: "mouse,up,1"; source: "base"; action: STATE_SET "default" 0.0; target: "base"; - target: "e.text.label"; } program { signal: "mouse,clicked,1*"; source: "base"; diff --git a/data/elementary/themes/edc/about-theme.edc b/data/elementary/themes/edc/about-theme.edc index d27d2001c1..d3db61d540 100644 --- a/data/elementary/themes/edc/about-theme.edc +++ b/data/elementary/themes/edc/about-theme.edc @@ -155,13 +155,11 @@ group { name: "e/theme/about"; signal: "mouse,down,1*"; source: "base"; action: STATE_SET "clicked" 0.0; target: "base"; - target: "e.text.label"; } program { signal: "mouse,up,1"; source: "base"; action: STATE_SET "default" 0.0; target: "base"; - target: "e.text.label"; } program { signal: "mouse,clicked,1*"; source: "base"; @@ -171,13 +169,11 @@ group { name: "e/theme/about"; signal: "mouse,down,1*"; source: "base2"; action: STATE_SET "clicked" 0.0; target: "base2"; - target: "e.text.theme"; } program { signal: "mouse,up,1"; source: "base2"; action: STATE_SET "default" 0.0; target: "base2"; - target: "e.text.theme"; } program { signal: "mouse,clicked,1*"; source: "base2"; diff --git a/data/elementary/themes/edc/elm/button.edc b/data/elementary/themes/edc/elm/button.edc index cd0f4eb190..fd497df834 100644 --- a/data/elementary/themes/edc/elm/button.edc +++ b/data/elementary/themes/edc/elm/button.edc @@ -892,29 +892,6 @@ group { name: "elm/button/base/media_player/prev/default"; target: "shadow1"; target: "shadow2"; } - program { - signal: "mouse,up,1"; source: "event"; - action: SIGNAL_EMIT "elm,action,unpress" "elm"; - after: "button_unclick_anim"; - } - program { name: "button_unclick_anim"; - action: STATE_SET "default" 0.0; - target: "shadow1"; - target: "shadow2"; - } - program { - signal: "elm,anim,activate"; source: "elm"; - action: STATE_SET "clicked" 0.0; - target: "shadow1"; - target: "shadow2"; - after: "button_unpressed_anim"; - } - program { name: "button_unpressed_anim"; - action: STATE_SET "default" 0.0; - in: 0.5 0.0; - target: "shadow1"; - target: "shadow2"; - } program { signal: "mouse,clicked,1"; source: "event"; action: SIGNAL_EMIT "elm,action,click" "elm"; diff --git a/data/elementary/themes/edc/elm/gengrid.edc b/data/elementary/themes/edc/elm/gengrid.edc index 2c089e6ce3..5f375f9eae 100644 --- a/data/elementary/themes/edc/elm/gengrid.edc +++ b/data/elementary/themes/edc/elm/gengrid.edc @@ -38,7 +38,7 @@ group { name: "elm/gengrid/item/default/default"; } \ program { \ signal: "elm,state,odd"; source: "elm"; \ - action: STATE_SET "odd" 1.0; \ + action: STATE_SET "odd" 0.0; \ target: "base"; \ } \ program { \ diff --git a/data/elementary/themes/edc/elm/genlist.edc b/data/elementary/themes/edc/elm/genlist.edc index 5cd6838cb8..976d25dc9d 100644 --- a/data/elementary/themes/edc/elm/genlist.edc +++ b/data/elementary/themes/edc/elm/genlist.edc @@ -5066,7 +5066,7 @@ group { "elm/genlist/item/edit/default"; nomouse; } program { signal: "elm,state,odd"; - action: STATE_SET "odd" 1.0; + action: STATE_SET "odd" 0.0; target: "base"; } program { diff --git a/data/elementary/themes/edc/elm/list.edc b/data/elementary/themes/edc/elm/list.edc index 06419383b1..ab27c174f9 100644 --- a/data/elementary/themes/edc/elm/list.edc +++ b/data/elementary/themes/edc/elm/list.edc @@ -143,7 +143,7 @@ group { name: "elm/list/item/default"; } program { signal: "elm,state,odd"; source: "elm"; - action: STATE_SET "odd" 1.0; + action: STATE_SET "odd" 0.0; target: "base"; } program { @@ -454,7 +454,7 @@ group { name: "elm/list/h_item/default"; } program { signal: "elm,state,odd"; source: "elm"; - action: STATE_SET "odd" 1.0; + action: STATE_SET "odd" 0.0; target: "base"; } program { diff --git a/data/elementary/themes/edc/elm/menu.edc b/data/elementary/themes/edc/elm/menu.edc index ec3d67b13a..8a593d605b 100644 --- a/data/elementary/themes/edc/elm/menu.edc +++ b/data/elementary/themes/edc/elm/menu.edc @@ -1134,12 +1134,12 @@ group { name: "elm/hover/base/main_menu_submenu/default"; program { name: "show"; signal: "elm,action,show"; source: "elm"; action: STATE_SET "visible" 0.0; - target: "base"; + target: "top"; } program { name: "hide"; signal: "elm,action,hide"; source: "elm"; action: STATE_SET "default" 0.0; - target: "base"; + target: "top"; } program { name: "bottomshow"; signal: "elm,action,slot,bottom,show"; source: "elm"; diff --git a/data/elementary/themes/edc/evrything.edc b/data/elementary/themes/edc/evrything.edc index 21b2065d7a..9f6dfe638a 100644 --- a/data/elementary/themes/edc/evrything.edc +++ b/data/elementary/themes/edc/evrything.edc @@ -1026,7 +1026,6 @@ group { name: "e/modules/everything/thumbview/main/scrollframe"; program { signal: "mouse,down,1*"; source: "sb_vbar_a1"; action: STATE_SET "clicked" 0.0; - target: "sb_vbar_a1"; target: "arrow1_vbar"; } program { @@ -1037,13 +1036,11 @@ group { name: "e/modules/everything/thumbview/main/scrollframe"; program { signal: "mouse,up,1"; source: "sb_vbar_a1"; action: STATE_SET "default" 0.0; - target: "sb_vbar_a1"; target: "arrow1_vbar"; } program { signal: "mouse,down,1*"; source: "sb_vbar_a2"; action: STATE_SET "clicked" 0.0; - target: "sb_vbar_a2"; target: "arrow2_vbar"; } program { @@ -1054,7 +1051,6 @@ group { name: "e/modules/everything/thumbview/main/scrollframe"; program { signal: "mouse,up,1"; source: "sb_vbar_a2"; action: STATE_SET "default" 0.0; - target: "sb_vbar_a2"; target: "arrow2_vbar"; } program { @@ -1218,7 +1214,6 @@ group { name: "e/modules/everything/thumbview/main/scrollframe"; program { signal: "mouse,down,1*"; source: "e.dragable.vbar"; action: STATE_SET "clicked" 0.0; - target: "e.dragable.vbar"; target: "shadow_vbar"; target: "glow_vbar"; target: "center_glow_vbar"; @@ -1226,7 +1221,6 @@ group { name: "e/modules/everything/thumbview/main/scrollframe"; program { signal: "mouse,up,1"; source: "e.dragable.vbar"; action: STATE_SET "default" 0.0; - target: "e.dragable.vbar"; target: "shadow_vbar"; target: "glow_vbar"; target: "center_glow_vbar"; diff --git a/data/elementary/themes/edc/fileman.edc b/data/elementary/themes/edc/fileman.edc index 6305e2ed02..6f69fa3159 100644 --- a/data/elementary/themes/edc/fileman.edc +++ b/data/elementary/themes/edc/fileman.edc @@ -1084,13 +1084,11 @@ group { name: "e/fileman/default/window/main"; program { signal: "e,toolbar,left"; source: "e"; action: STATE_SET "tb_left" 0.0; - target: "e.swallow.toolbar"; target: "region"; } program { signal: "e,toolbar,right"; source: "e"; action: STATE_SET "tb_right" 0.0; - target: "e.swallow.toolbar"; target: "region"; } program { diff --git a/data/elementary/themes/edc/scrollframe.edc b/data/elementary/themes/edc/scrollframe.edc index 0a04cc938a..b5299717fb 100644 --- a/data/elementary/themes/edc/scrollframe.edc +++ b/data/elementary/themes/edc/scrollframe.edc @@ -136,7 +136,6 @@ group { name: "e/widgets/scrollframe"; program { signal: "mouse,down,1*"; source: "sb_vbar_a1"; action: STATE_SET "clicked" 0.0; - target: "sb_vbar_a1"; target: "arrow1_vbar"; } program { @@ -147,13 +146,11 @@ group { name: "e/widgets/scrollframe"; program { signal: "mouse,up,1"; source: "sb_vbar_a1"; action: STATE_SET "default" 0.0; - target: "sb_vbar_a1"; target: "arrow1_vbar"; } program { signal: "mouse,down,1*"; source: "sb_vbar_a2"; action: STATE_SET "clicked" 0.0; - target: "sb_vbar_a2"; target: "arrow2_vbar"; } program { @@ -164,7 +161,6 @@ group { name: "e/widgets/scrollframe"; program { signal: "mouse,up,1"; source: "sb_vbar_a2"; action: STATE_SET "default" 0.0; - target: "sb_vbar_a2"; target: "arrow2_vbar"; } program { @@ -292,7 +288,6 @@ group { name: "e/widgets/scrollframe"; program { signal: "mouse,down,1*"; source: "sb_hbar_a1"; action: STATE_SET "clicked" 0.0; - target: "sb_hbar_a1"; target: "arrow1_hbar"; } program { @@ -303,13 +298,11 @@ group { name: "e/widgets/scrollframe"; program { signal: "mouse,up,1"; source: "sb_hbar_a1"; action: STATE_SET "default" 0.0; - target: "sb_hbar_a1"; target: "arrow1_hbar"; } program { signal: "mouse,down,1*"; source: "sb_hbar_a2"; action: STATE_SET "clicked" 0.0; - target: "sb_hbar_a2"; target: "arrow2_hbar"; } program { @@ -320,7 +313,6 @@ group { name: "e/widgets/scrollframe"; program { signal: "mouse,up,1"; source: "sb_hbar_a2"; action: STATE_SET "default" 0.0; - target: "sb_hbar_a2"; target: "arrow2_hbar"; } program { @@ -678,7 +670,6 @@ group { name: "e/widgets/scrollframe"; program { signal: "mouse,down,1*"; source: "e.dragable.vbar"; action: STATE_SET "clicked" 0.0; - target: "e.dragable.vbar"; target: "shadow_vbar"; target: "glow_vbar"; target: "center_glow_vbar"; @@ -686,7 +677,6 @@ group { name: "e/widgets/scrollframe"; program { signal: "mouse,up,1"; source: "e.dragable.vbar"; action: STATE_SET "default" 0.0; - target: "e.dragable.vbar"; target: "shadow_vbar"; target: "glow_vbar"; target: "center_glow_vbar"; @@ -694,7 +684,6 @@ group { name: "e/widgets/scrollframe"; program { signal: "mouse,down,1*"; source: "e.dragable.hbar"; action: STATE_SET "clicked" 0.0; - target: "e.dragable.hbar"; target: "shadow_hbar"; target: "glow_hbar"; target: "center_glow_hbar"; @@ -702,7 +691,6 @@ group { name: "e/widgets/scrollframe"; program { signal: "mouse,up,1"; source: "e.dragable.hbar"; action: STATE_SET "default" 0.0; - target: "e.dragable.hbar"; target: "shadow_hbar"; target: "glow_hbar"; target: "center_glow_hbar"; diff --git a/data/elementary/themes/edc/syscon.edc b/data/elementary/themes/edc/syscon.edc index 32bc51c818..4bf8055ca8 100644 --- a/data/elementary/themes/edc/syscon.edc +++ b/data/elementary/themes/edc/syscon.edc @@ -100,13 +100,11 @@ group { name: "e/widgets/syscon/main"; signal: "mouse,down,1*"; source: "base"; action: STATE_SET "clicked" 0.0; target: "base"; - target: "e.text.label"; } program { signal: "mouse,up,1"; source: "base"; action: STATE_SET "default" 0.0; target: "base"; - target: "e.text.label"; } program { signal: "mouse,clicked,1*"; source: "base"; diff --git a/data/elementary/themes/edc/tasks.edc b/data/elementary/themes/edc/tasks.edc index d08dc2be74..78838bc9dd 100644 --- a/data/elementary/themes/edc/tasks.edc +++ b/data/elementary/themes/edc/tasks.edc @@ -261,14 +261,12 @@ group { name:"e/modules/tasks/item"; signal: "mouse,down,1"; source: "event"; action: STATE_SET "clicked" 0.0; target: "base"; - target: "e.text.label"; target: "sel_label"; } program { signal: "mouse,up,1"; source: "event"; action: STATE_SET "default" 0.0; target: "base"; - target: "e.text.label"; target: "sel_label"; } program { diff --git a/data/elementary/themes/edc/wallpaper.edc b/data/elementary/themes/edc/wallpaper.edc index 43a46476b1..ea64ed4537 100644 --- a/data/elementary/themes/edc/wallpaper.edc +++ b/data/elementary/themes/edc/wallpaper.edc @@ -778,8 +778,6 @@ target: "icon_box_shadow"; target: "icon_box"; target: "base"; - target: "icon_zoom"; - target: "e.swallow.content"; target: "events"; after: "thumb_gen2"; } @@ -1059,8 +1057,6 @@ target: "icon_box_shadow"; target: "icon_box"; target: "base"; - target: "icon_zoom"; - target: "e.swallow.content"; target: "events"; target: "theme"; after: "thumb_gen2"; @@ -1272,8 +1268,6 @@ target: "icon_box_shadow"; target: "icon_box"; target: "base"; - target: "icon_zoom"; - target: "e.swallow.content"; target: "events"; after: "thumb_gen2"; } diff --git a/meson_options.txt b/meson_options.txt index af3b87aa41..dfefc94074 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -317,6 +317,12 @@ option('bindings', description : 'Add values here to enable the bindings', ) +option('mono-beta', + type: 'boolean', + value: false, + description: 'Flag for enabling @beta Eo methods in the api' +) + option('native-arch-optimization', type: 'boolean', value: true, diff --git a/src/Makefile_Efl_Mono.am b/src/Makefile_Efl_Mono.am index 73e9ded754..8c7d2f0373 100644 --- a/src/Makefile_Efl_Mono.am +++ b/src/Makefile_Efl_Mono.am @@ -43,6 +43,7 @@ efl_ecore_evas_mono_files = \ # is custom built instead of through _LTLIBRARIES/_LIBRARIES lib_efl_mono_libefl_mono_dll_sources = \ bindings/mono/efl_mono/efl_all.cs \ + bindings/mono/efl_mono/efl_csharp_application.cs \ $(efl_eo_mono_files) \ $(efl_eina_mono_files) \ $(efl_eldbus_mono_files) \ diff --git a/src/Makefile_Elementary.am b/src/Makefile_Elementary.am index ff247b7731..448a437ad8 100644 --- a/src/Makefile_Elementary.am +++ b/src/Makefile_Elementary.am @@ -202,7 +202,6 @@ elm_legacy_eolian_files = \ lib/elementary/elm_calendar_item.eo \ lib/elementary/elm_clock.eo \ lib/elementary/elm_colorselector.eo \ - lib/elementary/elm_combobox.eo \ lib/elementary/elm_conformant.eo \ lib/elementary/elm_ctxpopup.eo \ lib/elementary/elm_dayselector.eo \ diff --git a/src/Makefile_Eolian_Cxx.am b/src/Makefile_Eolian_Cxx.am index ec1ce93f45..f17c00d7bf 100644 --- a/src/Makefile_Eolian_Cxx.am +++ b/src/Makefile_Eolian_Cxx.am @@ -85,7 +85,6 @@ tests/eolian_cxx/eolian_cxx_test_parse.cc \ tests/eolian_cxx/a.c \ tests/eolian_cxx/b.c \ tests/eolian_cxx/c.c \ -tests/eolian_cxx/d.c \ tests/eolian_cxx/eolian_cxx_test_binding.cc \ tests/eolian_cxx/eolian_cxx_test_address_of.cc \ tests/eolian_cxx/eolian_cxx_test_wrapper.cc \ @@ -111,7 +110,7 @@ endif tests/eolian_cxx/$(TESTS_EOLIAN_CXX_OBJNAME)eolian_cxx_suite-name1_name2_type_generation.$(OBJEXT): tests/eolian_cxx/name1_name2_type_generation.eo.h tests/eolian_cxx/name1_name2_type_generation.eo.c tests/eolian_cxx/$(TESTS_EOLIAN_CXX_OBJNAME)eolian_cxx_suite-eolian_cxx_test_inheritance.$(OBJEXT): tests/eolian_cxx/simple.eo.hh tests/eolian_cxx/simple.eo.h tests/eolian_cxx/$(TESTS_EOLIAN_CXX_OBJNAME)eolian_cxx_suite-eolian_cxx_test_binding.$(OBJEXT): tests/eolian_cxx/generic.eo.hh tests/eolian_cxx/generic.eo.h tests/eolian_cxx/generic.eo.c tests/eolian_cxx/generic_interface.eo.hh tests/eolian_cxx/generic_interface.eo.h tests/eolian_cxx/generic_interface.eo.c tests/eolian_cxx/name1_name2_type_generation.eo.hh tests/eolian_cxx/name1_name2_type_generation.eo.h tests/eolian_cxx/name1_name2_type_generation.eo.c -tests/eolian_cxx/$(TESTS_EOLIAN_CXX_OBJNAME)eolian_cxx_suite-eolian_cxx_test_address_of.$(OBJEXT): tests/eolian_cxx/a.eo.hh tests/eolian_cxx/b.eo.hh tests/eolian_cxx/c.eo.hh tests/eolian_cxx/d.eo.hh tests/eolian_cxx/a.eo.h tests/eolian_cxx/b.eo.h tests/eolian_cxx/c.eo.h tests/eolian_cxx/d.eo.h +tests/eolian_cxx/$(TESTS_EOLIAN_CXX_OBJNAME)eolian_cxx_suite-eolian_cxx_test_address_of.$(OBJEXT): tests/eolian_cxx/a.eo.hh tests/eolian_cxx/b.eo.hh tests/eolian_cxx/c.eo.hh tests/eolian_cxx/a.eo.h tests/eolian_cxx/b.eo.h tests/eolian_cxx/c.eo.h tests/eolian_cxx/$(TESTS_EOLIAN_CXX_OBJNAME)eolian_cxx_suite-eolian_cxx_test_cyclic.$(OBJEXT): tests/eolian_cxx/cyclic1.eo.hh tests/eolian_cxx/cyclic2.eo.hh tests/eolian_cxx/cyclic1.eo.c tests/eolian_cxx/cyclic2.eo.c tests/eolian_cxx/cyclic1.eo.h tests/eolian_cxx/cyclic2.eo.h tests/eolian_cxx/$(TESTS_EOLIAN_CXX_OBJNAME)eolian_cxx_suite-eolian_cxx_test_wrapper.$(OBJEXT): tests/eolian_cxx/a.eo.h tests/eolian_cxx/a.eo.c tests/eolian_cxx/a.eo.hh @@ -121,7 +120,6 @@ tests/eolian_cxx/$(TESTS_EOLIAN_CXX_OBJNAME)eolian_cxx_suite-generic.$(OBJEXT): tests/eolian_cxx/$(TESTS_EOLIAN_CXX_OBJNAME)eolian_cxx_suite-a.$(OBJEXT): tests/eolian_cxx/a.eo.c tests/eolian_cxx/a.eo.h tests/eolian_cxx/$(TESTS_EOLIAN_CXX_OBJNAME)eolian_cxx_suite-b.$(OBJEXT): tests/eolian_cxx/b.eo.c tests/eolian_cxx/b.eo.h tests/eolian_cxx/$(TESTS_EOLIAN_CXX_OBJNAME)eolian_cxx_suite-c.$(OBJEXT): tests/eolian_cxx/c.eo.c tests/eolian_cxx/c.eo.h -tests/eolian_cxx/$(TESTS_EOLIAN_CXX_OBJNAME)eolian_cxx_suite-d.$(OBJEXT): tests/eolian_cxx/d.eo.c tests/eolian_cxx/d.eo.h tests/eolian_cxx/$(TESTS_EOLIAN_CXX_OBJNAME)eolian_cxx_suite-name_name.$(OBJEXT): tests/eolian_cxx/name_name.eo.c tests/eolian_cxx/name_name.eo.h tests/eolian_cxx/ns_name.eo.c tests/eolian_cxx/ns_name.eo.h tests/eolian_cxx/ns_name_other.eo.c tests/eolian_cxx/ns_name_other.eo.h tests/eolian_cxx/$(TESTS_EOLIAN_CXX_OBJNAME)eolian_cxx_suite-name_name_cxx.$(OBJEXT): tests/eolian_cxx/name_name.eo.h tests/eolian_cxx/name_name.eo.hh tests/eolian_cxx/ns_name.eo.h tests/eolian_cxx/ns_name.eo.hh tests/eolian_cxx/ns_name_other.eo.h tests/eolian_cxx/ns_name_other.eo.hh @@ -145,7 +143,6 @@ tests/eolian_cxx/generic_interface.eo.impl.hh \ tests/eolian_cxx/a.eo.hh tests/eolian_cxx/a.eo.impl.hh tests/eolian_cxx/a.eo.c tests/eolian_cxx/a.eo.h \ tests/eolian_cxx/b.eo.hh tests/eolian_cxx/b.eo.impl.hh tests/eolian_cxx/b.eo.c tests/eolian_cxx/b.eo.h \ tests/eolian_cxx/c.eo.hh tests/eolian_cxx/c.eo.impl.hh tests/eolian_cxx/c.eo.c tests/eolian_cxx/c.eo.h \ -tests/eolian_cxx/d.eo.hh tests/eolian_cxx/d.eo.impl.hh tests/eolian_cxx/d.eo.c tests/eolian_cxx/d.eo.h \ tests/eolian_cxx/name_name.eo.hh \ tests/eolian_cxx/name_name.eo.c \ tests/eolian_cxx/name_name.eo.h \ @@ -207,7 +204,6 @@ tests/eolian_cxx/docs.eo \ tests/eolian_cxx/a.eo \ tests/eolian_cxx/b.eo \ tests/eolian_cxx/c.eo \ -tests/eolian_cxx/d.eo \ tests/eolian_cxx/name_name.eo \ tests/eolian_cxx/ns_name.eo \ tests/eolian_cxx/ns_name_other.eo \ diff --git a/src/Makefile_Eolian_Mono_Helper.am b/src/Makefile_Eolian_Mono_Helper.am index 6097c447b3..3ada3b2a0b 100644 --- a/src/Makefile_Eolian_Mono_Helper.am +++ b/src/Makefile_Eolian_Mono_Helper.am @@ -8,7 +8,11 @@ EOLIAN_MONO = EFL_RUN_IN_TREE=1 $(top_builddir)/src/bin/eolian_mono/eolian_mono$ _EOLIAN_MONO_DEP = bin/eolian_mono/eolian_mono${EXEEXT} endif +if HAVE_CSHARP_BETA +EOLIAN_MONO_FLAGS = -b -M @VMAJ@ -m @VMIN@ +else EOLIAN_MONO_FLAGS = -M @VMAJ@ -m @VMIN@ +endif AM_V_EOLMONO = $(am__v_EOLMONO_@AM_V@) am__v_EOLMONO_ = $(am__v_EOLMONO_@AM_DEFAULT_V@) diff --git a/src/bin/edje/edje_cc_out.c b/src/bin/edje/edje_cc_out.c index e43199e8ee..41eae28ac0 100644 --- a/src/bin/edje/edje_cc_out.c +++ b/src/bin/edje/edje_cc_out.c @@ -750,10 +750,38 @@ check_program(Edje_Part_Collection *pc, Edje_Program *ep, Eet_File *ef) EINA_LIST_FOREACH(ep->targets, l, et) { + Edje_Part *part; + + part = pc->parts[et->id]; + /* verify existence of description in part */ + if (ep->action == EDJE_ACTION_TYPE_STATE_SET) + { + if ((!eina_streq(ep->state, "custom")) && + ((!eina_streq(ep->state, "default")) || (!EINA_DBL_EQ(ep->value, 0.0)))) + { + Edje_Part_Collection_Directory_Entry *de; + Eina_Bool found = EINA_FALSE; + for (i = 0; i < part->other.desc_count; i++) + { + Edje_Part_Description_Common *ed = part->other.desc[i]; + if (eina_streq(ed->state.name, ep->state) && EINA_DBL_EQ(ep->value, ed->state.value)) + { + found = EINA_TRUE; + break; + } + } + if (!found) + { + de = eina_hash_find(edje_collections_lookup, &pc->id); + error_and_abort(NULL, "GROUP %s - state '%s:%g' does not exist for part '%s'; set in program '%s'", + de->entry, ep->state, ep->value, part->name, ep->name); + } + } + } if (((ep->action == EDJE_ACTION_TYPE_STATE_SET) || (ep->action == EDJE_ACTION_TYPE_SIGNAL_EMIT)) && (et->id < (int)pc->parts_count) && - (pc->parts[et->id]->type == EDJE_PART_TYPE_MESH_NODE) && + (part->type == EDJE_PART_TYPE_MESH_NODE) && (strstr(ep->signal, "mouse"))) { for (i = 0; (i < pc->parts_count) && (ep->source_3d_id < 0); i++) diff --git a/src/bin/efreet/efreet_mime_cache_create.c b/src/bin/efreet/efreet_mime_cache_create.c index b179316677..68e30179ee 100644 --- a/src/bin/efreet/efreet_mime_cache_create.c +++ b/src/bin/efreet/efreet_mime_cache_create.c @@ -296,7 +296,7 @@ store_cache(const char *out) goto write_error; EINA_LIST_FOREACH(mimes_str_offsets, l, ptr) { - val = (int)((long)ptr) + str_start; + val = (int)((size_t)ptr) + str_start; if (fwrite(&val, sizeof(val), 1, f) != 1) goto write_error; } @@ -307,12 +307,12 @@ store_cache(const char *out) ll = extn_mimes_sorted; EINA_LIST_FOREACH(extn_mimes_str_offsets, l, ptr) { - val = (int)((long)ptr) + str_start + mimes_str_len; + val = (int)((size_t)ptr) + str_start + mimes_str_len; if (fwrite(&val, sizeof(val), 1, f) != 1) goto write_error; s = eina_hash_find(extn_mimes, ll->data); ptr = find_off(s, mimes_sorted, mimes_str_offsets); - val = (int)((long)ptr) + str_start; + val = (int)((size_t)ptr) + str_start; if (fwrite(&val, sizeof(val), 1, f) != 1) goto write_error; ll = ll->next; @@ -324,12 +324,12 @@ store_cache(const char *out) ll = glob_mimes_sorted; EINA_LIST_FOREACH(glob_mimes_str_offsets, l, ptr) { - val = (int)((long)ptr) + str_start + mimes_str_len + extn_mimes_str_len; + val = (int)((size_t)ptr) + str_start + mimes_str_len + extn_mimes_str_len; if (fwrite(&val, sizeof(val), 1, f) != 1) goto write_error; s = eina_hash_find(glob_mimes, ll->data); ptr = find_off(s, mimes_sorted, mimes_str_offsets); - val = (int)((long)ptr) + str_start; + val = (int)((size_t)ptr) + str_start; if (fwrite(&val, sizeof(val), 1, f) != 1) goto write_error; ll = ll->next; diff --git a/src/bin/elementary/test_bg.c b/src/bin/elementary/test_bg.c index f71dd7bb86..1802a69f79 100644 --- a/src/bin/elementary/test_bg.c +++ b/src/bin/elementary/test_bg.c @@ -422,13 +422,13 @@ test_bg_scale_type(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *e o_bg = efl_add(EFL_UI_BG_CLASS, box, efl_file_set(efl_added, buf, NULL), efl_gfx_size_hint_weight_set(efl_added, EFL_GFX_SIZE_HINT_EXPAND, EFL_GFX_SIZE_HINT_EXPAND), - efl_gfx_size_hint_align_set(efl_added, EFL_GFX_SIZE_HINT_FILL, EFL_GFX_SIZE_HINT_FILL), + efl_gfx_size_hint_fill_set(efl_added, EINA_TRUE, EINA_TRUE), efl_pack(box, efl_added)); hbox = efl_add(EFL_UI_BOX_CLASS, box, efl_ui_direction_set(efl_added, EFL_UI_DIR_HORIZONTAL), efl_gfx_size_hint_weight_set(efl_added, EFL_GFX_SIZE_HINT_EXPAND, 0.0), - efl_gfx_size_hint_align_set(efl_added, EFL_GFX_SIZE_HINT_FILL, EFL_GFX_SIZE_HINT_FILL), + efl_gfx_size_hint_fill_set(efl_added, EINA_TRUE, EINA_TRUE), efl_pack(box, efl_added)); rdg = rd = efl_add(EFL_UI_RADIO_CLASS, hbox, diff --git a/src/bin/elementary/test_efl_anim_interpolator.c b/src/bin/elementary/test_efl_anim_interpolator.c index 2eb30f69cf..ca2e2446f9 100644 --- a/src/bin/elementary/test_efl_anim_interpolator.c +++ b/src/bin/elementary/test_efl_anim_interpolator.c @@ -78,12 +78,12 @@ static void _anim_ended_cb(void *data, const Efl_Event *event) { App_Data *ad = data; + int i; printf("Animation has been ended!\n"); ad->running_anim_cnt--; - int i; for (i = 0; i < INTERP_NUM; i++) { if (ad->anim_obj[i] == event->object) @@ -123,8 +123,8 @@ static void _anim_start_all(void *data, Evas_Object *obj, void *event_info EINA_UNUSED) { App_Data *ad = data; - int i; + for (i = 0; i < INTERP_NUM; i++) { //Let Animation Object start animation @@ -139,19 +139,32 @@ static void _win_del_cb(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED) { App_Data *ad = data; + int i; + + for (i = 0; i < INTERP_NUM; i++) + { + //Unregister callback called when window deletes + efl_event_callback_del(ad->anim_obj[i], + EFL_ANIMATION_PLAYER_EVENT_ENDED, + _anim_ended_cb, ad); + } + free(ad); } void test_efl_anim_interpolator(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED) { + int i; + App_Data *ad = calloc(1, sizeof(App_Data)); if (!ad) return; const char *modes[] = {"LINEAR", "SINUSOIDAL", "DECELERATE", "ACCELERATE", "DIVISOR_INTERP", "BOUNCE", "SPRING"}; - Evas_Object *win = elm_win_add(NULL, "Efl Animation Interpolator", ELM_WIN_BASIC); + Evas_Object *win = + elm_win_add(NULL, "Efl Animation Interpolator", ELM_WIN_BASIC); elm_win_title_set(win, "Efl Animation Interpolator"); elm_win_autodel_set(win, EINA_TRUE); evas_object_smart_callback_add(win, "delete,request", _win_del_cb, ad); @@ -162,10 +175,10 @@ test_efl_anim_interpolator(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, evas_object_resize(start_all_btn, WIN_W, BTN_H); evas_object_move(start_all_btn, 0, (WIN_H - BTN_H)); evas_object_show(start_all_btn); - evas_object_smart_callback_add(start_all_btn, "clicked", _anim_start_all, ad); + evas_object_smart_callback_add(start_all_btn, "clicked", + _anim_start_all, ad); ad->start_all_btn = start_all_btn; - int i; for (i = 0; i < INTERP_NUM; i++) { Evas_Object *label = elm_label_add(win); @@ -184,7 +197,8 @@ test_efl_anim_interpolator(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, evas_object_smart_callback_add(btn, "clicked", _anim_start, ad); ad->btn[i] = btn; - Efl_Canvas_Animation *anim = efl_add(EFL_CANVAS_ANIMATION_TRANSLATE_CLASS, win); + Efl_Canvas_Animation *anim = + efl_add(EFL_CANVAS_ANIMATION_TRANSLATE_CLASS, win); efl_animation_translate_set(anim, 0, 0, (WIN_W - BTN_W), 0); efl_animation_duration_set(anim, 2.0); efl_animation_final_state_keep_set(anim, EINA_FALSE); @@ -194,19 +208,23 @@ test_efl_anim_interpolator(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, ad->anim[i] = anim; //Create Animation Object from Animation - Efl_Canvas_Animation_Player *anim_obj = efl_add(EFL_CANVAS_ANIMATION_PLAYER_CLASS, win, - efl_animation_player_animation_set(efl_added, anim), - efl_animation_player_target_set(efl_added, btn)); + Efl_Canvas_Animation_Player *anim_obj = + efl_add(EFL_CANVAS_ANIMATION_PLAYER_CLASS, win, + efl_animation_player_animation_set(efl_added, anim), + efl_animation_player_target_set(efl_added, btn)); ad->anim_obj[i] = anim_obj; //Register callback called when animation starts - efl_event_callback_add(anim_obj, EFL_ANIMATION_PLAYER_EVENT_STARTED, _anim_started_cb, ad); + efl_event_callback_add(anim_obj, EFL_ANIMATION_PLAYER_EVENT_STARTED, + _anim_started_cb, ad); //Register callback called when animation ends - efl_event_callback_add(anim_obj, EFL_ANIMATION_PLAYER_EVENT_ENDED, _anim_ended_cb, ad); + efl_event_callback_add(anim_obj, EFL_ANIMATION_PLAYER_EVENT_ENDED, + _anim_ended_cb, ad); //Register callback called while animation is executed - efl_event_callback_add(anim_obj, EFL_ANIMATION_PLAYER_EVENT_RUNNING, _anim_running_cb, NULL); + efl_event_callback_add(anim_obj, EFL_ANIMATION_PLAYER_EVENT_RUNNING, + _anim_running_cb, NULL); } ad->running_anim_cnt = 0; diff --git a/src/bin/elementary/test_evas_snapshot.c b/src/bin/elementary/test_evas_snapshot.c index e288278a4a..96b7bc4478 100644 --- a/src/bin/elementary/test_evas_snapshot.c +++ b/src/bin/elementary/test_evas_snapshot.c @@ -175,7 +175,7 @@ test_evas_snapshot(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *e box = efl_add(EFL_UI_BOX_CLASS, win, efl_ui_direction_set(efl_added, EFL_UI_DIR_HORIZONTAL), - efl_gfx_size_hint_align_set(efl_added, -1.0, -1.0), + efl_gfx_size_hint_fill_set(efl_added, EINA_TRUE, EINA_TRUE), efl_pack_table(table, efl_added, 0, TABLE_SIZE + 1, TABLE_SIZE, 1)); efl_add(EFL_UI_BUTTON_CLASS, win, diff --git a/src/bin/elementary/test_gfx_filters.c b/src/bin/elementary/test_gfx_filters.c index b110894f2a..58fd21c4a5 100644 --- a/src/bin/elementary/test_gfx_filters.c +++ b/src/bin/elementary/test_gfx_filters.c @@ -346,7 +346,8 @@ test_gfx_filters(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *eve box2 = efl_add(EFL_UI_BOX_CLASS, win, efl_ui_direction_set(efl_added, EFL_UI_DIR_HORIZONTAL), efl_gfx_size_hint_weight_set(efl_added, 1.0, 0.0), - efl_gfx_size_hint_align_set(efl_added, -1.0, 0.0)); + efl_gfx_size_hint_align_set(efl_added, 0.5, 0.0), + efl_gfx_size_hint_fill_set(efl_added, EINA_TRUE, EINA_FALSE)); efl_pack(box, box2); /* FIXME: Efl.Ui.Text doesn't work as expected. */ @@ -375,7 +376,7 @@ test_gfx_filters(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *eve o = efl_add(EFL_UI_BUTTON_CLASS, win, efl_text_set(efl_added, "Flip"), efl_gfx_size_hint_weight_set(efl_added, 0.0, 1.0), - efl_gfx_size_hint_align_set(efl_added, -1.0, 0.5), + efl_gfx_size_hint_fill_set(efl_added, EINA_TRUE, EINA_FALSE), efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED, _flip_click, win)); efl_pack(box2, o); } @@ -384,7 +385,7 @@ test_gfx_filters(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *eve box2 = efl_add(EFL_UI_BOX_CLASS, win, efl_ui_direction_set(efl_added, EFL_UI_DIR_HORIZONTAL), efl_gfx_size_hint_weight_set(efl_added, 1.0, 0.0), - efl_gfx_size_hint_align_set(efl_added, -1.0, 0.5), + efl_gfx_size_hint_fill_set(efl_added, EINA_TRUE, EINA_FALSE), efl_pack_padding_set(efl_added, 5, 5, 1), efl_gfx_size_hint_margin_set(efl_added, 5, 5, 5, 5), efl_pack_align_set(efl_added, 0, 0.5)); @@ -453,7 +454,7 @@ test_gfx_filters(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *eve box2 = efl_add(EFL_UI_BOX_STACK_CLASS, win, efl_ui_direction_set(efl_added, EFL_UI_DIR_HORIZONTAL), efl_gfx_size_hint_weight_set(efl_added, 1.0, 0.0), - efl_gfx_size_hint_align_set(efl_added, -1.0, -1.0), + efl_gfx_size_hint_fill_set(efl_added, EINA_TRUE, EINA_TRUE), efl_pack_align_set(efl_added, 0.5, 0.5)); efl_pack(flip, box2); @@ -469,7 +470,7 @@ test_gfx_filters(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *eve o = box2 = efl_add(EFL_UI_BOX_STACK_CLASS, win, efl_ui_direction_set(efl_added, EFL_UI_DIR_HORIZONTAL), efl_gfx_size_hint_weight_set(efl_added, 1.0, 0.0), - efl_gfx_size_hint_align_set(efl_added, -1.0, -1.0), + efl_gfx_size_hint_fill_set(efl_added, EINA_TRUE, EINA_TRUE), efl_pack_align_set(efl_added, 0.5, 0.5)); efl_pack(flip, box2); diff --git a/src/bin/elementary/test_ui_box.c b/src/bin/elementary/test_ui_box.c index effa539463..58194a4099 100644 --- a/src/bin/elementary/test_ui_box.c +++ b/src/bin/elementary/test_ui_box.c @@ -112,6 +112,30 @@ alignv_slider_cb(void *data, const Efl_Event *event) efl_pack_align_set(box, ah, val); } +static void +alignh_btn_slider_cb(void *data, const Efl_Event *event) +{ + double av, val; + Eo *win = data, *btn; + + btn = efl_key_wref_get(win, "button"); + val = elm_slider_value_get(event->object); + efl_gfx_size_hint_align_get(btn, NULL, &av); + efl_gfx_size_hint_align_set(btn, val, av); +} + +static void +alignv_btn_slider_cb(void *data, const Efl_Event *event) +{ + double ah, val; + Eo *win = data, *btn; + + btn = efl_key_wref_get(win, "button"); + val = elm_slider_value_get(event->object); + efl_gfx_size_hint_align_get(btn, &ah, NULL); + efl_gfx_size_hint_align_set(btn, ah, val); +} + static void flow_check_cb(void *data, const Efl_Event *event) { @@ -245,7 +269,8 @@ test_ui_box(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_in /* weights radio group */ bx = efl_add(EFL_UI_BOX_CLASS, win, efl_ui_direction_set(efl_added, EFL_UI_DIR_DOWN)); - efl_gfx_size_hint_align_set(bx, 0, -1); + efl_gfx_size_hint_align_set(bx, 0, 0.5); + efl_gfx_size_hint_fill_set(bx, EINA_FALSE, EINA_TRUE); efl_pack(hbox, bx); chk = o = elm_radio_add(win); @@ -298,7 +323,8 @@ test_ui_box(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_in /* misc */ bx = efl_add(EFL_UI_BOX_CLASS, win, efl_ui_direction_set(efl_added, EFL_UI_DIR_DOWN)); - efl_gfx_size_hint_align_set(bx, 0, -1); + efl_gfx_size_hint_align_set(bx, 0, 0.5); + efl_gfx_size_hint_fill_set(bx, EINA_FALSE, EINA_TRUE); efl_gfx_size_hint_weight_set(bx, 0, 1); efl_pack(hbox, bx); @@ -352,7 +378,8 @@ test_ui_box(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_in /* user min size setter */ bx = efl_add(EFL_UI_BOX_CLASS, win, efl_ui_direction_set(efl_added, EFL_UI_DIR_DOWN)); - efl_gfx_size_hint_align_set(bx, 0, -1); + efl_gfx_size_hint_align_set(bx, 0, 0.5); + efl_gfx_size_hint_fill_set(bx, EINA_FALSE, EINA_TRUE); efl_gfx_size_hint_weight_set(bx, 0, 1); efl_pack(hbox, bx); @@ -378,7 +405,8 @@ test_ui_box(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_in /* inner box padding */ bx = efl_add(EFL_UI_BOX_CLASS, win, efl_ui_direction_set(efl_added, EFL_UI_DIR_DOWN)); - efl_gfx_size_hint_align_set(bx, 0, -1); + efl_gfx_size_hint_align_set(bx, 0, 0.5); + efl_gfx_size_hint_fill_set(bx, EINA_FALSE, EINA_TRUE); efl_gfx_size_hint_weight_set(bx, 0, 1); efl_pack(hbox, bx); @@ -404,7 +432,8 @@ test_ui_box(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_in /* outer margin */ bx = efl_add(EFL_UI_BOX_CLASS, win, efl_ui_direction_set(efl_added, EFL_UI_DIR_DOWN)); - efl_gfx_size_hint_align_set(bx, 0, -1); + efl_gfx_size_hint_align_set(bx, 0, 0.5); + efl_gfx_size_hint_fill_set(bx, EINA_FALSE, EINA_TRUE); efl_gfx_size_hint_weight_set(bx, 0, 1); efl_pack(hbox, bx); @@ -430,7 +459,8 @@ test_ui_box(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_in /* Box align */ bx = efl_add(EFL_UI_BOX_CLASS, win, efl_ui_direction_set(efl_added, EFL_UI_DIR_DOWN)); - efl_gfx_size_hint_align_set(bx, 0, -1); + efl_gfx_size_hint_align_set(bx, 0, 0.5); + efl_gfx_size_hint_fill_set(bx, EINA_FALSE, EINA_TRUE); efl_gfx_size_hint_weight_set(bx, 1, 1); efl_pack(hbox, bx); @@ -466,6 +496,46 @@ test_ui_box(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_in efl_pack(bx, o); efl_gfx_entity_visible_set(o, 1); + /* Button align */ + bx = efl_add(EFL_UI_BOX_CLASS, win, + efl_ui_direction_set(efl_added, EFL_UI_DIR_DOWN)); + efl_gfx_size_hint_align_set(bx, 0, 0.5); + efl_gfx_size_hint_fill_set(bx, EINA_FALSE, EINA_TRUE); + efl_gfx_size_hint_weight_set(bx, 1, 1); + efl_pack(hbox, bx); + + o = elm_label_add(win); + elm_object_text_set(o, "Button align"); + efl_pack(bx, o); + efl_gfx_entity_visible_set(o, 1); + + o = elm_slider_add(win); + elm_slider_indicator_format_set(o, "%.1f"); + elm_slider_indicator_show_set(o, 1); + elm_slider_horizontal_set(o, 0); + efl_gfx_size_hint_align_set(o, 0.5, -1); + efl_gfx_size_hint_weight_set(o, 1, 1); + efl_event_callback_add(o, EFL_UI_SLIDER_EVENT_CHANGED, alignv_btn_slider_cb, win); + elm_slider_min_max_set(o, 0.0, 1.0); + elm_slider_step_set(o, 0.1); + elm_slider_value_set(o, 0.5); + efl_pack(bx, o); + efl_gfx_entity_visible_set(o, 1); + + o = elm_slider_add(win); + elm_slider_indicator_format_set(o, "%.1f"); + elm_slider_indicator_show_set(o, 1); + elm_slider_horizontal_set(o, 1); + efl_gfx_size_hint_align_set(o, 0.5, -1); + efl_gfx_size_hint_weight_set(o, 1, 0); + efl_gfx_size_hint_min_set(o, EINA_SIZE2D(100, 0)); + efl_event_callback_add(o, EFL_UI_SLIDER_EVENT_CHANGED, alignh_btn_slider_cb, win); + elm_slider_min_max_set(o, -0.1, 1.0); + elm_slider_step_set(o, 0.1); + elm_slider_value_set(o, 0.5); + efl_pack(bx, o); + efl_gfx_entity_visible_set(o, 1); + /* contents */ f = elm_frame_add(win); @@ -483,14 +553,17 @@ test_ui_box(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_in efl_gfx_size_hint_weight_set(bx, 1, 1); efl_content_set(f, bx); - objects[i++] = o = elm_button_add(win); - elm_object_text_set(o, "Btn1"); + objects[i++] = o = efl_add(EFL_UI_BUTTON_CLASS, bx); + efl_text_set(o, "Btn1"); + efl_gfx_size_hint_weight_set(o, 0, 0); + efl_gfx_size_hint_align_set(o, 0.5, 0.5); + efl_gfx_size_hint_fill_set(o, EINA_FALSE, EINA_FALSE); efl_pack(bx, o); efl_gfx_entity_visible_set(o, 1); - objects[i++] = o = elm_button_add(win); - elm_object_text_set(o, "Button 2"); - efl_gfx_size_hint_align_set(o, -1, -1); + objects[i++] = o = efl_add(EFL_UI_BUTTON_CLASS, bx); + efl_text_set(o, "Button 2"); + efl_gfx_size_hint_weight_set(o, 0, 0); efl_pack(bx, o); efl_gfx_entity_visible_set(o, 1); @@ -501,15 +574,19 @@ test_ui_box(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_in efl_pack(bx, o); efl_gfx_entity_visible_set(o, 1); - objects[i++] = o = elm_button_add(win); - elm_object_text_set(o, "Min size"); + objects[i++] = o = efl_add(EFL_UI_BUTTON_CLASS, bx); + efl_text_set(o, "Min size"); + efl_gfx_size_hint_weight_set(o, 0, 0); + efl_gfx_size_hint_fill_set(o, EINA_FALSE, EINA_FALSE); efl_gfx_size_hint_align_set(o, 0.5, 1.0); efl_gfx_size_hint_aspect_set(o, EFL_GFX_SIZE_HINT_ASPECT_BOTH, EINA_SIZE2D(1, 1)); efl_pack(bx, o); efl_gfx_entity_visible_set(o, 1); - objects[i++] = o = elm_button_add(win); - elm_object_text_set(o, "Quit!"); + objects[i++] = o = efl_add(EFL_UI_BUTTON_CLASS, bx); + efl_text_set(o, "Quit!"); + efl_gfx_size_hint_weight_set(o, 0, 0); + efl_gfx_size_hint_fill_set(o, EINA_FALSE, EINA_FALSE); efl_gfx_size_hint_align_set(o, 0.5, 0.0); efl_pack(bx, o); efl_gfx_entity_visible_set(o, 1); @@ -521,26 +598,33 @@ test_ui_box(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_in efl_pack(bx, o); efl_gfx_entity_visible_set(o, 1); - objects[i++] = o = elm_button_add(win); - elm_object_text_set(o, "Button with a quite long text."); - efl_gfx_size_hint_align_set(o, -1, -1); + objects[i++] = o = efl_add(EFL_UI_BUTTON_CLASS, bx); + efl_key_wref_set(win, "button", o); + efl_text_set(o, "Button with a quite long text."); + efl_gfx_size_hint_weight_set(o, 0, 0); efl_gfx_size_hint_max_set(o, EINA_SIZE2D(200, 100)); efl_pack(bx, o); efl_gfx_entity_visible_set(o, 1); - objects[i++] = o = elm_button_add(win); - elm_object_text_set(o, "BtnA"); + objects[i++] = o = efl_add(EFL_UI_BUTTON_CLASS, bx); + efl_text_set(o, "BtnA"); + efl_gfx_size_hint_weight_set(o, 0, 0); + efl_gfx_size_hint_fill_set(o, EINA_FALSE, EINA_FALSE); efl_gfx_size_hint_aspect_set(o, EFL_GFX_SIZE_HINT_ASPECT_BOTH, EINA_SIZE2D(1, 2)); efl_pack(bx, o); efl_gfx_entity_visible_set(o, 1); - objects[i++] = o = elm_button_add(win); - elm_object_text_set(o, "BtnB"); + objects[i++] = o = efl_add(EFL_UI_BUTTON_CLASS, bx); + efl_text_set(o, "BtnB"); + efl_gfx_size_hint_weight_set(o, 0, 0); + efl_gfx_size_hint_fill_set(o, EINA_FALSE, EINA_FALSE); efl_pack(bx, o); efl_gfx_entity_visible_set(o, 1); - objects[i++] = o = elm_button_add(win); - elm_object_text_set(o, "BtnC"); + objects[i++] = o = efl_add(EFL_UI_BUTTON_CLASS, bx); + efl_text_set(o, "BtnC"); + efl_gfx_size_hint_weight_set(o, 0, 0); + efl_gfx_size_hint_fill_set(o, EINA_FALSE, EINA_FALSE); efl_pack(bx, o); efl_gfx_entity_visible_set(o, 1); diff --git a/src/bin/elementary/test_ui_clock.c b/src/bin/elementary/test_ui_clock.c index 2e667b5026..fc20112c04 100644 --- a/src/bin/elementary/test_ui_clock.c +++ b/src/bin/elementary/test_ui_clock.c @@ -58,7 +58,7 @@ test_ui_clock(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_ dt1 = efl_add(EFL_UI_CLOCK_CLASS, bx, efl_gfx_size_hint_weight_set(efl_added, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND), - efl_gfx_size_hint_align_set(efl_added, EVAS_HINT_FILL, 0.5), + efl_gfx_size_hint_fill_set(efl_added, EINA_TRUE, EINA_FALSE), efl_ui_clock_field_visible_set(efl_added, EFL_UI_CLOCK_TYPE_HOUR, EINA_FALSE), efl_ui_clock_field_visible_set(efl_added, EFL_UI_CLOCK_TYPE_MINUTE, EINA_FALSE), efl_ui_clock_field_visible_set(efl_added, EFL_UI_CLOCK_TYPE_AMPM, EINA_FALSE), @@ -70,7 +70,7 @@ test_ui_clock(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_ dt2 = efl_add(EFL_UI_CLOCK_CLASS, bx, efl_gfx_size_hint_weight_set(efl_added, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND), - efl_gfx_size_hint_align_set(efl_added, EVAS_HINT_FILL, 0.5), + efl_gfx_size_hint_fill_set(efl_added, EINA_TRUE, EINA_FALSE), efl_ui_clock_field_visible_set(efl_added, EFL_UI_CLOCK_TYPE_YEAR, EINA_FALSE), efl_ui_clock_field_visible_set(efl_added, EFL_UI_CLOCK_TYPE_MONTH, EINA_FALSE), efl_ui_clock_field_visible_set(efl_added, EFL_UI_CLOCK_TYPE_DATE, EINA_FALSE), @@ -81,19 +81,20 @@ test_ui_clock(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_ dt3 = efl_add(EFL_UI_CLOCK_CLASS, bx, efl_gfx_size_hint_weight_set(efl_added, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND), - efl_gfx_size_hint_align_set(efl_added, EVAS_HINT_FILL, 0.5), + efl_gfx_size_hint_fill_set(efl_added, EINA_TRUE, EINA_FALSE), efl_pack(bx, efl_added)); efl_add(EFL_UI_TEXT_CLASS, bx, efl_text_set(efl_added, "Editable Clock:"), efl_gfx_size_hint_weight_set(efl_added, 0.0, 0.0), - efl_gfx_size_hint_align_set(efl_added, 0, EVAS_HINT_FILL), + efl_gfx_size_hint_align_set(efl_added, 0, 0.5), + efl_gfx_size_hint_fill_set(efl_added, EINA_FALSE, EINA_TRUE), efl_gfx_size_hint_min_set(efl_added, EINA_SIZE2D(100, 25)), efl_pack(bx, efl_added)); dt4 = efl_add(EFL_UI_CLOCK_CLASS, bx, efl_gfx_size_hint_weight_set(efl_added, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND), - efl_gfx_size_hint_align_set(efl_added, EVAS_HINT_FILL, 0.5), + efl_gfx_size_hint_fill_set(efl_added, EINA_TRUE, EINA_FALSE), efl_ui_clock_edit_mode_set(efl_added, EINA_TRUE), efl_ui_clock_pause_set(efl_added, EINA_TRUE), efl_pack(bx, efl_added)); diff --git a/src/bin/elementary/test_ui_scroller.c b/src/bin/elementary/test_ui_scroller.c index a1f8cbd2f8..2cbceb77f3 100644 --- a/src/bin/elementary/test_ui_scroller.c +++ b/src/bin/elementary/test_ui_scroller.c @@ -45,7 +45,8 @@ test_efl_ui_scroller(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void bx = efl_add(EFL_UI_BOX_CLASS, sc, efl_ui_direction_set(efl_added, EFL_UI_DIR_DOWN), efl_gfx_size_hint_weight_set(efl_added, EVAS_HINT_EXPAND, 0), - efl_gfx_size_hint_align_set(efl_added, EVAS_HINT_FILL, 0), + efl_gfx_size_hint_align_set(efl_added, 0.5, 0), + efl_gfx_size_hint_fill_set(efl_added, EINA_TRUE, EINA_FALSE), efl_content_set(sc, efl_added)); efl_add(EFL_UI_SLIDER_CLASS, bx, @@ -57,7 +58,7 @@ test_efl_ui_scroller(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void efl_add(EFL_UI_BUTTON_CLASS, bx, efl_text_set(efl_added, "Vertical"), efl_gfx_size_hint_weight_set(efl_added, EVAS_HINT_EXPAND, 0.0), - efl_gfx_size_hint_align_set(efl_added, EVAS_HINT_FILL, 0.5), + efl_gfx_size_hint_fill_set(efl_added, EINA_TRUE, EINA_FALSE), efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED, _bt_clicked, NULL), efl_pack(bx, efl_added)); } @@ -83,7 +84,7 @@ test_efl_ui_scroller(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void efl_add(EFL_UI_BUTTON_CLASS, bx, efl_text_set(efl_added, "Vertical"), efl_gfx_size_hint_weight_set(efl_added, EVAS_HINT_EXPAND, 0.0), - efl_gfx_size_hint_align_set(efl_added, EVAS_HINT_FILL, 0.5), + efl_gfx_size_hint_fill_set(efl_added, EINA_TRUE, EINA_FALSE), efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED, _bt_clicked, NULL), efl_pack(bx, efl_added)); } @@ -100,7 +101,7 @@ test_efl_ui_scroller(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void sc3 = efl_add(EFL_UI_SCROLLER_CLASS, win, efl_gfx_size_hint_weight_set(efl_added, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND), - efl_gfx_size_hint_align_set(efl_added, EVAS_HINT_FILL, EVAS_HINT_FILL), + efl_gfx_size_hint_fill_set(efl_added, EINA_TRUE, EINA_TRUE), efl_pack_table(gd, efl_added, 0, 0, 1, 1)); gd2 = efl_add(EFL_UI_TABLE_CLASS, sc3, @@ -122,7 +123,7 @@ test_efl_ui_scroller(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void efl_add(EFL_UI_BUTTON_CLASS, bx, efl_text_set(efl_added, "Vertical"), efl_gfx_size_hint_weight_set(efl_added, EVAS_HINT_EXPAND, 0.0), - efl_gfx_size_hint_align_set(efl_added, EVAS_HINT_FILL, 0.5), + efl_gfx_size_hint_fill_set(efl_added, EINA_TRUE, EINA_FALSE), efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED, _bt_clicked, NULL), efl_pack(bx, efl_added)); } diff --git a/src/bin/elementary/test_ui_tab_pager.c b/src/bin/elementary/test_ui_tab_pager.c index 6ce97a2768..84bef407af 100644 --- a/src/bin/elementary/test_ui_tab_pager.c +++ b/src/bin/elementary/test_ui_tab_pager.c @@ -89,7 +89,7 @@ content_add(Eo *parent, char *text) efl_file_set(efl_added, buf, "page_layout"), efl_text_set(efl_part(efl_added, "text"), text), efl_gfx_size_hint_weight_set(efl_added, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND), - efl_gfx_size_hint_align_set(efl_added, EVAS_HINT_FILL, EVAS_HINT_FILL)); + efl_gfx_size_hint_fill_set(efl_added, EINA_TRUE, EINA_TRUE)); return page; } @@ -146,7 +146,7 @@ test_ui_tab_pager(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *ev tp = efl_add(EFL_UI_TAB_PAGER_CLASS, layout, efl_gfx_size_hint_weight_set(efl_added, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND), - efl_gfx_size_hint_align_set(efl_added, EVAS_HINT_FILL, EVAS_HINT_FILL), + efl_gfx_size_hint_fill_set(efl_added, EINA_TRUE, EINA_TRUE), efl_ui_pager_page_size_set(efl_added, EINA_SIZE2D(-1, -1)), efl_ui_pager_padding_set(efl_added, 20), efl_content_set(efl_part(layout, "tab_pager"), efl_added)); diff --git a/src/bin/elementary/test_ui_table.c b/src/bin/elementary/test_ui_table.c index 26f3f414f9..9f1a20ef11 100644 --- a/src/bin/elementary/test_ui_table.c +++ b/src/bin/elementary/test_ui_table.c @@ -38,7 +38,7 @@ weights_cb(void *data, const Efl_Event *event) efl_gfx_size_hint_weight_set(objects[i], 0, 0); break; case NONE_BUT_FILL: - efl_gfx_size_hint_align_set(table, -1, -1); + efl_gfx_size_hint_fill_set(table, EINA_TRUE, EINA_TRUE); for (int i = 0; i < 7; i++) efl_gfx_size_hint_weight_set(objects[i], 0, 0); break; @@ -96,6 +96,26 @@ btnmargins_slider_cb(void *data, const Efl_Event *event) efl_gfx_size_hint_margin_set(data, val, val, val, val); } +static void +alignv_slider_cb(void *data EINA_UNUSED, const Efl_Event *event) +{ + double ax, val; + + val = elm_slider_value_get(event->object); + efl_gfx_size_hint_align_get(objects[1], &ax, NULL); + efl_gfx_size_hint_align_set(objects[1], ax, val); +} + +static void +alignh_slider_cb(void *data EINA_UNUSED, const Efl_Event *event) +{ + double ay, val; + + val = elm_slider_value_get(event->object); + efl_gfx_size_hint_align_get(objects[1], NULL, &ay); + efl_gfx_size_hint_align_set(objects[1], val, ay); +} + static void layout_updated_cb(void *data, const Efl_Event *event) { @@ -205,7 +225,8 @@ test_ui_table(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_ /* weights radio group */ bx = efl_add(EFL_UI_BOX_CLASS, win, efl_ui_direction_set(efl_added, EFL_UI_DIR_DOWN)); - efl_gfx_size_hint_align_set(bx, 0, -1); + efl_gfx_size_hint_align_set(bx, 0, 0.5); + efl_gfx_size_hint_fill_set(bx, EINA_FALSE, EINA_TRUE); efl_pack(hbox, bx); chk = o = elm_radio_add(win); @@ -267,7 +288,7 @@ test_ui_table(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_ /* min size setter */ bx = efl_add(EFL_UI_BOX_CLASS, win, efl_ui_direction_set(efl_added, EFL_UI_DIR_DOWN)); - efl_gfx_size_hint_align_set(bx, 0.5, -1); + efl_gfx_size_hint_fill_set(bx, EINA_FALSE, EINA_TRUE); efl_gfx_size_hint_weight_set(bx, 0, 1); efl_pack(hbox, bx); @@ -293,7 +314,8 @@ test_ui_table(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_ /* inner box padding */ bx = efl_add(EFL_UI_BOX_CLASS, win, efl_ui_direction_set(efl_added, EFL_UI_DIR_DOWN)); - efl_gfx_size_hint_align_set(bx, 0, -1); + efl_gfx_size_hint_align_set(bx, 0, 0.5); + efl_gfx_size_hint_fill_set(bx, EINA_FALSE, EINA_TRUE); efl_gfx_size_hint_weight_set(bx, 0, 1); efl_pack(hbox, bx); @@ -319,7 +341,7 @@ test_ui_table(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_ /* outer margin */ bx = efl_add(EFL_UI_BOX_CLASS, win, efl_ui_direction_set(efl_added, EFL_UI_DIR_DOWN)); - efl_gfx_size_hint_align_set(bx, 0, -1); + efl_gfx_size_hint_fill_set(bx, EINA_FALSE, EINA_TRUE); efl_gfx_size_hint_weight_set(bx, 0, 1); efl_pack(hbox, bx); @@ -345,7 +367,8 @@ test_ui_table(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_ /* button margins */ bx = efl_add(EFL_UI_BOX_CLASS, win, efl_ui_direction_set(efl_added, EFL_UI_DIR_DOWN)); - efl_gfx_size_hint_align_set(bx, 0, -1); + efl_gfx_size_hint_align_set(bx, 0, 0.5); + efl_gfx_size_hint_fill_set(bx, EINA_FALSE, EINA_TRUE); efl_gfx_size_hint_weight_set(bx, 1, 1); efl_pack(hbox, bx); @@ -368,10 +391,48 @@ test_ui_table(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_ efl_gfx_entity_visible_set(o, 1); + /* button1 aligns */ + bx = efl_add(EFL_UI_BOX_CLASS, win, + efl_ui_direction_set(efl_added, EFL_UI_DIR_DOWN)); + efl_gfx_size_hint_align_set(bx, 0, 0.5); + efl_gfx_size_hint_fill_set(bx, EINA_FALSE, EINA_TRUE); + efl_gfx_size_hint_weight_set(bx, 1, 1); + efl_pack(hbox, bx); + + o = elm_label_add(win); + elm_object_text_set(o, "Button1 align"); + efl_pack(bx, o); + efl_gfx_entity_visible_set(o, 1); + + o = elm_slider_add(win); + elm_slider_indicator_format_set(o, "%.1f"); + elm_slider_indicator_show_set(o, 1); + elm_slider_horizontal_set(o, 0); + efl_gfx_size_hint_align_set(o, 0.5, -1); + efl_gfx_size_hint_weight_set(o, 1, 1); + efl_event_callback_add(o, EFL_UI_SLIDER_EVENT_CHANGED, alignv_slider_cb, NULL); + elm_slider_min_max_set(o, 0, 1); + elm_slider_value_set(o, 0.3); + efl_pack(bx, o); + efl_gfx_entity_visible_set(o, 1); + + o = elm_slider_add(win); + elm_slider_indicator_format_set(o, "%.1f"); + elm_slider_indicator_show_set(o, 1); + elm_slider_horizontal_set(o, 1); + efl_gfx_size_hint_align_set(o, -1, -1); + efl_gfx_size_hint_weight_set(o, 1, 0); + efl_event_callback_add(o, EFL_UI_SLIDER_EVENT_CHANGED, alignh_slider_cb, NULL); + elm_slider_min_max_set(o, 0, 1); + elm_slider_value_set(o, 0.3); + efl_pack(bx, o); + efl_gfx_entity_visible_set(o, 1); + /* ro info */ bx = efl_add(EFL_UI_BOX_CLASS, win, efl_ui_direction_set(efl_added, EFL_UI_DIR_DOWN)); - efl_gfx_size_hint_align_set(bx, 0, -1); + efl_gfx_size_hint_align_set(bx, 0, 0.5); + efl_gfx_size_hint_fill_set(bx, EINA_FALSE, EINA_TRUE); efl_gfx_size_hint_weight_set(bx, 1, 1); efl_pack(hbox, bx); @@ -411,45 +472,47 @@ test_ui_table(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_ efl_gfx_color_set(o, 64, 96, 128, 255); efl_pack_table(table, o, 0, 0, 3, 1); - objects[i++] = o = elm_button_add(win); - elm_object_text_set(o, "Button 1"); + objects[i++] = o = efl_add(EFL_UI_BUTTON_CLASS, table); + efl_text_set(o, "Button 1"); efl_gfx_size_hint_weight_set(o, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); - efl_gfx_size_hint_align_set(o, EVAS_HINT_FILL, EVAS_HINT_FILL); + efl_gfx_size_hint_fill_set(o, EINA_TRUE, EINA_TRUE); + efl_gfx_size_hint_align_set(o, 0.3, 0.3); + efl_gfx_size_hint_max_set(o, EINA_SIZE2D(100, 100)); efl_pack_table(table, o, 0, 0, 1, 1); efl_gfx_entity_visible_set(o, 1); - objects[i++] = o = elm_button_add(win); - elm_object_text_set(o, "Button 2"); + objects[i++] = o = efl_add(EFL_UI_BUTTON_CLASS, table); + efl_text_set(o, "Button 2"); efl_gfx_size_hint_weight_set(o, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); - efl_gfx_size_hint_align_set(o, EVAS_HINT_FILL, EVAS_HINT_FILL); + efl_gfx_size_hint_fill_set(o, EINA_TRUE, EINA_TRUE); efl_pack_table(table, o, 1, 0, 1, 1); efl_gfx_entity_visible_set(o, 1); - objects[i++] = o = elm_button_add(win); - elm_object_text_set(o, "Button 3"); + objects[i++] = o = efl_add(EFL_UI_BUTTON_CLASS, table); + efl_text_set(o, "Button 3"); efl_gfx_size_hint_weight_set(o, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); - efl_gfx_size_hint_align_set(o, EVAS_HINT_FILL, EVAS_HINT_FILL); + efl_gfx_size_hint_fill_set(o, EINA_TRUE, EINA_TRUE); efl_pack_table(table, o, 2, 0, 1, 1); efl_gfx_entity_visible_set(o, 1); - objects[i++] = o = elm_button_add(win); - elm_object_text_set(o, "Button 4"); + objects[i++] = o = efl_add(EFL_UI_BUTTON_CLASS, table); + efl_text_set(o, "Button 4"); efl_gfx_size_hint_weight_set(o, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); - efl_gfx_size_hint_align_set(o, EVAS_HINT_FILL, EVAS_HINT_FILL); + efl_gfx_size_hint_fill_set(o, EINA_TRUE, EINA_TRUE); efl_pack_table(table, o, 0, 1, 2, 1); efl_gfx_entity_visible_set(o, 1); - objects[i++] = o = elm_button_add(win); - elm_object_text_set(o, "Button 5"); + objects[i++] = o = efl_add(EFL_UI_BUTTON_CLASS, table); + efl_text_set(o, "Button 5"); efl_gfx_size_hint_weight_set(o, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); - efl_gfx_size_hint_align_set(o, EVAS_HINT_FILL, EVAS_HINT_FILL); + efl_gfx_size_hint_fill_set(o, EINA_TRUE, EINA_TRUE); efl_pack_table(table, o, 2, 1, 1, 2); efl_gfx_entity_visible_set(o, 1); - objects[i++] = o = elm_button_add(win); - elm_object_text_set(o, "Button 6"); + objects[i++] = o = efl_add(EFL_UI_BUTTON_CLASS, table); + efl_text_set(o, "Button 6"); efl_gfx_size_hint_weight_set(o, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); - efl_gfx_size_hint_align_set(o, EVAS_HINT_FILL, EVAS_HINT_FILL); + efl_gfx_size_hint_fill_set(o, EINA_TRUE, EINA_TRUE); efl_pack_table(table, o, 0, 2, 2, 1); efl_gfx_entity_visible_set(o, 1); @@ -475,8 +538,10 @@ static void append_cb(void *data, const Efl_Event *ev EINA_UNUSED) { Eo *table = data; - Eo *o = elm_button_add(table); - elm_object_text_set(o, btn_text("appended")); + Eo *o = efl_add(EFL_UI_BUTTON_CLASS, table); + efl_text_set(o, btn_text("appended")); + efl_gfx_size_hint_weight_set(o, 0, 0); + efl_gfx_size_hint_fill_set(o, EINA_FALSE, EINA_FALSE); efl_event_callback_add(o, EFL_UI_EVENT_CLICKED, remove_cb, NULL); elm_object_tooltip_text_set(o, "Click to unpack"); efl_pack_end(table, o); @@ -548,7 +613,8 @@ test_ui_table_linear(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, /* ro info */ bx = efl_add(EFL_UI_BOX_CLASS, win, efl_ui_direction_set(efl_added, EFL_UI_DIR_DOWN)); - efl_gfx_size_hint_align_set(bx, 0, -1); + efl_gfx_size_hint_align_set(bx, 0, 0.5); + efl_gfx_size_hint_fill_set(bx, EINA_FALSE, EINA_TRUE); efl_gfx_size_hint_weight_set(bx, 1, 1); efl_pack(hbox, bx); efl_gfx_entity_visible_set(bx, 1); @@ -586,20 +652,26 @@ test_ui_table_linear(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, elm_object_content_set(f, table); efl_gfx_entity_visible_set(table, 1); - o = elm_button_add(win); - elm_object_text_set(o, btn_text(NULL)); + o = efl_add(EFL_UI_BUTTON_CLASS, table); + efl_text_set(o, btn_text(NULL)); + efl_gfx_size_hint_weight_set(o, 0, 0); + efl_gfx_size_hint_fill_set(o, EINA_FALSE, EINA_FALSE); efl_event_callback_add(o, EFL_UI_EVENT_CLICKED, remove_cb, NULL); efl_pack(table, o); efl_gfx_entity_visible_set(o, 1); - o = elm_button_add(win); - elm_object_text_set(o, btn_text(NULL)); + o = efl_add(EFL_UI_BUTTON_CLASS, table); + efl_text_set(o, btn_text(NULL)); + efl_gfx_size_hint_weight_set(o, 0, 0); + efl_gfx_size_hint_fill_set(o, EINA_FALSE, EINA_FALSE); efl_event_callback_add(o, EFL_UI_EVENT_CLICKED, remove_cb, NULL); efl_pack(table, o); efl_gfx_entity_visible_set(o, 1); - o = elm_button_add(win); - elm_object_text_set(o, btn_text(NULL)); + o = efl_add(EFL_UI_BUTTON_CLASS, table); + efl_text_set(o, btn_text(NULL)); + efl_gfx_size_hint_weight_set(o, 0, 0); + efl_gfx_size_hint_fill_set(o, EINA_FALSE, EINA_FALSE); efl_event_callback_add(o, EFL_UI_EVENT_CLICKED, remove_cb, NULL); efl_pack(table, o); efl_gfx_entity_visible_set(o, 1); diff --git a/src/bin/elementary/test_ui_textpath.c b/src/bin/elementary/test_ui_textpath.c index 2192f44709..b865775b8d 100644 --- a/src/bin/elementary/test_ui_textpath.c +++ b/src/bin/elementary/test_ui_textpath.c @@ -100,7 +100,7 @@ test_ui_textpath(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *eve box = elm_box_add(win); elm_box_horizontal_set(box, EINA_FALSE); efl_gfx_size_hint_weight_set(box, EFL_GFX_SIZE_HINT_EXPAND, EFL_GFX_SIZE_HINT_EXPAND); - efl_gfx_size_hint_align_set(box, EFL_GFX_SIZE_HINT_FILL, EFL_GFX_SIZE_HINT_FILL); + efl_gfx_size_hint_align_set(box, EVAS_HINT_FILL, EVAS_HINT_FILL); efl_gfx_entity_visible_set(box, EINA_TRUE); txtpath = efl_add(EFL_UI_TEXTPATH_CLASS, win); @@ -115,7 +115,7 @@ test_ui_textpath(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *eve hbox = elm_box_add(win); elm_box_horizontal_set(hbox, EINA_TRUE); efl_gfx_size_hint_weight_set(hbox, EFL_GFX_SIZE_HINT_EXPAND, EFL_GFX_SIZE_HINT_EXPAND); - efl_gfx_size_hint_align_set(hbox, EFL_GFX_SIZE_HINT_FILL, EFL_GFX_SIZE_HINT_FILL); + efl_gfx_size_hint_align_set(hbox, EVAS_HINT_FILL, EVAS_HINT_FILL); efl_gfx_entity_visible_set(hbox, EINA_TRUE); elm_box_pack_end(box, hbox); @@ -142,7 +142,7 @@ test_ui_textpath(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *eve hbox = elm_box_add(win); elm_box_horizontal_set(hbox, EINA_TRUE); efl_gfx_size_hint_weight_set(hbox, EFL_GFX_SIZE_HINT_EXPAND, EFL_GFX_SIZE_HINT_EXPAND); - efl_gfx_size_hint_align_set(hbox, EFL_GFX_SIZE_HINT_FILL, EFL_GFX_SIZE_HINT_FILL); + efl_gfx_size_hint_align_set(hbox, EVAS_HINT_FILL, EVAS_HINT_FILL); efl_gfx_entity_visible_set(hbox, EINA_TRUE); elm_box_pack_end(box, hbox); @@ -150,7 +150,7 @@ test_ui_textpath(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *eve elm_object_text_set(sld, "Angle"); elm_slider_min_max_set(sld, 0, 360); elm_slider_value_set(sld, 0); - efl_gfx_size_hint_align_set(sld, 0.5, EFL_GFX_SIZE_HINT_FILL); + efl_gfx_size_hint_align_set(sld, 0.5, EVAS_HINT_FILL); efl_gfx_size_hint_weight_set(sld, EFL_GFX_SIZE_HINT_EXPAND, EFL_GFX_SIZE_HINT_EXPAND); efl_gfx_size_hint_min_set(sld, EINA_SIZE2D(150, 0)); efl_event_callback_add(sld, EFL_UI_SLIDER_EVENT_CHANGED, _angle_changed_cb, txtpath); @@ -162,7 +162,7 @@ test_ui_textpath(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *eve elm_object_text_set(sld, "Slice No"); elm_slider_min_max_set(sld, 20, 300); elm_slider_value_set(sld, 99); - efl_gfx_size_hint_align_set(sld, 0.5, EFL_GFX_SIZE_HINT_FILL); + efl_gfx_size_hint_align_set(sld, 0.5, EVAS_HINT_FILL); efl_gfx_size_hint_weight_set(sld, EFL_GFX_SIZE_HINT_EXPAND, EFL_GFX_SIZE_HINT_EXPAND); efl_gfx_size_hint_min_set(sld, EINA_SIZE2D(150, 0)); efl_event_callback_add(sld, EFL_UI_SLIDER_EVENT_CHANGED, _slice_no_changed_cb, txtpath); @@ -173,7 +173,7 @@ test_ui_textpath(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *eve hbox = elm_box_add(win); elm_box_horizontal_set(hbox, EINA_TRUE); efl_gfx_size_hint_weight_set(hbox, EFL_GFX_SIZE_HINT_EXPAND, EFL_GFX_SIZE_HINT_EXPAND); - efl_gfx_size_hint_align_set(hbox, EFL_GFX_SIZE_HINT_FILL, EFL_GFX_SIZE_HINT_FILL); + efl_gfx_size_hint_align_set(hbox, EVAS_HINT_FILL, EVAS_HINT_FILL); efl_gfx_entity_visible_set(hbox, EINA_TRUE); elm_box_pack_end(box, hbox); diff --git a/src/bin/eolian/sources.c b/src/bin/eolian/sources.c index 900b70216b..d80ca74abe 100644 --- a/src/bin/eolian/sources.c +++ b/src/bin/eolian/sources.c @@ -267,6 +267,50 @@ _generate_iterative_free(Eina_Strbuf **buf, const Eolian_Type *type, const Eolia eina_strbuf_free(iter_param); } +static int +_gen_function_param_fallback(Eina_Iterator *itr, Eina_Strbuf *fallback_free_ownership, Eina_Strbuf *param_call) +{ + Eolian_Function_Parameter *pr; + int owners = 0; + + EINA_ITERATOR_FOREACH(itr, pr) + { + const Eolian_Type *type, *inner_type; + + type = eolian_parameter_type_get(pr); + inner_type = eolian_type_base_type_get(type); + + //check if they should be freed or just ignored + if (!eolian_type_is_owned(type) || eolian_parameter_direction_get(pr) == EOLIAN_OUT_PARAM) + { + eina_strbuf_append_printf(fallback_free_ownership, " (void)%s;\n", eolian_parameter_name_get(pr)); + continue; + } + + owners ++; + + eina_strbuf_reset(param_call); + + if (eolian_parameter_direction_get(pr) == EOLIAN_INOUT_PARAM) + eina_strbuf_append_char(param_call, '*'); + eina_strbuf_append(param_call, eolian_parameter_name_get(pr)); + + //check if we might want to free or handle the children + if (!inner_type || !eolian_type_is_owned(inner_type)) + { + _generate_normal_free(&fallback_free_ownership, type, param_call, ""); + } + else if (inner_type && eolian_type_is_owned(inner_type)) + { + _generate_iterative_free(&fallback_free_ownership, type, inner_type, pr, param_call); + } + } + eina_iterator_free(itr); + + return owners; +} + + static void _gen_func(const Eolian_Class *cl, const Eolian_Function *fid, Eolian_Function_Type ftype, Eina_Strbuf *buf, @@ -356,50 +400,23 @@ _gen_func(const Eolian_Class *cl, const Eolian_Function *fid, else { Eina_Iterator *itr; - Eolian_Function_Parameter *pr; int owners = 0; Eina_Strbuf *param_call; param_call = eina_strbuf_new(); if (is_prop) - itr = eolian_property_values_get(fid, ftype); - else - itr = eolian_function_parameters_get(fid); - - EINA_ITERATOR_FOREACH(itr, pr) { - const Eolian_Type *type, *inner_type; - - type = eolian_parameter_type_get(pr); - inner_type = eolian_type_base_type_get(type); - - //check if they should be freed or just ignored - if (!eolian_type_is_owned(type) || eolian_parameter_direction_get(pr) == EOLIAN_OUT_PARAM) - { - eina_strbuf_append_printf(fallback_free_ownership, " (void)%s;\n", eolian_parameter_name_get(pr)); - continue; - } - - owners ++; - - eina_strbuf_reset(param_call); - - if (eolian_parameter_direction_get(pr) == EOLIAN_INOUT_PARAM) - eina_strbuf_append_char(param_call, '*'); - eina_strbuf_append(param_call, eolian_parameter_name_get(pr)); - - //check if we might want to free or handle the children - if (!inner_type || !eolian_type_is_owned(inner_type)) - { - _generate_normal_free(&fallback_free_ownership, type, param_call, ""); - } - else if (inner_type && eolian_type_is_owned(inner_type)) - { - _generate_iterative_free(&fallback_free_ownership, type, inner_type, pr, param_call); - } + itr = eolian_property_values_get(fid, ftype); + owners += _gen_function_param_fallback(itr, fallback_free_ownership, param_call); + itr = eolian_property_keys_get(fid, ftype); + owners += _gen_function_param_fallback(itr, fallback_free_ownership, param_call); + } + else + { + itr = eolian_function_parameters_get(fid); + owners += _gen_function_param_fallback(itr, fallback_free_ownership, param_call); } - eina_iterator_free(itr); if (owners == 0) { diff --git a/src/bin/eolian_mono/eolian/mono/async_function_definition.hh b/src/bin/eolian_mono/eolian/mono/async_function_definition.hh index 1dc705ad3a..5164311ee7 100644 --- a/src/bin/eolian_mono/eolian/mono/async_function_definition.hh +++ b/src/bin/eolian_mono/eolian/mono/async_function_definition.hh @@ -48,7 +48,7 @@ struct async_function_declaration_generator { if (f.is_static) return true; - if (blacklist::is_function_blacklisted(f.c_name)) + if (blacklist::is_function_blacklisted(f, context)) return true; if (!f.return_type.original_type.visit(is_future{})) return true; @@ -76,7 +76,7 @@ struct async_function_definition_generator if(do_super && f.is_static) // Static methods goes only on Concrete classes. return true; - if(blacklist::is_function_blacklisted(f.c_name)) + if(blacklist::is_function_blacklisted(f, context)) return true; if(!f.return_type.original_type.visit(is_future{})) return true; diff --git a/src/bin/eolian_mono/eolian/mono/blacklist.hh b/src/bin/eolian_mono/eolian/mono/blacklist.hh index fff61c7231..c11437b2df 100644 --- a/src/bin/eolian_mono/eolian/mono/blacklist.hh +++ b/src/bin/eolian_mono/eolian/mono/blacklist.hh @@ -2,7 +2,9 @@ #define EOLIAN_MONO_BLACKLIST_HH #include "grammar/klass_def.hpp" +#include "grammar/context.hpp" #include "name_helpers.hh" +#include "generation_contexts.hh" namespace eolian_mono { @@ -49,6 +51,19 @@ inline bool is_function_blacklisted(std::string const& c_name) ; } +template +inline bool is_function_blacklisted(attributes::function_def const& func, Context context) +{ + auto options = efl::eolian::grammar::context_find_tag(context); + auto c_name = func.c_name; + + if (func.is_beta && !options.want_beta) + return true; + + return is_function_blacklisted(c_name); +} + + // Blacklist structs that require some kind of manual binding. inline bool is_struct_blacklisted(std::string const& full_name) { @@ -85,9 +100,17 @@ inline bool is_property_blacklisted(std::string const& name) || name == "Efl.Text.Text"; } -inline bool is_property_blacklisted(attributes::property_def const& property) +template +inline bool is_property_blacklisted(attributes::property_def const& property, Context context) { auto name = name_helpers::klass_full_concrete_or_interface_name(property.klass) + "." + name_helpers::property_managed_name(property); + + if (property.getter.is_engaged()) + if (is_function_blacklisted(*property.getter, context)) + return true; + if (property.setter.is_engaged()) + if (is_function_blacklisted(*property.setter, context)) + return true; return is_property_blacklisted(name); } diff --git a/src/bin/eolian_mono/eolian/mono/events.hh b/src/bin/eolian_mono/eolian/mono/events.hh index 22849a9fcb..c9cb686803 100644 --- a/src/bin/eolian_mono/eolian/mono/events.hh +++ b/src/bin/eolian_mono/eolian/mono/events.hh @@ -264,7 +264,7 @@ struct event_definition_generator << scope_tab << scope_tab << scope_tab << "On_" << wrapper_evt_name << "(args);\n" << scope_tab << scope_tab << "} catch (Exception e) {\n" << scope_tab << scope_tab << scope_tab << "Eina.Log.Error(e.ToString());\n" - << scope_tab << scope_tab << scope_tab << "Eina.Error.Set(Eina.Error.EFL_ERROR);\n" + << scope_tab << scope_tab << scope_tab << "Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);\n" << scope_tab << scope_tab << "}\n" << scope_tab << "}\n\n" ).generate(sink, attributes::unused, context)) diff --git a/src/bin/eolian_mono/eolian/mono/function_declaration.hh b/src/bin/eolian_mono/eolian/mono/function_declaration.hh index 8fdb8269e8..baad0bb33d 100644 --- a/src/bin/eolian_mono/eolian/mono/function_declaration.hh +++ b/src/bin/eolian_mono/eolian/mono/function_declaration.hh @@ -20,7 +20,7 @@ struct function_declaration_generator template bool generate(OutputIterator sink, attributes::function_def const& f, Context const& context) const { - if(blacklist::is_function_blacklisted(f.c_name) || f.is_static) + if(blacklist::is_function_blacklisted(f, context) || f.is_static) return true; if(!as_generator(documentation).generate(sink, f, context)) diff --git a/src/bin/eolian_mono/eolian/mono/function_definition.hh b/src/bin/eolian_mono/eolian/mono/function_definition.hh index b0e2e5ea3c..6917870074 100644 --- a/src/bin/eolian_mono/eolian/mono/function_definition.hh +++ b/src/bin/eolian_mono/eolian/mono/function_definition.hh @@ -32,7 +32,7 @@ struct native_function_definition_generator bool generate(OutputIterator sink, attributes::function_def const& f, Context const& context) const { EINA_CXX_DOM_LOG_DBG(eolian_mono::domain) << "native_function_definition_generator: " << f.c_name << std::endl; - if(blacklist::is_function_blacklisted(f.c_name) || f.is_static) // Only Concrete classes implement static methods. + if(blacklist::is_function_blacklisted(f, context) || f.is_static) // Only Concrete classes implement static methods. return true; else { @@ -71,7 +71,11 @@ struct native_function_definition_generator if(!as_generator(eolian_mono::type(true)).generate(std::back_inserter(return_type), f.return_type, context)) return false; - std::string klass_inherit_name = name_helpers::klass_inherit_name(*klass); + std::string klass_cast_name; + if (klass->type != attributes::class_type::interface_) + klass_cast_name = name_helpers::klass_inherit_name(*klass); + else + klass_cast_name = name_helpers::klass_interface_name(*klass); if(!as_generator (scope_tab @@ -89,16 +93,16 @@ struct native_function_definition_generator << scope_tab << scope_tab << "if(wrapper != null) {\n" << scope_tab << scope_tab << scope_tab << eolian_mono::native_function_definition_preamble() << scope_tab << scope_tab << scope_tab << "try {\n" - << scope_tab << scope_tab << scope_tab << scope_tab << (return_type != " void" ? "_ret_var = " : "") << "((" << klass_inherit_name << ")wrapper)." << string + << scope_tab << scope_tab << scope_tab << scope_tab << (return_type != " void" ? "_ret_var = " : "") << "((" << klass_cast_name << ")wrapper)." << string << "(" << (native_argument_invocation % ", ") << ");\n" << scope_tab << scope_tab << scope_tab << "} catch (Exception e) {\n" << scope_tab << scope_tab << scope_tab << scope_tab << "Eina.Log.Warning($\"Callback error: {e.ToString()}\");\n" - << scope_tab << scope_tab << scope_tab << scope_tab << "Eina.Error.Set(Eina.Error.EFL_ERROR);\n" + << scope_tab << scope_tab << scope_tab << scope_tab << "Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);\n" << scope_tab << scope_tab << scope_tab << "}\n" << eolian_mono::native_function_definition_epilogue(*klass) << scope_tab << scope_tab << "} else {\n" << scope_tab << scope_tab << scope_tab << (return_type != " void" ? "return " : "") << string - << "(Efl.Eo.Globals.efl_super(obj, " << "EoKlass)" << *(", " << argument) << ");\n" + << "(Efl.Eo.Globals.efl_super(obj, " << "GetEflClass())" << *(", " << argument) << ");\n" << scope_tab << scope_tab << "}\n" << scope_tab << "}\n" ) @@ -134,7 +138,7 @@ struct function_definition_generator bool generate(OutputIterator sink, attributes::function_def const& f, Context const& context) const { EINA_CXX_DOM_LOG_DBG(eolian_mono::domain) << "function_definition_generator: " << f.c_name << std::endl; - if(blacklist::is_function_blacklisted(f.c_name)) + if(blacklist::is_function_blacklisted(f, context)) return true; if(!as_generator @@ -209,7 +213,7 @@ struct property_wrapper_definition_generator template bool generate(OutputIterator sink, attributes::property_def const& property, Context context) const { - if (blacklist::is_property_blacklisted(property)) + if (blacklist::is_property_blacklisted(property, context)) return true; bool interface = context_find_tag(context).current_wrapper_kind == class_context::interface; diff --git a/src/bin/eolian_mono/eolian/mono/function_helpers.hh b/src/bin/eolian_mono/eolian/mono/function_helpers.hh index 017ddad9d8..c83cbbbf11 100644 --- a/src/bin/eolian_mono/eolian/mono/function_helpers.hh +++ b/src/bin/eolian_mono/eolian/mono/function_helpers.hh @@ -99,7 +99,7 @@ struct function_definition_epilogue_generator bool generate(OutputIterator sink, attributes::function_def const& f, Context const& context) const { if (!as_generator( - scope_tab << scope_tab << "Eina.Error.RaiseIfOccurred();\n" + scope_tab << scope_tab << "Eina.Error.RaiseIfUnhandledException();\n" << *(scope_tab << scope_tab << convert_out_assign) << *(scope_tab << scope_tab << convert_in_ptr_assign) << scope_tab << scope_tab << convert_return diff --git a/src/bin/eolian_mono/eolian/mono/function_pointer.hh b/src/bin/eolian_mono/eolian/mono/function_pointer.hh index 95c0e0fa1e..2c62abeb12 100644 --- a/src/bin/eolian_mono/eolian/mono/function_pointer.hh +++ b/src/bin/eolian_mono/eolian/mono/function_pointer.hh @@ -90,7 +90,7 @@ struct function_pointer { << scope_tab << scope_tab << scope_tab << (return_type != " void" ? "_ret_var = " : "") << "cb(" << (native_argument_invocation % ", ") << ");\n" << scope_tab << scope_tab << "} catch (Exception e) {\n" << scope_tab << scope_tab << scope_tab << "Eina.Log.Warning($\"Callback error: {e.ToString()}\");\n" - << scope_tab << scope_tab << scope_tab << "Eina.Error.Set(Eina.Error.EFL_ERROR);\n" + << scope_tab << scope_tab << scope_tab << "Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);\n" << scope_tab << scope_tab << "}\n" << native_function_definition_epilogue(nullptr) << scope_tab << "}\n" diff --git a/src/bin/eolian_mono/eolian/mono/function_registration.hh b/src/bin/eolian_mono/eolian/mono/function_registration.hh index 0b8da4a05a..90cbbc485d 100644 --- a/src/bin/eolian_mono/eolian/mono/function_registration.hh +++ b/src/bin/eolian_mono/eolian/mono/function_registration.hh @@ -20,21 +20,21 @@ namespace eolian_mono { -template +// template struct function_registration_generator { - I index_generator; + // I index_generator; attributes::klass_def const* klass; template bool generate(OutputIterator sink, attributes::function_def const& f, Context const& context) const { EINA_CXX_DOM_LOG_DBG(eolian_mono::domain) << "function_registration_generator: " << f.name << std::endl; - if(blacklist::is_function_blacklisted(f.c_name) || f.is_static) // Static methods aren't overrideable + if(blacklist::is_function_blacklisted(f, context) || f.is_static) // Static methods aren't overrideable return true; else { - auto index = index_generator(); + // auto index = index_generator(); if(!as_generator( scope_tab << scope_tab << f.c_name << "_static_delegate = new " << f.c_name << "_delegate(" << @@ -43,12 +43,13 @@ struct function_registration_generator return false; if(!as_generator + (scope_tab << scope_tab << "descs.Add(new Efl_Op_Description() {" #ifdef _WIN32 - (scope_tab << scope_tab << "descs[" << index << "].api_func = Marshal.StringToHGlobalAnsi(\"" << string << "\");\n" + << "api_func = Marshal.StringToHGlobalAnsi(\"" << string << "\")" #else - (scope_tab << scope_tab << "descs[" << index << "].api_func = Efl.Eo.Globals.dlsym(Efl.Eo.Globals.RTLD_DEFAULT, \"" << string << "\");\n" + << "api_func = Efl.Eo.Globals.dlsym(Efl.Eo.Globals.RTLD_DEFAULT, \"" << string << "\")" #endif - << scope_tab << scope_tab << "descs[" << index << "].func = Marshal.GetFunctionPointerForDelegate(" << string << "_static_delegate);\n" + ", func = Marshal.GetFunctionPointerForDelegate(" << string << "_static_delegate)});\n" ) .generate(sink, std::make_tuple(f.c_name, f.c_name), context)) return false; @@ -59,10 +60,9 @@ struct function_registration_generator struct function_registration_parameterized { - template - function_registration_generator operator()(I i, attributes::klass_def const& klass) const + function_registration_generator operator()(attributes::klass_def const& klass) const { - return {i, &klass}; + return {&klass}; } } const function_registration; @@ -70,15 +70,15 @@ struct function_registration_parameterized namespace efl { namespace eolian { namespace grammar { -template -struct is_eager_generator< ::eolian_mono::function_registration_generator> : std::true_type {}; -template -struct is_generator< ::eolian_mono::function_registration_generator> : std::true_type {}; +template <> +struct is_eager_generator< ::eolian_mono::function_registration_generator> : std::true_type {}; +template <> +struct is_generator< ::eolian_mono::function_registration_generator> : std::true_type {}; namespace type_traits { -template -struct attributes_needed< ::eolian_mono::function_registration_generator> : std::integral_constant {}; +template <> +struct attributes_needed< ::eolian_mono::function_registration_generator> : std::integral_constant {}; } } } } diff --git a/src/bin/eolian_mono/eolian/mono/generation_contexts.hh b/src/bin/eolian_mono/eolian/mono/generation_contexts.hh index ca1ca9e678..9a1493ab25 100644 --- a/src/bin/eolian_mono/eolian/mono/generation_contexts.hh +++ b/src/bin/eolian_mono/eolian/mono/generation_contexts.hh @@ -45,6 +45,10 @@ struct eolian_state_context { const Eolian_State *state; }; +struct options_context { + bool want_beta; +}; + } #endif diff --git a/src/bin/eolian_mono/eolian/mono/klass.hh b/src/bin/eolian_mono/eolian/mono/klass.hh index 907ac97ad1..6a2c8186eb 100644 --- a/src/bin/eolian_mono/eolian/mono/klass.hh +++ b/src/bin/eolian_mono/eolian/mono/klass.hh @@ -71,13 +71,14 @@ static bool generate_equals_method(OutputIterator sink, Context const &context) } /* Get the actual number of functions of a class, checking for blacklisted ones */ +template static std::size_t -get_implementable_function_count(grammar::attributes::klass_def const& cls) +get_implementable_function_count(grammar::attributes::klass_def const& cls, Context context) { auto methods = helpers::get_all_implementable_methods(cls); - return std::count_if(methods.cbegin(), methods.cend(), [](grammar::attributes::function_def const& func) + return std::count_if(methods.cbegin(), methods.cend(), [&context](grammar::attributes::function_def const& func) { - return !blacklist::is_function_blacklisted(func.c_name) && !func.is_static; + return !blacklist::is_function_blacklisted(func, context) && !func.is_static; }); } @@ -123,53 +124,57 @@ struct klass // Interface class if(class_type == "interface") { - auto iface_cxt = context_add_tag(class_context{class_context::interface}, context); + auto iface_cxt = context_add_tag(class_context{class_context::interface}, context); - if(!as_generator(documentation).generate(sink, cls, iface_cxt)) - return false; + if(!as_generator(documentation).generate(sink, cls, iface_cxt)) + return false; - if(!as_generator + // Mark the interface with the proper native Efl_Class* getter + if(!as_generator(lit("[") << name_helpers::klass_native_inherit_name(cls) << "]\n") + .generate(sink, attributes::unused, iface_cxt)) + return false; + + if(!as_generator ( "public " /*<< class_type*/ "interface" /*<<*/ " " << string << " : " ) .generate(sink, name_helpers::klass_interface_name(cls), iface_cxt)) - return false; - for(auto first = std::begin(cls.immediate_inherits) - , last = std::end(cls.immediate_inherits); first != last; ++first) - { - if(first->type != attributes::class_type::regular && first->type != attributes::class_type::abstract_) - if(!as_generator("\n" << scope_tab << string << " ,").generate(sink, name_helpers::klass_full_interface_name(*first), iface_cxt)) - return false; - } + return false; + for(auto first = std::begin(cls.immediate_inherits) + , last = std::end(cls.immediate_inherits); first != last; ++first) + { + if(first->type != attributes::class_type::regular && first->type != attributes::class_type::abstract_) + if(!as_generator("\n" << scope_tab << string << " ,").generate(sink, name_helpers::klass_full_interface_name(*first), iface_cxt)) + return false; + } - if(!as_generator("\n" << scope_tab << "Efl.Eo.IWrapper, IDisposable").generate(sink, attributes::unused, iface_cxt)) - return false; + if(!as_generator("\n" << scope_tab << "Efl.Eo.IWrapper, IDisposable").generate(sink, attributes::unused, iface_cxt)) + return false; - if(!as_generator("\n{\n").generate(sink, attributes::unused, iface_cxt)) - return false; + if(!as_generator("\n{\n").generate(sink, attributes::unused, iface_cxt)) + return false; - if(!as_generator(*(scope_tab << function_declaration)).generate(sink, cls.functions, iface_cxt)) - return false; + if(!as_generator(*(scope_tab << function_declaration)).generate(sink, cls.functions, iface_cxt)) + return false; - if(!as_generator(*(scope_tab << async_function_declaration)).generate(sink, cls.functions, iface_cxt)) - return false; + if(!as_generator(*(scope_tab << async_function_declaration)).generate(sink, cls.functions, iface_cxt)) + return false; - if(!as_generator(*(event_declaration)).generate(sink, cls.events, iface_cxt)) - return false; + if(!as_generator(*(event_declaration)).generate(sink, cls.events, iface_cxt)) + return false; - for (auto &&p : cls.parts) - if (!as_generator( + for (auto &&p : cls.parts) + if (!as_generator( documentation(1) << name_helpers::klass_full_concrete_or_interface_name(p.klass) << " " << utils::capitalize(p.name) << "{ get;}\n" ).generate(sink, p, iface_cxt)) + return false; + + if (!as_generator(*(property_wrapper_definition)).generate(sink, cls.properties, iface_cxt)) return false; - if (!as_generator(*(property_wrapper_definition)).generate(sink, cls.properties, iface_cxt)) - return false; - - // End of interface declaration - if(!as_generator("}\n").generate(sink, attributes::unused, iface_cxt)) return false; - + // End of interface declaration + if(!as_generator("}\n").generate(sink, attributes::unused, iface_cxt)) return false; } // Events arguments go in the top namespace to avoid the Concrete suffix clutter in interface events. @@ -271,7 +276,6 @@ struct klass if(!as_generator("}\n").generate(sink, attributes::unused, concrete_cxt)) return false; - } // Inheritable class @@ -283,6 +287,7 @@ struct klass if(!as_generator ( documentation + << "[" << name_helpers::klass_native_inherit_name(cls) << "]\n" << "public " << class_type << " " << name_helpers::klass_concrete_name(cls) << " : " << (klass_full_concrete_or_interface_name % ",") // classes << (inherit_classes.empty() ? "" : ",") @@ -344,16 +349,8 @@ struct klass if(!as_generator("}\n").generate(sink, attributes::unused, inherit_cxt)) return false; } - std::size_t function_count = get_implementable_function_count(cls); - - int function_registration_index = 0; - auto index_generator = [&function_registration_index] - { - return function_registration_index++; - }; - // Native Inherit class - if(class_type == "class") + //if(class_type == "class") { auto inative_cxt = context_add_tag(class_context{class_context::inherit_native}, context); auto native_inherit_name = name_helpers::klass_native_inherit_name(cls); @@ -367,21 +364,21 @@ struct klass if(!as_generator ( - "public " << class_type << " " << native_inherit_name << " " << (root ? "" : (": " + base_name)) <<"{\n" - << scope_tab << (root ? "protected IntPtr EoKlass { get; set; }\n" : "\n") - << scope_tab << "public " << (root ? "" : "new ") << "Efl_Op_Description[] GetEoOps()\n" + "public class " << native_inherit_name << " " << (root ? ": Efl.Eo.NativeClass" : (": " + base_name)) <<"{\n" + // << scope_tab << (root ? "protected IntPtr EoKlass { get; set; }\n" : "\n") + << scope_tab << "public " << /*(root ? "" : "new ")*/ "override " << "System.Collections.Generic.List GetEoOps(System.Type type)\n" << scope_tab << "{\n" - << scope_tab << scope_tab << "Efl_Op_Description[] descs = new Efl_Op_Description[" << grammar::int_ << "];\n" + << scope_tab << scope_tab << "var descs = new System.Collections.Generic.List();\n" ) - .generate(sink, function_count, inative_cxt)) + .generate(sink, attributes::unused, inative_cxt)) return false; // Native wrapper registration - if(!as_generator(*(function_registration(index_generator, cls))) + if(!as_generator(*(function_registration(cls))) .generate(sink, helpers::get_all_implementable_methods(cls), inative_cxt)) return false; if(!root) - if(!as_generator(scope_tab << scope_tab << "descs = descs.Concat(base.GetEoOps()).ToArray();\n").generate(sink, attributes::unused, inative_cxt)) + if(!as_generator(scope_tab << scope_tab << "descs.AddRange(base.GetEoOps(type));\n").generate(sink, attributes::unused, inative_cxt)) return false; if(!as_generator( @@ -390,32 +387,23 @@ struct klass ).generate(sink, attributes::unused, inative_cxt)) return false; - if(!as_generator - (scope_tab << "public " << (root ? "" : "new " ) << "byte class_initializer(IntPtr klass)\n" - << scope_tab << "{\n" - << scope_tab << scope_tab << "var descs = GetEoOps();\n" - << scope_tab << scope_tab << "var count = descs.Length;\n" - << scope_tab << scope_tab << "IntPtr descs_ptr = Marshal.AllocHGlobal(Marshal.SizeOf(descs[0])*count);\n" - << scope_tab << scope_tab << "IntPtr ptr = descs_ptr;\n" - << scope_tab << scope_tab << "for(int i = 0; i != count; ++i)\n" - << scope_tab << scope_tab << "{\n" - << scope_tab << scope_tab << scope_tab << "Marshal.StructureToPtr(descs[i], ptr, false);\n" - << scope_tab << scope_tab << scope_tab << "ptr = IntPtr.Add(ptr, Marshal.SizeOf(descs[0]));\n" - << scope_tab << scope_tab << "}\n" - << scope_tab << scope_tab << "Efl_Object_Ops ops;\n" - << scope_tab << scope_tab << "ops.descs = descs_ptr;\n" - << scope_tab << scope_tab << "ops.count = (UIntPtr)count;\n" - << scope_tab << scope_tab << "IntPtr ops_ptr = Marshal.AllocHGlobal(Marshal.SizeOf(ops));\n" - << scope_tab << scope_tab << "Marshal.StructureToPtr(ops, ops_ptr, false);\n" - << scope_tab << scope_tab << "Efl.Eo.Globals.efl_class_functions_set(klass, ops_ptr, IntPtr.Zero);\n" - << scope_tab << scope_tab << "EoKlass = klass;\n" - ).generate(sink, attributes::unused, inative_cxt)) return false; + // Attribute getter of the native 'Efl_Class *' handle (for proper inheritance from additional explicit interfaces) + if(!as_generator( + scope_tab << "public override IntPtr GetEflClass()\n" + << scope_tab << "{\n" + << scope_tab << scope_tab << "return " << name_helpers::klass_get_full_name(cls) << "();\n" + << scope_tab << "}\n" + ).generate(sink, attributes::unused, inative_cxt)) + return false; - - if(!as_generator(scope_tab << scope_tab << "return 1;\n" - << scope_tab << "}\n") - .generate(sink, attributes::unused, inative_cxt)) return false; - // + if(!as_generator( + scope_tab << "public static " << (root ? "" : "new ") << " IntPtr GetEflClassStatic()\n" + << scope_tab << "{\n" + << scope_tab << scope_tab << "return " << name_helpers::klass_get_full_name(cls) << "();\n" + << scope_tab << "}\n" + ).generate(sink, attributes::unused, inative_cxt)) + return false; + // Native method definitions if(!as_generator(*(native_function_definition(cls))) .generate(sink, helpers::get_all_implementable_methods(cls), inative_cxt)) return false; @@ -436,8 +424,9 @@ struct klass bool root = !helpers::has_regular_ancestor(cls); bool is_inherit = is_inherit_context(context); - std::string class_getter = "return Efl.Eo.Globals.efl_class_get(handle);"; + std::string class_getter = name_helpers::klass_get_name(cls) + "()"; std::string native_inherit_full_name = name_helpers::klass_full_native_inherit_name(cls); + auto inherit_name = name_helpers::klass_concrete_name(cls); // The klass field is static but there is no problem if multiple C# classes inherit from this generated one // as it is just a simple wrapper, forwarding the Eo calls either to the user API (where C#'s virtual method @@ -449,7 +438,6 @@ struct klass << scope_tab << "public " << (root ? "" : "new ") << "static " << native_inherit_full_name << " nativeInherit = new " << native_inherit_full_name << "();\n" ).generate(sink, attributes::unused, context)) return false; - class_getter = "return klass;"; } std::string raw_klass_modifier; @@ -462,7 +450,10 @@ struct klass scope_tab << "///Pointer to the native class description.\n" << scope_tab << "public " << raw_klass_modifier << "System.IntPtr NativeClass {\n" << scope_tab << scope_tab << "get {\n" - << scope_tab << scope_tab << scope_tab << class_getter << "\n" //return klass; }\n" + << scope_tab << scope_tab << scope_tab << "if (((object)this).GetType() == typeof (" << inherit_name << "))\n" + << scope_tab << scope_tab << scope_tab << scope_tab << "return " << native_inherit_full_name << ".GetEflClassStatic();\n" + << scope_tab << scope_tab << scope_tab << "else\n" + << scope_tab << scope_tab << scope_tab << scope_tab << "return Efl.Eo.Globals.klasses[((object)this).GetType()];\n" << scope_tab << scope_tab << "}\n" << scope_tab << "}\n" ).generate(sink, attributes::unused, context)) @@ -519,7 +510,8 @@ struct klass scope_tab << "///Creates a new instance.\n" << scope_tab << "///Parent instance.\n" << scope_tab << "///Delegate to call constructing methods that should be run inside the constructor.\n" - << scope_tab << "public " << inherit_name << "(Efl.Object parent = null, ConstructingMethod init_cb=null) : base(nativeInherit.class_initializer, \"" << inherit_name << "\", " << name_helpers::klass_get_name(cls) << "(), typeof(" << inherit_name << "), parent, ref klass)\n" + << scope_tab << "public " << inherit_name << "(Efl.Object parent = null, ConstructingMethod init_cb=null) : " + "base(\"" << inherit_name << "\", " << name_helpers::klass_get_name(cls) << "(), typeof(" << inherit_name << "), parent)\n" << scope_tab << "{\n" << scope_tab << scope_tab << "if (init_cb != null) {\n" << scope_tab << scope_tab << scope_tab << "init_cb(this);\n" @@ -528,7 +520,7 @@ struct klass << scope_tab << "}\n" << scope_tab << "///Internal constructor to forward the wrapper initialization to the root class.\n" - << scope_tab << "protected " << inherit_name << "(Efl.Eo.Globals.class_initializer class_initializer, String klass_name, IntPtr base_klass, System.Type managed_type, Efl.Object parent, ref IntPtr target_klass) : base(class_initializer, klass_name, base_klass, managed_type, parent, ref target_klass) {}\n" + << scope_tab << "protected " << inherit_name << "(String klass_name, IntPtr base_klass, System.Type managed_type, Efl.Object parent) : base(klass_name, base_klass, managed_type, parent) {}\n" << scope_tab << "///Constructs an instance from a native pointer.\n" << scope_tab << "public " << inherit_name << "(System.IntPtr raw)" << (root ? "" : " : base(raw)") << "\n" @@ -544,7 +536,7 @@ struct klass scope_tab << "///Creates a new instance.\n" << scope_tab << "///Parent instance.\n" << scope_tab << "///Delegate to call constructing methods that should be run inside the constructor.\n" - << scope_tab << "public " << inherit_name << "(Efl.Object parent = null, ConstructingMethod init_cb=null) : this(nativeInherit.class_initializer, \"" << inherit_name << "\", " << name_helpers::klass_get_name(cls) << "(), typeof(" << inherit_name << "), parent, ref klass)\n" + << scope_tab << "public " << inherit_name << "(Efl.Object parent = null, ConstructingMethod init_cb=null) : this(\"" << inherit_name << "\", " << name_helpers::klass_get_name(cls) << "(), typeof(" << inherit_name << "), parent)\n" << scope_tab << "{\n" << scope_tab << scope_tab << "if (init_cb != null) {\n" << scope_tab << scope_tab << scope_tab << "init_cb(this);\n" @@ -552,22 +544,22 @@ struct klass << scope_tab << scope_tab << "FinishInstantiation();\n" << scope_tab << "}\n" - << scope_tab << "protected " << inherit_name << "(Efl.Eo.Globals.class_initializer class_initializer, String klass_name, IntPtr base_klass, System.Type managed_type, Efl.Object parent, ref IntPtr target_klass)\n" + << scope_tab << "protected " << inherit_name << "(String klass_name, IntPtr base_klass, System.Type managed_type, Efl.Object parent)\n" << scope_tab << "{\n" - << scope_tab << scope_tab << "inherited = this.GetType() != managed_type;\n" + << scope_tab << scope_tab << "inherited = ((object)this).GetType() != managed_type;\n" << scope_tab << scope_tab << "IntPtr actual_klass = base_klass;\n" << scope_tab << scope_tab << "if (inherited) {\n" - << scope_tab << scope_tab << scope_tab << "if (target_klass == System.IntPtr.Zero) {\n" + << scope_tab << scope_tab << scope_tab << "if (!Efl.Eo.Globals.klasses.ContainsKey(((object)this).GetType())) {\n" << scope_tab << scope_tab << scope_tab << scope_tab << "lock (klassAllocLock) {\n" - << scope_tab << scope_tab << scope_tab << scope_tab << scope_tab << "if (target_klass == System.IntPtr.Zero) {\n" - << scope_tab << scope_tab << scope_tab << scope_tab << scope_tab << scope_tab << "target_klass = Efl.Eo.Globals.register_class(class_initializer, klass_name, base_klass);\n" - << scope_tab << scope_tab << scope_tab << scope_tab << scope_tab << scope_tab << "if (target_klass == System.IntPtr.Zero) {\n" + << scope_tab << scope_tab << scope_tab << scope_tab << scope_tab << scope_tab << "actual_klass = Efl.Eo.Globals.register_class(klass_name, base_klass, ((object)this).GetType());\n" + << scope_tab << scope_tab << scope_tab << scope_tab << scope_tab << scope_tab << "if (actual_klass == System.IntPtr.Zero) {\n" << scope_tab << scope_tab << scope_tab << scope_tab << scope_tab << scope_tab << scope_tab << "throw new System.InvalidOperationException(\"Failed to initialize class '" << inherit_name << "'\");\n" << scope_tab << scope_tab << scope_tab << scope_tab << scope_tab << scope_tab << "}\n" - << scope_tab << scope_tab << scope_tab << scope_tab << scope_tab << "}\n" + << scope_tab << scope_tab << scope_tab << scope_tab << scope_tab << scope_tab << "Efl.Eo.Globals.klasses[((object)this).GetType()] = actual_klass;\n" << scope_tab << scope_tab << scope_tab << scope_tab << "}\n" << scope_tab << scope_tab << scope_tab << "}\n" - << scope_tab << scope_tab << scope_tab << "actual_klass = target_klass;\n" + << scope_tab << scope_tab << scope_tab << "else\n" + << scope_tab << scope_tab << scope_tab << scope_tab << "actual_klass = Efl.Eo.Globals.klasses[((object)this).GetType()];\n" << scope_tab << scope_tab << "}\n" << scope_tab << scope_tab << "handle = Efl.Eo.Globals.instantiate_start(actual_klass, parent);\n" << scope_tab << scope_tab << "register_event_proxies();\n" @@ -579,7 +571,7 @@ struct klass << scope_tab << scope_tab << scope_tab << "Efl.Eo.Globals.data_set(this);\n" << scope_tab << scope_tab << "}\n" << scope_tab << scope_tab << "handle = Efl.Eo.Globals.instantiate_end(handle);\n" - << scope_tab << scope_tab << "Eina.Error.RaiseIfOccurred();\n" + << scope_tab << scope_tab << "Eina.Error.RaiseIfUnhandledException();\n" << scope_tab << "}\n" << scope_tab << "///Constructs an instance from a native pointer.\n" @@ -718,7 +710,7 @@ struct klass << scope_tab << scope_tab << scope_tab << scope_tab << "Eina.Log.Error($\"Failed to add event proxy for event {key}\");\n" << scope_tab << scope_tab << scope_tab << scope_tab << "return false;\n" << scope_tab << scope_tab << scope_tab << "}\n" - << scope_tab << scope_tab << scope_tab << "Eina.Error.RaiseIfOccurred();\n" + << scope_tab << scope_tab << scope_tab << "Eina.Error.RaiseIfUnhandledException();\n" << scope_tab << scope_tab << "} \n" << scope_tab << scope_tab << "event_cb_count[key]++;\n" << scope_tab << scope_tab << "return true;\n" @@ -740,7 +732,7 @@ struct klass << scope_tab << scope_tab << scope_tab << scope_tab << "Eina.Log.Error($\"Failed to remove event proxy for event {key}\");\n" << scope_tab << scope_tab << scope_tab << scope_tab << "return false;\n" << scope_tab << scope_tab << scope_tab << "}\n" - << scope_tab << scope_tab << scope_tab << "Eina.Error.RaiseIfOccurred();\n" + << scope_tab << scope_tab << scope_tab << "Eina.Error.RaiseIfUnhandledException();\n" << scope_tab << scope_tab << "} else if (event_count == 0) {\n" << scope_tab << scope_tab << scope_tab << "Eina.Log.Error($\"Trying to remove proxy for event {key} when there is nothing registered.\");\n" << scope_tab << scope_tab << scope_tab << "return false;\n" diff --git a/src/bin/eolian_mono/eolian/mono/name_helpers.hh b/src/bin/eolian_mono/eolian/mono/name_helpers.hh index 801d721008..8910447ae1 100644 --- a/src/bin/eolian_mono/eolian/mono/name_helpers.hh +++ b/src/bin/eolian_mono/eolian/mono/name_helpers.hh @@ -274,14 +274,14 @@ struct klass_interface_name_generator { return utils::remove_all(klass.eolian_name, '_'); } - + template bool generate(OutputIterator sink, Attr const& attribute, Context const& context) const { return as_generator((*this).operator()(attribute)).generate(sink, attributes::unused, context); } -} klass_interface_name; - +} const klass_interface_name; + struct klass_full_interface_name_generator { template @@ -289,13 +289,13 @@ struct klass_full_interface_name_generator { return join_namespaces(klass.namespaces, '.', managed_namespace) + klass_interface_name(klass); } - + template bool generate(OutputIterator sink, Attr const& attribute, Context const& context) const { return as_generator((*this).operator()(attribute)).generate(sink, attributes::unused, context); } -} klass_full_interface_name; +} const klass_full_interface_name; template inline std::string klass_concrete_name(T const& klass) @@ -313,13 +313,13 @@ struct klass_full_concrete_name_generator { return join_namespaces(klass.namespaces, '.', managed_namespace) + klass_concrete_name(klass); } - + template bool generate(OutputIterator sink, Attr const& attribute, Context const& context) const { return as_generator((*this).operator()(attribute)).generate(sink, attributes::unused, context); } -} klass_full_concrete_name; +} const klass_full_concrete_name; struct klass_full_concrete_or_interface_name_generator { @@ -347,7 +347,7 @@ struct klass_full_concrete_or_interface_name_generator { return as_generator((*this).operator()(attribute)).generate(sink, attributes::unused, context); } -} klass_full_concrete_or_interface_name; +} const klass_full_concrete_or_interface_name; template inline std::string klass_inherit_name(T const& klass) @@ -373,7 +373,8 @@ inline std::string klass_get_name(T const& clsname) return clsname.klass_get_name; } -inline std::string klass_get_full_name(attributes::klass_name const& clsname) +template +inline std::string klass_get_full_name(T const& clsname) { return klass_full_concrete_name(clsname) + "." + klass_get_name(clsname); } diff --git a/src/bin/eolian_mono/eolian_mono.cc b/src/bin/eolian_mono/eolian_mono.cc index db888816a2..235f25082f 100644 --- a/src/bin/eolian_mono/eolian_mono.cc +++ b/src/bin/eolian_mono/eolian_mono.cc @@ -47,6 +47,7 @@ struct options_type mutable Eolian_Unit const* unit; int v_major; int v_minor; + bool want_beta; std::map references_map; }; @@ -144,7 +145,9 @@ run(options_type const& opts) opts.references_map}, efl::eolian::grammar::context_null()); - auto context = efl::eolian::grammar::context_add_tag(eolian_mono::eolian_state_context{opts.state}, lib_context); + auto options_context = efl::eolian::grammar::context_add_tag(eolian_mono::options_context{opts.want_beta}, lib_context); + + auto context = efl::eolian::grammar::context_add_tag(eolian_mono::eolian_state_context{opts.state}, options_context); EINA_ITERATOR_FOREACH(aliases, tp) { @@ -273,6 +276,7 @@ _usage(const char *progname) << " -n, --namespace Wrap generated code in a namespace. [Eg: efl::ecore::file]" << std::endl << " -r, --recurse Recurse input directories loading .eo files." << std::endl << " -v, --version Print the version." << std::endl + << " -b, --beta Enable @beta methods." << std::endl << " -h, --help Print this help." << std::endl; exit(EXIT_FAILURE); } @@ -302,9 +306,10 @@ opts_get(int argc, char **argv) { "vmaj", required_argument, 0, 'M' }, { "vmin", required_argument, 0, 'm' }, { "references", required_argument, 0, 'r'}, + { "beta", no_argument, 0, 'b'}, { 0, 0, 0, 0 } }; - const char* options = "I:D:o:c:M:m:ar:vh"; + const char* options = "I:D:o:c:M:m:ar:vhb"; int c, idx; while ( (c = getopt_long(argc, argv, options, long_options, &idx)) != -1) @@ -356,6 +361,10 @@ opts_get(int argc, char **argv) _print_version(); if (argc == 2) exit(EXIT_SUCCESS); } + else if (c == 'b') + { + opts.want_beta = true; + } } if (optind == argc-1) { diff --git a/src/bindings/cxx/eina_cxx/eina_deleter.hh b/src/bindings/cxx/eina_cxx/eina_deleter.hh index f88efd309d..7831dfd8ee 100644 --- a/src/bindings/cxx/eina_cxx/eina_deleter.hh +++ b/src/bindings/cxx/eina_cxx/eina_deleter.hh @@ -23,6 +23,10 @@ struct malloc_deleter { // how to free binbuf? } + void operator()(Eina_Promise*) const + { + // workaround until we manually handle efl_loop_promise_new + } }; template diff --git a/src/bindings/mono/efl_mono.dll.config.in b/src/bindings/mono/efl_mono.dll.config.in index 0531b79523..b84883fda9 100644 --- a/src/bindings/mono/efl_mono.dll.config.in +++ b/src/bindings/mono/efl_mono.dll.config.in @@ -1,9 +1,9 @@ - - - - - - - + + + + + + + diff --git a/src/bindings/mono/efl_mono/efl_csharp_application.cs b/src/bindings/mono/efl_mono/efl_csharp_application.cs new file mode 100644 index 0000000000..2b2c55c75e --- /dev/null +++ b/src/bindings/mono/efl_mono/efl_csharp_application.cs @@ -0,0 +1,131 @@ +using System; +using System.Runtime.InteropServices; +using System.Threading; +using static Efl.UnsafeNativeMethods; + +static class UnsafeNativeMethods { + [DllImport(efl.Libs.Ecore)] public static extern void ecore_init(); + [DllImport(efl.Libs.Ecore)] public static extern void ecore_shutdown(); + [DllImport(efl.Libs.Elementary)] public static extern int elm_init(int argc, IntPtr argv); + [DllImport(efl.Libs.Elementary)] public static extern void elm_policy_set(int policy, int policy_detail); + [DllImport(efl.Libs.Elementary)] public static extern void elm_shutdown(); + [DllImport(efl.Libs.Elementary)] public static extern void elm_exit(); +} + +namespace Efl { + namespace Csharp { + public enum Components { + Basic, + Ui, + } + /// + /// This represents the entry point for the EFL framework + /// You can use this class to implement the 4 abstract methods which will then be called accordingly + /// All subsystems of efl are booted up correctly when the abstract methods of this class are called. + /// + /// + /// Calls to efl outside those efl-callbacks or outside the mainloop are not allowed and will lead to issues + /// + /// + /// UserApp is the class that implements the Application abstract + /// + /// public static void Main() { + /// UserApp editor = new UserApp(); + /// editor.Launch(editor); + /// } + /// + /// + public abstract class Application { + //the initializied components + private static Components initComponent; + //what follows are 3 private functions to boot up the internals of efl + private static void Init(Efl.Csharp.Components component) { + Eina.Config.Init(); + Efl.Eo.Config.Init(); + ecore_init(); + evas_init(); + eldbus.Config.Init(); + + if (component == Components.Ui) { + // TODO Support elm command line arguments +#if WIN32 // Not a native define, we define it in our build system + // Ecore_Win32 uses OleInitialize, which requires single thread apartments + if (System.Threading.Thread.CurrentThread.GetApartmentState() != ApartmentState.STA) + throw new InvalidOperationException("UI Applications require STAThreadAttribute in Main()"); +#endif + elm_init(0, IntPtr.Zero); + + elm_policy_set((int)Elm.Policy.Quit, (int)Elm.PolicyQuit.LastWindowHidden); + } + initComponent = component; + } + private static void Shutdown() { + // Try to cleanup everything before actually shutting down. + System.GC.Collect(); + System.GC.WaitForPendingFinalizers(); + + if (initComponent == Components.Ui) { + elm_shutdown(); + } + eldbus.Config.Shutdown(); + evas_shutdown(); + ecore_shutdown(); + Efl.Eo.Config.Shutdown(); + Eina.Config.Shutdown(); + } + /// + /// Called when the application is started. Arguments from the command line are passed here. + /// + protected abstract void OnInitialize(Eina.Array args); + /// + /// Arguments are passed here, Additional calls to this function may occure, + /// but then the initialization flag is set to false. + /// + /// + /// When Initialize is true then OnInitialize is also called + /// + protected virtual void OnArguments(Efl.LoopArguments args) { } + /// + /// Called when the application is not going to be displayed, or is not used by a user for some time. + /// + protected virtual void OnPause() { } + /// + /// Called before an application is used again after a call to OnPause(). + /// + protected virtual void OnResume() { } + /// + /// Called before starting the shutdown of the application. + /// + protected virtual void OnTerminate() { } + /// + /// This function initializices everything in EFL and runs your application. + /// This call will result in a call to OnInitialize(), which you application should override. + /// + public void Launch(Efl.Csharp.Components components=Components.Ui) { + Init(components); + Efl.App app = Efl.App.AppMain; + foreach (var arg in Environment.GetCommandLineArgs()) + app.AppendArg(arg); + app.ArgumentsEvt += (object sender, LoopArgumentsEvt_Args evt) => { + if (evt.arg.Initialization) { + OnInitialize(evt.arg.Argv); + } + OnArguments(evt.arg); + }; + app.PauseEvt += (object sender, EventArgs e) => { + OnPause(); + }; + app.ResumeEvt += (object sender, EventArgs e) => { + OnResume(); + }; + app.TerminateEvt += (object sender, EventArgs e) => { + OnTerminate(); + }; + app.Begin(); + Shutdown(); + } + } + } +} + + diff --git a/src/bindings/mono/efl_mono/meson.build b/src/bindings/mono/efl_mono/meson.build index 9134de5bbd..acfeb4bc3f 100644 --- a/src/bindings/mono/efl_mono/meson.build +++ b/src/bindings/mono/efl_mono/meson.build @@ -1,4 +1,7 @@ -mono_files += files('efl_all.cs') +mono_files += files( + 'efl_all.cs', + 'efl_csharp_application.cs' + ) bash = find_program('bash') diff --git a/src/bindings/mono/eina_mono/eina_config.cs b/src/bindings/mono/eina_mono/eina_config.cs index 6bc0397439..ee0bb5bd0e 100644 --- a/src/bindings/mono/eina_mono/eina_config.cs +++ b/src/bindings/mono/eina_mono/eina_config.cs @@ -12,10 +12,6 @@ public class Config { public static void Init() { if (eina_init() == 0) throw (new Efl.EflException("Failed to initialize Eina")); - - // Initialize the submodules here - Eina.Log.Init(); - Eina.Error.Init(); } public static int Shutdown() { diff --git a/src/bindings/mono/eina_mono/eina_error.cs b/src/bindings/mono/eina_mono/eina_error.cs index 00e8f91c6d..07760fd395 100644 --- a/src/bindings/mono/eina_mono/eina_error.cs +++ b/src/bindings/mono/eina_mono/eina_error.cs @@ -14,7 +14,7 @@ public struct Error : IComparable get { return MsgGet(this); } } - public static Error EFL_ERROR; + public static Error UNHANDLED_EXCEPTION; public static Error NO_ERROR = new Error(0); public static Error EPERM = new Error(1); @@ -39,9 +39,9 @@ public struct Error : IComparable return "Eina.Error(" + code + ")"; } - internal static void Init() + static Error() { - EFL_ERROR = eina_error_msg_register("Managed Code Error"); + UNHANDLED_EXCEPTION = eina_error_msg_register("Unhandled C# exception occurred."); } [DllImport(efl.Libs.Eina)] static extern Error eina_error_msg_register(string msg); @@ -65,11 +65,16 @@ public struct Error : IComparable return Eina.StringConversion.NativeUtf8ToManagedString(cstr); } - public static void RaiseIfOccurred() + /// Raises an exception if an unhandled exception occurred before switching + /// back to the native code. For example, in an event handler. + public static void RaiseIfUnhandledException() { Error e = Get(); - Clear(); - Raise(e); + if (e == UNHANDLED_EXCEPTION) + { + Clear(); + Raise(e); + } } public static void Raise(Error e) diff --git a/src/bindings/mono/eina_mono/eina_log.cs b/src/bindings/mono/eina_mono/eina_log.cs index 855c0f3836..c17f02b8e5 100644 --- a/src/bindings/mono/eina_mono/eina_log.cs +++ b/src/bindings/mono/eina_mono/eina_log.cs @@ -53,22 +53,17 @@ public class Log private static int domain = -1; - internal static void Init(String name="mono", String color="\033[32;1m") + static Log() { - if (domain == -1) - { - // Maybe move this check outside when other eina stuff get support? - domain = eina_log_domain_register(name, color); - if (domain < 0) - Console.WriteLine("Error: Couldn't register Eina log domain for name {0}.", name); - else - Info($"Registered mono domain with number {domain}"); - } + const String name="mono"; + const String color="\033[32;1m"; + + // Maybe move this check outside when other eina stuff get support? + domain = eina_log_domain_register(name, color); + if (domain < 0) + Console.WriteLine("Error: Couldn't register Eina log domain for name {0}.", name); else - { - Warning("Trying to initialize the log system again."); - // TODO Export the domain registration to the binding user to allow custom domains. - } + Info($"Registered mono domain with number {domain}"); } private static void EnsureDomainRegistered() diff --git a/src/bindings/mono/eldbus_mono/eldbus_common.cs b/src/bindings/mono/eldbus_mono/eldbus_common.cs index 558bfcf059..30e3b0be8e 100644 --- a/src/bindings/mono/eldbus_mono/eldbus_common.cs +++ b/src/bindings/mono/eldbus_mono/eldbus_common.cs @@ -135,19 +135,13 @@ public abstract class BasicMessageArgument public void AppendTo(eldbus.Message msg) { if (!InternalAppendTo(msg)) - { - Eina.Error.RaiseIfOccurred(); throw new SEHException("Eldbus: could not append basic type to eldbus.Message"); - } } public void AppendTo(eldbus.MessageIterator iter) { if (!InternalAppendTo(iter)) - { - Eina.Error.RaiseIfOccurred(); throw new SEHException("Eldbus: could not append basic type to eldbus.MessageIterator"); - } } public abstract char TypeCode {get;} diff --git a/src/bindings/mono/eldbus_mono/eldbus_connection.cs b/src/bindings/mono/eldbus_mono/eldbus_connection.cs index 61ad6b69c8..099582ede5 100644 --- a/src/bindings/mono/eldbus_mono/eldbus_connection.cs +++ b/src/bindings/mono/eldbus_mono/eldbus_connection.cs @@ -192,10 +192,7 @@ public class Connection : IDisposable var pending_hdl = eldbus_connection_send(Handle, msg.Handle, cb_wrapper, cb_data, timeout); if(pending_hdl == IntPtr.Zero) - { - Eina.Error.RaiseIfOccurred(); throw new SEHException("Eldbus: could not get `Pending' object from eldbus_connection_send"); - } msg.Ref(); @@ -224,10 +221,7 @@ public class Connection : IDisposable var pending_hdl = eldbus_name_request(Handle, bus, flags, cb_wrapper, cb_data); if(pending_hdl == IntPtr.Zero) - { - Eina.Error.RaiseIfOccurred(); throw new SEHException("Eldbus: could not get `Pending' object from eldbus_name_request"); - } return new eldbus.Pending(pending_hdl, false); } @@ -245,10 +239,7 @@ public class Connection : IDisposable var pending_hdl = eldbus_name_release(Handle, bus, cb_wrapper, cb_data); if(pending_hdl == IntPtr.Zero) - { - Eina.Error.RaiseIfOccurred(); throw new SEHException("Eldbus: could not get `Pending' object from eldbus_name_release"); - } return new eldbus.Pending(pending_hdl, false); } @@ -266,10 +257,7 @@ public class Connection : IDisposable var pending_hdl = eldbus_name_owner_get(Handle, bus, cb_wrapper, cb_data); if(pending_hdl == IntPtr.Zero) - { - Eina.Error.RaiseIfOccurred(); throw new SEHException("Eldbus: could not get `Pending' object from eldbus_name_owner_get"); - } return new eldbus.Pending(pending_hdl, false); } @@ -287,10 +275,7 @@ public class Connection : IDisposable var pending_hdl = eldbus_name_owner_has(Handle, bus, cb_wrapper, cb_data); if(pending_hdl == IntPtr.Zero) - { - Eina.Error.RaiseIfOccurred(); throw new SEHException("Eldbus: could not get `Pending' object from eldbus_name_owner_has"); - } return new eldbus.Pending(pending_hdl, false); } @@ -305,10 +290,7 @@ public class Connection : IDisposable var pending_hdl = eldbus_names_list(Handle, cb_wrapper, cb_data); if(pending_hdl == IntPtr.Zero) - { - Eina.Error.RaiseIfOccurred(); throw new SEHException("Eldbus: could not get `Pending' object from eldbus_names_list"); - } return new eldbus.Pending(pending_hdl, false); } @@ -323,10 +305,7 @@ public class Connection : IDisposable var pending_hdl = eldbus_names_activatable_list(Handle, cb_wrapper, cb_data); if(pending_hdl == IntPtr.Zero) - { - Eina.Error.RaiseIfOccurred(); throw new SEHException("Eldbus: could not get `Pending' object from eldbus_names_activatable_list"); - } return new eldbus.Pending(pending_hdl, false); } @@ -341,10 +320,7 @@ public class Connection : IDisposable var pending_hdl = eldbus_hello(Handle, cb_wrapper, cb_data); if(pending_hdl == IntPtr.Zero) - { - Eina.Error.RaiseIfOccurred(); throw new SEHException("Eldbus: could not get `Pending' object from eldbus_hello"); - } return new eldbus.Pending(pending_hdl, false); } @@ -362,10 +338,7 @@ public class Connection : IDisposable var pending_hdl = eldbus_name_start(Handle, bus, flags, cb_wrapper, cb_data); if(pending_hdl == IntPtr.Zero) - { - Eina.Error.RaiseIfOccurred(); throw new SEHException("Eldbus: could not get `Pending' object from eldbus_name_start"); - } return new eldbus.Pending(pending_hdl, false); } diff --git a/src/bindings/mono/eldbus_mono/eldbus_message.cs b/src/bindings/mono/eldbus_mono/eldbus_message.cs index 82fb5dac27..b3826d6e13 100644 --- a/src/bindings/mono/eldbus_mono/eldbus_message.cs +++ b/src/bindings/mono/eldbus_mono/eldbus_message.cs @@ -251,10 +251,7 @@ public class Message : IDisposable { var ptr = eldbus_message_method_call_new(dest, path, iface, method); if (ptr == IntPtr.Zero) - { - Eina.Error.RaiseIfOccurred(); throw new SEHException("Eldbus: could not get `Message' object from eldbus_message_method_call_new"); - } return new eldbus.Message(ptr, true); } @@ -262,10 +259,7 @@ public class Message : IDisposable { var ptr = eldbus_message_signal_new(path, _interface, name); if (ptr == IntPtr.Zero) - { - Eina.Error.RaiseIfOccurred(); throw new SEHException("Eldbus: could not get `Message' object from eldbus_message_signal_new"); - } return new eldbus.Message(ptr, true); } @@ -328,10 +322,7 @@ public class Message : IDisposable CheckHandle(); var ptr = eldbus_message_error_new(Handle, error_name, error_msg); if (ptr == IntPtr.Zero) - { - Eina.Error.RaiseIfOccurred(); throw new SEHException("Eldbus: could not get `Message' object from eldbus_message_error_new"); - } return new eldbus.Message(ptr, false); } @@ -340,10 +331,7 @@ public class Message : IDisposable CheckHandle(); var ptr = eldbus_message_method_return_new(Handle); if (ptr == IntPtr.Zero) - { - Eina.Error.RaiseIfOccurred(); throw new SEHException("Eldbus: could not get `Message' object from eldbus_message_method_return_new"); - } return new eldbus.Message(ptr, false); } @@ -471,10 +459,7 @@ public class Message : IDisposable CheckHandle(); var ptr = eldbus_message_iter_get(Handle); if (ptr == IntPtr.Zero) - { - Eina.Error.RaiseIfOccurred(); throw new SEHException("Eldbus: could not get `MessageIterator' object from eldbus_message_iter_get"); - } return new eldbus.MessageIterator(ptr, IntPtr.Zero); } } @@ -529,20 +514,12 @@ public class MessageIterator IntPtr new_iter = IntPtr.Zero; if (signature[0] == 'v') - { new_iter = eldbus_message_iter_container_new(Handle, 'v', signature.Substring(1)); - } else if (!eldbus_message_iter_arguments_append(Handle, signature, out new_iter)) - { - Eina.Error.RaiseIfOccurred(); throw new SEHException("Eldbus: could not append container type"); - } if (new_iter == IntPtr.Zero) - { - Eina.Error.RaiseIfOccurred(); throw new SEHException("Eldbus: could not get `MessageIterator' object from eldbus_message_iter_arguments_append"); - } return new eldbus.MessageIterator(new_iter, Handle); } @@ -554,10 +531,7 @@ public class MessageIterator IntPtr new_iter = eldbus_message_iter_container_new(Handle, type, contained_signature); if (new_iter == IntPtr.Zero) - { - Eina.Error.RaiseIfOccurred(); throw new SEHException("Eldbus: could not get `MessageIterator' object from eldbus_message_iter_container_new"); - } return new eldbus.MessageIterator(new_iter, Handle); } @@ -567,15 +541,10 @@ public class MessageIterator CheckHandle(); if (Parent == IntPtr.Zero) - { throw new SEHException("Eldbus: can not close MessageIterator open container without a parent"); - } if (!eldbus_message_iter_container_close(Parent, Handle)) - { - Eina.Error.RaiseIfOccurred(); throw new SEHException("Eldbus: could not close MessageIterator"); - } Handle = IntPtr.Zero; Parent = IntPtr.Zero; @@ -685,10 +654,7 @@ public class MessageIterator IntPtr hdl = IntPtr.Zero; bool r = eldbus_message_iter_get_and_next(Handle, typecode, out hdl); if (hdl == IntPtr.Zero) - { - Eina.Error.RaiseIfOccurred(); throw new SEHException("Eldbus: could not get argument"); - } iter = new eldbus.MessageIterator(hdl, Handle); return r; @@ -699,10 +665,7 @@ public class MessageIterator CheckHandle(); IntPtr hdl = IntPtr.Zero; if (!eldbus_message_iter_arguments_get(Handle, signatue, out hdl) || hdl == IntPtr.Zero) - { - Eina.Error.RaiseIfOccurred(); throw new SEHException("Eldbus: could not get argument"); - } iter = new eldbus.MessageIterator(hdl, Handle); return Next(); @@ -801,10 +764,7 @@ public class MessageIterator CheckHandle(); IntPtr hdl = IntPtr.Zero; if (!eldbus_message_iter_arguments_get(Handle, signatue, out hdl) || hdl == IntPtr.Zero) - { - Eina.Error.RaiseIfOccurred(); throw new SEHException("Eldbus: could not get argument"); - } iter = new eldbus.MessageIterator(hdl, Handle); } @@ -829,10 +789,7 @@ public class MessageIterator CheckHandle(); if (!eldbus_message_iter_fixed_array_get(Handle, type_code, out value, out n_elements)) - { - Eina.Error.RaiseIfOccurred(); throw new SEHException("Eldbus: could not get fixed array"); - } } public void GetFixedArray(out byte[] array) diff --git a/src/bindings/mono/eldbus_mono/eldbus_object.cs b/src/bindings/mono/eldbus_mono/eldbus_object.cs index 0dfe4d891e..44888532ef 100644 --- a/src/bindings/mono/eldbus_mono/eldbus_object.cs +++ b/src/bindings/mono/eldbus_mono/eldbus_object.cs @@ -121,10 +121,7 @@ public class Object : System.IDisposable var handle = eldbus_object_get(conn.Handle, bus, path); if (handle == IntPtr.Zero) - { - Eina.Error.RaiseIfOccurred(); throw new SEHException("Eldbus: could not get `Object' object from eldbus_object_get"); - } InitNew(handle, true); } @@ -169,10 +166,7 @@ public class Object : System.IDisposable var conn = eldbus_object_connection_get(Handle); if (conn == IntPtr.Zero) - { - Eina.Error.RaiseIfOccurred(); throw new SEHException("Eldbus: could not get `Connection' object from eldbus_object_connection_get"); - } return new eldbus.Connection(conn, false); } @@ -216,10 +210,7 @@ public class Object : System.IDisposable var pending_hdl = eldbus_object_send(Handle, msg.Handle, cb_wrapper, cb_data, timeout); if (pending_hdl == IntPtr.Zero) - { - Eina.Error.RaiseIfOccurred(); throw new SEHException("Eldbus: could not get `Pending' object from eldbus_object_send"); - } return new eldbus.Pending(pending_hdl, false); } @@ -231,10 +222,7 @@ public class Object : System.IDisposable var hdl = eldbus_object_method_call_new(Handle, _interface, member); if (hdl == IntPtr.Zero) - { - Eina.Error.RaiseIfOccurred(); throw new SEHException("Eldbus: could not get `Message' object from eldbus_object_method_call_new"); - } return new eldbus.Message(hdl, false); } @@ -249,10 +237,7 @@ public class Object : System.IDisposable var pending_hdl = eldbus_object_peer_ping(Handle, cb_wrapper, cb_data); if (pending_hdl == IntPtr.Zero) - { - Eina.Error.RaiseIfOccurred(); throw new SEHException("Eldbus: could not get `Pending' object from eldbus_object_peer_ping"); - } return new eldbus.Pending(pending_hdl, false); } @@ -267,10 +252,7 @@ public class Object : System.IDisposable var pending_hdl = eldbus_object_peer_machine_id_get(Handle, cb_wrapper, cb_data); if (pending_hdl == IntPtr.Zero) - { - Eina.Error.RaiseIfOccurred(); throw new SEHException("Eldbus: could not get `Pending' object from eldbus_object_peer_machine_id_get"); - } return new eldbus.Pending(pending_hdl, false); } @@ -285,10 +267,7 @@ public class Object : System.IDisposable var pending_hdl = eldbus_object_introspect(Handle, cb_wrapper, cb_data); if (pending_hdl == IntPtr.Zero) - { - Eina.Error.RaiseIfOccurred(); throw new SEHException("Eldbus: could not get `Pending' object from eldbus_object_introspect"); - } return new eldbus.Pending(pending_hdl, false); } @@ -303,10 +282,7 @@ public class Object : System.IDisposable var pending_hdl = eldbus_object_managed_objects_get(Handle, cb_wrapper, cb_data); if (pending_hdl == IntPtr.Zero) - { - Eina.Error.RaiseIfOccurred(); throw new SEHException("Eldbus: could not get `Pending' object from eldbus_object_managed_objects_get"); - } return new eldbus.Pending(pending_hdl, false); } diff --git a/src/bindings/mono/eldbus_mono/eldbus_proxy.cs b/src/bindings/mono/eldbus_mono/eldbus_proxy.cs index 25903c9b21..fa34ce307b 100644 --- a/src/bindings/mono/eldbus_mono/eldbus_proxy.cs +++ b/src/bindings/mono/eldbus_mono/eldbus_proxy.cs @@ -133,10 +133,7 @@ public class Proxy : IDisposable CheckHandle(); var ptr = eldbus_proxy_object_get(Handle); if (ptr == IntPtr.Zero) - { - Eina.Error.RaiseIfOccurred(); throw new SEHException("Eldbus: could not get `Object' object from eldbus_proxy_object_get"); - } return new eldbus.Object(ptr, false); } @@ -156,10 +153,7 @@ public class Proxy : IDisposable var ptr = eldbus_proxy_method_call_new(Handle, member); if (ptr == IntPtr.Zero) - { - Eina.Error.RaiseIfOccurred(); throw new SEHException("Eldbus: could not get `Message' object from eldbus_proxy_method_call_new"); - } return new eldbus.Message(ptr, false); } @@ -176,10 +170,7 @@ public class Proxy : IDisposable var pending_hdl = eldbus_proxy_send(Handle, msg.Handle, cb_wrapper, cb_data, timeout); if (pending_hdl == IntPtr.Zero) - { - Eina.Error.RaiseIfOccurred(); throw new SEHException("Eldbus: could not get `Pending' object from eldbus_proxy_send"); - } return new eldbus.Pending(pending_hdl, false); } @@ -189,10 +180,7 @@ public class Proxy : IDisposable CheckHandle(); var ptr = eldbus_proxy_send_and_block(Handle, msg.Handle, timeout); if (ptr == IntPtr.Zero) - { - Eina.Error.RaiseIfOccurred(); throw new SEHException("Eldbus: could not get `Message' object from eldbus_proxy_send_and_block"); - } return new eldbus.Message(ptr, true); } diff --git a/src/bindings/mono/eo_mono/iwrapper.cs b/src/bindings/mono/eo_mono/iwrapper.cs index 35ee606540..fe96088626 100644 --- a/src/bindings/mono/eo_mono/iwrapper.cs +++ b/src/bindings/mono/eo_mono/iwrapper.cs @@ -7,6 +7,7 @@ using System.Diagnostics; using System.Threading; using static Eina.NativeCustomExportFunctions; +using EoG = Efl.Eo.Globals; namespace Efl { namespace Eo { @@ -25,21 +26,103 @@ public class Globals { [DllImport(efl.Libs.Eo)] public static extern int efl_ref_count(IntPtr eo); [DllImport(efl.Libs.Eo)] public static extern IntPtr - efl_class_new(IntPtr class_description, IntPtr base0); + efl_class_new(IntPtr class_description, IntPtr parent, IntPtr term); [DllImport(efl.Libs.Eo)] public static extern IntPtr - efl_class_new(IntPtr class_description, IntPtr base0, IntPtr base1); + efl_class_new(IntPtr class_description, IntPtr parent, IntPtr extn1, IntPtr term); [DllImport(efl.Libs.Eo)] public static extern IntPtr - efl_class_new(IntPtr class_description, IntPtr base0, IntPtr base1, IntPtr base2); + efl_class_new(IntPtr class_description, IntPtr parent, IntPtr extn1, IntPtr extn2, IntPtr term); [DllImport(efl.Libs.Eo)] public static extern IntPtr - efl_class_new(IntPtr class_description, IntPtr base0, IntPtr base1, IntPtr base2, IntPtr base3); + efl_class_new(IntPtr class_description, IntPtr parent, IntPtr extn1, IntPtr extn2, IntPtr extn3, IntPtr term); [DllImport(efl.Libs.Eo)] public static extern IntPtr - efl_class_new(IntPtr class_description, IntPtr base0, IntPtr base1, IntPtr base2, IntPtr base3, IntPtr base4); + efl_class_new(IntPtr class_description, IntPtr parent, IntPtr extn1, IntPtr extn2, IntPtr extn3, IntPtr extn4, IntPtr term); [DllImport(efl.Libs.Eo)] public static extern IntPtr - efl_class_new(IntPtr class_description, IntPtr base0, IntPtr base1, IntPtr base2, IntPtr base3, IntPtr base4, IntPtr base5); + efl_class_new(IntPtr class_description, IntPtr parent, IntPtr extn1, IntPtr extn2, IntPtr extn3, IntPtr extn4, IntPtr extn5, IntPtr term); [DllImport(efl.Libs.Eo)] public static extern IntPtr - efl_class_new(IntPtr class_description, IntPtr base0, IntPtr base1, IntPtr base2, IntPtr base3, IntPtr base4, IntPtr base5, IntPtr base6); + efl_class_new(IntPtr class_description, IntPtr parent, IntPtr extn1, IntPtr extn2, IntPtr extn3, IntPtr extn4, IntPtr extn5, IntPtr extn6, IntPtr term); [DllImport(efl.Libs.Eo)] public static extern IntPtr - efl_class_new(IntPtr class_description, IntPtr base0, IntPtr base1, IntPtr base2, IntPtr base3, IntPtr base4, IntPtr base5, IntPtr base6, IntPtr base7); + efl_class_new(IntPtr class_description, IntPtr parent, IntPtr extn1, IntPtr extn2, IntPtr extn3, IntPtr extn4, IntPtr extn5, IntPtr extn6, IntPtr extn7, IntPtr term); + [DllImport(efl.Libs.Eo)] public static extern IntPtr + efl_class_new(IntPtr class_description, IntPtr parent, IntPtr extn1, IntPtr extn2, IntPtr extn3, IntPtr extn4, IntPtr extn5, IntPtr extn6, IntPtr extn7, IntPtr extn8, IntPtr term); + [DllImport(efl.Libs.Eo)] public static extern IntPtr + efl_class_new(IntPtr class_description, IntPtr parent, IntPtr extn1, IntPtr extn2, IntPtr extn3, IntPtr extn4, IntPtr extn5, IntPtr extn6, IntPtr extn7, IntPtr extn8, IntPtr extn9, IntPtr term); + [DllImport(efl.Libs.Eo)] public static extern IntPtr + efl_class_new(IntPtr class_description, IntPtr parent, IntPtr extn1, IntPtr extn2, IntPtr extn3, IntPtr extn4, IntPtr extn5, IntPtr extn6, IntPtr extn7, IntPtr extn8, IntPtr extn9, IntPtr extn10, IntPtr term); + [DllImport(efl.Libs.Eo)] public static extern IntPtr + efl_class_new(IntPtr class_description, IntPtr parent, IntPtr extn1, IntPtr extn2, IntPtr extn3, IntPtr extn4, IntPtr extn5, IntPtr extn6, IntPtr extn7, IntPtr extn8, IntPtr extn9, IntPtr extn10, IntPtr extn11, IntPtr term); + [DllImport(efl.Libs.Eo)] public static extern IntPtr + efl_class_new(IntPtr class_description, IntPtr parent, IntPtr extn1, IntPtr extn2, IntPtr extn3, IntPtr extn4, IntPtr extn5, IntPtr extn6, IntPtr extn7, IntPtr extn8, IntPtr extn9, IntPtr extn10, IntPtr extn11, IntPtr extn12, IntPtr term); + [DllImport(efl.Libs.Eo)] public static extern IntPtr + efl_class_new(IntPtr class_description, IntPtr parent, IntPtr extn1, IntPtr extn2, IntPtr extn3, IntPtr extn4, IntPtr extn5, IntPtr extn6, IntPtr extn7, IntPtr extn8, IntPtr extn9, IntPtr extn10, IntPtr extn11, IntPtr extn12, IntPtr extn13, IntPtr term); + [DllImport(efl.Libs.Eo)] public static extern IntPtr + efl_class_new(IntPtr class_description, IntPtr parent, IntPtr extn1, IntPtr extn2, IntPtr extn3, IntPtr extn4, IntPtr extn5, IntPtr extn6, IntPtr extn7, IntPtr extn8, IntPtr extn9, IntPtr extn10, IntPtr extn11, IntPtr extn12, IntPtr extn13, IntPtr extn14, IntPtr term); + [DllImport(efl.Libs.Eo)] public static extern IntPtr + efl_class_new(IntPtr class_description, IntPtr parent, IntPtr extn1, IntPtr extn2, IntPtr extn3, IntPtr extn4, IntPtr extn5, IntPtr extn6, IntPtr extn7, IntPtr extn8, IntPtr extn9, IntPtr extn10, IntPtr extn11, IntPtr extn12, IntPtr extn13, IntPtr extn14, IntPtr extn15, IntPtr term); + [DllImport(efl.Libs.Eo)] public static extern IntPtr + efl_class_new(IntPtr class_description, IntPtr parent, IntPtr extn1, IntPtr extn2, IntPtr extn3, IntPtr extn4, IntPtr extn5, IntPtr extn6, IntPtr extn7, IntPtr extn8, IntPtr extn9, IntPtr extn10, IntPtr extn11, IntPtr extn12, IntPtr extn13, IntPtr extn14, IntPtr extn15, IntPtr extn16, IntPtr term); + [DllImport(efl.Libs.Eo)] public static extern IntPtr + efl_class_new(IntPtr class_description, IntPtr parent, IntPtr extn1, IntPtr extn2, IntPtr extn3, IntPtr extn4, IntPtr extn5, IntPtr extn6, IntPtr extn7, IntPtr extn8, IntPtr extn9, IntPtr extn10, IntPtr extn11, IntPtr extn12, IntPtr extn13, IntPtr extn14, IntPtr extn15, IntPtr extn16, IntPtr extn17, IntPtr term); + [DllImport(efl.Libs.Eo)] public static extern IntPtr + efl_class_new(IntPtr class_description, IntPtr parent, IntPtr extn1, IntPtr extn2, IntPtr extn3, IntPtr extn4, IntPtr extn5, IntPtr extn6, IntPtr extn7, IntPtr extn8, IntPtr extn9, IntPtr extn10, IntPtr extn11, IntPtr extn12, IntPtr extn13, IntPtr extn14, IntPtr extn15, IntPtr extn16, IntPtr extn17, IntPtr extn18, IntPtr term); + [DllImport(efl.Libs.Eo)] public static extern IntPtr + efl_class_new(IntPtr class_description, IntPtr parent, IntPtr extn1, IntPtr extn2, IntPtr extn3, IntPtr extn4, IntPtr extn5, IntPtr extn6, IntPtr extn7, IntPtr extn8, IntPtr extn9, IntPtr extn10, IntPtr extn11, IntPtr extn12, IntPtr extn13, IntPtr extn14, IntPtr extn15, IntPtr extn16, IntPtr extn17, IntPtr extn18, IntPtr extn19, IntPtr term); + [DllImport(efl.Libs.Eo)] public static extern IntPtr + efl_class_new(IntPtr class_description, IntPtr parent, IntPtr extn1, IntPtr extn2, IntPtr extn3, IntPtr extn4, IntPtr extn5, IntPtr extn6, IntPtr extn7, IntPtr extn8, IntPtr extn9, IntPtr extn10, IntPtr extn11, IntPtr extn12, IntPtr extn13, IntPtr extn14, IntPtr extn15, IntPtr extn16, IntPtr extn17, IntPtr extn18, IntPtr extn19, IntPtr extn20, IntPtr term); + [DllImport(efl.Libs.Eo)] public static extern IntPtr + efl_class_new(IntPtr class_description, IntPtr parent, IntPtr extn1, IntPtr extn2, IntPtr extn3, IntPtr extn4, IntPtr extn5, IntPtr extn6, IntPtr extn7, IntPtr extn8, IntPtr extn9, IntPtr extn10, IntPtr extn11, IntPtr extn12, IntPtr extn13, IntPtr extn14, IntPtr extn15, IntPtr extn16, IntPtr extn17, IntPtr extn18, IntPtr extn19, IntPtr extn20, IntPtr extn21, IntPtr term); + [DllImport(efl.Libs.Eo)] public static extern IntPtr + efl_class_new(IntPtr class_description, IntPtr parent, IntPtr extn1, IntPtr extn2, IntPtr extn3, IntPtr extn4, IntPtr extn5, IntPtr extn6, IntPtr extn7, IntPtr extn8, IntPtr extn9, IntPtr extn10, IntPtr extn11, IntPtr extn12, IntPtr extn13, IntPtr extn14, IntPtr extn15, IntPtr extn16, IntPtr extn17, IntPtr extn18, IntPtr extn19, IntPtr extn20, IntPtr extn21, IntPtr extn22, IntPtr term); + [DllImport(efl.Libs.Eo)] public static extern IntPtr + efl_class_new(IntPtr class_description, IntPtr parent, IntPtr extn1, IntPtr extn2, IntPtr extn3, IntPtr extn4, IntPtr extn5, IntPtr extn6, IntPtr extn7, IntPtr extn8, IntPtr extn9, IntPtr extn10, IntPtr extn11, IntPtr extn12, IntPtr extn13, IntPtr extn14, IntPtr extn15, IntPtr extn16, IntPtr extn17, IntPtr extn18, IntPtr extn19, IntPtr extn20, IntPtr extn21, IntPtr extn22, IntPtr extn23, IntPtr term); + [DllImport(efl.Libs.Eo)] public static extern IntPtr + efl_class_new(IntPtr class_description, IntPtr parent, IntPtr extn1, IntPtr extn2, IntPtr extn3, IntPtr extn4, IntPtr extn5, IntPtr extn6, IntPtr extn7, IntPtr extn8, IntPtr extn9, IntPtr extn10, IntPtr extn11, IntPtr extn12, IntPtr extn13, IntPtr extn14, IntPtr extn15, IntPtr extn16, IntPtr extn17, IntPtr extn18, IntPtr extn19, IntPtr extn20, IntPtr extn21, IntPtr extn22, IntPtr extn23, IntPtr extn24, IntPtr term); + [DllImport(efl.Libs.Eo)] public static extern IntPtr + efl_class_new(IntPtr class_description, IntPtr parent, IntPtr extn1, IntPtr extn2, IntPtr extn3, IntPtr extn4, IntPtr extn5, IntPtr extn6, IntPtr extn7, IntPtr extn8, IntPtr extn9, IntPtr extn10, IntPtr extn11, IntPtr extn12, IntPtr extn13, IntPtr extn14, IntPtr extn15, IntPtr extn16, IntPtr extn17, IntPtr extn18, IntPtr extn19, IntPtr extn20, IntPtr extn21, IntPtr extn22, IntPtr extn23, IntPtr extn24, IntPtr extn25, IntPtr term); + [DllImport(efl.Libs.Eo)] public static extern IntPtr + efl_class_new(IntPtr class_description, IntPtr parent, IntPtr extn1, IntPtr extn2, IntPtr extn3, IntPtr extn4, IntPtr extn5, IntPtr extn6, IntPtr extn7, IntPtr extn8, IntPtr extn9, IntPtr extn10, IntPtr extn11, IntPtr extn12, IntPtr extn13, IntPtr extn14, IntPtr extn15, IntPtr extn16, IntPtr extn17, IntPtr extn18, IntPtr extn19, IntPtr extn20, IntPtr extn21, IntPtr extn22, IntPtr extn23, IntPtr extn24, IntPtr extn25, IntPtr extn26, IntPtr term); + [DllImport(efl.Libs.Eo)] public static extern IntPtr + efl_class_new(IntPtr class_description, IntPtr parent, IntPtr extn1, IntPtr extn2, IntPtr extn3, IntPtr extn4, IntPtr extn5, IntPtr extn6, IntPtr extn7, IntPtr extn8, IntPtr extn9, IntPtr extn10, IntPtr extn11, IntPtr extn12, IntPtr extn13, IntPtr extn14, IntPtr extn15, IntPtr extn16, IntPtr extn17, IntPtr extn18, IntPtr extn19, IntPtr extn20, IntPtr extn21, IntPtr extn22, IntPtr extn23, IntPtr extn24, IntPtr extn25, IntPtr extn26, IntPtr extn27, IntPtr term); + [DllImport(efl.Libs.Eo)] public static extern IntPtr + efl_class_new(IntPtr class_description, IntPtr parent, IntPtr extn1, IntPtr extn2, IntPtr extn3, IntPtr extn4, IntPtr extn5, IntPtr extn6, IntPtr extn7, IntPtr extn8, IntPtr extn9, IntPtr extn10, IntPtr extn11, IntPtr extn12, IntPtr extn13, IntPtr extn14, IntPtr extn15, IntPtr extn16, IntPtr extn17, IntPtr extn18, IntPtr extn19, IntPtr extn20, IntPtr extn21, IntPtr extn22, IntPtr extn23, IntPtr extn24, IntPtr extn25, IntPtr extn26, IntPtr extn27, IntPtr extn28, IntPtr term); + [DllImport(efl.Libs.Eo)] public static extern IntPtr + efl_class_new(IntPtr class_description, IntPtr parent, IntPtr extn1, IntPtr extn2, IntPtr extn3, IntPtr extn4, IntPtr extn5, IntPtr extn6, IntPtr extn7, IntPtr extn8, IntPtr extn9, IntPtr extn10, IntPtr extn11, IntPtr extn12, IntPtr extn13, IntPtr extn14, IntPtr extn15, IntPtr extn16, IntPtr extn17, IntPtr extn18, IntPtr extn19, IntPtr extn20, IntPtr extn21, IntPtr extn22, IntPtr extn23, IntPtr extn24, IntPtr extn25, IntPtr extn26, IntPtr extn27, IntPtr extn28, IntPtr extn29, IntPtr term); + [DllImport(efl.Libs.Eo)] public static extern IntPtr + efl_class_new(IntPtr class_description, IntPtr parent, IntPtr extn1, IntPtr extn2, IntPtr extn3, IntPtr extn4, IntPtr extn5, IntPtr extn6, IntPtr extn7, IntPtr extn8, IntPtr extn9, IntPtr extn10, IntPtr extn11, IntPtr extn12, IntPtr extn13, IntPtr extn14, IntPtr extn15, IntPtr extn16, IntPtr extn17, IntPtr extn18, IntPtr extn19, IntPtr extn20, IntPtr extn21, IntPtr extn22, IntPtr extn23, IntPtr extn24, IntPtr extn25, IntPtr extn26, IntPtr extn27, IntPtr extn28, IntPtr extn29, IntPtr extn30, IntPtr term); + [DllImport(efl.Libs.Eo)] public static extern IntPtr + efl_class_new(IntPtr class_description, IntPtr parent, IntPtr extn1, IntPtr extn2, IntPtr extn3, IntPtr extn4, IntPtr extn5, IntPtr extn6, IntPtr extn7, IntPtr extn8, IntPtr extn9, IntPtr extn10, IntPtr extn11, IntPtr extn12, IntPtr extn13, IntPtr extn14, IntPtr extn15, IntPtr extn16, IntPtr extn17, IntPtr extn18, IntPtr extn19, IntPtr extn20, IntPtr extn21, IntPtr extn22, IntPtr extn23, IntPtr extn24, IntPtr extn25, IntPtr extn26, IntPtr extn27, IntPtr extn28, IntPtr extn29, IntPtr extn30, IntPtr extn31, IntPtr term); + [DllImport(efl.Libs.Eo)] public static extern IntPtr + efl_class_new(IntPtr class_description, IntPtr parent, IntPtr extn1, IntPtr extn2, IntPtr extn3, IntPtr extn4, IntPtr extn5, IntPtr extn6, IntPtr extn7, IntPtr extn8, IntPtr extn9, IntPtr extn10, IntPtr extn11, IntPtr extn12, IntPtr extn13, IntPtr extn14, IntPtr extn15, IntPtr extn16, IntPtr extn17, IntPtr extn18, IntPtr extn19, IntPtr extn20, IntPtr extn21, IntPtr extn22, IntPtr extn23, IntPtr extn24, IntPtr extn25, IntPtr extn26, IntPtr extn27, IntPtr extn28, IntPtr extn29, IntPtr extn30, IntPtr extn31, IntPtr extn32, IntPtr term); + [DllImport(efl.Libs.Eo)] public static extern IntPtr + efl_class_new(IntPtr class_description, IntPtr parent, IntPtr extn1, IntPtr extn2, IntPtr extn3, IntPtr extn4, IntPtr extn5, IntPtr extn6, IntPtr extn7, IntPtr extn8, IntPtr extn9, IntPtr extn10, IntPtr extn11, IntPtr extn12, IntPtr extn13, IntPtr extn14, IntPtr extn15, IntPtr extn16, IntPtr extn17, IntPtr extn18, IntPtr extn19, IntPtr extn20, IntPtr extn21, IntPtr extn22, IntPtr extn23, IntPtr extn24, IntPtr extn25, IntPtr extn26, IntPtr extn27, IntPtr extn28, IntPtr extn29, IntPtr extn30, IntPtr extn31, IntPtr extn32, IntPtr extn33, IntPtr term); + [DllImport(efl.Libs.Eo)] public static extern IntPtr + efl_class_new(IntPtr class_description, IntPtr parent, IntPtr extn1, IntPtr extn2, IntPtr extn3, IntPtr extn4, IntPtr extn5, IntPtr extn6, IntPtr extn7, IntPtr extn8, IntPtr extn9, IntPtr extn10, IntPtr extn11, IntPtr extn12, IntPtr extn13, IntPtr extn14, IntPtr extn15, IntPtr extn16, IntPtr extn17, IntPtr extn18, IntPtr extn19, IntPtr extn20, IntPtr extn21, IntPtr extn22, IntPtr extn23, IntPtr extn24, IntPtr extn25, IntPtr extn26, IntPtr extn27, IntPtr extn28, IntPtr extn29, IntPtr extn30, IntPtr extn31, IntPtr extn32, IntPtr extn33, IntPtr extn34, IntPtr term); + [DllImport(efl.Libs.Eo)] public static extern IntPtr + efl_class_new(IntPtr class_description, IntPtr parent, IntPtr extn1, IntPtr extn2, IntPtr extn3, IntPtr extn4, IntPtr extn5, IntPtr extn6, IntPtr extn7, IntPtr extn8, IntPtr extn9, IntPtr extn10, IntPtr extn11, IntPtr extn12, IntPtr extn13, IntPtr extn14, IntPtr extn15, IntPtr extn16, IntPtr extn17, IntPtr extn18, IntPtr extn19, IntPtr extn20, IntPtr extn21, IntPtr extn22, IntPtr extn23, IntPtr extn24, IntPtr extn25, IntPtr extn26, IntPtr extn27, IntPtr extn28, IntPtr extn29, IntPtr extn30, IntPtr extn31, IntPtr extn32, IntPtr extn33, IntPtr extn34, IntPtr extn35, IntPtr term); + [DllImport(efl.Libs.Eo)] public static extern IntPtr + efl_class_new(IntPtr class_description, IntPtr parent, IntPtr extn1, IntPtr extn2, IntPtr extn3, IntPtr extn4, IntPtr extn5, IntPtr extn6, IntPtr extn7, IntPtr extn8, IntPtr extn9, IntPtr extn10, IntPtr extn11, IntPtr extn12, IntPtr extn13, IntPtr extn14, IntPtr extn15, IntPtr extn16, IntPtr extn17, IntPtr extn18, IntPtr extn19, IntPtr extn20, IntPtr extn21, IntPtr extn22, IntPtr extn23, IntPtr extn24, IntPtr extn25, IntPtr extn26, IntPtr extn27, IntPtr extn28, IntPtr extn29, IntPtr extn30, IntPtr extn31, IntPtr extn32, IntPtr extn33, IntPtr extn34, IntPtr extn35, IntPtr extn36, IntPtr term); + [DllImport(efl.Libs.Eo)] public static extern IntPtr + efl_class_new(IntPtr class_description, IntPtr parent, IntPtr extn1, IntPtr extn2, IntPtr extn3, IntPtr extn4, IntPtr extn5, IntPtr extn6, IntPtr extn7, IntPtr extn8, IntPtr extn9, IntPtr extn10, IntPtr extn11, IntPtr extn12, IntPtr extn13, IntPtr extn14, IntPtr extn15, IntPtr extn16, IntPtr extn17, IntPtr extn18, IntPtr extn19, IntPtr extn20, IntPtr extn21, IntPtr extn22, IntPtr extn23, IntPtr extn24, IntPtr extn25, IntPtr extn26, IntPtr extn27, IntPtr extn28, IntPtr extn29, IntPtr extn30, IntPtr extn31, IntPtr extn32, IntPtr extn33, IntPtr extn34, IntPtr extn35, IntPtr extn36, IntPtr extn37, IntPtr term); + [DllImport(efl.Libs.Eo)] public static extern IntPtr + efl_class_new(IntPtr class_description, IntPtr parent, IntPtr extn1, IntPtr extn2, IntPtr extn3, IntPtr extn4, IntPtr extn5, IntPtr extn6, IntPtr extn7, IntPtr extn8, IntPtr extn9, IntPtr extn10, IntPtr extn11, IntPtr extn12, IntPtr extn13, IntPtr extn14, IntPtr extn15, IntPtr extn16, IntPtr extn17, IntPtr extn18, IntPtr extn19, IntPtr extn20, IntPtr extn21, IntPtr extn22, IntPtr extn23, IntPtr extn24, IntPtr extn25, IntPtr extn26, IntPtr extn27, IntPtr extn28, IntPtr extn29, IntPtr extn30, IntPtr extn31, IntPtr extn32, IntPtr extn33, IntPtr extn34, IntPtr extn35, IntPtr extn36, IntPtr extn37, IntPtr extn38, IntPtr term); + [DllImport(efl.Libs.Eo)] public static extern IntPtr + efl_class_new(IntPtr class_description, IntPtr parent, IntPtr extn1, IntPtr extn2, IntPtr extn3, IntPtr extn4, IntPtr extn5, IntPtr extn6, IntPtr extn7, IntPtr extn8, IntPtr extn9, IntPtr extn10, IntPtr extn11, IntPtr extn12, IntPtr extn13, IntPtr extn14, IntPtr extn15, IntPtr extn16, IntPtr extn17, IntPtr extn18, IntPtr extn19, IntPtr extn20, IntPtr extn21, IntPtr extn22, IntPtr extn23, IntPtr extn24, IntPtr extn25, IntPtr extn26, IntPtr extn27, IntPtr extn28, IntPtr extn29, IntPtr extn30, IntPtr extn31, IntPtr extn32, IntPtr extn33, IntPtr extn34, IntPtr extn35, IntPtr extn36, IntPtr extn37, IntPtr extn38, IntPtr extn39, IntPtr term); + [DllImport(efl.Libs.Eo)] public static extern IntPtr + efl_class_new(IntPtr class_description, IntPtr parent, IntPtr extn1, IntPtr extn2, IntPtr extn3, IntPtr extn4, IntPtr extn5, IntPtr extn6, IntPtr extn7, IntPtr extn8, IntPtr extn9, IntPtr extn10, IntPtr extn11, IntPtr extn12, IntPtr extn13, IntPtr extn14, IntPtr extn15, IntPtr extn16, IntPtr extn17, IntPtr extn18, IntPtr extn19, IntPtr extn20, IntPtr extn21, IntPtr extn22, IntPtr extn23, IntPtr extn24, IntPtr extn25, IntPtr extn26, IntPtr extn27, IntPtr extn28, IntPtr extn29, IntPtr extn30, IntPtr extn31, IntPtr extn32, IntPtr extn33, IntPtr extn34, IntPtr extn35, IntPtr extn36, IntPtr extn37, IntPtr extn38, IntPtr extn39, IntPtr extn40, IntPtr term); + [DllImport(efl.Libs.Eo)] public static extern IntPtr + efl_class_new(IntPtr class_description, IntPtr parent, IntPtr extn1, IntPtr extn2, IntPtr extn3, IntPtr extn4, IntPtr extn5, IntPtr extn6, IntPtr extn7, IntPtr extn8, IntPtr extn9, IntPtr extn10, IntPtr extn11, IntPtr extn12, IntPtr extn13, IntPtr extn14, IntPtr extn15, IntPtr extn16, IntPtr extn17, IntPtr extn18, IntPtr extn19, IntPtr extn20, IntPtr extn21, IntPtr extn22, IntPtr extn23, IntPtr extn24, IntPtr extn25, IntPtr extn26, IntPtr extn27, IntPtr extn28, IntPtr extn29, IntPtr extn30, IntPtr extn31, IntPtr extn32, IntPtr extn33, IntPtr extn34, IntPtr extn35, IntPtr extn36, IntPtr extn37, IntPtr extn38, IntPtr extn39, IntPtr extn40, IntPtr extn41, IntPtr term); + [DllImport(efl.Libs.Eo)] public static extern IntPtr + efl_class_new(IntPtr class_description, IntPtr parent, IntPtr extn1, IntPtr extn2, IntPtr extn3, IntPtr extn4, IntPtr extn5, IntPtr extn6, IntPtr extn7, IntPtr extn8, IntPtr extn9, IntPtr extn10, IntPtr extn11, IntPtr extn12, IntPtr extn13, IntPtr extn14, IntPtr extn15, IntPtr extn16, IntPtr extn17, IntPtr extn18, IntPtr extn19, IntPtr extn20, IntPtr extn21, IntPtr extn22, IntPtr extn23, IntPtr extn24, IntPtr extn25, IntPtr extn26, IntPtr extn27, IntPtr extn28, IntPtr extn29, IntPtr extn30, IntPtr extn31, IntPtr extn32, IntPtr extn33, IntPtr extn34, IntPtr extn35, IntPtr extn36, IntPtr extn37, IntPtr extn38, IntPtr extn39, IntPtr extn40, IntPtr extn41, IntPtr extn42, IntPtr term); + [DllImport(efl.Libs.Eo)] public static extern IntPtr + efl_class_new(IntPtr class_description, IntPtr parent, IntPtr extn1, IntPtr extn2, IntPtr extn3, IntPtr extn4, IntPtr extn5, IntPtr extn6, IntPtr extn7, IntPtr extn8, IntPtr extn9, IntPtr extn10, IntPtr extn11, IntPtr extn12, IntPtr extn13, IntPtr extn14, IntPtr extn15, IntPtr extn16, IntPtr extn17, IntPtr extn18, IntPtr extn19, IntPtr extn20, IntPtr extn21, IntPtr extn22, IntPtr extn23, IntPtr extn24, IntPtr extn25, IntPtr extn26, IntPtr extn27, IntPtr extn28, IntPtr extn29, IntPtr extn30, IntPtr extn31, IntPtr extn32, IntPtr extn33, IntPtr extn34, IntPtr extn35, IntPtr extn36, IntPtr extn37, IntPtr extn38, IntPtr extn39, IntPtr extn40, IntPtr extn41, IntPtr extn42, IntPtr extn43, IntPtr term); + [DllImport(efl.Libs.Eo)] public static extern IntPtr + efl_class_new(IntPtr class_description, IntPtr parent, IntPtr extn1, IntPtr extn2, IntPtr extn3, IntPtr extn4, IntPtr extn5, IntPtr extn6, IntPtr extn7, IntPtr extn8, IntPtr extn9, IntPtr extn10, IntPtr extn11, IntPtr extn12, IntPtr extn13, IntPtr extn14, IntPtr extn15, IntPtr extn16, IntPtr extn17, IntPtr extn18, IntPtr extn19, IntPtr extn20, IntPtr extn21, IntPtr extn22, IntPtr extn23, IntPtr extn24, IntPtr extn25, IntPtr extn26, IntPtr extn27, IntPtr extn28, IntPtr extn29, IntPtr extn30, IntPtr extn31, IntPtr extn32, IntPtr extn33, IntPtr extn34, IntPtr extn35, IntPtr extn36, IntPtr extn37, IntPtr extn38, IntPtr extn39, IntPtr extn40, IntPtr extn41, IntPtr extn42, IntPtr extn43, IntPtr extn44, IntPtr term); + [DllImport(efl.Libs.Eo)] public static extern IntPtr + efl_class_new(IntPtr class_description, IntPtr parent, IntPtr extn1, IntPtr extn2, IntPtr extn3, IntPtr extn4, IntPtr extn5, IntPtr extn6, IntPtr extn7, IntPtr extn8, IntPtr extn9, IntPtr extn10, IntPtr extn11, IntPtr extn12, IntPtr extn13, IntPtr extn14, IntPtr extn15, IntPtr extn16, IntPtr extn17, IntPtr extn18, IntPtr extn19, IntPtr extn20, IntPtr extn21, IntPtr extn22, IntPtr extn23, IntPtr extn24, IntPtr extn25, IntPtr extn26, IntPtr extn27, IntPtr extn28, IntPtr extn29, IntPtr extn30, IntPtr extn31, IntPtr extn32, IntPtr extn33, IntPtr extn34, IntPtr extn35, IntPtr extn36, IntPtr extn37, IntPtr extn38, IntPtr extn39, IntPtr extn40, IntPtr extn41, IntPtr extn42, IntPtr extn43, IntPtr extn44, IntPtr extn45, IntPtr term); + [DllImport(efl.Libs.Eo)] public static extern IntPtr + efl_class_new(IntPtr class_description, IntPtr parent, IntPtr extn1, IntPtr extn2, IntPtr extn3, IntPtr extn4, IntPtr extn5, IntPtr extn6, IntPtr extn7, IntPtr extn8, IntPtr extn9, IntPtr extn10, IntPtr extn11, IntPtr extn12, IntPtr extn13, IntPtr extn14, IntPtr extn15, IntPtr extn16, IntPtr extn17, IntPtr extn18, IntPtr extn19, IntPtr extn20, IntPtr extn21, IntPtr extn22, IntPtr extn23, IntPtr extn24, IntPtr extn25, IntPtr extn26, IntPtr extn27, IntPtr extn28, IntPtr extn29, IntPtr extn30, IntPtr extn31, IntPtr extn32, IntPtr extn33, IntPtr extn34, IntPtr extn35, IntPtr extn36, IntPtr extn37, IntPtr extn38, IntPtr extn39, IntPtr extn40, IntPtr extn41, IntPtr extn42, IntPtr extn43, IntPtr extn44, IntPtr extn45, IntPtr extn46, IntPtr term); + [DllImport(efl.Libs.Eo)] public static extern IntPtr + efl_class_new(IntPtr class_description, IntPtr parent, IntPtr extn1, IntPtr extn2, IntPtr extn3, IntPtr extn4, IntPtr extn5, IntPtr extn6, IntPtr extn7, IntPtr extn8, IntPtr extn9, IntPtr extn10, IntPtr extn11, IntPtr extn12, IntPtr extn13, IntPtr extn14, IntPtr extn15, IntPtr extn16, IntPtr extn17, IntPtr extn18, IntPtr extn19, IntPtr extn20, IntPtr extn21, IntPtr extn22, IntPtr extn23, IntPtr extn24, IntPtr extn25, IntPtr extn26, IntPtr extn27, IntPtr extn28, IntPtr extn29, IntPtr extn30, IntPtr extn31, IntPtr extn32, IntPtr extn33, IntPtr extn34, IntPtr extn35, IntPtr extn36, IntPtr extn37, IntPtr extn38, IntPtr extn39, IntPtr extn40, IntPtr extn41, IntPtr extn42, IntPtr extn43, IntPtr extn44, IntPtr extn45, IntPtr extn46, IntPtr extn47, IntPtr term); + [DllImport(efl.Libs.Eo)] public static extern IntPtr + efl_class_new(IntPtr class_description, IntPtr parent, IntPtr extn1, IntPtr extn2, IntPtr extn3, IntPtr extn4, IntPtr extn5, IntPtr extn6, IntPtr extn7, IntPtr extn8, IntPtr extn9, IntPtr extn10, IntPtr extn11, IntPtr extn12, IntPtr extn13, IntPtr extn14, IntPtr extn15, IntPtr extn16, IntPtr extn17, IntPtr extn18, IntPtr extn19, IntPtr extn20, IntPtr extn21, IntPtr extn22, IntPtr extn23, IntPtr extn24, IntPtr extn25, IntPtr extn26, IntPtr extn27, IntPtr extn28, IntPtr extn29, IntPtr extn30, IntPtr extn31, IntPtr extn32, IntPtr extn33, IntPtr extn34, IntPtr extn35, IntPtr extn36, IntPtr extn37, IntPtr extn38, IntPtr extn39, IntPtr extn40, IntPtr extn41, IntPtr extn42, IntPtr extn43, IntPtr extn44, IntPtr extn45, IntPtr extn46, IntPtr extn47, IntPtr extn48, IntPtr term); [DllImport(efl.Libs.Eo)] public static extern byte efl_class_functions_set(IntPtr klass_id, IntPtr object_ops, IntPtr class_ops); [DllImport(efl.Libs.Eo)] public static extern IntPtr efl_data_scope_get(IntPtr obj, IntPtr klass); [DllImport(efl.Libs.Eo)] public static extern IntPtr efl_super(IntPtr obj, IntPtr klass); @@ -67,11 +150,14 @@ public class Globals { [DllImport(efl.Libs.Eo)] public static extern IntPtr efl_object_legacy_only_event_description_get([MarshalAs(UnmanagedType.LPStr)] String name); + public static System.Collections.Concurrent.ConcurrentDictionary klasses + = new System.Collections.Concurrent.ConcurrentDictionary(); + public const int RTLD_NOW = 2; public delegate byte class_initializer(IntPtr klass); - - public static IntPtr register_class(class_initializer initializer, String class_name, IntPtr base_klass) + + public static IntPtr register_class(String class_name, IntPtr base_klass, System.Type type) { ClassDescription description; description.version = 2; // EO_VERSION @@ -82,28 +168,185 @@ public class Globals { description.class_constructor = IntPtr.Zero; description.class_destructor = IntPtr.Zero; - if(initializer != null) - description.class_initializer = Marshal.GetFunctionPointerForDelegate(initializer); + class_initializer init = (IntPtr kls) => + { + return Globals.class_initializer_call(kls, type); + }; + + description.class_initializer = Marshal.GetFunctionPointerForDelegate(init); IntPtr description_ptr = Eina.MemoryNative.Alloc(Marshal.SizeOf(description)); Marshal.StructureToPtr(description, description_ptr, false); - + + var interface_list = EoG.get_efl_interfaces(type); + + System.Console.WriteLine ("Interafaces: {0}", interface_list.Count); + Eina.Log.Debug("Going to register!"); - IntPtr klass = Efl.Eo.Globals.efl_class_new(description_ptr, base_klass, IntPtr.Zero); + IntPtr klass = EoG.call_efl_class_new(description_ptr, base_klass, interface_list); if(klass == IntPtr.Zero) + { Eina.Log.Error("klass was not registered"); + Console.WriteLine("klass was not registered"); + } else Eina.Log.Debug("Registered class successfully"); return klass; } + public static List get_efl_interfaces(System.Type type) + { + System.Type base_type = type.BaseType; + + var ifaces_lst = new List(); + var base_ifaces = base_type.GetInterfaces(); + var ifaces = type.GetInterfaces(); + foreach (var iface in ifaces) + { + if (!System.Array.Exists(base_ifaces, element => element == iface)) + { + var attrs = System.Attribute.GetCustomAttributes(iface); + foreach (var attr in attrs) + { + if (attr is Efl.Eo.NativeClass) { + ifaces_lst.Add(((Efl.Eo.NativeClass)attr).GetEflClass()); + break; + } + } + } + } + return ifaces_lst; + } + private static Efl.Eo.NativeClass get_native_class(System.Type type) + { + var attrs = System.Attribute.GetCustomAttributes(type); + foreach (var attr in attrs) + { + if (attr is Efl.Eo.NativeClass) { + return (Efl.Eo.NativeClass)attr; + } + } + return null; + } + public static byte class_initializer_call(IntPtr klass, System.Type type) + { + Console.WriteLine("class_intiailizer_call 0x{1} {0}", type, klass); + Efl.Eo.NativeClass nativeClass = get_native_class(type.BaseType); + + if (nativeClass != null) + { + Console.WriteLine("nativeClass != null"); + var descs = nativeClass.GetEoOps(type); + var count = descs.Count; + + var all_interfaces = type.GetInterfaces(); + var base_interfaces = type.BaseType.GetInterfaces(); + foreach (var iface in all_interfaces) + { + if (!System.Array.Exists(base_interfaces, element => element == iface)) + { + var nc = get_native_class(iface); + if(nc != null) + { + var moredescs = nc.GetEoOps(type); + Console.WriteLine("adding {0} more descs to registration", moredescs.Count); + descs.AddRange(moredescs); + count = descs.Count; + } + } + } + + IntPtr descs_ptr = Marshal.AllocHGlobal(Marshal.SizeOf(descs[0])*count); + IntPtr ptr = descs_ptr; + for(int i = 0; i != count; ++i) + { + Marshal.StructureToPtr(descs[i], ptr, false); + ptr = IntPtr.Add(ptr, Marshal.SizeOf(descs[0])); + } + Efl_Object_Ops ops; + ops.descs = descs_ptr; + ops.count = (UIntPtr)count; + IntPtr ops_ptr = Marshal.AllocHGlobal(Marshal.SizeOf(ops)); + Marshal.StructureToPtr(ops, ops_ptr, false); + Efl.Eo.Globals.efl_class_functions_set(klass, ops_ptr, IntPtr.Zero); + //EoKlass = klass; + } + else + Console.WriteLine("nativeClass == null"); + + return 1; + } + public static IntPtr call_efl_class_new(IntPtr desc, IntPtr bk, List il = null) + { + IntPtr nul = IntPtr.Zero; + int iface_list_count = (il == null ? 0 : il.Count); + switch(iface_list_count) + { + default: return nul; + case 0: return EoG.efl_class_new(desc, bk, nul); + case 1: return EoG.efl_class_new(desc, bk, il[0], nul); + case 2: return EoG.efl_class_new(desc, bk, il[0], il[1], nul); + case 3: return EoG.efl_class_new(desc, bk, il[0], il[1], il[2], nul); + case 4: return EoG.efl_class_new(desc, bk, il[0], il[1], il[2], il[3], nul); + case 5: return EoG.efl_class_new(desc, bk, il[0], il[1], il[2], il[3], il[4], nul); + case 6: return EoG.efl_class_new(desc, bk, il[0], il[1], il[2], il[3], il[4], il[5], nul); + case 7: return EoG.efl_class_new(desc, bk, il[0], il[1], il[2], il[3], il[4], il[5], il[6], nul); + case 8: return EoG.efl_class_new(desc, bk, il[0], il[1], il[2], il[3], il[4], il[5], il[6], il[7], nul); + case 9: return EoG.efl_class_new(desc, bk, il[0], il[1], il[2], il[3], il[4], il[5], il[6], il[7], il[8], nul); + case 10: return EoG.efl_class_new(desc, bk, il[0], il[1], il[2], il[3], il[4], il[5], il[6], il[7], il[8], il[9], nul); + case 11: return EoG.efl_class_new(desc, bk, il[0], il[1], il[2], il[3], il[4], il[5], il[6], il[7], il[8], il[9], il[10], nul); + case 12: return EoG.efl_class_new(desc, bk, il[0], il[1], il[2], il[3], il[4], il[5], il[6], il[7], il[8], il[9], il[10], il[11], nul); + case 13: return EoG.efl_class_new(desc, bk, il[0], il[1], il[2], il[3], il[4], il[5], il[6], il[7], il[8], il[9], il[10], il[11], il[12], nul); + case 14: return EoG.efl_class_new(desc, bk, il[0], il[1], il[2], il[3], il[4], il[5], il[6], il[7], il[8], il[9], il[10], il[11], il[12], il[13], nul); + case 15: return EoG.efl_class_new(desc, bk, il[0], il[1], il[2], il[3], il[4], il[5], il[6], il[7], il[8], il[9], il[10], il[11], il[12], il[13], il[14], nul); + case 16: return EoG.efl_class_new(desc, bk, il[0], il[1], il[2], il[3], il[4], il[5], il[6], il[7], il[8], il[9], il[10], il[11], il[12], il[13], il[14], il[15], nul); + case 17: return EoG.efl_class_new(desc, bk, il[0], il[1], il[2], il[3], il[4], il[5], il[6], il[7], il[8], il[9], il[10], il[11], il[12], il[13], il[14], il[15], il[16], nul); + case 18: return EoG.efl_class_new(desc, bk, il[0], il[1], il[2], il[3], il[4], il[5], il[6], il[7], il[8], il[9], il[10], il[11], il[12], il[13], il[14], il[15], il[16], il[17], nul); + case 19: return EoG.efl_class_new(desc, bk, il[0], il[1], il[2], il[3], il[4], il[5], il[6], il[7], il[8], il[9], il[10], il[11], il[12], il[13], il[14], il[15], il[16], il[17], il[18], nul); + case 20: return EoG.efl_class_new(desc, bk, il[0], il[1], il[2], il[3], il[4], il[5], il[6], il[7], il[8], il[9], il[10], il[11], il[12], il[13], il[14], il[15], il[16], il[17], il[18], il[19], nul); + case 21: return EoG.efl_class_new(desc, bk, il[0], il[1], il[2], il[3], il[4], il[5], il[6], il[7], il[8], il[9], il[10], il[11], il[12], il[13], il[14], il[15], il[16], il[17], il[18], il[19], il[20], nul); + case 22: return EoG.efl_class_new(desc, bk, il[0], il[1], il[2], il[3], il[4], il[5], il[6], il[7], il[8], il[9], il[10], il[11], il[12], il[13], il[14], il[15], il[16], il[17], il[18], il[19], il[20], il[21], nul); + case 23: return EoG.efl_class_new(desc, bk, il[0], il[1], il[2], il[3], il[4], il[5], il[6], il[7], il[8], il[9], il[10], il[11], il[12], il[13], il[14], il[15], il[16], il[17], il[18], il[19], il[20], il[21], il[22], nul); + case 24: return EoG.efl_class_new(desc, bk, il[0], il[1], il[2], il[3], il[4], il[5], il[6], il[7], il[8], il[9], il[10], il[11], il[12], il[13], il[14], il[15], il[16], il[17], il[18], il[19], il[20], il[21], il[22], il[23], nul); + case 25: return EoG.efl_class_new(desc, bk, il[0], il[1], il[2], il[3], il[4], il[5], il[6], il[7], il[8], il[9], il[10], il[11], il[12], il[13], il[14], il[15], il[16], il[17], il[18], il[19], il[20], il[21], il[22], il[23], il[24], nul); + case 26: return EoG.efl_class_new(desc, bk, il[0], il[1], il[2], il[3], il[4], il[5], il[6], il[7], il[8], il[9], il[10], il[11], il[12], il[13], il[14], il[15], il[16], il[17], il[18], il[19], il[20], il[21], il[22], il[23], il[24], il[25], nul); + case 27: return EoG.efl_class_new(desc, bk, il[0], il[1], il[2], il[3], il[4], il[5], il[6], il[7], il[8], il[9], il[10], il[11], il[12], il[13], il[14], il[15], il[16], il[17], il[18], il[19], il[20], il[21], il[22], il[23], il[24], il[25], il[26], nul); + case 28: return EoG.efl_class_new(desc, bk, il[0], il[1], il[2], il[3], il[4], il[5], il[6], il[7], il[8], il[9], il[10], il[11], il[12], il[13], il[14], il[15], il[16], il[17], il[18], il[19], il[20], il[21], il[22], il[23], il[24], il[25], il[26], il[27], nul); + case 29: return EoG.efl_class_new(desc, bk, il[0], il[1], il[2], il[3], il[4], il[5], il[6], il[7], il[8], il[9], il[10], il[11], il[12], il[13], il[14], il[15], il[16], il[17], il[18], il[19], il[20], il[21], il[22], il[23], il[24], il[25], il[26], il[27], il[28], nul); + case 30: return EoG.efl_class_new(desc, bk, il[0], il[1], il[2], il[3], il[4], il[5], il[6], il[7], il[8], il[9], il[10], il[11], il[12], il[13], il[14], il[15], il[16], il[17], il[18], il[19], il[20], il[21], il[22], il[23], il[24], il[25], il[26], il[27], il[28], il[29], nul); + case 31: return EoG.efl_class_new(desc, bk, il[0], il[1], il[2], il[3], il[4], il[5], il[6], il[7], il[8], il[9], il[10], il[11], il[12], il[13], il[14], il[15], il[16], il[17], il[18], il[19], il[20], il[21], il[22], il[23], il[24], il[25], il[26], il[27], il[28], il[29], il[30], nul); + case 32: return EoG.efl_class_new(desc, bk, il[0], il[1], il[2], il[3], il[4], il[5], il[6], il[7], il[8], il[9], il[10], il[11], il[12], il[13], il[14], il[15], il[16], il[17], il[18], il[19], il[20], il[21], il[22], il[23], il[24], il[25], il[26], il[27], il[28], il[29], il[30], il[31], nul); + case 33: return EoG.efl_class_new(desc, bk, il[0], il[1], il[2], il[3], il[4], il[5], il[6], il[7], il[8], il[9], il[10], il[11], il[12], il[13], il[14], il[15], il[16], il[17], il[18], il[19], il[20], il[21], il[22], il[23], il[24], il[25], il[26], il[27], il[28], il[29], il[30], il[31], il[32], nul); + case 34: return EoG.efl_class_new(desc, bk, il[0], il[1], il[2], il[3], il[4], il[5], il[6], il[7], il[8], il[9], il[10], il[11], il[12], il[13], il[14], il[15], il[16], il[17], il[18], il[19], il[20], il[21], il[22], il[23], il[24], il[25], il[26], il[27], il[28], il[29], il[30], il[31], il[32], il[33], nul); + case 35: return EoG.efl_class_new(desc, bk, il[0], il[1], il[2], il[3], il[4], il[5], il[6], il[7], il[8], il[9], il[10], il[11], il[12], il[13], il[14], il[15], il[16], il[17], il[18], il[19], il[20], il[21], il[22], il[23], il[24], il[25], il[26], il[27], il[28], il[29], il[30], il[31], il[32], il[33], il[34], nul); + case 36: return EoG.efl_class_new(desc, bk, il[0], il[1], il[2], il[3], il[4], il[5], il[6], il[7], il[8], il[9], il[10], il[11], il[12], il[13], il[14], il[15], il[16], il[17], il[18], il[19], il[20], il[21], il[22], il[23], il[24], il[25], il[26], il[27], il[28], il[29], il[30], il[31], il[32], il[33], il[34], il[35], nul); + case 37: return EoG.efl_class_new(desc, bk, il[0], il[1], il[2], il[3], il[4], il[5], il[6], il[7], il[8], il[9], il[10], il[11], il[12], il[13], il[14], il[15], il[16], il[17], il[18], il[19], il[20], il[21], il[22], il[23], il[24], il[25], il[26], il[27], il[28], il[29], il[30], il[31], il[32], il[33], il[34], il[35], il[36], nul); + case 38: return EoG.efl_class_new(desc, bk, il[0], il[1], il[2], il[3], il[4], il[5], il[6], il[7], il[8], il[9], il[10], il[11], il[12], il[13], il[14], il[15], il[16], il[17], il[18], il[19], il[20], il[21], il[22], il[23], il[24], il[25], il[26], il[27], il[28], il[29], il[30], il[31], il[32], il[33], il[34], il[35], il[36], il[37], nul); + case 39: return EoG.efl_class_new(desc, bk, il[0], il[1], il[2], il[3], il[4], il[5], il[6], il[7], il[8], il[9], il[10], il[11], il[12], il[13], il[14], il[15], il[16], il[17], il[18], il[19], il[20], il[21], il[22], il[23], il[24], il[25], il[26], il[27], il[28], il[29], il[30], il[31], il[32], il[33], il[34], il[35], il[36], il[37], il[38], nul); + case 40: return EoG.efl_class_new(desc, bk, il[0], il[1], il[2], il[3], il[4], il[5], il[6], il[7], il[8], il[9], il[10], il[11], il[12], il[13], il[14], il[15], il[16], il[17], il[18], il[19], il[20], il[21], il[22], il[23], il[24], il[25], il[26], il[27], il[28], il[29], il[30], il[31], il[32], il[33], il[34], il[35], il[36], il[37], il[38], il[39], nul); + case 41: return EoG.efl_class_new(desc, bk, il[0], il[1], il[2], il[3], il[4], il[5], il[6], il[7], il[8], il[9], il[10], il[11], il[12], il[13], il[14], il[15], il[16], il[17], il[18], il[19], il[20], il[21], il[22], il[23], il[24], il[25], il[26], il[27], il[28], il[29], il[30], il[31], il[32], il[33], il[34], il[35], il[36], il[37], il[38], il[39], il[40], nul); + case 42: return EoG.efl_class_new(desc, bk, il[0], il[1], il[2], il[3], il[4], il[5], il[6], il[7], il[8], il[9], il[10], il[11], il[12], il[13], il[14], il[15], il[16], il[17], il[18], il[19], il[20], il[21], il[22], il[23], il[24], il[25], il[26], il[27], il[28], il[29], il[30], il[31], il[32], il[33], il[34], il[35], il[36], il[37], il[38], il[39], il[40], il[41], nul); + case 43: return EoG.efl_class_new(desc, bk, il[0], il[1], il[2], il[3], il[4], il[5], il[6], il[7], il[8], il[9], il[10], il[11], il[12], il[13], il[14], il[15], il[16], il[17], il[18], il[19], il[20], il[21], il[22], il[23], il[24], il[25], il[26], il[27], il[28], il[29], il[30], il[31], il[32], il[33], il[34], il[35], il[36], il[37], il[38], il[39], il[40], il[41], il[42], nul); + case 44: return EoG.efl_class_new(desc, bk, il[0], il[1], il[2], il[3], il[4], il[5], il[6], il[7], il[8], il[9], il[10], il[11], il[12], il[13], il[14], il[15], il[16], il[17], il[18], il[19], il[20], il[21], il[22], il[23], il[24], il[25], il[26], il[27], il[28], il[29], il[30], il[31], il[32], il[33], il[34], il[35], il[36], il[37], il[38], il[39], il[40], il[41], il[42], il[43], nul); + case 45: return EoG.efl_class_new(desc, bk, il[0], il[1], il[2], il[3], il[4], il[5], il[6], il[7], il[8], il[9], il[10], il[11], il[12], il[13], il[14], il[15], il[16], il[17], il[18], il[19], il[20], il[21], il[22], il[23], il[24], il[25], il[26], il[27], il[28], il[29], il[30], il[31], il[32], il[33], il[34], il[35], il[36], il[37], il[38], il[39], il[40], il[41], il[42], il[43], il[44], nul); + case 46: return EoG.efl_class_new(desc, bk, il[0], il[1], il[2], il[3], il[4], il[5], il[6], il[7], il[8], il[9], il[10], il[11], il[12], il[13], il[14], il[15], il[16], il[17], il[18], il[19], il[20], il[21], il[22], il[23], il[24], il[25], il[26], il[27], il[28], il[29], il[30], il[31], il[32], il[33], il[34], il[35], il[36], il[37], il[38], il[39], il[40], il[41], il[42], il[43], il[44], il[45], nul); + case 47: return EoG.efl_class_new(desc, bk, il[0], il[1], il[2], il[3], il[4], il[5], il[6], il[7], il[8], il[9], il[10], il[11], il[12], il[13], il[14], il[15], il[16], il[17], il[18], il[19], il[20], il[21], il[22], il[23], il[24], il[25], il[26], il[27], il[28], il[29], il[30], il[31], il[32], il[33], il[34], il[35], il[36], il[37], il[38], il[39], il[40], il[41], il[42], il[43], il[44], il[45], il[46], nul); + case 48: return EoG.efl_class_new(desc, bk, il[0], il[1], il[2], il[3], il[4], il[5], il[6], il[7], il[8], il[9], il[10], il[11], il[12], il[13], il[14], il[15], il[16], il[17], il[18], il[19], il[20], il[21], il[22], il[23], il[24], il[25], il[26], il[27], il[28], il[29], il[30], il[31], il[32], il[33], il[34], il[35], il[36], il[37], il[38], il[39], il[40], il[41], il[42], il[43], il[44], il[45], il[46], il[47], nul); + } + } public static IntPtr instantiate_start(IntPtr klass, Efl.Object parent) { Eina.Log.Debug($"Instantiating from klass 0x{klass.ToInt64():x}"); + Console.WriteLine($"Instantiating from klass 0x{klass.ToInt64():x}"); System.IntPtr parent_ptr = System.IntPtr.Zero; if(parent != null) parent_ptr = parent.NativeHandle; System.IntPtr eo = Efl.Eo.Globals._efl_add_internal_start("file", 0, klass, parent_ptr, 1, 0); + if (eo == System.IntPtr.Zero) + { + throw new Exception("Instantiation failed"); + } + Console.WriteLine($"Eo instance right after internal_start 0x{eo.ToInt64():x} with refcount {Efl.Eo.Globals.efl_ref_count(eo)}"); Console.WriteLine($"Parent was 0x{parent_ptr.ToInt64()}"); return eo; @@ -250,6 +493,17 @@ public static class Config } } +[System.AttributeUsage(System.AttributeTargets.Class | + System.AttributeTargets.Interface, + AllowMultiple = false, + Inherited = true) +] +public abstract class NativeClass : System.Attribute +{ + public abstract IntPtr GetEflClass(); + public abstract System.Collections.Generic.List GetEoOps(System.Type type); +} + public interface IWrapper { /// Pointer to internal Eo instance. diff --git a/src/bindings/mono/meson.build b/src/bindings/mono/meson.build index 411c29f617..b9d6879998 100644 --- a/src/bindings/mono/meson.build +++ b/src/bindings/mono/meson.build @@ -52,7 +52,6 @@ blacklisted_files = [ 'efl_object_override.eo', 'elm_web.eo', 'elm_map.eo', - 'elm_combobox.eo', 'elm_list.eo', 'elm_genlist.eo', 'elm_view_list.eo', @@ -67,6 +66,11 @@ efl_mono_lib = library('eflcustomexportsmono', dependencies : [eo, eina] ) +beta_option = [] +if (get_option('mono-beta')) + beta_option = '-b' +endif + mono_generator_target = [] mono_files = [] foreach lib : mono_sublibs @@ -88,7 +92,7 @@ foreach lib : mono_sublibs mono_generator_target += custom_target('eolian_mono_gen_'+mono_gen_file.underscorify()+'', input : join_paths(subdir_file_location, mono_gen_file), output : [mono_gen_file + '.cs'], - command : [eolian_mono_gen, '-I', meson.current_source_dir(), eolian_include_directories, + command : [eolian_mono_gen, beta_option, '-I', meson.current_source_dir(), eolian_include_directories, '--dllimport', package_name, '-o', join_paths(meson.current_build_dir(), mono_gen_file + '.cs'), '@INPUT@']) @@ -107,7 +111,7 @@ foreach mono_gen_file : legacy_evas_required_by_mono mono_generator_target += custom_target('eolian_mono_gen_'+mono_gen_file.underscorify()+'', input : join_paths(subdir_file_location, mono_gen_file), output : [mono_gen_file + '.cs'], - command : [eolian_mono_gen, '-I', meson.current_source_dir(), eolian_include_directories, + command : [eolian_mono_gen, beta_option, '-I', meson.current_source_dir(), eolian_include_directories, '--dllimport', 'evas', '-o', join_paths(meson.current_build_dir(), mono_gen_file + '.cs'), '@INPUT@']) diff --git a/src/examples/ecore/ecore_promise2_example.c b/src/examples/ecore/ecore_promise2_example.c index d10acf0450..7ddb426b1a 100644 --- a/src/examples/ecore/ecore_promise2_example.c +++ b/src/examples/ecore/ecore_promise2_example.c @@ -43,11 +43,13 @@ _timeout(void *data, const Eina_Value v, const Eina_Future *dead_future EINA_UNU return v; } -static void -_promise_cancel(void *data, const Eina_Promise *dead EINA_UNUSED) +static Eina_Value +_promise_cancel(Eo *o EINA_UNUSED, void *data, Eina_Error error) { Ctx *ctx = data; - if (ctx->timer) eina_future_cancel(ctx->timer); + + if (error == ECANCELED && ctx->timer) eina_future_cancel(ctx->timer); + return eina_value_error_init(error); } static Ctx * @@ -56,7 +58,7 @@ _promise_ctx_new(Efl_Loop *loop, Eina_Value *v) Ctx *ctx; ctx = calloc(1, sizeof(Ctx)); EINA_SAFETY_ON_NULL_GOTO(ctx, err_ctx); - ctx->p = efl_loop_promise_new(loop, ctx, _promise_cancel, NULL); + ctx->p = efl_loop_promise_new(loop, NULL); EINA_SAFETY_ON_NULL_GOTO(ctx->p, err_timer); ctx->value = v; return ctx; @@ -76,7 +78,7 @@ _future_get(Ctx *ctx, Efl_Loop *loop) EINA_SAFETY_ON_NULL_GOTO(f, err_future); ctx->timer = eina_future_then(efl_loop_timeout(loop, 0.1), _timeout, ctx); EINA_SAFETY_ON_NULL_GOTO(ctx->timer, err_timer); - return f; + return efl_future_then(loop, f, .error = _promise_cancel, .data = ctx); err_timer: eina_future_cancel(f); diff --git a/src/examples/eina/EinaError01.cs b/src/examples/eina/EinaError01.cs index 09062717c7..8fceaefb75 100644 --- a/src/examples/eina/EinaError01.cs +++ b/src/examples/eina/EinaError01.cs @@ -37,7 +37,7 @@ public class ExampleEinaError01 try { testFunc(-1, "abc"); - Eina.Error.RaiseIfOccurred(); + Eina.Error.RaiseIfUnhandledException(); } catch(Efl.EflException e) { @@ -58,7 +58,7 @@ public class ExampleEinaError01 { testFunc(42, "abc"); - Eina.Error.RaiseIfOccurred(); + Eina.Error.RaiseIfUnhandledException(); err = Eina.Error.Get(); WriteLine($"Really no error? {err == Eina.Error.NO_ERROR}."); diff --git a/src/examples/elementary/button_cxx_example_01.cc b/src/examples/elementary/button_cxx_example_01.cc index d7a9c67afd..7f85e19593 100644 --- a/src/examples/elementary/button_cxx_example_01.cc +++ b/src/examples/elementary/button_cxx_example_01.cc @@ -100,7 +100,8 @@ efl_main(void *data EINA_UNUSED, const Efl_Event *ev EINA_UNUSED) up.autorepeat_initial_timeout_set(1.0); up.autorepeat_gap_timeout_set(0.5); up.hint_weight_set(EFL_GFX_SIZE_HINT_EXPAND, 0.0); - up.hint_align_set(EFL_GFX_SIZE_HINT_FILL, 0.0); + up.hint_fill_set(true, false); + up.hint_align_set(0.5, 0.0); box.pack_end(up); auto wmid = mid._get_wref(); @@ -180,7 +181,8 @@ efl_main(void *data EINA_UNUSED, const Efl_Event *ev EINA_UNUSED) left.autorepeat_initial_timeout_set(1.0); left.autorepeat_gap_timeout_set(0.5); left.hint_weight_set(0.0, EFL_GFX_SIZE_HINT_EXPAND); - left.hint_align_set(0.0, EFL_GFX_SIZE_HINT_FILL); + left.hint_fill_set(false, true); + left.hint_align_set(0.0, 0.5); box_inferior.pack_end(left); efl::eolian::event_add(efl::ui::Clickable::repeated_event, left, btn_cursors_move); efl::eolian::event_add(efl::ui::Clickable::unpressed_event, left, btn_cursors_release); @@ -199,7 +201,8 @@ efl_main(void *data EINA_UNUSED, const Efl_Event *ev EINA_UNUSED) right.autorepeat_initial_timeout_set(1.0); right.autorepeat_gap_timeout_set(0.5); right.hint_weight_set(0.0, EFL_GFX_SIZE_HINT_EXPAND); - right.hint_align_set(0.0, EFL_GFX_SIZE_HINT_FILL); + right.hint_fill_set(false, true); + right.hint_align_set(0.0, 0.5); box_inferior.pack_end(right); efl::eolian::event_add(efl::ui::Clickable::repeated_event, right, btn_cursors_move); efl::eolian::event_add(efl::ui::Clickable::unpressed_event, right, btn_cursors_release); @@ -212,7 +215,8 @@ efl_main(void *data EINA_UNUSED, const Efl_Event *ev EINA_UNUSED) down.autorepeat_initial_timeout_set(1.0); down.autorepeat_gap_timeout_set(0.5); down.hint_weight_set(EFL_GFX_SIZE_HINT_EXPAND, 0.0); - down.hint_align_set(EFL_GFX_SIZE_HINT_FILL, 0.0); + down.hint_fill_set(true, false); + down.hint_align_set(0.5, 0.0); box.pack_end(down); efl::eolian::event_add(efl::ui::Clickable::repeated_event, down, btn_cursors_move); efl::eolian::event_add(efl::ui::Clickable::unpressed_event, down, btn_cursors_release); diff --git a/src/examples/elementary/calendar_cxx_example_04.cc b/src/examples/elementary/calendar_cxx_example_04.cc index df9a5a4f12..4e7a17fe21 100644 --- a/src/examples/elementary/calendar_cxx_example_04.cc +++ b/src/examples/elementary/calendar_cxx_example_04.cc @@ -34,7 +34,7 @@ efl_main(void *data EINA_UNUSED, const Efl_Event *ev EINA_UNUSED) ::elm::Calendar cal2(instantiate, win); //cal2.size_hint_weight_set(EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); - //cal2.size_hint_align_set(EVAS_HINT_FILL, EVAS_HINT_FILL); + //cal2.size_hint_fill_set(true, true); current_time = time(NULL) +2 * SECS_DAY; localtime_r(¤t_time, &selected_time); // cal2.selected_time_set(&selected_time); diff --git a/src/examples/elementary/efl_ui_grid_example_1.c b/src/examples/elementary/efl_ui_grid_example_1.c index 26bf850e68..257f5daf39 100644 --- a/src/examples/elementary/efl_ui_grid_example_1.c +++ b/src/examples/elementary/efl_ui_grid_example_1.c @@ -24,7 +24,7 @@ EoGenerate(const Efl_Class *klass, Eo *parent, Efl_Ui_Dir dir) Eo* obj = efl_add(klass, parent); if (dir != EFL_UI_DIR_DEFAULT) efl_ui_direction_set(obj, dir); efl_gfx_size_hint_weight_set(obj, EFL_GFX_SIZE_HINT_EXPAND, EFL_GFX_SIZE_HINT_EXPAND); - efl_gfx_size_hint_align_set(obj, EFL_GFX_SIZE_HINT_FILL, EFL_GFX_SIZE_HINT_FILL); + efl_gfx_size_hint_fill_set(obj, EINA_TRUE, EINA_TRUE); return obj; } @@ -48,7 +48,7 @@ elm_main(int argc, char **argv) Eo *btn = efl_add(EFL_UI_BUTTON_CLASS, box); efl_gfx_size_hint_weight_set(btn, 0.3, 0.3); - efl_gfx_size_hint_align_set(btn, EFL_GFX_SIZE_HINT_FILL, EFL_GFX_SIZE_HINT_FILL); + efl_gfx_size_hint_fill_set(btn, EINA_TRUE, EINA_TRUE); efl_text_set(btn, "BUTTON"); efl_pack_end(box, btn); diff --git a/src/examples/elementary/efl_ui_list_example_1.c b/src/examples/elementary/efl_ui_list_example_1.c index 432c58621c..c2bb8946dc 100644 --- a/src/examples/elementary/efl_ui_list_example_1.c +++ b/src/examples/elementary/efl_ui_list_example_1.c @@ -116,7 +116,7 @@ elm_main(int argc, char **argv) wbox = efl_add(EFL_UI_BOX_CLASS, win); efl_ui_direction_set(wbox, EFL_UI_DIR_VERTICAL); efl_gfx_size_hint_weight_set(wbox, EFL_GFX_SIZE_HINT_EXPAND, EFL_GFX_SIZE_HINT_EXPAND); - efl_gfx_size_hint_align_set(wbox, EFL_GFX_SIZE_HINT_FILL, EFL_GFX_SIZE_HINT_FILL); + efl_gfx_size_hint_fill_set(wbox, EINA_TRUE, EINA_TRUE); if ((argv[1] != NULL) && (!strcmp(argv[1], "empty"))) @@ -324,4 +324,4 @@ elm_main(int argc, char **argv) return 0; } -ELM_MAIN() \ No newline at end of file +ELM_MAIN() diff --git a/src/examples/elementary/slider_cxx_example.cc b/src/examples/elementary/slider_cxx_example.cc index 61358d2c89..90d815f9de 100644 --- a/src/examples/elementary/slider_cxx_example.cc +++ b/src/examples/elementary/slider_cxx_example.cc @@ -22,7 +22,7 @@ efl_main(void *data EINA_UNUSED, const Efl_Event *ev EINA_UNUSED) win.content_set(bx); efl::ui::Slider sl(instantiate, win); - sl.hint_align_set(EFL_GFX_SIZE_HINT_FILL, 0.5); + sl.hint_fill_set(true, false); bx.pack_end(sl); efl::ui::Slider sl2(instantiate, win); @@ -38,37 +38,37 @@ efl_main(void *data EINA_UNUSED, const Efl_Event *ev EINA_UNUSED) efl::eo::downcast(sl2.part_get("elm.swallow.end")) .content_set(ic2); - sl2.hint_align_set(EFL_GFX_SIZE_HINT_FILL, 0.5); + sl2.hint_fill_set(true, false); bx.pack_end(sl2); efl::ui::Slider sl3(instantiate, win); sl3.range_value_set(1); sl3.hint_min_set({220, 0}); - sl3.hint_align_set(EFL_GFX_SIZE_HINT_FILL, 0.5); + sl3.hint_fill_set(true, false); bx.pack_end(sl3); efl::ui::Slider sl4(instantiate, win); sl4.range_min_max_set(0, 100); - sl4.hint_align_set(EFL_GFX_SIZE_HINT_FILL, 0.5); + sl4.hint_fill_set(true, false); bx.pack_end(sl4); efl::ui::Slider sl5(instantiate, win); sl5.range_min_max_set(0, 100); sl5.range_step_set(1); sl5.direction_set(EFL_UI_DIR_UP); - sl5.hint_align_set(EFL_GFX_SIZE_HINT_FILL, 0.5); + sl5.hint_fill_set(true, false); sl5.hint_min_set({0, 120}); bx.pack_end(sl5); efl::ui::Slider sl6(instantiate, win); sl6.direction_set(EFL_UI_DIR_HORIZONTAL); sl6.range_min_max_set(0, 10); - sl6.hint_align_set(0.5, EFL_GFX_SIZE_HINT_FILL); + sl6.hint_fill_set(false, true); sl6.hint_weight_set(0, EFL_GFX_SIZE_HINT_EXPAND); bx.pack_end(sl6); efl::ui::Slider sl7(instantiate, win); - sl7.hint_align_set(EFL_GFX_SIZE_HINT_FILL, 0.5); + sl7.hint_fill_set(true, false); bx.pack_end(sl7); auto changed = std::bind ( [] (efl::ui::Slider obj) diff --git a/src/examples/elementary/spinner_cxx_example.cc b/src/examples/elementary/spinner_cxx_example.cc index 7d88436ad9..a37e24e44c 100644 --- a/src/examples/elementary/spinner_cxx_example.cc +++ b/src/examples/elementary/spinner_cxx_example.cc @@ -23,12 +23,12 @@ efl_main(void *data EINA_UNUSED, const Efl_Event *ev EINA_UNUSED) win.content_set(bx); elm::Spinner sp(instantiate, win); - sp.hint_align_set(EFL_GFX_SIZE_HINT_FILL, 0.5); + sp.hint_fill_set(true, false); bx.pack_end(sp); elm::Spinner sp2(instantiate, win); sp2.label_format_set("Percentage %%%1.2f something"); - sp2.hint_align_set(EFL_GFX_SIZE_HINT_FILL, 0.5); + sp2.hint_fill_set(true, false); bx.pack_end(sp2); elm::Spinner sp3(instantiate, win); @@ -36,18 +36,18 @@ efl_main(void *data EINA_UNUSED, const Efl_Event *ev EINA_UNUSED) sp3.step_set(1.5); sp3.wrap_set(true); sp3.min_max_set(-50.0, 250.0); - sp3.hint_align_set(EFL_GFX_SIZE_HINT_FILL, 0.5); + sp3.hint_fill_set(true, false); bx.pack_end(sp3); elm::Spinner sp4(instantiate, win); sp4.style_set("vertical"); sp4.interval_set(0.2); - sp4.hint_align_set(EFL_GFX_SIZE_HINT_FILL, 0.5); + sp4.hint_fill_set(true, false); bx.pack_end(sp4); elm::Spinner sp5(instantiate, win); sp5.editable_set(false); - sp5.hint_align_set(EFL_GFX_SIZE_HINT_FILL, 0.5); + sp5.hint_fill_set(true, false); bx.pack_end(sp5); elm::Spinner sp6(instantiate, win); @@ -65,11 +65,11 @@ efl_main(void *data EINA_UNUSED, const Efl_Event *ev EINA_UNUSED) sp6.special_value_add(10, "October"); sp6.special_value_add(11, "November"); sp6.special_value_add(12, "December"); - sp6.hint_align_set(EFL_GFX_SIZE_HINT_FILL, 0.5); + sp6.hint_fill_set(true, false); bx.pack_end(sp6); elm::Spinner sp7(instantiate, win); - sp7.hint_align_set(EFL_GFX_SIZE_HINT_FILL, 0.5); + sp7.hint_fill_set(true, false); bx.pack_end(sp7); sp7.editable_set(true); diff --git a/src/examples/elementary/toolbar_cxx_example_01.cc b/src/examples/elementary/toolbar_cxx_example_01.cc index 85fae352d7..5a884b96f7 100644 --- a/src/examples/elementary/toolbar_cxx_example_01.cc +++ b/src/examples/elementary/toolbar_cxx_example_01.cc @@ -35,7 +35,8 @@ elm_main(int argc, char* argv[]) elm::Toolbar toolbar_1(instantiate, win_1); toolbar_1.shrink_mode_set(ELM_TOOLBAR_SHRINK_MENU); toolbar_1.hint_weight_set(0, 0); - toolbar_1.hint_align_set(-1, 0); + toolbar_1.hint_align_set(0.5, 0); + toolbar_1.hint_fill_set(ture, false); toolbar_1.menu_parent_set(win_1); elm::toolbar::Item item_1 = efl::eo::downcast (toolbar_1.item_append("document-print", "Hello", nullptr, nullptr)); @@ -71,7 +72,7 @@ elm_main(int argc, char* argv[]) box_1.pack_end(toolbar_1); elm::Widget table_1(elm_table_add(win_1._eo_ptr())); table_1.hint_weight_set(0.0, 1.0); - table_1.hint_align_set(-1, -1); + table_1.hint_fill_set(true, true); table_1.visible_set(true); elm::Widget photo_1(elm_photo_add(win_1._eo_ptr())); diff --git a/src/lib/ecore/efl_app.eo b/src/lib/ecore/efl_app.eo index 303d1a6d01..860de3abc6 100644 --- a/src/lib/ecore/efl_app.eo +++ b/src/lib/ecore/efl_app.eo @@ -39,6 +39,7 @@ class Efl.App (Efl.Loop) events { pause: void; [[Called when the application is not going be displayed or otherwise used by a user for some time]] resume: void; [[Called before a window is rendered after a pause event]] + standby: void; [[Called when the application's windows are all destroyed]] terminate: void; [[Called before starting the shutdown of the application]] signal,usr1: void; [[System specific, but on unix maps to SIGUSR1 signal to the process - only called on main loop object]] signal,usr2: void; [[System specific, but on unix maps to SIGUSR2 signal to the process - only called on main loop object]] diff --git a/src/lib/ecore/efl_exe.c b/src/lib/ecore/efl_exe.c index 391916365a..a6f9f5f506 100644 --- a/src/lib/ecore/efl_exe.c +++ b/src/lib/ecore/efl_exe.c @@ -192,7 +192,6 @@ _exe_exit_eval(Eo *obj, Efl_Exe_Data *pd) { Eina_Promise *p = pd->promise; int exit_code = efl_task_exit_code_get(obj); - pd->promise = NULL; if ((exit_code != 0) && (!(efl_task_flags_get(obj) & EFL_TASK_FLAGS_NO_EXIT_CODE_ERROR))) { @@ -280,14 +279,23 @@ _cb_exe_in(void *data, const Efl_Event *event EINA_UNUSED) efl_io_writer_can_write_set(obj, EINA_TRUE); } -static void -_run_cancel_cb(void *data, Efl_Loop_Consumer *consumer EINA_UNUSED, const Eina_Promise *dead_promise EINA_UNUSED) +static Eina_Value +_run_cancel_cb(Efl_Loop_Consumer *consumer, void *data EINA_UNUSED, Eina_Error error) { - Eo *obj = data; - Efl_Exe_Data *pd = efl_data_scope_get(obj, MY_CLASS); - pd->promise = NULL; - efl_task_end(obj); + if (error == ECANCELED) efl_task_end(consumer); + + return eina_value_error_init(error); } + +static void +_run_clean_cb(Efl_Loop_Consumer *consumer EINA_UNUSED, + void *data, + const Eina_Future *dead_future EINA_UNUSED) +{ + Efl_Exe_Data *pd = data; + pd->promise = NULL; +} + #endif ////////////////////////////////////////////////////////////////////////// @@ -485,8 +493,11 @@ _efl_exe_efl_task_run(Eo *obj EINA_UNUSED, Efl_Exe_Data *pd) EFL_LOOP_HANDLER_FLAGS_READ)); _ecore_signal_pid_unlock(); pd->run = EINA_TRUE; - pd->promise = efl_loop_promise_new(obj, obj, _run_cancel_cb, NULL); - return efl_future_then(obj, eina_future_new(pd->promise)); + pd->promise = efl_loop_promise_new(obj); + return efl_future_then(obj, eina_future_new(pd->promise), + .data = pd, + .error = _run_cancel_cb, + .free = _run_clean_cb); } // this code is in the child here, and is temporary setup until we // exec() the child to replace everything. diff --git a/src/lib/ecore/efl_io_buffered_stream.c b/src/lib/ecore/efl_io_buffered_stream.c index a02b6bbb3e..53b1edaf1d 100644 --- a/src/lib/ecore/efl_io_buffered_stream.c +++ b/src/lib/ecore/efl_io_buffered_stream.c @@ -351,7 +351,7 @@ _efl_io_buffered_stream_inner_io_set(Eo *o, Efl_Io_Buffered_Stream_Data *pd, Efl EINA_SAFETY_ON_NULL_RETURN(io); EINA_SAFETY_ON_TRUE_RETURN(pd->inner_io != NULL); - pd->is_closer = efl_isa(io, EFL_IO_CLOSER_MIXIN); + pd->is_closer = efl_isa(io, EFL_IO_CLOSER_INTERFACE); is_reader = efl_isa(io, EFL_IO_READER_INTERFACE); is_writer = efl_isa(io, EFL_IO_WRITER_INTERFACE); diff --git a/src/lib/ecore/efl_io_copier.c b/src/lib/ecore/efl_io_copier.c index a03168807c..dbedfcf959 100644 --- a/src/lib/ecore/efl_io_copier.c +++ b/src/lib/ecore/efl_io_copier.c @@ -55,7 +55,7 @@ static void _efl_io_copier_read(Eo *o, Efl_Io_Copier_Data *pd); efl_ref_count(pd->source), \ efl_io_reader_can_read_get(pd->source), \ efl_io_reader_eos_get(pd->source), \ - efl_isa(pd->source, EFL_IO_CLOSER_MIXIN) ? \ + efl_isa(pd->source, EFL_IO_CLOSER_INTERFACE) ? \ efl_io_closer_closed_get(pd->source) : 0); \ if (!pd->destination) \ DBG("destination=NULL"); \ @@ -65,7 +65,7 @@ static void _efl_io_copier_read(Eo *o, Efl_Io_Copier_Data *pd); efl_class_name_get(efl_class_get(pd->destination)), \ efl_ref_count(pd->destination), \ efl_io_writer_can_write_get(pd->destination), \ - efl_isa(pd->destination, EFL_IO_CLOSER_MIXIN) ? \ + efl_isa(pd->destination, EFL_IO_CLOSER_INTERFACE) ? \ efl_io_closer_closed_get(pd->destination) : 0); \ } \ } \ @@ -418,7 +418,7 @@ _efl_io_copier_source_set(Eo *o, Efl_Io_Copier_Data *pd, Efl_Io_Reader *source) _efl_io_copier_source_resized, o); pd->progress.total = 0; } - if (efl_isa(pd->source, EFL_IO_CLOSER_MIXIN)) + if (efl_isa(pd->source, EFL_IO_CLOSER_INTERFACE)) { efl_event_callback_del(pd->source, EFL_IO_CLOSER_EVENT_CLOSED, _efl_io_copier_source_closed, o); @@ -441,7 +441,7 @@ _efl_io_copier_source_set(Eo *o, Efl_Io_Copier_Data *pd, Efl_Io_Reader *source) _efl_io_copier_source_size_apply(o, pd); } - if (efl_isa(pd->source, EFL_IO_CLOSER_MIXIN)) + if (efl_isa(pd->source, EFL_IO_CLOSER_INTERFACE)) { efl_io_closer_close_on_exec_set(pd->source, efl_io_closer_close_on_exec_get(o)); efl_io_closer_close_on_invalidate_set(pd->source, efl_io_closer_close_on_invalidate_get(o)); @@ -505,7 +505,7 @@ _efl_io_copier_destination_set(Eo *o, Efl_Io_Copier_Data *pd, Efl_Io_Writer *des if (pd->destination) { efl_event_callback_array_del(pd->destination, destination_cbs(), o); - if (efl_isa(pd->destination, EFL_IO_CLOSER_MIXIN)) + if (efl_isa(pd->destination, EFL_IO_CLOSER_INTERFACE)) { efl_event_callback_del(pd->destination, EFL_IO_CLOSER_EVENT_CLOSED, _efl_io_copier_destination_closed, o); @@ -520,7 +520,7 @@ _efl_io_copier_destination_set(Eo *o, Efl_Io_Copier_Data *pd, Efl_Io_Writer *des pd->destination = efl_ref(destination); efl_event_callback_array_add(pd->destination, destination_cbs(), o); - if (efl_isa(pd->destination, EFL_IO_CLOSER_MIXIN)) + if (efl_isa(pd->destination, EFL_IO_CLOSER_INTERFACE)) { efl_io_closer_close_on_exec_set(pd->destination, efl_io_closer_close_on_exec_get(o)); efl_io_closer_close_on_invalidate_set(pd->destination, efl_io_closer_close_on_invalidate_get(o)); @@ -656,7 +656,7 @@ _efl_io_copier_efl_io_closer_close(Eo *o, Efl_Io_Copier_Data *pd) pd->progress.total = 0; } efl_event_callback_array_del(pd->source, source_cbs(), o); - if (efl_isa(pd->source, EFL_IO_CLOSER_MIXIN) && + if (efl_isa(pd->source, EFL_IO_CLOSER_INTERFACE) && !efl_io_closer_closed_get(pd->source)) { efl_event_callback_del(pd->source, EFL_IO_CLOSER_EVENT_CLOSED, @@ -668,7 +668,7 @@ _efl_io_copier_efl_io_closer_close(Eo *o, Efl_Io_Copier_Data *pd) if (pd->destination) { efl_event_callback_array_del(pd->destination, destination_cbs(), o); - if (efl_isa(pd->destination, EFL_IO_CLOSER_MIXIN) && + if (efl_isa(pd->destination, EFL_IO_CLOSER_INTERFACE) && !efl_io_closer_closed_get(pd->destination)) { efl_event_callback_del(pd->destination, EFL_IO_CLOSER_EVENT_CLOSED, @@ -793,10 +793,10 @@ _efl_io_copier_done_get(const Eo *o, Efl_Io_Copier_Data *pd) pd->source, pd->source ? efl_class_name_get(pd->source) : "", pd->source ? efl_io_reader_eos_get(pd->source) : 1, - pd->source ? (efl_isa(pd->source, EFL_IO_CLOSER_MIXIN) ? efl_io_closer_closed_get(pd->source) : 0) : 1, + pd->source ? (efl_isa(pd->source, EFL_IO_CLOSER_INTERFACE) ? efl_io_closer_closed_get(pd->source) : 0) : 1, pd->destination, pd->destination ? efl_class_name_get(pd->destination) : "", - pd->destination ? (efl_isa(pd->destination, EFL_IO_CLOSER_MIXIN) ? efl_io_closer_closed_get(pd->destination) : 0) : 1); + pd->destination ? (efl_isa(pd->destination, EFL_IO_CLOSER_INTERFACE) ? efl_io_closer_closed_get(pd->destination) : 0) : 1); return pd->done; } @@ -896,10 +896,10 @@ _efl_io_copier_efl_io_closer_close_on_exec_set(Eo *o EINA_UNUSED, Efl_Io_Copier_ if (pd->close_on_exec == close_on_exec) return EINA_TRUE; pd->close_on_exec = close_on_exec; - if (pd->source && efl_isa(pd->source, EFL_IO_CLOSER_MIXIN)) + if (pd->source && efl_isa(pd->source, EFL_IO_CLOSER_INTERFACE)) efl_io_closer_close_on_exec_set(pd->source, close_on_exec); - if (pd->destination && efl_isa(pd->destination, EFL_IO_CLOSER_MIXIN)) + if (pd->destination && efl_isa(pd->destination, EFL_IO_CLOSER_INTERFACE)) efl_io_closer_close_on_exec_set(pd->destination, close_on_exec); return EINA_TRUE; @@ -917,10 +917,10 @@ _efl_io_copier_efl_io_closer_close_on_invalidate_set(Eo *o EINA_UNUSED, Efl_Io_C if (pd->close_on_invalidate == close_on_invalidate) return; pd->close_on_invalidate = close_on_invalidate; - if (pd->source && efl_isa(pd->source, EFL_IO_CLOSER_MIXIN)) + if (pd->source && efl_isa(pd->source, EFL_IO_CLOSER_INTERFACE)) efl_io_closer_close_on_invalidate_set(pd->source, close_on_invalidate); - if (pd->destination && efl_isa(pd->destination, EFL_IO_CLOSER_MIXIN)) + if (pd->destination && efl_isa(pd->destination, EFL_IO_CLOSER_INTERFACE)) efl_io_closer_close_on_invalidate_set(pd->destination, close_on_invalidate); } diff --git a/src/lib/ecore/efl_loop_consumer.c b/src/lib/ecore/efl_loop_consumer.c index 1c74f9741f..2b5182e6d8 100644 --- a/src/lib/ecore/efl_loop_consumer.c +++ b/src/lib/ecore/efl_loop_consumer.c @@ -50,67 +50,15 @@ _efl_loop_consumer_future_rejected(const Eo *obj, Efl_Loop_Consumer_Data *pd EIN return eina_future_rejected(efl_loop_future_scheduler_get(obj), error); } -typedef struct _Efl_Loop_Consumer_Promise Efl_Loop_Consumer_Promise; -struct _Efl_Loop_Consumer_Promise -{ - EflLoopConsumerPromiseCancel func; - Eina_Free_Cb free; - void *data; - Eo *obj; -}; - static void -_cancel_free(void *data) +_dummy_cancel(void *data EINA_UNUSED, const Eina_Promise *p EINA_UNUSED) { - Efl_Loop_Consumer_Promise *lcp = data; - - if (lcp->free) lcp->free(lcp->data); - efl_unref(lcp->obj); - free(lcp); -} - -static void -_cancel_triggered(void *data, const Eina_Promise *p) -{ - Efl_Loop_Consumer_Promise *lcp = data; - - if (lcp->func) lcp->func(lcp->data, lcp->obj, p); -} - -static void -_data_set(Eina_Promise *p, void *data) -{ - Efl_Loop_Consumer_Promise *lcp = eina_promise_data_get(p); - lcp->data = data; -} - -static void -_cancel_free_cb_set(Eina_Promise *p, Eina_Free_Cb free_cb) -{ - Efl_Loop_Consumer_Promise *lcp = eina_promise_data_get(p); - lcp->free = free_cb; } static Eina_Promise * -_efl_loop_consumer_promise_new(Eo *obj, Efl_Loop_Consumer_Data *pd EINA_UNUSED, - void *cancel_data, EflLoopConsumerPromiseCancel cancel, Eina_Free_Cb cancel_free_cb) +_efl_loop_consumer_promise_new(const Eo *obj, Efl_Loop_Consumer_Data *pd EINA_UNUSED) { - Efl_Loop_Consumer_Promise *lcp; - Eina_Promise *p; - - lcp = calloc(1, sizeof (Efl_Loop_Consumer_Promise)); - if (!lcp) return NULL; - - lcp->func = cancel; - lcp->data = cancel_data; - lcp->free = cancel_free_cb; - lcp->obj = efl_ref(obj); - - p = eina_promise_new(efl_loop_future_scheduler_get(obj), _cancel_triggered, lcp); - eina_promise_data_set_cb_set(p, _data_set); - eina_promise_data_free_cb_set_cb_set(p, _cancel_free_cb_set); - eina_promise_data_free_cb_set(p, _cancel_free); - return p; + return eina_promise_new(efl_loop_future_scheduler_get(obj), _dummy_cancel, NULL); } #include "efl_loop_consumer.eo.c" diff --git a/src/lib/ecore/efl_loop_consumer.eo b/src/lib/ecore/efl_loop_consumer.eo index b0228462d7..62534536b4 100644 --- a/src/lib/ecore/efl_loop_consumer.eo +++ b/src/lib/ecore/efl_loop_consumer.eo @@ -1,12 +1,4 @@ -function EflLoopConsumerPromiseCancel { - [[EflLoopConsumerPromiseCancel function callback called when a promise is cancelled.]] - params { - @in consumer: Efl.Loop_Consumer; [[The consumer that was used to create the promise.]] - @in dead_promise: const(ptr(Eina.Promise)); [[The promise that was just cancelled.]] - } -}; - -class Efl.Loop_Consumer (Efl.Object) +abstract Efl.Loop_Consumer (Efl.Object) { [[An Efl.Loop_Consumer is a class which requires one of the parents to provide an Efl.Loop interface when performing provider_find. It will enforce this by @@ -53,13 +45,10 @@ class Efl.Loop_Consumer (Efl.Object) } return: future; [[The future or $NULL on error.]] } - promise_new { + promise_new @const { [[Create a new promise with the scheduler coming from the loop provided by this object. Note: You should not use eina_promise_data_set as this function rely on controlling the promise data.]] - params { - cancel: EflLoopConsumerPromiseCancel; [[Callback called when the promise is being cancelled.]] - } return: ptr(Eina.Promise) @owned; [[The new promise.]] } } diff --git a/src/lib/ecore/efl_thread.c b/src/lib/ecore/efl_thread.c index 6008bbafce..8e4cd978fb 100644 --- a/src/lib/ecore/efl_thread.c +++ b/src/lib/ecore/efl_thread.c @@ -329,7 +329,6 @@ _thread_exit_eval(Eo *obj, Efl_Thread_Data *pd) { Eina_Promise *p = pd->promise; int exit_code = efl_task_exit_code_get(obj); - pd->promise = NULL; if ((exit_code != 0) && (!(efl_task_flags_get(obj) & EFL_TASK_FLAGS_NO_EXIT_CODE_ERROR))) eina_promise_reject(p, exit_code + 1000000); @@ -410,13 +409,20 @@ _cb_thread_parent_ctrl_out(void *data, const Efl_Event *event EINA_UNUSED) ////////////////////////////////////////////////////////////////////////// -static void -_run_cancel_cb(void *data, Efl_Loop_Consumer *consumer EINA_UNUSED, const Eina_Promise *dead_promise EINA_UNUSED) +static Eina_Value +_run_cancel_cb(Efl_Loop_Consumer *consumer, void *data EINA_UNUSED, Eina_Error error) { - Eo *obj = data; - Efl_Thread_Data *pd = efl_data_scope_get(obj, MY_CLASS); + if (error == ECANCELED) efl_task_end(consumer); + + return eina_value_error_init(error); +} + +static void +_run_clean_cb(Efl_Loop_Consumer *consumer EINA_UNUSED,void *data, const Eina_Future *dead_future EINA_UNUSED) +{ + Efl_Thread_Data *pd = data; + pd->promise = NULL; - efl_task_end(obj); } static void @@ -776,8 +782,9 @@ _efl_thread_efl_task_run(Eo *obj, Efl_Thread_Data *pd) } pd->thdat = thdat; pd->run = EINA_TRUE; - pd->promise = efl_loop_promise_new(obj, obj, _run_cancel_cb, NULL); - return efl_future_then(obj, eina_future_new(pd->promise)); + pd->promise = efl_loop_promise_new(obj); + return efl_future_then(obj, eina_future_new(pd->promise), + .data = pd, .error = _run_cancel_cb, .free = _run_clean_cb); } EOLIAN static void diff --git a/src/lib/ecore_audio/ecore_audio.eo b/src/lib/ecore_audio/ecore_audio.eo index 988ba007be..e2c9fb8f5f 100644 --- a/src/lib/ecore_audio/ecore_audio.eo +++ b/src/lib/ecore_audio/ecore_audio.eo @@ -12,7 +12,7 @@ enum Ecore.Audio.Format { last [[Sentinel value to indicate last enum field during iteration]] } -class Ecore.Audio (Efl.Object) +abstract Ecore.Audio (Efl.Object) { [[Convenience audio class.]] diff --git a/src/lib/ecore_audio/ecore_audio_in.eo b/src/lib/ecore_audio/ecore_audio_in.eo index d46f99d64a..43f0d7b0e4 100644 --- a/src/lib/ecore_audio/ecore_audio_in.eo +++ b/src/lib/ecore_audio/ecore_audio_in.eo @@ -44,7 +44,7 @@ class Ecore.Audio.In (Ecore.Audio) channels: int; [[The number of channels]] } } - @property preloaded @pure_virtual { + @property preloaded { [[Preloaded state of the input @since 1.8 @@ -82,7 +82,7 @@ class Ecore.Audio.In (Ecore.Audio) @since 1.8 ]] - set @pure_virtual { + set { } get { } @@ -134,7 +134,7 @@ class Ecore.Audio.In (Ecore.Audio) @in len: size; [[The amount of samples to read]] } } - seek @pure_virtual { + seek { [[Seeks within the input @since 1.8 @@ -153,6 +153,9 @@ class Ecore.Audio.In (Ecore.Audio) Efl.Object.constructor; Efl.Object.destructor; Ecore.Audio.vio_set; + @empty .length {set;} + @empty .preloaded {set; get;} + @empty .seek; } events { in,looped: void; [[Called when an input has looped.]] diff --git a/src/lib/ecore_con/efl_net_control_access_point-connman.c b/src/lib/ecore_con/efl_net_control_access_point-connman.c index 32394ab989..fdbaa413ca 100644 --- a/src/lib/ecore_con/efl_net_control_access_point-connman.c +++ b/src/lib/ecore_con/efl_net_control_access_point-connman.c @@ -726,13 +726,11 @@ static void _efl_net_control_access_point_connect_cb(void *data, const Eldbus_Message *msg, Eldbus_Pending *pending) { Eina_Promise *promise = data; - Efl_Object *o = eina_promise_data_get(promise); - Efl_Net_Control_Access_Point_Data *pd = efl_data_scope_get(o, MY_CLASS); + Efl_Net_Control_Access_Point_Data *pd = eldbus_pending_data_get(pending, ".object"); const char *err_name, *err_msg; EINA_SAFETY_ON_NULL_RETURN(pd); - pd->pending = eina_list_remove(pd->pending, pending); if (eldbus_message_error_get(msg, &err_name, &err_msg)) { Eina_Error err = EINVAL; @@ -741,7 +739,7 @@ _efl_net_control_access_point_connect_cb(void *data, const Eldbus_Message *msg, err = EINPROGRESS; else if (strcmp(err_name, "net.connman.Error.AlreadyConnected") == 0) err = EALREADY; - WRN("Could not Connect %p: %s=%s", o, err_name, err_msg); + WRN("Could not Connect: %s=%s", err_name, err_msg); eina_promise_reject(promise, err); return; @@ -750,20 +748,29 @@ _efl_net_control_access_point_connect_cb(void *data, const Eldbus_Message *msg, eina_promise_resolve(promise, EINA_VALUE_EMPTY); } -static void -_efl_net_control_access_point_connect_promise_del(void *data, Efl_Loop_Consumer *consumer EINA_UNUSED, const Eina_Promise *dead_ptr) +static Eina_Value +_efl_net_control_access_point_connect_promise_del(Efl_Loop_Consumer *consumer EINA_UNUSED, void *data, Eina_Error error) { - Eldbus_Pending *p = data; - Efl_Net_Control_Access_Point_Data *pd; + if (error == ECANCELED) + { + Eldbus_Pending *p = data; - p = eina_promise_data_get(dead_ptr); - if (!p) return; /* already gone, nothing to do */ + DBG("cancel pending connect %p", p); + eldbus_pending_cancel(p); + } + + return eina_value_error_init(error); +} + +static void +_efl_net_control_access_point_connect_promise_clean(Eo *o EINA_UNUSED, void *data, const Eina_Future *dead_future EINA_UNUSED) +{ + Efl_Net_Control_Access_Point_Data *pd; + Eldbus_Pending *p = data; pd = eldbus_pending_data_get(p, ".object"); pd->pending = eina_list_remove(pd->pending, p); - DBG("cancel pending connect %p", p); - eldbus_pending_cancel(p); } EOLIAN static Eina_Future * @@ -773,7 +780,7 @@ _efl_net_control_access_point_connect(Eo *o, Efl_Net_Control_Access_Point_Data * Eina_Promise *promise; Eina_Future *f = NULL; - promise = efl_loop_promise_new(o, o, _efl_net_control_access_point_connect_promise_del, NULL); + promise = efl_loop_promise_new(o); EINA_SAFETY_ON_NULL_RETURN_VAL(promise, NULL); f = eina_future_new(promise); @@ -785,7 +792,10 @@ _efl_net_control_access_point_connect(Eo *o, Efl_Net_Control_Access_Point_Data * pd->pending = eina_list_append(pd->pending, p); eldbus_pending_data_set(p, ".object", pd); - return efl_future_then(o, f); + return efl_future_then(o, f, + .data = p, + .error = _efl_net_control_access_point_connect_promise_del, + .free = _efl_net_control_access_point_connect_promise_clean); error_dbus: eina_promise_reject(promise, ENOSYS); diff --git a/src/lib/ecore_con/efl_net_control_technology-connman.c b/src/lib/ecore_con/efl_net_control_technology-connman.c index 2ccec1d983..9a73103e0b 100644 --- a/src/lib/ecore_con/efl_net_control_technology-connman.c +++ b/src/lib/ecore_con/efl_net_control_technology-connman.c @@ -348,15 +348,11 @@ static void _efl_net_control_technology_scan_cb(void *data, const Eldbus_Message *msg, Eldbus_Pending *pending) { Eina_Promise *promise = data; - Eo *o = eldbus_pending_data_get(eina_promise_data_get(promise), ".object"); - Efl_Net_Control_Technology_Data *pd = efl_data_scope_get(o, MY_CLASS); const char *err_name, *err_msg; - EINA_SAFETY_ON_NULL_RETURN(pd); - - pd->pending = eina_list_remove(pd->pending, pending); if (eldbus_message_error_get(msg, &err_name, &err_msg)) { + Eo *o = eldbus_pending_data_get(pending, ".object"); Eina_Error err = EINVAL; if (strcmp(err_name, "net.connman.Error.NotSupported") == 0) @@ -370,24 +366,29 @@ _efl_net_control_technology_scan_cb(void *data, const Eldbus_Message *msg, Eldbu eina_promise_resolve(promise, EINA_VALUE_EMPTY); } -static void -_efl_net_control_technology_scan_promise_del(void *data EINA_UNUSED, Efl_Loop_Consumer *consumer EINA_UNUSED, const Eina_Promise *dead_ptr) +static Eina_Value +_efl_net_control_technology_scan_promise_cancel(Eo *o EINA_UNUSED, void *data, Eina_Error error) { - Eldbus_Pending *p; + Eldbus_Pending *p = data; + + if (error == ECANCELED) + { + DBG("cancel pending scan %p", p); + eldbus_pending_cancel(p); + } + + return eina_value_error_init(error); +} + +static void +_efl_net_control_technology_scan_promise_del(Eo *o, void *data, const Eina_Future *dead_future EINA_UNUSED) +{ + Eldbus_Pending *p = data; Efl_Net_Control_Technology_Data *pd; - Eo *o; - p = eina_promise_data_get(dead_ptr); - if (!p) return; /* already gone, nothing to do */ - - o = eldbus_pending_data_get(p, ".object"); pd = efl_data_scope_get(o, MY_CLASS); - EINA_SAFETY_ON_NULL_RETURN(pd); - pd->pending = eina_list_remove(pd->pending, p); - DBG("cancel pending scan %p", p); - eldbus_pending_cancel(p); } EOLIAN static Eina_Future * @@ -397,7 +398,7 @@ _efl_net_control_technology_scan(Eo *o, Efl_Net_Control_Technology_Data *pd) Eina_Promise *promise; Eina_Future *f = NULL; - promise = efl_loop_promise_new(o, NULL, _efl_net_control_technology_scan_promise_del, NULL); + promise = efl_loop_promise_new(o); EINA_SAFETY_ON_NULL_RETURN_VAL(promise, NULL); f = eina_future_new(promise); @@ -407,10 +408,12 @@ _efl_net_control_technology_scan(Eo *o, Efl_Net_Control_Technology_Data *pd) EINA_SAFETY_ON_NULL_GOTO(p, error_dbus); pd->pending = eina_list_append(pd->pending, p); - eina_promise_data_set(promise, p); eldbus_pending_data_set(p, ".object", o); - return efl_future_then(o, f); + return efl_future_then(o, f, + .error = _efl_net_control_technology_scan_promise_cancel, + .free = _efl_net_control_technology_scan_promise_del, + .data = p); error_dbus: eina_promise_reject(promise, ENOSYS); diff --git a/src/lib/ecore_con/efl_net_server_fd.eo b/src/lib/ecore_con/efl_net_server_fd.eo index 97f192ef91..bbb25a58bf 100644 --- a/src/lib/ecore_con/efl_net_server_fd.eo +++ b/src/lib/ecore_con/efl_net_server_fd.eo @@ -1,4 +1,4 @@ -class Efl.Net.Server_Fd (Efl.Loop_Fd, Efl.Net.Server) { +abstract Efl.Net.Server_Fd (Efl.Loop_Fd, Efl.Net.Server) { [[A generic server based on file descriptors. @since 1.19 diff --git a/src/lib/ecore_drm2/ecore_drm2_fb.c b/src/lib/ecore_drm2/ecore_drm2_fb.c index 4e26fd765a..33c0e27570 100644 --- a/src/lib/ecore_drm2/ecore_drm2_fb.c +++ b/src/lib/ecore_drm2/ecore_drm2_fb.c @@ -411,7 +411,7 @@ _fb_atomic_flip_test(Ecore_Drm2_Output *output) } ret = - sym_drmModeAtomicCommit(output->fd, req, flags, NULL); + sym_drmModeAtomicCommit(output->fd, req, flags, output); if (ret < 0) goto err; /* clear any previous request */ @@ -447,7 +447,7 @@ _fb_atomic_flip(Ecore_Drm2_Output *output) res = sym_drmModeAtomicCommit(output->fd, output->prep.atomic_req, flags, - output->user_data); + output); if (res < 0) { ERR("Failed Atomic Commit: %m"); @@ -499,7 +499,7 @@ _fb_flip(Ecore_Drm2_Output *output) static Eina_Bool bugged_about_bug = EINA_FALSE; repeat = EINA_FALSE; ret = sym_drmModePageFlip(fb->fd, output->crtc_id, fb->id, - DRM_MODE_PAGE_FLIP_EVENT, output->user_data); + DRM_MODE_PAGE_FLIP_EVENT, output); /* Some drivers (RPI - looking at you) are broken and produce * flip events before they are ready for another flip, so be * a little robust in the face of badness and try a few times diff --git a/src/lib/ecore_drm2/ecore_drm2_outputs.c b/src/lib/ecore_drm2/ecore_drm2_outputs.c index e39f26a6da..8cebea513b 100644 --- a/src/lib/ecore_drm2/ecore_drm2_outputs.c +++ b/src/lib/ecore_drm2/ecore_drm2_outputs.c @@ -1291,7 +1291,7 @@ _output_mode_atomic_set(Ecore_Drm2_Output *output, Ecore_Drm2_Output_Mode *mode) } ret = sym_drmModeAtomicCommit(output->fd, req, DRM_MODE_ATOMIC_ALLOW_MODESET, - output->user_data); + output); if (ret < 0) { ERR("Failed to commit atomic Mode: %m"); @@ -1538,7 +1538,7 @@ ecore_drm2_output_rotation_set(Ecore_Drm2_Output *output, int rotation) if (res < 0) goto err; res = sym_drmModeAtomicCommit(output->fd, req, flags, - output->user_data); + output); if (res < 0) goto err; else @@ -1609,29 +1609,29 @@ _blanktime_fallback(Ecore_Drm2_Output *output, int sequence, long *sec, long *us EAPI Eina_Bool ecore_drm2_output_blanktime_get(Ecore_Drm2_Output *output, int sequence, long *sec, long *usec) { - drmVBlank v; - int ret; - Eina_Bool success; + drmVBlank v; + int ret; + Eina_Bool success; - EINA_SAFETY_ON_NULL_RETURN_VAL(output, EINA_FALSE); - EINA_SAFETY_ON_NULL_RETURN_VAL(sec, EINA_FALSE); - EINA_SAFETY_ON_NULL_RETURN_VAL(usec, EINA_FALSE); + EINA_SAFETY_ON_NULL_RETURN_VAL(output, EINA_FALSE); + EINA_SAFETY_ON_NULL_RETURN_VAL(sec, EINA_FALSE); + EINA_SAFETY_ON_NULL_RETURN_VAL(usec, EINA_FALSE); - memset(&v, 0, sizeof(v)); - v.request.type = DRM_VBLANK_RELATIVE; - v.request.sequence = sequence; - ret = sym_drmWaitVBlank(output->fd, &v); - success = (ret == 0) && (v.reply.tval_sec > 0 || v.reply.tval_usec > 0); - if (!success) - { - ret = _blanktime_fallback(output, sequence, sec, usec); - if (ret) return EINA_FALSE; - return EINA_TRUE; - } + memset(&v, 0, sizeof(v)); + v.request.type = DRM_VBLANK_RELATIVE; + v.request.sequence = sequence; + ret = sym_drmWaitVBlank(output->fd, &v); + success = (ret == 0) && (v.reply.tval_sec > 0 || v.reply.tval_usec > 0); + if (!success) + { + ret = _blanktime_fallback(output, sequence, sec, usec); + if (ret) return EINA_FALSE; + return EINA_TRUE; + } - *sec = v.reply.tval_sec; - *usec = v.reply.tval_usec; - return EINA_TRUE; + *sec = v.reply.tval_sec; + *usec = v.reply.tval_usec; + return EINA_TRUE; } EAPI void diff --git a/src/lib/ecore_evas/ecore_evas.c b/src/lib/ecore_evas/ecore_evas.c index 14c3792036..cbd3107fa3 100644 --- a/src/lib/ecore_evas/ecore_evas.c +++ b/src/lib/ecore_evas/ecore_evas.c @@ -5172,14 +5172,14 @@ EAPI void _ecore_evas_mouse_inout_set(Ecore_Evas *ee, Efl_Input_Device *mouse, Eina_Bool in, Eina_Bool force_out) { - Efl_Input_Device *present; + Eina_List *present; if (!mouse) mouse = evas_default_device_get(ee->evas, EFL_INPUT_DEVICE_TYPE_MOUSE);; EINA_SAFETY_ON_NULL_RETURN(mouse); - present = eina_list_data_find(ee->mice_in, mouse); + present = eina_list_data_find_list(ee->mice_in, mouse); if (in) { @@ -5191,7 +5191,7 @@ _ecore_evas_mouse_inout_set(Ecore_Evas *ee, Efl_Input_Device *mouse, } else { - if (present) ee->mice_in = eina_list_remove(ee->mice_in, mouse); + if (present) ee->mice_in = eina_list_remove_list(ee->mice_in, present); else if (!present && !force_out) return; efl_event_callback_del(mouse, EFL_EVENT_DEL, _ecore_evas_mouse_del_cb, ee); diff --git a/src/lib/ecore_wl2/ecore_wl2_private.h b/src/lib/ecore_wl2/ecore_wl2_private.h index 1ac9b44808..e62ea5f8ea 100644 --- a/src/lib/ecore_wl2/ecore_wl2_private.h +++ b/src/lib/ecore_wl2/ecore_wl2_private.h @@ -147,6 +147,7 @@ struct _Ecore_Wl2_Aux_Hint struct _Ecore_Wl2_Frame_Cb_Handle { + EINA_INLIST; Ecore_Wl2_Window *win; Ecore_Wl2_Frame_Cb cb; void *data; @@ -221,7 +222,7 @@ struct _Ecore_Wl2_Window Eina_Inlist *subsurfs; Eina_List *supported_aux_hints; - Eina_List *frame_callbacks; + Eina_Inlist *frame_callbacks; Eina_List *outputs; diff --git a/src/lib/ecore_wl2/ecore_wl2_window.c b/src/lib/ecore_wl2/ecore_wl2_window.c index 0a61e596ab..71c74f3284 100644 --- a/src/lib/ecore_wl2/ecore_wl2_window.c +++ b/src/lib/ecore_wl2/ecore_wl2_window.c @@ -1418,13 +1418,13 @@ _frame_cb(void *data, struct wl_callback *callback, uint32_t timestamp) { Ecore_Wl2_Frame_Cb_Handle *cb; Ecore_Wl2_Window *window; - Eina_List *l, *ll; + Eina_Inlist *l; window = data; window->commit_pending = EINA_FALSE; wl_callback_destroy(callback); window->callback = NULL; - EINA_LIST_FOREACH_SAFE(window->frame_callbacks, l, ll, cb) + EINA_INLIST_FOREACH_SAFE(window->frame_callbacks, l, cb) cb->cb(window, timestamp, cb->data); } @@ -1652,7 +1652,7 @@ ecore_wl2_window_frame_callback_add(Ecore_Wl2_Window *window, Ecore_Wl2_Frame_Cb callback->data = data; callback->win = window; window->frame_callbacks = - eina_list_append(window->frame_callbacks, callback); + eina_inlist_append(window->frame_callbacks, EINA_INLIST_GET(callback)); return callback; } @@ -1662,7 +1662,7 @@ ecore_wl2_window_frame_callback_del(Ecore_Wl2_Frame_Cb_Handle *handle) EINA_SAFETY_ON_NULL_RETURN(handle); handle->win->frame_callbacks = - eina_list_remove(handle->win->frame_callbacks, handle); + eina_inlist_remove(handle->win->frame_callbacks, EINA_INLIST_GET(handle)); free(handle); } diff --git a/src/lib/ector/gl/ector_gl_buffer.eo b/src/lib/ector/gl/ector_gl_buffer.eo index 03171eac8c..872ee2b4b5 100644 --- a/src/lib/ector/gl/ector_gl_buffer.eo +++ b/src/lib/ector/gl/ector_gl_buffer.eo @@ -1,4 +1,4 @@ -class Ector.GL.Buffer (Efl.Object, Ector.Buffer) +class Ector.GL.Buffer extends Efl.Object implements Ector.Buffer { [[Ector GL buffer class]] data: null; diff --git a/src/lib/ector/software/ector_renderer_software.eo b/src/lib/ector/software/ector_renderer_software.eo index 46251e3a4b..09faabfbe0 100644 --- a/src/lib/ector/software/ector_renderer_software.eo +++ b/src/lib/ector/software/ector_renderer_software.eo @@ -1,4 +1,4 @@ -class Ector.Renderer.Software (Ector.Renderer) +abstract Ector.Renderer.Software (Ector.Renderer) { [[Ector software renderer class]] data: null; diff --git a/src/lib/edje/edje_load.c b/src/lib/edje/edje_load.c index e08ec4edb8..f5f1aa8bda 100644 --- a/src/lib/edje/edje_load.c +++ b/src/lib/edje/edje_load.c @@ -2122,7 +2122,6 @@ _edje_file_del(Edje *ed) EINA_LIST_FREE(ed->actions, runp) free(runp); } - _edje_animators = eina_list_remove(_edje_animators, ed); efl_event_callback_del(ed->obj, EFL_EVENT_ANIMATOR_TICK, _edje_timer_cb, ed); ecore_animator_del(ed->animator); ed->animator = NULL; diff --git a/src/lib/edje/edje_private.h b/src/lib/edje/edje_private.h index 42bbfb25ca..c555bd3be6 100644 --- a/src/lib/edje/edje_private.h +++ b/src/lib/edje/edje_private.h @@ -2458,7 +2458,6 @@ EAPI void _edje_edd_shutdown(void); EAPI extern Eet_Data_Descriptor *_edje_edd_edje_file; EAPI extern Eet_Data_Descriptor *_edje_edd_edje_part_collection; -extern Eina_List *_edje_animators; extern Eina_Inlist *_edje_edjes; extern char *_edje_fontset_append; diff --git a/src/lib/edje/edje_program.c b/src/lib/edje/edje_program.c index 35961159bb..b781a4b3fa 100644 --- a/src/lib/edje/edje_program.c +++ b/src/lib/edje/edje_program.c @@ -4,7 +4,6 @@ static void _edje_emit_cb(Edje *ed, const char *sig, const char *src, Edje_Messa static void _edje_param_copy(Edje *ed, Edje_Real_Part *src_part, const char *src_param, Edje_Real_Part *dst_part, const char *dst_param); static void _edje_param_set(Edje *ed, Edje_Real_Part *part, const char *param, const char *value); -Eina_List *_edje_animators = NULL; static double _edje_transition_duration_scale = 0; static Eina_Bool diff --git a/src/lib/efl/interfaces/efl_gfx_size_hint.eo b/src/lib/efl/interfaces/efl_gfx_size_hint.eo index 4fa45eefc4..711ff6e817 100644 --- a/src/lib/efl/interfaces/efl_gfx_size_hint.eo +++ b/src/lib/efl/interfaces/efl_gfx_size_hint.eo @@ -3,8 +3,6 @@ import efl_gfx_types; const Efl.Gfx.Size_Hint_Expand: double = 1.0; [[Use with @Efl.Gfx.Size_Hint.hint_weight.]] -const Efl.Gfx.Size_Hint_Fill: double = -1.0; - [[Special value for @Efl.Gfx.Size_Hint.hint_align.]] interface Efl.Gfx.Size_Hint { @@ -203,16 +201,7 @@ interface Efl.Gfx.Size_Hint These are hints on how to align an object inside the boundaries of a container/manager. Accepted values are in - the 0.0 to 1.0 range, with the special value @Efl.Gfx.Size_Hint_Fill - used to specify "justify" or "fill" by some users. In this - case, maximum size hints should be enforced with higher - priority, if they are set. Also, any padding hint set on - objects should add up to the alignment space on the final - scene composition. - - See documentation of possible users: in Evas, they are the - @Efl.Ui.Box "box" and @Efl.Ui.Table "table" - smart objects. + the 0.0 to 1.0 range. For the horizontal component, 0.0 means to the left, 1.0 means to the right. Analogously, for the vertical component, @@ -227,10 +216,33 @@ interface Efl.Gfx.Size_Hint @image html alignment-hints.png */ values { - x: double; [[Double, ranging from 0.0 to 1.0 or with the special value - @Efl.Gfx.Size_Hint_Fill, to use as horizontal alignment hint.]] - y: double; [[Double, ranging from 0.0 to 1.0 or with the special value - @Efl.Gfx.Size_Hint_Fill, to use as vertical alignment hint.]] + x: double; [[Double, ranging from 0.0 to 1.0.]] + y: double; [[Double, ranging from 0.0 to 1.0.]] + } + } + @property hint_fill { + [[Hints for an object's fill property that used to specify "justify" + or "fill" by some users. @.hint_fill specify whether to fill + the space inside the boundaries of a container/manager. + + Maximum size hints should be enforced with higher + priority, if they are set. Also, any @.hint_margin set on + objects should add up to the object space on the final + scene composition. + + See documentation of possible users: in Evas, they are the + @Efl.Ui.Box "box" and @Efl.Ui.Table "table" smart objects. + + This is not a size enforcement in any way, it's just a hint + that should be used whenever appropriate. + + Note: Default fill hint values are true, for both axes. + ]] + values { + x: bool; [[$true if to fill the object space, $false otherwise, + to use as horizontal fill hint.]] + y: bool; [[$true if to fill the object space, $false otherwise, + to use as vertical fill hint.]] } } } diff --git a/src/lib/efl/interfaces/efl_io_closer.c b/src/lib/efl/interfaces/efl_io_closer.c index 55b27f7b4d..1e93faf645 100644 --- a/src/lib/efl/interfaces/efl_io_closer.c +++ b/src/lib/efl/interfaces/efl_io_closer.c @@ -1,13 +1,4 @@ #include "config.h" #include "Efl.h" -EOLIAN static Eina_Bool -_efl_io_closer_closed_set(Eo *obj, void *pd EINA_UNUSED, Eina_Bool is_closed) -{ - if (is_closed) - return efl_io_closer_close(obj) == 0; - - return EINA_FALSE; -} - #include "interfaces/efl_io_closer.eo.c" diff --git a/src/lib/efl/interfaces/efl_io_closer.eo b/src/lib/efl/interfaces/efl_io_closer.eo index b7a6684fb6..2ba4323085 100644 --- a/src/lib/efl/interfaces/efl_io_closer.eo +++ b/src/lib/efl/interfaces/efl_io_closer.eo @@ -1,6 +1,6 @@ import eina_types; -mixin Efl.Io.Closer { +interface Efl.Io.Closer { [[Generic interface for objects that can close themselves. This interface allows external objects to transparently close an @@ -12,10 +12,8 @@ mixin Efl.Io.Closer { @since 1.19 ]] - data: null; - methods { - close @pure_virtual { + close { [[Closes the Input/Output object. This operation will be executed immediately and may or @@ -32,11 +30,7 @@ mixin Efl.Io.Closer { @property closed { [[If true will notify object was closed.]] - get @pure_virtual { } - set { - [[If true, calls close()]] - return: bool; [[$true if could close, $false if already closed or errors.]] - } + get { } values { is_closed: bool; [[$true if closed, $false otherwise]] } @@ -49,8 +43,8 @@ mixin Efl.Io.Closer { so they are not inherited by the processes (children or self) doing exec(). ]] - get @pure_virtual { } - set @pure_virtual { + get { } + set { [[If $true, will close on exec() call.]] return: bool; [[$true if could set, $false if not supported or failed.]] } @@ -65,8 +59,8 @@ mixin Efl.Io.Closer { If the object was disconnected from its parent (including the main loop) without close, this property will state whenever it should be closed or not. ]] - get @pure_virtual { } - set @pure_virtual { } + get { } + set { } values { close_on_invalidate: bool; [[$true if close on invalidate, $false otherwise]] } diff --git a/src/lib/efl/interfaces/efl_observer.eo b/src/lib/efl/interfaces/efl_observer.eo index c76503fac2..38764f843d 100644 --- a/src/lib/efl/interfaces/efl_observer.eo +++ b/src/lib/efl/interfaces/efl_observer.eo @@ -1,7 +1,7 @@ interface Efl.Observer { [[Efl observer interface]] methods { - update @pure_virtual { + update { [[Update observer according to the changes of observable object. @since 1.19]] diff --git a/src/lib/eina/eina_internal.h b/src/lib/eina/eina_internal.h index 9ae14df76b..e501bd17b5 100644 --- a/src/lib/eina/eina_internal.h +++ b/src/lib/eina/eina_internal.h @@ -42,6 +42,7 @@ #endif #include "eina_prefix.h" +#include "eina_promise.h" typedef struct _Eina_Vpath_Interface_User Eina_Vpath_Interface_User; @@ -99,7 +100,6 @@ EAPI void eina_vpath_interface_app_set(const char *app_name, Eina_Prefix *p); */ EAPI void eina_vpath_interface_user_set(Eina_Vpath_Interface_User *user); - void eina_xdg_env_init(void); #undef EAPI diff --git a/src/lib/eina/eina_promise.c b/src/lib/eina/eina_promise.c index aa5ced8ab2..1937c17d90 100644 --- a/src/lib/eina/eina_promise.c +++ b/src/lib/eina/eina_promise.c @@ -103,9 +103,6 @@ struct _Eina_Promise { Eina_Future *future; Eina_Future_Scheduler *scheduler; Eina_Promise_Cancel_Cb cancel; - Eina_Promise_Data_Set_Cb data_set_cb; - Eina_Promise_Data_Free_Cb_Set_Cb data_free_cb_set_cb; - Eina_Free_Cb free_cb; const void *data; }; @@ -308,20 +305,13 @@ _eina_promise_link(Eina_Promise *p, Eina_Future *f) DBG("Linking future %p with promise %p", f, p); } -static void -_eina_promise_free(Eina_Promise *p) -{ - if (p->free_cb) p->free_cb((void*) p->data); - eina_mempool_free(_promise_mp, p); -} - static void _eina_promise_cancel(Eina_Promise *p) { DBG("Cancelling promise: %p, data: %p, future: %p", p, p->data, p->future); _eina_promise_unlink(p); p->cancel((void *)p->data, p); - _eina_promise_free(p); + eina_mempool_free(_promise_mp, p); } static void @@ -526,7 +516,7 @@ _eina_promise_deliver(Eina_Promise *p, DBG("Promise %p has no future", p); eina_value_flush(&value); } - _eina_promise_free(p); + eina_mempool_free(_promise_mp, p); } Eina_Bool @@ -645,7 +635,7 @@ _eina_promise_clean_dispatch(Eina_Promise *p, Eina_Value v) // This function is called on a promise created with a scheduler, not a continue one. _eina_future_dispatch(p->scheduler, f, v); } - _eina_promise_free(p); + eina_mempool_free(_promise_mp, p); } static Eina_Value @@ -1106,59 +1096,6 @@ eina_future_cb_convert_to(const Eina_Value_Type *type) return (Eina_Future_Desc){.cb = _eina_future_cb_convert_to, .data = type}; } -EAPI void * -eina_promise_data_get(const Eina_Promise *p) -{ - EINA_SAFETY_ON_NULL_RETURN_VAL(p, NULL); - return (void *)p->data; -} - -EAPI void -eina_promise_data_set(Eina_Promise *p, - void *data) -{ - EINA_SAFETY_ON_NULL_RETURN(p); - if (p->data_set_cb) - { - Eina_Promise_Data_Set_Cb cb = p->data_set_cb; - p->data_set_cb = NULL; - cb(p, data); - p->data_set_cb = cb; - } - else p->data = data; -} - -EAPI void -eina_promise_data_free_cb_set(Eina_Promise *p, - Eina_Free_Cb free_cb) -{ - EINA_SAFETY_ON_NULL_RETURN(p); - if (p->data_free_cb_set_cb) - { - Eina_Promise_Data_Free_Cb_Set_Cb cb = p->data_free_cb_set_cb; - p->data_free_cb_set_cb = NULL; - cb(p, free_cb); - p->data_free_cb_set_cb = cb; - } - else p->free_cb = free_cb; -} - -EAPI void -eina_promise_data_set_cb_set(Eina_Promise *p, - Eina_Promise_Data_Set_Cb data_set_cb) -{ - EINA_SAFETY_ON_NULL_RETURN(p); - p->data_set_cb = data_set_cb; -} - -EAPI void -eina_promise_data_free_cb_set_cb_set(Eina_Promise *p, - Eina_Promise_Data_Free_Cb_Set_Cb data_free_cb_set_cb) -{ - EINA_SAFETY_ON_NULL_RETURN(p); - p->data_free_cb_set_cb = data_free_cb_set_cb; -} - static Eina_Value _eina_future_cb_easy(void *data, const Eina_Value value, const Eina_Future *dead_future) diff --git a/src/lib/eina/eina_promise.h b/src/lib/eina/eina_promise.h index 060d8dccf8..428da12afa 100644 --- a/src/lib/eina/eina_promise.h +++ b/src/lib/eina/eina_promise.h @@ -187,26 +187,6 @@ struct _Eina_Future_Scheduler { */ typedef void (*Eina_Promise_Cancel_Cb) (void *data, const Eina_Promise *dead_promise); -/* - * @typedef Eina_Promise_Data_Set_Cb Eina_Promise_Data_Set_Cb. - * @ingroup eina_promise - * - * A callback used to intercept eina_promise_data_set(). - * - * Used internally by EFL - please do not use. - */ -typedef void (*Eina_Promise_Data_Set_Cb) (Eina_Promise *p, void *data); - -/* - * @typedef Eina_Promise_Data_Free_Cb_Set_Cb Eina_Promise_Data_Free_Cb_Set_Cb. - * @ingroup eina_promise - * - * A callback used to intercept eina_promise_data_set_cb_set(). - * - * Used internally by EFL - please do not use. - */ -typedef void (*Eina_Promise_Data_Free_Cb_Set_Cb) (Eina_Promise *p, Eina_Free_Cb free_cb); - /** * @typedef Eina_Future_Success_Cb Eina_Future_Success_Cb. * @ingroup eina_future @@ -555,7 +535,6 @@ struct _Eina_Future_Desc { * @see eina_promise_continue_new() * @see eina_promise_resolve() * @see eina_promise_reject() - * @see eina_promise_data_get() * @see eina_promise_as_value() * @see #Eina_Future_Scheduler * @see #Eina_Future_Scheduler_Entry @@ -622,7 +601,6 @@ EAPI Eina_Promise *eina_promise_new(Eina_Future_Scheduler *scheduler, Eina_Promi * @see eina_promise_new() * @see eina_promise_resolve() * @see eina_promise_reject() - * @see eina_promise_data_get() * @see eina_promise_as_value() * @see #Eina_Future_Scheduler * @see #Eina_Future_Scheduler_Entry @@ -630,54 +608,6 @@ EAPI Eina_Promise *eina_promise_new(Eina_Future_Scheduler *scheduler, Eina_Promi */ EAPI Eina_Promise *eina_promise_continue_new(const Eina_Future *dead_future, Eina_Promise_Cancel_Cb cancel_cb, const void *data) EINA_ARG_NONNULL(1, 2) EINA_WARN_UNUSED_RESULT; -/** - * Gets the data attached to the promise. - * - * @return The data passed to eina_promise_new() or @c NULL on error. - * @see eina_promise_new() - * @see eina_promise_data_set() - */ -EAPI void *eina_promise_data_get(const Eina_Promise *p) EINA_ARG_NONNULL(1); - -/** - * Sets the data attached to the promise. - * - * Set the data passed to eina_promise_new(). - * @see eina_promise_new() - * @see eina_promise_data_get() - */ -EAPI void eina_promise_data_set(Eina_Promise *p, void *data) EINA_ARG_NONNULL(1); - -/** - * Sets the free callback used when the data attached on the promise is freed just before the destruction of the promise itself. - * - * @param[in] p The promise to set the free callback on. - * @param[in] free_cb The free callback. - */ -EAPI void eina_promise_data_free_cb_set(Eina_Promise *p, Eina_Free_Cb free_cb); - -/** - * Sets a data set intercept function that can alter the behavior of - * eina_promise_data_set(). Please do not use this as it is only used - * internally inside EFL and may be used to slightly alter a promise - * behavior and if used on these promises may remove EFL's override - * - * @param[in] p The promise to set the data set callback on - * @param[in] data_set_cb The callabck to intercept the data set - */ -EAPI void eina_promise_data_set_cb_set(Eina_Promise *p, Eina_Promise_Data_Set_Cb data_set_cb); - -/** - * Sets a data free cb set intercept function that can alter the behavior of - * eina_promise_data_free_cb_set(). Please do not use this as it is only used - * internally inside EFL and may be used to slightly alter a promise - * behavior and if used on these promises may remove EFL's override - * - * @param[in] p The promise to set the data set callback on - * @param[in] data_free_cb_set_cb The callabck to intercept the data free cb set - */ -EAPI void eina_promise_data_free_cb_set_cb_set(Eina_Promise *p, Eina_Promise_Data_Free_Cb_Set_Cb data_free_cb_set_cb); - /** * Resolves a promise. * @@ -696,7 +626,6 @@ EAPI void eina_promise_data_free_cb_set_cb_set(Eina_Promise *p, Eina_Promise_Dat * * @see eina_promise_new() * @see eina_promise_reject() - * @see eina_promise_data_get() * @see eina_promise_as_value() */ EAPI void eina_promise_resolve(Eina_Promise *p, Eina_Value value) EINA_ARG_NONNULL(1); @@ -714,7 +643,6 @@ EAPI void eina_promise_resolve(Eina_Promise *p, Eina_Value value) EINA_ARG_NONNU * * @see eina_promise_new() * @see eina_promise_resolve() - * @see eina_promise_data_get() * @see eina_promise_as_value() */ EAPI void eina_promise_reject(Eina_Promise *p, Eina_Error err) EINA_ARG_NONNULL(1); diff --git a/src/lib/eina/eina_value.h b/src/lib/eina/eina_value.h index b3a702456e..faca4bfde1 100644 --- a/src/lib/eina/eina_value.h +++ b/src/lib/eina/eina_value.h @@ -724,7 +724,7 @@ static inline Eina_Bool eina_value_setup(Eina_Value *value, const Eina_Value_Type *type) EINA_ARG_NONNULL(1, 2); /** - * @brief Creates generic value storage. + * @brief Empties a generic value storage. * * @param[in] value Value object * diff --git a/src/lib/eio/efl_io_manager.c b/src/lib/eio/efl_io_manager.c index 9dcdfeeedf..3509bc6a63 100644 --- a/src/lib/eio/efl_io_manager.c +++ b/src/lib/eio/efl_io_manager.c @@ -119,7 +119,7 @@ _efl_io_manager_direct_ls(const Eo *obj, Eina_Future *future; Eio_File *h; - p = eina_promise_new(efl_loop_future_scheduler_get(obj), _efl_io_manager_future_cancel, NULL); + p = efl_loop_promise_new(obj); if (!p) return NULL; future = eina_future_new(p); @@ -143,9 +143,8 @@ _efl_io_manager_direct_ls(const Eo *obj, ecore_thread_local_data_add(h->thread, ".info", info, NULL, EINA_TRUE); ecore_thread_local_data_add(h->thread, ".info_data", info_data, info_free_cb, EINA_TRUE); - eina_promise_data_set(p, h); - return efl_future_then(obj, future); + return _efl_io_manager_future(obj, future, h); end: return future; @@ -162,7 +161,7 @@ _efl_io_manager_stat_ls(const Eo *obj, Eina_Future *future; Eio_File *h; - p = eina_promise_new(efl_loop_future_scheduler_get(obj), _efl_io_manager_future_cancel, NULL); + p = efl_loop_promise_new(obj); if (!p) return NULL; future = eina_future_new(p); @@ -186,9 +185,8 @@ _efl_io_manager_stat_ls(const Eo *obj, ecore_thread_local_data_add(h->thread, ".info", info, NULL, EINA_TRUE); ecore_thread_local_data_add(h->thread, ".info_data", info_data, info_free_cb, EINA_TRUE); - eina_promise_data_set(p, h); - return efl_future_then(obj, future); + return _efl_io_manager_future(obj, future, h); end: return future; @@ -204,7 +202,7 @@ _efl_io_manager_ls(const Eo *obj, Eina_Future *future; Eio_File *h; - p = eina_promise_new(efl_loop_future_scheduler_get(obj), _efl_io_manager_future_cancel, NULL); + p = efl_loop_promise_new(obj); if (!p) return NULL; future = eina_future_new(p); @@ -217,9 +215,8 @@ _efl_io_manager_ls(const Eo *obj, ecore_thread_local_data_add(h->thread, ".paths", paths, NULL, EINA_TRUE); ecore_thread_local_data_add(h->thread, ".paths_data", paths_data, paths_free_cb, EINA_TRUE); - eina_promise_data_set(p, h); - return efl_future_then(obj, future); + return _efl_io_manager_future(obj, future, h); end: return future; @@ -256,7 +253,7 @@ _efl_io_manager_stat(const Eo *obj, Eina_Future *future; Eio_File *h; - p = eina_promise_new(efl_loop_future_scheduler_get(obj), _efl_io_manager_future_cancel, NULL); + p = efl_loop_promise_new(obj); if (!p) return NULL; future = eina_future_new(p); @@ -265,9 +262,8 @@ _efl_io_manager_stat(const Eo *obj, _future_file_error_cb, p); if (!h) goto end; - eina_promise_data_set(p, h); - return efl_future_then(obj, future); + return _efl_io_manager_future(obj, future, h); end: return future; @@ -285,7 +281,7 @@ _efl_io_manager_xattr_ls(const Eo *obj, Eina_Future *future; Eio_File *h; - p = eina_promise_new(efl_loop_future_scheduler_get(obj), _efl_io_manager_future_cancel, NULL); + p = efl_loop_promise_new(obj); if (!p) return NULL; future = eina_future_new(p); @@ -299,9 +295,8 @@ _efl_io_manager_xattr_ls(const Eo *obj, // There is no race condition here as all the callback are called in the main loop after this ecore_thread_local_data_add(h->thread, ".paths", paths, NULL, EINA_TRUE); ecore_thread_local_data_add(h->thread, ".paths_data", paths_data, paths_free_cb, EINA_TRUE); - eina_promise_data_set(p, h); - return efl_future_then(obj, future); + return _efl_io_manager_future(obj, future, h); end: return efl_future_then(obj, future);; @@ -336,7 +331,7 @@ _efl_io_manager_xattr_set(Eo *obj, Eina_Future *future; Eio_File *h; - p = eina_promise_new(efl_loop_future_scheduler_get(obj), _efl_io_manager_future_cancel, NULL); + p = efl_loop_promise_new(obj); if (!p) return NULL; future = eina_future_new(p); @@ -348,9 +343,8 @@ _efl_io_manager_xattr_set(Eo *obj, _future_file_error_cb, p); if (!h) goto end; - eina_promise_data_set(p, h); - return efl_future_then(obj, future); + return _efl_io_manager_future(obj, future, h); end: return future; @@ -366,7 +360,7 @@ _efl_io_manager_xattr_get(const Eo *obj, Eina_Future *future; Eio_File *h; - p = eina_promise_new(efl_loop_future_scheduler_get(obj), _efl_io_manager_future_cancel, NULL); + p = efl_loop_promise_new(obj); if (!p) return NULL; future = eina_future_new(p); @@ -375,10 +369,8 @@ _efl_io_manager_xattr_get(const Eo *obj, _future_file_error_cb, p); if (!h) goto end; - eina_promise_data_set(p, h); - /* XXX const */ - return efl_future_then((Eo *)obj, future); + return _efl_io_manager_future(obj, future, h); end: return future; @@ -405,7 +397,7 @@ _efl_io_manager_open(const Eo *obj, Eina_Future *future; Eio_File *h; - p = eina_promise_new(efl_loop_future_scheduler_get(obj), _efl_io_manager_future_cancel, NULL); + p = efl_loop_promise_new(obj); if (!p) return NULL; future = eina_future_new(p); @@ -414,9 +406,8 @@ _efl_io_manager_open(const Eo *obj, _future_file_error_cb, p); if (!h) goto end; - eina_promise_data_set(p, h); - return efl_future_then(obj, future); + return _efl_io_manager_future(obj, future, h); end: return future; @@ -431,7 +422,7 @@ _efl_io_manager_close(const Eo *obj, Eina_Future *future; Eio_File *h; - p = eina_promise_new(efl_loop_future_scheduler_get(obj), _efl_io_manager_future_cancel, NULL); + p = efl_loop_promise_new(obj); if (!p) return NULL; future = eina_future_new(p); @@ -440,9 +431,8 @@ _efl_io_manager_close(const Eo *obj, _future_file_error_cb, p); if (!h) goto end; - eina_promise_data_set(p, h); - return efl_future_then(obj, future); + return _efl_io_manager_future(obj, future, h); end: return future; diff --git a/src/lib/eio/eio_model.c b/src/lib/eio/eio_model.c index c6e03e663b..01550d1e7a 100644 --- a/src/lib/eio/eio_model.c +++ b/src/lib/eio/eio_model.c @@ -406,31 +406,34 @@ _delayed_flush(void *data EINA_UNUSED, const Efl_Event *ev) efl_event_callback_del(ev->object, EFL_LOOP_EVENT_IDLE, _delayed_flush, NULL); } -static void -_cancel_request(void *data, const Eina_Promise *dead_ptr EINA_UNUSED) +static Eina_Value +_cancel_request(Eo *model EINA_UNUSED, void *data, Eina_Error error) { delayed_queue = eina_list_remove_list(delayed_queue, data); + + return eina_value_error_init(error); } static Eina_Future * -_build_delay(Efl_Loop *loop) +_build_delay(Eio_Model *model) { Eina_Promise *p; - p = eina_promise_new(efl_loop_future_scheduler_get(loop), _cancel_request, NULL); + p = efl_loop_promise_new(model); if (!delayed_queue) { // Remove callback, just in case it is still there. - efl_event_callback_del(loop, EFL_LOOP_EVENT_IDLE, _delayed_flush, NULL); - efl_event_callback_add(loop, EFL_LOOP_EVENT_IDLE, _delayed_flush, NULL); + efl_event_callback_del(efl_loop_get(model), EFL_LOOP_EVENT_IDLE, _delayed_flush, NULL); + efl_event_callback_add(efl_loop_get(model), EFL_LOOP_EVENT_IDLE, _delayed_flush, NULL); // FIXME: It would be nice to be able to build a future directly to be triggered on one event } delayed_queue = eina_list_append(delayed_queue, p); - eina_promise_data_set(p, eina_list_last(delayed_queue)); - return eina_future_new(p); + return efl_future_then(model, eina_future_new(p), + .error = _cancel_request, + .data = eina_list_last(delayed_queue)); } static void @@ -453,7 +456,7 @@ _eio_build_mime_now(void *data, const Eina_Value v, const Eina_Future *dead_futu // Make sure that we are not over consuming time in the main loop if (delayed_queue || ecore_time_get() - ecore_loop_time_get() > 0.004) { - Eina_Future *f = eina_future_then(_build_delay(pd->loop), + Eina_Future *f = eina_future_then(_build_delay(model), _eio_build_mime_now, model, NULL); return eina_future_as_value(efl_future_then(model, f)); } @@ -480,7 +483,7 @@ _eio_build_mime(const Efl_Object *model, Eio_Model_Data *pd) if (pd->mime_type) return ; if (pd->request.mime) return ; - efl_wref_add(efl_provider_find(model, EFL_LOOP_CLASS), &pd->loop); + efl_wref_add(efl_loop_get(model), &pd->loop); f = efl_loop_job(pd->loop); f = eina_future_then(f, _eio_build_mime_now, model, NULL); @@ -682,7 +685,7 @@ _eio_model_efl_model_property_set(Eo *obj, if (finalized) { - Eina_Promise *p = eina_promise_new(efl_loop_future_scheduler_get(obj), _efl_io_manager_future_cancel, NULL); + Eina_Promise *p = efl_loop_promise_new(obj); f = eina_future_new(p); pd->request.move = eio_file_move(pd->path, path, @@ -690,17 +693,17 @@ _eio_model_efl_model_property_set(Eo *obj, _eio_move_done_cb, _eio_file_error_cb, p); ecore_thread_local_data_add(pd->request.move->thread, ".pd", pd, NULL, EINA_TRUE); - eina_promise_data_set(p, pd->request.move); + + f = _efl_io_manager_future(obj, f, pd->request.move); // FIXME: turn on monitor in the finalize stage or after move } else { - f = efl_loop_future_resolved(obj, - eina_value_string_init(pd->path)); + f = efl_loop_future_resolved(obj, eina_value_string_init(pd->path)); } - return efl_future_then(obj, f); + return f; on_error: return efl_loop_future_rejected(obj, err); diff --git a/src/lib/eio/eio_private.h b/src/lib/eio/eio_private.h index 7e8656609a..a6cd4ccab5 100644 --- a/src/lib/eio/eio_private.h +++ b/src/lib/eio/eio_private.h @@ -545,10 +545,20 @@ Eio_File * _eio_file_xattr(const char *path, void _eio_string_notify(void *data, Ecore_Thread *thread EINA_UNUSED, void *msg_data); void _eio_direct_notify(void *data, Ecore_Thread *thread EINA_UNUSED, void *msg_data); -static inline void -_efl_io_manager_future_cancel(void *data, const Eina_Promise *dead_ptr EINA_UNUSED) +static inline Eina_Value +_efl_io_manager_future_cancel(Eo *o EINA_UNUSED, void *data, Eina_Error error) { - eio_file_cancel(data); + if (error == ECANCELED) eio_file_cancel(data); + + return eina_value_error_init(error); +} + +static inline Eina_Future * +_efl_io_manager_future(const Eo *o, Eina_Future *f, Eio_File *h) +{ + return efl_future_then(o, f, + .error = _efl_io_manager_future_cancel, + .data = h); } EINA_VALUE_STRUCT_DESC_DEFINE(_eina_stat_desc, diff --git a/src/lib/eldbus/eldbus_model_connection.c b/src/lib/eldbus/eldbus_model_connection.c index a8f2d52478..56a0673e9d 100644 --- a/src/lib/eldbus/eldbus_model_connection.c +++ b/src/lib/eldbus/eldbus_model_connection.c @@ -70,7 +70,7 @@ _eldbus_model_connection_efl_model_children_slice_get(Eo *obj, return efl_loop_future_resolved(obj, v); } - p = efl_loop_promise_new(obj, NULL, _eldbus_eina_promise_cancel, NULL); + p = efl_loop_promise_new(obj); slice = calloc(1, sizeof (Eldbus_Children_Slice_Promise)); slice->p = p; diff --git a/src/lib/eldbus/eldbus_model_object.c b/src/lib/eldbus/eldbus_model_object.c index b975514cbd..11896292c1 100644 --- a/src/lib/eldbus/eldbus_model_object.c +++ b/src/lib/eldbus/eldbus_model_object.c @@ -127,7 +127,7 @@ _eldbus_model_object_efl_model_children_slice_get(Eo *obj EINA_UNUSED, return efl_loop_future_resolved(obj, v); } - p = efl_loop_promise_new(obj, NULL, _eldbus_eina_promise_cancel, NULL); + p = efl_loop_promise_new(obj); slice = calloc(1, sizeof(struct _Eldbus_Children_Slice_Promise)); slice->p = p; diff --git a/src/lib/eldbus/eldbus_model_private.h b/src/lib/eldbus/eldbus_model_private.h index e58a25d30d..bfe6d5efcc 100644 --- a/src/lib/eldbus/eldbus_model_private.h +++ b/src/lib/eldbus/eldbus_model_private.h @@ -39,13 +39,6 @@ struct _Eldbus_Model_Data /* logging support */ extern int eldbus_model_log_dom; -static inline void -_eldbus_eina_promise_cancel(void *data EINA_UNUSED, - Efl_Loop_Consumer *consumer EINA_UNUSED, - const Eina_Promise *dead_ptr EINA_UNUSED) -{ -} - #define ELDBUS_MODEL_ON_ERROR_EXIT_PROMISE_SET(exp, promise, err, v) \ do \ { \ diff --git a/src/lib/eldbus/eldbus_model_proxy.c b/src/lib/eldbus/eldbus_model_proxy.c index ca5cfc3bf2..32253e36a7 100644 --- a/src/lib/eldbus/eldbus_model_proxy.c +++ b/src/lib/eldbus/eldbus_model_proxy.c @@ -229,9 +229,9 @@ eldbus_model_proxy_property_check(Eldbus_Model_Proxy_Data *pd, } static void -_eldbus_model_proxy_cancel_cb(void *data, - Efl_Loop_Consumer *consumer EINA_UNUSED, - const Eina_Promise *dead_promise EINA_UNUSED) +_eldbus_model_proxy_cancel_cb(Efl_Loop_Consumer *consumer EINA_UNUSED, + void *data, + const Eina_Future *dead_future EINA_UNUSED) { Eldbus_Model_Proxy_Property_Set_Data *sd = data; @@ -294,7 +294,7 @@ _eldbus_model_proxy_efl_model_property_set(Eo *obj EINA_UNUSED, if (!data) goto on_error; data->pd = pd; - data->promise = efl_loop_promise_new(obj, data, _eldbus_model_proxy_cancel_cb, NULL); + data->promise = efl_loop_promise_new(obj); data->property = eina_stringshare_add(property); if (!(data->value = eina_value_dup(value))) goto on_error; @@ -310,7 +310,8 @@ _eldbus_model_proxy_efl_model_property_set(Eo *obj EINA_UNUSED, } if (pending) pd->pendings = eina_list_append(pd->pendings, pending); - return efl_future_then(obj, eina_future_new(data->promise)); + return efl_future_then(obj, eina_future_new(data->promise), + .data = data, .free = _eldbus_model_proxy_cancel_cb); on_error: return efl_loop_future_rejected(obj, err); diff --git a/src/lib/elementary/efl_ui_box.c b/src/lib/elementary/efl_ui_box.c index a00e643e0e..3abf465a1a 100644 --- a/src/lib/elementary/efl_ui_box.c +++ b/src/lib/elementary/efl_ui_box.c @@ -123,9 +123,6 @@ _efl_ui_box_efl_canvas_group_group_add(Eo *obj, Efl_Ui_Box_Data *_pd EINA_UNUSED elm_widget_can_focus_set(obj, EINA_FALSE); elm_widget_highlight_ignore_set(obj, EINA_TRUE); - - // new defaults: fill - no expand - evas_object_size_hint_align_set(obj, -1, -1); } EOLIAN static void diff --git a/src/lib/elementary/efl_ui_box_layout.c b/src/lib/elementary/efl_ui_box_layout.c index ba8b35ecd5..c42dd740a1 100644 --- a/src/lib/elementary/efl_ui_box_layout.c +++ b/src/lib/elementary/efl_ui_box_layout.c @@ -12,6 +12,7 @@ struct _Item_Calc Evas_Object *obj; double weight[2]; double align[2]; + Eina_Bool fill[2]; Eina_Size2D max, want, aspect; int pad[4]; Efl_Gfx_Size_Hint_Aspect aspect_type; @@ -76,10 +77,41 @@ _efl_ui_box_custom_layout(Efl_Ui_Box *ui_box, Evas_Object_Box_Data *bd) efl_gfx_size_hint_weight_get(o, &item->weight[0], &item->weight[1]); efl_gfx_size_hint_align_get(o, &item->align[0], &item->align[1]); efl_gfx_size_hint_margin_get(o, &item->pad[0], &item->pad[1], &item->pad[2], &item->pad[3]); + efl_gfx_size_hint_fill_get(o, &item->fill[0], &item->fill[1]); item->max = efl_gfx_size_hint_max_get(o); item->want = efl_gfx_size_hint_combined_min_get(o); efl_gfx_size_hint_aspect_get(o, &item->aspect_type, &item->aspect); + if (item->weight[0] < 0) item->weight[0] = 0; + if (item->weight[1] < 0) item->weight[1] = 0; + + if (EINA_DBL_EQ(item->align[0], -1)) + { + item->align[0] = 0.5; + item->fill[0] = EINA_TRUE; + } + else if (item->align[0] < 0) + { + item->align[0] = 0; + } + if (EINA_DBL_EQ(item->align[1], -1)) + { + item->align[1] = 0.5; + item->fill[1] = EINA_TRUE; + } + else if (item->align[1] < 0) + { + item->align[1] = 0; + } + if (item->align[0] > 1) item->align[0] = 1; + if (item->align[1] > 1) item->align[1] = 1; + + if (item->want.w < 0) item->want.w = 0; + if (item->want.h < 0) item->want.h = 0; + + if (item->max.w < 0) item->max.w = INT_MAX; + if (item->max.h < 0) item->max.h = INT_MAX; + if (item->aspect.w <= 0 || item->aspect.h <= 0) { if (item->aspect_type >= EFL_GFX_SIZE_HINT_ASPECT_HORIZONTAL) @@ -102,7 +134,7 @@ _efl_ui_box_custom_layout(Efl_Ui_Box *ui_box, Evas_Object_Box_Data *bd) if (horiz) { - if ((item->align[1] < 0) && (h < boxh)) + if (item->fill[1] && (h < boxh)) { double w1, h1; h1 = item->max.h > 0 ? MIN(boxh, item->max.h) : boxh; @@ -113,7 +145,7 @@ _efl_ui_box_custom_layout(Efl_Ui_Box *ui_box, Evas_Object_Box_Data *bd) } else { - if ((item->align[0] < 0) && (w < boxw)) + if (item->fill[0] && (w < boxw)) { double w1, h1; w1 = item->max.w > 0 ? MIN(boxw, item->max.w) : boxw; @@ -125,20 +157,6 @@ _efl_ui_box_custom_layout(Efl_Ui_Box *ui_box, Evas_Object_Box_Data *bd) item->want.w = w; item->want.h = h; } - - if (item->weight[0] < 0) item->weight[0] = 0; - if (item->weight[1] < 0) item->weight[1] = 0; - - if (item->align[0] < 0) item->align[0] = -1; - if (item->align[1] < 0) item->align[1] = -1; - if (item->align[0] > 1) item->align[0] = 1; - if (item->align[1] > 1) item->align[1] = 1; - - if (item->want.w < 0) item->want.w = 0; - if (item->want.h < 0) item->want.h = 0; - - if (item->max.w < 0) item->max.w = INT_MAX; - if (item->max.h < 0) item->max.h = INT_MAX; if (item->max.w < item->want.w) item->max.w = item->want.w; if (item->max.h < item->want.h) item->max.h = item->want.h; @@ -319,12 +337,12 @@ _efl_ui_box_custom_layout(Efl_Ui_Box *ui_box, Evas_Object_Box_Data *bd) w = w - item->pad[0] - item->pad[1]; h = h - item->pad[2] - item->pad[3]; - if (item->align[0] < 0) + if (item->fill[0]) x = cx + (cw - w) * 0.5 + item->pad[0]; else x = cx + (cw - w) * item->align[0] + item->pad[0]; - if (item->align[1] < 0) + if (item->fill[1]) y = cy + (ch - h) * 0.5 + item->pad[2]; else y = cy + (ch - h) * item->align[1] + item->pad[2]; @@ -335,15 +353,9 @@ _efl_ui_box_custom_layout(Efl_Ui_Box *ui_box, Evas_Object_Box_Data *bd) if (item->max.w < INT_MAX) { w = MIN(MAX(item->want.w - item->pad[0] - item->pad[1], item->max.w), cw); - if (item->align[0] < 0) - { - // bad case: fill+max are not good together - x = cx + ((cw - w) * box_align[0]) + item->pad[0]; - } - else - x = cx + ((cw - w) * item->align[0]) + item->pad[0]; + x = cx + ((cw - w) * item->align[0]) + item->pad[0]; } - else if (item->align[0] < 0) + else if (item->fill[0]) { // fill x w = cw - item->pad[0] - item->pad[1]; @@ -362,15 +374,9 @@ _efl_ui_box_custom_layout(Efl_Ui_Box *ui_box, Evas_Object_Box_Data *bd) if (item->max.h < INT_MAX) { h = MIN(MAX(item->want.h - item->pad[2] - item->pad[3], item->max.h), ch); - if (item->align[1] < 0) - { - // bad case: fill+max are not good together - y = cy + ((ch - h) * box_align[1]) + item->pad[2]; - } - else - y = cy + ((ch - h) * item->align[1]) + item->pad[2]; + y = cy + ((ch - h) * item->align[1]) + item->pad[2]; } - else if (item->align[1] < 0) + else if (item->fill[1]) { // fill y h = ch - item->pad[2] - item->pad[3]; diff --git a/src/lib/elementary/efl_ui_flip.c b/src/lib/elementary/efl_ui_flip.c index 24004012e0..7f3238e9bf 100644 --- a/src/lib/elementary/efl_ui_flip.c +++ b/src/lib/elementary/efl_ui_flip.c @@ -2137,7 +2137,7 @@ _update_front_back(Eo *obj, Efl_Ui_Flip_Data *pd) static void _content_added(Eo *obj, Efl_Ui_Flip_Data *pd, Efl_Gfx_Entity *content) { - evas_object_smart_member_add(content, obj); + elm_widget_sub_object_add(obj, content); if (!pd->front.content) { @@ -2158,7 +2158,7 @@ _content_removed(Eo *obj, Efl_Ui_Flip_Data *pd, Efl_Gfx_Entity *content) int index, count; Eina_Bool state; - evas_object_smart_member_del(content); + elm_widget_sub_object_del(obj, content); // if its not the front or back object just return. if ((pd->front.content != content) || (pd->back.content != content)) @@ -2212,6 +2212,7 @@ _efl_ui_flip_efl_container_content_count(Eo *obj EINA_UNUSED, Efl_Ui_Flip_Data * EOLIAN static Eina_Bool _efl_ui_flip_efl_container_content_remove(Eo *obj, Efl_Ui_Flip_Data *pd, Efl_Gfx_Entity *content) { + pd->content_list = eina_list_remove(pd->content_list, content); pd->content_list = eina_list_remove(pd->content_list, content); _content_removed(obj, pd, content); return EINA_TRUE; @@ -2220,6 +2221,7 @@ _efl_ui_flip_efl_container_content_remove(Eo *obj, Efl_Ui_Flip_Data *pd, Efl_Gfx EOLIAN static Eina_Bool _efl_ui_flip_efl_pack_unpack(Eo *obj, Efl_Ui_Flip_Data *pd, Efl_Gfx_Entity *subobj) { + pd->content_list = eina_list_remove(pd->content_list, subobj); pd->content_list = eina_list_remove(pd->content_list, subobj); _content_removed(obj, pd, subobj); return EINA_TRUE; @@ -2228,6 +2230,7 @@ _efl_ui_flip_efl_pack_unpack(Eo *obj, Efl_Ui_Flip_Data *pd, Efl_Gfx_Entity *subo EOLIAN static Eina_Bool _efl_ui_flip_efl_pack_pack(Eo *obj, Efl_Ui_Flip_Data *pd, Efl_Gfx_Entity *subobj) { + pd->content_list = eina_list_remove(pd->content_list, subobj); pd->content_list = eina_list_append(pd->content_list, subobj); _content_added(obj, pd, subobj); return EINA_TRUE; @@ -2236,6 +2239,7 @@ _efl_ui_flip_efl_pack_pack(Eo *obj, Efl_Ui_Flip_Data *pd, Efl_Gfx_Entity *subobj EOLIAN static Eina_Bool _efl_ui_flip_efl_pack_linear_pack_begin(Eo *obj, Efl_Ui_Flip_Data *pd, Efl_Gfx_Entity *subobj) { + pd->content_list = eina_list_remove(pd->content_list, subobj); pd->content_list = eina_list_prepend(pd->content_list, subobj); _content_added(obj, pd, subobj); @@ -2245,6 +2249,7 @@ _efl_ui_flip_efl_pack_linear_pack_begin(Eo *obj, Efl_Ui_Flip_Data *pd, Efl_Gfx_E EOLIAN static Eina_Bool _efl_ui_flip_efl_pack_linear_pack_end(Eo *obj, Efl_Ui_Flip_Data *pd, Efl_Gfx_Entity *subobj) { + pd->content_list = eina_list_remove(pd->content_list, subobj); pd->content_list = eina_list_append(pd->content_list, subobj); _content_added(obj, pd, subobj); return EINA_TRUE; @@ -2253,6 +2258,7 @@ _efl_ui_flip_efl_pack_linear_pack_end(Eo *obj, Efl_Ui_Flip_Data *pd, Efl_Gfx_Ent EOLIAN static Eina_Bool _efl_ui_flip_efl_pack_linear_pack_before(Eo *obj, Efl_Ui_Flip_Data *pd, Efl_Gfx_Entity *subobj, const Efl_Gfx_Entity *existing) { + pd->content_list = eina_list_remove(pd->content_list, subobj); pd->content_list = eina_list_prepend_relative(pd->content_list, subobj, existing); _content_added(obj, pd, subobj); return EINA_TRUE; @@ -2261,6 +2267,7 @@ _efl_ui_flip_efl_pack_linear_pack_before(Eo *obj, Efl_Ui_Flip_Data *pd, Efl_Gfx_ EOLIAN static Eina_Bool _efl_ui_flip_efl_pack_linear_pack_after(Eo *obj, Efl_Ui_Flip_Data *pd, Efl_Gfx_Entity *subobj, const Efl_Gfx_Entity *existing) { + pd->content_list = eina_list_remove(pd->content_list, subobj); pd->content_list = eina_list_append_relative(pd->content_list, subobj, existing); _content_added(obj, pd, subobj); return EINA_TRUE; @@ -2271,6 +2278,7 @@ _efl_ui_flip_efl_pack_linear_pack_at(Eo *obj, Efl_Ui_Flip_Data *pd, Efl_Gfx_Enti { Efl_Gfx_Entity *existing = NULL; existing = eina_list_nth(pd->content_list, index); + pd->content_list = eina_list_remove(pd->content_list, subobj); pd->content_list = eina_list_prepend_relative(pd->content_list, subobj, existing); _content_added(obj, pd, subobj); return EINA_TRUE; diff --git a/src/lib/elementary/efl_ui_focus_manager_root_focus.c b/src/lib/elementary/efl_ui_focus_manager_root_focus.c index f8a4c8653a..f47fe3d3fe 100644 --- a/src/lib/elementary/efl_ui_focus_manager_root_focus.c +++ b/src/lib/elementary/efl_ui_focus_manager_root_focus.c @@ -98,7 +98,6 @@ _efl_ui_focus_manager_root_focus_efl_ui_focus_manager_calc_unregister(Eo *obj, E _state_eval(obj, pd); } - EOLIAN static void _efl_ui_focus_manager_root_focus_efl_ui_focus_manager_manager_focus_set(Eo *obj, Efl_Ui_Focus_Manager_Root_Focus_Data *pd, Efl_Ui_Focus_Object *focus) { @@ -106,21 +105,18 @@ _efl_ui_focus_manager_root_focus_efl_ui_focus_manager_manager_focus_set(Eo *obj, efl_ui_focus_manager_focus_set(efl_super(obj, MY_CLASS), _trap(pd, focus)); } - EOLIAN static Efl_Ui_Focus_Object* _efl_ui_focus_manager_root_focus_efl_ui_focus_manager_manager_focus_get(const Eo *obj, Efl_Ui_Focus_Manager_Root_Focus_Data *pd) { return _trap(pd, efl_ui_focus_manager_focus_get(efl_super(obj, MY_CLASS))); } - EOLIAN static Efl_Ui_Focus_Relations * _efl_ui_focus_manager_root_focus_efl_ui_focus_manager_fetch(Eo *obj, Efl_Ui_Focus_Manager_Root_Focus_Data *pd, Efl_Ui_Focus_Object *child) { return efl_ui_focus_manager_fetch(efl_super(obj, MY_CLASS), _trap(pd, child)); } - EOLIAN static Efl_Ui_Focus_Manager_Logical_End_Detail _efl_ui_focus_manager_root_focus_efl_ui_focus_manager_logical_end(Eo *obj, Efl_Ui_Focus_Manager_Root_Focus_Data *pd) { @@ -171,7 +167,6 @@ _efl_ui_focus_manager_root_focus_canvas_object_get(const Eo *obj EINA_UNUSED, Ef EOLIAN static void _efl_ui_focus_manager_root_focus_canvas_object_set(Eo *obj, Efl_Ui_Focus_Manager_Root_Focus_Data *pd, Efl_Canvas_Object *canvas_object) { - //if canvas object is NULL trigger it as root if (!canvas_object) canvas_object = efl_ui_focus_manager_root_get(obj); diff --git a/src/lib/elementary/efl_ui_focus_manager_sub.c b/src/lib/elementary/efl_ui_focus_manager_sub.c index 7fb1383ad6..eb05f971b0 100644 --- a/src/lib/elementary/efl_ui_focus_manager_sub.c +++ b/src/lib/elementary/efl_ui_focus_manager_sub.c @@ -63,8 +63,7 @@ _border_flush(Eo *obj, Efl_Ui_Focus_Manager_Sub_Data *pd) eina_iterator_free(borders); //elements which are not in the current border elements - tmp = eina_list_clone(pd->current_border); - tmp = _set_a_without_b(tmp , selection); + tmp = _set_a_without_b(pd->current_border, selection); EINA_LIST_FREE(tmp, node) { @@ -73,8 +72,7 @@ _border_flush(Eo *obj, Efl_Ui_Focus_Manager_Sub_Data *pd) } //set of the elements which are new without those which are currently registered - tmp = eina_list_clone(selection); - tmp = _set_a_without_b(tmp, pd->current_border); + tmp = _set_a_without_b(selection, pd->current_border); EINA_LIST_FREE(tmp, node) { diff --git a/src/lib/elementary/efl_ui_focus_object.c b/src/lib/elementary/efl_ui_focus_object.c index 89e7af2a5d..37c65a0544 100644 --- a/src/lib/elementary/efl_ui_focus_object.c +++ b/src/lib/elementary/efl_ui_focus_object.c @@ -16,10 +16,14 @@ typedef struct { EOLIAN static void _efl_ui_focus_object_focus_set(Eo *obj, Efl_Ui_Focus_Object_Data *pd, Eina_Bool focus) { + Efl_Ui_Focus_Object *parent; + if (pd->old_focus == focus) return; pd->old_focus = focus; - efl_ui_focus_object_child_focus_set(efl_ui_focus_object_focus_parent_get(obj), focus); + parent = efl_ui_focus_object_focus_parent_get(obj); + if (parent) + efl_ui_focus_object_child_focus_set(parent, focus); efl_event_callback_call(obj, EFL_UI_FOCUS_OBJECT_EVENT_FOCUS_CHANGED , (void*) (uintptr_t) focus); } @@ -44,10 +48,14 @@ _efl_ui_focus_object_prepare_logical(Eo *obj, Efl_Ui_Focus_Object_Data *pd) EOLIAN static void _efl_ui_focus_object_child_focus_set(Eo *obj, Efl_Ui_Focus_Object_Data *pd, Eina_Bool child_focus) { + Efl_Ui_Focus_Object *parent; + if (child_focus == pd->child_focus) return; pd->child_focus = child_focus; - efl_ui_focus_object_child_focus_set(efl_ui_focus_object_focus_parent_get(obj), pd->child_focus); + parent = efl_ui_focus_object_focus_parent_get(obj); + if (parent) + efl_ui_focus_object_child_focus_set(parent, pd->child_focus); } EOLIAN static Eina_Bool diff --git a/src/lib/elementary/efl_ui_list_view_precise_layouter.c b/src/lib/elementary/efl_ui_list_view_precise_layouter.c index 156662caa5..c6cd605f77 100644 --- a/src/lib/elementary/efl_ui_list_view_precise_layouter.c +++ b/src/lib/elementary/efl_ui_list_view_precise_layouter.c @@ -56,12 +56,14 @@ _item_size_calc(Efl_Ui_List_View_Precise_Layouter_Data *pd, Efl_Ui_List_View_Lay { int boxx, boxy, boxw, boxh, boxl, boxr, boxt, boxb, pad[4]; double align[2]; + Eina_Bool fill[2]; Eina_Size2D max; efl_gfx_size_hint_margin_get(item->layout, &pad[0], &pad[1], &pad[2], &pad[3]); evas_object_geometry_get(pd->modeler, &boxx, &boxy, &boxw, &boxh); efl_gfx_size_hint_margin_get(pd->modeler, &boxl, &boxr, &boxt, &boxb); efl_gfx_size_hint_align_get(item->layout, &align[0], &align[1]); + efl_gfx_size_hint_fill_get(item->layout, &fill[0], &fill[1]); max = efl_gfx_size_hint_max_get(item->layout); // box outer margin @@ -70,8 +72,25 @@ _item_size_calc(Efl_Ui_List_View_Precise_Layouter_Data *pd, Efl_Ui_List_View_Lay boxx += boxl; boxy += boxt; - if (align[0] < 0) align[0] = -1; - if (align[1] < 0) align[1] = -1; + if (EINA_DBL_EQ(align[0], -1)) + { + align[0] = 0.5; + fill[0] = EINA_TRUE; + } + else if (align[0] < 0) + { + align[0] = 0; + } + if (EINA_DBL_EQ(align[1], -1)) + { + align[1] = 0.5; + fill[1] = EINA_TRUE; + } + else if (align[1] < 0) + { + align[1] = 0; + } + if (align[0] > 1) align[0] = 1; if (align[1] > 1) align[1] = 1; @@ -86,7 +105,7 @@ _item_size_calc(Efl_Ui_List_View_Precise_Layouter_Data *pd, Efl_Ui_List_View_Lay item->size.w = MIN(MAX(item->min.w - pad[0] - pad[1], max.w), boxw); item->pos.x = boxx + pad[0]; } - else if (align[0] < 0) + else if (fill[0]) { // fill x item->size.w = boxw - pad[0] - pad[1]; @@ -104,7 +123,7 @@ _item_size_calc(Efl_Ui_List_View_Precise_Layouter_Data *pd, Efl_Ui_List_View_Lay item->size.h = MIN(MAX(item->min.h - pad[2] - pad[3], max.h), boxh); item->pos.y = boxy + pad[2]; } - else if (align[1] < 0) + else if (fill[1]) { // fill y item->size.h = item->min.h - pad[2] - pad[3]; diff --git a/src/lib/elementary/efl_ui_scroll_alert_popup.c b/src/lib/elementary/efl_ui_scroll_alert_popup.c index 65a70628d5..3e7c8d9b5e 100644 --- a/src/lib/elementary/efl_ui_scroll_alert_popup.c +++ b/src/lib/elementary/efl_ui_scroll_alert_popup.c @@ -161,7 +161,7 @@ _efl_ui_scroll_alert_popup_content_set(Eo *obj, Efl_Ui_Scroll_Alert_Popup_Data * //Content should have expand propeties since the scroller is not layout layer efl_gfx_size_hint_weight_set(pd->content, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); - efl_gfx_size_hint_align_set(pd->content, EVAS_HINT_FILL, EVAS_HINT_FILL); + efl_gfx_size_hint_fill_set(pd->content, EINA_TRUE, EINA_TRUE); efl_content_set(pd->scroller, pd->content); } diff --git a/src/lib/elementary/efl_ui_selection_manager.c b/src/lib/elementary/efl_ui_selection_manager.c index 0f1bfc71ec..d8064a4953 100644 --- a/src/lib/elementary/efl_ui_selection_manager.c +++ b/src/lib/elementary/efl_ui_selection_manager.c @@ -93,8 +93,6 @@ _owner_change_check(Efl_Ui_Selection_Manager *manager, Efl_Object *owner, (sel_lost->type == type)) { eina_promise_resolve(sel_lost->promise, eina_value_uint_init(sel_lost->type)); - seat_sel2->sel_lost_list = eina_list_remove(seat_sel2->sel_lost_list, sel_lost); - free(sel_lost); } } seat_sel2->xwin = 0; @@ -138,8 +136,6 @@ _owner_change_check(Efl_Ui_Selection_Manager *manager, Efl_Object *owner, (sel_lost->type == type)) { eina_promise_resolve(sel_lost->promise, eina_value_uint_init(sel_lost->type)); - seat_sel->sel_lost_list = eina_list_remove(seat_sel->sel_lost_list, sel_lost); - free(sel_lost); } } } @@ -224,12 +220,10 @@ _sel_manager_seat_selection_init(Efl_Ui_Selection_Manager_Data *pd, unsigned int } static void -_sel_manager_promise_cancel(void *data, Efl_Loop_Consumer *consumer EINA_UNUSED, - const Eina_Promise *dead_future EINA_UNUSED) +_sel_manager_promise_cancel(Eo *obj EINA_UNUSED, void *data, const Eina_Future *dead_future EINA_UNUSED) { Sel_Manager_Selection_Lost *sel_lost = data; - sel_lost->seat_sel->sel_lost_list = eina_list_remove( - sel_lost->seat_sel->sel_lost_list, sel_lost); + sel_lost->seat_sel->sel_lost_list = eina_list_remove(sel_lost->seat_sel->sel_lost_list, sel_lost); free(sel_lost); } @@ -248,12 +242,13 @@ _update_sel_lost_list(Efl_Object *obj, Efl_Ui_Selection_Type type, sel_lost->seat_sel = seat_sel; seat_sel->sel_lost_list = eina_list_append(seat_sel->sel_lost_list, sel_lost); - p = efl_loop_promise_new(obj, NULL, _sel_manager_promise_cancel, NULL); - eina_promise_data_set(p, sel_lost); + p = efl_loop_promise_new(obj); if (!p) return NULL; sel_lost->promise = p; - return eina_future_new(p); + return efl_future_then(obj, eina_future_new(p), + .data = sel_lost, + .free = _sel_manager_promise_cancel); } /* TODO: this should not be an actual tempfile, but rather encode the object @@ -1060,8 +1055,6 @@ _x11_selection_clear(void *data, int type EINA_UNUSED, void *event) { sel_debug("resolve the promise: %p", sel_lost->promise); eina_promise_resolve(sel_lost->promise, eina_value_uint_init(sel_lost->type)); - seat_sel->sel_lost_list = eina_list_remove(seat_sel->sel_lost_list, sel_lost); - free(sel_lost); } } sel->active = EINA_FALSE; @@ -2559,8 +2552,6 @@ _wl_efl_sel_manager_selection_set(Efl_Ui_Selection_Manager_Data *pd, (sel_lost->type == type)) { eina_promise_resolve(sel_lost->promise, eina_value_uint_init(sel_lost->type)); - seat_sel->sel_lost_list = eina_list_remove(seat_sel->sel_lost_list, sel_lost); - free(sel_lost); } } } @@ -3977,8 +3968,6 @@ _cocoa_efl_sel_manager_selection_set(Efl_Ui_Selection_Manager_Data *pd, (sel_lost->type == type)) { eina_promise_resolve(sel_lost->promise, eina_value_uint_init(sel_lost->type)); - seat_sel->sel_lost_list = eina_list_remove(seat_sel->sel_lost_list, sel_lost); - free(sel_lost); } } if (sel->owner) @@ -4219,8 +4208,6 @@ _win32_efl_sel_manager_selection_set(Efl_Ui_Selection_Manager_Data *pd, (sel_lost->type == type)) { eina_promise_resolve(sel_lost->promise, eina_value_uint_init(sel_lost->type)); - seat_sel->sel_lost_list = eina_list_remove(seat_sel->sel_lost_list, sel_lost); - free(sel_lost); } } @@ -4815,8 +4802,6 @@ _efl_ui_selection_manager_selection_clear(Eo *obj, Efl_Ui_Selection_Manager_Data (sel_lost->type == type)) { eina_promise_resolve(sel_lost->promise, eina_value_uint_init(sel_lost->type)); - seat_sel->sel_lost_list = eina_list_remove(seat_sel->sel_lost_list, sel_lost); - free(sel_lost); } } seat_sel->sel_list[type].owner = NULL; diff --git a/src/lib/elementary/efl_ui_tags.c b/src/lib/elementary/efl_ui_tags.c index f763f4b787..3cdaa70898 100644 --- a/src/lib/elementary/efl_ui_tags.c +++ b/src/lib/elementary/efl_ui_tags.c @@ -843,16 +843,18 @@ _box_layout_cb(Evas_Object *o, Eina_Size2D obj_min; Evas_Coord ww, hh, ow, oh; double wx, wy; - int fw, fh; + Eina_Bool fx, fy; obj = opt->obj; evas_object_size_hint_align_get(obj, &ax, &ay); evas_object_size_hint_weight_get(obj, &wx, &wy); + efl_gfx_size_hint_fill_get(obj, &fx, &fy); obj_min = efl_gfx_size_hint_combined_min_get(obj); - fw = fh = EINA_FALSE; - if (EINA_DBL_EQ(ax, -1)) {fw = 1; ax = 0.5; } - if (EINA_DBL_EQ(ay, -1)) {fh = 1; ay = 0.5; } + if (EINA_DBL_EQ(ax, -1)) { fx = 1; ax = 0.5; } + else if (ax < 0) { ax = 0.0; } + if (EINA_DBL_EQ(ay, -1)) { fy = 1; ay = 0.5; } + else if (ay < 0) { ay = 0.0; } if (rtl) ax = 1.0 - ax; ww = obj_min.w; @@ -864,9 +866,9 @@ _box_layout_cb(Evas_Object *o, hh = lineh; ow = obj_min.w; - if (fw) ow = ww; + if (fx) ow = ww; oh = obj_min.h; - if (fh) oh = hh; + if (fy) oh = hh; linew += ww; if (linew > r.w && l != priv->children) @@ -941,7 +943,7 @@ _view_init(Evas_Object *obj, Efl_Ui_Tags_Data *sd) efl_gfx_size_hint_min_set(sd->entry, EINA_SIZE2D(MIN_W_ENTRY, 0)); evas_object_size_hint_weight_set (sd->entry, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); - evas_object_size_hint_align_set(sd->entry, EVAS_HINT_FILL, EVAS_HINT_FILL); + efl_gfx_size_hint_fill_set(sd->entry, EINA_TRUE, EINA_TRUE); elm_box_pack_end(sd->box, sd->entry); diff --git a/src/lib/elementary/efl_ui_widget.c b/src/lib/elementary/efl_ui_widget.c index eec2bde180..415882af0d 100644 --- a/src/lib/elementary/efl_ui_widget.c +++ b/src/lib/elementary/efl_ui_widget.c @@ -19,7 +19,7 @@ #include "elm_widget_container.h" #include "elm_interface_scrollable.h" #include "elm_part_helper.h" -#include "elm_combobox.eo.h" +#include "elm_widget_combobox.h" /* FIXME: remove this when we don't rely on evas event structs anymore */ #define EFL_INTERNAL_UNSTABLE diff --git a/src/lib/elementary/efl_ui_win.c b/src/lib/elementary/efl_ui_win.c index aeafaf8db4..f78aaad1af 100644 --- a/src/lib/elementary/efl_ui_win.c +++ b/src/lib/elementary/efl_ui_win.c @@ -2985,11 +2985,13 @@ _efl_ui_win_efl_canvas_group_group_del(Eo *obj, Efl_Ui_Win_Data *sd) efl_canvas_group_del(efl_super(obj, MY_CLASS)); - if ((!_elm_win_list) && - (elm_policy_get(ELM_POLICY_QUIT) == ELM_POLICY_QUIT_LAST_WINDOW_CLOSED)) + if (!_elm_win_list) { - _elm_win_flush_cache_and_exit(obj); + if (elm_policy_get(ELM_POLICY_QUIT) == ELM_POLICY_QUIT_LAST_WINDOW_CLOSED) + _elm_win_flush_cache_and_exit(obj); } + if (!_elm_win_list) + efl_event_callback_call(efl_app_main_get(EFL_APP_CLASS), EFL_APP_EVENT_STANDBY, NULL); } EOLIAN static void @@ -7385,7 +7387,7 @@ _elm_win_bg_set(Efl_Ui_Win_Data *sd, Eo *bg) } } efl_gfx_entity_visible_set(bg, 1); - efl_gfx_size_hint_align_set(bg, -1, -1); + efl_gfx_size_hint_fill_set(bg, EINA_TRUE, EINA_TRUE); efl_gfx_size_hint_weight_set(bg, 1, 1); efl_wref_add(bg, &sd->bg); return EINA_TRUE; diff --git a/src/lib/elementary/elc_combobox.c b/src/lib/elementary/elc_combobox.c index 5256764b0f..cd98f3c8b4 100644 --- a/src/lib/elementary/elc_combobox.c +++ b/src/lib/elementary/elc_combobox.c @@ -11,10 +11,29 @@ #include "elm_priv.h" #include "elm_widget_combobox.h" #include "elm_entry.eo.h" -#include "elm_combobox.eo.h" #include "elm_genlist.eo.h" #include "elm_hover.eo.h" +EOAPI void elm_obj_combobox_hover_begin(Eo *obj); +EOAPI void elm_obj_combobox_hover_end(Eo *obj); + +static const Efl_Event_Description _ELM_COMBOBOX_EVENT_DISMISSED = + EFL_EVENT_DESCRIPTION("dismissed"); +static const Efl_Event_Description _ELM_COMBOBOX_EVENT_EXPANDED = + EFL_EVENT_DESCRIPTION("expanded"); +static const Efl_Event_Description _ELM_COMBOBOX_EVENT_ITEM_SELECTED = + EFL_EVENT_DESCRIPTION("item,selected"); +static const Efl_Event_Description _ELM_COMBOBOX_EVENT_ITEM_PRESSED = + EFL_EVENT_DESCRIPTION("item,pressed"); +static const Efl_Event_Description _ELM_COMBOBOX_EVENT_FILTER_DONE = + EFL_EVENT_DESCRIPTION("filter,done"); + +#define ELM_COMBOBOX_EVENT_DISMISSED (&(_ELM_COMBOBOX_EVENT_DISMISSED)) +#define ELM_COMBOBOX_EVENT_EXPANDED (&(_ELM_COMBOBOX_EVENT_EXPANDED)) +#define ELM_COMBOBOX_EVENT_ITEM_SELECTED (&(_ELM_COMBOBOX_EVENT_ITEM_SELECTED)) +#define ELM_COMBOBOX_EVENT_ITEM_PRESSED (&(_ELM_COMBOBOX_EVENT_ITEM_PRESSED)) +#define ELM_COMBOBOX_EVENT_FILTER_DONE (&(_ELM_COMBOBOX_EVENT_FILTER_DONE)) + #define MY_CLASS ELM_COMBOBOX_CLASS #define MY_CLASS_NAME "Elm_Combobox" @@ -574,9 +593,58 @@ _elm_combobox_efl_gfx_entity_size_set(Eo *obj, Elm_Combobox_Data *pd, Eina_Size2 ELM_WIDGET_KEY_DOWN_DEFAULT_IMPLEMENT(elm_combobox, Elm_Combobox_Data) -/* Internal EO APIs and hidden overrides */ +EOAPI EFL_FUNC_BODY_CONST(elm_obj_combobox_expanded_get, Eina_Bool, 0); +EOAPI EFL_VOID_FUNC_BODY(elm_obj_combobox_hover_begin); +EOAPI EFL_VOID_FUNC_BODY(elm_obj_combobox_hover_end); -#define ELM_COMBOBOX_EXTRA_OPS \ - EFL_CANVAS_GROUP_ADD_DEL_OPS(elm_combobox) +static Eina_Bool +_elm_combobox_class_initializer(Efl_Class *klass) +{ + EFL_OPS_DEFINE(ops, + EFL_OBJECT_OP_FUNC(elm_obj_combobox_expanded_get, _elm_combobox_expanded_get), + EFL_OBJECT_OP_FUNC(elm_obj_combobox_hover_begin, _elm_combobox_hover_begin), + EFL_OBJECT_OP_FUNC(elm_obj_combobox_hover_end, _elm_combobox_hover_end), + EFL_OBJECT_OP_FUNC(efl_constructor, _elm_combobox_efl_object_constructor), + EFL_OBJECT_OP_FUNC(efl_gfx_entity_visible_set, _elm_combobox_efl_gfx_entity_visible_set), + EFL_OBJECT_OP_FUNC(efl_gfx_entity_size_set, _elm_combobox_efl_gfx_entity_size_set), + EFL_OBJECT_OP_FUNC(efl_ui_widget_theme_apply, _elm_combobox_efl_ui_widget_theme_apply), + EFL_OBJECT_OP_FUNC(efl_ui_l10n_translation_update, _elm_combobox_efl_ui_l10n_translation_update), + EFL_OBJECT_OP_FUNC(efl_ui_widget_event, _elm_combobox_efl_ui_widget_widget_event), + EFL_OBJECT_OP_FUNC(efl_ui_autorepeat_supported_get, _elm_combobox_efl_ui_autorepeat_autorepeat_supported_get), + EFL_OBJECT_OP_FUNC(elm_obj_genlist_filter_set, _elm_combobox_elm_genlist_filter_set), + EFL_OBJECT_OP_FUNC(efl_access_widget_action_elm_actions_get, _elm_combobox_efl_access_widget_action_elm_actions_get), + EFL_CANVAS_GROUP_ADD_DEL_OPS(elm_combobox) + ); -#include "elm_combobox.eo.c" + return efl_class_functions_set(klass, &ops, NULL); +} + +static const Efl_Class_Description _elm_combobox_class_desc = { + EO_VERSION, + "Elm.Combobox", + EFL_CLASS_TYPE_REGULAR, + sizeof(Elm_Combobox_Data), + _elm_combobox_class_initializer, + _elm_combobox_class_constructor, + NULL +}; + +EFL_DEFINE_CLASS(elm_combobox_class_get, &_elm_combobox_class_desc, EFL_UI_BUTTON_CLASS, EFL_UI_SELECTABLE_INTERFACE, EFL_ACCESS_WIDGET_ACTION_MIXIN, ELM_ENTRY_CLASS, ELM_GENLIST_CLASS, ELM_HOVER_CLASS, EFL_UI_LEGACY_INTERFACE, NULL); + +EAPI Eina_Bool +elm_combobox_expanded_get(const Elm_Combobox *obj) +{ + return elm_obj_combobox_expanded_get(obj); +} + +EAPI void +elm_combobox_hover_begin(Elm_Combobox *obj) +{ + elm_obj_combobox_hover_begin(obj); +} + +EAPI void +elm_combobox_hover_end(Elm_Combobox *obj) +{ + elm_obj_combobox_hover_end(obj); +} diff --git a/src/lib/elementary/elc_combobox_legacy.h b/src/lib/elementary/elc_combobox_legacy.h index 21e888f725..0ad5cdf1ae 100644 --- a/src/lib/elementary/elc_combobox_legacy.h +++ b/src/lib/elementary/elc_combobox_legacy.h @@ -1,3 +1,10 @@ +#ifndef _ELM_COMBOBOX_EO_CLASS_TYPE +#define _ELM_COMBOBOX_EO_CLASS_TYPE + +typedef Eo Elm_Combobox; + +#endif + /** * @brief Add a new Combobox object * @@ -8,4 +15,36 @@ */ EAPI Evas_Object *elm_combobox_add(Evas_Object *parent); -#include "elm_combobox.eo.legacy.h" +/** + * @brief Returns whether the combobox is expanded. + * + * This will return EINA_TRUE if the combobox is expanded or EINA_FALSE if it + * is not expanded. + * + * @param[in] obj The object. + * + * @return @c true if combobox is expenaded, @c false otherwise + * + * @since 1.17 + * + * @ingroup Elm_Combobox_Group + */ +EAPI Eina_Bool elm_combobox_expanded_get(const Elm_Combobox *obj); + +/** This triggers the combobox popup from code, the same as if the user had + * clicked the button. + * + * @since 1.17 + * + * @ingroup Elm_Combobox_Group + */ +EAPI void elm_combobox_hover_begin(Elm_Combobox *obj); + +/** This dismisses the combobox popup as if the user had clicked outside the + * hover. + * + * @since 1.17 + * + * @ingroup Elm_Combobox_Group + */ +EAPI void elm_combobox_hover_end(Elm_Combobox *obj); diff --git a/src/lib/elementary/elm_colorselector.c b/src/lib/elementary/elm_colorselector.c index 42d13995d2..b19f006bb7 100644 --- a/src/lib/elementary/elm_colorselector.c +++ b/src/lib/elementary/elm_colorselector.c @@ -1891,7 +1891,6 @@ _palette_box_prepare(Eo *o) { efl_ui_direction_set(o, EFL_UI_DIR_HORIZONTAL); efl_gfx_size_hint_weight_set(o, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); - efl_gfx_size_hint_align_set(o, EVAS_HINT_FILL, EVAS_HINT_FILL); efl_gfx_entity_visible_set(o, EINA_FALSE); } @@ -1910,6 +1909,7 @@ _create_colorpalette(Evas_Object *obj) if (elm_widget_is_legacy(obj)) { sd->palette_box = elm_legacy_add(EFL_UI_BOX_FLOW_CLASS, obj); + evas_object_size_hint_align_set(sd->palette_box, EVAS_HINT_FILL, EVAS_HINT_FILL); } else { diff --git a/src/lib/elementary/elm_combobox.eo b/src/lib/elementary/elm_combobox.eo deleted file mode 100644 index 390ab08d59..0000000000 --- a/src/lib/elementary/elm_combobox.eo +++ /dev/null @@ -1,60 +0,0 @@ -class Elm.Combobox (Efl.Ui.Button, Efl.Ui.Selectable, - Efl.Access.Widget.Action, - Elm.Entry, Elm.Genlist, Elm.Hover, Efl.Ui.Legacy) -{ - [[Elementary combobox class]] - legacy_prefix: elm_combobox; - eo_prefix: elm_obj_combobox; - event_prefix: elm_combobox; - methods { - @property expanded { - get { - [[Returns whether the combobox is expanded. - - This will return EINA_TRUE if the combobox is expanded or - EINA_FALSE if it is not expanded. - - @since 1.17 - ]] - return: bool; [[$true if combobox is expenaded, $false otherwise]] - } - } - hover_begin { - [[This triggers the combobox popup from code, the same as if the user - had clicked the button. - - @since 1.17 - ]] - } - hover_end { - [[This dismisses the combobox popup as if the user had clicked - outside the hover. - - @since 1.17 - ]] - } - } - implements { - class.constructor; - Efl.Object.constructor; - Efl.Gfx.Entity.visible { set; } - Efl.Gfx.Entity.size { set; } - Efl.Ui.Widget.theme_apply; - Efl.Ui.L10n.translation_update; - Efl.Ui.Widget.widget_event; - Efl.Ui.Autorepeat.autorepeat_supported { get; } - Elm.Genlist.filter { set; } - Efl.Access.Widget.Action.elm_actions { get; } - //Efl.Part.part; // TODO? - } - events { - dismissed: void; [[Called when combobox was dismissed]] - expanded: void; [[Called when combobox was expanded]] - /* FIXME: Nobody is emitting this - clicked; [[Called when combobox was clicked]] - */ - item,selected: Efl.Object; [[Called when combobox item was selected]] - item,pressed: Efl.Object; [[Called when combobox item was pressed]] - filter,done: Efl.Object; [[Called when combobox filter was done]] - } -} diff --git a/src/lib/elementary/elm_config.c b/src/lib/elementary/elm_config.c index ac8d5d10b6..7d7e85d438 100644 --- a/src/lib/elementary/elm_config.c +++ b/src/lib/elementary/elm_config.c @@ -1437,7 +1437,7 @@ _profile_fetch_from_conf(void) { char buf[PATH_MAX], *p, *s; Eet_File *ef = NULL; - int len = 0; + int len = 0, i; // if env var - use profile without question s = getenv("ELM_PROFILE"); @@ -1459,9 +1459,14 @@ _profile_fetch_from_conf(void) } } - if(!_use_build_config) + for (i = 0; i < 2 && !_use_build_config; i++) { - _elm_config_user_dir_snprintf(buf, sizeof(buf), "config/profile.cfg"); + // user profile + if (i == 0) + _elm_config_user_dir_snprintf(buf, sizeof(buf), "config/profile.cfg"); + // system profile + else if (i == 1) + _elm_data_dir_snprintf(buf, sizeof(buf), "config/profile.cfg"); ef = eet_open(buf, EET_FILE_MODE_READ); if (ef) { @@ -2205,6 +2210,7 @@ _elm_config_profile_name_get() rst = calloc(1, len+1); memcpy(rst, p, len); rst[len] = '\0'; + free(p); } eet_close(ef); } diff --git a/src/lib/elementary/elm_entry.c b/src/lib/elementary/elm_entry.c index dac8e916f6..8661778d09 100644 --- a/src/lib/elementary/elm_entry.c +++ b/src/lib/elementary/elm_entry.c @@ -143,18 +143,24 @@ _file_load(const char *file) Eina_File *f; char *text = NULL; void *tmp = NULL; + size_t size; f = eina_file_open(file, EINA_FALSE); if (!f) return NULL; - tmp = eina_file_map_all(f, EINA_FILE_SEQUENTIAL); - if (!tmp) goto on_error; + size = eina_file_size_get(f); + if (size) + { + tmp = eina_file_map_all(f, EINA_FILE_SEQUENTIAL); + if (!tmp) goto on_error; + } - text = malloc(eina_file_size_get(f) + 1); + text = malloc(size + 1); if (!text) goto on_error; - memcpy(text, tmp, eina_file_size_get(f)); - text[eina_file_size_get(f)] = 0; + if (size) + memcpy(text, tmp, size); + text[size] = 0; if (eina_file_map_faulted(f, tmp)) { diff --git a/src/lib/elementary/elm_panel.c b/src/lib/elementary/elm_panel.c index 204dc2e89a..1265e127ee 100644 --- a/src/lib/elementary/elm_panel.c +++ b/src/lib/elementary/elm_panel.c @@ -743,7 +743,7 @@ _elm_panel_content_set(Eo *obj, Elm_Panel_Data *sd, const char *part, Evas_Objec ERR("elm.swallow.event is being used for panel internally. Don't touch this part!"); return EINA_FALSE; } - if (strcmp(part, "elm.swallow.content") || (content == sd->bx)) + if (strcmp(part, "elm.swallow.content")) { Eina_Bool int_ret = EINA_TRUE; int_ret = efl_content_set(efl_part(efl_super(obj, MY_CLASS), part), content); @@ -856,7 +856,7 @@ _elm_panel_efl_canvas_group_group_add(Eo *obj, Elm_Panel_Data *priv) CRI("Failed to set layout!"); else { - elm_layout_content_set(obj, "elm.swallow.content", priv->bx); + efl_content_set(efl_part(efl_super(obj, MY_CLASS), "elm.swallow.content"), priv->bx); if (edje_object_part_exists (wd->resize_obj, "elm.swallow.event")) @@ -1319,8 +1319,10 @@ _elm_panel_scrollable_set(Eo *obj, Elm_Panel_Data *sd, Eina_Bool scrollable) if (scrollable) { - elm_layout_content_unset(obj, "elm.swallow.content"); + efl_content_unset(efl_part(efl_super(obj, MY_CLASS), "elm.swallow.content")); + //Hide previous resize object + evas_object_hide(sd->panel_edje); elm_widget_resize_object_set(obj, NULL); elm_widget_sub_object_add(obj, sd->panel_edje); @@ -1434,8 +1436,9 @@ _elm_panel_scrollable_set(Eo *obj, Elm_Panel_Data *sd, Eina_Bool scrollable) elm_widget_resize_object_set(obj, sd->panel_edje); + evas_object_hide(sd->scr_ly); elm_layout_content_unset(sd->scr_ly, "elm.swallow.content"); - elm_layout_content_set(obj, "elm.swallow.content", sd->bx); + efl_content_set(efl_part(efl_super(obj, MY_CLASS), "elm.swallow.content"), sd->bx); if (sd->content) elm_widget_sub_object_add(obj, sd->content); } } diff --git a/src/lib/elementary/elm_web.eo b/src/lib/elementary/elm_web.eo index 7f66f0c43c..f1a09244cc 100644 --- a/src/lib/elementary/elm_web.eo +++ b/src/lib/elementary/elm_web.eo @@ -5,7 +5,7 @@ type Elm_Web_Dialog_Confirm: __undefined_type; [[Elementary web dialog confirm t type Elm_Web_Dialog_Prompt: __undefined_type; [[Elementary web dialog prompt type]] type Elm_Web_Dialog_Alert: __undefined_type; [[Elementary web dialog alert type]] -class Elm.Web (Efl.Ui.Widget, Efl.Ui.Legacy, Efl.Ui.Zoom) +abstract Elm.Web (Efl.Ui.Widget, Efl.Ui.Legacy, Efl.Ui.Zoom) { [[Elementary web view class]] legacy_prefix: elm_web; diff --git a/src/lib/elementary/elm_widget_combobox.h b/src/lib/elementary/elm_widget_combobox.h index bdbaaaeab8..889f97b28b 100644 --- a/src/lib/elementary/elm_widget_combobox.h +++ b/src/lib/elementary/elm_widget_combobox.h @@ -79,4 +79,8 @@ struct _Elm_Combobox_Data ELM_WIDGET_ITEM_CHECK_OR_RETURN((Elm_Widget_Item *)it, __VA_ARGS__); \ ELM_COMBOBOX_CHECK(it->base.widget) __VA_ARGS__; +#define ELM_COMBOBOX_CLASS elm_combobox_class_get() + +EWAPI const Efl_Class *elm_combobox_class_get(void); + #endif diff --git a/src/lib/elementary/meson.build b/src/lib/elementary/meson.build index cfc41555a7..327765d5b2 100644 --- a/src/lib/elementary/meson.build +++ b/src/lib/elementary/meson.build @@ -22,7 +22,6 @@ pub_legacy_eo_files = [ 'elm_calendar_item.eo', 'elm_clock.eo', 'elm_colorselector.eo', - 'elm_combobox.eo', 'elm_conformant.eo', 'elm_ctxpopup.eo', 'elm_dayselector.eo', diff --git a/src/lib/emile/emile_compress.c b/src/lib/emile/emile_compress.c index 0d2e605795..e744d3f93f 100644 --- a/src/lib/emile/emile_compress.c +++ b/src/lib/emile/emile_compress.c @@ -52,9 +52,9 @@ emile_compress(const Eina_Binbuf *data, switch (t) { case EMILE_LZ4: - length = LZ4_compress((const char *)eina_binbuf_string_get(data), - compact, - eina_binbuf_length_get(data)); + length = LZ4_compress_default + ((const char *)eina_binbuf_string_get(data), compact, + eina_binbuf_length_get(data), length); /* It is going to be smaller and should never fail, if it does you are in deep poo. */ temp = realloc(compact, length); if (temp) compact = temp; @@ -64,9 +64,9 @@ emile_compress(const Eina_Binbuf *data, break; case EMILE_LZ4HC: - length = LZ4_compressHC((const char *)eina_binbuf_string_get(data), - compact, - eina_binbuf_length_get(data)); + length = LZ4_compress_HC + ((const char *)eina_binbuf_string_get(data), compact, + eina_binbuf_length_get(data), length, 16); temp = realloc(compact, length); if (temp) compact = temp; diff --git a/src/lib/eolian/Eolian.h b/src/lib/eolian/Eolian.h index d4678715d1..fc28058c6b 100644 --- a/src/lib/eolian/Eolian.h +++ b/src/lib/eolian/Eolian.h @@ -1461,6 +1461,19 @@ EAPI Eina_Stringshare *eolian_class_data_type_get(const Eolian_Class *klass); */ EAPI const Eolian_Class *eolian_class_parent_get(const Eolian_Class *klass); +/* + * @brief Returns an iterator to the required classes of this mixin + * + * For none mixins this will return an empty iterator, for mixins this retuns a iterator that + * carries all the classes that are required by this passed mixin. + * + * @param[in] klass the class + * @return the iterator + * + * @ingroup Eolian + */ +EAPI Eina_Iterator *eolian_class_requires_get(const Eolian_Class *klass); + /* * @brief Returns an iterator to the class extensions * diff --git a/src/lib/eolian/database_class.c b/src/lib/eolian/database_class.c index 5bd22dfe7f..bbe398ed0b 100644 --- a/src/lib/eolian/database_class.c +++ b/src/lib/eolian/database_class.c @@ -29,6 +29,8 @@ database_class_del(Eolian_Class *cl) EINA_LIST_FREE(cl->properties, fid) database_function_del(fid); EINA_LIST_FREE(cl->events, ev) database_event_del(ev); EINA_LIST_FREE(cl->parts, pt) database_part_del(pt); + eina_list_free(cl->requires); + eina_list_free(cl->callables); if (cl->legacy_prefix) eina_stringshare_del(cl->legacy_prefix); if (cl->eo_prefix) eina_stringshare_del(cl->eo_prefix); diff --git a/src/lib/eolian/database_class_api.c b/src/lib/eolian/database_class_api.c index d96a7d7ecc..f79cdb800b 100644 --- a/src/lib/eolian/database_class_api.c +++ b/src/lib/eolian/database_class_api.c @@ -55,6 +55,12 @@ eolian_class_parent_get(const Eolian_Class *cl) return cl->parent; } +EAPI Eina_Iterator * +eolian_class_requires_get(const Eolian_Class *cl) +{ + return eina_list_iterator_new(cl->requires); +} + EAPI Eina_Iterator * eolian_class_extensions_get(const Eolian_Class *cl) { diff --git a/src/lib/eolian/database_validate.c b/src/lib/eolian/database_validate.c index 09004c81c4..2a4c646647 100644 --- a/src/lib/eolian/database_validate.c +++ b/src/lib/eolian/database_validate.c @@ -12,7 +12,7 @@ typedef struct _Validate_State { Eina_Bool warned; Eina_Bool event_redef; - Eina_Bool ext_regular; + Eina_Bool unimplemented; } Validate_State; static Eina_Bool @@ -22,6 +22,9 @@ _validate(Eolian_Object *obj) return EINA_TRUE; } +#define _eo_parser_log(_base, ...) \ + eolian_state_log_obj((_base)->unit->state, (_base), __VA_ARGS__) + static Eina_Bool _validate_docstr(Eina_Stringshare *str, const Eolian_Object *info, Eina_List **rdbg) { @@ -184,9 +187,9 @@ _validate_typedecl(Validate_State *vals, Eolian_Typedecl *tp) static const char * const eo_complex_frees[] = { - "eina_accessor_free", "eina_array_free", NULL, /* future */ + "eina_accessor_free", "eina_array_free", "(void)", /* future */ "eina_iterator_free", "eina_hash_free", - "eina_list_free", "eina_inarray_free", "eina_inlist_free" + "eina_list_free", "eina_inarray_free", "(void)" }; static const char *eo_obj_free = "efl_del"; @@ -523,9 +526,6 @@ _get_impl_class(const Eolian_Class *cl, const char *cln) return NULL; } -#define _eo_parser_log(_base, ...) \ - eolian_state_log_obj((_base)->unit->state, (_base), __VA_ARGS__) - static Eina_Bool _db_fill_implement(Eolian_Class *cl, Eolian_Implement *impl) { @@ -622,8 +622,168 @@ _db_fill_implement(Eolian_Class *cl, Eolian_Implement *impl) return EINA_TRUE; } +typedef enum +{ + IMPL_STATUS_NONE = 1, + IMPL_STATUS_FULL, + IMPL_STATUS_GET, + IMPL_STATUS_SET +} Impl_Status; + static Eina_Bool -_db_fill_implements(Eolian_Class *cl) +_extend_impl(Eina_Hash *fs, Eolian_Implement *impl, Eina_Bool as_iface) +{ + const Eolian_Function *fid = impl->foo_id; + Impl_Status st = (Impl_Status)eina_hash_find(fs, &fid); + if (st == IMPL_STATUS_FULL) + return EINA_FALSE; + if (!st) + eina_hash_set(fs, &fid, (void *)IMPL_STATUS_NONE); + if (as_iface || (impl->implklass->type == EOLIAN_CLASS_INTERFACE)) + return !st; + /* impl covers entire declaration */ + if (fid->type == EOLIAN_METHOD || + ((st == IMPL_STATUS_GET || fid->type == EOLIAN_PROP_SET) && impl->is_prop_set) || + ((st == IMPL_STATUS_SET || fid->type == EOLIAN_PROP_GET) && impl->is_prop_get) || + (impl->is_prop_get && impl->is_prop_set)) + { + /* different implementing class can only do a real implementation */ + if (impl->implklass != impl->klass) + { + eina_hash_set(fs, &fid, (void *)IMPL_STATUS_FULL); + return (st != IMPL_STATUS_FULL); + } + /* entirely virtual, so bail out always */ + if (impl->get_pure_virtual && impl->set_pure_virtual) + return !st; + if (impl->get_pure_virtual) + { + if (fid->type == EOLIAN_METHOD || fid->type == EOLIAN_PROP_GET) + return !st; + if (st == IMPL_STATUS_GET) + { + eina_hash_set(fs, &fid, (void *)IMPL_STATUS_FULL); + return (st != IMPL_STATUS_FULL); + } + else + { + eina_hash_set(fs, &fid, (void *)IMPL_STATUS_SET); + return (st <= IMPL_STATUS_NONE); + } + } + if (impl->set_pure_virtual) + { + if (fid->type == EOLIAN_PROP_SET) + return !st; + if (st == IMPL_STATUS_SET) + { + eina_hash_set(fs, &fid, (void *)IMPL_STATUS_FULL); + return (st < IMPL_STATUS_FULL); + } + else + { + eina_hash_set(fs, &fid, (void *)IMPL_STATUS_GET); + return (st <= IMPL_STATUS_NONE); + } + } + eina_hash_set(fs, &fid, (void *)IMPL_STATUS_FULL); + return (st != IMPL_STATUS_FULL); + } + if (impl->implklass != impl->klass || + (!impl->get_pure_virtual && !impl->set_pure_virtual)) + { + if (impl->is_prop_get) + { + eina_hash_set(fs, &fid, (void *)IMPL_STATUS_GET); + return (st <= IMPL_STATUS_NONE); + } + else if (impl->is_prop_set) + { + eina_hash_set(fs, &fid, (void *)IMPL_STATUS_SET); + return (st <= IMPL_STATUS_NONE); + } + } + return !st; +} + +static void +_db_fill_callables(Eolian_Class *cl, Eolian_Class *icl, Eina_Hash *fs, Eina_Bool parent) +{ + Eina_List *l; + Eolian_Implement *impl; + Eina_Bool allow_impl = parent || (icl->type == EOLIAN_CLASS_MIXIN); + EINA_LIST_FOREACH(icl->callables, l, impl) + { + Impl_Status ost = (Impl_Status)eina_hash_find(fs, &impl->foo_id); + Eina_Bool extd = _extend_impl(fs, impl, !allow_impl); + if (extd) + { + /* we had an unimplementation in the list, replace + * instead of appending the new thing to callables + * this is a corner case, it shouldn't happen much + */ + if (ost == IMPL_STATUS_NONE) + { + Eina_List *ll; + Eolian_Implement *old; + EINA_LIST_FOREACH(cl->callables, ll, old) + { + if (old->foo_id == impl->foo_id) + eina_list_data_set(ll, impl); + } + } + else + cl->callables = eina_list_append(cl->callables, impl); + } + } +} + +static Eina_Bool +_db_check_implemented(Validate_State *vals, Eolian_Class *cl, Eina_Hash *fs) +{ + if (cl->type != EOLIAN_CLASS_REGULAR) + return EINA_TRUE; + + Eina_Bool succ = EINA_TRUE; + + if (!vals->unimplemented) + return EINA_TRUE; + + Eina_List *l; + Eolian_Implement *impl; + EINA_LIST_FOREACH(cl->callables, l, impl) + { + Impl_Status st = (Impl_Status)eina_hash_find(fs, &impl->foo_id); + const Eolian_Function *fid = impl->foo_id; + switch (st) + { + case IMPL_STATUS_NONE: + _eo_parser_log( + &cl->base, "unimplemented function '%s' (originally defined at %s:%d:%d)", + fid->base.name, fid->base.file, fid->base.line, fid->base.column); + succ = EINA_FALSE; + continue; + case IMPL_STATUS_GET: + case IMPL_STATUS_SET: + _eo_parser_log( + &cl->base, "partially implemented function '%s' (originally defined at %s:%d:%d)", + fid->base.name, fid->base.file, fid->base.line, fid->base.column); + succ = EINA_FALSE; + continue; + case IMPL_STATUS_FULL: + continue; + default: + _eo_parser_log( + &cl->base, "internal error, unregistered function '%s' (originally defined at %s:%d:%d)", + fid->base.name, fid->base.file, fid->base.line, fid->base.column); + return EINA_FALSE; + } + } + return succ; +} + +static Eina_Bool +_db_fill_implements(Eolian_Class *cl, Eina_Hash *fs) { Eolian_Implement *impl; Eina_List *l; @@ -656,7 +816,9 @@ _db_fill_implements(Eolian_Class *cl) ret = EINA_FALSE; goto end; } + cl->callables = eina_list_append(cl->callables, impl); eina_hash_add(prop ? pth : th, impl->base.name, impl->base.name); + _extend_impl(fs, impl, cl->type == EOLIAN_CLASS_INTERFACE); } end: @@ -740,7 +902,7 @@ _db_swap_inherit(Eolian_Class *cl, Eina_Bool succ, Eina_Stringshare *in_cl, } static Eina_Bool -_db_fill_inherits(Eolian_Class *cl, Eina_Hash *fhash) +_db_fill_inherits(Validate_State *vals, Eolian_Class *cl, Eina_Hash *fhash) { if (eina_hash_find(fhash, &cl->base.name)) return EINA_TRUE; @@ -764,7 +926,7 @@ _db_fill_inherits(Eolian_Class *cl, Eina_Hash *fhash) * the rest of the list needs to be freed in order not to * leak any memory */ - succ = _db_fill_inherits(cl->parent, fhash); + succ = _db_fill_inherits(vals, cl->parent, fhash); } } @@ -775,7 +937,7 @@ _db_fill_inherits(Eolian_Class *cl, Eina_Hash *fhash) if (!succ) continue; cl->extends = eina_list_append(cl->extends, out_cl); - succ = _db_fill_inherits(out_cl, fhash); + succ = _db_fill_inherits(vals, out_cl, fhash); } if (succ && cl->type == EOLIAN_CLASS_MIXIN) @@ -793,7 +955,7 @@ _db_fill_inherits(Eolian_Class *cl, Eina_Hash *fhash) } if (succ) { - _db_fill_inherits(out_cl, fhash); + _db_fill_inherits(vals, out_cl, fhash); } if (!succ) continue; @@ -810,13 +972,33 @@ _db_fill_inherits(Eolian_Class *cl, Eina_Hash *fhash) eina_hash_add(fhash, &cl->base.name, cl); + /* stores mappings from function to Impl_Status */ + Eina_Hash *fh = eina_hash_pointer_new(NULL); + /* make sure impls/ctors are filled first, but do it only once */ - if (!_db_fill_implements(cl)) + if (!_db_fill_implements(cl, fh)) return EINA_FALSE; if (!_db_fill_ctors(cl)) return EINA_FALSE; + /* fill callables list with stuff from inheritance tree, the current + * class stuff is already filled in _db_fill_implements, this is needed + * in order to make sure all methods are implemented + */ + if (cl->parent) + _db_fill_callables(cl, cl->parent, fh, EINA_TRUE); + + Eolian_Class *icl; + EINA_LIST_FOREACH(cl->extends, il, icl) + _db_fill_callables(cl, icl, fh, EINA_FALSE); + + /* verify that all methods are implemented on the class */ + if (!_db_check_implemented(vals, cl, fh)) + vals->warned = EINA_TRUE; + + eina_hash_free(fh); + return EINA_TRUE; } @@ -910,7 +1092,7 @@ _validate_class(Validate_State *vals, Eolian_Class *cl, required_classes = eina_list_append(required_classes, required_class); } } - if (!valid && vals->ext_regular) switch (icl->type) + if (!valid) switch (icl->type) { case EOLIAN_CLASS_REGULAR: case EOLIAN_CLASS_ABSTRACT: @@ -1037,7 +1219,7 @@ database_validate(const Eolian_Unit *src) Validate_State vals = { EINA_FALSE, !!getenv("EOLIAN_EVENT_REDEF_WARN"), - !!getenv("EOLIAN_CLASS_REGULAR_AS_EXT_WARN") + !!getenv("EOLIAN_CLASS_UNIMPLEMENTED_WARN") }; /* do an initial pass to refill inherits */ @@ -1045,7 +1227,7 @@ database_validate(const Eolian_Unit *src) Eina_Hash *fhash = eina_hash_pointer_new(NULL); EINA_ITERATOR_FOREACH(iter, cl) { - if (!_db_fill_inherits(cl, fhash)) + if (!_db_fill_inherits(&vals, cl, fhash)) { eina_hash_free(fhash); return EINA_FALSE; diff --git a/src/lib/eolian/eo_parser.c b/src/lib/eolian/eo_parser.c index a06b69b6fb..0ea2944ea4 100644 --- a/src/lib/eolian/eo_parser.c +++ b/src/lib/eolian/eo_parser.c @@ -1016,6 +1016,13 @@ parse_params(Eo_Lexer *ls, Eina_List **params, Eina_Bool allow_inout, check_match(ls, '}', '{', line, col); } +static void +check_abstract_pure_virtual(Eo_Lexer *ls) +{ + if ((ls->klass->type != EOLIAN_CLASS_ABSTRACT) && (ls->klass->type != EOLIAN_CLASS_MIXIN)) + eo_lexer_syntax_error(ls, "@pure_virtual only allowed in abstract classes or mixins"); +} + static void parse_accessor(Eo_Lexer *ls, Eolian_Function *prop) { @@ -1047,6 +1054,7 @@ parse_accessor(Eo_Lexer *ls, Eolian_Function *prop) for (;;) switch (ls->t.kw) { case KW_at_pure_virtual: + check_abstract_pure_virtual(ls); CASE_LOCK(ls, virtp, "pure_virtual qualifier"); if (is_get) prop->impl->get_pure_virtual = EINA_TRUE; else prop->impl->set_pure_virtual = EINA_TRUE; @@ -1220,6 +1228,7 @@ parse_property(Eo_Lexer *ls) eo_lexer_get(ls); break; case KW_at_pure_virtual: + check_abstract_pure_virtual(ls); CASE_LOCK(ls, virtp, "pure_virtual qualifier"); eo_lexer_get(ls); break; @@ -1389,6 +1398,7 @@ parse_method(Eo_Lexer *ls) eo_lexer_get(ls); break; case KW_at_pure_virtual: + check_abstract_pure_virtual(ls); CASE_LOCK(ls, virtp, "pure_virtual qualifier"); eo_lexer_get(ls); break; diff --git a/src/lib/eolian/eolian_database.h b/src/lib/eolian/eolian_database.h index fdaee09d11..805b547109 100644 --- a/src/lib/eolian/eolian_database.h +++ b/src/lib/eolian/eolian_database.h @@ -192,6 +192,7 @@ struct _Eolian_Class Eina_List *events; /* Eolian_Event */ Eina_List *parts; /* Eolian_Part */ Eina_List *requires; /* a list of required other classes only used internally */ + Eina_List *callables; /* internal for now */ Eina_Bool class_ctor_enable:1; Eina_Bool class_dtor_enable:1; }; diff --git a/src/lib/eolian_cxx/grammar/klass_def.hpp b/src/lib/eolian_cxx/grammar/klass_def.hpp index f69fca29d3..fc9d09519a 100644 --- a/src/lib/eolian_cxx/grammar/klass_def.hpp +++ b/src/lib/eolian_cxx/grammar/klass_def.hpp @@ -1061,11 +1061,12 @@ struct klass_def , std::string klass_get_name) : eolian_name(_eolian_name), cxx_name(_cxx_name) , namespaces(_namespaces) - , functions(_functions), properties(_properties), inherits(_inherits), type(_type), unit(unit) - , klass_get_name(klass_get_name) + , functions(_functions), properties(_properties), inherits(_inherits), type(_type) + , klass_get_name(klass_get_name), unit(unit) {} - klass_def(Eolian_Class const* klass, Eolian_Unit const* unit) : unit(unit) - , klass_get_name( ::eolian_class_c_get_function_name_get(klass)) + klass_def(Eolian_Class const* klass, Eolian_Unit const* unit) + : klass_get_name( ::eolian_class_c_get_function_name_get(klass)) + , unit(unit) { for(efl::eina::iterator namespace_iterator( ::eolian_class_namespaces_get(klass)) , namespace_last; namespace_iterator != namespace_last; ++namespace_iterator) diff --git a/src/lib/evas/canvas/efl_canvas_animation.eo b/src/lib/evas/canvas/efl_canvas_animation.eo index 8040ac9dbe..63f882c09b 100644 --- a/src/lib/evas/canvas/efl_canvas_animation.eo +++ b/src/lib/evas/canvas/efl_canvas_animation.eo @@ -1,6 +1,6 @@ import efl_canvas_animation_types; -class Efl.Canvas.Animation (Efl.Object, Efl.Playable) +abstract Efl.Canvas.Animation (Efl.Object, Efl.Playable) { [[Efl animation class]] eo_prefix: efl_animation; diff --git a/src/lib/evas/canvas/efl_canvas_object.eo b/src/lib/evas/canvas/efl_canvas_object.eo index 14dfa3e61a..ac4577896f 100644 --- a/src/lib/evas/canvas/efl_canvas_object.eo +++ b/src/lib/evas/canvas/efl_canvas_object.eo @@ -608,6 +608,7 @@ abstract Efl.Canvas.Object (Efl.Loop_Consumer, Efl.Gfx.Entity, Efl.Gfx.Color, Ef Efl.Gfx.Size_Hint.hint_max { get; set; } Efl.Gfx.Size_Hint.hint_margin { get; set; } Efl.Gfx.Size_Hint.hint_weight { get; set; } + Efl.Gfx.Size_Hint.hint_fill { get; set; } Efl.Gfx.Entity.scale { set; get; } Efl.Input.Interface.seat_event_filter { get; set; } Efl.Loop_Consumer.loop { get; } diff --git a/src/lib/evas/canvas/evas_canvas3d_object.eo b/src/lib/evas/canvas/evas_canvas3d_object.eo index 0fa7161f29..8b917cf555 100644 --- a/src/lib/evas/canvas/evas_canvas3d_object.eo +++ b/src/lib/evas/canvas/evas_canvas3d_object.eo @@ -1,6 +1,6 @@ import evas_canvas3d_types; -class Evas.Canvas3D.Object (Efl.Object) +abstract Evas.Canvas3D.Object (Efl.Object) { [[Evas 3D canvas object class]] data: Evas_Canvas3D_Object_Data; diff --git a/src/lib/evas/canvas/evas_object_main.c b/src/lib/evas/canvas/evas_object_main.c index 954528ca29..8f218fa8c2 100644 --- a/src/lib/evas/canvas/evas_object_main.c +++ b/src/lib/evas/canvas/evas_object_main.c @@ -325,9 +325,6 @@ _efl_canvas_object_efl_object_finalize(Eo *eo_obj, Evas_Object_Protected_Data *o if (!obj->legacy.weight_set) efl_gfx_size_hint_weight_set(eo_obj, 1.0, 1.0); - if (!obj->legacy.align_set) - efl_gfx_size_hint_align_set(eo_obj, -1.0, -1.0); - if (obj->legacy.visible_set /* && ... */) { obj->legacy.finalized = EINA_TRUE; @@ -1605,6 +1602,8 @@ _evas_object_size_hint_alloc(Evas_Object *eo_obj EINA_UNUSED, Evas_Object_Protec obj->size_hints->max.h = -1; obj->size_hints->align.x = 0.5; obj->size_hints->align.y = 0.5; + obj->size_hints->fill.x = 1; + obj->size_hints->fill.y = 1; obj->size_hints->dispmode = EVAS_DISPLAY_MODE_NONE; } @@ -1830,7 +1829,6 @@ _efl_canvas_object_efl_gfx_size_hint_hint_align_set(Eo *eo_obj, Evas_Object_Prot EVAS_OBJECT_DATA_VALID_CHECK(obj); evas_object_async_block(obj); - if (!obj->legacy.align_set) obj->legacy.align_set = 1; if (EINA_UNLIKELY(!obj->size_hints)) { if (EINA_DBL_EQ(x, 0.5) && EINA_DBL_EQ(y, 0.5)) return; @@ -1920,6 +1918,49 @@ _efl_canvas_object_efl_gfx_size_hint_hint_margin_set(Eo *eo_obj, Evas_Object_Pro evas_object_inform_call_changed_size_hints(eo_obj, obj); } +EOLIAN static void +_efl_canvas_object_efl_gfx_size_hint_hint_fill_get(const Eo *eo_obj EINA_UNUSED, Evas_Object_Protected_Data *obj, Eina_Bool *x, Eina_Bool *y) +{ + if ((!obj->size_hints) || obj->delete_me) + { + if (x) *x = EINA_TRUE; + if (y) *y = EINA_TRUE; + return; + } + if (x) *x = obj->size_hints->fill.x; + if (y) *y = obj->size_hints->fill.y; +} + +EOLIAN static void +_efl_canvas_object_efl_gfx_size_hint_hint_fill_set(Eo *eo_obj, Evas_Object_Protected_Data *obj, Eina_Bool x, Eina_Bool y) +{ + if (obj->delete_me) + return; + + if (obj->legacy.ctor) + { + ERR("fill_set() not supported. use align_set() with EVAS_HINT_FILL instead."); + return; + } + + EVAS_OBJECT_DATA_VALID_CHECK(obj); + evas_object_async_block(obj); + + x = !!x; + y = !!y; + + if (EINA_UNLIKELY(!obj->size_hints)) + { + if (x && y) return; + _evas_object_size_hint_alloc(eo_obj, obj); + } + if ((obj->size_hints->fill.x == x) && (obj->size_hints->fill.y == y)) return; + obj->size_hints->fill.x = x; + obj->size_hints->fill.y = y; + + evas_object_inform_call_changed_size_hints(eo_obj, obj); +} + EAPI void evas_object_show(Evas_Object *eo_obj) { @@ -2331,6 +2372,7 @@ _efl_canvas_object_efl_object_dbg_info_get(Eo *eo_obj, Evas_Object_Protected_Dat Eina_Bool propagate_event; Eina_Bool repeat_event; Eina_Bool clipees_has; + Eina_Bool fillx, filly; visible = efl_gfx_entity_visible_get(eo_obj); layer = efl_gfx_stack_layer_get(eo_obj); @@ -2342,6 +2384,7 @@ _efl_canvas_object_efl_object_dbg_info_get(Eo *eo_obj, Evas_Object_Protected_Dat //efl_gfx_size_hint_request_get(eo_obj, &requestw, &requesth); efl_gfx_size_hint_align_get(eo_obj, &dblx, &dbly); efl_gfx_size_hint_weight_get(eo_obj, &dblw, &dblh); + efl_gfx_size_hint_fill_get(eo_obj, &fillx, &filly); efl_gfx_color_get(eo_obj, &r, &g, &b, &a); focus = evas_object_focus_get(eo_obj); m = efl_canvas_object_pointer_mode_get(eo_obj); @@ -2383,6 +2426,10 @@ _efl_canvas_object_efl_object_dbg_info_get(Eo *eo_obj, Evas_Object_Protected_Dat EFL_DBG_INFO_APPEND(node, "x", EINA_VALUE_TYPE_DOUBLE, dblx); EFL_DBG_INFO_APPEND(node, "y", EINA_VALUE_TYPE_DOUBLE, dbly); + node = EFL_DBG_INFO_LIST_APPEND(group, "Fill"); + EFL_DBG_INFO_APPEND(node, "x", EINA_VALUE_TYPE_CHAR, fillx); + EFL_DBG_INFO_APPEND(node, "y", EINA_VALUE_TYPE_CHAR, filly); + node = EFL_DBG_INFO_LIST_APPEND(group, "Weight"); EFL_DBG_INFO_APPEND(node, "w", EINA_VALUE_TYPE_DOUBLE, dblw); EFL_DBG_INFO_APPEND(node, "h", EINA_VALUE_TYPE_DOUBLE, dblh); diff --git a/src/lib/evas/canvas/evas_object_table.c b/src/lib/evas/canvas/evas_object_table.c index a735655eb6..bc18487e95 100644 --- a/src/lib/evas/canvas/evas_object_table.c +++ b/src/lib/evas/canvas/evas_object_table.c @@ -330,6 +330,7 @@ _evas_object_table_calculate_hints_homogeneous(Evas_Object *o, Evas_Table_Data * Evas_Object_Table_Option *opt; Evas_Coord minw, minh, o_minw, o_minh; Eina_Bool expand_h, expand_v; + Eina_Bool fill_h, fill_v; o_minw = 0; o_minh = 0; @@ -350,6 +351,8 @@ _evas_object_table_calculate_hints_homogeneous(Evas_Object *o, Evas_Table_Data * (child, &opt->pad.l, &opt->pad.r, &opt->pad.t, &opt->pad.b); evas_object_size_hint_align_get(child, &opt->align.h, &opt->align.v); evas_object_size_hint_weight_get(child, &weightw, &weighth); + //only for Efl.Ui.Table + efl_gfx_size_hint_fill_get(child, &fill_h, &fill_v); child_minw = opt->min.w + opt->pad.l + opt->pad.r; child_minh = opt->min.h + opt->pad.t + opt->pad.b; @@ -375,13 +378,13 @@ _evas_object_table_calculate_hints_homogeneous(Evas_Object *o, Evas_Table_Data * expand_v = 1; } - opt->fill_h = 0; + opt->fill_h = fill_h; if (opt->align.h < 0.0) { opt->align.h = 0.5; opt->fill_h = 1; } - opt->fill_v = 0; + opt->fill_v = fill_v; if (opt->align.v < 0.0) { opt->align.v = 0.5; diff --git a/src/lib/evas/canvas/evas_render.c b/src/lib/evas/canvas/evas_render.c index 57fc72226d..80c960bda9 100644 --- a/src/lib/evas/canvas/evas_render.c +++ b/src/lib/evas/canvas/evas_render.c @@ -3582,8 +3582,8 @@ evas_render_updates_internal(Evas *eo_e, { eina_evlog("+render_output_async_flush", eo_e, 0.0, NULL); efl_ref(eo_e); - e->rendering = EINA_TRUE; - _rendering_evases = eina_list_append(_rendering_evases, e); + _rendering_evases = eina_list_prepend(_rendering_evases, e); + e->rendering = _rendering_evases; _cb_always_call(eo_e, EVAS_CALLBACK_RENDER_FLUSH_PRE, NULL); evas_thread_queue_flush((Evas_Thread_Command_Cb)evas_render_pipe_wakeup, e); eina_evlog("-render_output_async_flush", eo_e, 0.0, NULL); @@ -3856,8 +3856,8 @@ evas_render_wakeup(Evas *eo_e) } /* post rendering */ - _rendering_evases = eina_list_remove(_rendering_evases, evas); - evas->rendering = EINA_FALSE; + _rendering_evases = eina_list_remove_list(_rendering_evases, evas->rendering); + evas->rendering = NULL; post.updated_area = ret_updates; _cb_always_call(eo_e, EVAS_CALLBACK_RENDER_POST, &post); diff --git a/src/lib/evas/common/evas_image_main.c b/src/lib/evas/common/evas_image_main.c index 2403a75e2b..a9cee630aa 100644 --- a/src/lib/evas/common/evas_image_main.c +++ b/src/lib/evas/common/evas_image_main.c @@ -662,18 +662,22 @@ _evas_common_rgba_image_post_surface(Image_Entry *ie) { im->pixman.im = pixman_image_create_bits ( -// FIXME: endianess determines this +#ifdef WORDS_BIGENDIAN + PIXMAN_b8g8r8a8, +#else PIXMAN_a8r8g8b8, -// PIXMAN_b8g8r8a8, +#endif w, h, im->image.data, w * 4); } else { im->pixman.im = pixman_image_create_bits ( -// FIXME: endianess determines this +#ifdef WORDS_BIGENDIAN + PIXMAN_b8g8r8x8, +#else PIXMAN_x8r8g8b8, -// PIXMAN_b8g8r8x8, +#endif w, h, im->image.data, w * 4); } # else diff --git a/src/lib/evas/include/evas_private.h b/src/lib/evas/include/evas_private.h index 622922f2c8..4a0efdb8fb 100644 --- a/src/lib/evas/include/evas_private.h +++ b/src/lib/evas/include/evas_private.h @@ -62,6 +62,7 @@ typedef struct _Evas_Layer Evas_Layer; typedef struct _Evas_Size Evas_Size; typedef struct _Evas_Aspect Evas_Aspect; typedef struct _Evas_Border Evas_Border; +typedef struct _Evas_Bool_Pair Evas_Bool_Pair; typedef struct _Evas_Double_Pair Evas_Double_Pair; typedef struct _Evas_Size_Hints Evas_Size_Hints; typedef struct _Evas_Data_Node Evas_Data_Node; @@ -890,12 +891,13 @@ struct _Evas_Public_Data Evas_Device *default_mouse; Evas_Device *default_keyboard; + Eina_List *rendering; + unsigned char changed : 1; unsigned char delete_me : 1; unsigned char invalidate : 1; unsigned char cleanup : 1; Eina_Bool is_frozen : 1; - Eina_Bool rendering : 1; Eina_Bool inside_post_render : 1; Eina_Bool devices_modified : 1; }; @@ -932,6 +934,11 @@ struct _Evas_Border Evas_Coord l, r, t, b; }; +struct _Evas_Bool_Pair +{ + Eina_Bool x, y; +}; + struct _Evas_Double_Pair { double x, y; @@ -944,6 +951,7 @@ struct _Evas_Size_Hints Evas_Aspect aspect; Evas_Double_Pair align, weight; Evas_Border padding; + Evas_Bool_Pair fill; Evas_Display_Mode dispmode; }; @@ -1186,7 +1194,6 @@ struct _Evas_Object_Protected_Data Eina_Bool ctor : 1; // used legacy constructor Eina_Bool visible_set : 1; // visibility manually set Eina_Bool weight_set : 1; // weight manually set - Eina_Bool align_set : 1; // align manually set Eina_Bool finalized : 1; // object fully constructed } legacy; diff --git a/src/modules/ecore_evas/engines/drm/ecore_evas_drm.c b/src/modules/ecore_evas/engines/drm/ecore_evas_drm.c index 794cf841fd..5668b416d1 100644 --- a/src/modules/ecore_evas/engines/drm/ecore_evas_drm.c +++ b/src/modules/ecore_evas/engines/drm/ecore_evas_drm.c @@ -718,27 +718,32 @@ static void _cb_pageflip(int fd EINA_UNUSED, unsigned int frame EINA_UNUSED, unsigned int sec, unsigned int usec, void *data) { Ecore_Evas *ee; + Ecore_Drm2_Output *output; Ecore_Evas_Engine_Drm_Data *edata; int ret; - ee = data; + output = data; + + ee = ecore_drm2_output_user_data_get(output); + if (!ee) return; + edata = ee->engine.data; - ret = ecore_drm2_fb_flip_complete(edata->output); + ret = ecore_drm2_fb_flip_complete(output); if (edata->ticking) { int x, y, w, h; double t = (double)sec + ((double)usec / 1000000); - ecore_drm2_output_info_get(edata->output, &x, &y, &w, &h, NULL); + ecore_drm2_output_info_get(output, &x, &y, &w, &h, NULL); if (!edata->once) t = ecore_time_get(); ecore_evas_animator_tick(ee, &(Eina_Rectangle){x, y, w, h}, t - edata->offset); } else if (ret) - ecore_drm2_fb_flip(NULL, edata->output); + ecore_drm2_fb_flip(NULL, output); } static void @@ -952,6 +957,51 @@ static Ecore_Evas_Engine_Func _ecore_evas_drm_engine_func = _drm_last_tick_get, }; +#ifdef BUILD_ECORE_EVAS_GL_DRM +static void * +_drm_gl_canvas_setup(Ecore_Evas *ee, Ecore_Evas_Engine_Drm_Data *edata) +{ + Evas_Engine_Info_GL_Drm *einfo; + char *num; + + einfo = (Evas_Engine_Info_GL_Drm *)evas_engine_info_get(ee->evas); + if (!einfo) return NULL; + + einfo->info.vsync = EINA_TRUE; + + num = getenv("EVAS_DRM_VSYNC"); + if ((num) && (!atoi(num))) + einfo->info.vsync = EINA_FALSE; + + einfo->info.dev = edata->dev; + einfo->info.bpp = edata->bpp; + einfo->info.depth = edata->depth; + einfo->info.format = edata->format; + einfo->info.rotation = ee->rotation; + einfo->info.output = edata->output; + + return einfo; +} +#endif + +static void * +_drm_canvas_setup(Ecore_Evas *ee, Ecore_Evas_Engine_Drm_Data *edata) +{ + Evas_Engine_Info_Drm *einfo; + + einfo = (Evas_Engine_Info_Drm *)evas_engine_info_get(ee->evas); + if (!einfo) return NULL; + + einfo->info.dev = edata->dev; + einfo->info.bpp = edata->bpp; + einfo->info.depth = edata->depth; + einfo->info.format = edata->format; + einfo->info.rotation = ee->rotation; + einfo->info.output = edata->output; + + return einfo; +} + static Ecore_Evas * _ecore_evas_new_internal(const char *device, int x, int y, int w, int h, Eina_Bool gl) { @@ -961,8 +1011,10 @@ _ecore_evas_new_internal(const char *device, int x, int y, int w, int h, Eina_Bo int method, mw, mh; void *tinfo; - if (gl) method = evas_render_method_lookup("gl_drm"); - else method = evas_render_method_lookup("drm"); + if (gl) + method = evas_render_method_lookup("gl_drm"); + else + method = evas_render_method_lookup("drm"); if (!method) return NULL; @@ -1039,48 +1091,23 @@ _ecore_evas_new_internal(const char *device, int x, int y, int w, int h, Eina_Bo evas_event_callback_add(ee->evas, EVAS_CALLBACK_RENDER_POST, _drm_render_updates, ee); - tinfo = evas_engine_info_get(ee->evas); #ifdef BUILD_ECORE_EVAS_GL_DRM - if (tinfo && gl) - { - char *num; - Evas_Engine_Info_GL_Drm *einfo = tinfo; - - einfo->info.vsync = EINA_TRUE; - - num = getenv("EVAS_DRM_VSYNC"); - if ((num) && (!atoi(num))) - einfo->info.vsync = EINA_FALSE; - - einfo->info.dev = edata->dev; - einfo->info.bpp = edata->bpp; - einfo->info.depth = edata->depth; - einfo->info.format = edata->format; - einfo->info.rotation = ee->rotation; - einfo->info.output = edata->output; - if (!evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo)) - { - ERR("evas_engine_info_set() for engine '%s' failed", ee->driver); - goto eng_err; - } - } + if (gl) + tinfo = _drm_gl_canvas_setup(ee, edata); else #endif - if (tinfo) - { - Evas_Engine_Info_Drm *einfo = tinfo; + tinfo = _drm_canvas_setup(ee, edata); - einfo->info.dev = edata->dev; - einfo->info.bpp = edata->bpp; - einfo->info.depth = edata->depth; - einfo->info.format = edata->format; - einfo->info.rotation = ee->rotation; - einfo->info.output = edata->output; - if (!evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo)) - { - ERR("evas_engine_info_set() for engine '%s' failed", ee->driver); - goto eng_err; - } + if (!tinfo) + { + ERR("evas_engine_info_get() for engine '%s' failed", ee->driver); + goto eng_err; + } + + if (!evas_engine_info_set(ee->evas, (Evas_Engine_Info *)tinfo)) + { + ERR("evas_engine_info_set() for engine '%s' failed", ee->driver); + goto eng_err; } ee->prop.window = ecore_drm2_output_crtc_get(edata->output); diff --git a/src/modules/emotion/gstreamer1/emotion_sink.c b/src/modules/emotion/gstreamer1/emotion_sink.c index 5816628a56..2bd91359ac 100644 --- a/src/modules/emotion/gstreamer1/emotion_sink.c +++ b/src/modules/emotion/gstreamer1/emotion_sink.c @@ -31,6 +31,7 @@ enum { G_DEFINE_TYPE_WITH_CODE(EmotionVideoSink, emotion_video_sink, GST_TYPE_VIDEO_SINK, + G_ADD_PRIVATE(EmotionVideoSink) _do_init); @@ -43,7 +44,7 @@ emotion_video_sink_init(EmotionVideoSink* sink) EmotionVideoSinkPrivate* priv; INF("sink init"); - sink->priv = priv = G_TYPE_INSTANCE_GET_PRIVATE(sink, EMOTION_TYPE_VIDEO_SINK, EmotionVideoSinkPrivate); + sink->priv = priv = emotion_video_sink_get_instance_private(sink); gst_video_info_init (&priv->info); priv->eheight = 0; priv->func = NULL; @@ -587,8 +588,6 @@ emotion_video_sink_class_init(EmotionVideoSinkClass* klass) gstbase_sink_class = GST_BASE_SINK_CLASS(klass); gstvideo_sink_class = GST_VIDEO_SINK_CLASS(klass); - g_type_class_add_private(klass, sizeof(EmotionVideoSinkPrivate)); - gobject_class->set_property = emotion_video_sink_set_property; gobject_class->get_property = emotion_video_sink_get_property; diff --git a/src/modules/evas/engines/gl_generic/evas_ector_gl_buffer.eo b/src/modules/evas/engines/gl_generic/evas_ector_gl_buffer.eo index 57335dd511..7830416db5 100644 --- a/src/modules/evas/engines/gl_generic/evas_ector_gl_buffer.eo +++ b/src/modules/evas/engines/gl_generic/evas_ector_gl_buffer.eo @@ -1,4 +1,4 @@ -class Evas.Ector.GL.Buffer (Efl.Object, Evas.Ector.Buffer, Ector.GL.Buffer) +class Evas.Ector.GL.Buffer extends Ector.GL.Buffer implements Evas.Ector.Buffer { [[An Ector GL buffer capable of being mapped, drawn and rendered to. diff --git a/src/modules/evas/engines/gl_generic/evas_ector_gl_image_buffer.eo b/src/modules/evas/engines/gl_generic/evas_ector_gl_image_buffer.eo index ccf1534549..6944a3a446 100644 --- a/src/modules/evas/engines/gl_generic/evas_ector_gl_image_buffer.eo +++ b/src/modules/evas/engines/gl_generic/evas_ector_gl_image_buffer.eo @@ -1,4 +1,4 @@ -class Evas.Ector.GL.Image.Buffer (Efl.Object, Evas.Ector.Buffer, Ector.GL.Buffer) +class Evas.Ector.GL.Image.Buffer extends Ector.GL.Buffer implements Evas.Ector.Buffer { [[An Ector GL buffer wrapping an existing Evas_GL_Image.]] implements { diff --git a/src/modules/evas/image_savers/tgv/evas_image_save_tgv.c b/src/modules/evas/image_savers/tgv/evas_image_save_tgv.c index aa0a82b943..9fee4de364 100644 --- a/src/modules/evas/image_savers/tgv/evas_image_save_tgv.c +++ b/src/modules/evas/image_savers/tgv/evas_image_save_tgv.c @@ -125,7 +125,8 @@ _save_direct_tgv(RGBA_Image *im, const char *file, int compress) buffer_size = LZ4_compressBound(etc_data_size); buffer = malloc(buffer_size); if (!buffer) goto on_error; - data_size = LZ4_compressHC((char *) data, (char *) buffer, etc_data_size); + data_size = LZ4_compress_HC + ((char *)data, (char *)buffer, etc_data_size, buffer_size, 16); } else { @@ -486,8 +487,11 @@ evas_image_save_file_tgv(RGBA_Image *im, if (compress) { - wlen = LZ4_compressHC((char *) buffer, (char *) comp, - block_count * etc_block_size); + wlen = LZ4_compress_HC + ((char *)buffer, (char *)comp, + block_count * etc_block_size, + LZ4_compressBound(block_count * etc_block_size), + 16); } else { diff --git a/src/tests/efl_mono/Eina.cs b/src/tests/efl_mono/Eina.cs index db42b23d7f..1009252c73 100644 --- a/src/tests/efl_mono/Eina.cs +++ b/src/tests/efl_mono/Eina.cs @@ -380,6 +380,20 @@ class TestEinaSlice Test.Assert(slc.GetBytes().SequenceEqual(base_seq)); } + public static void test_eina_rw_slice_inout() + { + var t = new Dummy.TestObject(); + var rw_seq = new byte[4]{0xA, 0xA, 0xA, 0xA}; + var expected_seq = new byte[4]{0xA, 0xB, 0xC, 0xD}; + var pinnedRWData = GCHandle.Alloc(rw_seq, GCHandleType.Pinned); + IntPtr ptr = pinnedRWData.AddrOfPinnedObject(); + var slc = new Eina.RwSlice(ptr, (UIntPtr)4); + Test.Assert(t.EinaRwSliceInout(ref slc)); + Test.Assert(slc.Mem != IntPtr.Zero); + Test.Assert(slc.Length == rw_seq.Length); + Test.Assert(slc.GetBytes().SequenceEqual(expected_seq)); + } + /* public static void test_eina_slice_return() { @@ -4047,5 +4061,12 @@ class TestEinaAccessor } } +class TestEinaLog +{ + public static void basic_log_usage() + { + Eina.Log.Error("This should work"); + } +} } diff --git a/src/tests/efl_mono/Errors.cs b/src/tests/efl_mono/Errors.cs index 9f4ebf2690..802ac337c0 100644 --- a/src/tests/efl_mono/Errors.cs +++ b/src/tests/efl_mono/Errors.cs @@ -5,33 +5,22 @@ namespace TestSuite class TestEinaError { + public static void basic_efl_error_available() + { + Test.AssertEquals(Eina.Error.UNHANDLED_EXCEPTION.Message, "Unhandled C# exception occurred."); + } public static void basic_test() { Eina.Error.Clear(); - Test.AssertNotRaises(Eina.Error.RaiseIfOccurred); Eina.Error.Set(Eina.Error.ENOENT); - Test.AssertRaises(Eina.Error.RaiseIfOccurred); + Eina.Error err = Eina.Error.Get(); + Test.AssertEquals(err, Eina.Error.ENOENT); } } class TestEolianError { - public static void global_eina_error() - { - var obj = new Dummy.TestObject(); - Test.AssertRaises(() => obj.RaisesEinaError()); - } - - class Child : Dummy.TestObject { - } - - public static void global_eina_error_inherited() - { - var obj = new Child(); - Test.AssertRaises(() => obj.RaisesEinaError()); - } - class CustomException : Exception { public CustomException(string msg): base(msg) {} } diff --git a/src/tests/efl_mono/Inheritance.cs b/src/tests/efl_mono/Inheritance.cs new file mode 100644 index 0000000000..344c6da71f --- /dev/null +++ b/src/tests/efl_mono/Inheritance.cs @@ -0,0 +1,55 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Runtime.InteropServices; +using System.Runtime.CompilerServices; + +using EinaTestData; +using static EinaTestData.BaseData; + +namespace TestSuite +{ + +class TestInheritance +{ + internal class Inherit1 : Dummy.TestObject + { + override public void IntOut (int x, out int y) + { + y = 10*x; + } + } + + internal class Inherit2 : Dummy.TestObject, Dummy.InheritIface + { + override public void IntOut (int x, out int y) + { + Console.WriteLine("IntOut"); + y = 10*x; + } + + public string StringshareTest (string i) + { + Console.WriteLine("StringshareTest"); + return "Hello World"; + } + } + + public static void test_inherit_from_regular_class() + { + var obj = new Inherit1(); + int i = Dummy.InheritHelper.ReceiveDummyAndCallIntOut(obj); + Test.AssertEquals (50, i); + } + + public static void test_inherit_from_iface() + { + var obj = new Inherit2(); + int i = Dummy.InheritHelper.ReceiveDummyAndCallIntOut(obj); + Test.AssertEquals (50, i); + string s = Dummy.InheritHelper.ReceiveDummyAndCallInStringshare(obj); + Test.AssertEquals ("Hello World", s); + } +} + +} diff --git a/src/tests/efl_mono/dummy_inherit_helper.eo b/src/tests/efl_mono/dummy_inherit_helper.eo new file mode 100644 index 0000000000..101c759390 --- /dev/null +++ b/src/tests/efl_mono/dummy_inherit_helper.eo @@ -0,0 +1,17 @@ +class Dummy.Inherit_Helper extends Efl.Object +{ + methods { + receive_dummy_and_call_int_out @class { + params { + @in x: Dummy.Test_Object; + } + return: int; + } + receive_dummy_and_call_in_stringshare @class { + params { + @in x: Dummy.Inherit_Iface; + } + return: stringshare; + } + } +} diff --git a/src/tests/efl_mono/dummy_inherit_iface.eo b/src/tests/efl_mono/dummy_inherit_iface.eo new file mode 100644 index 0000000000..6333a86f42 --- /dev/null +++ b/src/tests/efl_mono/dummy_inherit_iface.eo @@ -0,0 +1,10 @@ +interface Dummy.Inherit_Iface { + methods { + stringshare_test { + params { + @in v: stringshare; + } + return: stringshare @owned; + } + } +} diff --git a/src/tests/efl_mono/dummy_test_object.eo b/src/tests/efl_mono/dummy_test_object.eo index 4a6ea5fcc6..e6c42f64c8 100644 --- a/src/tests/efl_mono/dummy_test_object.eo +++ b/src/tests/efl_mono/dummy_test_object.eo @@ -266,6 +266,13 @@ class Dummy.Test_Object extends Efl.Object implements Efl.Part, Dummy.Test_Iface return: bool; } + eina_rw_slice_inout { + params { + @inout slice: Eina.Rw_Slice; + } + return: bool; + } + /* eina_slice_return { return: Eina.Slice; diff --git a/src/tests/efl_mono/libefl_mono_native_test.c b/src/tests/efl_mono/libefl_mono_native_test.c index 576690bb86..4c46e1e8dc 100644 --- a/src/tests/efl_mono/libefl_mono_native_test.c +++ b/src/tests/efl_mono/libefl_mono_native_test.c @@ -8,9 +8,20 @@ #include #include +#ifdef EOAPI #undef EOAPI +#endif + +#ifdef EWAPI +#undef EWAPI +#endif + +#ifdef EAPI #undef EAPI +#endif + #define EOAPI EAPI EAPI_WEAK +#define EWAPI EAPI EAPI_WEAK #ifdef _WIN32 # ifdef EFL_BUILD @@ -39,6 +50,8 @@ #include "dummy_child.eo.h" #include "dummy_test_iface.eo.h" #include "dummy_another_iface.eo.h" +#include "dummy_inherit_iface.eo.h" +#include "dummy_inherit_helper.eo.h" #include @@ -71,6 +84,13 @@ typedef struct Dummy_Child_Data { } Dummy_Child_Data; +typedef struct Dummy_Inherit_Helper_Data +{ +} Dummy_Inherit_Helper_Data; + +typedef struct Dummy_Inherit_Iface_Data +{ +} Dummy_Inherit_Iface_Data; static void *_new_int(int v) @@ -331,6 +351,14 @@ Eina_Bool _dummy_test_object_eina_rw_slice_out(EINA_UNUSED Eo *obj, EINA_UNUSED return EINA_TRUE; } +Eina_Bool _dummy_test_object_eina_rw_slice_inout(EINA_UNUSED Eo *obj, EINA_UNUSED Dummy_Test_Object_Data *pd, Eina_Rw_Slice *slice) +{ + if (!slice) return EINA_FALSE; + for (size_t i = 0; i < slice->len; i++) + slice->bytes[i] += (uint8_t)i; + return EINA_TRUE; +} + Eina_Slice _dummy_test_object_eina_slice_return(EINA_UNUSED Eo *obj, EINA_UNUSED Dummy_Test_Object_Data *pd) { Eina_Slice slc = EINA_SLICE_ARRAY(base_seq); @@ -3833,7 +3861,7 @@ Eina_Future* _dummy_test_object_get_future(EINA_UNUSED Eo *obj, Dummy_Test_Objec return eina_future_new(pd->promise); } -void _dummy_test_object_fulfill_promise(Eo *obj, Dummy_Test_Object_Data *pd, int data) +void _dummy_test_object_fulfill_promise(Eo *obj EINA_UNUSED, Dummy_Test_Object_Data *pd, int data) { if (pd->promise == NULL) { @@ -3846,7 +3874,7 @@ void _dummy_test_object_fulfill_promise(Eo *obj, Dummy_Test_Object_Data *pd, int eina_promise_resolve(pd->promise, v); } -void _dummy_test_object_reject_promise(Eo *obj, Dummy_Test_Object_Data *pd, Eina_Error err) +void _dummy_test_object_reject_promise(Eo *obj EINA_UNUSED, Dummy_Test_Object_Data *pd, Eina_Error err) { if (pd->promise == NULL) { @@ -3857,7 +3885,7 @@ void _dummy_test_object_reject_promise(Eo *obj, Dummy_Test_Object_Data *pd, Eina eina_promise_reject(pd->promise, err); } -Eina_Accessor *_dummy_test_object_clone_accessor(Eo *obj, Dummy_Test_Object_Data *pd, Eina_Accessor *acc) +Eina_Accessor *_dummy_test_object_clone_accessor(Eo *obj EINA_UNUSED, Dummy_Test_Object_Data *pd, Eina_Accessor *acc) { if (pd->list_for_accessor) eina_list_free(pd->list_for_accessor); @@ -3872,17 +3900,17 @@ Eina_Accessor *_dummy_test_object_clone_accessor(Eo *obj, Dummy_Test_Object_Data return eina_list_accessor_new(pd->list_for_accessor); } -void _dummy_test_object_dummy_test_iface_emit_test_conflicted(Eo *obj, Dummy_Test_Object_Data *pd) +void _dummy_test_object_dummy_test_iface_emit_test_conflicted(Eo *obj, Dummy_Test_Object_Data *pd EINA_UNUSED) { efl_event_callback_legacy_call(obj, DUMMY_TEST_IFACE_EVENT_CONFLICTED, NULL); } -void _dummy_test_object_dummy_test_iface_emit_nonconflicted(Eo *obj, Dummy_Test_Object_Data *pd) +void _dummy_test_object_dummy_test_iface_emit_nonconflicted(Eo *obj, Dummy_Test_Object_Data *pd EINA_UNUSED) { efl_event_callback_legacy_call(obj, DUMMY_TEST_IFACE_EVENT_NONCONFLICTED, NULL); } -void _dummy_test_object_dummy_another_iface_emit_another_conflicted(Eo *obj, Dummy_Test_Object_Data *pd) +void _dummy_test_object_dummy_another_iface_emit_another_conflicted(Eo *obj, Dummy_Test_Object_Data *pd EINA_UNUSED) { efl_event_callback_legacy_call(obj, DUMMY_ANOTHER_IFACE_EVENT_CONFLICTED, NULL); } @@ -3920,9 +3948,24 @@ _dummy_child_class_destructor(Efl_Class *klass) (void)klass; } +// Inherit +int _dummy_inherit_helper_receive_dummy_and_call_int_out(Eo *obj EINA_UNUSED, void *pd EINA_UNUSED, Dummy_Test_Object *x) +{ + int v = 8; + dummy_test_object_int_out (x, 5, &v); + return v; +} + +const char* _dummy_inherit_helper_receive_dummy_and_call_in_stringshare(Eo *obj EINA_UNUSED, void *pd EINA_UNUSED, Dummy_Test_Object *x) +{ + return dummy_inherit_iface_stringshare_test (x, eina_stringshare_add("hello world")); +} + #include "dummy_test_object.eo.c" #include "dummy_numberwrapper.eo.c" #include "dummy_child.eo.c" #include "dummy_test_iface.eo.c" #include "dummy_another_iface.eo.c" +#include "dummy_inherit_helper.eo.c" +#include "dummy_inherit_iface.eo.c" diff --git a/src/tests/efl_mono/meson.build b/src/tests/efl_mono/meson.build index 25541996e1..b01e2747af 100644 --- a/src/tests/efl_mono/meson.build +++ b/src/tests/efl_mono/meson.build @@ -1,4 +1,4 @@ -eo_files = ['dummy_child.eo', 'dummy_numberwrapper.eo', 'dummy_test_object.eo', 'dummy_test_iface.eo', 'dummy_another_iface.eo'] +eo_files = ['dummy_child.eo', 'dummy_numberwrapper.eo', 'dummy_test_object.eo', 'dummy_test_iface.eo', 'dummy_another_iface.eo', 'dummy_inherit_helper.eo', 'dummy_inherit_iface.eo'] eo_file_targets = [] @@ -57,7 +57,8 @@ efl_mono_src = [ 'Strings.cs', 'Structs.cs', 'Value.cs', - 'ValueEolian.cs' + 'ValueEolian.cs', + 'Inheritance.cs', ] efl_mono_suite = executable('efl-mono-suite', diff --git a/src/tests/elementary/efl_ui_test_grid.c b/src/tests/elementary/efl_ui_test_grid.c index a6975ab262..5fbadf90ed 100644 --- a/src/tests/elementary/efl_ui_test_grid.c +++ b/src/tests/elementary/efl_ui_test_grid.c @@ -20,7 +20,7 @@ grid_setup() box = efl_add(EFL_UI_BOX_CLASS, win, efl_ui_direction_set(efl_added, EFL_UI_DIR_VERTICAL)); efl_gfx_size_hint_weight_set(box, EFL_GFX_SIZE_HINT_EXPAND, EFL_GFX_SIZE_HINT_EXPAND); - efl_gfx_size_hint_align_set(box, EFL_GFX_SIZE_HINT_FILL, EFL_GFX_SIZE_HINT_FILL); + efl_gfx_size_hint_fill_set(box, EINA_TRUE, EINA_TRUE); elm_win_resize_object_add(win, box); grid = efl_add(EFL_UI_GRID_CLASS, box); diff --git a/src/tests/elementary/elm_test_layout.c b/src/tests/elementary/elm_test_layout.c index 0419a9cbeb..bead485a03 100644 --- a/src/tests/elementary/elm_test_layout.c +++ b/src/tests/elementary/elm_test_layout.c @@ -6,7 +6,7 @@ #include #include "elm_suite.h" -EFL_START_TEST (elm_layout_legacy_type_check) +EFL_START_TEST(elm_layout_test_legacy_type_check) { Evas_Object *win, *layout; const char *type; @@ -41,7 +41,7 @@ EFL_START_TEST(elm_atspi_role_get) } EFL_END_TEST -EFL_START_TEST(elm_layout_swallows) +EFL_START_TEST(elm_layout_test_swallows) { char buf[PATH_MAX]; Evas_Object *win, *ly, *bt, *bt2; @@ -82,7 +82,7 @@ _propagated_cb(void *data EINA_UNUSED, return v; } -EFL_START_TEST(elm_layout_model_connect) +EFL_START_TEST(elm_layout_test_model_connect) { char buf[PATH_MAX]; Evas_Object *win, *ly; @@ -119,8 +119,8 @@ EFL_END_TEST void elm_test_layout(TCase *tc) { - tcase_add_test(tc, elm_layout_legacy_type_check); + tcase_add_test(tc, elm_layout_test_legacy_type_check); tcase_add_test(tc, elm_atspi_role_get); - tcase_add_test(tc, elm_layout_swallows); - tcase_add_test(tc, elm_layout_model_connect); + tcase_add_test(tc, elm_layout_test_swallows); + tcase_add_test(tc, elm_layout_test_model_connect); } diff --git a/src/tests/eolian/data/base.eo b/src/tests/eolian/data/base.eo index 1576573406..4f1b93d518 100644 --- a/src/tests/eolian/data/base.eo +++ b/src/tests/eolian/data/base.eo @@ -1,4 +1,4 @@ -class Base { +abstract Base { methods { @property z { values { diff --git a/src/tests/eolian/data/nmsp1_nmsp11_class2.eo b/src/tests/eolian/data/nmsp1_nmsp11_class2.eo index 13750e5f46..40c7b854b9 100644 --- a/src/tests/eolian/data/nmsp1_nmsp11_class2.eo +++ b/src/tests/eolian/data/nmsp1_nmsp11_class2.eo @@ -1,4 +1,4 @@ -class nmsp1.nmsp11.class2 +abstract nmsp1.nmsp11.class2 { methods { @property a { diff --git a/src/tests/eolian/data/nmsp2_class1.eo b/src/tests/eolian/data/nmsp2_class1.eo index 91e9de6fb1..e92be95c1d 100644 --- a/src/tests/eolian/data/nmsp2_class1.eo +++ b/src/tests/eolian/data/nmsp2_class1.eo @@ -1,3 +1,3 @@ -class nmsp2.class1 +mixin nmsp2.class1 { } diff --git a/src/tests/eolian/data/no_nmsp.eo b/src/tests/eolian/data/no_nmsp.eo index 740cd64212..daf4313282 100644 --- a/src/tests/eolian/data/no_nmsp.eo +++ b/src/tests/eolian/data/no_nmsp.eo @@ -1,4 +1,4 @@ -class no_nmsp +mixin no_nmsp { methods { foo { diff --git a/src/tests/eolian/data/object_impl.eo b/src/tests/eolian/data/object_impl.eo index e646a70ea4..9cbaed4f6e 100644 --- a/src/tests/eolian/data/object_impl.eo +++ b/src/tests/eolian/data/object_impl.eo @@ -1,4 +1,4 @@ -class Object_Impl extends Base { +abstract Object_Impl extends Base { methods { @property a { set { diff --git a/src/tests/eolian/data/override.eo b/src/tests/eolian/data/override.eo index 440dc2125b..221e12fc84 100644 --- a/src/tests/eolian/data/override.eo +++ b/src/tests/eolian/data/override.eo @@ -1,4 +1,4 @@ -class Override extends Base { +abstract Override extends Base { methods { @property a { set @pure_virtual { diff --git a/src/tests/eolian/data/override_ref.c b/src/tests/eolian/data/override_ref.c index a4b0c90d25..c177272ee3 100644 --- a/src/tests/eolian/data/override_ref.c +++ b/src/tests/eolian/data/override_ref.c @@ -92,7 +92,7 @@ _override_class_initializer(Efl_Class *klass) static const Efl_Class_Description _override_class_desc = { EO_VERSION, "Override", - EFL_CLASS_TYPE_REGULAR, + EFL_CLASS_TYPE_REGULAR_NO_INSTANT, sizeof(Override_Data), _override_class_initializer, NULL, diff --git a/src/tests/eolian/data/parts.eo b/src/tests/eolian/data/parts.eo index 773282d728..e7062f543b 100644 --- a/src/tests/eolian/data/parts.eo +++ b/src/tests/eolian/data/parts.eo @@ -1,7 +1,6 @@ -class Parts extends Override implements Base { +class Parts extends Override { parts { part1: Override; [[Part 1]] - part2: Base; [[Part 2]] - part3: Parts; [[Part 3]] + part2: Parts; [[Part 2]] } } diff --git a/src/tests/eolian/eolian_parsing.c b/src/tests/eolian/eolian_parsing.c index d93906bc56..ce2ea68e2f 100644 --- a/src/tests/eolian/eolian_parsing.c +++ b/src/tests/eolian/eolian_parsing.c @@ -1516,7 +1516,7 @@ EFL_START_TEST(eolian_parts) int i = 0; static const char *part_classes[] = { - "Override", "Base", "Parts" + "Override", "Parts" }; Eolian_State *eos = eolian_state_new(); @@ -1583,14 +1583,35 @@ EFL_START_TEST(eolian_mixins_require) //check that implements contains this one class { Eolian_Implement *impl; - Eina_Iterator *i = eolian_class_extensions_get (cl); + Eina_Iterator *i = eolian_class_implements_get(cl); + Eina_Array *tmp = eina_array_new(1); EINA_ITERATOR_FOREACH(i, impl) { - ck_assert_ptr_eq(eolian_implement_class_get(impl), base); + if (eolian_implement_class_get(impl) != cl) + { + eina_array_push(tmp, eolian_implement_class_get(impl)); + ck_assert_ptr_eq(eolian_implement_class_get(impl), base); + } } + ck_assert_int_eq(eina_array_count(tmp), 1); + eina_array_free(tmp); eina_iterator_free(i); } + //check that the mixins has the right require + { + Eina_Iterator *iter = eolian_class_requires_get(cl); + Eina_Array *tmp = eina_array_new(1); + + EINA_ITERATOR_FOREACH(iter, cl) + { + eina_array_push(tmp, cl); + } + ck_assert_int_eq(eina_array_count(tmp), 1); + ck_assert_ptr_eq(eina_array_data_get(tmp, 0), base); + eina_array_free(tmp); + eina_iterator_free(iter); + } eolian_state_free(eos); } EFL_END_TEST diff --git a/src/tests/eolian_cxx/c.c b/src/tests/eolian_cxx/c.c index ccd7ceb713..45c3e0af66 100644 --- a/src/tests/eolian_cxx/c.c +++ b/src/tests/eolian_cxx/c.c @@ -5,6 +5,7 @@ #include #include "a.eo.h" +#include "b.eo.h" #include "c.eo.h" struct _C_Data diff --git a/src/tests/eolian_cxx/c.eo b/src/tests/eolian_cxx/c.eo index 47c96cc1c5..fe7921c67a 100644 --- a/src/tests/eolian_cxx/c.eo +++ b/src/tests/eolian_cxx/c.eo @@ -1,4 +1,4 @@ -class C extends A +class C extends B { data: C_Data; implements { diff --git a/src/tests/eolian_cxx/d.c b/src/tests/eolian_cxx/d.c deleted file mode 100644 index bd1372b828..0000000000 --- a/src/tests/eolian_cxx/d.c +++ /dev/null @@ -1,25 +0,0 @@ -#ifdef HAVE_CONFIG_H -# include -#endif - -#include - -#include "a.eo.h" -#include "b.eo.h" -#include "c.eo.h" -#include "d.eo.h" - -struct _D_Data -{ - int callbacks; -}; -typedef struct _D_Data D_Data; - -#define MY_CLASS D_CLASS - -static Eo *_d_efl_object_constructor(Eo *obj EINA_UNUSED, D_Data *pd EINA_UNUSED) -{ - return efl_constructor(efl_super(obj, MY_CLASS)); -} - -#include "d.eo.c" diff --git a/src/tests/eolian_cxx/d.eo b/src/tests/eolian_cxx/d.eo deleted file mode 100644 index a3bf2a587f..0000000000 --- a/src/tests/eolian_cxx/d.eo +++ /dev/null @@ -1,7 +0,0 @@ -class D extends B implements C -{ - data: D_Data; - implements { - Efl.Object.constructor; - } -} diff --git a/src/tests/eolian_cxx/eolian_cxx_test_address_of.cc b/src/tests/eolian_cxx/eolian_cxx_test_address_of.cc index f6ef5a5747..45697f8e25 100644 --- a/src/tests/eolian_cxx/eolian_cxx_test_address_of.cc +++ b/src/tests/eolian_cxx/eolian_cxx_test_address_of.cc @@ -7,7 +7,6 @@ #include #include #include -#include #include "eolian_cxx_suite.h" @@ -15,16 +14,14 @@ EFL_START_TEST(eolian_cxx_test_addess_of_conversions) { efl::eo::eo_init init; - nonamespace::D d_obj; + nonamespace::C c_obj; - nonamespace::A* a_ptr = &d_obj; - nonamespace::B* b_ptr = &d_obj; - nonamespace::C* c_ptr = &d_obj; - nonamespace::D* d_ptr = &d_obj; + nonamespace::A* a_ptr = &c_obj; + nonamespace::B* b_ptr = &c_obj; + nonamespace::C* c_ptr = &c_obj; fail_unless(a_ptr == (void*) b_ptr); fail_unless(a_ptr == (void*) c_ptr); - fail_unless(a_ptr == (void*) d_ptr); } EFL_END_TEST diff --git a/src/tests/eolian_cxx/meson.build b/src/tests/eolian_cxx/meson.build index a3a0e5707f..aa1c5677cb 100644 --- a/src/tests/eolian_cxx/meson.build +++ b/src/tests/eolian_cxx/meson.build @@ -6,7 +6,6 @@ eolian_cxx_suite_src = files([ 'a.c', 'b.c', 'c.c', - 'd.c', 'eolian_cxx_test_binding.cc', 'eolian_cxx_test_address_of.cc', 'eolian_cxx_test_wrapper.cc', @@ -28,7 +27,6 @@ pub_eo_files = [ 'a.eo', 'b.eo', 'c.eo', - 'd.eo', 'complex.eo', 'cyclic1.eo', 'cyclic2.eo',