summaryrefslogtreecommitdiff
path: root/src/lib/eolian_cxx
diff options
context:
space:
mode:
authorLauro Moura <lauromoura@expertisesolutions.com.br>2018-04-10 22:30:40 -0300
committerFelipe Magno de Almeida <felipe@expertisesolutions.com.br>2018-04-12 21:23:42 -0300
commit65f868786a59533a1cbf9d58b886cdc4f49ceb94 (patch)
treea0d2478b2f8504cb14d2e06ea78cb3c5b655764a /src/lib/eolian_cxx
parenta252c3445d2cf45aba332b6fcd634e54ee7239dc (diff)
efl_mono: Proper support for @class methods.
Previously, class methods were implemented as regular instance methods. This commits generates C# static methods for @class methods on the *Concrete classes (and their childs).
Diffstat (limited to 'src/lib/eolian_cxx')
-rw-r--r--src/lib/eolian_cxx/grammar/klass_def.hpp21
1 files changed, 15 insertions, 6 deletions
diff --git a/src/lib/eolian_cxx/grammar/klass_def.hpp b/src/lib/eolian_cxx/grammar/klass_def.hpp
index 1db8df9444..d5a5894cac 100644
--- a/src/lib/eolian_cxx/grammar/klass_def.hpp
+++ b/src/lib/eolian_cxx/grammar/klass_def.hpp
@@ -109,6 +109,9 @@ struct klass_name
109 qualifier_def base_qualifier; 109 qualifier_def base_qualifier;
110 class_type type; 110 class_type type;
111 111
112 klass_name() {
113 }
114
112 klass_name(std::vector<std::string> namespaces 115 klass_name(std::vector<std::string> namespaces
113 , std::string eolian_name, qualifier_def base_qualifier 116 , std::string eolian_name, qualifier_def base_qualifier
114 , class_type type) 117 , class_type type)
@@ -527,6 +530,7 @@ enum class function_type
527 530
528struct function_def 531struct function_def
529{ 532{
533 klass_name klass;
530 type_def return_type; 534 type_def return_type;
531 std::string name; 535 std::string name;
532 std::vector<parameter_def> parameters; 536 std::vector<parameter_def> parameters;
@@ -543,7 +547,8 @@ struct function_def
543 547
544 friend inline bool operator==(function_def const& lhs, function_def const& rhs) 548 friend inline bool operator==(function_def const& lhs, function_def const& rhs)
545 { 549 {
546 return lhs.return_type == rhs.return_type 550 return lhs.klass == rhs.klass
551 && lhs.return_type == rhs.return_type
547 && lhs.name == rhs.name 552 && lhs.name == rhs.name
548 && lhs.parameters == rhs.parameters 553 && lhs.parameters == rhs.parameters
549 && lhs.c_name == rhs.c_name 554 && lhs.c_name == rhs.c_name
@@ -561,7 +566,8 @@ struct function_def
561 return !(lhs == rhs); 566 return !(lhs == rhs);
562 } 567 }
563 function_def() = default; 568 function_def() = default;
564 function_def(type_def _return_type, std::string const& _name, 569 function_def(klass_name _klass,
570 type_def _return_type, std::string const& _name,
565 std::vector<parameter_def> const& _parameters, 571 std::vector<parameter_def> const& _parameters,
566 std::string const& _c_name, 572 std::string const& _c_name,
567 std::string _filename, 573 std::string _filename,
@@ -572,8 +578,9 @@ struct function_def
572 bool _is_beta = false, 578 bool _is_beta = false,
573 bool _is_protected = false, 579 bool _is_protected = false,
574 Eolian_Unit const* unit = nullptr) 580 Eolian_Unit const* unit = nullptr)
575 : return_type(_return_type), name(_name), parameters(_parameters), 581 : klass(_klass), return_type(_return_type), name(_name),
576 c_name(_c_name), filename(_filename), documentation(_documentation), 582 parameters(_parameters), c_name(_c_name), filename(_filename),
583 documentation(_documentation),
577 return_documentation(_return_documentation), 584 return_documentation(_return_documentation),
578 property_documentation(_property_documentation), 585 property_documentation(_property_documentation),
579 type(_type), 586 type(_type),
@@ -633,8 +640,10 @@ struct function_def
633 c_name = eolian_function_full_c_name_get(function, type, EINA_FALSE); 640 c_name = eolian_function_full_c_name_get(function, type, EINA_FALSE);
634 if (type != EOLIAN_FUNCTION_POINTER) 641 if (type != EOLIAN_FUNCTION_POINTER)
635 { 642 {
636 const Eolian_Class *klass = eolian_function_class_get(function); 643 const Eolian_Class *eolian_klass = eolian_function_class_get(function);
637 filename = eolian_object_file_get((const Eolian_Object *)klass); 644 filename = eolian_object_file_get((const Eolian_Object *)eolian_klass);
645 klass = klass_name(eolian_klass,
646 {attributes::qualifier_info::is_none, std::string()});
638 } 647 }
639 else 648 else
640 { 649 {