summaryrefslogtreecommitdiff
path: root/src/bindings/mono/eina_mono/eina_binbuf.cs
diff options
context:
space:
mode:
authorLauro Moura <lauromoura@expertisesolutions.com.br>2018-11-29 21:04:37 -0200
committerVitor Sousa <vitorsousa@expertisesolutions.com.br>2018-11-29 21:29:48 -0200
commit3623753c1d6b893955a1c31e8559a2312f674192 (patch)
treee862682ff92d34ce4ebf44c95efa24ba3a57fe7a /src/bindings/mono/eina_mono/eina_binbuf.cs
parenteec7bc458eee333fd7237a3bd43e8c2c884f21ca (diff)
csharp: Change to new class API.
Summary: As discussed in T7204: - Eo Interfaces/mixins -> C# Interfaces with concrete class implementations - Eo Regular/Abstracts -> Proper C# classes - Added some new generators and helper methods. - Refactored the class generator, splitting into helper methods Eo handles now are stored only in the "root" class in any given inheritance tree (generally, Efl.Object), and accessible to each child. Methods also are defined in a single place instead of repeatedly generated in everyfile, reducing the size of the generated .dll from 30MB to around 4.5MB. Mixins are generated as C# interfaces but any regular class it inherits from is lost, as we can't have interfaces inheriting from regular classes. This will be dealt with in a later commit. Summary of API Changes: - Merged Inherit/Concrete classes. (These suffixes disappear from regular classes). - Interface still have implementations with 'Concrete' suffix for when they are returned from methods. - Removed 'I' from interface names. - Removed interfaces for regular/abstract Eo classes. - Concrete classes for interfaces/mixins hold the event argument struct. - Removed '_' from classes, enums, structs, etc, as indicated in C# naming conventions. - Namespaces are now Camel.Cased. - Renamed IWrapper's raw_handle/raw_klass to NativeHandle/NativeClass Also renamed the test classes as after the namespace change, the test namespace Test can conflict with the helper Test namespace. (And use more meaningful names than Test.Testing...) Also Fixes T7336 by removing a deprecated example and adding efl_loop_timer_example to build system. Fixes T7451 by hiding the class_get DllImports and renaming the IWrapper fields. The native handlers are used in the manual binding. Still need to work: - As there are still some events names clashing (e.g. Efl.Ui.Bg with "resize" from Efl.Gfx.Entity and Efl.Gfx.Image), Events are currently declared on the interface and implemented "namespaced" in the classes, requiring the cast to the interface to access the event. - The Mixin Conundrum. Mixin inheritance will be dealt in a future commit. Depends on D7260 Reviewers: segfaultxavi, vitor.sousa, felipealmeida, Jaehyun_Cho Reviewed By: vitor.sousa Subscribers: cedric, #reviewers, #committers Tags: #efl Maniphest Tasks: T7451, T7336 Differential Revision: https://phab.enlightenment.org/D7262
Diffstat (limited to 'src/bindings/mono/eina_mono/eina_binbuf.cs')
-rw-r--r--src/bindings/mono/eina_mono/eina_binbuf.cs14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/bindings/mono/eina_mono/eina_binbuf.cs b/src/bindings/mono/eina_mono/eina_binbuf.cs
index ecfbfc3..20a4c2d 100644
--- a/src/bindings/mono/eina_mono/eina_binbuf.cs
+++ b/src/bindings/mono/eina_mono/eina_binbuf.cs
@@ -3,7 +3,7 @@
3using System; 3using System;
4using System.Runtime.InteropServices; 4using System.Runtime.InteropServices;
5 5
6namespace eina { 6namespace Eina {
7 7
8public class Binbuf : IDisposable 8public class Binbuf : IDisposable
9{ 9{
@@ -16,7 +16,7 @@ public class Binbuf : IDisposable
16 [DllImport(efl.Libs.Eina)] public static extern byte 16 [DllImport(efl.Libs.Eina)] public static extern byte
17 eina_binbuf_append_length(IntPtr buf, byte[] str, UIntPtr length); 17 eina_binbuf_append_length(IntPtr buf, byte[] str, UIntPtr length);
18 [DllImport(efl.Libs.Eina)] public static extern byte 18 [DllImport(efl.Libs.Eina)] public static extern byte
19 eina_binbuf_append_slice(IntPtr buf, eina.Slice slice); 19 eina_binbuf_append_slice(IntPtr buf, Eina.Slice slice);
20 [DllImport(efl.Libs.Eina)] public static extern byte 20 [DllImport(efl.Libs.Eina)] public static extern byte
21 eina_binbuf_append_buffer(IntPtr buf, IntPtr data); 21 eina_binbuf_append_buffer(IntPtr buf, IntPtr data);
22 [DllImport(efl.Libs.Eina)] public static extern byte 22 [DllImport(efl.Libs.Eina)] public static extern byte
@@ -24,7 +24,7 @@ public class Binbuf : IDisposable
24 [DllImport(efl.Libs.Eina)] public static extern byte 24 [DllImport(efl.Libs.Eina)] public static extern byte
25 eina_binbuf_insert_length(IntPtr buf, byte[] str, UIntPtr length, UIntPtr pos); 25 eina_binbuf_insert_length(IntPtr buf, byte[] str, UIntPtr length, UIntPtr pos);
26 [DllImport(efl.Libs.Eina)] public static extern byte 26 [DllImport(efl.Libs.Eina)] public static extern byte
27 eina_binbuf_insert_slice(IntPtr buf, eina.Slice slice, UIntPtr pos); 27 eina_binbuf_insert_slice(IntPtr buf, Eina.Slice slice, UIntPtr pos);
28 [DllImport(efl.Libs.Eina)] public static extern byte 28 [DllImport(efl.Libs.Eina)] public static extern byte
29 eina_binbuf_insert_char(IntPtr buf, byte c, UIntPtr pos); 29 eina_binbuf_insert_char(IntPtr buf, byte c, UIntPtr pos);
30 [DllImport(efl.Libs.Eina)] public static extern byte 30 [DllImport(efl.Libs.Eina)] public static extern byte
@@ -35,7 +35,7 @@ public class Binbuf : IDisposable
35 eina_binbuf_string_free(IntPtr buf); 35 eina_binbuf_string_free(IntPtr buf);
36 [DllImport(efl.Libs.Eina)] public static extern UIntPtr 36 [DllImport(efl.Libs.Eina)] public static extern UIntPtr
37 eina_binbuf_length_get(IntPtr buf); 37 eina_binbuf_length_get(IntPtr buf);
38 [DllImport(efl.Libs.Eina)] public static extern eina.Slice 38 [DllImport(efl.Libs.Eina)] public static extern Eina.Slice
39 eina_binbuf_slice_get(IntPtr buf); 39 eina_binbuf_slice_get(IntPtr buf);
40 40
41 public IntPtr Handle {get;set;} = IntPtr.Zero; 41 public IntPtr Handle {get;set;} = IntPtr.Zero;
@@ -146,7 +146,7 @@ public class Binbuf : IDisposable
146 return 0 != eina_binbuf_append_char(Handle, c); 146 return 0 != eina_binbuf_append_char(Handle, c);
147 } 147 }
148 148
149 public bool Append(eina.Slice slice) 149 public bool Append(Eina.Slice slice)
150 { 150 {
151 return 0 != eina_binbuf_append_slice(Handle, slice); 151 return 0 != eina_binbuf_append_slice(Handle, slice);
152 } 152 }
@@ -166,7 +166,7 @@ public class Binbuf : IDisposable
166 return 0 != eina_binbuf_insert_char(Handle, c, (UIntPtr)pos); 166 return 0 != eina_binbuf_insert_char(Handle, c, (UIntPtr)pos);
167 } 167 }
168 168
169 public bool Insert(eina.Slice slice, uint pos) 169 public bool Insert(Eina.Slice slice, uint pos)
170 { 170 {
171 return 0 != eina_binbuf_insert_slice(Handle, slice, (UIntPtr)pos); 171 return 0 != eina_binbuf_insert_slice(Handle, slice, (UIntPtr)pos);
172 } 172 }
@@ -203,7 +203,7 @@ public class Binbuf : IDisposable
203 return eina_binbuf_length_get(Handle); 203 return eina_binbuf_length_get(Handle);
204 } 204 }
205 205
206 eina.Slice GetSlice() 206 Eina.Slice GetSlice()
207 { 207 {
208 return eina_binbuf_slice_get(Handle); 208 return eina_binbuf_slice_get(Handle);
209 } 209 }