summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLauro Moura <lauromoura@expertisesolutions.com.br>2017-12-06 21:03:55 -0300
committerFelipe Magno de Almeida <felipe@expertisesolutions.com.br>2017-12-20 19:57:17 -0200
commit46b202b86ce1912653bfcae2db2dac045af9bb2b (patch)
tree37e0256e4d3046bb24c555b472791f81b4f6d28f
parent0609c68e34940e40e0caae1bb9dfc48d4eaa306e (diff)
eolian-mono: Add documentation generation support
This commit adds the "documentation" generator, which gets the documentation_def attribute of the given item and generates xml comments to be exported by MCS. For items requiring some customization of the generated comments (e.g. functions and its parameters), the helpers to generate the preamble (summary), body (paragraphs) and epilogue (currently just the @since tag) were added. Currently we do not support converting Eolian references into xmldoc references. As we explicitly generate Get/Set methods for properties, for now the generator tries to get the get/set specific documentation first. If it is not present, fallback to the common docs. Later this could be changed to generate the common one as paragraphs of the Get/Set. Also some generated code like the wrappers for calling C# methods from C can be private. This will cleanup the introspection results and warnings when generating documentation. Due to this visibility change, the binbuf tests had to be changed to add redirect calls to the native methods instead of directly calling the DllImport'd methods.
-rw-r--r--src/Makefile_Efl_Mono.am5
-rw-r--r--src/Makefile_Eolian_Cxx.am3
-rw-r--r--src/bin/eolian_mono/eolian/mono/documentation.hh201
-rw-r--r--src/bin/eolian_mono/eolian/mono/enum_definition.hh7
-rw-r--r--src/bin/eolian_mono/eolian/mono/function_declaration.hh9
-rw-r--r--src/bin/eolian_mono/eolian/mono/function_definition.hh15
-rw-r--r--src/bin/eolian_mono/eolian/mono/function_pointer.hh17
-rw-r--r--src/bin/eolian_mono/eolian/mono/klass.hh93
-rw-r--r--src/bin/eolian_mono/eolian/mono/struct_definition.hh25
-rw-r--r--src/bin/eolian_mono/eolian/mono/using_decl.hh8
-rw-r--r--src/bindings/mono/ecore_evas_mono/ecore_evas.cs1
-rw-r--r--src/bindings/mono/efl_mono/efl_all.cs2
-rw-r--r--src/bindings/mono/efl_mono/efl_libs.cs.in1
-rw-r--r--src/bindings/mono/eina_mono/eina_array.cs2
-rw-r--r--src/bindings/mono/eina_mono/eina_binbuf.cs2
-rw-r--r--src/bindings/mono/eina_mono/eina_common.cs4
-rw-r--r--src/bindings/mono/eina_mono/eina_config.cs2
-rw-r--r--src/bindings/mono/eina_mono/eina_container_common.cs2
-rw-r--r--src/bindings/mono/eina_mono/eina_error.cs2
-rw-r--r--src/bindings/mono/eina_mono/eina_hash.cs2
-rw-r--r--src/bindings/mono/eina_mono/eina_inarray.cs2
-rw-r--r--src/bindings/mono/eina_mono/eina_inlist.cs2
-rw-r--r--src/bindings/mono/eina_mono/eina_iterator.cs2
-rw-r--r--src/bindings/mono/eina_mono/eina_list.cs2
-rw-r--r--src/bindings/mono/eina_mono/eina_log.cs2
-rw-r--r--src/bindings/mono/eina_mono/eina_slice.cs2
-rw-r--r--src/bindings/mono/eina_mono/eina_stringshare.cs1
-rw-r--r--src/bindings/mono/eina_mono/eina_value.cs8
-rw-r--r--src/bindings/mono/eldbus_mono/eldbus_common.cs2
-rw-r--r--src/bindings/mono/eldbus_mono/eldbus_config.cs2
-rw-r--r--src/bindings/mono/eldbus_mono/eldbus_connection.cs2
-rw-r--r--src/bindings/mono/eldbus_mono/eldbus_message.cs2
-rw-r--r--src/bindings/mono/eldbus_mono/eldbus_object.cs3
-rw-r--r--src/bindings/mono/eldbus_mono/eldbus_pending.cs2
-rw-r--r--src/bindings/mono/eldbus_mono/eldbus_proxy.cs2
-rw-r--r--src/bindings/mono/eldbus_mono/eldbus_service.cs2
-rw-r--r--src/bindings/mono/eo_mono/iwrapper.cs1
-rw-r--r--src/bindings/mono/eo_mono/workaround.cs192
-rw-r--r--src/examples/efl_mono/EoInherit01.cs2
-rw-r--r--src/examples/efl_mono/example_numberwrapper.c5
-rw-r--r--src/examples/efl_mono/example_numberwrapper.eo6
-rw-r--r--src/lib/eolian_cxx/Eolian_Cxx.hh18
-rw-r--r--src/lib/eolian_cxx/grammar/function_definition.hpp2
-rw-r--r--src/lib/eolian_cxx/grammar/html_escaped_string.hpp51
-rw-r--r--src/lib/eolian_cxx/grammar/klass_def.hpp151
-rw-r--r--src/lib/eolian_cxx/grammar/string.hpp6
-rw-r--r--src/tests/efl_mono/Eina.cs30
-rw-r--r--src/tests/efl_mono/Events.cs13
-rw-r--r--src/tests/efl_mono/libefl_mono_native_test.c35
-rw-r--r--src/tests/efl_mono/test_testing.eo33
-rw-r--r--src/tests/eolian_cxx/docs.eo86
-rw-r--r--src/tests/eolian_cxx/eolian_cxx_suite.cc1
-rw-r--r--src/tests/eolian_cxx/eolian_cxx_suite.h1
-rw-r--r--src/tests/eolian_cxx/eolian_cxx_test_documentation.cc289
54 files changed, 1206 insertions, 157 deletions
diff --git a/src/Makefile_Efl_Mono.am b/src/Makefile_Efl_Mono.am
index 5b2f993d22..7cfa20d4da 100644
--- a/src/Makefile_Efl_Mono.am
+++ b/src/Makefile_Efl_Mono.am
@@ -190,9 +190,11 @@ lib_efl_mono_libeflcustomexportsmono_la_DEPENDENCIES = @EFL_CUSTOM_EXPORTS_MONO_
190 190
191#Efl Mono - C Sharp binding library 191#Efl Mono - C Sharp binding library
192 192
193libefl_mono_dll_MCS_FLAGS = -doc:lib/efl_mono/libefl_mono.xml
194
193lib/efl_mono/libefl_mono.dll: $(efl_mono_files_dist) lib/efl_mono/$(am__dirstamp) $(efl_mono_files_gen) lib/efl_mono/libefl_mono.dll.config 195lib/efl_mono/libefl_mono.dll: $(efl_mono_files_dist) lib/efl_mono/$(am__dirstamp) $(efl_mono_files_gen) lib/efl_mono/libefl_mono.dll.config
194 @rm -f lib/efl_mono/libefl_mono.dll 196 @rm -f lib/efl_mono/libefl_mono.dll
195 $(AM_V_MCS) $(MCS) $(MCS_FLAGS) -out:$@ -t:library $(filter %.cs, $(^)) 197 $(AM_V_MCS) $(MCS) $(MCS_FLAGS) $(libefl_mono_dll_MCS_FLAGS) -out:$@ -t:library $(filter %.cs, $(^))
196 198
197lib/efl_mono/libefl_mono.dll.config: 199lib/efl_mono/libefl_mono.dll.config:
198 echo "<configuration>" > $@ 200 echo "<configuration>" > $@
@@ -213,6 +215,7 @@ endif
213EFL_INSTALL_EXEC_HOOK += \ 215EFL_INSTALL_EXEC_HOOK += \
214$(MKDIR_P) $(efl_mono_dll_dest); \ 216$(MKDIR_P) $(efl_mono_dll_dest); \
215cp -f $(builddir)/lib/efl_mono/libefl_mono.dll $(efl_mono_dll_dest)/libefl_mono.dll; \ 217cp -f $(builddir)/lib/efl_mono/libefl_mono.dll $(efl_mono_dll_dest)/libefl_mono.dll; \
218cp -f $(builddir)/lib/efl_mono/libefl_mono.xml $(efl_mono_dll_dest)/libefl_mono.xml; \
216$(MKDIR_P) $(DESTDIR)$(datadir)/efl_mono; \ 219$(MKDIR_P) $(DESTDIR)$(datadir)/efl_mono; \
217cp -f $(builddir)/bindings/mono/efl_mono/efl_libs.csv $(DESTDIR)$(datadir)/efl_mono/efl_libs.csv; 220cp -f $(builddir)/bindings/mono/efl_mono/efl_libs.csv $(DESTDIR)$(datadir)/efl_mono/efl_libs.csv;
218 221
diff --git a/src/Makefile_Eolian_Cxx.am b/src/Makefile_Eolian_Cxx.am
index 3bc12415ca..d920936f37 100644
--- a/src/Makefile_Eolian_Cxx.am
+++ b/src/Makefile_Eolian_Cxx.am
@@ -94,6 +94,7 @@ tests/eolian_cxx/generic.c \
94tests/eolian_cxx/name1_name2_type_generation.c \ 94tests/eolian_cxx/name1_name2_type_generation.c \
95tests/eolian_cxx/eolian_cxx_test_inheritance.cc \ 95tests/eolian_cxx/eolian_cxx_test_inheritance.cc \
96tests/eolian_cxx/eolian_cxx_test_generate.cc \ 96tests/eolian_cxx/eolian_cxx_test_generate.cc \
97tests/eolian_cxx/eolian_cxx_test_documentation.cc \
97tests/eolian_cxx/eolian_cxx_test_cyclic.cc \ 98tests/eolian_cxx/eolian_cxx_test_cyclic.cc \
98tests/eolian_cxx/complex.c \ 99tests/eolian_cxx/complex.c \
99tests/eolian_cxx/complex_cxx.cc \ 100tests/eolian_cxx/complex_cxx.cc \
@@ -168,7 +169,7 @@ tests_eolian_cxx_eolian_cxx_suite_CXXFLAGS = \
168-DTESTS_WD=\"`pwd`\" \ 169-DTESTS_WD=\"`pwd`\" \
169-DTESTS_SRC_DIR=\"$(top_srcdir)/src/tests/eolian_cxx\" \ 170-DTESTS_SRC_DIR=\"$(top_srcdir)/src/tests/eolian_cxx\" \
170-DPACKAGE_BUILD_DIR=\"$(abs_top_builddir)/src/tests/eolian_cxx\" \ 171-DPACKAGE_BUILD_DIR=\"$(abs_top_builddir)/src/tests/eolian_cxx\" \
171-DPACKAGE_DATA_DIR=\"$(datadir)/eolian_cxx\" \ 172-DPACKAGE_DATA_DIR=\"$(top_srcdir)/src/tests/eolian_cxx\" \
172-DTESTS_BUILD_DIR=\"$(top_builddir)/src/tests/eolian_cxx\" \ 173-DTESTS_BUILD_DIR=\"$(top_builddir)/src/tests/eolian_cxx\" \
173@CHECK_CFLAGS@ @EOLIAN_CXX_CFLAGS@ @EINA_CXX_CFLAGS@ \ 174@CHECK_CFLAGS@ @EOLIAN_CXX_CFLAGS@ @EINA_CXX_CFLAGS@ \
174@EOLIAN_CFLAGS@ @EINA_CFLAGS@ @EO_CFLAGS@ @ECORE_CFLAGS@ \ 175@EOLIAN_CFLAGS@ @EINA_CFLAGS@ @EO_CFLAGS@ @ECORE_CFLAGS@ \
diff --git a/src/bin/eolian_mono/eolian/mono/documentation.hh b/src/bin/eolian_mono/eolian/mono/documentation.hh
new file mode 100644
index 0000000000..42fe9d24e1
--- /dev/null
+++ b/src/bin/eolian_mono/eolian/mono/documentation.hh
@@ -0,0 +1,201 @@
1#ifndef EOLIAN_MONO_DOCUMENTATION_HPP
2#define EOLIAN_MONO_DOCUMENTATION_HPP
3
4#include "grammar/generator.hpp"
5#include "grammar/klass_def.hpp"
6#include "grammar/html_escaped_string.hpp"
7#include "using_decl.hh"
8#include "keyword.hh"
9
10#include <Eina.h>
11
12namespace eolian_mono {
13
14struct documentation_generator
15{
16
17 int scope_size = 0;
18
19 documentation_generator(int scope_size)
20 : scope_size(scope_size) {}
21
22 /// Tag generator helpers
23 template<typename OutputIterator, typename Context>
24 bool generate_tag(OutputIterator sink, std::string const& tag, std::string const &text, Context const& context) const
25 {
26 if (text.empty())
27 return true;
28
29 return as_generator( scope_tab(scope_size) << "///<" << tag << ">" << html_escaped_string << "</" << tag << ">\n").generate(sink, text, context);
30 }
31
32 template<typename OutputIterator, typename Context>
33 bool generate_tag_summary(OutputIterator sink, std::string const& text, Context const& context) const
34 {
35 return generate_tag(sink, "summary", text, context);
36 }
37
38 template<typename OutputIterator, typename Context>
39 bool generate_tag_para(OutputIterator sink, std::string const& text, Context const& context) const
40 {
41 return generate_tag(sink, "para", text, context);
42 }
43
44 template<typename OutputIterator, typename Context>
45 bool generate_tag_param(OutputIterator sink, std::string const& name, std::string const& text, Context const& context) const
46 {
47 return as_generator( scope_tab(scope_size) << "///<param name=\"" << name << "\">"
48 << html_escaped_string << "</param>\n").generate(sink, text, context);
49 }
50
51 template<typename OutputIterator, typename Context>
52 bool generate_tag_return(OutputIterator sink, std::string const& text, Context const& context) const
53 {
54 return generate_tag(sink, "return", text, context);
55 }
56
57 // Actual exported generators
58 template<typename OutputIterator, typename Attribute, typename Context>
59 bool generate(OutputIterator sink, Attribute const& attr, Context const& context) const
60 {
61 return generate(sink, attr.documentation, context);
62 }
63
64 template<typename OutputIterator, typename Context>
65 bool generate(OutputIterator sink, attributes::function_def const& func, Context const& context) const
66 {
67 if (func.type == attributes::function_type::prop_get || func.type == attributes::function_type::prop_set)
68 return generate_property(sink, func, context);
69 else
70 return generate_function(sink, func, context);
71 return true;
72 }
73
74 template<typename OutputIterator, typename Context>
75 bool generate_property(OutputIterator sink, attributes::function_def const& func, Context const& context) const
76 {
77
78 // First, try the get/set specific documentation
79 if (!func.documentation.summary.empty())
80 {
81 if (!generate(sink, func.documentation, context))
82 return false;
83 }
84 else // fallback to common property documentation
85 {
86 if (!generate(sink, func.property_documentation, context))
87 return false;
88 }
89
90 for (auto&& param : func.parameters)
91 if (!generate_parameter(sink, param, context))
92 return false;
93
94 if (!generate_tag_return(sink, func.return_documentation.summary, context))
95 return false;
96
97 return true;
98 }
99
100 template<typename OutputIterator, typename Context>
101 bool generate_function(OutputIterator sink, attributes::function_def const& func, Context const& context) const
102 {
103 if (!generate(sink, func.documentation, context))
104 return false;
105
106 for (auto&& param : func.parameters)
107 if (!generate_parameter(sink, param, context))
108 return false;
109
110 if (!generate_tag_return(sink, func.return_documentation.summary, context))
111 return false;
112
113 return true;
114 }
115
116 template<typename OutputIterator, typename Context>
117 bool generate_parameter(OutputIterator sink, attributes::parameter_def const& param, Context const& context) const
118 {
119 return generate_tag_param(sink, escape_keyword(param.param_name), param.documentation.summary, context);
120 }
121
122 template<typename OutputIterator, typename Context>
123 bool generate(OutputIterator sink, attributes::documentation_def const& doc, Context const& context) const
124 {
125 if (!generate_preamble(sink, doc, context))
126 return false;
127 if (!generate_body(sink, doc, context))
128 return false;
129 if (!generate_epilogue(sink, doc, context))
130 return false;
131
132 return true;
133 }
134
135 template<typename OutputIterator, typename Context>
136 bool generate_preamble(OutputIterator sink, attributes::documentation_def const& doc, Context const context) const
137 {
138 return generate_tag_summary(sink, doc.summary, context);
139 }
140
141
142 template<typename OutputIterator, typename Context>
143 bool generate_body(OutputIterator sink, attributes::documentation_def const& doc, Context const context) const
144 {
145 for (auto&& para : doc.desc_paragraphs)
146 {
147 if (!generate_tag_para(sink, para, context))
148 return false;
149 }
150
151 return true;
152 }
153
154 template<typename OutputIterator, typename Context>
155 bool generate_epilogue(OutputIterator sink, attributes::documentation_def const& doc, Context const context) const
156 {
157 if (doc.since.empty())
158 return true;
159
160 if (!generate_tag_para(sink, doc.since, context))
161 return false;
162
163 return true;
164 }
165};
166
167struct documentation_terminal
168{
169 documentation_generator operator()(int n) const
170 {
171 return documentation_generator(n);
172 }
173} const documentation = {};
174
175documentation_generator as_generator(documentation_terminal)
176{
177 return documentation_generator(0);
178}
179
180} // namespace eolian_mono
181
182
183namespace efl { namespace eolian { namespace grammar {
184
185template<>
186struct is_eager_generator<::eolian_mono::documentation_generator> : std::true_type {};
187template<>
188struct is_generator<::eolian_mono::documentation_generator> : std::true_type {};
189
190template<>
191struct is_generator<::eolian_mono::documentation_terminal> : std::true_type {};
192
193namespace type_traits {
194template<>
195struct attributes_needed<struct ::eolian_mono::documentation_generator> : std::integral_constant<int, 1> {};
196template<>
197struct attributes_needed<struct ::eolian_mono::documentation_terminal> : std::integral_constant<int, 1> {};
198}
199} } }
200
201#endif
diff --git a/src/bin/eolian_mono/eolian/mono/enum_definition.hh b/src/bin/eolian_mono/eolian/mono/enum_definition.hh
index ae9775e71f..d8bc54c175 100644
--- a/src/bin/eolian_mono/eolian/mono/enum_definition.hh
+++ b/src/bin/eolian_mono/eolian/mono/enum_definition.hh
@@ -22,6 +22,9 @@ struct enum_definition_generator
22 auto open_namespace = *("namespace " << string << " { ") << "\n"; 22 auto open_namespace = *("namespace " << string << " { ") << "\n";
23 if(!as_generator(open_namespace).generate(sink, cpp_namespaces, add_lower_case_context(context))) return false; 23 if(!as_generator(open_namespace).generate(sink, cpp_namespaces, add_lower_case_context(context))) return false;
24 24
25 if(!as_generator(documentation).generate(sink, enum_, context))
26 return false;
27
25 if(!as_generator 28 if(!as_generator
26 ( 29 (
27 "public enum " << string << "\n{\n" 30 "public enum " << string << "\n{\n"
@@ -38,9 +41,9 @@ struct enum_definition_generator
38 name[0] = std::toupper(name[0]); // Hack to allow 'static' as a field name 41 name[0] = std::toupper(name[0]); // Hack to allow 'static' as a field name
39 if (!as_generator 42 if (!as_generator
40 ( 43 (
41 string << " = " << string << ",\n" 44 documentation << string << " = " << string << ",\n"
42 ) 45 )
43 .generate(sink, std::make_tuple(name, literal), context)) 46 .generate(sink, std::make_tuple(*first, name, literal), context))
44 return false; 47 return false;
45 } 48 }
46 49
diff --git a/src/bin/eolian_mono/eolian/mono/function_declaration.hh b/src/bin/eolian_mono/eolian/mono/function_declaration.hh
index 561c975118..76bbd6103b 100644
--- a/src/bin/eolian_mono/eolian/mono/function_declaration.hh
+++ b/src/bin/eolian_mono/eolian/mono/function_declaration.hh
@@ -21,10 +21,13 @@ struct function_declaration_generator
21 { 21 {
22 if(is_function_blacklisted(f.c_name)) 22 if(is_function_blacklisted(f.c_name))
23 return true; 23 return true;
24 else 24
25 return as_generator 25 if(!as_generator(documentation).generate(sink, f, context))
26 return false;
27
28 return as_generator
26 (eolian_mono::type(true) << " " << string << "(" << (parameter % ", ") << ");\n") 29 (eolian_mono::type(true) << " " << string << "(" << (parameter % ", ") << ");\n")
27 .generate(sink, std::make_tuple(f.return_type, managed_method_name(f.name), f.parameters), context); 30 .generate(sink, std::make_tuple(f.return_type, managed_method_name(f.name), f.parameters), context);
28 } 31 }
29}; 32};
30 33
diff --git a/src/bin/eolian_mono/eolian/mono/function_definition.hh b/src/bin/eolian_mono/eolian/mono/function_definition.hh
index 2a4c027896..04e8921fad 100644
--- a/src/bin/eolian_mono/eolian/mono/function_definition.hh
+++ b/src/bin/eolian_mono/eolian/mono/function_definition.hh
@@ -15,6 +15,7 @@
15#include "marshall_type.hh" 15#include "marshall_type.hh"
16#include "parameter.hh" 16#include "parameter.hh"
17#include "keyword.hh" 17#include "keyword.hh"
18#include "documentation.hh"
18#include "using_decl.hh" 19#include "using_decl.hh"
19#include "generation_contexts.hh" 20#include "generation_contexts.hh"
20 21
@@ -34,7 +35,7 @@ struct native_function_definition_generator
34 if(!as_generator 35 if(!as_generator
35 ("\n\n" << scope_tab 36 ("\n\n" << scope_tab
36 << eolian_mono::marshall_native_annotation(true) 37 << eolian_mono::marshall_native_annotation(true)
37 << " public delegate " 38 << " private delegate "
38 << eolian_mono::marshall_type(true) 39 << eolian_mono::marshall_type(true)
39 << " " 40 << " "
40 << string 41 << string
@@ -50,7 +51,7 @@ struct native_function_definition_generator
50 if(!as_generator 51 if(!as_generator
51 (scope_tab << "[System.Runtime.InteropServices.DllImport(" << context_find_tag<library_context>(context).actual_library_name(f.filename) << ")] " 52 (scope_tab << "[System.Runtime.InteropServices.DllImport(" << context_find_tag<library_context>(context).actual_library_name(f.filename) << ")] "
52 << eolian_mono::marshall_native_annotation(true) 53 << eolian_mono::marshall_native_annotation(true)
53 << " public static extern " 54 << " private static extern "
54 << eolian_mono::marshall_type(true) 55 << eolian_mono::marshall_type(true)
55 << " " << string 56 << " " << string
56 << "(System.IntPtr obj" 57 << "(System.IntPtr obj"
@@ -68,7 +69,7 @@ struct native_function_definition_generator
68 69
69 if(!as_generator 70 if(!as_generator
70 (scope_tab 71 (scope_tab
71 << " public static " 72 << " private static "
72 << eolian_mono::marshall_type(true) << " " 73 << eolian_mono::marshall_type(true) << " "
73 << string 74 << string
74 << "(System.IntPtr obj, System.IntPtr pd" 75 << "(System.IntPtr obj, System.IntPtr pd"
@@ -108,7 +109,7 @@ struct native_function_definition_generator
108 return false; 109 return false;
109 110
110 if(!as_generator 111 if(!as_generator
111 (scope_tab << "public static " 112 (scope_tab << "private static "
112 << string 113 << string
113 << "_delegate " 114 << "_delegate "
114 << string << "_static_delegate = new " << string << "_delegate(" << string << "NativeInherit." << string << ");\n" 115 << string << "_static_delegate = new " << string << "_delegate(" << string << "NativeInherit." << string << ");\n"
@@ -137,7 +138,7 @@ struct function_definition_generator
137 if(!as_generator 138 if(!as_generator
138 ("\n\n" << scope_tab << "[System.Runtime.InteropServices.DllImport(" << context_find_tag<library_context>(context).actual_library_name(f.filename) << ")]\n" 139 ("\n\n" << scope_tab << "[System.Runtime.InteropServices.DllImport(" << context_find_tag<library_context>(context).actual_library_name(f.filename) << ")]\n"
139 << scope_tab << eolian_mono::marshall_annotation(true) 140 << scope_tab << eolian_mono::marshall_annotation(true)
140 << " public static extern " 141 << " private static extern "
141 << eolian_mono::marshall_type(true) 142 << eolian_mono::marshall_type(true)
142 << " " << string 143 << " " << string
143 << "(System.IntPtr obj" 144 << "(System.IntPtr obj"
@@ -154,6 +155,10 @@ struct function_definition_generator
154 return false; 155 return false;
155 156
156 if(!as_generator 157 if(!as_generator
158 (documentation(1)).generate(sink, f, context))
159 return false;
160
161 if(!as_generator
157 (scope_tab << (do_super ? "virtual " : "") << "public " << return_type << " " << string << "(" << (parameter % ", ") 162 (scope_tab << (do_super ? "virtual " : "") << "public " << return_type << " " << string << "(" << (parameter % ", ")
158 << ") {\n " 163 << ") {\n "
159 << eolian_mono::function_definition_preamble() << string << "(" 164 << eolian_mono::function_definition_preamble() << string << "("
diff --git a/src/bin/eolian_mono/eolian/mono/function_pointer.hh b/src/bin/eolian_mono/eolian/mono/function_pointer.hh
index 0f91a4c41c..0890edcb51 100644
--- a/src/bin/eolian_mono/eolian/mono/function_pointer.hh
+++ b/src/bin/eolian_mono/eolian/mono/function_pointer.hh
@@ -6,6 +6,8 @@
6#include <vector> 6#include <vector>
7#include <string> 7#include <string>
8 8
9#include "documentation.hh"
10
9namespace eolian_mono { 11namespace eolian_mono {
10 12
11// Blacklist structs that require some kind of manual binding. 13// Blacklist structs that require some kind of manual binding.
@@ -36,25 +38,26 @@ struct function_pointer {
36 if(!as_generator(open_namespace).generate(sink, namespaces, add_lower_case_context(context))) return false; 38 if(!as_generator(open_namespace).generate(sink, namespaces, add_lower_case_context(context))) return false;
37 39
38 // C# visible delegate 40 // C# visible delegate
39 if (!as_generator("public delegate " << type << " " << string 41 if (!as_generator(documentation
42 << "public delegate " << type << " " << string
40 << "(" << (parameter % ", ") << ");\n") 43 << "(" << (parameter % ", ") << ");\n")
41 .generate(sink, std::make_tuple(f.return_type, escape_keyword(f.name), f.parameters), context)) 44 .generate(sink, std::make_tuple(f, f.return_type, escape_keyword(f.name), f.parameters), context))
42 return false; 45 return false;
43 // "Internal" delegate, 1-to-1 with the Unamaged function type 46 // "Internal" delegate, 1-to-1 with the Unamaged function type
44 if (!as_generator("public delegate " << type << " " << string // public? 47 if (!as_generator("internal delegate " << type << " " << string // public?
45 << "Internal(IntPtr data, " << (parameter % ", ") << ");\n") 48 << "Internal(IntPtr data, " << (parameter % ", ") << ");\n")
46 .generate(sink, std::make_tuple(f.return_type, escape_keyword(f.name), f.parameters), context)) 49 .generate(sink, std::make_tuple(f.return_type, escape_keyword(f.name), f.parameters), context))
47 return false; 50 return false;
48 51
49 std::string f_name = escape_keyword(f.name); 52 std::string f_name = escape_keyword(f.name);
50 // Wrapper type, with callback matching the Unamanaged one 53 // Wrapper type, with callback matching the Unamanaged one
51 if (!as_generator("public class " << f_name << "Wrapper\n" 54 if (!as_generator("internal class " << f_name << "Wrapper\n"
52 << "{\n\n" 55 << "{\n\n"
53 << scope_tab << "private " << f_name << "Internal _cb;\n" 56 << scope_tab << "private " << f_name << "Internal _cb;\n"
54 << scope_tab << "private IntPtr _cb_data;\n" 57 << scope_tab << "private IntPtr _cb_data;\n"
55 << scope_tab << "private Eina_Free_Cb _cb_free_cb;\n\n" 58 << scope_tab << "private Eina_Free_Cb _cb_free_cb;\n\n"
56 59
57 << scope_tab << "public " << f_name << "Wrapper (" << f_name << "Internal _cb, IntPtr _cb_data, Eina_Free_Cb _cb_free_cb)\n" 60 << scope_tab << "internal " << f_name << "Wrapper (" << f_name << "Internal _cb, IntPtr _cb_data, Eina_Free_Cb _cb_free_cb)\n"
58 << scope_tab << "{\n" 61 << scope_tab << "{\n"
59 << scope_tab << scope_tab << "this._cb = _cb;\n" 62 << scope_tab << scope_tab << "this._cb = _cb;\n"
60 << scope_tab << scope_tab << "this._cb_data = _cb_data;\n" 63 << scope_tab << scope_tab << "this._cb_data = _cb_data;\n"
@@ -67,12 +70,12 @@ struct function_pointer {
67 << scope_tab << scope_tab << scope_tab << "this._cb_free_cb(this._cb_data);\n" 70 << scope_tab << scope_tab << scope_tab << "this._cb_free_cb(this._cb_data);\n"
68 << scope_tab << "}\n\n" 71 << scope_tab << "}\n\n"
69 72
70 << scope_tab << "public " << type << " ManagedCb(" << (parameter % ",") << ")\n" 73 << scope_tab << "internal " << type << " ManagedCb(" << (parameter % ",") << ")\n"
71 << scope_tab << "{\n" 74 << scope_tab << "{\n"
72 << scope_tab << scope_tab << (f.return_type.c_type != "void" ? "return ": "") << "_cb(_cb_data, " << (argument_invocation_no_conversion % ", ") << ");\n" 75 << scope_tab << scope_tab << (f.return_type.c_type != "void" ? "return ": "") << "_cb(_cb_data, " << (argument_invocation_no_conversion % ", ") << ");\n"
73 << scope_tab << "}\n\n" 76 << scope_tab << "}\n\n"
74 77
75 << scope_tab << "public static " << type << " Cb(IntPtr cb_data, " << (parameter % ", ") << ")\n" 78 << scope_tab << "internal static " << type << " Cb(IntPtr cb_data, " << (parameter % ", ") << ")\n"
76 << scope_tab << "{\n" 79 << scope_tab << "{\n"
77 << scope_tab << scope_tab << "GCHandle handle = GCHandle.FromIntPtr(cb_data);\n" 80 << scope_tab << scope_tab << "GCHandle handle = GCHandle.FromIntPtr(cb_data);\n"
78 << scope_tab << scope_tab << string << " cb = (" << string << ")handle.Target;\n" 81 << scope_tab << scope_tab << string << " cb = (" << string << ")handle.Target;\n"
diff --git a/src/bin/eolian_mono/eolian/mono/klass.hh b/src/bin/eolian_mono/eolian/mono/klass.hh
index 639e263054..d8bea22024 100644
--- a/src/bin/eolian_mono/eolian/mono/klass.hh
+++ b/src/bin/eolian_mono/eolian/mono/klass.hh
@@ -14,6 +14,7 @@
14#include "function_definition.hh" 14#include "function_definition.hh"
15#include "function_registration.hh" 15#include "function_registration.hh"
16#include "function_declaration.hh" 16#include "function_declaration.hh"
17#include "documentation.hh"
17#include "grammar/string.hpp" 18#include "grammar/string.hpp"
18#include "grammar/attribute_replace.hpp" 19#include "grammar/attribute_replace.hpp"
19#include "grammar/integral.hpp" 20#include "grammar/integral.hpp"
@@ -30,7 +31,8 @@ template <typename OutputIterator, typename Context>
30static bool generate_static_cast_method(OutputIterator sink, const std::string &class_name, Context const &context) 31static bool generate_static_cast_method(OutputIterator sink, const std::string &class_name, Context const &context)
31{ 32{
32 return as_generator( 33 return as_generator(
33 scope_tab << "public static " << class_name << " static_cast(efl.Object obj)\n" 34 scope_tab << "///<summary>Casts obj into an instance of this type.</summary>\n"
35 << scope_tab << "public static " << class_name << " static_cast(efl.Object obj)\n"
34 << scope_tab << "{\n" 36 << scope_tab << "{\n"
35 << scope_tab << scope_tab << "if (obj == null)\n" 37 << scope_tab << scope_tab << "if (obj == null)\n"
36 << scope_tab << scope_tab << scope_tab << "throw new System.ArgumentNullException(\"obj\");\n" 38 << scope_tab << scope_tab << scope_tab << "throw new System.ArgumentNullException(\"obj\");\n"
@@ -43,13 +45,15 @@ template <typename OutputIterator, typename Context>
43static bool generate_equals_method(OutputIterator sink, Context const &context) 45static bool generate_equals_method(OutputIterator sink, Context const &context)
44{ 46{
45 return as_generator( 47 return as_generator(
46 scope_tab << "public override bool Equals(object obj)\n" 48 scope_tab << "///<summary>Verifies if the given object is equals to this.</summary>\n"
49 << scope_tab << "public override bool Equals(object obj)\n"
47 << scope_tab << "{\n" 50 << scope_tab << "{\n"
48 << scope_tab << scope_tab << "var other = obj as efl.Object;\n" 51 << scope_tab << scope_tab << "var other = obj as efl.Object;\n"
49 << scope_tab << scope_tab << "if (other == null)\n" 52 << scope_tab << scope_tab << "if (other == null)\n"
50 << scope_tab << scope_tab << scope_tab << "return false;\n" 53 << scope_tab << scope_tab << scope_tab << "return false;\n"
51 << scope_tab << scope_tab << "return this.raw_handle == other.raw_handle;\n" 54 << scope_tab << scope_tab << "return this.raw_handle == other.raw_handle;\n"
52 << scope_tab << "}\n" 55 << scope_tab << "}\n"
56 << scope_tab << "///<summary>Gets the hash code for this object based on the native pointer it points to.</summary>\n"
53 << scope_tab << "public override int GetHashCode()\n" 57 << scope_tab << "public override int GetHashCode()\n"
54 << scope_tab << "{\n" 58 << scope_tab << "{\n"
55 << scope_tab << scope_tab << "return this.raw_handle.ToInt32();\n" 59 << scope_tab << scope_tab << "return this.raw_handle.ToInt32();\n"
@@ -156,8 +160,12 @@ struct klass
156 std::replace(evt_name.begin(), evt_name.end(), ',', '_'); 160 std::replace(evt_name.begin(), evt_name.end(), ',', '_');
157 std::string arg_type = (*etype).original_type.visit(get_csharp_type_visitor{}); 161 std::string arg_type = (*etype).original_type.visit(get_csharp_type_visitor{});
158 162
163 if (!as_generator("///<summary>Event argument wrapper for event " << string << ".</summary>\n"
164 ).generate(sink, evt_name, context))
165 return false;
159 166
160 if (!as_generator("public class " << evt_name << "_Args : EventArgs {\n" 167 if (!as_generator("public class " << evt_name << "_Args : EventArgs {\n"
168 << scope_tab << "///<summary>Actual event payload.</summary>\n"
161 << scope_tab << "public " << arg_type << " arg { get; set; }\n" 169 << scope_tab << "public " << arg_type << " arg { get; set; }\n"
162 << "}\n").generate(sink, NULL, context)) 170 << "}\n").generate(sink, NULL, context))
163 return false; 171 return false;
@@ -166,6 +174,10 @@ struct klass
166 // Interface class 174 // Interface class
167 { 175 {
168 auto iface_cxt = context_add_tag(class_context{class_context::interface}, context); 176 auto iface_cxt = context_add_tag(class_context{class_context::interface}, context);
177
178 if(!as_generator(documentation).generate(sink, cls, iface_cxt))
179 return false;
180
169 if(!as_generator 181 if(!as_generator
170 ( 182 (
171 "public " /*<< class_type*/ "interface" /*<<*/ " " << string << " : " 183 "public " /*<< class_type*/ "interface" /*<<*/ " " << string << " : "
@@ -199,6 +211,10 @@ struct klass
199 if (etype.is_engaged()) 211 if (etype.is_engaged())
200 wrapper_args_type = "<" + evt_name + "_Args>"; 212 wrapper_args_type = "<" + evt_name + "_Args>";
201 213
214
215 if (!as_generator(documentation(1)).generate(sink, e, iface_cxt))
216 return false;
217
202 //FIXME Add a way to generate camelcase names 218 //FIXME Add a way to generate camelcase names
203 if (!as_generator( 219 if (!as_generator(
204 scope_tab << "event EventHandler" << wrapper_args_type << " " 220 scope_tab << "event EventHandler" << wrapper_args_type << " "
@@ -218,19 +234,26 @@ struct klass
218 auto concrete_cxt = context_add_tag(class_context{class_context::concrete}, context); 234 auto concrete_cxt = context_add_tag(class_context{class_context::concrete}, context);
219 if(!as_generator 235 if(!as_generator
220 ( 236 (
221 "public class " << string << "Concrete : " << string << "\n{\n" 237 documentation
238 << "sealed public class " << string << "Concrete : " << string << "\n{\n"
222 << scope_tab << "System.IntPtr handle;\n" 239 << scope_tab << "System.IntPtr handle;\n"
240 << scope_tab << "///<summary>Pointer to the native instance.</summary>\n"
223 << scope_tab << "public System.IntPtr raw_handle {\n" 241 << scope_tab << "public System.IntPtr raw_handle {\n"
224 << scope_tab << scope_tab << "get { return handle; }\n" 242 << scope_tab << scope_tab << "get { return handle; }\n"
225 << scope_tab << "}\n" 243 << scope_tab << "}\n"
244 << scope_tab << "///<summary>Pointer to the native class description.</summary>\n"
226 << scope_tab << "public System.IntPtr raw_klass {\n" 245 << scope_tab << "public System.IntPtr raw_klass {\n"
227 << scope_tab << scope_tab << "get { return efl.eo.Globals.efl_class_get(handle); }\n" 246 << scope_tab << scope_tab << "get { return efl.eo.Globals.efl_class_get(handle); }\n"
228 << scope_tab << "}\n" 247 << scope_tab << "}\n"
248 << scope_tab << "///<summary>Delegate for function to be called from inside the native constructor.</summary>\n"
229 << scope_tab << "public delegate void ConstructingMethod(" << string << " obj);\n" 249 << scope_tab << "public delegate void ConstructingMethod(" << string << " obj);\n"
230 << scope_tab << "[System.Runtime.InteropServices.DllImport(" << context_find_tag<library_context>(concrete_cxt).actual_library_name(cls.filename) 250 << scope_tab << "[System.Runtime.InteropServices.DllImport(" << context_find_tag<library_context>(concrete_cxt).actual_library_name(cls.filename)
231 << ")] static extern System.IntPtr\n" 251 << ")] private static extern System.IntPtr\n"
232 << scope_tab << scope_tab << class_get_name << "();\n" 252 << scope_tab << scope_tab << class_get_name << "();\n"
233 << (class_type == "class" ? "" : "/*") 253 << (class_type == "class" ? "" : "/*")
254 << scope_tab << "///<summary>Creates a new instance.</summary>\n"
255 << scope_tab << "///<param>Parent instance.</param>\n"
256 << scope_tab << "///<param>Delegate to call constructing methods that should be run inside the constructor.</param>\n"
234 << scope_tab << "public " << string << "Concrete(efl.Object parent = null, ConstructingMethod init_cb=null)\n" 257 << scope_tab << "public " << string << "Concrete(efl.Object parent = null, ConstructingMethod init_cb=null)\n"
235 << scope_tab << "{\n" 258 << scope_tab << "{\n"
236 << scope_tab << scope_tab << "System.IntPtr klass = " << class_get_name << "();\n" 259 << scope_tab << scope_tab << "System.IntPtr klass = " << class_get_name << "();\n"
@@ -246,22 +269,26 @@ struct klass
246 << scope_tab << scope_tab << "eina.Error.RaiseIfOccurred();\n" 269 << scope_tab << scope_tab << "eina.Error.RaiseIfOccurred();\n"
247 << scope_tab << "}\n" 270 << scope_tab << "}\n"
248 << (class_type == "class" ? "" : "*/") 271 << (class_type == "class" ? "" : "*/")
272 << scope_tab << "///<summary>Constructs an instance from a native pointer.</summary>\n"
249 << scope_tab << "public " << string << "Concrete(System.IntPtr raw)\n" 273 << scope_tab << "public " << string << "Concrete(System.IntPtr raw)\n"
250 << scope_tab << "{\n" 274 << scope_tab << "{\n"
251 << scope_tab << scope_tab << "handle = raw;\n" 275 << scope_tab << scope_tab << "handle = raw;\n"
252 << scope_tab << scope_tab << "register_event_proxies();\n" 276 << scope_tab << scope_tab << "register_event_proxies();\n"
253 << scope_tab << "}\n" 277 << scope_tab << "}\n"
278 << scope_tab << "///<summary>Destructor.</summary>\n"
254 << scope_tab << "~" << string << "Concrete()\n" 279 << scope_tab << "~" << string << "Concrete()\n"
255 << scope_tab << "{\n" 280 << scope_tab << "{\n"
256 << scope_tab << scope_tab << "Dispose(false);\n" 281 << scope_tab << scope_tab << "Dispose(false);\n"
257 << scope_tab << "}\n" 282 << scope_tab << "}\n"
258 << scope_tab << "protected virtual void Dispose(bool disposing)\n" 283 << scope_tab << "///<summary>Releases the underlying native instance.</summary>\n"
284 << scope_tab << "protected void Dispose(bool disposing)\n"
259 << scope_tab << "{\n" 285 << scope_tab << "{\n"
260 << scope_tab << scope_tab << "if (handle != System.IntPtr.Zero) {\n" 286 << scope_tab << scope_tab << "if (handle != System.IntPtr.Zero) {\n"
261 << scope_tab << scope_tab << scope_tab << "efl.eo.Globals.efl_unref(handle);\n" 287 << scope_tab << scope_tab << scope_tab << "efl.eo.Globals.efl_unref(handle);\n"
262 << scope_tab << scope_tab << scope_tab << "handle = System.IntPtr.Zero;\n" 288 << scope_tab << scope_tab << scope_tab << "handle = System.IntPtr.Zero;\n"
263 << scope_tab << scope_tab << "}\n" 289 << scope_tab << scope_tab << "}\n"
264 << scope_tab << "}\n" 290 << scope_tab << "}\n"
291 << scope_tab << "///<summary>Releases the underlying native instance.</summary>\n"
265 << scope_tab << "public void Dispose()\n" 292 << scope_tab << "public void Dispose()\n"
266 << scope_tab << "{\n" 293 << scope_tab << "{\n"
267 << scope_tab << scope_tab << "Dispose(true);\n" 294 << scope_tab << scope_tab << "Dispose(true);\n"
@@ -269,7 +296,7 @@ struct klass
269 << scope_tab << "}\n" 296 << scope_tab << "}\n"
270 ) 297 )
271 .generate(sink 298 .generate(sink
272 , std::make_tuple( 299 , std::make_tuple( cls,
273 cls.cxx_name, cls.cxx_name, cls.cxx_name, cls.namespaces, cls.eolian_name 300 cls.cxx_name, cls.cxx_name, cls.cxx_name, cls.namespaces, cls.eolian_name
274 , cls.cxx_name, cls.namespaces, cls.eolian_name, cls.cxx_name 301 , cls.cxx_name, cls.namespaces, cls.eolian_name, cls.cxx_name
275 , cls.cxx_name) 302 , cls.cxx_name)
@@ -304,22 +331,29 @@ struct klass
304 331
305 if(!as_generator 332 if(!as_generator
306 ( 333 (
307 "public " << class_type << " " << string << "Inherit : " << string << "\n{\n" 334 documentation
335 << "public " << class_type << " " << string << "Inherit : " << string << "\n{\n"
308 << scope_tab << "System.IntPtr handle;\n" 336 << scope_tab << "System.IntPtr handle;\n"
309 << scope_tab << "public static System.IntPtr klass = System.IntPtr.Zero;\n" 337 << scope_tab << "internal static System.IntPtr klass = System.IntPtr.Zero;\n"
310 << scope_tab << "private static readonly object klassAllocLock = new object();\n" 338 << scope_tab << "private static readonly object klassAllocLock = new object();\n"
311 << scope_tab << (cls_has_string_return ? ("public Dictionary<String, IntPtr> cached_strings = new Dictionary<String, IntPtr>();") : "") << "\n" 339 << scope_tab << (cls_has_string_return ? ("internal Dictionary<String, IntPtr> cached_strings = new Dictionary<String, IntPtr>();") : "") << "\n"
312 << scope_tab << (cls_has_stringshare_return ? ("public Dictionary<String, IntPtr> cached_stringshares = new Dictionary<String, IntPtr>();") : "") << "\n" 340 << scope_tab << (cls_has_stringshare_return ? ("internal Dictionary<String, IntPtr> cached_stringshares = new Dictionary<String, IntPtr>();") : "") << "\n"
341 << scope_tab << "///<summary>Pointer to the native instance.</summary>\n"
313 << scope_tab << "public System.IntPtr raw_handle {\n" 342 << scope_tab << "public System.IntPtr raw_handle {\n"
314 << scope_tab << scope_tab << "get { return handle; }\n" 343 << scope_tab << scope_tab << "get { return handle; }\n"
315 << scope_tab << "}\n" 344 << scope_tab << "}\n"
345 << scope_tab << "///<summary>Pointer to the native class description.</summary>\n"
316 << scope_tab << "public System.IntPtr raw_klass {\n" 346 << scope_tab << "public System.IntPtr raw_klass {\n"
317 << scope_tab << scope_tab << "get { return klass; }\n" 347 << scope_tab << scope_tab << "get { return klass; }\n"
318 << scope_tab << "}\n" 348 << scope_tab << "}\n"
349 << scope_tab << "///<summary>Delegate for function to be called from inside the native constructor.</summary>\n"
319 << scope_tab << "public delegate void ConstructingMethod(" << string << " obj);\n" 350 << scope_tab << "public delegate void ConstructingMethod(" << string << " obj);\n"
320 << scope_tab << "[System.Runtime.InteropServices.DllImport(" << context_find_tag<library_context>(inherit_cxt).actual_library_name(cls.filename) 351 << scope_tab << "[System.Runtime.InteropServices.DllImport(" << context_find_tag<library_context>(inherit_cxt).actual_library_name(cls.filename)
321 << ")] static extern System.IntPtr\n" 352 << ")] private static extern System.IntPtr\n"
322 << scope_tab << scope_tab << class_get_name << "();\n" 353 << scope_tab << scope_tab << class_get_name << "();\n"
354 << scope_tab << "///<summary>Creates a new instance.</summary>\n"
355 << scope_tab << "///<param>Parent instance.</param>\n"
356 << scope_tab << "///<param>Delegate to call constructing methods that should be run inside the constructor.</param>\n"
323 << scope_tab << "public " << string << "Inherit(efl.Object parent = null, ConstructingMethod init_cb=null)\n" 357 << scope_tab << "public " << string << "Inherit(efl.Object parent = null, ConstructingMethod init_cb=null)\n"
324 << scope_tab << "{\n" 358 << scope_tab << "{\n"
325 << scope_tab << scope_tab << "if (klass == System.IntPtr.Zero) {\n" 359 << scope_tab << scope_tab << "if (klass == System.IntPtr.Zero) {\n"
@@ -339,10 +373,12 @@ struct klass
339 << scope_tab << scope_tab << "register_event_proxies();\n" 373 << scope_tab << scope_tab << "register_event_proxies();\n"
340 << scope_tab << scope_tab << "eina.Error.RaiseIfOccurred();\n" 374 << scope_tab << scope_tab << "eina.Error.RaiseIfOccurred();\n"
341 << scope_tab << "}\n" 375 << scope_tab << "}\n"
376 << scope_tab << "///<summary>Destructor.</summary>\n"
342 << scope_tab << "~" << string << "Inherit()\n" 377 << scope_tab << "~" << string << "Inherit()\n"
343 << scope_tab << "{\n" 378 << scope_tab << "{\n"
344 << scope_tab << scope_tab << "Dispose(false);\n" 379 << scope_tab << scope_tab << "Dispose(false);\n"
345 << scope_tab << "}\n" 380 << scope_tab << "}\n"
381 << scope_tab << "///<summary>Releases the underlying native instance.</summary>\n"
346 << scope_tab << "protected virtual void Dispose(bool disposing)\n" 382 << scope_tab << "protected virtual void Dispose(bool disposing)\n"
347 << scope_tab << "{\n" 383 << scope_tab << "{\n"
348 << scope_tab << scope_tab << "if (handle != System.IntPtr.Zero) {\n" 384 << scope_tab << scope_tab << "if (handle != System.IntPtr.Zero) {\n"
@@ -350,6 +386,7 @@ struct klass
350 << scope_tab << scope_tab << scope_tab << "handle = System.IntPtr.Zero;\n" 386 << scope_tab << scope_tab << scope_tab << "handle = System.IntPtr.Zero;\n"
351 << scope_tab << scope_tab << "}\n" 387 << scope_tab << scope_tab << "}\n"
352 << scope_tab << "}\n" 388 << scope_tab << "}\n"
389 << scope_tab << "///<summary>Releases the underlying native instance.</summary>\n"
353 << scope_tab << "public void Dispose()\n" 390 << scope_tab << "public void Dispose()\n"
354 << scope_tab << "{\n" 391 << scope_tab << "{\n"
355 << scope_tab << (cls_has_string_return ? "efl.eo.Globals.free_dict_values(cached_strings);" : "") << "\n" 392 << scope_tab << (cls_has_string_return ? "efl.eo.Globals.free_dict_values(cached_strings);" : "") << "\n"
@@ -360,7 +397,7 @@ struct klass
360 ) 397 )
361 .generate(sink 398 .generate(sink
362 , std::make_tuple( 399 , std::make_tuple(
363 cls.cxx_name, cls.cxx_name, cls.cxx_name, cls.namespaces, cls.eolian_name 400 cls, cls.cxx_name, cls.cxx_name, cls.cxx_name, cls.namespaces, cls.eolian_name
364 , cls.cxx_name, cls.cxx_name, cls.namespaces, cls.eolian_name, cls.cxx_name 401 , cls.cxx_name, cls.cxx_name, cls.namespaces, cls.eolian_name, cls.cxx_name
365 , cls.cxx_name) 402 , cls.cxx_name)
366 , inherit_cxt)) 403 , inherit_cxt))
@@ -399,7 +436,7 @@ struct klass
399 auto inative_cxt = context_add_tag(class_context{class_context::inherit_native}, context); 436 auto inative_cxt = context_add_tag(class_context{class_context::inherit_native}, context);
400 if(!as_generator 437 if(!as_generator
401 ( 438 (
402 "public " << class_type << " " << string << "NativeInherit {\n" 439 "internal " << class_type << " " << string << "NativeInherit {\n"
403 << scope_tab << "public static byte class_initializer(IntPtr klass)\n" 440 << scope_tab << "public static byte class_initializer(IntPtr klass)\n"
404 << scope_tab << "{\n" 441 << scope_tab << "{\n"
405 << scope_tab << scope_tab << "Efl_Op_Description[] descs = new Efl_Op_Description[" << grammar::int_ << "];\n" 442 << scope_tab << scope_tab << "Efl_Op_Description[] descs = new Efl_Op_Description[" << grammar::int_ << "];\n"
@@ -528,7 +565,7 @@ struct klass
528 << scope_tab << scope_tab << scope_tab << "efl.kw_event.Description desc = new efl.kw_event.Description(key);\n" 565 << scope_tab << scope_tab << scope_tab << "efl.kw_event.Description desc = new efl.kw_event.Description(key);\n"
529 << scope_tab << scope_tab << scope_tab << "bool result = efl.eo.Globals.efl_event_callback_priority_add(handle, desc, 0, evt_delegate, System.IntPtr.Zero);\n" 566 << scope_tab << scope_tab << scope_tab << "bool result = efl.eo.Globals.efl_event_callback_priority_add(handle, desc, 0, evt_delegate, System.IntPtr.Zero);\n"
530 << scope_tab << scope_tab << scope_tab << "if (!result) {\n" 567 << scope_tab << scope_tab << scope_tab << "if (!result) {\n"
531 << scope_tab << scope_tab << scope_tab << scope_tab << "eina.Log.Error(\"Failed to add event proxy for event ${key}\");\n" 568 << scope_tab << scope_tab << scope_tab << scope_tab << "eina.Log.Error($\"Failed to add event proxy for event {key}\");\n"
532 << scope_tab << scope_tab << scope_tab << scope_tab << "return false;\n" 569 << scope_tab << scope_tab << scope_tab << scope_tab << "return false;\n"
533 << scope_tab << scope_tab << scope_tab << "}\n" 570 << scope_tab << scope_tab << scope_tab << "}\n"
534 << scope_tab << scope_tab << scope_tab << "eina.Error.RaiseIfOccurred();\n" 571 << scope_tab << scope_tab << scope_tab << "eina.Error.RaiseIfOccurred();\n"
@@ -544,12 +581,12 @@ struct klass
544 << scope_tab << scope_tab << scope_tab << "efl.kw_event.Description desc = new efl.kw_event.Description(key);\n" 581 << scope_tab << scope_tab << scope_tab << "efl.kw_event.Description desc = new efl.kw_event.Description(key);\n"
545 << scope_tab << scope_tab << scope_tab << "bool result = efl.eo.Globals.efl_event_callback_del(handle, desc, evt_delegate, System.IntPtr.Zero);\n" 582 << scope_tab << scope_tab << scope_tab << "bool result = efl.eo.Globals.efl_event_callback_del(handle, desc, evt_delegate, System.IntPtr.Zero);\n"
546 << scope_tab << scope_tab << scope_tab << "if (!result) {\n" 583 << scope_tab << scope_tab << scope_tab << "if (!result) {\n"
547 << scope_tab << scope_tab << scope_tab << scope_tab << "eina.Log.Error(\"Failed to remove event proxy for event ${key}\");\n" 584 << scope_tab << scope_tab << scope_tab << scope_tab << "eina.Log.Error($\"Failed to remove event proxy for event {key}\");\n"
548 << scope_tab << scope_tab << scope_tab << scope_tab << "return false;\n" 585 << scope_tab << scope_tab << scope_tab << scope_tab << "return false;\n"
549 << scope_tab << scope_tab << scope_tab << "}\n" 586 << scope_tab << scope_tab << scope_tab << "}\n"
550 << scope_tab << scope_tab << scope_tab << "eina.Error.RaiseIfOccurred();\n" 587 << scope_tab << scope_tab << scope_tab << "eina.Error.RaiseIfOccurred();\n"
551 << scope_tab << scope_tab << "} else if (event_count == 0) {\n" 588 << scope_tab << scope_tab << "} else if (event_count == 0) {\n"
552 << scope_tab << scope_tab << scope_tab << "eina.Log.Error(\"Trying to remove proxy for event ${key} when there is nothing registered.\");\n" 589 << scope_tab << scope_tab << scope_tab << "eina.Log.Error($\"Trying to remove proxy for event {key} when there is nothing registered.\");\n"
553 << scope_tab << scope_tab << scope_tab << "return false;\n" 590 << scope_tab << scope_tab << scope_tab << "return false;\n"
554 << scope_tab << scope_tab << "} \n" 591 << scope_tab << scope_tab << "} \n"
555 << scope_tab << scope_tab << "event_cb_count[key]--;\n" 592 << scope_tab << scope_tab << "event_cb_count[key]--;\n"
@@ -586,8 +623,12 @@ struct klass
586 // Marshal.PtrToStructure for value types 623 // Marshal.PtrToStructure for value types
587 624
588 // Wrapper event declaration 625 // Wrapper event declaration
626 if(!as_generator(documentation(1)).generate(sink, e, context))
627 return false;
628
589 if(!as_generator( 629 if(!as_generator(
590 scope_tab << "protected event EventHandler" << wrapper_args_template << " " << upper_name << ";\n" 630 scope_tab << "protected event EventHandler" << wrapper_args_template << " " << upper_name << ";\n"
631 << scope_tab << "///<summary>Method to raise event "<< event_name << ".</summary>\n"
591 << scope_tab << "protected void On_" << event_name << "(" << wrapper_args_type << " e)\n" 632 << scope_tab << "protected void On_" << event_name << "(" << wrapper_args_type << " e)\n"
592 << scope_tab << "{\n" 633 << scope_tab << "{\n"
593 << scope_tab << scope_tab << "EventHandler" << wrapper_args_template << " evt;\n" 634 << scope_tab << scope_tab << "EventHandler" << wrapper_args_template << " evt;\n"
@@ -596,13 +637,13 @@ struct klass
596 << scope_tab << scope_tab << "}\n" 637 << scope_tab << scope_tab << "}\n"
597 << scope_tab << scope_tab << "if (evt != null) { evt(this, e); }\n" 638 << scope_tab << scope_tab << "if (evt != null) { evt(this, e); }\n"
598 << scope_tab << "}\n" 639 << scope_tab << "}\n"
599 << scope_tab << "public void on_" << event_name << "_NativeCallback(System.IntPtr data, ref efl.Event evt)\n" 640 << scope_tab << "private void on_" << event_name << "_NativeCallback(System.IntPtr data, ref efl.Event evt)\n"
600 << scope_tab << "{\n" 641 << scope_tab << "{\n"
601 << scope_tab << event_args 642 << scope_tab << event_args
602 << scope_tab << scope_tab << "try {\n" 643 << scope_tab << scope_tab << "try {\n"
603 << scope_tab << scope_tab << scope_tab << "On_" << event_name << "(args);\n" 644 << scope_tab << scope_tab << scope_tab << "On_" << event_name << "(args);\n"
604 << scope_tab << scope_tab << "} catch (Exception e) {\n" 645 << scope_tab << scope_tab << "} catch (Exception e) {\n"
605 << scope_tab << scope_tab << scope_tab << "eina.Log.Warning(e.ToString());\n" 646 << scope_tab << scope_tab << scope_tab << "eina.Log.Error(e.ToString());\n"
606 << scope_tab << scope_tab << scope_tab << "eina.Error.Set(eina.Error.EFL_ERROR);\n" 647 << scope_tab << scope_tab << scope_tab << "eina.Error.Set(eina.Error.EFL_ERROR);\n"
607 << scope_tab << scope_tab << "}\n" 648 << scope_tab << scope_tab << "}\n"
608 << scope_tab << "}\n" 649 << scope_tab << "}\n"
@@ -618,7 +659,7 @@ struct klass
618 << scope_tab << scope_tab << scope_tab << scope_tab << "if (add_cpp_event_handler(key, this.evt_" << event_name << "_delegate))\n" 659 << scope_tab << scope_tab << scope_tab << scope_tab << "if (add_cpp_event_handler(key, this.evt_" << event_name << "_delegate))\n"
619 << scope_tab << scope_tab << scope_tab << scope_tab << scope_tab << upper_name << " += value;\n" 660 << scope_tab << scope_tab << scope_tab << scope_tab << scope_tab << upper_name << " += value;\n"
620 << scope_tab << scope_tab << scope_tab << scope_tab << "else\n" 661 << scope_tab << scope_tab << scope_tab << scope_tab << "else\n"
621 << scope_tab << scope_tab << scope_tab << scope_tab << scope_tab << "eina.Log.Error(\"Error adding proxy for event ${key}\");\n" 662 << scope_tab << scope_tab << scope_tab << scope_tab << scope_tab << "eina.Log.Error($\"Error adding proxy for event {key}\");\n"
622 << scope_tab << scope_tab << scope_tab << "}\n" // End of lock block 663 << scope_tab << scope_tab << scope_tab << "}\n" // End of lock block
623 << scope_tab << scope_tab << "}\n" 664 << scope_tab << scope_tab << "}\n"
624 << scope_tab << scope_tab << "remove {\n" 665 << scope_tab << scope_tab << "remove {\n"
@@ -627,7 +668,7 @@ struct klass
627 << scope_tab << scope_tab << scope_tab << scope_tab << "if (remove_cpp_event_handler(key, this.evt_" << event_name << "_delegate))\n" 668 << scope_tab << scope_tab << scope_tab << scope_tab << "if (remove_cpp_event_handler(key, this.evt_" << event_name << "_delegate))\n"
628 << scope_tab << scope_tab << scope_tab << scope_tab << scope_tab << upper_name << " -= value;\n" 669 << scope_tab << scope_tab << scope_tab << scope_tab << scope_tab << upper_name << " -= value;\n"
629 << scope_tab << scope_tab << scope_tab << scope_tab << "else\n" 670 << scope_tab << scope_tab << scope_tab << scope_tab << "else\n"
630 << scope_tab << scope_tab << scope_tab << scope_tab << scope_tab << "eina.Log.Error(\"Error removing proxy for event ${key}\");\n" 671 << scope_tab << scope_tab << scope_tab << scope_tab << scope_tab << "eina.Log.Error($\"Error removing proxy for event {key}\");\n"
631 << scope_tab << scope_tab << scope_tab << "}\n" // End of lock block 672 << scope_tab << scope_tab << scope_tab << "}\n" // End of lock block
632 << scope_tab << scope_tab << "}\n" 673 << scope_tab << scope_tab << "}\n"
633 << scope_tab << "}\n") 674 << scope_tab << "}\n")
@@ -672,8 +713,12 @@ struct klass
672 wrapper_args_type << "EventArgs"; 713 wrapper_args_type << "EventArgs";
673 } 714 }
674 715
716 if (!as_generator(documentation(1)).generate(sink, e, context))
717 return false;
718
675 if (!as_generator( 719 if (!as_generator(
676 scope_tab << "protected event EventHandler" << wrapper_args_template << " " << wrapper_evt_name << ";\n" 720 scope_tab << "protected event EventHandler" << wrapper_args_template << " " << wrapper_evt_name << ";\n"
721 << scope_tab << "///<summary>Method to raise event "<< wrapper_evt_name << ".</summary>\n"
677 << scope_tab << "protected void On_" << wrapper_evt_name << "(" << wrapper_args_type.str() << " e)\n" 722 << scope_tab << "protected void On_" << wrapper_evt_name << "(" << wrapper_args_type.str() << " e)\n"
678 << scope_tab << "{\n" 723 << scope_tab << "{\n"
679 << scope_tab << scope_tab << "EventHandler" << wrapper_args_template << " evt;\n" 724 << scope_tab << scope_tab << "EventHandler" << wrapper_args_template << " evt;\n"
@@ -683,13 +728,13 @@ struct klass
683 << scope_tab << scope_tab << "if (evt != null) { evt(this, e); }\n" 728 << scope_tab << scope_tab << "if (evt != null) { evt(this, e); }\n"
684 << scope_tab << "}\n" 729 << scope_tab << "}\n"
685 << scope_tab << "efl.Event_Cb evt_" << wrapper_evt_name << "_delegate;\n" 730 << scope_tab << "efl.Event_Cb evt_" << wrapper_evt_name << "_delegate;\n"
686 << scope_tab << "protected void on_" << wrapper_evt_name << "_NativeCallback(System.IntPtr data, ref efl.Event evt)" 731 << scope_tab << "private void on_" << wrapper_evt_name << "_NativeCallback(System.IntPtr data, ref efl.Event evt)"
687 << scope_tab << "{\n" 732 << scope_tab << "{\n"
688 << scope_tab << event_args 733 << scope_tab << event_args
689 << scope_tab << scope_tab << "try {\n" 734 << scope_tab << scope_tab << "try {\n"
690 << scope_tab << scope_tab << scope_tab << "On_" << wrapper_evt_name << "(args);\n" 735 << scope_tab << scope_tab << scope_tab << "On_" << wrapper_evt_name << "(args);\n"
691 << scope_tab << scope_tab << "} catch (Exception e) {\n" 736 << scope_tab << scope_tab << "} catch (Exception e) {\n"
692 << scope_tab << scope_tab << scope_tab << "eina.Log.Warning(e.ToString());\n" 737 << scope_tab << scope_tab << scope_tab << "eina.Log.Error(e.ToString());\n"
693 << scope_tab << scope_tab << scope_tab << "eina.Error.Set(eina.Error.EFL_ERROR);\n" 738 << scope_tab << scope_tab << scope_tab << "eina.Error.Set(eina.Error.EFL_ERROR);\n"
694 << scope_tab << scope_tab << "}\n" 739 << scope_tab << scope_tab << "}\n"
695 << scope_tab << "}\n" 740 << scope_tab << "}\n"
@@ -703,7 +748,7 @@ struct klass
703 << scope_tab << scope_tab << scope_tab << scope_tab << "if (add_cpp_event_handler(key, this.evt_" << wrapper_evt_name << "_delegate))\n" 748 << scope_tab << scope_tab << scope_tab << scope_tab << "if (add_cpp_event_handler(key, this.evt_" << wrapper_evt_name << "_delegate))\n"
704 << scope_tab << scope_tab << scope_tab << scope_tab << scope_tab << wrapper_evt_name << " += value;\n" 749 << scope_tab << scope_tab << scope_tab << scope_tab << scope_tab << wrapper_evt_name << " += value;\n"
705 << scope_tab << scope_tab << scope_tab << scope_tab << "else\n" 750 << scope_tab << scope_tab << scope_tab << scope_tab << "else\n"
706 << scope_tab << scope_tab << scope_tab << scope_tab << scope_tab << "eina.Log.Error(\"Error adding proxy for event ${key}\");\n" 751 << scope_tab << scope_tab << scope_tab << scope_tab << scope_tab << "eina.Log.Error($\"Error adding proxy for event {key}\");\n"
707 << scope_tab << scope_tab << scope_tab << "}\n" // End of lock block 752 << scope_tab << scope_tab << scope_tab << "}\n" // End of lock block
708 << scope_tab << scope_tab << "}\n" 753 << scope_tab << scope_tab << "}\n"
709 << scope_tab << scope_tab << "remove {\n" 754 << scope_tab << scope_tab << "remove {\n"
@@ -712,7 +757,7 @@ struct klass
712 << scope_tab << scope_tab << scope_tab << scope_tab << "if (remove_cpp_event_handler(key, this.evt_" << wrapper_evt_name << "_delegate))\n" 757 << scope_tab << scope_tab << scope_tab << scope_tab << "if (remove_cpp_event_handler(key, this.evt_" << wrapper_evt_name << "_delegate))\n"
713 << scope_tab << scope_tab << scope_tab << scope_tab << scope_tab << wrapper_evt_name << " -= value;\n" 758 << scope_tab << scope_tab << scope_tab << scope_tab << scope_tab << wrapper_evt_name << " -= value;\n"
714 << scope_tab << scope_tab << scope_tab << scope_tab << "else\n" 759 << scope_tab << scope_tab << scope_tab << scope_tab << "else\n"
715 << scope_tab << scope_tab << scope_tab << scope_tab << scope_tab << "eina.Log.Error(\"Error removing proxy for event ${key}\");\n" 760 << scope_tab << scope_tab << scope_tab << scope_tab << scope_tab << "eina.Log.Error($\"Error removing proxy for event {key}\");\n"
716 << scope_tab << scope_tab << scope_tab << "}\n" // End of lock block 761 << scope_tab << scope_tab << scope_tab << "}\n" // End of lock block
717 << scope_tab << scope_tab << "}\n" 762 << scope_tab << scope_tab << "}\n"
718 << scope_tab << "}\n") 763 << scope_tab << "}\n")
diff --git a/src/bin/eolian_mono/eolian/mono/struct_definition.hh b/src/bin/eolian_mono/eolian/mono/struct_definition.hh
index 85cc14cc0d..5db84e0a9b 100644
--- a/src/bin/eolian_mono/eolian/mono/struct_definition.hh
+++ b/src/bin/eolian_mono/eolian/mono/struct_definition.hh
@@ -10,6 +10,7 @@
10#include "type.hh" 10#include "type.hh"
11#include "keyword.hh" 11#include "keyword.hh"
12#include "using_decl.hh" 12#include "using_decl.hh"
13#include "documentation.hh"
13 14
14namespace eolian_mono { 15namespace eolian_mono {
15 16
@@ -35,6 +36,9 @@ struct struct_definition_generator
35 template <typename OutputIterator, typename Context> 36 template <typename OutputIterator, typename Context>
36 bool generate(OutputIterator sink, attributes::struct_def const& struct_, Context const& context) const 37 bool generate(OutputIterator sink, attributes::struct_def const& struct_, Context const& context) const
37 { 38 {
39
40 if(!as_generator(documentation).generate(sink, struct_, context))
41 return false;
38 if(!as_generator 42 if(!as_generator
39 ( 43 (
40 "[StructLayout(LayoutKind.Sequential)]\n" 44 "[StructLayout(LayoutKind.Sequential)]\n"
@@ -46,11 +50,14 @@ struct struct_definition_generator
46 // iterate struct fields 50 // iterate struct fields
47 for (auto const& field : struct_.fields) 51 for (auto const& field : struct_.fields)
48 { 52 {
53 auto field_name = field.name;
54 field_name[0] = std::toupper(field_name[0]); // Hack to allow 'static' as a field name
49 if (!as_generator 55 if (!as_generator
50 ( 56 (
51 " public " << type << " " << string << ";\n" 57 documentation(1)
58 << scope_tab(1) << "public " << type << " " << string << ";\n"
52 ) 59 )
53 .generate(sink, std::make_tuple(field.type, to_field_name(field.name)), context)) 60 .generate(sink, std::make_tuple(field, field.type, to_field_name(field.name)), context))
54 return false; 61 return false;
55 } 62 }
56 63
@@ -79,7 +86,7 @@ struct struct_internal_definition_generator
79 if (!as_generator 86 if (!as_generator
80 ( 87 (
81 "[StructLayout(LayoutKind.Sequential)]\n" 88 "[StructLayout(LayoutKind.Sequential)]\n"
82 "public struct " << string << "\n{\n" 89 "internal struct " << string << "\n{\n"
83 ) 90 )
84 .generate(sink, binding_struct_internal_name(struct_), context)) 91 .generate(sink, binding_struct_internal_name(struct_), context))
85 return false; 92 return false;
@@ -97,11 +104,11 @@ struct struct_internal_definition_generator
97 || regular->base_type == "stringshare" 104 || regular->base_type == "stringshare"
98 || regular->base_type == "any_value_ptr"))) 105 || regular->base_type == "any_value_ptr")))
99 { 106 {
100 if (!as_generator(" public System.IntPtr " << string << ";\n") 107 if (!as_generator(" internal System.IntPtr " << string << ";\n")
101 .generate(sink, field_name, context)) 108 .generate(sink, field_name, context))
102 return false; 109 return false;
103 } 110 }
104 else if (!as_generator(eolian_mono::marshall_annotation(false) << " public " << eolian_mono::marshall_type(false) << " " << string << ";\n") 111 else if (!as_generator(eolian_mono::marshall_annotation(false) << " internal " << eolian_mono::marshall_type(false) << " " << string << ";\n")
105 .generate(sink, std::make_tuple(field.type, field.type, field_name), context)) 112 .generate(sink, std::make_tuple(field.type, field.type, field_name), context))
106 return false; 113 return false;
107 } 114 }
@@ -112,7 +119,7 @@ struct struct_internal_definition_generator
112 // those 'mini-amd64.c condition fields not met' crashes. 119 // those 'mini-amd64.c condition fields not met' crashes.
113 if (struct_.fields.size() == 0) 120 if (struct_.fields.size() == 0)
114 { 121 {
115 if (!as_generator("public IntPtr field;\n").generate(sink, nullptr, context)) 122 if (!as_generator("internal IntPtr field;\n").generate(sink, nullptr, context))
116 return false; 123 return false;
117 } 124 }
118 125
@@ -330,7 +337,7 @@ struct struct_binding_conversion_functions_generator
330 // Open conversion class 337 // Open conversion class
331 if (!as_generator 338 if (!as_generator
332 ( 339 (
333 "public static class " << string << "_StructConvertion\n{\n" 340 "internal static class " << string << "_StructConvertion\n{\n"
334 ) 341 )
335 .generate(sink, struct_.cxx_name, context)) 342 .generate(sink, struct_.cxx_name, context))
336 return false; 343 return false;
@@ -338,7 +345,7 @@ struct struct_binding_conversion_functions_generator
338 // to internal 345 // to internal
339 if (!as_generator 346 if (!as_generator
340 ( 347 (
341 scope_tab << "public static " << string << " ToInternal(" << string << " _external_struct)\n" 348 scope_tab << "internal static " << string << " ToInternal(" << string << " _external_struct)\n"
342 << scope_tab << "{\n" 349 << scope_tab << "{\n"
343 << scope_tab << scope_tab << "var _internal_struct = new " << string << "();\n\n" 350 << scope_tab << scope_tab << "var _internal_struct = new " << string << "();\n\n"
344 ) 351 )
@@ -366,7 +373,7 @@ struct struct_binding_conversion_functions_generator
366 // to external 373 // to external
367 if (!as_generator 374 if (!as_generator
368 ( 375 (
369 scope_tab << "public static " << string << " ToExternal(" << string << " _internal_struct)\n" 376 scope_tab << "internal static " << string << " ToExternal(" << string << " _internal_struct)\n"
370 << scope_tab << "{\n" 377 << scope_tab << "{\n"
371 << scope_tab << scope_tab << "var _external_struct = new " << string << "();\n\n" 378 << scope_tab << scope_tab << "var _external_struct = new " << string << "();\n\n"
372 ) 379 )
diff --git a/src/bin/eolian_mono/eolian/mono/using_decl.hh b/src/bin/eolian_mono/eolian/mono/using_decl.hh
index 97bf62c526..fdea162f59 100644
--- a/src/bin/eolian_mono/eolian/mono/using_decl.hh
+++ b/src/bin/eolian_mono/eolian/mono/using_decl.hh
@@ -1,11 +1,19 @@
1#ifndef EOLIAN_MONO_USING_DECL_HH 1#ifndef EOLIAN_MONO_USING_DECL_HH
2#define EOLIAN_MONO_USING_DECL_HH 2#define EOLIAN_MONO_USING_DECL_HH
3 3
4#include <grammar/generator.hpp>
5#include <grammar/context.hpp>
6#include <grammar/kleene.hpp>
7#include <grammar/integral.hpp>
8#include <grammar/string.hpp>
9#include <grammar/html_escaped_string.hpp>
10
4namespace eolian_mono { 11namespace eolian_mono {
5 12
6namespace grammar = efl::eolian::grammar; 13namespace grammar = efl::eolian::grammar;
7using efl::eolian::grammar::as_generator; 14using efl::eolian::grammar::as_generator;
8using efl::eolian::grammar::string; 15using efl::eolian::grammar::string;
16using efl::eolian::grammar::html_escaped_string;
9using efl::eolian::grammar::operator<<; 17using efl::eolian::grammar::operator<<;
10using efl::eolian::grammar::operator%; 18using efl::eolian::grammar::operator%;
11using efl::eolian::grammar::operator*; 19using efl::eolian::grammar::operator*;
diff --git a/src/bindings/mono/ecore_evas_mono/ecore_evas.cs b/src/bindings/mono/ecore_evas_mono/ecore_evas.cs
index a1c8a6dfe2..81609f4736 100644
--- a/src/bindings/mono/ecore_evas_mono/ecore_evas.cs
+++ b/src/bindings/mono/ecore_evas_mono/ecore_evas.cs
@@ -1,3 +1,4 @@
1#pragma warning disable 1591
1 2
2using System; 3using System;
3using System.Runtime.InteropServices; 4using System.Runtime.InteropServices;
diff --git a/src/bindings/mono/efl_mono/efl_all.cs b/src/bindings/mono/efl_mono/efl_all.cs
index 697cdf2f94..440f44b773 100644
--- a/src/bindings/mono/efl_mono/efl_all.cs
+++ b/src/bindings/mono/efl_mono/efl_all.cs
@@ -1,3 +1,5 @@
1#pragma warning disable 1591
2
1using System; 3using System;
2using System.Runtime.InteropServices; 4using System.Runtime.InteropServices;
3using System.Threading; 5using System.Threading;
diff --git a/src/bindings/mono/efl_mono/efl_libs.cs.in b/src/bindings/mono/efl_mono/efl_libs.cs.in
index e1c7dc6aeb..86742641fe 100644
--- a/src/bindings/mono/efl_mono/efl_libs.cs.in
+++ b/src/bindings/mono/efl_mono/efl_libs.cs.in
@@ -1,3 +1,4 @@
1#pragma warning disable 1591
1 2
2namespace efl { 3namespace efl {
3 4
diff --git a/src/bindings/mono/eina_mono/eina_array.cs b/src/bindings/mono/eina_mono/eina_array.cs
index 98e43b88b8..6156c0cbb1 100644
--- a/src/bindings/mono/eina_mono/eina_array.cs
+++ b/src/bindings/mono/eina_mono/eina_array.cs
@@ -1,3 +1,5 @@
1#pragma warning disable 1591
2
1using System; 3using System;
2using System.Runtime.InteropServices; 4using System.Runtime.InteropServices;
3using System.Collections.Generic; 5using System.Collections.Generic;
diff --git a/src/bindings/mono/eina_mono/eina_binbuf.cs b/src/bindings/mono/eina_mono/eina_binbuf.cs
index dd30ab1275..ecfbfc3705 100644
--- a/src/bindings/mono/eina_mono/eina_binbuf.cs
+++ b/src/bindings/mono/eina_mono/eina_binbuf.cs
@@ -1,3 +1,5 @@
1#pragma warning disable 1591
2
1using System; 3using System;
2using System.Runtime.InteropServices; 4using System.Runtime.InteropServices;
3 5
diff --git a/src/bindings/mono/eina_mono/eina_common.cs b/src/bindings/mono/eina_mono/eina_common.cs
index fe4e3ecabb..4bd93ce25b 100644
--- a/src/bindings/mono/eina_mono/eina_common.cs
+++ b/src/bindings/mono/eina_mono/eina_common.cs
@@ -1,3 +1,5 @@
1#pragma warning disable 1591
2
1using System; 3using System;
2using System.Text; 4using System.Text;
3using System.Runtime.InteropServices; 5using System.Runtime.InteropServices;
@@ -12,7 +14,7 @@ public delegate void Eina_Free_Cb(IntPtr data);
12 14
13} 15}
14 16
15public static class NativeCustomExportFunctions 17internal static class NativeCustomExportFunctions
16{ 18{
17 [DllImport(efl.Libs.CustomExports)] public static extern void 19 [DllImport(efl.Libs.CustomExports)] public static extern void
18 efl_mono_native_free(IntPtr ptr); 20 efl_mono_native_free(IntPtr ptr);
diff --git a/src/bindings/mono/eina_mono/eina_config.cs b/src/bindings/mono/eina_mono/eina_config.cs
index c33dd06601..b5a0053372 100644
--- a/src/bindings/mono/eina_mono/eina_config.cs
+++ b/src/bindings/mono/eina_mono/eina_config.cs
@@ -1,3 +1,5 @@
1#pragma warning disable 1591
2
1using System; 3using System;
2using System.Runtime.InteropServices; 4using System.Runtime.InteropServices;
3 5
diff --git a/src/bindings/mono/eina_mono/eina_container_common.cs b/src/bindings/mono/eina_mono/eina_container_common.cs
index a264ed7577..173f54d905 100644
--- a/src/bindings/mono/eina_mono/eina_container_common.cs
+++ b/src/bindings/mono/eina_mono/eina_container_common.cs
@@ -1,3 +1,5 @@
1#pragma warning disable 1591
2
1using System; 3using System;
2using System.Runtime.InteropServices; 4using System.Runtime.InteropServices;
3using System.Collections.Generic; 5using System.Collections.Generic;
diff --git a/src/bindings/mono/eina_mono/eina_error.cs b/src/bindings/mono/eina_mono/eina_error.cs
index 7bd604ecc4..c83728047e 100644
--- a/src/bindings/mono/eina_mono/eina_error.cs
+++ b/src/bindings/mono/eina_mono/eina_error.cs
@@ -1,3 +1,5 @@
1#pragma warning disable 1591
2
1using System; 3using System;
2using System.Runtime.InteropServices; 4using System.Runtime.InteropServices;
3 5
diff --git a/src/bindings/mono/eina_mono/eina_hash.cs b/src/bindings/mono/eina_mono/eina_hash.cs
index 045a9aed10..7b05f4e173 100644
--- a/src/bindings/mono/eina_mono/eina_hash.cs
+++ b/src/bindings/mono/eina_mono/eina_hash.cs
@@ -1,3 +1,5 @@
1#pragma warning disable 1591
2
1using System; 3using System;
2using System.Runtime.InteropServices; 4using System.Runtime.InteropServices;
3using System.Collections.Generic; 5using System.Collections.Generic;
diff --git a/src/bindings/mono/eina_mono/eina_inarray.cs b/src/bindings/mono/eina_mono/eina_inarray.cs
index 120a4b8820..e246af83f0 100644
--- a/src/bindings/mono/eina_mono/eina_inarray.cs
+++ b/src/bindings/mono/eina_mono/eina_inarray.cs
@@ -1,3 +1,5 @@
1#pragma warning disable 1591
2
1using System; 3using System;
2using System.Runtime.InteropServices; 4using System.Runtime.InteropServices;
3using System.Collections.Generic; 5using System.Collections.Generic;
diff --git a/src/bindings/mono/eina_mono/eina_inlist.cs b/src/bindings/mono/eina_mono/eina_inlist.cs
index 8257c20593..7b69924a9a 100644
--- a/src/bindings/mono/eina_mono/eina_inlist.cs
+++ b/src/bindings/mono/eina_mono/eina_inlist.cs
@@ -1,3 +1,5 @@
1#pragma warning disable 1591
2
1using System; 3using System;
2using System.Runtime.InteropServices; 4using System.Runtime.InteropServices;
3using System.Collections.Generic; 5using System.Collections.Generic;
diff --git a/src/bindings/mono/eina_mono/eina_iterator.cs b/src/bindings/mono/eina_mono/eina_iterator.cs
index 854a68c084..77f61c189b 100644
--- a/src/bindings/mono/eina_mono/eina_iterator.cs
+++ b/src/bindings/mono/eina_mono/eina_iterator.cs
@@ -1,3 +1,5 @@
1#pragma warning disable 1591
2
1using System; 3using System;
2using System.Runtime.InteropServices; 4using System.Runtime.InteropServices;
3using System.Collections.Generic; 5using System.Collections.Generic;
diff --git a/src/bindings/mono/eina_mono/eina_list.cs b/src/bindings/mono/eina_mono/eina_list.cs
index c972c82ed5..cef766f331 100644
--- a/src/bindings/mono/eina_mono/eina_list.cs
+++ b/src/bindings/mono/eina_mono/eina_list.cs
@@ -1,3 +1,5 @@
1#pragma warning disable 1591
2
1using System; 3using System;
2using System.Runtime.InteropServices; 4using System.Runtime.InteropServices;
3using System.Collections.Generic; 5using System.Collections.Generic;
diff --git a/src/bindings/mono/eina_mono/eina_log.cs b/src/bindings/mono/eina_mono/eina_log.cs
index a2a1e45927..747f8ec58c 100644
--- a/src/bindings/mono/eina_mono/eina_log.cs
+++ b/src/bindings/mono/eina_mono/eina_log.cs
@@ -1,3 +1,5 @@
1#pragma warning disable 1591
2
1using System; 3using System;
2using System.Runtime.InteropServices; 4using System.Runtime.InteropServices;
3using System.Runtime.CompilerServices; 5using System.Runtime.CompilerServices;
diff --git a/src/bindings/mono/eina_mono/eina_slice.cs b/src/bindings/mono/eina_mono/eina_slice.cs
index 189e9a57c7..c75c156fd7 100644
--- a/src/bindings/mono/eina_mono/eina_slice.cs
+++ b/src/bindings/mono/eina_mono/eina_slice.cs
@@ -1,3 +1,5 @@
1#pragma warning disable 1591
2
1using System; 3using System;
2using System.Runtime.InteropServices; 4using System.Runtime.InteropServices;
3 5
diff --git a/src/bindings/mono/eina_mono/eina_stringshare.cs b/src/bindings/mono/eina_mono/eina_stringshare.cs
index 825103d864..4e464c27b1 100644
--- a/src/bindings/mono/eina_mono/eina_stringshare.cs
+++ b/src/bindings/mono/eina_mono/eina_stringshare.cs
@@ -1,3 +1,4 @@
1#pragma warning disable 1591
1 2
2using System; 3using System;
3using System.Runtime.InteropServices; 4using System.Runtime.InteropServices;
diff --git a/src/bindings/mono/eina_mono/eina_value.cs b/src/bindings/mono/eina_mono/eina_value.cs
index 15c06590fa..d4e8dfbf94 100644
--- a/src/bindings/mono/eina_mono/eina_value.cs
+++ b/src/bindings/mono/eina_mono/eina_value.cs
@@ -1,3 +1,5 @@
1#pragma warning disable 1591
2
1#define CODE_ANALYSIS 3#define CODE_ANALYSIS
2 4
3using System; 5using System;
@@ -708,7 +710,7 @@ public class Value : IDisposable, IComparable<Value>, IEquatable<Value>
708 Setup(containerType, subtype, step); 710 Setup(containerType, subtype, step);
709 } 711 }
710 712
711 /// <summary>Constructor to build value from Values_Natives passed by value from C 713 /// <summary>Constructor to build value from Values_Natives passed by value from C.</summary>
712 public Value(Value_Native value) 714 public Value(Value_Native value)
713 { 715 {
714 this.Handle = MemoryNative.Alloc(Marshal.SizeOf(typeof(Value_Native))); 716 this.Handle = MemoryNative.Alloc(Marshal.SizeOf(typeof(Value_Native)));
@@ -721,13 +723,13 @@ public class Value : IDisposable, IComparable<Value>, IEquatable<Value>
721 this.Ownership = ValueOwnership.Managed; 723 this.Ownership = ValueOwnership.Managed;
722 } 724 }
723 725
724 /// <summary>Implicit conversion from managed value to native struct representation 726 /// <summary>Implicit conversion from managed value to native struct representation.</summary>
725 public static implicit operator Value_Native(Value v) 727 public static implicit operator Value_Native(Value v)
726 { 728 {
727 return v.GetNative(); 729 return v.GetNative();
728 } 730 }
729 731
730 /// <summary> 732 /// <summary>Implicit conversion from native struct representation to managed wrapper.</summary>
731 public static implicit operator Value(Value_Native v) 733 public static implicit operator Value(Value_Native v)
732 { 734 {
733 return new Value(v); 735 return new Value(v);
diff --git a/src/bindings/mono/eldbus_mono/eldbus_common.cs b/src/bindings/mono/eldbus_mono/eldbus_common.cs
index 95138581f0..20f14d4e6f 100644
--- a/src/bindings/mono/eldbus_mono/eldbus_common.cs
+++ b/src/bindings/mono/eldbus_mono/eldbus_common.cs
@@ -1,3 +1,5 @@
1#pragma warning disable 1591
2
1using System; 3using System;
2using System.Runtime.InteropServices; 4using System.Runtime.InteropServices;
3 5
diff --git a/src/bindings/mono/eldbus_mono/eldbus_config.cs b/src/bindings/mono/eldbus_mono/eldbus_config.cs
index f6054815ff..84b2ae102c 100644
--- a/src/bindings/mono/eldbus_mono/eldbus_config.cs
+++ b/src/bindings/mono/eldbus_mono/eldbus_config.cs
@@ -1,3 +1,5 @@
1#pragma warning disable 1591
2
1using System; 3using System;
2using System.Runtime.InteropServices; 4using System.Runtime.InteropServices;
3 5
diff --git a/src/bindings/mono/eldbus_mono/eldbus_connection.cs b/src/bindings/mono/eldbus_mono/eldbus_connection.cs
index 87d09cbd18..f80a0aba0a 100644
--- a/src/bindings/mono/eldbus_mono/eldbus_connection.cs
+++ b/src/bindings/mono/eldbus_mono/eldbus_connection.cs
@@ -1,3 +1,5 @@
1#pragma warning disable 1591
2
1using System; 3using System;
2using System.Runtime.InteropServices; 4using System.Runtime.InteropServices;
3 5
diff --git a/src/bindings/mono/eldbus_mono/eldbus_message.cs b/src/bindings/mono/eldbus_mono/eldbus_message.cs
index 2ebc90c722..0a1afb66d1 100644
--- a/src/bindings/mono/eldbus_mono/eldbus_message.cs
+++ b/src/bindings/mono/eldbus_mono/eldbus_message.cs
@@ -1,3 +1,5 @@
1#pragma warning disable 1591
2
1using System; 3using System;
2using System.Runtime.InteropServices; 4using System.Runtime.InteropServices;
3 5
diff --git a/src/bindings/mono/eldbus_mono/eldbus_object.cs b/src/bindings/mono/eldbus_mono/eldbus_object.cs
index 1b0f4cb58f..d07654deab 100644
--- a/src/bindings/mono/eldbus_mono/eldbus_object.cs
+++ b/src/bindings/mono/eldbus_mono/eldbus_object.cs
@@ -1,3 +1,6 @@
1
2#pragma warning disable 1591
3
1using System.Runtime.InteropServices; 4using System.Runtime.InteropServices;
2 5
3using static eldbus.EldbusObjectNativeFunctions; 6using static eldbus.EldbusObjectNativeFunctions;
diff --git a/src/bindings/mono/eldbus_mono/eldbus_pending.cs b/src/bindings/mono/eldbus_mono/eldbus_pending.cs
index 9dff599619..f5afa05700 100644
--- a/src/bindings/mono/eldbus_mono/eldbus_pending.cs
+++ b/src/bindings/mono/eldbus_mono/eldbus_pending.cs
@@ -1,3 +1,5 @@
1#pragma warning disable 1591
2
1using System; 3using System;
2using System.Runtime.InteropServices; 4using System.Runtime.InteropServices;
3 5
diff --git a/src/bindings/mono/eldbus_mono/eldbus_proxy.cs b/src/bindings/mono/eldbus_mono/eldbus_proxy.cs
index 1d07de71d8..d7729d8a70 100644
--- a/src/bindings/mono/eldbus_mono/eldbus_proxy.cs
+++ b/src/bindings/mono/eldbus_mono/eldbus_proxy.cs
@@ -1,3 +1,5 @@
1#pragma warning disable 1591
2
1using System; 3using System;
2using System.Runtime.InteropServices; 4using System.Runtime.InteropServices;
3 5
diff --git a/src/bindings/mono/eldbus_mono/eldbus_service.cs b/src/bindings/mono/eldbus_mono/eldbus_service.cs
index b3b5487733..33c3acb194 100644
--- a/src/bindings/mono/eldbus_mono/eldbus_service.cs
+++ b/src/bindings/mono/eldbus_mono/eldbus_service.cs
@@ -1,3 +1,5 @@
1#pragma warning disable 1591
2
1using System; 3using System;
2using System.Runtime.InteropServices; 4using System.Runtime.InteropServices;
3 5
diff --git a/src/bindings/mono/eo_mono/iwrapper.cs b/src/bindings/mono/eo_mono/iwrapper.cs
index bd3ba50edf..98e8f953ba 100644
--- a/src/bindings/mono/eo_mono/iwrapper.cs
+++ b/src/bindings/mono/eo_mono/iwrapper.cs
@@ -1,3 +1,4 @@
1#pragma warning disable 1591
1 2
2using System; 3using System;
3using System.Runtime.InteropServices; 4using System.Runtime.InteropServices;
diff --git a/src/bindings/mono/eo_mono/workaround.cs b/src/bindings/mono/eo_mono/workaround.cs
index d29ce3969f..ab7d0c8802 100644
--- a/src/bindings/mono/eo_mono/workaround.cs
+++ b/src/bindings/mono/eo_mono/workaround.cs
@@ -1,32 +1,47 @@
1#pragma warning disable 1591
1 2
2using System; 3using System;
3using System.Runtime.InteropServices; 4using System.Runtime.InteropServices;
4using System.Collections.Generic; 5using System.Collections.Generic;
5 6
7///<summary>Eo class description, passed to efl_class_new.</summary>
6[StructLayout(LayoutKind.Sequential, CharSet=CharSet.Ansi)] 8[StructLayout(LayoutKind.Sequential, CharSet=CharSet.Ansi)]
7public struct ClassDescription 9public struct ClassDescription
8{ 10{
11 ///<summary>Current Eo version.</summary>
9 public uint version; 12 public uint version;
13 ///<summary>Name of the class.</summary>
10 [MarshalAs(UnmanagedType.LPStr)] public String name; 14 [MarshalAs(UnmanagedType.LPStr)] public String name;
15 ///<summary>Class type.</summary>
11 public int class_type; 16 public int class_type;
17 ///<summary>Size of data (private + protected + public) per instance.</summary>
12 public UIntPtr data_size; 18 public UIntPtr data_size;
19 ///<summary>Initializer for the class.</summary>
13 public IntPtr class_initializer; 20 public IntPtr class_initializer;
21 ///<summary>Constructor of the class.</summary>
14 public IntPtr class_constructor; 22 public IntPtr class_constructor;
23 ///<summary>Destructor of the class.</summary>
15 public IntPtr class_destructor; 24 public IntPtr class_destructor;
16} 25}
17 26
27///<summary>Description of an Eo API operation.</summary>
18[StructLayout(LayoutKind.Sequential, CharSet=CharSet.Ansi)] 28[StructLayout(LayoutKind.Sequential, CharSet=CharSet.Ansi)]
19public struct Efl_Op_Description 29public struct Efl_Op_Description
20{ 30{
31 ///<summary>The EAPI function offering this op. (String with the name of the function on Windows)</summary>
21 public IntPtr api_func; 32 public IntPtr api_func;
33 ///<summary>The static function to be called for this op</summary>
22 public IntPtr func; 34 public IntPtr func;
23} 35}
24 36
37///<summary>List of operations on a given Object.</summary>
25[StructLayout(LayoutKind.Sequential, CharSet=CharSet.Ansi)] 38[StructLayout(LayoutKind.Sequential, CharSet=CharSet.Ansi)]
26public struct Efl_Object_Ops 39public struct Efl_Object_Ops
27{ 40{
28 public IntPtr descs; /**< The op descriptions array of size count. */ 41 ///<summary>The op descriptions array of size count.</summary>
29 public UIntPtr count; /**< Number of op descriptions. */ 42 public IntPtr descs;
43 ///<summary>Number of op descriptions.</summary>
44 public UIntPtr count;
30}; 45};
31 46
32[StructLayout(LayoutKind.Sequential)] 47[StructLayout(LayoutKind.Sequential)]
@@ -262,28 +277,45 @@ namespace evas {
262/* Copied from Evas_Legacy.h */ 277/* Copied from Evas_Legacy.h */
263public enum Text_Style_Type 278public enum Text_Style_Type
264{ 279{
265 Plain = 0, /**< plain, standard text */ 280 ///<summary> plain, standard text.</summary>
266 Shadow, /**< text with shadow underneath */ 281 Plain = 0,
267 Outline, /**< text with an outline */ 282 ///<summary> text with shadow underneath.</summary>
268 SoftOutline, /**< text with a soft outline */ 283 Shadow,
269 Glow, /**< text with a glow effect */ 284 ///<summary> text with an outline.</summary>
270 OutlineShadow, /**< text with both outline and shadow effects */ 285 Outline,
271 FarShadow, /**< text with (far) shadow underneath */ 286 ///<summary> text with a soft outline.</summary>
272 OutlineSoftShadow, /**< text with outline and soft shadow effects combined */ 287 SoftOutline,
273 SoftShadow, /**< text with (soft) shadow underneath */ 288 ///<summary> text with a glow effect.</summary>
274 FarSoftShadow, /**< text with (far soft) shadow underneath */ 289 Glow,
290 ///<summary> text with both outline and shadow effects.</summary>
291 OutlineShadow,
292 ///<summary> text with (far) shadow underneath.</summary>
293 FarShadow,
294 ///<summary> text with outline and soft shadow effects combined.</summary>
295 OutlineSoftShadow,
296 ///<summary> text with (soft) shadow underneath.</summary>
297 SoftShadow,
298 ///<summary> text with (far soft) shadow underneath.</summary>
299 FarSoftShadow,
275 300
276 // Shadow direction modifiers 301 // Shadow direction modifiers
277 ShadowDirectionBottomRight = 0 /* 0 >> 4 */, /**< shadow growing to bottom right */ 302 ///<summary> shadow growing to bottom right.</summary>
278 ShadowDirectionBottom= 16 /* 1 >> 4 */, /**< shadow growing to the bottom */ 303 ShadowDirectionBottomRight = 0 /* 0 >> 4 */,
279 ShadowDirectionBottomLeft = 32 /* 2 >> 4 */, /**< shadow growing to bottom left */ 304 ///<summary> shadow growing to the bottom.</summary>
280 ShadowDirectionLeft = 48 /* 3 >> 4 */, /**< shadow growing to the left */ 305 ShadowDirectionBottom= 16 /* 1 >> 4 */,
281 ShadowDirectionTopLeft = 64 /* 4 >> 4 */, /**< shadow growing to top left */ 306 ///<summary> shadow growing to bottom left.</summary>
282 ShadowDirectionTop = 80 /* 5 >> 4 */, /**< shadow growing to the top */ 307 ShadowDirectionBottomLeft = 32 /* 2 >> 4 */,
283 ShadowDirectionTopRight = 96 /* 6 >> 4 */, /**< shadow growing to top right */ 308 ///<summary> shadow growing to the left.</summary>
284 ShadowDirectionRight = 112 /* 7 >> 4 */ /**< shadow growing to the right */ 309 ShadowDirectionLeft = 48 /* 3 >> 4 */,
310 ///<summary> shadow growing to top left.</summary>
311 ShadowDirectionTopLeft = 64 /* 4 >> 4 */,
312 ///<summary> shadow growing to the top.</summary>
313 ShadowDirectionTop = 80 /* 5 >> 4 */,
314 ///<summary> shadow growing to top right.</summary>
315 ShadowDirectionTopRight = 96 /* 6 >> 4 */,
316 ///<summary> shadow growing to the right.</summary>
317 ShadowDirectionRight = 112 /* 7 >> 4 */
285}; 318};
286
287 319
288// Copied from Evas_Common.h 320// Copied from Evas_Common.h
289// 321//
@@ -292,47 +324,83 @@ public enum Text_Style_Type
292 324
293public enum Callback_Type 325public enum Callback_Type
294{ 326{
295 EVAS_CALLBACK_MOUSE_IN = 0, /**< Mouse In Event */ 327 ///<summary> Mouse In Event.</summary>
296 EVAS_CALLBACK_MOUSE_OUT, /**< Mouse Out Event */ 328 EVAS_CALLBACK_MOUSE_IN = 0,
297 EVAS_CALLBACK_MOUSE_DOWN, /**< Mouse Button Down Event */ 329 ///<summary> Mouse Out Event.</summary>
298 EVAS_CALLBACK_MOUSE_UP, /**< Mouse Button Up Event */ 330 EVAS_CALLBACK_MOUSE_OUT,
299 EVAS_CALLBACK_MOUSE_MOVE, /**< Mouse Move Event */ 331 ///<summary> Mouse Button Down Event.</summary>
300 EVAS_CALLBACK_MOUSE_WHEEL, /**< Mouse Wheel Event */ 332 EVAS_CALLBACK_MOUSE_DOWN,
301 EVAS_CALLBACK_MULTI_DOWN, /**< Multi-touch Down Event */ 333 ///<summary> Mouse Button Up Event.</summary>
302 EVAS_CALLBACK_MULTI_UP, /**< Multi-touch Up Event */ 334 EVAS_CALLBACK_MOUSE_UP,
303 EVAS_CALLBACK_MULTI_MOVE, /**< Multi-touch Move Event */ 335 ///<summary> Mouse Move Event.</summary>
304 EVAS_CALLBACK_FREE, /**< Object Being Freed (Called after Del) */ 336 EVAS_CALLBACK_MOUSE_MOVE,
305 EVAS_CALLBACK_KEY_DOWN, /**< Key Press Event */ 337 ///<summary> Mouse Wheel Event.</summary>
306 EVAS_CALLBACK_KEY_UP, /**< Key Release Event */ 338 EVAS_CALLBACK_MOUSE_WHEEL,
307 EVAS_CALLBACK_FOCUS_IN, /**< Focus In Event */ 339 ///<summary> Multi-touch Down Event.</summary>
308 EVAS_CALLBACK_FOCUS_OUT, /**< Focus Out Event */ 340 EVAS_CALLBACK_MULTI_DOWN,
309 EVAS_CALLBACK_SHOW, /**< Show Event */ 341 ///<summary> Multi-touch Up Event.</summary>
310 EVAS_CALLBACK_HIDE, /**< Hide Event */ 342 EVAS_CALLBACK_MULTI_UP,
311 EVAS_CALLBACK_MOVE, /**< Move Event */ 343 ///<summary> Multi-touch Move Event.</summary>
312 EVAS_CALLBACK_RESIZE, /**< Resize Event */ 344 EVAS_CALLBACK_MULTI_MOVE,
313 EVAS_CALLBACK_RESTACK, /**< Restack Event */ 345 ///<summary> Object Being Freed (Called after Del).</summary>
314 EVAS_CALLBACK_DEL, /**< Object Being Deleted (called before Free) */ 346 EVAS_CALLBACK_FREE,
315 EVAS_CALLBACK_HOLD, /**< Events go on/off hold */ 347 ///<summary> Key Press Event.</summary>
316 EVAS_CALLBACK_CHANGED_SIZE_HINTS, /**< Size hints changed event */ 348 EVAS_CALLBACK_KEY_DOWN,
317 EVAS_CALLBACK_IMAGE_PRELOADED, /**< Image has been preloaded */ 349 ///<summary> Key Release Event.</summary>
318 EVAS_CALLBACK_CANVAS_FOCUS_IN, /**< Canvas got focus as a whole */ 350 EVAS_CALLBACK_KEY_UP,
319 EVAS_CALLBACK_CANVAS_FOCUS_OUT, /**< Canvas lost focus as a whole */ 351 ///<summary> Focus In Event.</summary>
320 EVAS_CALLBACK_RENDER_FLUSH_PRE, /**< Called after render update regions have 352 EVAS_CALLBACK_FOCUS_IN,
321 * been calculated, but only if update regions exist */ 353 ///<summary> Focus Out Event.</summary>
322 EVAS_CALLBACK_RENDER_FLUSH_POST, /**< Called after render update regions have 354 EVAS_CALLBACK_FOCUS_OUT,
323 * been sent to the display server, but only 355 ///<summary> Show Event.</summary>
324 * if update regions existed for the most recent frame */ 356 EVAS_CALLBACK_SHOW,
325 EVAS_CALLBACK_CANVAS_OBJECT_FOCUS_IN, /**< Canvas object got focus */ 357 ///<summary> Hide Event.</summary>
326 EVAS_CALLBACK_CANVAS_OBJECT_FOCUS_OUT, /**< Canvas object lost focus */ 358 EVAS_CALLBACK_HIDE,
327 EVAS_CALLBACK_IMAGE_UNLOADED, /**< Image data has been unloaded (by some mechanism in Evas that throw out original image data) */ 359 ///<summary> Move Event.</summary>
328 EVAS_CALLBACK_RENDER_PRE, /**< Called just before rendering starts on the canvas target. @since 1.2 */ 360 EVAS_CALLBACK_MOVE,
329 EVAS_CALLBACK_RENDER_POST, /**< Called just after rendering stops on the canvas target. @since 1.2 */ 361 ///<summary> Resize Event.</summary>
330 EVAS_CALLBACK_IMAGE_RESIZE, /**< Image size is changed. @since 1.8 */ 362 EVAS_CALLBACK_RESIZE,
331 EVAS_CALLBACK_DEVICE_CHANGED, /**< Devices added, removed or changed on canvas. @since 1.8 */ 363 ///<summary> Restack Event.</summary>
332 EVAS_CALLBACK_AXIS_UPDATE, /**< Input device changed value on some axis. @since 1.13 */ 364 EVAS_CALLBACK_RESTACK,
333 EVAS_CALLBACK_CANVAS_VIEWPORT_RESIZE, /**< Canvas viewport resized. @since 1.15 */ 365 ///<summary> Object Being Deleted (called before Free).</summary>
334 EVAS_CALLBACK_LAST /**< Sentinel value to indicate last enum field during 366 EVAS_CALLBACK_DEL,
335 * iteration */ 367 ///<summary> Events go on/off hold.</summary>
368 EVAS_CALLBACK_HOLD,
369 ///<summary> Size hints changed event.</summary>
370 EVAS_CALLBACK_CHANGED_SIZE_HINTS,
371 ///<summary> Image has been preloaded.</summary>
372 EVAS_CALLBACK_IMAGE_PRELOADED,
373 ///<summary> Canvas got focus as a whole.</summary>
374 EVAS_CALLBACK_CANVAS_FOCUS_IN,
375 ///<summary> Canvas lost focus as a whole.</summary>
376 EVAS_CALLBACK_CANVAS_FOCUS_OUT,
377 ///<summary>Called after render update regions have been calculated,
378 /// but only if update regions exist.</summary>
379 EVAS_CALLBACK_RENDER_FLUSH_PRE,
380 ///<summary>Called after render update regions have
381 /// been sent to the display server, but only
382 /// if update regions existed for the most recent frame.</summary>
383 EVAS_CALLBACK_RENDER_FLUSH_POST,
384 ///<summary> Canvas object got focus.</summary>
385 EVAS_CALLBACK_CANVAS_OBJECT_FOCUS_IN,
386 ///<summary> Canvas object lost focus.</summary>
387 EVAS_CALLBACK_CANVAS_OBJECT_FOCUS_OUT,
388 ///<summary> Image data has been unloaded (by some mechanism in Evas that throw out original image data).</summary>
389 EVAS_CALLBACK_IMAGE_UNLOADED,
390 ///<summary> Called just before rendering starts on the canvas target. @since 1.2.</summary>
391 EVAS_CALLBACK_RENDER_PRE,
392 ///<summary> Called just after rendering stops on the canvas target. @since 1.2.</summary>
393 EVAS_CALLBACK_RENDER_POST,
394 ///<summary> Image size is changed. @since 1.8.</summary>
395 EVAS_CALLBACK_IMAGE_RESIZE,
396 ///<summary> Devices added, removed or changed on canvas. @since 1.8.</summary>
397 EVAS_CALLBACK_DEVICE_CHANGED,
398 ///<summary> Input device changed value on some axis. @since 1.13.</summary>
399 EVAS_CALLBACK_AXIS_UPDATE,
400 ///<summary> Canvas viewport resized. @since 1.15.</summary>
401 EVAS_CALLBACK_CANVAS_VIEWPORT_RESIZE,
402 ///<summary>Sentinel value to indicate last enum field during iteration.</summary>
403 EVAS_CALLBACK_LAST
336}; 404};
337 405
338} 406}
diff --git a/src/examples/efl_mono/EoInherit01.cs b/src/examples/efl_mono/EoInherit01.cs
index 6b899aeca1..17ea4df27e 100644
--- a/src/examples/efl_mono/EoInherit01.cs
+++ b/src/examples/efl_mono/EoInherit01.cs
@@ -30,7 +30,7 @@ public class ExampleEoInherit01
30 int given = 111; 30 int given = 111;
31 31
32 // Call the C# override from the C method 32 // Call the C# override from the C method
33 example.NumberwrapperConcrete.example_numberwrapper_number_set(inheritObj.raw_handle, given); 33 inheritObj.CallNumberSet(given);
34 34
35 WriteLine($"Override successfully called? {inheritObj.derivedCalled}!\n"); 35 WriteLine($"Override successfully called? {inheritObj.derivedCalled}!\n");
36 36
diff --git a/src/examples/efl_mono/example_numberwrapper.c b/src/examples/efl_mono/example_numberwrapper.c
index f80dee616a..4ec0f72df1 100644
--- a/src/examples/efl_mono/example_numberwrapper.c
+++ b/src/examples/efl_mono/example_numberwrapper.c
@@ -52,6 +52,11 @@ void _example_numberwrapper_number_set(EINA_UNUSED Eo *obj, Example_Numberwrappe
52 pd->number = n; 52 pd->number = n;
53} 53}
54 54
55void _example_numberwrapper_number_set_call(Eo *obj, EINA_UNUSED Example_Numberwrapper_Data *pd, int n)
56{
57 example_numberwrapper_number_set(obj, n);
58}
59
55int _example_numberwrapper_number_get(EINA_UNUSED Eo *obj, Example_Numberwrapper_Data *pd) 60int _example_numberwrapper_number_get(EINA_UNUSED Eo *obj, Example_Numberwrapper_Data *pd)
56{ 61{
57 return pd->number; 62 return pd->number;
diff --git a/src/examples/efl_mono/example_numberwrapper.eo b/src/examples/efl_mono/example_numberwrapper.eo
index 85f2ce4a4d..4e0279e867 100644
--- a/src/examples/efl_mono/example_numberwrapper.eo
+++ b/src/examples/efl_mono/example_numberwrapper.eo
@@ -17,6 +17,12 @@ class Example.Numberwrapper (Efl.Object) {
17 } 17 }
18 } 18 }
19 19
20 number_set_call {
21 params {
22 n: int;
23 }
24 }
25
20 number_callback_set { 26 number_callback_set {
21 params { 27 params {
22 cb: NumberCb; 28 cb: NumberCb;
diff --git a/src/lib/eolian_cxx/Eolian_Cxx.hh b/src/lib/eolian_cxx/Eolian_Cxx.hh
index 5a8ea813c7..ec5062fee3 100644
--- a/src/lib/eolian_cxx/Eolian_Cxx.hh
+++ b/src/lib/eolian_cxx/Eolian_Cxx.hh
@@ -24,6 +24,24 @@ struct eolian_init
24 } 24 }
25}; 25};
26 26
27struct eolian_state
28{
29 Eolian *value;
30 eolian_state()
31 {
32 value = ::eolian_new();
33 }
34 ~eolian_state()
35 {
36 ::eolian_free(value);
37 }
38
39 inline Eolian_Unit const* as_unit() const
40 {
41 return (Eolian_Unit const*)value;
42 }
43};
44
27} } 45} }
28 46
29#endif // EOLIAN_CXX_LIB_HH 47#endif // EOLIAN_CXX_LIB_HH
diff --git a/src/lib/eolian_cxx/grammar/function_definition.hpp b/src/lib/eolian_cxx/grammar/function_definition.hpp
index 3c2eab5c74..9b646efc9c 100644
--- a/src/lib/eolian_cxx/grammar/function_definition.hpp
+++ b/src/lib/eolian_cxx/grammar/function_definition.hpp
@@ -113,7 +113,7 @@ struct function_definition_generator
113 if(!as_generator(scope_tab).generate(sink, attributes::unused, ctx)) return false; 113 if(!as_generator(scope_tab).generate(sink, attributes::unused, ctx)) return false;
114 114
115 if(f.return_type != attributes::void_ 115 if(f.return_type != attributes::void_
116 && !as_generator(attributes::c_type({attributes::parameter_direction::in, f.return_type, "", f.unit}) 116 && !as_generator(attributes::c_type({attributes::parameter_direction::in, f.return_type, "", attributes::documentation_def{}, f.unit})
117 << " __return_value = " 117 << " __return_value = "
118 ).generate(sink, attributes::unused, ctx)) return false; 118 ).generate(sink, attributes::unused, ctx)) return false;
119 119
diff --git a/src/lib/eolian_cxx/grammar/html_escaped_string.hpp b/src/lib/eolian_cxx/grammar/html_escaped_string.hpp
new file mode 100644
index 0000000000..9a6eef1f7c
--- /dev/null
+++ b/src/lib/eolian_cxx/grammar/html_escaped_string.hpp
@@ -0,0 +1,51 @@
1#ifndef EOLIAN_CXX_HTML_ESCAPED_STRING_HH
2#define EOLIAN_CXX_HTML_ESCAPED_STRING_HH
3
4#include <cstdlib>
5#include <cstring>
6
7#include "grammar/generator.hpp"
8#include "grammar/attributes.hpp"
9#include "grammar/string.hpp"
10
11namespace efl { namespace eolian { namespace grammar {
12
13struct html_escaped_string_generator
14{
15 template<typename OutputIterator, typename Context>
16 bool generate(OutputIterator sink, std::string const& input, Context const& context) const
17 {
18 std::string out;
19 out.reserve(input.size());
20 for (size_t pos = 0; pos != input.size(); ++pos)
21 {
22 switch(input[pos])
23 {
24 case '&': out.append("&amp;"); break;
25 case '\"': out.append("&quot;"); break;
26 case '\'': out.append("&apos;"); break;
27 case '<': out.append("&lt;"); break;
28 case '>': out.append("&gt;"); break;
29 default: out.append(&input[pos], 1); break;
30 }
31 }
32
33 return as_generator(string).generate(sink, out, context);
34 }
35};
36
37struct html_escaped_string_generator const html_escaped_string = {};
38
39template <>
40struct is_eager_generator<html_escaped_string_generator> : std::true_type {};
41template <>
42struct is_generator<html_escaped_string_generator> : std::true_type {};
43
44namespace type_traits {
45template <>
46struct attributes_needed<html_escaped_string_generator> : std::integral_constant<int, 1> {};
47}
48} } }
49
50#endif
51
diff --git a/src/lib/eolian_cxx/grammar/klass_def.hpp b/src/lib/eolian_cxx/grammar/klass_def.hpp
index f95b765cee..16d15b6f24 100644
--- a/src/lib/eolian_cxx/grammar/klass_def.hpp
+++ b/src/lib/eolian_cxx/grammar/klass_def.hpp
@@ -167,6 +167,49 @@ inline bool operator<(klass_name const& lhs, klass_name const& rhs)
167 , rhs.type)); 167 , rhs.type));
168} 168}
169 169
170struct documentation_def
171{
172 std::string summary;
173 std::string description;
174 std::string since;
175 std::vector<std::string> desc_paragraphs;
176
177 documentation_def() {}
178 documentation_def(std::string summary, std::string description, std::string since)
179 : summary(summary), description(description), since(since)
180 {}
181 documentation_def(Eolian_Documentation const* eolian_doc)
182 {
183 const char *str;
184
185 if (!eolian_doc)
186 return;
187
188 str = eolian_documentation_summary_get(eolian_doc);
189 if (str)
190 summary = str;
191
192 str = eolian_documentation_description_get(eolian_doc);
193 if (str)
194 description = str;
195
196 str = eolian_documentation_since_get(eolian_doc);
197 if (str)
198 since = str;
199
200 efl::eina::ptr_list<const char> l(eolian_documentation_string_split(description.c_str()));
201 for (auto&& i : l)
202 desc_paragraphs.push_back({&i});
203 }
204
205 friend inline bool operator==(documentation_def const& lhs, documentation_def const& rhs)
206 {
207 return lhs.summary == rhs.summary
208 && lhs.description == rhs.description
209 && lhs.since == rhs.since;
210 }
211};
212
170template <> 213template <>
171struct tuple_element<0ul, klass_name> 214struct tuple_element<0ul, klass_name>
172{ 215{
@@ -394,21 +437,24 @@ struct parameter_def
394 parameter_direction direction; 437 parameter_direction direction;
395 type_def type; 438 type_def type;
396 std::string param_name; 439 std::string param_name;
440 documentation_def documentation;
397 Eolian_Unit const* unit; 441 Eolian_Unit const* unit;
398 442
399 friend inline bool operator==(parameter_def const& lhs, parameter_def const& rhs) 443 friend inline bool operator==(parameter_def const& lhs, parameter_def const& rhs)
400 { 444 {
401 return lhs.direction == rhs.direction 445 return lhs.direction == rhs.direction
402 && lhs.type == rhs.type 446 && lhs.type == rhs.type
403 && lhs.param_name == rhs.param_name; 447 && lhs.param_name == rhs.param_name
448 && lhs.documentation == rhs.documentation;
404 } 449 }
405 friend inline bool operator!=(parameter_def const& lhs, parameter_def const& rhs) 450 friend inline bool operator!=(parameter_def const& lhs, parameter_def const& rhs)
406 { 451 {
407 return !(lhs == rhs); 452 return !(lhs == rhs);
408 } 453 }
409 454
410 parameter_def(parameter_direction direction, type_def type, std::string param_name, Eolian_Unit const* unit) 455 parameter_def(parameter_direction direction, type_def type, std::string param_name,
411 : direction(std::move(direction)), type(std::move(type)), param_name(std::move(param_name)), unit(unit) {} 456 documentation_def documentation, Eolian_Unit const* unit)
457 : direction(std::move(direction)), type(std::move(type)), param_name(std::move(param_name)), documentation(documentation), unit(unit) {}
412 parameter_def(Eolian_Function_Parameter const* param, Eolian_Unit const* unit) 458 parameter_def(Eolian_Function_Parameter const* param, Eolian_Unit const* unit)
413 : type( ::eolian_parameter_type_get(param), unit, EOLIAN_C_TYPE_PARAM) 459 : type( ::eolian_parameter_type_get(param), unit, EOLIAN_C_TYPE_PARAM)
414 , param_name( ::eolian_parameter_name_get(param)), unit(unit) 460 , param_name( ::eolian_parameter_name_get(param)), unit(unit)
@@ -429,6 +475,8 @@ struct parameter_def
429 } 475 }
430 if( ::eolian_parameter_is_optional(param)) 476 if( ::eolian_parameter_is_optional(param))
431 type.original_type.visit(detail::add_optional_qualifier_visitor{}); 477 type.original_type.visit(detail::add_optional_qualifier_visitor{});
478
479 documentation = eolian_parameter_documentation_get(param);
432 } 480 }
433}; 481};
434 482
@@ -467,6 +515,16 @@ template <int I>
467typename tuple_element<I, parameter_def>::type& get(parameter_def& p) 515typename tuple_element<I, parameter_def>::type& get(parameter_def& p)
468{ return tuple_element<I, parameter_def>::get(p); } 516{ return tuple_element<I, parameter_def>::get(p); }
469 517
518enum class function_type
519{
520 unresolved,
521 property,
522 prop_set,
523 prop_get,
524 method,
525 function_pointer
526};
527
470struct function_def 528struct function_def
471{ 529{
472 type_def return_type; 530 type_def return_type;
@@ -474,9 +532,12 @@ struct function_def
474 std::vector<parameter_def> parameters; 532 std::vector<parameter_def> parameters;
475 std::string c_name; 533 std::string c_name;
476 std::string filename; 534 std::string filename;
535 documentation_def documentation;
536 documentation_def return_documentation;
537 documentation_def property_documentation;
538 function_type type;
477 bool is_beta; 539 bool is_beta;
478 bool is_protected; 540 bool is_protected;
479 bool is_function_pointer;
480 bool is_static; 541 bool is_static;
481 Eolian_Unit const* unit; 542 Eolian_Unit const* unit;
482 543
@@ -487,9 +548,12 @@ struct function_def
487 && lhs.parameters == rhs.parameters 548 && lhs.parameters == rhs.parameters
488 && lhs.c_name == rhs.c_name 549 && lhs.c_name == rhs.c_name
489 && lhs.filename == rhs.filename 550 && lhs.filename == rhs.filename
551 && lhs.documentation == rhs.documentation
552 && lhs.return_documentation == rhs.return_documentation
553 && lhs.property_documentation == rhs.property_documentation
554 && lhs.type == rhs.type
490 && lhs.is_beta == rhs.is_beta 555 && lhs.is_beta == rhs.is_beta
491 && lhs.is_protected == rhs.is_protected 556 && lhs.is_protected == rhs.is_protected
492 && lhs.is_function_pointer == rhs.is_function_pointer
493 && lhs.is_static == rhs.is_static; 557 && lhs.is_static == rhs.is_static;
494 } 558 }
495 friend inline bool operator!=(function_def const& lhs, function_def const& rhs) 559 friend inline bool operator!=(function_def const& lhs, function_def const& rhs)
@@ -501,13 +565,20 @@ struct function_def
501 std::vector<parameter_def> const& _parameters, 565 std::vector<parameter_def> const& _parameters,
502 std::string const& _c_name, 566 std::string const& _c_name,
503 std::string _filename, 567 std::string _filename,
568 documentation_def _documentation,
569 documentation_def _return_documentation,
570 documentation_def _property_documentation,
571 function_type _type,
504 bool _is_beta = false, 572 bool _is_beta = false,
505 bool _is_protected = false, 573 bool _is_protected = false,
506 bool _is_function_pointer = false,
507 Eolian_Unit const* unit = nullptr) 574 Eolian_Unit const* unit = nullptr)
508 : return_type(_return_type), name(_name), parameters(_parameters), 575 : return_type(_return_type), name(_name), parameters(_parameters),
509 c_name(_c_name), filename(_filename), is_beta(_is_beta), is_protected(_is_protected), 576 c_name(_c_name), filename(_filename), documentation(_documentation),
510 is_function_pointer(_is_function_pointer), unit(unit) {} 577 return_documentation(_return_documentation),
578 property_documentation(_property_documentation),
579 type(_type),
580 is_beta(_is_beta), is_protected(_is_protected),
581 unit(unit) {}
511 582
512 function_def( ::Eolian_Function const* function, Eolian_Function_Type type, Eolian_Unit const* unit) 583 function_def( ::Eolian_Function const* function, Eolian_Function_Type type, Eolian_Unit const* unit)
513 : return_type(void_), unit(unit) 584 : return_type(void_), unit(unit)
@@ -572,6 +643,40 @@ struct function_def
572 is_beta = eolian_function_is_beta(function); 643 is_beta = eolian_function_is_beta(function);
573 is_protected = eolian_function_scope_get(function, type) == EOLIAN_SCOPE_PROTECTED; 644 is_protected = eolian_function_scope_get(function, type) == EOLIAN_SCOPE_PROTECTED;
574 is_static = eolian_function_is_class(function); 645 is_static = eolian_function_is_class(function);
646
647 return_documentation = eolian_function_return_documentation_get(function, type);
648
649 Eolian_Implement const* implement = eolian_function_implement_get(function);
650 if (!implement)
651 return;
652
653 documentation = eolian_implement_documentation_get(implement, type);
654
655
656 if (type == EOLIAN_PROP_GET || type == EOLIAN_PROP_SET)
657 property_documentation = eolian_implement_documentation_get(implement, EOLIAN_PROPERTY);
658
659 switch (type)
660 {
661 case EOLIAN_UNRESOLVED:
662 this->type = function_type::unresolved;
663 break;
664 case EOLIAN_PROPERTY:
665 this->type = function_type::property;
666 break;
667 case EOLIAN_PROP_GET:
668 this->type = function_type::prop_get;
669 break;
670 case EOLIAN_PROP_SET:
671 this->type = function_type::prop_set;
672 break;
673 case EOLIAN_METHOD:
674 this->type = function_type::method;
675 break;
676 case EOLIAN_FUNCTION_POINTER:
677 this->type = function_type::function_pointer;
678 break;
679 }
575 } 680 }
576 681
577 std::string template_statement() const 682 std::string template_statement() const
@@ -677,6 +782,7 @@ struct event_def
677 eina::optional<type_def> type; 782 eina::optional<type_def> type;
678 std::string name, c_name; 783 std::string name, c_name;
679 bool beta, protect; 784 bool beta, protect;
785 documentation_def documentation;
680 786
681 friend inline bool operator==(event_def const& lhs, event_def const& rhs) 787 friend inline bool operator==(event_def const& lhs, event_def const& rhs)
682 { 788 {
@@ -684,21 +790,25 @@ struct event_def
684 && lhs.name == rhs.name 790 && lhs.name == rhs.name
685 && lhs.c_name == rhs.c_name 791 && lhs.c_name == rhs.c_name
686 && lhs.beta == rhs.beta 792 && lhs.beta == rhs.beta
687 && lhs.protect == rhs.protect; 793 && lhs.protect == rhs.protect
794 && lhs.documentation == rhs.documentation;
688 } 795 }
689 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)
690 { 797 {
691 return !(lhs == rhs); 798 return !(lhs == rhs);
692 } 799 }
693 800
694 event_def(type_def type, std::string name, std::string c_name, bool beta, bool protect) 801 event_def(type_def type, std::string name, std::string c_name, bool beta, bool protect,
695 : type(type), name(name), c_name(c_name), beta(beta), protect(protect) {} 802 documentation_def documentation)
803 : type(type), name(name), c_name(c_name), beta(beta), protect(protect)
804 , documentation(documentation) {}
696 event_def(Eolian_Event const* event, Eolian_Unit const* unit) 805 event_def(Eolian_Event const* event, Eolian_Unit const* unit)
697 : type( ::eolian_event_type_get(event) ? eina::optional<type_def>{{::eolian_event_type_get(event), unit, EOLIAN_C_TYPE_DEFAULT}} : eina::optional<type_def>{}) 806 : type( ::eolian_event_type_get(event) ? eina::optional<type_def>{{::eolian_event_type_get(event), unit, EOLIAN_C_TYPE_DEFAULT}} : eina::optional<type_def>{})
698 , name( ::eolian_event_name_get(event)) 807 , name( ::eolian_event_name_get(event))
699 , c_name( ::eolian_event_c_name_get(event)) 808 , c_name( ::eolian_event_c_name_get(event))
700 , beta( ::eolian_event_is_beta(event)) 809 , beta( ::eolian_event_is_beta(event))
701 , protect( ::eolian_event_scope_get(event) == EOLIAN_SCOPE_PROTECTED){} 810 , protect( ::eolian_event_scope_get(event) == EOLIAN_SCOPE_PROTECTED)
811 , documentation( ::eolian_event_documentation_get(event)) {}
702}; 812};
703 813
704template <> 814template <>
@@ -768,6 +878,7 @@ struct klass_def
768 std::string eolian_name; 878 std::string eolian_name;
769 std::string cxx_name; 879 std::string cxx_name;
770 std::string filename; 880 std::string filename;
881 documentation_def documentation;
771 std::vector<std::string> namespaces; 882 std::vector<std::string> namespaces;
772 std::vector<function_def> functions; 883 std::vector<function_def> functions;
773 std::set<klass_name, compare_klass_name_by_name> inherits; 884 std::set<klass_name, compare_klass_name_by_name> inherits;
@@ -802,12 +913,14 @@ struct klass_def
802 } 913 }
803 914
804 klass_def(std::string eolian_name, std::string cxx_name, std::string filename 915 klass_def(std::string eolian_name, std::string cxx_name, std::string filename
916 , documentation_def documentation
805 , std::vector<std::string> namespaces 917 , std::vector<std::string> namespaces
806 , std::vector<function_def> functions 918 , std::vector<function_def> functions
807 , std::set<klass_name, compare_klass_name_by_name> inherits 919 , std::set<klass_name, compare_klass_name_by_name> inherits
808 , class_type type 920 , class_type type
809 , std::set<klass_name, compare_klass_name_by_name> immediate_inherits) 921 , std::set<klass_name, compare_klass_name_by_name> immediate_inherits)
810 : eolian_name(eolian_name), cxx_name(cxx_name), filename(filename) 922 : eolian_name(eolian_name), cxx_name(cxx_name), filename(filename)
923 , documentation(documentation)
811 , namespaces(namespaces) 924 , namespaces(namespaces)
812 , functions(functions), inherits(inherits), type(type) 925 , functions(functions), inherits(inherits), type(type)
813 , immediate_inherits(immediate_inherits) 926 , immediate_inherits(immediate_inherits)
@@ -915,6 +1028,8 @@ struct klass_def
915 events.push_back({&*event_iterator, unit}); 1028 events.push_back({&*event_iterator, unit});
916 } catch(std::exception const&) {} 1029 } catch(std::exception const&) {}
917 } 1030 }
1031
1032 documentation = eolian_class_documentation_get(klass);
918 } 1033 }
919 1034
920 // TODO memoize the return? 1035 // TODO memoize the return?
@@ -956,6 +1071,7 @@ struct enum_value_def
956 value_def value; 1071 value_def value;
957 std::string name; 1072 std::string name;
958 std::string c_name; 1073 std::string c_name;
1074 documentation_def documentation;
959 1075
960 enum_value_def(Eolian_Enum_Type_Field const* enum_field, Eolian_Unit const* unit) 1076 enum_value_def(Eolian_Enum_Type_Field const* enum_field, Eolian_Unit const* unit)
961 { 1077 {
@@ -963,6 +1079,7 @@ struct enum_value_def
963 c_name = eolian_typedecl_enum_field_c_name_get(enum_field); 1079 c_name = eolian_typedecl_enum_field_c_name_get(enum_field);
964 auto exp = eolian_typedecl_enum_field_value_get(enum_field, EINA_TRUE); 1080 auto exp = eolian_typedecl_enum_field_value_get(enum_field, EINA_TRUE);
965 value = eolian_expression_eval(unit, exp, EOLIAN_MASK_INT); // FIXME hardcoded int 1081 value = eolian_expression_eval(unit, exp, EOLIAN_MASK_INT); // FIXME hardcoded int
1082 documentation = eolian_typedecl_enum_field_documentation_get(enum_field);
966 } 1083 }
967}; 1084};
968 1085
@@ -972,6 +1089,7 @@ struct enum_def
972 std::string cxx_name; 1089 std::string cxx_name;
973 std::vector<std::string> namespaces; 1090 std::vector<std::string> namespaces;
974 std::vector<enum_value_def> fields; 1091 std::vector<enum_value_def> fields;
1092 documentation_def documentation;
975 1093
976 enum_def(Eolian_Typedecl const* enum_obj, Eolian_Unit const* unit) 1094 enum_def(Eolian_Typedecl const* enum_obj, Eolian_Unit const* unit)
977 { 1095 {
@@ -989,6 +1107,8 @@ struct enum_def
989 enum_value_def field_def(&*field_iterator, unit); 1107 enum_value_def field_def(&*field_iterator, unit);
990 this->fields.push_back(field_def); 1108 this->fields.push_back(field_def);
991 } 1109 }
1110
1111 documentation = ::eolian_typedecl_documentation_get(enum_obj);
992 } 1112 }
993}; 1113};
994 1114
@@ -996,6 +1116,7 @@ struct struct_field_def
996{ 1116{
997 type_def type; 1117 type_def type;
998 std::string name; 1118 std::string name;
1119 documentation_def documentation;
999 1120
1000 struct_field_def(Eolian_Struct_Type_Field const* struct_field, Eolian_Unit const* unit) 1121 struct_field_def(Eolian_Struct_Type_Field const* struct_field, Eolian_Unit const* unit)
1001 { 1122 {
@@ -1003,6 +1124,7 @@ struct struct_field_def
1003 try { 1124 try {
1004 type.set(eolian_typedecl_struct_field_type_get(struct_field), unit, EOLIAN_C_TYPE_DEFAULT); 1125 type.set(eolian_typedecl_struct_field_type_get(struct_field), unit, EOLIAN_C_TYPE_DEFAULT);
1005 } catch(std::runtime_error const&) { /* Silently skip pointer fields*/ } 1126 } catch(std::runtime_error const&) { /* Silently skip pointer fields*/ }
1127 documentation = ::eolian_typedecl_struct_field_documentation_get(struct_field);
1006 } 1128 }
1007 1129
1008}; 1130};
@@ -1013,6 +1135,7 @@ struct struct_def
1013 std::string cxx_name; 1135 std::string cxx_name;
1014 std::vector<std::string> namespaces; 1136 std::vector<std::string> namespaces;
1015 std::vector<struct_field_def> fields; 1137 std::vector<struct_field_def> fields;
1138 documentation_def documentation;
1016 1139
1017 struct_def(Eolian_Typedecl const* struct_obj, Eolian_Unit const* unit) 1140 struct_def(Eolian_Typedecl const* struct_obj, Eolian_Unit const* unit)
1018 { 1141 {
@@ -1029,6 +1152,8 @@ struct struct_def
1029 struct_field_def field_def(&*field_iterator, unit); 1152 struct_field_def field_def(&*field_iterator, unit);
1030 this->fields.push_back(field_def); 1153 this->fields.push_back(field_def);
1031 } 1154 }
1155
1156 documentation = ::eolian_typedecl_documentation_get(struct_obj);
1032 } 1157 }
1033}; 1158};
1034 1159
@@ -1137,7 +1262,7 @@ template <>
1137struct is_tuple<attributes::parameter_def> : std::true_type {}; 1262struct is_tuple<attributes::parameter_def> : std::true_type {};
1138template <> 1263template <>
1139struct is_tuple<attributes::event_def> : std::true_type {}; 1264struct is_tuple<attributes::event_def> : std::true_type {};
1140 1265
1141} 1266}
1142 1267
1143} } } 1268} } }
diff --git a/src/lib/eolian_cxx/grammar/string.hpp b/src/lib/eolian_cxx/grammar/string.hpp
index df4ae8f2cb..06cce17823 100644
--- a/src/lib/eolian_cxx/grammar/string.hpp
+++ b/src/lib/eolian_cxx/grammar/string.hpp
@@ -26,7 +26,7 @@ struct literal_generator
26 const char* string; 26 const char* string;
27}; 27};
28 28
29literal_generator as_generator(char const* literal) { return literal; } 29inline literal_generator as_generator(char const* literal) { return literal; }
30 30
31struct { 31struct {
32 literal_generator operator()(const char* literal) const 32 literal_generator operator()(const char* literal) const
@@ -164,7 +164,7 @@ struct is_generator<string_generator_terminal> : std::true_type {};
164template <> 164template <>
165struct is_generator<std::string> : std::true_type {}; 165struct is_generator<std::string> : std::true_type {};
166 166
167string_generator as_generator(string_generator_terminal) 167inline string_generator as_generator(string_generator_terminal)
168{ 168{
169 return string_generator{}; 169 return string_generator{};
170} 170}
@@ -181,7 +181,7 @@ struct attributes_needed<string_replace_generator> : std::integral_constant<int,
181 181
182namespace std { 182namespace std {
183 183
184::efl::eolian::grammar::specific_string_generator as_generator(std::string string) 184inline ::efl::eolian::grammar::specific_string_generator as_generator(std::string string)
185{ 185{
186 return ::efl::eolian::grammar::specific_string_generator{string}; 186 return ::efl::eolian::grammar::specific_string_generator{string};
187} 187}
diff --git a/src/tests/efl_mono/Eina.cs b/src/tests/efl_mono/Eina.cs
index e5baa8e32a..bd2d2976b9 100644
--- a/src/tests/efl_mono/Eina.cs
+++ b/src/tests/efl_mono/Eina.cs
@@ -510,7 +510,7 @@ class TestEinaBinbuf
510 { 510 {
511 var t = new NativeInheritImpl(); 511 var t = new NativeInheritImpl();
512 var binbuf = new eina.Binbuf(base_seq, (uint)base_seq.Length); 512 var binbuf = new eina.Binbuf(base_seq, (uint)base_seq.Length);
513 Test.Assert(NativeInheritImpl.test_testing_eina_binbuf_in(t.raw_handle, binbuf.Handle)); 513 Test.Assert(t.CallEinaBinbufIn(binbuf));
514 Test.Assert(t.binbuf_in_flag); 514 Test.Assert(t.binbuf_in_flag);
515 Test.Assert(binbuf.Own); 515 Test.Assert(binbuf.Own);
516 Test.Assert(binbuf.GetBytes().SequenceEqual(new byte[]{43,42,0x0,0x2A,0x42,33})); 516 Test.Assert(binbuf.GetBytes().SequenceEqual(new byte[]{43,42,0x0,0x2A,0x42,33}));
@@ -523,7 +523,7 @@ class TestEinaBinbuf
523 var t = new NativeInheritImpl(); 523 var t = new NativeInheritImpl();
524 var binbuf = new eina.Binbuf(base_seq, (uint)base_seq.Length); 524 var binbuf = new eina.Binbuf(base_seq, (uint)base_seq.Length);
525 binbuf.Own = false; 525 binbuf.Own = false;
526 Test.Assert(NativeInheritImpl.test_testing_eina_binbuf_in_own(t.raw_handle, binbuf.Handle)); 526 Test.Assert(t.CallEinaBinbufInOwn(binbuf));
527 Test.Assert(t.binbuf_in_own_flag); 527 Test.Assert(t.binbuf_in_own_flag);
528 Test.Assert(binbuf.GetBytes().SequenceEqual(new byte[]{43,42,0x0,0x2A,0x42,33})); 528 Test.Assert(binbuf.GetBytes().SequenceEqual(new byte[]{43,42,0x0,0x2A,0x42,33}));
529 binbuf.Dispose(); 529 binbuf.Dispose();
@@ -534,11 +534,8 @@ class TestEinaBinbuf
534 public static void test_inherit_eina_binbuf_out() 534 public static void test_inherit_eina_binbuf_out()
535 { 535 {
536 var t = new NativeInheritImpl(); 536 var t = new NativeInheritImpl();
537 IntPtr bb_hdl; 537 eina.Binbuf binbuf = t.CallEinaBinbufOut();
538 Test.Assert(NativeInheritImpl.test_testing_eina_binbuf_out(t.raw_handle, out bb_hdl));
539 Test.Assert(t.binbuf_out_flag); 538 Test.Assert(t.binbuf_out_flag);
540 Test.Assert(bb_hdl != IntPtr.Zero);
541 var binbuf = new eina.Binbuf(bb_hdl, false);
542 Test.Assert(binbuf.GetBytes().SequenceEqual(new byte[]{33})); 539 Test.Assert(binbuf.GetBytes().SequenceEqual(new byte[]{33}));
543 binbuf.Reset(); 540 binbuf.Reset();
544 Test.Assert(binbuf.Append(base_seq)); 541 Test.Assert(binbuf.Append(base_seq));
@@ -550,11 +547,8 @@ class TestEinaBinbuf
550 public static void test_inherit_eina_binbuf_out_own() 547 public static void test_inherit_eina_binbuf_out_own()
551 { 548 {
552 var t = new NativeInheritImpl(); 549 var t = new NativeInheritImpl();
553 IntPtr bb_hdl; 550 eina.Binbuf binbuf = t.CallEinaBinbufOutOwn();
554 Test.Assert(NativeInheritImpl.test_testing_eina_binbuf_out_own(t.raw_handle, out bb_hdl));
555 Test.Assert(t.binbuf_out_own_flag); 551 Test.Assert(t.binbuf_out_own_flag);
556 Test.Assert(bb_hdl != IntPtr.Zero);
557 var binbuf = new eina.Binbuf(bb_hdl, true);
558 Test.Assert(binbuf.GetBytes().SequenceEqual(new byte[]{33})); 552 Test.Assert(binbuf.GetBytes().SequenceEqual(new byte[]{33}));
559 binbuf.Reset(); 553 binbuf.Reset();
560 Test.Assert(binbuf.Append(base_seq)); 554 Test.Assert(binbuf.Append(base_seq));
@@ -566,10 +560,8 @@ class TestEinaBinbuf
566 public static void test_inherit_eina_binbuf_return() 560 public static void test_inherit_eina_binbuf_return()
567 { 561 {
568 var t = new NativeInheritImpl(); 562 var t = new NativeInheritImpl();
569 IntPtr bb_hdl = NativeInheritImpl.test_testing_eina_binbuf_return(t.raw_handle); 563 var binbuf = t.CallEinaBinbufReturn();
570 Test.Assert(t.binbuf_return_flag); 564 Test.Assert(t.binbuf_return_flag);
571 Test.Assert(bb_hdl != IntPtr.Zero);
572 var binbuf = new eina.Binbuf(bb_hdl, false);
573 Test.Assert(binbuf.GetBytes().SequenceEqual(new byte[]{33})); 565 Test.Assert(binbuf.GetBytes().SequenceEqual(new byte[]{33}));
574 binbuf.Reset(); 566 binbuf.Reset();
575 Test.Assert(binbuf.Append(base_seq)); 567 Test.Assert(binbuf.Append(base_seq));
@@ -581,10 +573,8 @@ class TestEinaBinbuf
581 public static void test_inherit_eina_binbuf_return_own() 573 public static void test_inherit_eina_binbuf_return_own()
582 { 574 {
583 var t = new NativeInheritImpl(); 575 var t = new NativeInheritImpl();
584 IntPtr bb_hdl = NativeInheritImpl.test_testing_eina_binbuf_return_own(t.raw_handle); 576 var binbuf = t.CallEinaBinbufReturnOwn();
585 Test.Assert(t.binbuf_return_own_flag); 577 Test.Assert(t.binbuf_return_own_flag);
586 Test.Assert(bb_hdl != IntPtr.Zero);
587 var binbuf = new eina.Binbuf(bb_hdl, true);
588 Test.Assert(binbuf.GetBytes().SequenceEqual(new byte[]{33})); 578 Test.Assert(binbuf.GetBytes().SequenceEqual(new byte[]{33}));
589 binbuf.Reset(); 579 binbuf.Reset();
590 Test.Assert(binbuf.Append(base_seq)); 580 Test.Assert(binbuf.Append(base_seq));
@@ -681,7 +671,7 @@ class TestEinaSlice
681 { 671 {
682 var t = new NativeInheritImpl(); 672 var t = new NativeInheritImpl();
683 var slc = new eina.Slice(pinnedPtr, (UIntPtr)3); 673 var slc = new eina.Slice(pinnedPtr, (UIntPtr)3);
684 Test.Assert(NativeInheritImpl.test_testing_eina_slice_in(t.raw_handle, slc)); 674 Test.Assert(t.EinaSliceIn(slc));
685 Test.Assert(t.slice_in_flag); 675 Test.Assert(t.slice_in_flag);
686 } 676 }
687 677
@@ -694,7 +684,7 @@ class TestEinaSlice
694 var slc = new eina.Rw_Slice(ptr, (UIntPtr)3); 684 var slc = new eina.Rw_Slice(ptr, (UIntPtr)3);
695 685
696 var t = new NativeInheritImpl(); 686 var t = new NativeInheritImpl();
697 Test.Assert(NativeInheritImpl.test_testing_eina_rw_slice_in(t.raw_handle, slc)); 687 Test.Assert(t.EinaRwSliceIn(slc));
698 688
699 Test.Assert(t.rw_slice_in_flag); 689 Test.Assert(t.rw_slice_in_flag);
700 Test.Assert(slc.GetBytes().SequenceEqual(base_seq)); 690 Test.Assert(slc.GetBytes().SequenceEqual(base_seq));
@@ -706,7 +696,7 @@ class TestEinaSlice
706 { 696 {
707 var t = new NativeInheritImpl(); 697 var t = new NativeInheritImpl();
708 var slc = new eina.Slice(); 698 var slc = new eina.Slice();
709 Test.Assert(NativeInheritImpl.test_testing_eina_slice_out(t.raw_handle, ref slc)); 699 Test.Assert(t.EinaSliceOut(ref slc));
710 Test.Assert(t.slice_out_flag); 700 Test.Assert(t.slice_out_flag);
711 Test.Assert(slc.Mem != IntPtr.Zero); 701 Test.Assert(slc.Mem != IntPtr.Zero);
712 Test.Assert(slc.Length == base_seq.Length); 702 Test.Assert(slc.Length == base_seq.Length);
@@ -717,7 +707,7 @@ class TestEinaSlice
717 { 707 {
718 var t = new NativeInheritImpl(); 708 var t = new NativeInheritImpl();
719 var slc = new eina.Rw_Slice(); 709 var slc = new eina.Rw_Slice();
720 Test.Assert(NativeInheritImpl.test_testing_eina_rw_slice_out(t.raw_handle, ref slc)); 710 Test.Assert(t.EinaRwSliceOut(ref slc));
721 Test.Assert(t.rw_slice_out_flag); 711 Test.Assert(t.rw_slice_out_flag);
722 Test.Assert(slc.Mem != IntPtr.Zero); 712 Test.Assert(slc.Mem != IntPtr.Zero);
723 Test.Assert(slc.Length == base_seq.Length); 713 Test.Assert(slc.Length == base_seq.Length);
diff --git a/src/tests/efl_mono/Events.cs b/src/tests/efl_mono/Events.cs
index 025e501a19..5719745a76 100644
--- a/src/tests/efl_mono/Events.cs
+++ b/src/tests/efl_mono/Events.cs
@@ -6,21 +6,32 @@ namespace TestSuite
6class TestEoEvents 6class TestEoEvents
7{ 7{
8 public bool called = false; 8 public bool called = false;
9 public bool correct_sender = false;
9 protected void callback(object sender, EventArgs e) { 10 protected void callback(object sender, EventArgs e) {
10 called = true; 11 called = true;
12 efl.Object obj = sender as efl.Object;
13 if (obj != null)
14 {
15 obj.SetName("loop_called");
16 correct_sender = true;
17 }
11 } 18 }
12 protected void another_callback(object sender, EventArgs e) { } 19 protected void another_callback(object sender, EventArgs e) { }
13 20
14 public static void callback_add_event() 21 public static void callback_add_event()
15 { 22 {
16 efl.Loop loop = new efl.LoopConcrete(); 23 efl.Loop loop = new efl.LoopConcrete();
24 loop.SetName("loop");
17 TestEoEvents listener = new TestEoEvents(); 25 TestEoEvents listener = new TestEoEvents();
18 loop.CALLBACK_ADD += listener.callback; 26 loop.CALLBACK_ADD += listener.callback;
19 27
20 Test.Assert(!listener.called); 28 Test.Assert(!listener.called);
29 Test.Assert(!listener.correct_sender);
30 Test.AssertEquals("loop", loop.GetName());
21 loop.IDLE += listener.another_callback; 31 loop.IDLE += listener.another_callback;
22 Test.Assert(listener.called); 32 Test.Assert(listener.called);
33 Test.Assert(listener.correct_sender);
34 Test.AssertEquals("loop_called", loop.GetName());
23 } 35 }
24} 36}
25
26} 37}
diff --git a/src/tests/efl_mono/libefl_mono_native_test.c b/src/tests/efl_mono/libefl_mono_native_test.c
index b8cc8d58e4..eedc12fac7 100644
--- a/src/tests/efl_mono/libefl_mono_native_test.c
+++ b/src/tests/efl_mono/libefl_mono_native_test.c
@@ -307,6 +307,11 @@ Eina_Bool _test_testing_eina_binbuf_in(EINA_UNUSED Eo *obj, EINA_UNUSED Test_Tes
307 return r; 307 return r;
308} 308}
309 309
310Eina_Bool _test_testing_call_eina_binbuf_in(Eo *obj, EINA_UNUSED Test_Testing_Data *pd, Eina_Binbuf *binbuf)
311{
312 return test_testing_eina_binbuf_in(obj, binbuf);
313}
314
310Eina_Binbuf *_binbuf_in_own_to_check = NULL; 315Eina_Binbuf *_binbuf_in_own_to_check = NULL;
311 316
312Eina_Bool _test_testing_eina_binbuf_in_own(EINA_UNUSED Eo *obj, EINA_UNUSED Test_Testing_Data *pd, Eina_Binbuf *binbuf) 317Eina_Bool _test_testing_eina_binbuf_in_own(EINA_UNUSED Eo *obj, EINA_UNUSED Test_Testing_Data *pd, Eina_Binbuf *binbuf)
@@ -319,6 +324,11 @@ Eina_Bool _test_testing_eina_binbuf_in_own(EINA_UNUSED Eo *obj, EINA_UNUSED Test
319 return r; 324 return r;
320} 325}
321 326
327Eina_Bool _test_testing_call_eina_binbuf_in_own(Eo *obj, EINA_UNUSED Test_Testing_Data *pd, Eina_Binbuf *binbuf)
328{
329 return test_testing_eina_binbuf_in_own(obj, binbuf);
330}
331
322Eina_Bool _test_testing_check_binbuf_in_own(EINA_UNUSED Eo *obj, EINA_UNUSED Test_Testing_Data *pd) 332Eina_Bool _test_testing_check_binbuf_in_own(EINA_UNUSED Eo *obj, EINA_UNUSED Test_Testing_Data *pd)
323{ 333{
324 if (!_binbuf_in_own_to_check) return EINA_FALSE; 334 if (!_binbuf_in_own_to_check) return EINA_FALSE;
@@ -339,6 +349,13 @@ Eina_Bool _test_testing_eina_binbuf_out(EINA_UNUSED Eo *obj, EINA_UNUSED Test_Te
339 return EINA_TRUE; 349 return EINA_TRUE;
340} 350}
341 351
352Eina_Binbuf *_test_testing_call_eina_binbuf_out(Eo *obj, EINA_UNUSED Test_Testing_Data *pd)
353{
354 Eina_Binbuf *binbuf = NULL;
355 test_testing_eina_binbuf_out(obj, &binbuf);
356 return binbuf;
357}
358
342Eina_Bool _test_testing_check_binbuf_out(EINA_UNUSED Eo *obj, EINA_UNUSED Test_Testing_Data *pd) 359Eina_Bool _test_testing_check_binbuf_out(EINA_UNUSED Eo *obj, EINA_UNUSED Test_Testing_Data *pd)
343{ 360{
344 if (!_binbuf_out_to_check) return EINA_FALSE; 361 if (!_binbuf_out_to_check) return EINA_FALSE;
@@ -353,6 +370,13 @@ Eina_Bool _test_testing_eina_binbuf_out_own(EINA_UNUSED Eo *obj, EINA_UNUSED Tes
353 return EINA_TRUE; 370 return EINA_TRUE;
354} 371}
355 372
373Eina_Binbuf *_test_testing_call_eina_binbuf_out_own(Eo *obj, EINA_UNUSED Test_Testing_Data *pd)
374{
375 Eina_Binbuf *binbuf = NULL;
376 test_testing_eina_binbuf_out_own(obj, &binbuf);
377 return binbuf;
378}
379
356Eina_Binbuf *_binbuf_return_to_check = NULL; 380Eina_Binbuf *_binbuf_return_to_check = NULL;
357 381
358Eina_Binbuf *_test_testing_eina_binbuf_return(EINA_UNUSED Eo *obj, EINA_UNUSED Test_Testing_Data *pd) 382Eina_Binbuf *_test_testing_eina_binbuf_return(EINA_UNUSED Eo *obj, EINA_UNUSED Test_Testing_Data *pd)
@@ -363,6 +387,11 @@ Eina_Binbuf *_test_testing_eina_binbuf_return(EINA_UNUSED Eo *obj, EINA_UNUSED T
363 return binbuf; 387 return binbuf;
364} 388}
365 389
390Eina_Binbuf *_test_testing_call_eina_binbuf_return(Eo *obj, EINA_UNUSED Test_Testing_Data *pd)
391{
392 return test_testing_eina_binbuf_return(obj);
393}
394
366Eina_Bool _test_testing_check_binbuf_return(EINA_UNUSED Eo *obj, EINA_UNUSED Test_Testing_Data *pd) 395Eina_Bool _test_testing_check_binbuf_return(EINA_UNUSED Eo *obj, EINA_UNUSED Test_Testing_Data *pd)
367{ 396{
368 if (!_binbuf_return_to_check) return EINA_FALSE; 397 if (!_binbuf_return_to_check) return EINA_FALSE;
@@ -376,6 +405,12 @@ Eina_Binbuf *_test_testing_eina_binbuf_return_own(EINA_UNUSED Eo *obj, EINA_UNUS
376 return binbuf; 405 return binbuf;
377} 406}
378 407
408Eina_Binbuf *_test_testing_call_eina_binbuf_return_own(Eo *obj, EINA_UNUSED Test_Testing_Data *pd)
409{
410 return test_testing_eina_binbuf_return_own(obj);
411}
412
413
379static const int base_seq_int[] = {0x0,0x2A,0x42}; 414static const int base_seq_int[] = {0x0,0x2A,0x42};
380static const unsigned int base_seq_int_size = EINA_C_ARRAY_LENGTH(base_seq_int); 415static const unsigned int base_seq_int_size = EINA_C_ARRAY_LENGTH(base_seq_int);
381static const int modified_seq_int[] = {0x0,0x2A,0x42,42,43,33}; 416static const int modified_seq_int[] = {0x0,0x2A,0x42,42,43,33};
diff --git a/src/tests/efl_mono/test_testing.eo b/src/tests/efl_mono/test_testing.eo
index 7d7ab51275..fec5f901f9 100644
--- a/src/tests/efl_mono/test_testing.eo
+++ b/src/tests/efl_mono/test_testing.eo
@@ -254,12 +254,27 @@ class Test.Testing (Efl.Object) {
254 return: bool; 254 return: bool;
255 } 255 }
256 256
257 call_eina_binbuf_in {
258 params {
259 @in binbuf: ptr(Eina.Binbuf);
260 }
261 return: bool;
262 }
263
257 eina_binbuf_in_own { 264 eina_binbuf_in_own {
258 params { 265 params {
259 @in binbuf: ptr(Eina.Binbuf) @owned; 266 @in binbuf: ptr(Eina.Binbuf) @owned;
260 } 267 }
261 return: bool; 268 return: bool;
262 } 269 }
270
271 call_eina_binbuf_in_own {
272 params {
273 @in str: ptr(Eina.Binbuf) @owned;
274 }
275 return: bool;
276 }
277
263 check_binbuf_in_own { 278 check_binbuf_in_own {
264 return: bool; 279 return: bool;
265 } 280 }
@@ -270,6 +285,11 @@ class Test.Testing (Efl.Object) {
270 } 285 }
271 return: bool; 286 return: bool;
272 } 287 }
288
289 call_eina_binbuf_out {
290 return: ptr(Eina.Binbuf);
291 }
292
273 check_binbuf_out { 293 check_binbuf_out {
274 return: bool; 294 return: bool;
275 } 295 }
@@ -281,9 +301,18 @@ class Test.Testing (Efl.Object) {
281 return: bool; 301 return: bool;
282 } 302 }
283 303
304 call_eina_binbuf_out_own {
305 return: ptr(Eina.Binbuf) @owned;
306 }
307
284 eina_binbuf_return { 308 eina_binbuf_return {
285 return: ptr(Eina.Binbuf); 309 return: ptr(Eina.Binbuf);
286 } 310 }
311
312 call_eina_binbuf_return {
313 return: ptr(Eina.Binbuf);
314 }
315
287 check_binbuf_return { 316 check_binbuf_return {
288 return: bool; 317 return: bool;
289 } 318 }
@@ -292,6 +321,10 @@ class Test.Testing (Efl.Object) {
292 return: ptr(Eina.Binbuf) @owned; 321 return: ptr(Eina.Binbuf) @owned;
293 } 322 }
294 323
324 call_eina_binbuf_return_own {
325 return: ptr(Eina.Binbuf) @owned;
326 }
327
295 /* Eina Array */ 328 /* Eina Array */
296 329
297 /* Integer */ 330 /* Integer */
diff --git a/src/tests/eolian_cxx/docs.eo b/src/tests/eolian_cxx/docs.eo
new file mode 100644
index 0000000000..9d2e576866
--- /dev/null
+++ b/src/tests/eolian_cxx/docs.eo
@@ -0,0 +1,86 @@
1struct Foo {
2 [[This is struct Foo.
3 It does stuff.
4
5 Note: This is a note.
6
7 This is a longer description for struct Foo.
8
9 Warning: This is a warning. You can only use Warning: and
10 Note: at the beginning of a paragraph.
11
12 This is another paragraph.
13
14 @since 1.66
15 ]]
16 field1: int; [[Field documentation.]]
17 field2: float;
18 field3: short; [[Another field documentation.]]
19}
20
21enum Bar {
22 [[Docs for enum Bar.]]
23 blah = 0,
24 foo = 1, [[Docs for foo.]]
25 bar = 2 [[Docs for bar.]]
26}
27
28type Alias: Bar; [[Docs for typedef.
29
30 More docs for typedef.
31 See @Bar. @since 2.0
32 ]]
33
34var pants: int = 150; [[Docs for var.]]
35
36struct Opaque; [[Opaque struct docs. See @Foo for another struct.]]
37
38class Docs {
39 [[Docs for class.
40
41 More docs for class. Testing references now.
42 @Foo
43 @Bar
44 @Alias
45 @pants
46 @.meth
47 @.prop
48 @.prop.get
49 @.prop.set
50 @Foo.field1
51 @Bar.foo
52 @Docs
53
54 @since 1.17
55 ]]
56 legacy_prefix: docs;
57 methods {
58 meth {
59 [[Method documentation.]]
60 params {
61 @in a: int; [[Param documentation.]]
62 @out b: float;
63 @out c: long; [[Another param documentation.]]
64 }
65 return: int; [[Return documentation.]]
66 }
67 @property prop {
68 [[Property common documentation.
69
70 @since 1.18
71 ]]
72 get {
73 [[Get documentation.]]
74 }
75 set {
76 [[Set documentation.]]
77 }
78 values {
79 val: int; [[Value documentation.]]
80 }
81 }
82 }
83 events {
84 clicked; [[Event docs.]]
85 }
86}
diff --git a/src/tests/eolian_cxx/eolian_cxx_suite.cc b/src/tests/eolian_cxx/eolian_cxx_suite.cc
index c78a338fc3..6a1b94033b 100644
--- a/src/tests/eolian_cxx/eolian_cxx_suite.cc
+++ b/src/tests/eolian_cxx/eolian_cxx_suite.cc
@@ -13,6 +13,7 @@ static const Efl_Test_Case etc[] = {
13 { "Eolian-Cxx Inheritance", eolian_cxx_test_inheritance }, 13 { "Eolian-Cxx Inheritance", eolian_cxx_test_inheritance },
14 { "Eolian-Cxx Binding", eolian_cxx_test_binding }, 14 { "Eolian-Cxx Binding", eolian_cxx_test_binding },
15 { "Eolian-Cxx Cyclic", eolian_cxx_test_cyclic }, 15 { "Eolian-Cxx Cyclic", eolian_cxx_test_cyclic },
16 { "Eolian-Cxx Documentation", eolian_cxx_test_documentation },
16 { NULL, NULL } 17 { NULL, NULL }
17}; 18};
18 19
diff --git a/src/tests/eolian_cxx/eolian_cxx_suite.h b/src/tests/eolian_cxx/eolian_cxx_suite.h
index 0d3ce69931..63691d6a2d 100644
--- a/src/tests/eolian_cxx/eolian_cxx_suite.h
+++ b/src/tests/eolian_cxx/eolian_cxx_suite.h
@@ -10,5 +10,6 @@ void eolian_cxx_test_address_of(TCase* tc);
10void eolian_cxx_test_inheritance(TCase* tc); 10void eolian_cxx_test_inheritance(TCase* tc);
11void eolian_cxx_test_binding(TCase* tc); 11void eolian_cxx_test_binding(TCase* tc);
12void eolian_cxx_test_cyclic(TCase* tc); 12void eolian_cxx_test_cyclic(TCase* tc);
13void eolian_cxx_test_documentation(TCase* tc);
13 14
14#endif /* _EOLIAN_CXX_SUITE_H */ 15#endif /* _EOLIAN_CXX_SUITE_H */
diff --git a/src/tests/eolian_cxx/eolian_cxx_test_documentation.cc b/src/tests/eolian_cxx/eolian_cxx_test_documentation.cc
new file mode 100644
index 0000000000..26f249432b
--- /dev/null
+++ b/src/tests/eolian_cxx/eolian_cxx_test_documentation.cc
@@ -0,0 +1,289 @@
1#ifdef HAVE_CONFIG_H
2# include <config.h>
3#endif
4
5#include <iostream>
6#include <cassert>
7#include <iterator>
8#include <algorithm>
9
10#include <Eina.hh>
11#include <Eolian_Cxx.hh>
12
13#include "eolian_cxx_suite.h"
14
15#include "grammar/klass_def.hpp"
16
17using efl::eolian::grammar::attributes::klass_def;
18using efl::eolian::grammar::attributes::documentation_def;
19using efl::eolian::grammar::attributes::function_def;
20using efl::eolian::grammar::attributes::enum_def;
21using efl::eolian::grammar::attributes::struct_def;
22
23klass_def init_test_data(efl::eolian::eolian_state const& state)
24{
25 ck_assert(::eolian_directory_scan(state.value, PACKAGE_DATA_DIR));
26 ck_assert(::eolian_all_eot_files_parse(state.value));
27 ck_assert(::eolian_file_parse(state.value, PACKAGE_DATA_DIR"/docs.eo"));
28
29 const Eolian_Class *c_klass = ::eolian_class_get_by_name(state.as_unit(), "Docs");
30 ck_assert_ptr_ne(c_klass, NULL);
31
32 klass_def klass(c_klass, state.as_unit());
33 return klass;
34}
35
36START_TEST(eolian_cxx_test_class_docs)
37{
38 efl::eina::eina_init eina_init;
39 efl::eolian::eolian_init eolian_init;
40 efl::eolian::eolian_state eolian_state;
41
42 klass_def klass = init_test_data(eolian_state);
43 documentation_def doc = klass.documentation;
44 ck_assert_str_eq(doc.summary.c_str(), "Docs for class.");
45 ck_assert_str_eq(doc.description.c_str(),
46 "More docs for class. Testing references now. "
47 "@Foo "
48 "@Bar "
49 "@Alias "
50 "@pants "
51 "@Docs.meth "
52 "@Docs.prop "
53 "@Docs.prop.get "
54 "@Docs.prop.set "
55 "@Foo.field1 "
56 "@Bar.foo "
57 "@Docs");
58 ck_assert_str_eq(doc.since.c_str(), "1.17");
59}
60END_TEST
61
62START_TEST(eolian_cxx_test_function_docs)
63{
64 efl::eina::eina_init eina_init;
65 efl::eolian::eolian_init eolian_init;
66 efl::eolian::eolian_state eolian_state;
67
68 klass_def klass = init_test_data(eolian_state);
69 function_def func = *std::find_if(klass.functions.begin(), klass.functions.end(),
70 [](const function_def& f) {
71 return f.name == "meth";
72 });
73
74 documentation_def doc = func.documentation;
75 ck_assert_str_eq(doc.summary.c_str(), "Method documentation.");
76 ck_assert_str_eq(doc.description.c_str(), "");
77 ck_assert_str_eq(doc.since.c_str(), "1.17"); // Since is inherited from parent if not present, except when no doc is present ofr this member.
78
79 doc = func.return_documentation;
80 ck_assert_str_eq(doc.summary.c_str(), "Return documentation.");
81 ck_assert_str_eq(doc.description.c_str(), "");
82 ck_assert_str_eq(doc.since.c_str(), "1.17");
83
84 auto param_iter = func.parameters.begin();
85
86 // a int
87 doc = param_iter->documentation;
88 ck_assert_str_eq(doc.summary.c_str(), "Param documentation.");
89 ck_assert_str_eq(doc.description.c_str(), "");
90 ck_assert_str_eq(doc.since.c_str(), "1.17");
91
92 param_iter++;
93
94 // b float (no doc)
95 doc = param_iter->documentation;
96 ck_assert_str_eq(doc.summary.c_str(), "");
97 ck_assert_str_eq(doc.description.c_str(), "");
98 ck_assert_str_eq(doc.since.c_str(), "");
99
100 param_iter++;
101
102 // c long
103 doc = param_iter->documentation;
104 ck_assert_str_eq(doc.summary.c_str(), "Another param documentation.");
105 ck_assert_str_eq(doc.description.c_str(), "");
106 ck_assert_str_eq(doc.since.c_str(), "1.17");
107}
108END_TEST
109
110START_TEST(eolian_cxx_test_property_docs)
111{
112 efl::eina::eina_init eina_init;
113 efl::eolian::eolian_init eolian_init;
114 efl::eolian::eolian_state eolian_state;
115
116 klass_def klass = init_test_data(eolian_state);
117 auto func_iter = std::find_if(klass.functions.begin(), klass.functions.end(),
118 [](const function_def& f) {
119 return f.name == "prop_get";
120 });
121
122 ck_assert_msg(func_iter != klass.functions.end(), "Failed to find prop_get function");
123 function_def func = *func_iter;
124
125 documentation_def doc = func.property_documentation;
126 ck_assert_str_eq(doc.summary.c_str(), "Property common documentation.");
127 ck_assert_str_eq(doc.description.c_str(), "");
128 ck_assert_str_eq(doc.since.c_str(), "1.18");
129
130 doc = func.documentation; // Actual getdocumentation.
131 ck_assert_str_eq(doc.summary.c_str(), "Get documentation.");
132 ck_assert_str_eq(doc.description.c_str(), "");
133 ck_assert_str_eq(doc.since.c_str(), "1.17"); // Members inherit from parent *class*
134
135 func_iter = std::find_if(klass.functions.begin(), klass.functions.end(),
136 [](const function_def& f) {
137 return f.name == "prop_set";
138 });
139
140 ck_assert_msg(func_iter != klass.functions.end(), "Failed to find prop_set function");
141 func = *func_iter;
142
143 doc = func.documentation; // Actual getdocumentation.
144 ck_assert_str_eq(doc.summary.c_str(), "Set documentation.");
145 ck_assert_str_eq(doc.description.c_str(), "");
146 ck_assert_str_eq(doc.since.c_str(), "1.17"); // Members inherit from parent *class*
147}
148END_TEST
149
150START_TEST(eolian_cxx_test_event_docs)
151{
152 efl::eina::eina_init eina_init;
153 efl::eolian::eolian_init eolian_init;
154 efl::eolian::eolian_state eolian_state;
155
156 klass_def klass = init_test_data(eolian_state);
157
158 auto event = klass.events.front();
159 documentation_def doc = event.documentation;
160 ck_assert_str_eq(doc.summary.c_str(), "Event docs.");
161 ck_assert_str_eq(doc.description.c_str(), "");
162 ck_assert_str_eq(doc.since.c_str(), "1.17"); // Members inherit from parent *class*
163}
164END_TEST
165
166START_TEST(eolian_cxx_test_enum_docs)
167{
168 efl::eina::eina_init eina_init;
169 efl::eolian::eolian_init eolian_init;
170 efl::eolian::eolian_state eolian_state;
171
172 klass_def klass = init_test_data(eolian_state);
173
174 auto unit = eolian_state.as_unit();
175 enum_def _enum(::eolian_typedecl_enum_get_by_name(unit, "Bar"), unit);
176
177 documentation_def doc = _enum.documentation;
178 ck_assert_str_eq(doc.summary.c_str(), "Docs for enum Bar.");
179 ck_assert_str_eq(doc.description.c_str(), "");
180 ck_assert_str_eq(doc.since.c_str(), "");
181
182 // fields
183 auto field_iter = _enum.fields.begin();
184
185 // blah - no docs
186 doc = field_iter->documentation;
187 ck_assert_str_eq(doc.summary.c_str(), "");
188 ck_assert_str_eq(doc.description.c_str(), "");
189 ck_assert_str_eq(doc.since.c_str(), "");
190
191 field_iter++;
192
193 // foo - docs
194 doc = field_iter->documentation;
195 ck_assert_str_eq(doc.summary.c_str(), "Docs for foo.");
196 ck_assert_str_eq(doc.description.c_str(), "");
197 ck_assert_str_eq(doc.since.c_str(), "");
198
199 field_iter++;
200
201 // bar - docs
202 doc = field_iter->documentation;
203 ck_assert_str_eq(doc.summary.c_str(), "Docs for bar.");
204 ck_assert_str_eq(doc.description.c_str(), "");
205 ck_assert_str_eq(doc.since.c_str(), "");
206}
207END_TEST
208
209START_TEST(eolian_cxx_test_struct_docs)
210{
211 efl::eina::eina_init eina_init;
212 efl::eolian::eolian_init eolian_init;
213 efl::eolian::eolian_state eolian_state;
214
215 klass_def klass = init_test_data(eolian_state);
216
217 auto unit = eolian_state.as_unit();
218 struct_def _struct(::eolian_typedecl_struct_get_by_name(unit, "Foo"), unit);
219
220 documentation_def doc = _struct.documentation;
221 ck_assert_str_eq(doc.summary.c_str(), "This is struct Foo. "
222 "It does stuff.");
223 ck_assert_str_eq(doc.description.c_str(),
224 "Note: This is a note.\n"
225 "\n"
226 "This is a longer description for struct Foo.\n"
227 "\n"
228 "Warning: This is a warning. You can only use Warning: and "
229 "Note: at the beginning of a paragraph.\n"
230 "\n"
231 "This is another paragraph.");
232 ck_assert_str_eq(doc.since.c_str(), "1.66");
233
234 std::vector<std::string> ref_paragraphs = {
235 "Note: This is a note.",
236 "This is a longer description for struct Foo.",
237 "Warning: This is a warning. You can only use Warning: and "
238 "Note: at the beginning of a paragraph.",
239 "This is another paragraph."
240 };
241
242 auto paragraph_it = doc.desc_paragraphs.begin();
243 auto ref_paragraph_it = ref_paragraphs.begin();
244
245 while (ref_paragraph_it != ref_paragraphs.end())
246 {
247 ck_assert_str_eq(paragraph_it->c_str(), ref_paragraph_it->c_str());
248 paragraph_it++;
249 ref_paragraph_it++;
250 }
251
252 ck_assert(paragraph_it == doc.desc_paragraphs.end());
253
254
255 // fields
256 auto field_iter = _struct.fields.begin();
257
258 doc = field_iter->documentation;
259 ck_assert_str_eq(doc.summary.c_str(), "Field documentation.");
260 ck_assert_str_eq(doc.description.c_str(), "");
261 ck_assert_str_eq(doc.since.c_str(), "");
262
263 field_iter++;
264
265 doc = field_iter->documentation;
266 ck_assert_str_eq(doc.summary.c_str(), "");
267 ck_assert_str_eq(doc.description.c_str(), "");
268 ck_assert_str_eq(doc.since.c_str(), "");
269
270 field_iter++;
271
272 doc = field_iter->documentation;
273 ck_assert_str_eq(doc.summary.c_str(), "Another field documentation.");
274 ck_assert_str_eq(doc.description.c_str(), "");
275 ck_assert_str_eq(doc.since.c_str(), "");
276}
277END_TEST
278
279void
280eolian_cxx_test_documentation(TCase* tc)
281{
282 tcase_add_test(tc, eolian_cxx_test_class_docs);
283 tcase_add_test(tc, eolian_cxx_test_function_docs);
284 tcase_add_test(tc, eolian_cxx_test_property_docs);
285 tcase_add_test(tc, eolian_cxx_test_event_docs);
286 tcase_add_test(tc, eolian_cxx_test_enum_docs);
287 tcase_add_test(tc, eolian_cxx_test_struct_docs);
288}
289