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>Common APIs for all 2D images that can be rendered on the canvas.</summary>
10 public interface Image :
11 Efl.Eo.IWrapper, IDisposable
13 /// <summary>Whether to use high-quality image scaling algorithm for this image.
14 /// When enabled, a higher quality image scaling algorithm is used when scaling images to sizes other than the source image's original one. This gives better results but is more computationally expensive.
16 /// <c>true</c> by default</summary>
17 /// <returns>Whether to use smooth scale or not.</returns>
18 bool GetSmoothScale();
19 /// <summary>Whether to use high-quality image scaling algorithm for this image.
20 /// When enabled, a higher quality image scaling algorithm is used when scaling images to sizes other than the source image's original one. This gives better results but is more computationally expensive.
22 /// <c>true</c> by default</summary>
23 /// <param name="smooth_scale">Whether to use smooth scale or not.</param>
24 /// <returns></returns>
25 void SetSmoothScale( bool smooth_scale);
26 /// <summary>Control how the image is scaled.</summary>
27 /// <returns>Image scale type</returns>
28 Efl.Gfx.ImageScaleType GetScaleType();
29 /// <summary>Control how the image is scaled.</summary>
30 /// <param name="scale_type">Image scale type</param>
31 /// <returns></returns>
32 void SetScaleType( Efl.Gfx.ImageScaleType scale_type);
33 /// <summary>Returns 1.0 if not applicable (eg. height = 0).</summary>
34 /// <returns>The image's ratio.</returns>
36 /// <summary>Dimensions of this image's border, a region that does not scale with the center area.
37 /// When EFL renders an image, its source may be scaled to fit the size of the object. This function sets an area from the borders of the image inwards which is not to be scaled. This function is useful for making frames and for widget theming, where, for example, buttons may be of varying sizes, but their border size must remain constant.
39 /// The units used for <c>l</c>, <c>r</c>, <c>t</c> and <c>b</c> are canvas units (pixels).
41 /// Note: The border region itself may be scaled by the <see cref="Efl.Gfx.Image.SetBorderScale"/> function.
43 /// Note: By default, image objects have no borders set, i.e. <c>l</c>, <c>r</c>, <c>t</c> and <c>b</c> start as 0.
45 /// Note: Similar to the concepts of 9-patch images or cap insets.</summary>
46 /// <param name="l">The border's left width.</param>
47 /// <param name="r">The border's right width.</param>
48 /// <param name="t">The border's top height.</param>
49 /// <param name="b">The border's bottom height.</param>
50 /// <returns></returns>
51 void GetBorder( out int l, out int r, out int t, out int b);
52 /// <summary>Dimensions of this image's border, a region that does not scale with the center area.
53 /// When EFL renders an image, its source may be scaled to fit the size of the object. This function sets an area from the borders of the image inwards which is not to be scaled. This function is useful for making frames and for widget theming, where, for example, buttons may be of varying sizes, but their border size must remain constant.
55 /// The units used for <c>l</c>, <c>r</c>, <c>t</c> and <c>b</c> are canvas units (pixels).
57 /// Note: The border region itself may be scaled by the <see cref="Efl.Gfx.Image.SetBorderScale"/> function.
59 /// Note: By default, image objects have no borders set, i.e. <c>l</c>, <c>r</c>, <c>t</c> and <c>b</c> start as 0.
61 /// Note: Similar to the concepts of 9-patch images or cap insets.</summary>
62 /// <param name="l">The border's left width.</param>
63 /// <param name="r">The border's right width.</param>
64 /// <param name="t">The border's top height.</param>
65 /// <param name="b">The border's bottom height.</param>
66 /// <returns></returns>
67 void SetBorder( int l, int r, int t, int b);
68 /// <summary>Scaling factor applied to the image borders.
69 /// This value multiplies the size of the <see cref="Efl.Gfx.Image.GetBorder"/> when scaling an object.
71 /// Default value is 1.0 (no scaling).</summary>
72 /// <returns>The scale factor.</returns>
73 double GetBorderScale();
74 /// <summary>Scaling factor applied to the image borders.
75 /// This value multiplies the size of the <see cref="Efl.Gfx.Image.GetBorder"/> when scaling an object.
77 /// Default value is 1.0 (no scaling).</summary>
78 /// <param name="scale">The scale factor.</param>
79 /// <returns></returns>
80 void SetBorderScale( double scale);
81 /// <summary>Specifies how the center part of the object (not the borders) should be drawn when EFL is rendering it.
82 /// This function sets how the center part of the image object's source image is to be drawn, which must be one of the values in <see cref="Efl.Gfx.BorderFillMode"/>. By center we mean the complementary part of that defined by <see cref="Efl.Gfx.Image.GetBorder"/>. This is very useful for making frames and decorations. You would most probably also be using a filled image (as in <see cref="Efl.Gfx.Fill.FillAuto"/>) to use as a frame.
84 /// The default value is <see cref="Efl.Gfx.BorderFillMode.Default"/>, ie. render and scale the center area, respecting its transparency.</summary>
85 /// <returns>Fill mode of the center region.</returns>
86 Efl.Gfx.BorderFillMode GetBorderCenterFill();
87 /// <summary>Specifies how the center part of the object (not the borders) should be drawn when EFL is rendering it.
88 /// This function sets how the center part of the image object's source image is to be drawn, which must be one of the values in <see cref="Efl.Gfx.BorderFillMode"/>. By center we mean the complementary part of that defined by <see cref="Efl.Gfx.Image.GetBorder"/>. This is very useful for making frames and decorations. You would most probably also be using a filled image (as in <see cref="Efl.Gfx.Fill.FillAuto"/>) to use as a frame.
90 /// The default value is <see cref="Efl.Gfx.BorderFillMode.Default"/>, ie. render and scale the center area, respecting its transparency.</summary>
91 /// <param name="fill">Fill mode of the center region.</param>
92 /// <returns></returns>
93 void SetBorderCenterFill( Efl.Gfx.BorderFillMode fill);
94 /// <summary>This represents the size of the original image in pixels.
95 /// This may be different from the actual geometry on screen or even the size of the loaded pixel buffer. This is the size of the image as stored in the original file.
97 /// This is a read-only property, and may return 0x0.
99 /// <returns>The size in pixels.</returns>
100 Eina.Size2D GetImageSize();
101 /// <summary>Get the content hint setting of a given image object of the canvas.
102 /// This returns #EVAS_IMAGE_CONTENT_HINT_NONE on error.</summary>
103 /// <returns>Dynamic or static content hint, see <see cref="Efl.Gfx.ImageContentHint"/></returns>
104 Efl.Gfx.ImageContentHint GetContentHint();
105 /// <summary>Set the content hint setting of a given image object of the canvas.
106 /// This function sets the content hint value of the given image of the canvas. For example, if you're on the GL engine and your driver implementation supports it, setting this hint to #EVAS_IMAGE_CONTENT_HINT_DYNAMIC will make it need zero copies at texture upload time, which is an "expensive" operation.</summary>
107 /// <param name="hint">Dynamic or static content hint, see <see cref="Efl.Gfx.ImageContentHint"/></param>
108 /// <returns></returns>
109 void SetContentHint( Efl.Gfx.ImageContentHint hint);
110 /// <summary>Get the scale hint of a given image of the canvas.
111 /// This function returns the scale hint value of the given image object of the canvas.</summary>
112 /// <returns>Scalable or static size hint, see <see cref="Efl.Gfx.ImageScaleHint"/></returns>
113 Efl.Gfx.ImageScaleHint GetScaleHint();
114 /// <summary>Set the scale hint of a given image of the canvas.
115 /// This function sets the scale hint value of the given image object in the canvas, which will affect how Evas is to cache scaled versions of its original source image.</summary>
116 /// <param name="hint">Scalable or static size hint, see <see cref="Efl.Gfx.ImageScaleHint"/></param>
117 /// <returns></returns>
118 void SetScaleHint( Efl.Gfx.ImageScaleHint hint);
119 /// <summary>Gets the (last) file loading error for a given object.</summary>
120 /// <returns>The load error code.</returns>
121 Efl.Gfx.ImageLoadError GetImageLoadError();
122 /// <summary>Image data has been preloaded.</summary>
123 event EventHandler PreloadEvt;
124 /// <summary>Image was resized (its pixel data).</summary>
125 event EventHandler ResizeEvt;
126 /// <summary>Image data has been unloaded (by some mechanism in EFL that threw out the original image data).</summary>
127 event EventHandler UnloadEvt;
128 /// <summary>Whether to use high-quality image scaling algorithm for this image.
129 /// When enabled, a higher quality image scaling algorithm is used when scaling images to sizes other than the source image's original one. This gives better results but is more computationally expensive.
131 /// <c>true</c> by default</summary>
132 /// <value>Whether to use smooth scale or not.</value>
137 /// <summary>Control how the image is scaled.</summary>
138 /// <value>Image scale type</value>
139 Efl.Gfx.ImageScaleType ScaleType {
143 /// <summary>The native width/height ratio of the image.</summary>
144 /// <value>The image's ratio.</value>
148 /// <summary>Scaling factor applied to the image borders.
149 /// This value multiplies the size of the <see cref="Efl.Gfx.Image.GetBorder"/> when scaling an object.
151 /// Default value is 1.0 (no scaling).</summary>
152 /// <value>The scale factor.</value>
157 /// <summary>Specifies how the center part of the object (not the borders) should be drawn when EFL is rendering it.
158 /// This function sets how the center part of the image object's source image is to be drawn, which must be one of the values in <see cref="Efl.Gfx.BorderFillMode"/>. By center we mean the complementary part of that defined by <see cref="Efl.Gfx.Image.GetBorder"/>. This is very useful for making frames and decorations. You would most probably also be using a filled image (as in <see cref="Efl.Gfx.Fill.FillAuto"/>) to use as a frame.
160 /// The default value is <see cref="Efl.Gfx.BorderFillMode.Default"/>, ie. render and scale the center area, respecting its transparency.</summary>
161 /// <value>Fill mode of the center region.</value>
162 Efl.Gfx.BorderFillMode BorderCenterFill {
166 /// <summary>This represents the size of the original image in pixels.
167 /// This may be different from the actual geometry on screen or even the size of the loaded pixel buffer. This is the size of the image as stored in the original file.
169 /// This is a read-only property, and may return 0x0.
171 /// <value>The size in pixels.</value>
172 Eina.Size2D ImageSize {
175 /// <summary>Get the content hint setting of a given image object of the canvas.
176 /// This returns #EVAS_IMAGE_CONTENT_HINT_NONE on error.</summary>
177 /// <value>Dynamic or static content hint, see <see cref="Efl.Gfx.ImageContentHint"/></value>
178 Efl.Gfx.ImageContentHint ContentHint {
182 /// <summary>Get the scale hint of a given image of the canvas.
183 /// This function returns the scale hint value of the given image object of the canvas.</summary>
184 /// <value>Scalable or static size hint, see <see cref="Efl.Gfx.ImageScaleHint"/></value>
185 Efl.Gfx.ImageScaleHint ScaleHint {
189 /// <summary>Gets the (last) file loading error for a given object.</summary>
190 /// <value>The load error code.</value>
191 Efl.Gfx.ImageLoadError ImageLoadError {
195 /// <summary>Common APIs for all 2D images that can be rendered on the canvas.</summary>
196 sealed public class ImageConcrete :
201 ///<summary>Pointer to the native class description.</summary>
202 public System.IntPtr NativeClass {
204 if (((object)this).GetType() == typeof (ImageConcrete))
205 return Efl.Gfx.ImageNativeInherit.GetEflClassStatic();
207 return Efl.Eo.ClassRegister.klassFromType[((object)this).GetType()];
210 private EventHandlerList eventHandlers = new EventHandlerList();
211 private System.IntPtr handle;
212 ///<summary>Pointer to the native instance.</summary>
213 public System.IntPtr NativeHandle {
214 get { return handle; }
216 [System.Runtime.InteropServices.DllImport(efl.Libs.Efl)] internal static extern System.IntPtr
217 efl_gfx_image_interface_get();
218 ///<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>
219 public ImageConcrete(System.IntPtr raw)
222 register_event_proxies();
224 ///<summary>Destructor.</summary>
229 ///<summary>Releases the underlying native instance.</summary>
230 void Dispose(bool disposing)
232 if (handle != System.IntPtr.Zero) {
233 Efl.Eo.Globals.efl_unref(handle);
234 handle = System.IntPtr.Zero;
237 ///<summary>Releases the underlying native instance.</summary>
238 public void Dispose()
241 GC.SuppressFinalize(this);
243 ///<summary>Casts obj into an instance of this type.</summary>
244 public static ImageConcrete static_cast(Efl.Object obj)
247 throw new System.ArgumentNullException("obj");
248 return new ImageConcrete(obj.NativeHandle);
250 ///<summary>Verifies if the given object is equal to this one.</summary>
251 public override bool Equals(object obj)
253 var other = obj as Efl.Object;
256 return this.NativeHandle == other.NativeHandle;
258 ///<summary>Gets the hash code for this object based on the native pointer it points to.</summary>
259 public override int GetHashCode()
261 return this.NativeHandle.ToInt32();
263 ///<summary>Turns the native pointer into a string representation.</summary>
264 public override String ToString()
266 return $"{this.GetType().Name}@[{this.NativeHandle.ToInt32():x}]";
268 private readonly object eventLock = new object();
269 private Dictionary<string, int> event_cb_count = new Dictionary<string, int>();
270 private bool add_cpp_event_handler(string lib, string key, Efl.EventCb evt_delegate) {
272 if (!event_cb_count.TryGetValue(key, out event_count))
273 event_cb_count[key] = event_count;
274 if (event_count == 0) {
275 IntPtr desc = Efl.EventDescription.GetNative(lib, key);
276 if (desc == IntPtr.Zero) {
277 Eina.Log.Error($"Failed to get native event {key}");
280 bool result = Efl.Eo.Globals.efl_event_callback_priority_add(handle, desc, 0, evt_delegate, System.IntPtr.Zero);
282 Eina.Log.Error($"Failed to add event proxy for event {key}");
285 Eina.Error.RaiseIfUnhandledException();
287 event_cb_count[key]++;
290 private bool remove_cpp_event_handler(string key, Efl.EventCb evt_delegate) {
292 if (!event_cb_count.TryGetValue(key, out event_count))
293 event_cb_count[key] = event_count;
294 if (event_count == 1) {
295 IntPtr desc = Efl.EventDescription.GetNative(efl.Libs.Efl, key);
296 if (desc == IntPtr.Zero) {
297 Eina.Log.Error($"Failed to get native event {key}");
300 bool result = Efl.Eo.Globals.efl_event_callback_del(handle, desc, evt_delegate, System.IntPtr.Zero);
302 Eina.Log.Error($"Failed to remove event proxy for event {key}");
305 Eina.Error.RaiseIfUnhandledException();
306 } else if (event_count == 0) {
307 Eina.Log.Error($"Trying to remove proxy for event {key} when there is nothing registered.");
310 event_cb_count[key]--;
313 private static object PreloadEvtKey = new object();
314 /// <summary>Image data has been preloaded.</summary>
315 public event EventHandler PreloadEvt
319 string key = "_EFL_GFX_IMAGE_EVENT_PRELOAD";
320 if (add_cpp_event_handler(efl.Libs.Efl, key, this.evt_PreloadEvt_delegate)) {
321 eventHandlers.AddHandler(PreloadEvtKey , value);
323 Eina.Log.Error($"Error adding proxy for event {key}");
328 string key = "_EFL_GFX_IMAGE_EVENT_PRELOAD";
329 if (remove_cpp_event_handler(key, this.evt_PreloadEvt_delegate)) {
330 eventHandlers.RemoveHandler(PreloadEvtKey , value);
332 Eina.Log.Error($"Error removing proxy for event {key}");
336 ///<summary>Method to raise event PreloadEvt.</summary>
337 public void On_PreloadEvt(EventArgs e)
341 evt = (EventHandler)eventHandlers[PreloadEvtKey];
343 evt?.Invoke(this, e);
345 Efl.EventCb evt_PreloadEvt_delegate;
346 private void on_PreloadEvt_NativeCallback(System.IntPtr data, ref Efl.Event_StructInternal evt)
348 EventArgs args = EventArgs.Empty;
351 } catch (Exception e) {
352 Eina.Log.Error(e.ToString());
353 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
357 private static object ResizeEvtKey = new object();
358 /// <summary>Image was resized (its pixel data).</summary>
359 public event EventHandler ResizeEvt
363 string key = "_EFL_GFX_IMAGE_EVENT_RESIZE";
364 if (add_cpp_event_handler(efl.Libs.Efl, key, this.evt_ResizeEvt_delegate)) {
365 eventHandlers.AddHandler(ResizeEvtKey , value);
367 Eina.Log.Error($"Error adding proxy for event {key}");
372 string key = "_EFL_GFX_IMAGE_EVENT_RESIZE";
373 if (remove_cpp_event_handler(key, this.evt_ResizeEvt_delegate)) {
374 eventHandlers.RemoveHandler(ResizeEvtKey , value);
376 Eina.Log.Error($"Error removing proxy for event {key}");
380 ///<summary>Method to raise event ResizeEvt.</summary>
381 public void On_ResizeEvt(EventArgs e)
385 evt = (EventHandler)eventHandlers[ResizeEvtKey];
387 evt?.Invoke(this, e);
389 Efl.EventCb evt_ResizeEvt_delegate;
390 private void on_ResizeEvt_NativeCallback(System.IntPtr data, ref Efl.Event_StructInternal evt)
392 EventArgs args = EventArgs.Empty;
395 } catch (Exception e) {
396 Eina.Log.Error(e.ToString());
397 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
401 private static object UnloadEvtKey = new object();
402 /// <summary>Image data has been unloaded (by some mechanism in EFL that threw out the original image data).</summary>
403 public event EventHandler UnloadEvt
407 string key = "_EFL_GFX_IMAGE_EVENT_UNLOAD";
408 if (add_cpp_event_handler(efl.Libs.Efl, key, this.evt_UnloadEvt_delegate)) {
409 eventHandlers.AddHandler(UnloadEvtKey , value);
411 Eina.Log.Error($"Error adding proxy for event {key}");
416 string key = "_EFL_GFX_IMAGE_EVENT_UNLOAD";
417 if (remove_cpp_event_handler(key, this.evt_UnloadEvt_delegate)) {
418 eventHandlers.RemoveHandler(UnloadEvtKey , value);
420 Eina.Log.Error($"Error removing proxy for event {key}");
424 ///<summary>Method to raise event UnloadEvt.</summary>
425 public void On_UnloadEvt(EventArgs e)
429 evt = (EventHandler)eventHandlers[UnloadEvtKey];
431 evt?.Invoke(this, e);
433 Efl.EventCb evt_UnloadEvt_delegate;
434 private void on_UnloadEvt_NativeCallback(System.IntPtr data, ref Efl.Event_StructInternal evt)
436 EventArgs args = EventArgs.Empty;
439 } catch (Exception e) {
440 Eina.Log.Error(e.ToString());
441 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
445 void register_event_proxies()
447 evt_PreloadEvt_delegate = new Efl.EventCb(on_PreloadEvt_NativeCallback);
448 evt_ResizeEvt_delegate = new Efl.EventCb(on_ResizeEvt_NativeCallback);
449 evt_UnloadEvt_delegate = new Efl.EventCb(on_UnloadEvt_NativeCallback);
451 /// <summary>Whether to use high-quality image scaling algorithm for this image.
452 /// When enabled, a higher quality image scaling algorithm is used when scaling images to sizes other than the source image's original one. This gives better results but is more computationally expensive.
454 /// <c>true</c> by default</summary>
455 /// <returns>Whether to use smooth scale or not.</returns>
456 public bool GetSmoothScale() {
457 var _ret_var = Efl.Gfx.ImageNativeInherit.efl_gfx_image_smooth_scale_get_ptr.Value.Delegate(this.NativeHandle);
458 Eina.Error.RaiseIfUnhandledException();
461 /// <summary>Whether to use high-quality image scaling algorithm for this image.
462 /// When enabled, a higher quality image scaling algorithm is used when scaling images to sizes other than the source image's original one. This gives better results but is more computationally expensive.
464 /// <c>true</c> by default</summary>
465 /// <param name="smooth_scale">Whether to use smooth scale or not.</param>
466 /// <returns></returns>
467 public void SetSmoothScale( bool smooth_scale) {
468 Efl.Gfx.ImageNativeInherit.efl_gfx_image_smooth_scale_set_ptr.Value.Delegate(this.NativeHandle, smooth_scale);
469 Eina.Error.RaiseIfUnhandledException();
471 /// <summary>Control how the image is scaled.</summary>
472 /// <returns>Image scale type</returns>
473 public Efl.Gfx.ImageScaleType GetScaleType() {
474 var _ret_var = Efl.Gfx.ImageNativeInherit.efl_gfx_image_scale_type_get_ptr.Value.Delegate(this.NativeHandle);
475 Eina.Error.RaiseIfUnhandledException();
478 /// <summary>Control how the image is scaled.</summary>
479 /// <param name="scale_type">Image scale type</param>
480 /// <returns></returns>
481 public void SetScaleType( Efl.Gfx.ImageScaleType scale_type) {
482 Efl.Gfx.ImageNativeInherit.efl_gfx_image_scale_type_set_ptr.Value.Delegate(this.NativeHandle, scale_type);
483 Eina.Error.RaiseIfUnhandledException();
485 /// <summary>Returns 1.0 if not applicable (eg. height = 0).</summary>
486 /// <returns>The image's ratio.</returns>
487 public double GetRatio() {
488 var _ret_var = Efl.Gfx.ImageNativeInherit.efl_gfx_image_ratio_get_ptr.Value.Delegate(this.NativeHandle);
489 Eina.Error.RaiseIfUnhandledException();
492 /// <summary>Dimensions of this image's border, a region that does not scale with the center area.
493 /// When EFL renders an image, its source may be scaled to fit the size of the object. This function sets an area from the borders of the image inwards which is not to be scaled. This function is useful for making frames and for widget theming, where, for example, buttons may be of varying sizes, but their border size must remain constant.
495 /// The units used for <c>l</c>, <c>r</c>, <c>t</c> and <c>b</c> are canvas units (pixels).
497 /// Note: The border region itself may be scaled by the <see cref="Efl.Gfx.Image.SetBorderScale"/> function.
499 /// Note: By default, image objects have no borders set, i.e. <c>l</c>, <c>r</c>, <c>t</c> and <c>b</c> start as 0.
501 /// Note: Similar to the concepts of 9-patch images or cap insets.</summary>
502 /// <param name="l">The border's left width.</param>
503 /// <param name="r">The border's right width.</param>
504 /// <param name="t">The border's top height.</param>
505 /// <param name="b">The border's bottom height.</param>
506 /// <returns></returns>
507 public void GetBorder( out int l, out int r, out int t, out int b) {
508 Efl.Gfx.ImageNativeInherit.efl_gfx_image_border_get_ptr.Value.Delegate(this.NativeHandle, out l, out r, out t, out b);
509 Eina.Error.RaiseIfUnhandledException();
511 /// <summary>Dimensions of this image's border, a region that does not scale with the center area.
512 /// When EFL renders an image, its source may be scaled to fit the size of the object. This function sets an area from the borders of the image inwards which is not to be scaled. This function is useful for making frames and for widget theming, where, for example, buttons may be of varying sizes, but their border size must remain constant.
514 /// The units used for <c>l</c>, <c>r</c>, <c>t</c> and <c>b</c> are canvas units (pixels).
516 /// Note: The border region itself may be scaled by the <see cref="Efl.Gfx.Image.SetBorderScale"/> function.
518 /// Note: By default, image objects have no borders set, i.e. <c>l</c>, <c>r</c>, <c>t</c> and <c>b</c> start as 0.
520 /// Note: Similar to the concepts of 9-patch images or cap insets.</summary>
521 /// <param name="l">The border's left width.</param>
522 /// <param name="r">The border's right width.</param>
523 /// <param name="t">The border's top height.</param>
524 /// <param name="b">The border's bottom height.</param>
525 /// <returns></returns>
526 public void SetBorder( int l, int r, int t, int b) {
527 Efl.Gfx.ImageNativeInherit.efl_gfx_image_border_set_ptr.Value.Delegate(this.NativeHandle, l, r, t, b);
528 Eina.Error.RaiseIfUnhandledException();
530 /// <summary>Scaling factor applied to the image borders.
531 /// This value multiplies the size of the <see cref="Efl.Gfx.Image.GetBorder"/> when scaling an object.
533 /// Default value is 1.0 (no scaling).</summary>
534 /// <returns>The scale factor.</returns>
535 public double GetBorderScale() {
536 var _ret_var = Efl.Gfx.ImageNativeInherit.efl_gfx_image_border_scale_get_ptr.Value.Delegate(this.NativeHandle);
537 Eina.Error.RaiseIfUnhandledException();
540 /// <summary>Scaling factor applied to the image borders.
541 /// This value multiplies the size of the <see cref="Efl.Gfx.Image.GetBorder"/> when scaling an object.
543 /// Default value is 1.0 (no scaling).</summary>
544 /// <param name="scale">The scale factor.</param>
545 /// <returns></returns>
546 public void SetBorderScale( double scale) {
547 Efl.Gfx.ImageNativeInherit.efl_gfx_image_border_scale_set_ptr.Value.Delegate(this.NativeHandle, scale);
548 Eina.Error.RaiseIfUnhandledException();
550 /// <summary>Specifies how the center part of the object (not the borders) should be drawn when EFL is rendering it.
551 /// This function sets how the center part of the image object's source image is to be drawn, which must be one of the values in <see cref="Efl.Gfx.BorderFillMode"/>. By center we mean the complementary part of that defined by <see cref="Efl.Gfx.Image.GetBorder"/>. This is very useful for making frames and decorations. You would most probably also be using a filled image (as in <see cref="Efl.Gfx.Fill.FillAuto"/>) to use as a frame.
553 /// The default value is <see cref="Efl.Gfx.BorderFillMode.Default"/>, ie. render and scale the center area, respecting its transparency.</summary>
554 /// <returns>Fill mode of the center region.</returns>
555 public Efl.Gfx.BorderFillMode GetBorderCenterFill() {
556 var _ret_var = Efl.Gfx.ImageNativeInherit.efl_gfx_image_border_center_fill_get_ptr.Value.Delegate(this.NativeHandle);
557 Eina.Error.RaiseIfUnhandledException();
560 /// <summary>Specifies how the center part of the object (not the borders) should be drawn when EFL is rendering it.
561 /// This function sets how the center part of the image object's source image is to be drawn, which must be one of the values in <see cref="Efl.Gfx.BorderFillMode"/>. By center we mean the complementary part of that defined by <see cref="Efl.Gfx.Image.GetBorder"/>. This is very useful for making frames and decorations. You would most probably also be using a filled image (as in <see cref="Efl.Gfx.Fill.FillAuto"/>) to use as a frame.
563 /// The default value is <see cref="Efl.Gfx.BorderFillMode.Default"/>, ie. render and scale the center area, respecting its transparency.</summary>
564 /// <param name="fill">Fill mode of the center region.</param>
565 /// <returns></returns>
566 public void SetBorderCenterFill( Efl.Gfx.BorderFillMode fill) {
567 Efl.Gfx.ImageNativeInherit.efl_gfx_image_border_center_fill_set_ptr.Value.Delegate(this.NativeHandle, fill);
568 Eina.Error.RaiseIfUnhandledException();
570 /// <summary>This represents the size of the original image in pixels.
571 /// This may be different from the actual geometry on screen or even the size of the loaded pixel buffer. This is the size of the image as stored in the original file.
573 /// This is a read-only property, and may return 0x0.
575 /// <returns>The size in pixels.</returns>
576 public Eina.Size2D GetImageSize() {
577 var _ret_var = Efl.Gfx.ImageNativeInherit.efl_gfx_image_size_get_ptr.Value.Delegate(this.NativeHandle);
578 Eina.Error.RaiseIfUnhandledException();
579 return Eina.Size2D_StructConversion.ToManaged(_ret_var);
581 /// <summary>Get the content hint setting of a given image object of the canvas.
582 /// This returns #EVAS_IMAGE_CONTENT_HINT_NONE on error.</summary>
583 /// <returns>Dynamic or static content hint, see <see cref="Efl.Gfx.ImageContentHint"/></returns>
584 public Efl.Gfx.ImageContentHint GetContentHint() {
585 var _ret_var = Efl.Gfx.ImageNativeInherit.efl_gfx_image_content_hint_get_ptr.Value.Delegate(this.NativeHandle);
586 Eina.Error.RaiseIfUnhandledException();
589 /// <summary>Set the content hint setting of a given image object of the canvas.
590 /// This function sets the content hint value of the given image of the canvas. For example, if you're on the GL engine and your driver implementation supports it, setting this hint to #EVAS_IMAGE_CONTENT_HINT_DYNAMIC will make it need zero copies at texture upload time, which is an "expensive" operation.</summary>
591 /// <param name="hint">Dynamic or static content hint, see <see cref="Efl.Gfx.ImageContentHint"/></param>
592 /// <returns></returns>
593 public void SetContentHint( Efl.Gfx.ImageContentHint hint) {
594 Efl.Gfx.ImageNativeInherit.efl_gfx_image_content_hint_set_ptr.Value.Delegate(this.NativeHandle, hint);
595 Eina.Error.RaiseIfUnhandledException();
597 /// <summary>Get the scale hint of a given image of the canvas.
598 /// This function returns the scale hint value of the given image object of the canvas.</summary>
599 /// <returns>Scalable or static size hint, see <see cref="Efl.Gfx.ImageScaleHint"/></returns>
600 public Efl.Gfx.ImageScaleHint GetScaleHint() {
601 var _ret_var = Efl.Gfx.ImageNativeInherit.efl_gfx_image_scale_hint_get_ptr.Value.Delegate(this.NativeHandle);
602 Eina.Error.RaiseIfUnhandledException();
605 /// <summary>Set the scale hint of a given image of the canvas.
606 /// This function sets the scale hint value of the given image object in the canvas, which will affect how Evas is to cache scaled versions of its original source image.</summary>
607 /// <param name="hint">Scalable or static size hint, see <see cref="Efl.Gfx.ImageScaleHint"/></param>
608 /// <returns></returns>
609 public void SetScaleHint( Efl.Gfx.ImageScaleHint hint) {
610 Efl.Gfx.ImageNativeInherit.efl_gfx_image_scale_hint_set_ptr.Value.Delegate(this.NativeHandle, hint);
611 Eina.Error.RaiseIfUnhandledException();
613 /// <summary>Gets the (last) file loading error for a given object.</summary>
614 /// <returns>The load error code.</returns>
615 public Efl.Gfx.ImageLoadError GetImageLoadError() {
616 var _ret_var = Efl.Gfx.ImageNativeInherit.efl_gfx_image_load_error_get_ptr.Value.Delegate(this.NativeHandle);
617 Eina.Error.RaiseIfUnhandledException();
620 /// <summary>Whether to use high-quality image scaling algorithm for this image.
621 /// When enabled, a higher quality image scaling algorithm is used when scaling images to sizes other than the source image's original one. This gives better results but is more computationally expensive.
623 /// <c>true</c> by default</summary>
624 /// <value>Whether to use smooth scale or not.</value>
625 public bool SmoothScale {
626 get { return GetSmoothScale(); }
627 set { SetSmoothScale( value); }
629 /// <summary>Control how the image is scaled.</summary>
630 /// <value>Image scale type</value>
631 public Efl.Gfx.ImageScaleType ScaleType {
632 get { return GetScaleType(); }
633 set { SetScaleType( value); }
635 /// <summary>The native width/height ratio of the image.</summary>
636 /// <value>The image's ratio.</value>
637 public double Ratio {
638 get { return GetRatio(); }
640 /// <summary>Scaling factor applied to the image borders.
641 /// This value multiplies the size of the <see cref="Efl.Gfx.Image.GetBorder"/> when scaling an object.
643 /// Default value is 1.0 (no scaling).</summary>
644 /// <value>The scale factor.</value>
645 public double BorderScale {
646 get { return GetBorderScale(); }
647 set { SetBorderScale( value); }
649 /// <summary>Specifies how the center part of the object (not the borders) should be drawn when EFL is rendering it.
650 /// This function sets how the center part of the image object's source image is to be drawn, which must be one of the values in <see cref="Efl.Gfx.BorderFillMode"/>. By center we mean the complementary part of that defined by <see cref="Efl.Gfx.Image.GetBorder"/>. This is very useful for making frames and decorations. You would most probably also be using a filled image (as in <see cref="Efl.Gfx.Fill.FillAuto"/>) to use as a frame.
652 /// The default value is <see cref="Efl.Gfx.BorderFillMode.Default"/>, ie. render and scale the center area, respecting its transparency.</summary>
653 /// <value>Fill mode of the center region.</value>
654 public Efl.Gfx.BorderFillMode BorderCenterFill {
655 get { return GetBorderCenterFill(); }
656 set { SetBorderCenterFill( value); }
658 /// <summary>This represents the size of the original image in pixels.
659 /// This may be different from the actual geometry on screen or even the size of the loaded pixel buffer. This is the size of the image as stored in the original file.
661 /// This is a read-only property, and may return 0x0.
663 /// <value>The size in pixels.</value>
664 public Eina.Size2D ImageSize {
665 get { return GetImageSize(); }
667 /// <summary>Get the content hint setting of a given image object of the canvas.
668 /// This returns #EVAS_IMAGE_CONTENT_HINT_NONE on error.</summary>
669 /// <value>Dynamic or static content hint, see <see cref="Efl.Gfx.ImageContentHint"/></value>
670 public Efl.Gfx.ImageContentHint ContentHint {
671 get { return GetContentHint(); }
672 set { SetContentHint( value); }
674 /// <summary>Get the scale hint of a given image of the canvas.
675 /// This function returns the scale hint value of the given image object of the canvas.</summary>
676 /// <value>Scalable or static size hint, see <see cref="Efl.Gfx.ImageScaleHint"/></value>
677 public Efl.Gfx.ImageScaleHint ScaleHint {
678 get { return GetScaleHint(); }
679 set { SetScaleHint( value); }
681 /// <summary>Gets the (last) file loading error for a given object.</summary>
682 /// <value>The load error code.</value>
683 public Efl.Gfx.ImageLoadError ImageLoadError {
684 get { return GetImageLoadError(); }
687 public class ImageNativeInherit : Efl.Eo.NativeClass{
688 public static Efl.Eo.NativeModule _Module = new Efl.Eo.NativeModule(efl.Libs.Efl);
689 public override System.Collections.Generic.List<Efl_Op_Description> GetEoOps(System.Type type)
691 var descs = new System.Collections.Generic.List<Efl_Op_Description>();
692 if (efl_gfx_image_smooth_scale_get_static_delegate == null)
693 efl_gfx_image_smooth_scale_get_static_delegate = new efl_gfx_image_smooth_scale_get_delegate(smooth_scale_get);
694 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(_Module.Module, "efl_gfx_image_smooth_scale_get"), func = Marshal.GetFunctionPointerForDelegate(efl_gfx_image_smooth_scale_get_static_delegate)});
695 if (efl_gfx_image_smooth_scale_set_static_delegate == null)
696 efl_gfx_image_smooth_scale_set_static_delegate = new efl_gfx_image_smooth_scale_set_delegate(smooth_scale_set);
697 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(_Module.Module, "efl_gfx_image_smooth_scale_set"), func = Marshal.GetFunctionPointerForDelegate(efl_gfx_image_smooth_scale_set_static_delegate)});
698 if (efl_gfx_image_scale_type_get_static_delegate == null)
699 efl_gfx_image_scale_type_get_static_delegate = new efl_gfx_image_scale_type_get_delegate(scale_type_get);
700 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(_Module.Module, "efl_gfx_image_scale_type_get"), func = Marshal.GetFunctionPointerForDelegate(efl_gfx_image_scale_type_get_static_delegate)});
701 if (efl_gfx_image_scale_type_set_static_delegate == null)
702 efl_gfx_image_scale_type_set_static_delegate = new efl_gfx_image_scale_type_set_delegate(scale_type_set);
703 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(_Module.Module, "efl_gfx_image_scale_type_set"), func = Marshal.GetFunctionPointerForDelegate(efl_gfx_image_scale_type_set_static_delegate)});
704 if (efl_gfx_image_ratio_get_static_delegate == null)
705 efl_gfx_image_ratio_get_static_delegate = new efl_gfx_image_ratio_get_delegate(ratio_get);
706 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(_Module.Module, "efl_gfx_image_ratio_get"), func = Marshal.GetFunctionPointerForDelegate(efl_gfx_image_ratio_get_static_delegate)});
707 if (efl_gfx_image_border_get_static_delegate == null)
708 efl_gfx_image_border_get_static_delegate = new efl_gfx_image_border_get_delegate(border_get);
709 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(_Module.Module, "efl_gfx_image_border_get"), func = Marshal.GetFunctionPointerForDelegate(efl_gfx_image_border_get_static_delegate)});
710 if (efl_gfx_image_border_set_static_delegate == null)
711 efl_gfx_image_border_set_static_delegate = new efl_gfx_image_border_set_delegate(border_set);
712 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(_Module.Module, "efl_gfx_image_border_set"), func = Marshal.GetFunctionPointerForDelegate(efl_gfx_image_border_set_static_delegate)});
713 if (efl_gfx_image_border_scale_get_static_delegate == null)
714 efl_gfx_image_border_scale_get_static_delegate = new efl_gfx_image_border_scale_get_delegate(border_scale_get);
715 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(_Module.Module, "efl_gfx_image_border_scale_get"), func = Marshal.GetFunctionPointerForDelegate(efl_gfx_image_border_scale_get_static_delegate)});
716 if (efl_gfx_image_border_scale_set_static_delegate == null)
717 efl_gfx_image_border_scale_set_static_delegate = new efl_gfx_image_border_scale_set_delegate(border_scale_set);
718 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(_Module.Module, "efl_gfx_image_border_scale_set"), func = Marshal.GetFunctionPointerForDelegate(efl_gfx_image_border_scale_set_static_delegate)});
719 if (efl_gfx_image_border_center_fill_get_static_delegate == null)
720 efl_gfx_image_border_center_fill_get_static_delegate = new efl_gfx_image_border_center_fill_get_delegate(border_center_fill_get);
721 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(_Module.Module, "efl_gfx_image_border_center_fill_get"), func = Marshal.GetFunctionPointerForDelegate(efl_gfx_image_border_center_fill_get_static_delegate)});
722 if (efl_gfx_image_border_center_fill_set_static_delegate == null)
723 efl_gfx_image_border_center_fill_set_static_delegate = new efl_gfx_image_border_center_fill_set_delegate(border_center_fill_set);
724 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(_Module.Module, "efl_gfx_image_border_center_fill_set"), func = Marshal.GetFunctionPointerForDelegate(efl_gfx_image_border_center_fill_set_static_delegate)});
725 if (efl_gfx_image_size_get_static_delegate == null)
726 efl_gfx_image_size_get_static_delegate = new efl_gfx_image_size_get_delegate(image_size_get);
727 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(_Module.Module, "efl_gfx_image_size_get"), func = Marshal.GetFunctionPointerForDelegate(efl_gfx_image_size_get_static_delegate)});
728 if (efl_gfx_image_content_hint_get_static_delegate == null)
729 efl_gfx_image_content_hint_get_static_delegate = new efl_gfx_image_content_hint_get_delegate(content_hint_get);
730 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(_Module.Module, "efl_gfx_image_content_hint_get"), func = Marshal.GetFunctionPointerForDelegate(efl_gfx_image_content_hint_get_static_delegate)});
731 if (efl_gfx_image_content_hint_set_static_delegate == null)
732 efl_gfx_image_content_hint_set_static_delegate = new efl_gfx_image_content_hint_set_delegate(content_hint_set);
733 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(_Module.Module, "efl_gfx_image_content_hint_set"), func = Marshal.GetFunctionPointerForDelegate(efl_gfx_image_content_hint_set_static_delegate)});
734 if (efl_gfx_image_scale_hint_get_static_delegate == null)
735 efl_gfx_image_scale_hint_get_static_delegate = new efl_gfx_image_scale_hint_get_delegate(scale_hint_get);
736 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(_Module.Module, "efl_gfx_image_scale_hint_get"), func = Marshal.GetFunctionPointerForDelegate(efl_gfx_image_scale_hint_get_static_delegate)});
737 if (efl_gfx_image_scale_hint_set_static_delegate == null)
738 efl_gfx_image_scale_hint_set_static_delegate = new efl_gfx_image_scale_hint_set_delegate(scale_hint_set);
739 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(_Module.Module, "efl_gfx_image_scale_hint_set"), func = Marshal.GetFunctionPointerForDelegate(efl_gfx_image_scale_hint_set_static_delegate)});
740 if (efl_gfx_image_load_error_get_static_delegate == null)
741 efl_gfx_image_load_error_get_static_delegate = new efl_gfx_image_load_error_get_delegate(image_load_error_get);
742 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(_Module.Module, "efl_gfx_image_load_error_get"), func = Marshal.GetFunctionPointerForDelegate(efl_gfx_image_load_error_get_static_delegate)});
745 public override IntPtr GetEflClass()
747 return Efl.Gfx.ImageConcrete.efl_gfx_image_interface_get();
749 public static IntPtr GetEflClassStatic()
751 return Efl.Gfx.ImageConcrete.efl_gfx_image_interface_get();
755 [return: MarshalAs(UnmanagedType.U1)] private delegate bool efl_gfx_image_smooth_scale_get_delegate(System.IntPtr obj, System.IntPtr pd);
758 [return: MarshalAs(UnmanagedType.U1)] public delegate bool efl_gfx_image_smooth_scale_get_api_delegate(System.IntPtr obj);
759 public static Efl.Eo.FunctionWrapper<efl_gfx_image_smooth_scale_get_api_delegate> efl_gfx_image_smooth_scale_get_ptr = new Efl.Eo.FunctionWrapper<efl_gfx_image_smooth_scale_get_api_delegate>(_Module, "efl_gfx_image_smooth_scale_get");
760 private static bool smooth_scale_get(System.IntPtr obj, System.IntPtr pd)
762 Eina.Log.Debug("function efl_gfx_image_smooth_scale_get was called");
763 Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.data_get(pd);
764 if(wrapper != null) {
765 bool _ret_var = default(bool);
767 _ret_var = ((Image)wrapper).GetSmoothScale();
768 } catch (Exception e) {
769 Eina.Log.Warning($"Callback error: {e.ToString()}");
770 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
774 return efl_gfx_image_smooth_scale_get_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)));
777 private static efl_gfx_image_smooth_scale_get_delegate efl_gfx_image_smooth_scale_get_static_delegate;
780 private delegate void efl_gfx_image_smooth_scale_set_delegate(System.IntPtr obj, System.IntPtr pd, [MarshalAs(UnmanagedType.U1)] bool smooth_scale);
783 public delegate void efl_gfx_image_smooth_scale_set_api_delegate(System.IntPtr obj, [MarshalAs(UnmanagedType.U1)] bool smooth_scale);
784 public static Efl.Eo.FunctionWrapper<efl_gfx_image_smooth_scale_set_api_delegate> efl_gfx_image_smooth_scale_set_ptr = new Efl.Eo.FunctionWrapper<efl_gfx_image_smooth_scale_set_api_delegate>(_Module, "efl_gfx_image_smooth_scale_set");
785 private static void smooth_scale_set(System.IntPtr obj, System.IntPtr pd, bool smooth_scale)
787 Eina.Log.Debug("function efl_gfx_image_smooth_scale_set was called");
788 Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.data_get(pd);
789 if(wrapper != null) {
792 ((Image)wrapper).SetSmoothScale( smooth_scale);
793 } catch (Exception e) {
794 Eina.Log.Warning($"Callback error: {e.ToString()}");
795 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
798 efl_gfx_image_smooth_scale_set_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), smooth_scale);
801 private static efl_gfx_image_smooth_scale_set_delegate efl_gfx_image_smooth_scale_set_static_delegate;
804 private delegate Efl.Gfx.ImageScaleType efl_gfx_image_scale_type_get_delegate(System.IntPtr obj, System.IntPtr pd);
807 public delegate Efl.Gfx.ImageScaleType efl_gfx_image_scale_type_get_api_delegate(System.IntPtr obj);
808 public static Efl.Eo.FunctionWrapper<efl_gfx_image_scale_type_get_api_delegate> efl_gfx_image_scale_type_get_ptr = new Efl.Eo.FunctionWrapper<efl_gfx_image_scale_type_get_api_delegate>(_Module, "efl_gfx_image_scale_type_get");
809 private static Efl.Gfx.ImageScaleType scale_type_get(System.IntPtr obj, System.IntPtr pd)
811 Eina.Log.Debug("function efl_gfx_image_scale_type_get was called");
812 Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.data_get(pd);
813 if(wrapper != null) {
814 Efl.Gfx.ImageScaleType _ret_var = default(Efl.Gfx.ImageScaleType);
816 _ret_var = ((Image)wrapper).GetScaleType();
817 } catch (Exception e) {
818 Eina.Log.Warning($"Callback error: {e.ToString()}");
819 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
823 return efl_gfx_image_scale_type_get_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)));
826 private static efl_gfx_image_scale_type_get_delegate efl_gfx_image_scale_type_get_static_delegate;
829 private delegate void efl_gfx_image_scale_type_set_delegate(System.IntPtr obj, System.IntPtr pd, Efl.Gfx.ImageScaleType scale_type);
832 public delegate void efl_gfx_image_scale_type_set_api_delegate(System.IntPtr obj, Efl.Gfx.ImageScaleType scale_type);
833 public static Efl.Eo.FunctionWrapper<efl_gfx_image_scale_type_set_api_delegate> efl_gfx_image_scale_type_set_ptr = new Efl.Eo.FunctionWrapper<efl_gfx_image_scale_type_set_api_delegate>(_Module, "efl_gfx_image_scale_type_set");
834 private static void scale_type_set(System.IntPtr obj, System.IntPtr pd, Efl.Gfx.ImageScaleType scale_type)
836 Eina.Log.Debug("function efl_gfx_image_scale_type_set was called");
837 Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.data_get(pd);
838 if(wrapper != null) {
841 ((Image)wrapper).SetScaleType( scale_type);
842 } catch (Exception e) {
843 Eina.Log.Warning($"Callback error: {e.ToString()}");
844 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
847 efl_gfx_image_scale_type_set_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), scale_type);
850 private static efl_gfx_image_scale_type_set_delegate efl_gfx_image_scale_type_set_static_delegate;
853 private delegate double efl_gfx_image_ratio_get_delegate(System.IntPtr obj, System.IntPtr pd);
856 public delegate double efl_gfx_image_ratio_get_api_delegate(System.IntPtr obj);
857 public static Efl.Eo.FunctionWrapper<efl_gfx_image_ratio_get_api_delegate> efl_gfx_image_ratio_get_ptr = new Efl.Eo.FunctionWrapper<efl_gfx_image_ratio_get_api_delegate>(_Module, "efl_gfx_image_ratio_get");
858 private static double ratio_get(System.IntPtr obj, System.IntPtr pd)
860 Eina.Log.Debug("function efl_gfx_image_ratio_get was called");
861 Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.data_get(pd);
862 if(wrapper != null) {
863 double _ret_var = default(double);
865 _ret_var = ((Image)wrapper).GetRatio();
866 } catch (Exception e) {
867 Eina.Log.Warning($"Callback error: {e.ToString()}");
868 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
872 return efl_gfx_image_ratio_get_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)));
875 private static efl_gfx_image_ratio_get_delegate efl_gfx_image_ratio_get_static_delegate;
878 private delegate void efl_gfx_image_border_get_delegate(System.IntPtr obj, System.IntPtr pd, out int l, out int r, out int t, out int b);
881 public delegate void efl_gfx_image_border_get_api_delegate(System.IntPtr obj, out int l, out int r, out int t, out int b);
882 public static Efl.Eo.FunctionWrapper<efl_gfx_image_border_get_api_delegate> efl_gfx_image_border_get_ptr = new Efl.Eo.FunctionWrapper<efl_gfx_image_border_get_api_delegate>(_Module, "efl_gfx_image_border_get");
883 private static void border_get(System.IntPtr obj, System.IntPtr pd, out int l, out int r, out int t, out int b)
885 Eina.Log.Debug("function efl_gfx_image_border_get was called");
886 Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.data_get(pd);
887 if(wrapper != null) {
888 l = default( int); r = default( int); t = default( int); b = default( int);
890 ((Image)wrapper).GetBorder( out l, out r, out t, out b);
891 } catch (Exception e) {
892 Eina.Log.Warning($"Callback error: {e.ToString()}");
893 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
896 efl_gfx_image_border_get_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), out l, out r, out t, out b);
899 private static efl_gfx_image_border_get_delegate efl_gfx_image_border_get_static_delegate;
902 private delegate void efl_gfx_image_border_set_delegate(System.IntPtr obj, System.IntPtr pd, int l, int r, int t, int b);
905 public delegate void efl_gfx_image_border_set_api_delegate(System.IntPtr obj, int l, int r, int t, int b);
906 public static Efl.Eo.FunctionWrapper<efl_gfx_image_border_set_api_delegate> efl_gfx_image_border_set_ptr = new Efl.Eo.FunctionWrapper<efl_gfx_image_border_set_api_delegate>(_Module, "efl_gfx_image_border_set");
907 private static void border_set(System.IntPtr obj, System.IntPtr pd, int l, int r, int t, int b)
909 Eina.Log.Debug("function efl_gfx_image_border_set was called");
910 Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.data_get(pd);
911 if(wrapper != null) {
914 ((Image)wrapper).SetBorder( l, r, t, b);
915 } catch (Exception e) {
916 Eina.Log.Warning($"Callback error: {e.ToString()}");
917 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
920 efl_gfx_image_border_set_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), l, r, t, b);
923 private static efl_gfx_image_border_set_delegate efl_gfx_image_border_set_static_delegate;
926 private delegate double efl_gfx_image_border_scale_get_delegate(System.IntPtr obj, System.IntPtr pd);
929 public delegate double efl_gfx_image_border_scale_get_api_delegate(System.IntPtr obj);
930 public static Efl.Eo.FunctionWrapper<efl_gfx_image_border_scale_get_api_delegate> efl_gfx_image_border_scale_get_ptr = new Efl.Eo.FunctionWrapper<efl_gfx_image_border_scale_get_api_delegate>(_Module, "efl_gfx_image_border_scale_get");
931 private static double border_scale_get(System.IntPtr obj, System.IntPtr pd)
933 Eina.Log.Debug("function efl_gfx_image_border_scale_get was called");
934 Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.data_get(pd);
935 if(wrapper != null) {
936 double _ret_var = default(double);
938 _ret_var = ((Image)wrapper).GetBorderScale();
939 } catch (Exception e) {
940 Eina.Log.Warning($"Callback error: {e.ToString()}");
941 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
945 return efl_gfx_image_border_scale_get_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)));
948 private static efl_gfx_image_border_scale_get_delegate efl_gfx_image_border_scale_get_static_delegate;
951 private delegate void efl_gfx_image_border_scale_set_delegate(System.IntPtr obj, System.IntPtr pd, double scale);
954 public delegate void efl_gfx_image_border_scale_set_api_delegate(System.IntPtr obj, double scale);
955 public static Efl.Eo.FunctionWrapper<efl_gfx_image_border_scale_set_api_delegate> efl_gfx_image_border_scale_set_ptr = new Efl.Eo.FunctionWrapper<efl_gfx_image_border_scale_set_api_delegate>(_Module, "efl_gfx_image_border_scale_set");
956 private static void border_scale_set(System.IntPtr obj, System.IntPtr pd, double scale)
958 Eina.Log.Debug("function efl_gfx_image_border_scale_set was called");
959 Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.data_get(pd);
960 if(wrapper != null) {
963 ((Image)wrapper).SetBorderScale( scale);
964 } catch (Exception e) {
965 Eina.Log.Warning($"Callback error: {e.ToString()}");
966 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
969 efl_gfx_image_border_scale_set_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), scale);
972 private static efl_gfx_image_border_scale_set_delegate efl_gfx_image_border_scale_set_static_delegate;
975 private delegate Efl.Gfx.BorderFillMode efl_gfx_image_border_center_fill_get_delegate(System.IntPtr obj, System.IntPtr pd);
978 public delegate Efl.Gfx.BorderFillMode efl_gfx_image_border_center_fill_get_api_delegate(System.IntPtr obj);
979 public static Efl.Eo.FunctionWrapper<efl_gfx_image_border_center_fill_get_api_delegate> efl_gfx_image_border_center_fill_get_ptr = new Efl.Eo.FunctionWrapper<efl_gfx_image_border_center_fill_get_api_delegate>(_Module, "efl_gfx_image_border_center_fill_get");
980 private static Efl.Gfx.BorderFillMode border_center_fill_get(System.IntPtr obj, System.IntPtr pd)
982 Eina.Log.Debug("function efl_gfx_image_border_center_fill_get was called");
983 Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.data_get(pd);
984 if(wrapper != null) {
985 Efl.Gfx.BorderFillMode _ret_var = default(Efl.Gfx.BorderFillMode);
987 _ret_var = ((Image)wrapper).GetBorderCenterFill();
988 } catch (Exception e) {
989 Eina.Log.Warning($"Callback error: {e.ToString()}");
990 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
994 return efl_gfx_image_border_center_fill_get_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)));
997 private static efl_gfx_image_border_center_fill_get_delegate efl_gfx_image_border_center_fill_get_static_delegate;
1000 private delegate void efl_gfx_image_border_center_fill_set_delegate(System.IntPtr obj, System.IntPtr pd, Efl.Gfx.BorderFillMode fill);
1003 public delegate void efl_gfx_image_border_center_fill_set_api_delegate(System.IntPtr obj, Efl.Gfx.BorderFillMode fill);
1004 public static Efl.Eo.FunctionWrapper<efl_gfx_image_border_center_fill_set_api_delegate> efl_gfx_image_border_center_fill_set_ptr = new Efl.Eo.FunctionWrapper<efl_gfx_image_border_center_fill_set_api_delegate>(_Module, "efl_gfx_image_border_center_fill_set");
1005 private static void border_center_fill_set(System.IntPtr obj, System.IntPtr pd, Efl.Gfx.BorderFillMode fill)
1007 Eina.Log.Debug("function efl_gfx_image_border_center_fill_set was called");
1008 Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.data_get(pd);
1009 if(wrapper != null) {
1012 ((Image)wrapper).SetBorderCenterFill( fill);
1013 } catch (Exception e) {
1014 Eina.Log.Warning($"Callback error: {e.ToString()}");
1015 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
1018 efl_gfx_image_border_center_fill_set_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), fill);
1021 private static efl_gfx_image_border_center_fill_set_delegate efl_gfx_image_border_center_fill_set_static_delegate;
1024 private delegate Eina.Size2D_StructInternal efl_gfx_image_size_get_delegate(System.IntPtr obj, System.IntPtr pd);
1027 public delegate Eina.Size2D_StructInternal efl_gfx_image_size_get_api_delegate(System.IntPtr obj);
1028 public static Efl.Eo.FunctionWrapper<efl_gfx_image_size_get_api_delegate> efl_gfx_image_size_get_ptr = new Efl.Eo.FunctionWrapper<efl_gfx_image_size_get_api_delegate>(_Module, "efl_gfx_image_size_get");
1029 private static Eina.Size2D_StructInternal image_size_get(System.IntPtr obj, System.IntPtr pd)
1031 Eina.Log.Debug("function efl_gfx_image_size_get was called");
1032 Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.data_get(pd);
1033 if(wrapper != null) {
1034 Eina.Size2D _ret_var = default(Eina.Size2D);
1036 _ret_var = ((Image)wrapper).GetImageSize();
1037 } catch (Exception e) {
1038 Eina.Log.Warning($"Callback error: {e.ToString()}");
1039 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
1041 return Eina.Size2D_StructConversion.ToInternal(_ret_var);
1043 return efl_gfx_image_size_get_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)));
1046 private static efl_gfx_image_size_get_delegate efl_gfx_image_size_get_static_delegate;
1049 private delegate Efl.Gfx.ImageContentHint efl_gfx_image_content_hint_get_delegate(System.IntPtr obj, System.IntPtr pd);
1052 public delegate Efl.Gfx.ImageContentHint efl_gfx_image_content_hint_get_api_delegate(System.IntPtr obj);
1053 public static Efl.Eo.FunctionWrapper<efl_gfx_image_content_hint_get_api_delegate> efl_gfx_image_content_hint_get_ptr = new Efl.Eo.FunctionWrapper<efl_gfx_image_content_hint_get_api_delegate>(_Module, "efl_gfx_image_content_hint_get");
1054 private static Efl.Gfx.ImageContentHint content_hint_get(System.IntPtr obj, System.IntPtr pd)
1056 Eina.Log.Debug("function efl_gfx_image_content_hint_get was called");
1057 Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.data_get(pd);
1058 if(wrapper != null) {
1059 Efl.Gfx.ImageContentHint _ret_var = default(Efl.Gfx.ImageContentHint);
1061 _ret_var = ((Image)wrapper).GetContentHint();
1062 } catch (Exception e) {
1063 Eina.Log.Warning($"Callback error: {e.ToString()}");
1064 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
1068 return efl_gfx_image_content_hint_get_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)));
1071 private static efl_gfx_image_content_hint_get_delegate efl_gfx_image_content_hint_get_static_delegate;
1074 private delegate void efl_gfx_image_content_hint_set_delegate(System.IntPtr obj, System.IntPtr pd, Efl.Gfx.ImageContentHint hint);
1077 public delegate void efl_gfx_image_content_hint_set_api_delegate(System.IntPtr obj, Efl.Gfx.ImageContentHint hint);
1078 public static Efl.Eo.FunctionWrapper<efl_gfx_image_content_hint_set_api_delegate> efl_gfx_image_content_hint_set_ptr = new Efl.Eo.FunctionWrapper<efl_gfx_image_content_hint_set_api_delegate>(_Module, "efl_gfx_image_content_hint_set");
1079 private static void content_hint_set(System.IntPtr obj, System.IntPtr pd, Efl.Gfx.ImageContentHint hint)
1081 Eina.Log.Debug("function efl_gfx_image_content_hint_set was called");
1082 Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.data_get(pd);
1083 if(wrapper != null) {
1086 ((Image)wrapper).SetContentHint( hint);
1087 } catch (Exception e) {
1088 Eina.Log.Warning($"Callback error: {e.ToString()}");
1089 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
1092 efl_gfx_image_content_hint_set_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), hint);
1095 private static efl_gfx_image_content_hint_set_delegate efl_gfx_image_content_hint_set_static_delegate;
1098 private delegate Efl.Gfx.ImageScaleHint efl_gfx_image_scale_hint_get_delegate(System.IntPtr obj, System.IntPtr pd);
1101 public delegate Efl.Gfx.ImageScaleHint efl_gfx_image_scale_hint_get_api_delegate(System.IntPtr obj);
1102 public static Efl.Eo.FunctionWrapper<efl_gfx_image_scale_hint_get_api_delegate> efl_gfx_image_scale_hint_get_ptr = new Efl.Eo.FunctionWrapper<efl_gfx_image_scale_hint_get_api_delegate>(_Module, "efl_gfx_image_scale_hint_get");
1103 private static Efl.Gfx.ImageScaleHint scale_hint_get(System.IntPtr obj, System.IntPtr pd)
1105 Eina.Log.Debug("function efl_gfx_image_scale_hint_get was called");
1106 Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.data_get(pd);
1107 if(wrapper != null) {
1108 Efl.Gfx.ImageScaleHint _ret_var = default(Efl.Gfx.ImageScaleHint);
1110 _ret_var = ((Image)wrapper).GetScaleHint();
1111 } catch (Exception e) {
1112 Eina.Log.Warning($"Callback error: {e.ToString()}");
1113 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
1117 return efl_gfx_image_scale_hint_get_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)));
1120 private static efl_gfx_image_scale_hint_get_delegate efl_gfx_image_scale_hint_get_static_delegate;
1123 private delegate void efl_gfx_image_scale_hint_set_delegate(System.IntPtr obj, System.IntPtr pd, Efl.Gfx.ImageScaleHint hint);
1126 public delegate void efl_gfx_image_scale_hint_set_api_delegate(System.IntPtr obj, Efl.Gfx.ImageScaleHint hint);
1127 public static Efl.Eo.FunctionWrapper<efl_gfx_image_scale_hint_set_api_delegate> efl_gfx_image_scale_hint_set_ptr = new Efl.Eo.FunctionWrapper<efl_gfx_image_scale_hint_set_api_delegate>(_Module, "efl_gfx_image_scale_hint_set");
1128 private static void scale_hint_set(System.IntPtr obj, System.IntPtr pd, Efl.Gfx.ImageScaleHint hint)
1130 Eina.Log.Debug("function efl_gfx_image_scale_hint_set was called");
1131 Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.data_get(pd);
1132 if(wrapper != null) {
1135 ((Image)wrapper).SetScaleHint( hint);
1136 } catch (Exception e) {
1137 Eina.Log.Warning($"Callback error: {e.ToString()}");
1138 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
1141 efl_gfx_image_scale_hint_set_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), hint);
1144 private static efl_gfx_image_scale_hint_set_delegate efl_gfx_image_scale_hint_set_static_delegate;
1147 private delegate Efl.Gfx.ImageLoadError efl_gfx_image_load_error_get_delegate(System.IntPtr obj, System.IntPtr pd);
1150 public delegate Efl.Gfx.ImageLoadError efl_gfx_image_load_error_get_api_delegate(System.IntPtr obj);
1151 public static Efl.Eo.FunctionWrapper<efl_gfx_image_load_error_get_api_delegate> efl_gfx_image_load_error_get_ptr = new Efl.Eo.FunctionWrapper<efl_gfx_image_load_error_get_api_delegate>(_Module, "efl_gfx_image_load_error_get");
1152 private static Efl.Gfx.ImageLoadError image_load_error_get(System.IntPtr obj, System.IntPtr pd)
1154 Eina.Log.Debug("function efl_gfx_image_load_error_get was called");
1155 Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.data_get(pd);
1156 if(wrapper != null) {
1157 Efl.Gfx.ImageLoadError _ret_var = default(Efl.Gfx.ImageLoadError);
1159 _ret_var = ((Image)wrapper).GetImageLoadError();
1160 } catch (Exception e) {
1161 Eina.Log.Warning($"Callback error: {e.ToString()}");
1162 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
1166 return efl_gfx_image_load_error_get_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)));
1169 private static efl_gfx_image_load_error_get_delegate efl_gfx_image_load_error_get_static_delegate;
1172 namespace Efl { namespace Gfx {
1173 /// <summary>How an image's data is to be treated by EFL, for optimization.</summary>
1174 public enum ImageContentHint
1176 /// <summary>No hint on the content (default).</summary>
1178 /// <summary>The content will change over time.</summary>
1180 /// <summary>The content won't change over time.</summary>
1184 namespace Efl { namespace Gfx {
1185 /// <summary>How an image's data is to be treated by EFL, with regard to scaling cache.</summary>
1186 public enum ImageScaleHint
1188 /// <summary>No hint on the scaling (default).</summary>
1190 /// <summary>Image will be re-scaled over time, thus turning scaling cache OFF for its data.</summary>
1192 /// <summary>Image will not be re-scaled over time, thus turning scaling cache ON for its data.</summary>
1196 namespace Efl { namespace Gfx {
1197 /// <summary>Enumeration that defines scale types of an image.</summary>
1198 public enum ImageScaleType
1200 /// <summary>Scale the image so that it matches the object's area exactly. The image's aspect ratio might be changed.</summary>
1202 /// <summary>Scale the image so that it fits inside the object's area while maintaining the aspect ratio. At least one of the dimensions of the image should be equal to the corresponding dimension of the object.</summary>
1204 /// <summary>Scale the image so that it covers the entire object area while maintaining the aspect ratio. At least one of the dimensions of the image should be equal to the corresponding dimension of the object.</summary>
1206 /// <summary>Tile image at its original size.</summary>
1208 /// <summary>Not scale the image</summary>