csharp: Add Part suffix for the part wrappers accepted/tizen/unified/20190509.041000 submit/tizen/20190508.061942
authorLauro Moura <lauromoura@expertisesolutions.com.br>
Tue, 7 May 2019 11:44:23 +0000 (13:44 +0200)
committerHermet Park <hermetpark@gmail.com>
Wed, 8 May 2019 04:34:50 +0000 (13:34 +0900)
Reviewers: segfaultxavi

Reviewed By: segfaultxavi

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D8835

src/bin/eolian_mono/eolian/mono/name_helpers.hh
src/tests/efl_mono/Parts.cs
src/tests/efl_mono/dummy_part_holder.eo
src/tests/efl_mono/libefl_mono_native_test.c

index 1ae35ca..ca36d04 100644 (file)
@@ -282,7 +282,7 @@ inline std::string property_managed_name(attributes::property_def const& propert
 inline std::string managed_part_name(attributes::part_def const& part)
 {
   std::vector<std::string> names = utils::split(part.name, '_');
-  return utils::to_pascal_case(names);
+  return utils::to_pascal_case(names) + "Part";
 }
 
 // Class name translation (interface/concrete/inherit/etc)
index 50527c1..3de0b6c 100644 (file)
@@ -30,8 +30,8 @@ public static class TestParts
 
     private static void do_part_test(Dummy.PartHolder t)
     {
-        var p1 = t.PartOne;
-        var p2 = t.PartTwo;
+        var p1 = t.OnePart;
+        var p2 = t.TwoPart;
         Test.Assert(p1 is Dummy.TestObject);
         Test.AssertEquals("part_one", p1.GetName());
         Test.Assert(p2 is Dummy.TestObject);
index 2dc5ad7..d65fd12 100644 (file)
@@ -3,8 +3,8 @@ import eina_types;
 class @beta Dummy.Part_Holder extends Dummy.Test_Object implements Efl.Part {
 
    parts {
-      part_one: Dummy.Test_Object; [[ Part number one. ]]
-      part_two: Dummy.Test_Object; [[ Part number two. ]]
+      one: Dummy.Test_Object; [[ Part number one. ]]
+      two: Dummy.Test_Object; [[ Part number two. ]]
    }
    implements {
       Efl.Part.part_get;
index 52d9190..0201a6a 100644 (file)
@@ -92,8 +92,8 @@ typedef struct Dummy_Child_Data
 
 typedef struct Dummy_Part_Holder_Data
 {
-  Eo *part_one;
-  Eo *part_two;
+  Eo *one;
+  Eo *two;
 } Dummy_Part_Holder_Data;
 
 typedef struct Dummy_Inherit_Helper_Data
@@ -4057,8 +4057,8 @@ _dummy_part_holder_efl_object_constructor(Eo *obj, Dummy_Part_Holder_Data *pd)
    // To avoid an infinite loop calling the same constructor
    if (!efl_parent_get(obj))
      {
-        pd->part_one = efl_add(DUMMY_TEST_OBJECT_CLASS, obj, efl_name_set(efl_added, "part_one"));
-        pd->part_two = efl_add(DUMMY_TEST_OBJECT_CLASS, obj, efl_name_set(efl_added, "part_two"));
+        pd->one = efl_add(DUMMY_TEST_OBJECT_CLASS, obj, efl_name_set(efl_added, "part_one"));
+        pd->two = efl_add(DUMMY_TEST_OBJECT_CLASS, obj, efl_name_set(efl_added, "part_two"));
      }
 
    return obj;
@@ -4066,10 +4066,10 @@ _dummy_part_holder_efl_object_constructor(Eo *obj, Dummy_Part_Holder_Data *pd)
 
 Efl_Object *_dummy_part_holder_efl_part_part_get(EINA_UNUSED const Eo *obj, Dummy_Part_Holder_Data *pd, const char *name)
 {
-    if (!strcmp(name, "part_one"))
-      return pd->part_one;
-    else if (!strcmp(name, "part_two"))
-      return pd->part_two;
+    if (!strcmp(name, "one"))
+      return pd->one;
+    else if (!strcmp(name, "two"))
+      return pd->two;
     else
       return NULL;
 }