Merge branch 'master' into devs/hermet/lottie

This commit is contained in:
Hermet Park 2019-01-18 13:50:12 +09:00
commit d81467c117
172 changed files with 2155 additions and 1302 deletions

View File

@ -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

View File

@ -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";

View File

@ -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";

View File

@ -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";

View File

@ -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 { \

View File

@ -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 {

View File

@ -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 {

View File

@ -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";

View File

@ -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";

View File

@ -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 {

View File

@ -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";

View File

@ -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";

View File

@ -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 {

View File

@ -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";
}

View File

@ -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,

View File

@ -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) \

View File

@ -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 \

View File

@ -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 \

View File

@ -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@)

View File

@ -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++)

View File

@ -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;

View File

@ -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,

View File

@ -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;

View File

@ -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,

View File

@ -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);

View File

@ -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);

View File

@ -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));

View File

@ -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));
}

View File

@ -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));

View File

@ -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);

View File

@ -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);

View File

@ -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)
{

View File

@ -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;

View File

@ -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<typename Context>
inline bool is_function_blacklisted(attributes::function_def const& func, Context context)
{
auto options = efl::eolian::grammar::context_find_tag<options_context>(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<typename Context>
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);
}

View File

@ -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))

View File

@ -20,7 +20,7 @@ struct function_declaration_generator
template <typename OutputIterator, typename Context>
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))

View File

@ -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<typename OutputIterator, typename Context>
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<class_context>(context).current_wrapper_kind == class_context::interface;

View File

@ -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

View File

@ -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"

View File

@ -20,21 +20,21 @@
namespace eolian_mono {
template <typename I>
// template <typename I>
struct function_registration_generator
{
I index_generator;
// I index_generator;
attributes::klass_def const* klass;
template <typename OutputIterator, typename Context>
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 <typename I>
function_registration_generator<I> 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 <typename I>
struct is_eager_generator< ::eolian_mono::function_registration_generator<I>> : std::true_type {};
template <typename I>
struct is_generator< ::eolian_mono::function_registration_generator<I>> : 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 <typename I>
struct attributes_needed< ::eolian_mono::function_registration_generator<I>> : std::integral_constant<int, 1> {};
template <>
struct attributes_needed< ::eolian_mono::function_registration_generator> : std::integral_constant<int, 1> {};
}
} } }

View File

@ -45,6 +45,10 @@ struct eolian_state_context {
const Eolian_State *state;
};
struct options_context {
bool want_beta;
};
}
#endif

View File

@ -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<typename Context>
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<Efl_Op_Description> 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<Efl_Op_Description>();\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 << "///<summary>Pointer to the native class description.</summary>\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 << "///<summary>Creates a new instance.</summary>\n"
<< scope_tab << "///<param name=\"parent\">Parent instance.</param>\n"
<< scope_tab << "///<param name=\"init_cb\">Delegate to call constructing methods that should be run inside the constructor.</param>\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 << "///<summary>Internal constructor to forward the wrapper initialization to the root class.</summary>\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 << "///<summary>Constructs an instance from a native pointer.</summary>\n"
<< scope_tab << "public " << inherit_name << "(System.IntPtr raw)" << (root ? "" : " : base(raw)") << "\n"
@ -544,7 +536,7 @@ struct klass
scope_tab << "///<summary>Creates a new instance.</summary>\n"
<< scope_tab << "///<param name=\"parent\">Parent instance.</param>\n"
<< scope_tab << "///<param name=\"init_cb\">Delegate to call constructing methods that should be run inside the constructor.</param>\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 << "///<summary>Constructs an instance from a native pointer.</summary>\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"

View File

@ -274,14 +274,14 @@ struct klass_interface_name_generator
{
return utils::remove_all(klass.eolian_name, '_');
}
template <typename OutputIterator, typename Attr, typename Context>
bool generate(OutputIterator sink, Attr const& attribute, Context const& context) const
{
return as_generator((*this).operator()<Attr>(attribute)).generate(sink, attributes::unused, context);
}
} klass_interface_name;
} const klass_interface_name;
struct klass_full_interface_name_generator
{
template <typename T>
@ -289,13 +289,13 @@ struct klass_full_interface_name_generator
{
return join_namespaces(klass.namespaces, '.', managed_namespace) + klass_interface_name(klass);
}
template <typename OutputIterator, typename Attr, typename Context>
bool generate(OutputIterator sink, Attr const& attribute, Context const& context) const
{
return as_generator((*this).operator()<Attr>(attribute)).generate(sink, attributes::unused, context);
}
} klass_full_interface_name;
} const klass_full_interface_name;
template<typename T>
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 <typename OutputIterator, typename Attr, typename Context>
bool generate(OutputIterator sink, Attr const& attribute, Context const& context) const
{
return as_generator((*this).operator()<Attr>(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()<Attr>(attribute)).generate(sink, attributes::unused, context);
}
} klass_full_concrete_or_interface_name;
} const klass_full_concrete_or_interface_name;
template<typename T>
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<typename T>
inline std::string klass_get_full_name(T const& clsname)
{
return klass_full_concrete_name(clsname) + "." + klass_get_name(clsname);
}

View File

