1 #pragma warning disable CS1591
3 using System.Runtime.InteropServices;
4 using System.Collections.Generic;
6 using System.ComponentModel;
7 namespace Efl { namespace Gfx {
8 /// <summary>Efl graphics view interface</summary>
10 public interface View :
11 Efl.Eo.IWrapper, IDisposable
13 /// <summary>The dimensions of this object's viewport.
14 /// This property represents the size of an image (file on disk, vector graphics, GL or 3D scene, ...) view: this is the logical size of a view, not the number of pixels in the buffer, nor its visible size on the window.
16 /// For scalable scenes (vector graphics, 3D or GL), this means scaling the contents of the scene and drawing more pixels as a result; For pixmaps this means zooming and stretching up or down the backing buffer to fit this view.
18 /// In most cases the view should have the same dimensions as the object on the canvas, for best quality.
20 /// <see cref="Efl.Gfx.View.SetViewSize"/> may not be implemented. If it is, it might trigger a complete recalculation of the scene, or reload of the pixel data.
22 /// Refer to each implementing class specific documentation for more details.</summary>
23 /// <returns>Size of the view.</returns>
24 Eina.Size2D GetViewSize();
25 /// <summary>The dimensions of this object's viewport.
26 /// This property represents the size of an image (file on disk, vector graphics, GL or 3D scene, ...) view: this is the logical size of a view, not the number of pixels in the buffer, nor its visible size on the window.
28 /// For scalable scenes (vector graphics, 3D or GL), this means scaling the contents of the scene and drawing more pixels as a result; For pixmaps this means zooming and stretching up or down the backing buffer to fit this view.
30 /// In most cases the view should have the same dimensions as the object on the canvas, for best quality.
32 /// <see cref="Efl.Gfx.View.SetViewSize"/> may not be implemented. If it is, it might trigger a complete recalculation of the scene, or reload of the pixel data.
34 /// Refer to each implementing class specific documentation for more details.</summary>
35 /// <param name="size">Size of the view.</param>
36 /// <returns></returns>
37 void SetViewSize( Eina.Size2D size);
38 /// <summary>The dimensions of this object's viewport.
39 /// This property represents the size of an image (file on disk, vector graphics, GL or 3D scene, ...) view: this is the logical size of a view, not the number of pixels in the buffer, nor its visible size on the window.
41 /// For scalable scenes (vector graphics, 3D or GL), this means scaling the contents of the scene and drawing more pixels as a result; For pixmaps this means zooming and stretching up or down the backing buffer to fit this view.
43 /// In most cases the view should have the same dimensions as the object on the canvas, for best quality.
45 /// <see cref="Efl.Gfx.View.SetViewSize"/> may not be implemented. If it is, it might trigger a complete recalculation of the scene, or reload of the pixel data.
47 /// Refer to each implementing class specific documentation for more details.</summary>
48 /// <value>Size of the view.</value>
49 Eina.Size2D ViewSize {
54 /// <summary>Efl graphics view interface</summary>
55 sealed public class ViewConcrete :
60 ///<summary>Pointer to the native class description.</summary>
61 public System.IntPtr NativeClass {
63 if (((object)this).GetType() == typeof (ViewConcrete))
64 return Efl.Gfx.ViewNativeInherit.GetEflClassStatic();
66 return Efl.Eo.ClassRegister.klassFromType[((object)this).GetType()];
69 private System.IntPtr handle;
70 ///<summary>Pointer to the native instance.</summary>
71 public System.IntPtr NativeHandle {
72 get { return handle; }
74 [System.Runtime.InteropServices.DllImport(efl.Libs.Efl)] internal static extern System.IntPtr
75 efl_gfx_view_interface_get();
76 ///<summary>Internal usage: Constructs an instance from a native pointer. This is used when interacting with C code and should not be used directly.</summary>
77 public ViewConcrete(System.IntPtr raw)
80 register_event_proxies();
82 ///<summary>Destructor.</summary>
87 ///<summary>Releases the underlying native instance.</summary>
88 void Dispose(bool disposing)
90 if (handle != System.IntPtr.Zero) {
91 Efl.Eo.Globals.efl_unref(handle);
92 handle = System.IntPtr.Zero;
95 ///<summary>Releases the underlying native instance.</summary>
99 GC.SuppressFinalize(this);
101 ///<summary>Casts obj into an instance of this type.</summary>
102 public static ViewConcrete static_cast(Efl.Object obj)
105 throw new System.ArgumentNullException("obj");
106 return new ViewConcrete(obj.NativeHandle);
108 ///<summary>Verifies if the given object is equal to this one.</summary>
109 public override bool Equals(object obj)
111 var other = obj as Efl.Object;
114 return this.NativeHandle == other.NativeHandle;
116 ///<summary>Gets the hash code for this object based on the native pointer it points to.</summary>
117 public override int GetHashCode()
119 return this.NativeHandle.ToInt32();
121 ///<summary>Turns the native pointer into a string representation.</summary>
122 public override String ToString()
124 return $"{this.GetType().Name}@[{this.NativeHandle.ToInt32():x}]";
126 void register_event_proxies()
129 /// <summary>The dimensions of this object's viewport.
130 /// This property represents the size of an image (file on disk, vector graphics, GL or 3D scene, ...) view: this is the logical size of a view, not the number of pixels in the buffer, nor its visible size on the window.
132 /// For scalable scenes (vector graphics, 3D or GL), this means scaling the contents of the scene and drawing more pixels as a result; For pixmaps this means zooming and stretching up or down the backing buffer to fit this view.
134 /// In most cases the view should have the same dimensions as the object on the canvas, for best quality.
136 /// <see cref="Efl.Gfx.View.SetViewSize"/> may not be implemented. If it is, it might trigger a complete recalculation of the scene, or reload of the pixel data.
138 /// Refer to each implementing class specific documentation for more details.</summary>
139 /// <returns>Size of the view.</returns>
140 public Eina.Size2D GetViewSize() {
141 var _ret_var = Efl.Gfx.ViewNativeInherit.efl_gfx_view_size_get_ptr.Value.Delegate(this.NativeHandle);
142 Eina.Error.RaiseIfUnhandledException();
143 return Eina.Size2D_StructConversion.ToManaged(_ret_var);
145 /// <summary>The dimensions of this object's viewport.
146 /// This property represents the size of an image (file on disk, vector graphics, GL or 3D scene, ...) view: this is the logical size of a view, not the number of pixels in the buffer, nor its visible size on the window.
148 /// For scalable scenes (vector graphics, 3D or GL), this means scaling the contents of the scene and drawing more pixels as a result; For pixmaps this means zooming and stretching up or down the backing buffer to fit this view.
150 /// In most cases the view should have the same dimensions as the object on the canvas, for best quality.
152 /// <see cref="Efl.Gfx.View.SetViewSize"/> may not be implemented. If it is, it might trigger a complete recalculation of the scene, or reload of the pixel data.
154 /// Refer to each implementing class specific documentation for more details.</summary>
155 /// <param name="size">Size of the view.</param>
156 /// <returns></returns>
157 public void SetViewSize( Eina.Size2D size) {
158 var _in_size = Eina.Size2D_StructConversion.ToInternal(size);
159 Efl.Gfx.ViewNativeInherit.efl_gfx_view_size_set_ptr.Value.Delegate(this.NativeHandle, _in_size);
160 Eina.Error.RaiseIfUnhandledException();
162 /// <summary>The dimensions of this object's viewport.
163 /// This property represents the size of an image (file on disk, vector graphics, GL or 3D scene, ...) view: this is the logical size of a view, not the number of pixels in the buffer, nor its visible size on the window.
165 /// For scalable scenes (vector graphics, 3D or GL), this means scaling the contents of the scene and drawing more pixels as a result; For pixmaps this means zooming and stretching up or down the backing buffer to fit this view.
167 /// In most cases the view should have the same dimensions as the object on the canvas, for best quality.
169 /// <see cref="Efl.Gfx.View.SetViewSize"/> may not be implemented. If it is, it might trigger a complete recalculation of the scene, or reload of the pixel data.
171 /// Refer to each implementing class specific documentation for more details.</summary>
172 /// <value>Size of the view.</value>
173 public Eina.Size2D ViewSize {
174 get { return GetViewSize(); }
175 set { SetViewSize( value); }
178 public class ViewNativeInherit : Efl.Eo.NativeClass{
179 public static Efl.Eo.NativeModule _Module = new Efl.Eo.NativeModule(efl.Libs.Efl);
180 public override System.Collections.Generic.List<Efl_Op_Description> GetEoOps(System.Type type)
182 var descs = new System.Collections.Generic.List<Efl_Op_Description>();
183 if (efl_gfx_view_size_get_static_delegate == null)
184 efl_gfx_view_size_get_static_delegate = new efl_gfx_view_size_get_delegate(view_size_get);
185 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(_Module.Module, "efl_gfx_view_size_get"), func = Marshal.GetFunctionPointerForDelegate(efl_gfx_view_size_get_static_delegate)});
186 if (efl_gfx_view_size_set_static_delegate == null)
187 efl_gfx_view_size_set_static_delegate = new efl_gfx_view_size_set_delegate(view_size_set);
188 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(_Module.Module, "efl_gfx_view_size_set"), func = Marshal.GetFunctionPointerForDelegate(efl_gfx_view_size_set_static_delegate)});
191 public override IntPtr GetEflClass()
193 return Efl.Gfx.ViewConcrete.efl_gfx_view_interface_get();
195 public static IntPtr GetEflClassStatic()
197 return Efl.Gfx.ViewConcrete.efl_gfx_view_interface_get();
201 private delegate Eina.Size2D_StructInternal efl_gfx_view_size_get_delegate(System.IntPtr obj, System.IntPtr pd);
204 public delegate Eina.Size2D_StructInternal efl_gfx_view_size_get_api_delegate(System.IntPtr obj);
205 public static Efl.Eo.FunctionWrapper<efl_gfx_view_size_get_api_delegate> efl_gfx_view_size_get_ptr = new Efl.Eo.FunctionWrapper<efl_gfx_view_size_get_api_delegate>(_Module, "efl_gfx_view_size_get");
206 private static Eina.Size2D_StructInternal view_size_get(System.IntPtr obj, System.IntPtr pd)
208 Eina.Log.Debug("function efl_gfx_view_size_get was called");
209 Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.data_get(pd);
210 if(wrapper != null) {
211 Eina.Size2D _ret_var = default(Eina.Size2D);
213 _ret_var = ((View)wrapper).GetViewSize();
214 } catch (Exception e) {
215 Eina.Log.Warning($"Callback error: {e.ToString()}");
216 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
218 return Eina.Size2D_StructConversion.ToInternal(_ret_var);
220 return efl_gfx_view_size_get_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)));
223 private static efl_gfx_view_size_get_delegate efl_gfx_view_size_get_static_delegate;
226 private delegate void efl_gfx_view_size_set_delegate(System.IntPtr obj, System.IntPtr pd, Eina.Size2D_StructInternal size);
229 public delegate void efl_gfx_view_size_set_api_delegate(System.IntPtr obj, Eina.Size2D_StructInternal size);
230 public static Efl.Eo.FunctionWrapper<efl_gfx_view_size_set_api_delegate> efl_gfx_view_size_set_ptr = new Efl.Eo.FunctionWrapper<efl_gfx_view_size_set_api_delegate>(_Module, "efl_gfx_view_size_set");
231 private static void view_size_set(System.IntPtr obj, System.IntPtr pd, Eina.Size2D_StructInternal size)
233 Eina.Log.Debug("function efl_gfx_view_size_set was called");
234 Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.data_get(pd);
235 if(wrapper != null) {
236 var _in_size = Eina.Size2D_StructConversion.ToManaged(size);
239 ((View)wrapper).SetViewSize( _in_size);
240 } catch (Exception e) {
241 Eina.Log.Warning($"Callback error: {e.ToString()}");
242 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
245 efl_gfx_view_size_set_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), size);
248 private static efl_gfx_view_size_set_delegate efl_gfx_view_size_set_static_delegate;