aboutsummaryrefslogtreecommitdiffstats
path: root/src/tests/efl_mono/libefl_mono_native_test.c
diff options
context:
space:
mode:
authorLauro Moura <lauromoura@expertisesolutions.com.br>2019-02-06 17:50:28 -0200
committerVitor Sousa <vitorsousa@expertisesolutions.com.br>2019-03-01 23:04:08 -0300
commitdd89eb2fd1755c2816d97f28822639e03ed38608 (patch)
tree9931650c7db8f267e88b87103fe1c9cc85e0d594 /src/tests/efl_mono/libefl_mono_native_test.c
parentelementary: update MVVM example to use asynchronous factory API. (diff)
downloadefl-dd89eb2fd1755c2816d97f28822639e03ed38608.tar.gz
efl-mono: Add support for Efl.Class
Efl.Class (in practice, the return from the *_class_get() functions) can be used as argument to functions, like in Efl.Object.provider_find and Efl.Ui.Widget_Factory.item_class(get/set). This commits adds support by representing Efl.Class instances as System.Type in the C# API, allowing someone to do things like: `factory.ItemClass == typeof(MyFramework.MyButton)` It also supports user-defined classes that inherit from efl classes.
Diffstat (limited to 'src/tests/efl_mono/libefl_mono_native_test.c')
-rw-r--r--src/tests/efl_mono/libefl_mono_native_test.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/tests/efl_mono/libefl_mono_native_test.c b/src/tests/efl_mono/libefl_mono_native_test.c
index d702127d98..1769c61f89 100644
--- a/src/tests/efl_mono/libefl_mono_native_test.c
+++ b/src/tests/efl_mono/libefl_mono_native_test.c
@@ -73,6 +73,7 @@ typedef struct Dummy_Test_Object_Data
Eina_List *list_for_accessor;
int setter_only;
int iface_prop;
+ Eo *provider;
} Dummy_Test_Object_Data;
typedef struct Dummy_Numberwrapper_Data
@@ -150,6 +151,9 @@ _dummy_test_object_efl_object_constructor(Eo *obj, Dummy_Test_Object_Data *pd)
pd->part_two = efl_add(DUMMY_TEST_OBJECT_CLASS, obj, efl_name_set(efl_added, "part_two"));
}
+ pd->provider = efl_add(DUMMY_NUMBERWRAPPER_CLASS, obj);
+ dummy_numberwrapper_number_set(pd->provider, 1999);
+
return obj;
}
@@ -3920,6 +3924,14 @@ int _dummy_test_object_dummy_test_iface_iface_prop_get(EINA_UNUSED const Eo *obj
return pd->iface_prop;
}
+Eo * _dummy_test_object_efl_object_provider_find(EINA_UNUSED const Eo *obj, Dummy_Test_Object_Data *pd, const Efl_Class *klass)
+{
+ EINA_LOG_ERR("klass: %p, NUMBERWRAPPER: %p", klass, DUMMY_NUMBERWRAPPER_CLASS);
+ if (klass == DUMMY_NUMBERWRAPPER_CLASS)
+ return pd->provider;
+ return efl_provider_find(efl_super(obj, DUMMY_TEST_OBJECT_CLASS), klass);
+}
+
/// Dummy.Child
static Efl_Object *