@ -47,6 +47,7 @@ struct options_type
mutable Eolian_Unit const* unit;
int v_major;
int v_minor;
bool want_beta;
std::map<const std::string, std::string> 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 <ns> 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)
{

View File

@ -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 <typename T>

View File

@ -1,9 +1,9 @@
<configuration>
<dllmap dll=\"eina\" target=\"@EINA@\"/>
<dllmap dll=\"efl\" target=\"@EFL@\"/>
<dllmap dll=\"ecore\" target=\"@ECORE@\"/>
<dllmap dll=\"eo\" target=\"@EO@\"/>
<dllmap dll=\"evas\" target=\"@EVAS@\"/>
<dllmap dll=\"eldbus\" target=\"@ELDBUS@\"/>
<dllmap dll=\"elementary\" target=\"@ELEMENTARY@\"/>
<dllmap dll="eina" target="@EINA@"/>
<dllmap dll="efl" target="@EFL@"/>
<dllmap dll="ecore" target="@ECORE@"/>
<dllmap dll="eo" target="@EO@"/>
<dllmap dll="evas" target="@EVAS@"/>
<dllmap dll="eldbus" target="@ELDBUS@"/>
<dllmap dll="elementary" target="@ELEMENTARY@"/>
</configuration>

View File

@ -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,
}
/// <summary>
/// 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.
/// </summary>
/// <remarks>
/// Calls to efl outside those efl-callbacks or outside the mainloop are not allowed and will lead to issues
/// </remarks>
/// <example>
/// UserApp is the class that implements the Application abstract
/// <code>
/// public static void Main() {
/// UserApp editor = new UserApp();
/// editor.Launch(editor);
/// }
/// </code>
/// </example>
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();
}
/// <summary>
/// Called when the application is started. Arguments from the command line are passed here.
/// </summary>
protected abstract void OnInitialize(Eina.Array<System.String> args);
/// <summary>
/// Arguments are passed here, Additional calls to this function may occure,
/// but then the initialization flag is set to false.
/// </summary>
/// <remarks>
/// When Initialize is true then OnInitialize is also called
/// </remarks>
protected virtual void OnArguments(Efl.LoopArguments args) { }
/// <summary>
/// Called when the application is not going to be displayed, or is not used by a user for some time.
/// </summary>
protected virtual void OnPause() { }
/// <summary>
/// Called before an application is used again after a call to OnPause().
/// </summary>
protected virtual void OnResume() { }
/// <summary>
/// Called before starting the shutdown of the application.
/// </summary>
protected virtual void OnTerminate() { }
/// <summary>
/// This function initializices everything in EFL and runs your application.
/// This call will result in a call to OnInitialize(), which you application should override.
/// </summary>
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();
}
}
}
}

View File

@ -1,4 +1,7 @@
mono_files += files('efl_all.cs')
mono_files += files(
'efl_all.cs',
'efl_csharp_application.cs'
)
bash = find_program('bash')

View File

@ -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() {

View File

@ -14,7 +14,7 @@ public struct Error : IComparable<Error>
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<Error>
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<Error>
return Eina.StringConversion.NativeUtf8ToManagedString(cstr);
}
public static void RaiseIfOccurred()
/// <summary>Raises an exception if an unhandled exception occurred before switching
/// back to the native code. For example, in an event handler.</summary>
public static void RaiseIfUnhandledException()
{
Error e = Get();
Clear();
Raise(e);
if (e == UNHANDLED_EXCEPTION)
{
Clear();
Raise(e);
}
}
public static void Raise(Error e)

View File

@ -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()

View File

@ -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;}

View File

@ -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);
}

View File

@ -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)

View File

@ -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);
}

View File

@ -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);
}

View File

@ -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<System.Type, System.IntPtr> klasses
= new System.Collections.Concurrent.ConcurrentDictionary<System.Type, System.IntPtr>();
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<IntPtr> get_efl_interfaces(System.Type type)
{
System.Type base_type = type.BaseType;
var ifaces_lst = new List<IntPtr>();
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<IntPtr> 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<Efl_Op_Description> GetEoOps(System.Type type);
}
public interface IWrapper
{
/// <summary>Pointer to internal Eo instance.</summary>

View File

@ -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@'])

View File

@ -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);

View File

@ -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}.");

View File

@ -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);

View File

@ -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(&current_time, &selected_time);
// cal2.selected_time_set(&selected_time);

View File

@ -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);

View File

@ -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()
ELM_MAIN()

View File

@ -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<efl::Content>(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)

View File

@ -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);

View File

@ -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<elm::toolbar::Item>
(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()));

View File

@ -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]]

View File

@ -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.

View File

@ -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);

View File

@ -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);
}

View File

@ -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"

View File

@ -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<Eina.Error>; [[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.]]
}
}

View File

@ -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

View File

@ -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.]]

View File

@ -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.]]

View File

@ -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);

View File

@ -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);

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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);

View File

@ -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;

View File

@ -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);
}

View File

@ -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;

View File

@ -1,4 +1,4 @@
class Ector.Renderer.Software (Ector.Renderer)
abstract Ector.Renderer.Software (Ector.Renderer)
{
[[Ector software renderer class]]
data: null;

View File

@ -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;

View File

@ -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;

View File

@ -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

View File

@ -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.]]
}
}
}

View File

@ -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"

View File

@ -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]]
}

View File

@ -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]]

View File

@ -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

View File

@ -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)

View File

@ -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);

View File

@ -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
*

View File

@ -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;

View File

@ -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);

View File

@ -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,

Some files were not shown because too many files have changed in this diff Show More