7a65d287bec6cdc2789b2b4c1c85b79850122ded
[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
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>External buffer attached to this native surface.
67     /// Set to <c>null</c> to detach this surface from the external buffer.</summary>
68     /// <returns>The external buffer, depends on its type.</returns>
69     virtual public System.IntPtr GetNativeBuffer() {
70          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));
71         Eina.Error.RaiseIfUnhandledException();
72         return _ret_var;
73  }
74     /// <summary>Set the buffer. If this fails, this function returns <c>false</c>, and the surface is left without any attached buffer.</summary>
75     /// <param name="buffer">The external buffer, depends on its type.</param>
76     /// <returns><c>true</c> on success, <c>false</c> otherwise</returns>
77     virtual public bool SetNativeBuffer(System.IntPtr buffer) {
78                                  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);
79         Eina.Error.RaiseIfUnhandledException();
80                         return _ret_var;
81  }
82     /// <summary>External buffer attached to this native surface.
83     /// Set to <c>null</c> to detach this surface from the external buffer.</summary>
84     /// <value>The external buffer, depends on its type.</value>
85     public System.IntPtr NativeBuffer {
86         get { return GetNativeBuffer(); }
87         set { SetNativeBuffer(value); }
88     }
89     private static IntPtr GetEflClassStatic()
90     {
91         return Efl.Canvas.Surface.efl_canvas_surface_class_get();
92     }
93     /// <summary>Wrapper for native methods and virtual method delegates.
94     /// For internal use by generated code only.</summary>
95     public new class NativeMethods : Efl.Canvas.ImageInternal.NativeMethods
96     {
97         private static Efl.Eo.NativeModule Module = new Efl.Eo.NativeModule(    efl.Libs.Evas);
98         /// <summary>Gets the list of Eo operations to override.</summary>
99         /// <returns>The list of Eo operations to be overload.</returns>
100         public override System.Collections.Generic.List<Efl_Op_Description> GetEoOps(System.Type type)
101         {
102             var descs = new System.Collections.Generic.List<Efl_Op_Description>();
103             var methods = Efl.Eo.Globals.GetUserMethods(type);
104
105             if (efl_canvas_surface_native_buffer_get_static_delegate == null)
106             {
107                 efl_canvas_surface_native_buffer_get_static_delegate = new efl_canvas_surface_native_buffer_get_delegate(native_buffer_get);
108             }
109
110             if (methods.FirstOrDefault(m => m.Name == "GetNativeBuffer") != null)
111             {
112                 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) });
113             }
114
115             if (efl_canvas_surface_native_buffer_set_static_delegate == null)
116             {
117                 efl_canvas_surface_native_buffer_set_static_delegate = new efl_canvas_surface_native_buffer_set_delegate(native_buffer_set);
118             }
119
120             if (methods.FirstOrDefault(m => m.Name == "SetNativeBuffer") != null)
121             {
122                 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) });
123             }
124
125             descs.AddRange(base.GetEoOps(type));
126             return descs;
127         }
128         /// <summary>Returns the Eo class for the native methods of this class.</summary>
129         /// <returns>The native class pointer.</returns>
130         public override IntPtr GetEflClass()
131         {
132             return Efl.Canvas.Surface.efl_canvas_surface_class_get();
133         }
134
135         #pragma warning disable CA1707, CS1591, SA1300, SA1600
136
137         
138         private delegate System.IntPtr efl_canvas_surface_native_buffer_get_delegate(System.IntPtr obj, System.IntPtr pd);
139
140         
141         public delegate System.IntPtr efl_canvas_surface_native_buffer_get_api_delegate(System.IntPtr obj);
142
143         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");
144
145         private static System.IntPtr native_buffer_get(System.IntPtr obj, System.IntPtr pd)
146         {
147             Eina.Log.Debug("function efl_canvas_surface_native_buffer_get was called");
148             var ws = Efl.Eo.Globals.GetWrapperSupervisor(obj);
149             if (ws != null)
150             {
151             System.IntPtr _ret_var = default(System.IntPtr);
152                 try
153                 {
154                     _ret_var = ((Surface)ws.Target).GetNativeBuffer();
155                 }
156                 catch (Exception e)
157                 {
158                     Eina.Log.Warning($"Callback error: {e.ToString()}");
159                     Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
160                 }
161
162         return _ret_var;
163
164             }
165             else
166             {
167                 return efl_canvas_surface_native_buffer_get_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)));
168             }
169         }
170
171         private static efl_canvas_surface_native_buffer_get_delegate efl_canvas_surface_native_buffer_get_static_delegate;
172
173         [return: MarshalAs(UnmanagedType.U1)]
174         private delegate bool efl_canvas_surface_native_buffer_set_delegate(System.IntPtr obj, System.IntPtr pd,  System.IntPtr buffer);
175
176         [return: MarshalAs(UnmanagedType.U1)]
177         public delegate bool efl_canvas_surface_native_buffer_set_api_delegate(System.IntPtr obj,  System.IntPtr buffer);
178
179         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");
180
181         private static bool native_buffer_set(System.IntPtr obj, System.IntPtr pd, System.IntPtr buffer)
182         {
183             Eina.Log.Debug("function efl_canvas_surface_native_buffer_set was called");
184             var ws = Efl.Eo.Globals.GetWrapperSupervisor(obj);
185             if (ws != null)
186             {
187                                     bool _ret_var = default(bool);
188                 try
189                 {
190                     _ret_var = ((Surface)ws.Target).SetNativeBuffer(buffer);
191                 }
192                 catch (Exception e)
193                 {
194                     Eina.Log.Warning($"Callback error: {e.ToString()}");
195                     Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
196                 }
197
198                         return _ret_var;
199
200             }
201             else
202             {
203                 return efl_canvas_surface_native_buffer_set_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), buffer);
204             }
205         }
206
207         private static efl_canvas_surface_native_buffer_set_delegate efl_canvas_surface_native_buffer_set_static_delegate;
208
209         #pragma warning restore CA1707, CS1591, SA1300, SA1600
210
211 }
212 }
213 }
214
215 }
216