csharp: Add Part suffix for the part wrappers

Reviewers: segfaultxavi

Reviewed By: segfaultxavi

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D8835
This commit is contained in:
Lauro Moura 2019-05-07 13:44:23 +02:00 committed by Xavi Artigas
parent 770cede2bf
commit 3a570c38c9
4 changed files with 13 additions and 13 deletions

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

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

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

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