diff options
Diffstat (limited to 'src/lib/eolian_cxx')
-rw-r--r-- | src/lib/eolian_cxx/grammar/class_definition.hpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/lib/eolian_cxx/grammar/class_definition.hpp b/src/lib/eolian_cxx/grammar/class_definition.hpp index 13349d4007..295662f94d 100644 --- a/src/lib/eolian_cxx/grammar/class_definition.hpp +++ b/src/lib/eolian_cxx/grammar/class_definition.hpp | |||
@@ -156,6 +156,24 @@ struct class_definition_generator | |||
156 | << scope_tab << "} const " << string_replace(',', '_') << "_event;\n" | 156 | << scope_tab << "} const " << string_replace(',', '_') << "_event;\n" |
157 | ))).generate(sink, std::vector<attributes::event_def>{e}, context)) | 157 | ))).generate(sink, std::vector<attributes::event_def>{e}, context)) |
158 | return false; | 158 | return false; |
159 | if (!as_generator( | ||
160 | scope_tab << "template <typename F>\n" | ||
161 | << scope_tab << "typename std::enable_if<std::is_bind_expression<F>::value, ::efl::eolian::signal_connection>::type\n" | ||
162 | << scope_tab << string_replace(',', '_') << "_event_cb_add(F function)\n" | ||
163 | << scope_tab << "{\n" | ||
164 | << scope_tab << scope_tab << "return ::efl::eolian::event_add(" << string_replace(',', '_') << "_event, *this, function);\n" | ||
165 | << scope_tab << "}\n") | ||
166 | .generate(sink, std::make_tuple(e.name, e.name), context)) | ||
167 | return false; | ||
168 | if (!as_generator( | ||
169 | scope_tab << "template <typename F>\n" | ||
170 | << scope_tab << "typename std::enable_if<!std::is_bind_expression<F>::value, ::efl::eolian::signal_connection>::type\n" | ||
171 | << scope_tab << string_replace(',', '_') << "_event_cb_add(F function)\n" | ||
172 | << scope_tab << "{\n" | ||
173 | << scope_tab << scope_tab << "return ::efl::eolian::event_add(" << string_replace(',', '_') << "_event, *this, std::bind(function));\n" | ||
174 | << scope_tab << "}\n") | ||
175 | .generate(sink, std::make_tuple(e.name, e.name), context)) | ||
176 | return false; | ||
159 | if (e.beta && !as_generator("#endif\n").generate(sink, attributes::unused, context)) | 177 | if (e.beta && !as_generator("#endif\n").generate(sink, attributes::unused, context)) |
160 | return false; | 178 | return false; |
161 | if (e.protect && !as_generator("#endif\n").generate(sink, attributes::unused, context)) | 179 | if (e.protect && !as_generator("#endif\n").generate(sink, attributes::unused, context)) |