[EflSharp] Update Circle and efl cs files (#819)
[platform/core/csapi/tizenfx.git] / internals / src / EflSharp / EflSharp / efl / efl_canvas_surface.eo.cs
1 #pragma warning disable CS1591
2 using System;
3 using System.Runtime.InteropServices;
4 using System.Collections.Generic;
5 using System.Linq;
6 using System.Threading;
7 using System.ComponentModel;
8 namespace Efl {
9
10 namespace Canvas {
11
12 /// <summary>Native surfaces usually bound to an externally-managed buffer.
13 /// The attached <see cref="Efl.Canvas.Surface.NativeBuffer"/> is entirely platform-dependent, which means some of this mixin&apos;s subclasses will not work (constructor returns <c>null</c>) on some platforms. This class is meant to be used from native code only (C or C++), with direct access to the display system or a buffer allocation system.</summary>
14 [Efl.Canvas.Surface.NativeMethods]
15 public abstract class Surface : Efl.Canvas.ImageInternal, Efl.Eo.IWrapper
16 {
17     ///<summary>Pointer to the native class description.</summary>
18     public override System.IntPtr NativeClass
19     {
20         get
21         {
22             if (((object)this).GetType() == typeof(Surface))
23             {
24                 return GetEflClassStatic();
25             }
26             else
27             {
28                 return Efl.Eo.ClassRegister.klassFromType[((object)this).GetType()];
29             }
30         }
31     }
32
33     [System.Runtime.InteropServices.DllImport(efl.Libs.Evas)] internal static extern System.IntPtr
34         efl_canvas_surface_class_get();
35     /// <summary>Initializes a new instance of the <see cref="Surface"/> class.</summary>
36     /// <param name="parent">Parent instance.</param>
37     public Surface(Efl.Object parent= null
38             ) : base(efl_canvas_surface_class_get(), typeof(Surface), parent)
39     {
40         FinishInstantiation();
41     }
42
43     /// <summary>Initializes a new instance of the <see cref="Surface"/> class.
44     /// Internal usage: Constructs an instance from a native pointer. This is used when interacting with C code and should not be used directly.</summary>
45     /// <param name="raw">The native pointer to be wrapped.</param>
46     protected Surface(System.IntPtr raw) : base(raw)
47     {
48             }
49
50     [Efl.Eo.PrivateNativeClass]
51     private class SurfaceRealized : Surface
52     {
53         private SurfaceRealized(IntPtr ptr) : base(ptr)
54         {
55         }
56     }
57     /// <summary>Initializes a new instance of the <see cref="Surface"/> class.
58     /// Internal usage: Constructor to forward the wrapper initialization to the root class that interfaces with native code. Should not be used directly.</summary>
59     /// <param name="baseKlass">The pointer to the base native Eo class.</param>
60     /// <param name="managedType">The managed type of the public constructor that originated this call.</param>
61     /// <param name="parent">The Efl.Object parent of this instance.</param>
62     protected Surface(IntPtr baseKlass, System.Type managedType, Efl.Object parent) : base(baseKlass, managedType, parent)
63     {
64     }
65
66     /// <summary>Verifies if the given object is equal to this one.</summary>
67     /// <param name="instance">The object to compare to.</param>
68     /// <returns>True if both objects point to the same native object.</returns>
69     public override bool Equals(object instance)
70     {
71         var other = instance as Efl.Object;
72         if (other == null)
73         {
74             return false;
75         }
76         return this.NativeHandle == other.NativeHandle;
77     }
78
79     /// <summary>Gets the hash code for this object based on the native pointer it points to.</summary>
80     /// <returns>The value of the pointer, to be used as the hash code of this object.</returns>
81     public override int GetHashCode()
82     {
83         return this.NativeHandle.ToInt32();
84     }
85
86     /// <summary>Turns the native pointer into a string representation.</summary>
87     /// <returns>A string with the type and the native pointer for this object.</returns>
88     public override String ToString()
89     {
90         return $"{this.GetType().Name}@[{this.NativeHandle.ToInt32():x}]";
91     }
92
93     /// <summary>External buffer attached to this native surface.
94     /// Set to <c>null</c> to detach this surface from the external buffer.</summary>
95     /// <returns>The external buffer, depends on its type.</returns>
96     virtual public System.IntPtr GetNativeBuffer() {
97          var _ret_var = Efl.Canvas.Surface.NativeMethods.efl_canvas_surface_native_buffer_get_ptr.Value.Delegate((inherited ? Efl.Eo.Globals.efl_super(this.NativeHandle, this.NativeClass) : this.NativeHandle));
98         Eina.Error.RaiseIfUnhandledException();
99         return _ret_var;
100  }
101     /// <summary>Set the buffer. If this fails, this function returns <c>false</c>, and the surface is left without any attached buffer.</summary>
102     /// <param name="buffer">The external buffer, depends on its type.</param>
103     /// <returns><c>true</c> on success, <c>false</c> otherwise</returns>
104     virtual public bool SetNativeBuffer(System.IntPtr buffer) {
105                                  var _ret_var = Efl.Canvas.Surface.NativeMethods.efl_canvas_surface_native_buffer_set_ptr.Value.Delegate((inherited ? Efl.Eo.Globals.efl_super(this.NativeHandle, this.NativeClass) : this.NativeHandle),buffer);
106         Eina.Error.RaiseIfUnhandledException();
107                         return _ret_var;
108  }
109     /// <summary>External buffer attached to this native surface.
110 /// Set to <c>null</c> to detach this surface from the external buffer.</summary>
111 /// <value>The external buffer, depends on its type.</value>
112     public System.IntPtr NativeBuffer {
113         get { return GetNativeBuffer(); }
114         set { SetNativeBuffer(value); }
115     }
116     private static IntPtr GetEflClassStatic()
117     {
118         return Efl.Canvas.Surface.efl_canvas_surface_class_get();
119     }
120     /// <summary>Wrapper for native methods and virtual method delegates.
121     /// For internal use by generated code only.</summary>
122     public new class NativeMethods : Efl.Canvas.ImageInternal.NativeMethods
123     {
124         private static Efl.Eo.NativeModule Module = new Efl.Eo.NativeModule(    efl.Libs.Evas);
125         /// <summary>Gets the list of Eo operations to override.</summary>
126         /// <returns>The list of Eo operations to be overload.</returns>
127         public override System.Collections.Generic.List<Efl_Op_Description> GetEoOps(System.Type type)
128         {
129             var descs = new System.Collections.Generic.List<Efl_Op_Description>();
130             var methods = Efl.Eo.Globals.GetUserMethods(type);
131
132             if (efl_canvas_surface_native_buffer_get_static_delegate == null)
133             {
134                 efl_canvas_surface_native_buffer_get_static_delegate = new efl_canvas_surface_native_buffer_get_delegate(native_buffer_get);
135             }
136
137             if (methods.FirstOrDefault(m => m.Name == "GetNativeBuffer") != null)
138             {
139                 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(Module.Module, "efl_canvas_surface_native_buffer_get"), func = Marshal.GetFunctionPointerForDelegate(efl_canvas_surface_native_buffer_get_static_delegate) });
140             }
141
142             if (efl_canvas_surface_native_buffer_set_static_delegate == null)
143             {
144                 efl_canvas_surface_native_buffer_set_static_delegate = new efl_canvas_surface_native_buffer_set_delegate(native_buffer_set);
145             }
146
147             if (methods.FirstOrDefault(m => m.Name == "SetNativeBuffer") != null)
148             {
149                 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(Module.Module, "efl_canvas_surface_native_buffer_set"), func = Marshal.GetFunctionPointerForDelegate(efl_canvas_surface_native_buffer_set_static_delegate) });
150             }
151
152             descs.AddRange(base.GetEoOps(type));
153             return descs;
154         }
155         /// <summary>Returns the Eo class for the native methods of this class.</summary>
156         /// <returns>The native class pointer.</returns>
157         public override IntPtr GetEflClass()
158         {
159             return Efl.Canvas.Surface.efl_canvas_surface_class_get();
160         }
161
162         #pragma warning disable CA1707, SA1300, SA1600
163
164         
165         private delegate System.IntPtr efl_canvas_surface_native_buffer_get_delegate(System.IntPtr obj, System.IntPtr pd);
166
167         
168         public delegate System.IntPtr efl_canvas_surface_native_buffer_get_api_delegate(System.IntPtr obj);
169
170         public static Efl.Eo.FunctionWrapper<efl_canvas_surface_native_buffer_get_api_delegate> efl_canvas_surface_native_buffer_get_ptr = new Efl.Eo.FunctionWrapper<efl_canvas_surface_native_buffer_get_api_delegate>(Module, "efl_canvas_surface_native_buffer_get");
171
172         private static System.IntPtr native_buffer_get(System.IntPtr obj, System.IntPtr pd)
173         {
174             Eina.Log.Debug("function efl_canvas_surface_native_buffer_get was called");
175             Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.PrivateDataGet(pd);
176             if (wrapper != null)
177             {
178             System.IntPtr _ret_var = default(System.IntPtr);
179                 try
180                 {
181                     _ret_var = ((Surface)wrapper).GetNativeBuffer();
182                 }
183                 catch (Exception e)
184                 {
185                     Eina.Log.Warning($"Callback error: {e.ToString()}");
186                     Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
187                 }
188
189         return _ret_var;
190
191             }
192             else
193             {
194                 return efl_canvas_surface_native_buffer_get_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)));
195             }
196         }
197
198         private static efl_canvas_surface_native_buffer_get_delegate efl_canvas_surface_native_buffer_get_static_delegate;
199
200         [return: MarshalAs(UnmanagedType.U1)]
201         private delegate bool efl_canvas_surface_native_buffer_set_delegate(System.IntPtr obj, System.IntPtr pd,  System.IntPtr buffer);
202
203         [return: MarshalAs(UnmanagedType.U1)]
204         public delegate bool efl_canvas_surface_native_buffer_set_api_delegate(System.IntPtr obj,  System.IntPtr buffer);
205
206         public static Efl.Eo.FunctionWrapper<efl_canvas_surface_native_buffer_set_api_delegate> efl_canvas_surface_native_buffer_set_ptr = new Efl.Eo.FunctionWrapper<efl_canvas_surface_native_buffer_set_api_delegate>(Module, "efl_canvas_surface_native_buffer_set");
207
208         private static bool native_buffer_set(System.IntPtr obj, System.IntPtr pd, System.IntPtr buffer)
209         {
210             Eina.Log.Debug("function efl_canvas_surface_native_buffer_set was called");
211             Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.PrivateDataGet(pd);
212             if (wrapper != null)
213             {
214                                     bool _ret_var = default(bool);
215                 try
216                 {
217                     _ret_var = ((Surface)wrapper).SetNativeBuffer(buffer);
218                 }
219                 catch (Exception e)
220                 {
221                     Eina.Log.Warning($"Callback error: {e.ToString()}");
222                     Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
223                 }
224
225                         return _ret_var;
226
227             }
228             else
229             {
230                 return efl_canvas_surface_native_buffer_set_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), buffer);
231             }
232         }
233
234         private static efl_canvas_surface_native_buffer_set_delegate efl_canvas_surface_native_buffer_set_static_delegate;
235
236         #pragma warning restore CA1707, SA1300, SA1600
237
238 }
239 }
240 }
241
242 }
243