[EflSharp] Update Circle and efl cs files (#819)
[platform/core/csapi/tizenfx.git] / internals / src / EflSharp / EflSharp / efl / efl_orientation.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 /// <summary>Efl orientation interface</summary>
11 [Efl.IOrientationConcrete.NativeMethods]
12 public interface IOrientation : 
13     Efl.Eo.IWrapper, IDisposable
14 {
15     /// <summary>Control the orientation of a given object.
16 /// This can be used to set the rotation on an image or a window, for instance.</summary>
17 /// <returns>The rotation angle (CCW), see <see cref="Efl.Orient"/>.</returns>
18 Efl.Orient GetOrientation();
19     /// <summary>Control the orientation of a given object.
20 /// This can be used to set the rotation on an image or a window, for instance.</summary>
21 /// <param name="dir">The rotation angle (CCW), see <see cref="Efl.Orient"/>.</param>
22 void SetOrientation(Efl.Orient dir);
23     /// <summary>Control the flip of the given image
24 /// Use this function to change how your image is to be flipped: vertically or horizontally or transpose or traverse.</summary>
25 /// <returns>Flip method</returns>
26 Efl.Flip GetFlip();
27     /// <summary>Control the flip of the given image
28 /// Use this function to change how your image is to be flipped: vertically or horizontally or transpose or traverse.</summary>
29 /// <param name="flip">Flip method</param>
30 void SetFlip(Efl.Flip flip);
31                     /// <summary>Control the orientation of a given object.
32 /// This can be used to set the rotation on an image or a window, for instance.</summary>
33 /// <value>The rotation angle (CCW), see <see cref="Efl.Orient"/>.</value>
34     Efl.Orient Orientation {
35         get ;
36         set ;
37     }
38     /// <summary>Control the flip of the given image
39 /// Use this function to change how your image is to be flipped: vertically or horizontally or transpose or traverse.</summary>
40 /// <value>Flip method</value>
41     Efl.Flip Flip {
42         get ;
43         set ;
44     }
45 }
46 /// <summary>Efl orientation interface</summary>
47 sealed public class IOrientationConcrete : 
48
49 IOrientation
50     
51 {
52     ///<summary>Pointer to the native class description.</summary>
53     public System.IntPtr NativeClass
54     {
55         get
56         {
57             if (((object)this).GetType() == typeof(IOrientationConcrete))
58             {
59                 return GetEflClassStatic();
60             }
61             else
62             {
63                 return Efl.Eo.ClassRegister.klassFromType[((object)this).GetType()];
64             }
65         }
66     }
67
68     private  System.IntPtr handle;
69     ///<summary>Pointer to the native instance.</summary>
70     public System.IntPtr NativeHandle
71     {
72         get { return handle; }
73     }
74
75     [System.Runtime.InteropServices.DllImport(efl.Libs.Efl)] internal static extern System.IntPtr
76         efl_orientation_interface_get();
77     /// <summary>Initializes a new instance of the <see cref="IOrientation"/> class.
78     /// Internal usage: This is used when interacting with C code and should not be used directly.</summary>
79     private IOrientationConcrete(System.IntPtr raw)
80     {
81         handle = raw;
82     }
83     ///<summary>Destructor.</summary>
84     ~IOrientationConcrete()
85     {
86         Dispose(false);
87     }
88
89     ///<summary>Releases the underlying native instance.</summary>
90     private void Dispose(bool disposing)
91     {
92         if (handle != System.IntPtr.Zero)
93         {
94             IntPtr h = handle;
95             handle = IntPtr.Zero;
96
97             IntPtr gcHandlePtr = IntPtr.Zero;
98             if (disposing)
99             {
100                 Efl.Eo.Globals.efl_mono_native_dispose(h, gcHandlePtr);
101             }
102             else
103             {
104                 Monitor.Enter(Efl.All.InitLock);
105                 if (Efl.All.MainLoopInitialized)
106                 {
107                     Efl.Eo.Globals.efl_mono_thread_safe_native_dispose(h, gcHandlePtr);
108                 }
109
110                 Monitor.Exit(Efl.All.InitLock);
111             }
112         }
113
114     }
115
116     ///<summary>Releases the underlying native instance.</summary>
117     public void Dispose()
118     {
119         Dispose(true);
120         GC.SuppressFinalize(this);
121     }
122
123     /// <summary>Verifies if the given object is equal to this one.</summary>
124     /// <param name="instance">The object to compare to.</param>
125     /// <returns>True if both objects point to the same native object.</returns>
126     public override bool Equals(object instance)
127     {
128         var other = instance as Efl.Object;
129         if (other == null)
130         {
131             return false;
132         }
133         return this.NativeHandle == other.NativeHandle;
134     }
135
136     /// <summary>Gets the hash code for this object based on the native pointer it points to.</summary>
137     /// <returns>The value of the pointer, to be used as the hash code of this object.</returns>
138     public override int GetHashCode()
139     {
140         return this.NativeHandle.ToInt32();
141     }
142
143     /// <summary>Turns the native pointer into a string representation.</summary>
144     /// <returns>A string with the type and the native pointer for this object.</returns>
145     public override String ToString()
146     {
147         return $"{this.GetType().Name}@[{this.NativeHandle.ToInt32():x}]";
148     }
149
150     /// <summary>Control the orientation of a given object.
151     /// This can be used to set the rotation on an image or a window, for instance.</summary>
152     /// <returns>The rotation angle (CCW), see <see cref="Efl.Orient"/>.</returns>
153     public Efl.Orient GetOrientation() {
154          var _ret_var = Efl.IOrientationConcrete.NativeMethods.efl_orientation_get_ptr.Value.Delegate(this.NativeHandle);
155         Eina.Error.RaiseIfUnhandledException();
156         return _ret_var;
157  }
158     /// <summary>Control the orientation of a given object.
159     /// This can be used to set the rotation on an image or a window, for instance.</summary>
160     /// <param name="dir">The rotation angle (CCW), see <see cref="Efl.Orient"/>.</param>
161     public void SetOrientation(Efl.Orient dir) {
162                                  Efl.IOrientationConcrete.NativeMethods.efl_orientation_set_ptr.Value.Delegate(this.NativeHandle,dir);
163         Eina.Error.RaiseIfUnhandledException();
164                          }
165     /// <summary>Control the flip of the given image
166     /// Use this function to change how your image is to be flipped: vertically or horizontally or transpose or traverse.</summary>
167     /// <returns>Flip method</returns>
168     public Efl.Flip GetFlip() {
169          var _ret_var = Efl.IOrientationConcrete.NativeMethods.efl_orientation_flip_get_ptr.Value.Delegate(this.NativeHandle);
170         Eina.Error.RaiseIfUnhandledException();
171         return _ret_var;
172  }
173     /// <summary>Control the flip of the given image
174     /// Use this function to change how your image is to be flipped: vertically or horizontally or transpose or traverse.</summary>
175     /// <param name="flip">Flip method</param>
176     public void SetFlip(Efl.Flip flip) {
177                                  Efl.IOrientationConcrete.NativeMethods.efl_orientation_flip_set_ptr.Value.Delegate(this.NativeHandle,flip);
178         Eina.Error.RaiseIfUnhandledException();
179                          }
180     /// <summary>Control the orientation of a given object.
181 /// This can be used to set the rotation on an image or a window, for instance.</summary>
182 /// <value>The rotation angle (CCW), see <see cref="Efl.Orient"/>.</value>
183     public Efl.Orient Orientation {
184         get { return GetOrientation(); }
185         set { SetOrientation(value); }
186     }
187     /// <summary>Control the flip of the given image
188 /// Use this function to change how your image is to be flipped: vertically or horizontally or transpose or traverse.</summary>
189 /// <value>Flip method</value>
190     public Efl.Flip Flip {
191         get { return GetFlip(); }
192         set { SetFlip(value); }
193     }
194     private static IntPtr GetEflClassStatic()
195     {
196         return Efl.IOrientationConcrete.efl_orientation_interface_get();
197     }
198     /// <summary>Wrapper for native methods and virtual method delegates.
199     /// For internal use by generated code only.</summary>
200     public class NativeMethods  : Efl.Eo.NativeClass
201     {
202         private static Efl.Eo.NativeModule Module = new Efl.Eo.NativeModule(    efl.Libs.Efl);
203         /// <summary>Gets the list of Eo operations to override.</summary>
204         /// <returns>The list of Eo operations to be overload.</returns>
205         public override System.Collections.Generic.List<Efl_Op_Description> GetEoOps(System.Type type)
206         {
207             var descs = new System.Collections.Generic.List<Efl_Op_Description>();
208             var methods = Efl.Eo.Globals.GetUserMethods(type);
209
210             if (efl_orientation_get_static_delegate == null)
211             {
212                 efl_orientation_get_static_delegate = new efl_orientation_get_delegate(orientation_get);
213             }
214
215             if (methods.FirstOrDefault(m => m.Name == "GetOrientation") != null)
216             {
217                 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(Module.Module, "efl_orientation_get"), func = Marshal.GetFunctionPointerForDelegate(efl_orientation_get_static_delegate) });
218             }
219
220             if (efl_orientation_set_static_delegate == null)
221             {
222                 efl_orientation_set_static_delegate = new efl_orientation_set_delegate(orientation_set);
223             }
224
225             if (methods.FirstOrDefault(m => m.Name == "SetOrientation") != null)
226             {
227                 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(Module.Module, "efl_orientation_set"), func = Marshal.GetFunctionPointerForDelegate(efl_orientation_set_static_delegate) });
228             }
229
230             if (efl_orientation_flip_get_static_delegate == null)
231             {
232                 efl_orientation_flip_get_static_delegate = new efl_orientation_flip_get_delegate(flip_get);
233             }
234
235             if (methods.FirstOrDefault(m => m.Name == "GetFlip") != null)
236             {
237                 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(Module.Module, "efl_orientation_flip_get"), func = Marshal.GetFunctionPointerForDelegate(efl_orientation_flip_get_static_delegate) });
238             }
239
240             if (efl_orientation_flip_set_static_delegate == null)
241             {
242                 efl_orientation_flip_set_static_delegate = new efl_orientation_flip_set_delegate(flip_set);
243             }
244
245             if (methods.FirstOrDefault(m => m.Name == "SetFlip") != null)
246             {
247                 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(Module.Module, "efl_orientation_flip_set"), func = Marshal.GetFunctionPointerForDelegate(efl_orientation_flip_set_static_delegate) });
248             }
249
250             return descs;
251         }
252         /// <summary>Returns the Eo class for the native methods of this class.</summary>
253         /// <returns>The native class pointer.</returns>
254         public override IntPtr GetEflClass()
255         {
256             return Efl.IOrientationConcrete.efl_orientation_interface_get();
257         }
258
259         #pragma warning disable CA1707, SA1300, SA1600
260
261         
262         private delegate Efl.Orient efl_orientation_get_delegate(System.IntPtr obj, System.IntPtr pd);
263
264         
265         public delegate Efl.Orient efl_orientation_get_api_delegate(System.IntPtr obj);
266
267         public static Efl.Eo.FunctionWrapper<efl_orientation_get_api_delegate> efl_orientation_get_ptr = new Efl.Eo.FunctionWrapper<efl_orientation_get_api_delegate>(Module, "efl_orientation_get");
268
269         private static Efl.Orient orientation_get(System.IntPtr obj, System.IntPtr pd)
270         {
271             Eina.Log.Debug("function efl_orientation_get was called");
272             Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.PrivateDataGet(pd);
273             if (wrapper != null)
274             {
275             Efl.Orient _ret_var = default(Efl.Orient);
276                 try
277                 {
278                     _ret_var = ((IOrientation)wrapper).GetOrientation();
279                 }
280                 catch (Exception e)
281                 {
282                     Eina.Log.Warning($"Callback error: {e.ToString()}");
283                     Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
284                 }
285
286         return _ret_var;
287
288             }
289             else
290             {
291                 return efl_orientation_get_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)));
292             }
293         }
294
295         private static efl_orientation_get_delegate efl_orientation_get_static_delegate;
296
297         
298         private delegate void efl_orientation_set_delegate(System.IntPtr obj, System.IntPtr pd,  Efl.Orient dir);
299
300         
301         public delegate void efl_orientation_set_api_delegate(System.IntPtr obj,  Efl.Orient dir);
302
303         public static Efl.Eo.FunctionWrapper<efl_orientation_set_api_delegate> efl_orientation_set_ptr = new Efl.Eo.FunctionWrapper<efl_orientation_set_api_delegate>(Module, "efl_orientation_set");
304
305         private static void orientation_set(System.IntPtr obj, System.IntPtr pd, Efl.Orient dir)
306         {
307             Eina.Log.Debug("function efl_orientation_set was called");
308             Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.PrivateDataGet(pd);
309             if (wrapper != null)
310             {
311                                     
312                 try
313                 {
314                     ((IOrientation)wrapper).SetOrientation(dir);
315                 }
316                 catch (Exception e)
317                 {
318                     Eina.Log.Warning($"Callback error: {e.ToString()}");
319                     Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
320                 }
321
322                         
323             }
324             else
325             {
326                 efl_orientation_set_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), dir);
327             }
328         }
329
330         private static efl_orientation_set_delegate efl_orientation_set_static_delegate;
331
332         
333         private delegate Efl.Flip efl_orientation_flip_get_delegate(System.IntPtr obj, System.IntPtr pd);
334
335         
336         public delegate Efl.Flip efl_orientation_flip_get_api_delegate(System.IntPtr obj);
337
338         public static Efl.Eo.FunctionWrapper<efl_orientation_flip_get_api_delegate> efl_orientation_flip_get_ptr = new Efl.Eo.FunctionWrapper<efl_orientation_flip_get_api_delegate>(Module, "efl_orientation_flip_get");
339
340         private static Efl.Flip flip_get(System.IntPtr obj, System.IntPtr pd)
341         {
342             Eina.Log.Debug("function efl_orientation_flip_get was called");
343             Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.PrivateDataGet(pd);
344             if (wrapper != null)
345             {
346             Efl.Flip _ret_var = default(Efl.Flip);
347                 try
348                 {
349                     _ret_var = ((IOrientation)wrapper).GetFlip();
350                 }
351                 catch (Exception e)
352                 {
353                     Eina.Log.Warning($"Callback error: {e.ToString()}");
354                     Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
355                 }
356
357         return _ret_var;
358
359             }
360             else
361             {
362                 return efl_orientation_flip_get_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)));
363             }
364         }
365
366         private static efl_orientation_flip_get_delegate efl_orientation_flip_get_static_delegate;
367
368         
369         private delegate void efl_orientation_flip_set_delegate(System.IntPtr obj, System.IntPtr pd,  Efl.Flip flip);
370
371         
372         public delegate void efl_orientation_flip_set_api_delegate(System.IntPtr obj,  Efl.Flip flip);
373
374         public static Efl.Eo.FunctionWrapper<efl_orientation_flip_set_api_delegate> efl_orientation_flip_set_ptr = new Efl.Eo.FunctionWrapper<efl_orientation_flip_set_api_delegate>(Module, "efl_orientation_flip_set");
375
376         private static void flip_set(System.IntPtr obj, System.IntPtr pd, Efl.Flip flip)
377         {
378             Eina.Log.Debug("function efl_orientation_flip_set was called");
379             Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.PrivateDataGet(pd);
380             if (wrapper != null)
381             {
382                                     
383                 try
384                 {
385                     ((IOrientation)wrapper).SetFlip(flip);
386                 }
387                 catch (Exception e)
388                 {
389                     Eina.Log.Warning($"Callback error: {e.ToString()}");
390                     Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
391                 }
392
393                         
394             }
395             else
396             {
397                 efl_orientation_flip_set_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), flip);
398             }
399         }
400
401         private static efl_orientation_flip_set_delegate efl_orientation_flip_set_static_delegate;
402
403         #pragma warning restore CA1707, SA1300, SA1600
404
405 }
406 }
407 }
408
409 namespace Efl {
410
411 /// <summary>An orientation type, to rotate visual objects.
412 /// Not to be confused with <see cref="Efl.Ui.Dir"/> which is meant for widgets, rather than images and canvases. This enum is used to rotate images, videos and the like.
413 /// 
414 /// See also <see cref="Efl.IOrientation"/>.</summary>
415 public enum Orient
416 {
417 /// <summary>Default, same as up</summary>
418 None = 0,
419 /// <summary>Orient up, do not rotate.</summary>
420 Up = 0,
421 /// <summary>Orient right, rotate 90 degrees counter clock-wise.</summary>
422 Right = 90,
423 /// <summary>Orient down, rotate 180 degrees.</summary>
424 Down = 180,
425 /// <summary>Orient left, rotate 90 degrees clock-wise.</summary>
426 Left = 270,
427 }
428
429 }
430
431 namespace Efl {
432
433 /// <summary>A flip type, to flip visual objects.
434 /// See also <see cref="Efl.IOrientation"/>.</summary>
435 public enum Flip
436 {
437 /// <summary>No flip</summary>
438 None = 0,
439 /// <summary>Flip image horizontally</summary>
440 Horizontal = 1,
441 /// <summary>Flip image vertically</summary>
442 Vertical = 2,
443 }
444
445 }
446