summaryrefslogtreecommitdiff
path: root/src/lib/eolian_cxx
diff options
context:
space:
mode:
authorLauro Moura <lauromoura@expertisesolutions.com.br>2018-04-16 21:44:27 -0300
committerLauro Moura <lauromoura@expertisesolutions.com.br>2018-04-26 10:55:18 -0300
commita413914c1805ebbcd3b58880e5efa2d9527fd933 (patch)
tree77503787f3086f9ffbb78c5e3affe429b2ffa25f /src/lib/eolian_cxx
parent8e151023b9a713be5fa251d6e182b3796f39a37a (diff)
efl_mono: Move event generators to its own header.
Summary: Making it easier to share code between self and inherited events. During this move, the namespace and keyword headers were merged into the name_helpers header. Also added the first seed of a generic namespace reducer function, to be used by other functions in later commits. Depends on D5994 Reviewers: felipealmeida Reviewed By: felipealmeida Subscribers: segfaultxavi, cedric Differential Revision: https://phab.enlightenment.org/D5995
Diffstat (limited to 'src/lib/eolian_cxx')
-rw-r--r--src/lib/eolian_cxx/grammar/klass_def.hpp18
1 files changed, 11 insertions, 7 deletions
diff --git a/src/lib/eolian_cxx/grammar/klass_def.hpp b/src/lib/eolian_cxx/grammar/klass_def.hpp
index d5a5894cac..9c3681da1e 100644
--- a/src/lib/eolian_cxx/grammar/klass_def.hpp
+++ b/src/lib/eolian_cxx/grammar/klass_def.hpp
@@ -787,6 +787,7 @@ struct compare_klass_name_by_name
787 787
788struct event_def 788struct event_def
789{ 789{
790 klass_name klass;
790 eina::optional<type_def> type; 791 eina::optional<type_def> type;
791 std::string name, c_name; 792 std::string name, c_name;
792 bool beta, protect; 793 bool beta, protect;
@@ -794,7 +795,8 @@ struct event_def
794 795
795 friend inline bool operator==(event_def const& lhs, event_def const& rhs) 796 friend inline bool operator==(event_def const& lhs, event_def const& rhs)
796 { 797 {
797 return lhs.type == rhs.type 798 return lhs.klass == rhs.klass
799 && lhs.type == rhs.type
798 && lhs.name == rhs.name 800 && lhs.name == rhs.name
799 && lhs.c_name == rhs.c_name 801 && lhs.c_name == rhs.c_name
800 && lhs.beta == rhs.beta 802 && lhs.beta == rhs.beta
@@ -806,12 +808,14 @@ struct event_def
806 return !(lhs == rhs); 808 return !(lhs == rhs);
807 } 809 }
808 810
809 event_def(type_def type, std::string name, std::string c_name, bool beta, bool protect, 811 event_def(klass_name _klass, type_def type, std::string name, std::string c_name,
810 documentation_def documentation) 812 bool beta, bool protect, documentation_def documentation)
811 : type(type), name(name), c_name(c_name), beta(beta), protect(protect) 813 : klass(_klass), type(type), name(name), c_name(c_name), beta(beta), protect(protect)
812 , documentation(documentation) {} 814 , documentation(documentation) {}
813 event_def(Eolian_Event const* event, Eolian_Unit const* unit) 815
814 : type( ::eolian_event_type_get(event) ? eina::optional<type_def>{{::eolian_event_type_get(event), unit, EOLIAN_C_TYPE_DEFAULT}} : eina::optional<type_def>{}) 816 event_def(Eolian_Event const* event, Eolian_Class const* cls, Eolian_Unit const* unit)
817 : klass(cls, {attributes::qualifier_info::is_none, std::string()})
818 , type( ::eolian_event_type_get(event) ? eina::optional<type_def>{{::eolian_event_type_get(event), unit, EOLIAN_C_TYPE_DEFAULT}} : eina::optional<type_def>{})
815 , name( ::eolian_event_name_get(event)) 819 , name( ::eolian_event_name_get(event))
816 , c_name( ::eolian_event_c_name_get(event)) 820 , c_name( ::eolian_event_c_name_get(event))
817 , beta( ::eolian_event_is_beta(event)) 821 , beta( ::eolian_event_is_beta(event))
@@ -1035,7 +1039,7 @@ struct klass_def
1035 , event_last; event_iterator != event_last; ++event_iterator) 1039 , event_last; event_iterator != event_last; ++event_iterator)
1036 { 1040 {
1037 try { 1041 try {
1038 events.push_back({&*event_iterator, unit}); 1042 events.push_back({&*event_iterator, klass, unit});
1039 } catch(std::exception const&) {} 1043 } catch(std::exception const&) {}
1040 } 1044 }
1041 1045