diff options
author | Yeongjong Lee <yj34.lee@samsung.com> | 2020-01-23 07:30:13 +0900 |
---|---|---|
committer | WooHyun Jung <wh0705.jung@samsung.com> | 2020-01-23 07:30:14 +0900 |
commit | 97098dcc50b62e51dad3469619ed55242ca01a80 (patch) | |
tree | 33d372fef1f883a12f4172ceb9ab07223ca28805 /src/tests/efl_mono | |
parent | 5137f6d143c681fcf4f53e4e45df8af1a538ae75 (diff) | |
download | efl-97098dcc50b62e51dad3469619ed55242ca01a80.tar.gz |
csharp: cleanup concrete class
Summary:
Concrete class is only used to call static member of NativeMethod. they don't
need any inheritance and implementation of c functions.
Depends on D9893
Test Plan: ninja test
Reviewers: lauromoura, felipealmeida
Subscribers: Jaehyun_Cho, woohyun, segfaultxavi, cedric, #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D9894
Diffstat (limited to 'src/tests/efl_mono')
-rw-r--r-- | src/tests/efl_mono/Eo.cs | 32 | ||||
-rw-r--r-- | src/tests/efl_mono/dummy_test_object.c | 22 | ||||
-rw-r--r-- | src/tests/efl_mono/dummy_test_object.eo | 17 |
3 files changed, 71 insertions, 0 deletions
diff --git a/src/tests/efl_mono/Eo.cs b/src/tests/efl_mono/Eo.cs index 70e9d29c16..8d00155e10 100644 --- a/src/tests/efl_mono/Eo.cs +++ b/src/tests/efl_mono/Eo.cs @@ -385,6 +385,16 @@ class TestEoMultipleChildClasses class TestCsharpProperties { + + private class MyObject : Dummy.TestObject + { + public MyObject(Efl.Object parent = null) : base(parent) + { + } + private MyObject(ConstructingHandle ch) : base(ch) + { + } + } public static void test_csharp_properties() { var obj = new Dummy.TestObject(); @@ -428,6 +438,28 @@ class TestCsharpProperties iface.Dispose(); } + public static void test_iface_value_property() + { + var obj = new Dummy.TestObject(); + var prop = new MyObject(); + + obj.IfaceValueProp = prop; + Test.AssertEquals(obj.IfaceValueProp, prop); + + obj.Dispose(); + prop.Dispose(); + } + + public static void test_iface_value_from_c() + { + var obj = new Dummy.TestObject(); + + obj.SetIfaceKlassProp(typeof(MyObject)); + Test.AssertEquals(obj.IfaceValueFromC.GetType(), typeof(MyObject)); + + obj.Dispose(); + } + public static void test_csharp_multi_valued_prop() { var obj = new Dummy.TestObject(); diff --git a/src/tests/efl_mono/dummy_test_object.c b/src/tests/efl_mono/dummy_test_object.c index b87aff1cd4..687737a4aa 100644 --- a/src/tests/efl_mono/dummy_test_object.c +++ b/src/tests/efl_mono/dummy_test_object.c @@ -38,6 +38,8 @@ typedef struct Dummy_Test_Object_Data int prop1; int prop2; Eo *hidden_object; + Dummy_Test_Iface *iface_value_prop; + Efl_Class *iface_klass; // Containers passed to C# as iterator/accessors Eina_Array *out_array; @@ -4784,6 +4786,26 @@ Eo *_dummy_test_object_hidden_object_get(EINA_UNUSED const Eo *obj, Dummy_Test_O return pd->hidden_object; } +Dummy_Test_Iface *_dummy_test_object_iface_value_prop_get(EINA_UNUSED const Eo *obj, Dummy_Test_Object_Data *pd) +{ + return pd->iface_value_prop; +} + +void _dummy_test_object_iface_value_prop_set(EINA_UNUSED Eo *obj, Dummy_Test_Object_Data *pd, Dummy_Test_Iface *prop) +{ + pd->iface_value_prop = prop; +} + +void _dummy_test_object_iface_klass_prop_set(EINA_UNUSED Eo *obj, Dummy_Test_Object_Data *pd, Efl_Class *klass) +{ + pd->iface_klass = klass; +} + +Dummy_Test_Iface *_dummy_test_object_iface_value_from_c_get(const Eo *obj, Dummy_Test_Object_Data *pd) +{ + return efl_add(pd->iface_klass, (Eo*)obj); +} + // Inherit int _dummy_inherit_helper_receive_dummy_and_call_int_out(Dummy_Test_Object *x) { diff --git a/src/tests/efl_mono/dummy_test_object.eo b/src/tests/efl_mono/dummy_test_object.eo index cf2ae7ce03..ee24e5ef9b 100644 --- a/src/tests/efl_mono/dummy_test_object.eo +++ b/src/tests/efl_mono/dummy_test_object.eo @@ -1664,6 +1664,23 @@ class Dummy.Test_Object extends Efl.Object implements Dummy.Test_Iface { obj: Efl.Object; } } + @property iface_value_prop { + values { + prop: Dummy.Test_Iface; + } + } + @property iface_klass_prop { + set {} + values { + klass: Efl.Class; + } + } + @property iface_value_from_c { + get {} + values { + prop: Dummy.Test_Iface; + } + } } implements { Efl.Object.constructor; |