#pragma warning disable CS1591 using System; using System.Runtime.InteropServices; using System.Collections.Generic; using System.Linq; using System.ComponentModel; namespace Efl { namespace Ui { /// Efl UI zoom interface [ZoomNativeInherit] public interface Zoom : Efl.Eo.IWrapper, IDisposable { /// This sets the zoom animation state to on or off for zoomable. The default is off. When paused is true, it will stop zooming using animation on zoom level changes and change instantly, stopping any existing animations that are running. /// The paused state. bool GetZoomAnimation(); /// This sets the zoom animation state to on or off for zoomable. The default is off. When paused is true, it will stop zooming using animation on zoom level changes and change instantly, stopping any existing animations that are running. /// The paused state. /// void SetZoomAnimation( bool paused); /// Get the zoom level of the photo /// This returns the current zoom level of the zoomable object. Note that if you set the fill mode to other than #EFL_UI_ZOOM_MODE_MANUAL (which is the default), the zoom level may be changed at any time by the zoomable object itself to account for photo size and zoomable viewport size. /// The zoom level to set double GetZoomLevel(); /// Set the zoom level of the photo /// This sets the zoom level. If zoom is 1, it means no zoom. If it's smaller than 1, it means zoom in. If it's bigger than 1, it means zoom out. For example, zoom 1 will be 1:1 pixel for pixel. zoom 2 will be 2:1 (that is 2x2 photo pixels will display as 1 on-screen pixel) which is a zoom out. 4:1 will be 4x4 photo pixels as 1 screen pixel, and so on. The zoom parameter must be greater than 0. It is suggested to stick to powers of 2. (1, 2, 4, 8, 16, 32, etc.). /// The zoom level to set /// void SetZoomLevel( double zoom); /// Get the zoom mode /// This gets the current zoom mode of the zoomable object. /// The zoom mode. Efl.Ui.ZoomMode GetZoomMode(); /// Set the zoom mode /// This sets the zoom mode to manual or one of several automatic levels. Manual (EFL_UI_ZOOM_MODE_MANUAL) means that zoom is set manually by and will stay at that level until changed by code or until zoom mode is changed. This is the default mode. The Automatic modes will allow the zoomable object to automatically adjust zoom mode based on properties. /// /// #EFL_UI_ZOOM_MODE_AUTO_FIT) will adjust zoom so the photo fits EXACTLY inside the scroll frame with no pixels outside this region. #EFL_UI_ZOOM_MODE_AUTO_FILL will be similar but ensure no pixels within the frame are left unfilled. /// The zoom mode. /// void SetZoomMode( Efl.Ui.ZoomMode mode); /// Called when zooming started event EventHandler ZoomStartEvt; /// Called when zooming stopped event EventHandler ZoomStopEvt; /// Called when zooming changed event EventHandler ZoomChangeEvt; /// This sets the zoom animation state to on or off for zoomable. The default is off. When paused is true, it will stop zooming using animation on zoom level changes and change instantly, stopping any existing animations that are running. /// The paused state. bool ZoomAnimation { get ; set ; } /// Get the zoom level of the photo /// This returns the current zoom level of the zoomable object. Note that if you set the fill mode to other than #EFL_UI_ZOOM_MODE_MANUAL (which is the default), the zoom level may be changed at any time by the zoomable object itself to account for photo size and zoomable viewport size. /// The zoom level to set double ZoomLevel { get ; set ; } /// Get the zoom mode /// This gets the current zoom mode of the zoomable object. /// The zoom mode. Efl.Ui.ZoomMode ZoomMode { get ; set ; } } /// Efl UI zoom interface sealed public class ZoomConcrete : Zoom { ///Pointer to the native class description. public System.IntPtr NativeClass { get { if (((object)this).GetType() == typeof (ZoomConcrete)) return Efl.Ui.ZoomNativeInherit.GetEflClassStatic(); else return Efl.Eo.ClassRegister.klassFromType[((object)this).GetType()]; } } private EventHandlerList eventHandlers = new EventHandlerList(); private System.IntPtr handle; ///Pointer to the native instance. public System.IntPtr NativeHandle { get { return handle; } } [System.Runtime.InteropServices.DllImport(efl.Libs.Efl)] internal static extern System.IntPtr efl_ui_zoom_interface_get(); ///Internal usage: Constructs an instance from a native pointer. This is used when interacting with C code and should not be used directly. public ZoomConcrete(System.IntPtr raw) { handle = raw; register_event_proxies(); } ///Destructor. ~ZoomConcrete() { Dispose(false); } ///Releases the underlying native instance. void Dispose(bool disposing) { if (handle != System.IntPtr.Zero) { Efl.Eo.Globals.efl_unref(handle); handle = System.IntPtr.Zero; } } ///Releases the underlying native instance. public void Dispose() { Dispose(true); GC.SuppressFinalize(this); } ///Casts obj into an instance of this type. public static ZoomConcrete static_cast(Efl.Object obj) { if (obj == null) throw new System.ArgumentNullException("obj"); return new ZoomConcrete(obj.NativeHandle); } ///Verifies if the given object is equal to this one. public override bool Equals(object obj) { var other = obj as Efl.Object; if (other == null) return false; return this.NativeHandle == other.NativeHandle; } ///Gets the hash code for this object based on the native pointer it points to. public override int GetHashCode() { return this.NativeHandle.ToInt32(); } ///Turns the native pointer into a string representation. public override String ToString() { return $"{this.GetType().Name}@[{this.NativeHandle.ToInt32():x}]"; } private readonly object eventLock = new object(); private Dictionary event_cb_count = new Dictionary(); private bool add_cpp_event_handler(string lib, string key, Efl.EventCb evt_delegate) { int event_count = 0; if (!event_cb_count.TryGetValue(key, out event_count)) event_cb_count[key] = event_count; if (event_count == 0) { IntPtr desc = Efl.EventDescription.GetNative(lib, key); if (desc == IntPtr.Zero) { Eina.Log.Error($"Failed to get native event {key}"); return false; } bool result = Efl.Eo.Globals.efl_event_callback_priority_add(handle, desc, 0, evt_delegate, System.IntPtr.Zero); if (!result) { Eina.Log.Error($"Failed to add event proxy for event {key}"); return false; } Eina.Error.RaiseIfUnhandledException(); } event_cb_count[key]++; return true; } private bool remove_cpp_event_handler(string key, Efl.EventCb evt_delegate) { int event_count = 0; if (!event_cb_count.TryGetValue(key, out event_count)) event_cb_count[key] = event_count; if (event_count == 1) { IntPtr desc = Efl.EventDescription.GetNative(efl.Libs.Efl, key); if (desc == IntPtr.Zero) { Eina.Log.Error($"Failed to get native event {key}"); return false; } bool result = Efl.Eo.Globals.efl_event_callback_del(handle, desc, evt_delegate, System.IntPtr.Zero); if (!result) { Eina.Log.Error($"Failed to remove event proxy for event {key}"); return false; } Eina.Error.RaiseIfUnhandledException(); } else if (event_count == 0) { Eina.Log.Error($"Trying to remove proxy for event {key} when there is nothing registered."); return false; } event_cb_count[key]--; return true; } private static object ZoomStartEvtKey = new object(); /// Called when zooming started public event EventHandler ZoomStartEvt { add { lock (eventLock) { string key = "_EFL_UI_EVENT_ZOOM_START"; if (add_cpp_event_handler(efl.Libs.Efl, key, this.evt_ZoomStartEvt_delegate)) { eventHandlers.AddHandler(ZoomStartEvtKey , value); } else Eina.Log.Error($"Error adding proxy for event {key}"); } } remove { lock (eventLock) { string key = "_EFL_UI_EVENT_ZOOM_START"; if (remove_cpp_event_handler(key, this.evt_ZoomStartEvt_delegate)) { eventHandlers.RemoveHandler(ZoomStartEvtKey , value); } else Eina.Log.Error($"Error removing proxy for event {key}"); } } } ///Method to raise event ZoomStartEvt. public void On_ZoomStartEvt(EventArgs e) { EventHandler evt; lock (eventLock) { evt = (EventHandler)eventHandlers[ZoomStartEvtKey]; } evt?.Invoke(this, e); } Efl.EventCb evt_ZoomStartEvt_delegate; private void on_ZoomStartEvt_NativeCallback(System.IntPtr data, ref Efl.Event_StructInternal evt) { EventArgs args = EventArgs.Empty; try { On_ZoomStartEvt(args); } catch (Exception e) { Eina.Log.Error(e.ToString()); Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION); } } private static object ZoomStopEvtKey = new object(); /// Called when zooming stopped public event EventHandler ZoomStopEvt { add { lock (eventLock) { string key = "_EFL_UI_EVENT_ZOOM_STOP"; if (add_cpp_event_handler(efl.Libs.Efl, key, this.evt_ZoomStopEvt_delegate)) { eventHandlers.AddHandler(ZoomStopEvtKey , value); } else Eina.Log.Error($"Error adding proxy for event {key}"); } } remove { lock (eventLock) { string key = "_EFL_UI_EVENT_ZOOM_STOP"; if (remove_cpp_event_handler(key, this.evt_ZoomStopEvt_delegate)) { eventHandlers.RemoveHandler(ZoomStopEvtKey , value); } else Eina.Log.Error($"Error removing proxy for event {key}"); } } } ///Method to raise event ZoomStopEvt. public void On_ZoomStopEvt(EventArgs e) { EventHandler evt; lock (eventLock) { evt = (EventHandler)eventHandlers[ZoomStopEvtKey]; } evt?.Invoke(this, e); } Efl.EventCb evt_ZoomStopEvt_delegate; private void on_ZoomStopEvt_NativeCallback(System.IntPtr data, ref Efl.Event_StructInternal evt) { EventArgs args = EventArgs.Empty; try { On_ZoomStopEvt(args); } catch (Exception e) { Eina.Log.Error(e.ToString()); Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION); } } private static object ZoomChangeEvtKey = new object(); /// Called when zooming changed public event EventHandler ZoomChangeEvt { add { lock (eventLock) { string key = "_EFL_UI_EVENT_ZOOM_CHANGE"; if (add_cpp_event_handler(efl.Libs.Efl, key, this.evt_ZoomChangeEvt_delegate)) { eventHandlers.AddHandler(ZoomChangeEvtKey , value); } else Eina.Log.Error($"Error adding proxy for event {key}"); } } remove { lock (eventLock) { string key = "_EFL_UI_EVENT_ZOOM_CHANGE"; if (remove_cpp_event_handler(key, this.evt_ZoomChangeEvt_delegate)) { eventHandlers.RemoveHandler(ZoomChangeEvtKey , value); } else Eina.Log.Error($"Error removing proxy for event {key}"); } } } ///Method to raise event ZoomChangeEvt. public void On_ZoomChangeEvt(EventArgs e) { EventHandler evt; lock (eventLock) { evt = (EventHandler)eventHandlers[ZoomChangeEvtKey]; } evt?.Invoke(this, e); } Efl.EventCb evt_ZoomChangeEvt_delegate; private void on_ZoomChangeEvt_NativeCallback(System.IntPtr data, ref Efl.Event_StructInternal evt) { EventArgs args = EventArgs.Empty; try { On_ZoomChangeEvt(args); } catch (Exception e) { Eina.Log.Error(e.ToString()); Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION); } } void register_event_proxies() { evt_ZoomStartEvt_delegate = new Efl.EventCb(on_ZoomStartEvt_NativeCallback); evt_ZoomStopEvt_delegate = new Efl.EventCb(on_ZoomStopEvt_NativeCallback); evt_ZoomChangeEvt_delegate = new Efl.EventCb(on_ZoomChangeEvt_NativeCallback); } /// This sets the zoom animation state to on or off for zoomable. The default is off. When paused is true, it will stop zooming using animation on zoom level changes and change instantly, stopping any existing animations that are running. /// The paused state. public bool GetZoomAnimation() { var _ret_var = Efl.Ui.ZoomNativeInherit.efl_ui_zoom_animation_get_ptr.Value.Delegate(this.NativeHandle); Eina.Error.RaiseIfUnhandledException(); return _ret_var; } /// This sets the zoom animation state to on or off for zoomable. The default is off. When paused is true, it will stop zooming using animation on zoom level changes and change instantly, stopping any existing animations that are running. /// The paused state. /// public void SetZoomAnimation( bool paused) { Efl.Ui.ZoomNativeInherit.efl_ui_zoom_animation_set_ptr.Value.Delegate(this.NativeHandle, paused); Eina.Error.RaiseIfUnhandledException(); } /// Get the zoom level of the photo /// This returns the current zoom level of the zoomable object. Note that if you set the fill mode to other than #EFL_UI_ZOOM_MODE_MANUAL (which is the default), the zoom level may be changed at any time by the zoomable object itself to account for photo size and zoomable viewport size. /// The zoom level to set public double GetZoomLevel() { var _ret_var = Efl.Ui.ZoomNativeInherit.efl_ui_zoom_level_get_ptr.Value.Delegate(this.NativeHandle); Eina.Error.RaiseIfUnhandledException(); return _ret_var; } /// Set the zoom level of the photo /// This sets the zoom level. If zoom is 1, it means no zoom. If it's smaller than 1, it means zoom in. If it's bigger than 1, it means zoom out. For example, zoom 1 will be 1:1 pixel for pixel. zoom 2 will be 2:1 (that is 2x2 photo pixels will display as 1 on-screen pixel) which is a zoom out. 4:1 will be 4x4 photo pixels as 1 screen pixel, and so on. The zoom parameter must be greater than 0. It is suggested to stick to powers of 2. (1, 2, 4, 8, 16, 32, etc.). /// The zoom level to set /// public void SetZoomLevel( double zoom) { Efl.Ui.ZoomNativeInherit.efl_ui_zoom_level_set_ptr.Value.Delegate(this.NativeHandle, zoom); Eina.Error.RaiseIfUnhandledException(); } /// Get the zoom mode /// This gets the current zoom mode of the zoomable object. /// The zoom mode. public Efl.Ui.ZoomMode GetZoomMode() { var _ret_var = Efl.Ui.ZoomNativeInherit.efl_ui_zoom_mode_get_ptr.Value.Delegate(this.NativeHandle); Eina.Error.RaiseIfUnhandledException(); return _ret_var; } /// Set the zoom mode /// This sets the zoom mode to manual or one of several automatic levels. Manual (EFL_UI_ZOOM_MODE_MANUAL) means that zoom is set manually by and will stay at that level until changed by code or until zoom mode is changed. This is the default mode. The Automatic modes will allow the zoomable object to automatically adjust zoom mode based on properties. /// /// #EFL_UI_ZOOM_MODE_AUTO_FIT) will adjust zoom so the photo fits EXACTLY inside the scroll frame with no pixels outside this region. #EFL_UI_ZOOM_MODE_AUTO_FILL will be similar but ensure no pixels within the frame are left unfilled. /// The zoom mode. /// public void SetZoomMode( Efl.Ui.ZoomMode mode) { Efl.Ui.ZoomNativeInherit.efl_ui_zoom_mode_set_ptr.Value.Delegate(this.NativeHandle, mode); Eina.Error.RaiseIfUnhandledException(); } /// This sets the zoom animation state to on or off for zoomable. The default is off. When paused is true, it will stop zooming using animation on zoom level changes and change instantly, stopping any existing animations that are running. /// The paused state. public bool ZoomAnimation { get { return GetZoomAnimation(); } set { SetZoomAnimation( value); } } /// Get the zoom level of the photo /// This returns the current zoom level of the zoomable object. Note that if you set the fill mode to other than #EFL_UI_ZOOM_MODE_MANUAL (which is the default), the zoom level may be changed at any time by the zoomable object itself to account for photo size and zoomable viewport size. /// The zoom level to set public double ZoomLevel { get { return GetZoomLevel(); } set { SetZoomLevel( value); } } /// Get the zoom mode /// This gets the current zoom mode of the zoomable object. /// The zoom mode. public Efl.Ui.ZoomMode ZoomMode { get { return GetZoomMode(); } set { SetZoomMode( value); } } } public class ZoomNativeInherit : Efl.Eo.NativeClass{ public static Efl.Eo.NativeModule _Module = new Efl.Eo.NativeModule(efl.Libs.Efl); public override System.Collections.Generic.List GetEoOps(System.Type type) { var descs = new System.Collections.Generic.List(); if (efl_ui_zoom_animation_get_static_delegate == null) efl_ui_zoom_animation_get_static_delegate = new efl_ui_zoom_animation_get_delegate(zoom_animation_get); descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(_Module.Module, "efl_ui_zoom_animation_get"), func = Marshal.GetFunctionPointerForDelegate(efl_ui_zoom_animation_get_static_delegate)}); if (efl_ui_zoom_animation_set_static_delegate == null) efl_ui_zoom_animation_set_static_delegate = new efl_ui_zoom_animation_set_delegate(zoom_animation_set); descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(_Module.Module, "efl_ui_zoom_animation_set"), func = Marshal.GetFunctionPointerForDelegate(efl_ui_zoom_animation_set_static_delegate)}); if (efl_ui_zoom_level_get_static_delegate == null) efl_ui_zoom_level_get_static_delegate = new efl_ui_zoom_level_get_delegate(zoom_level_get); descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(_Module.Module, "efl_ui_zoom_level_get"), func = Marshal.GetFunctionPointerForDelegate(efl_ui_zoom_level_get_static_delegate)}); if (efl_ui_zoom_level_set_static_delegate == null) efl_ui_zoom_level_set_static_delegate = new efl_ui_zoom_level_set_delegate(zoom_level_set); descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(_Module.Module, "efl_ui_zoom_level_set"), func = Marshal.GetFunctionPointerForDelegate(efl_ui_zoom_level_set_static_delegate)}); if (efl_ui_zoom_mode_get_static_delegate == null) efl_ui_zoom_mode_get_static_delegate = new efl_ui_zoom_mode_get_delegate(zoom_mode_get); descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(_Module.Module, "efl_ui_zoom_mode_get"), func = Marshal.GetFunctionPointerForDelegate(efl_ui_zoom_mode_get_static_delegate)}); if (efl_ui_zoom_mode_set_static_delegate == null) efl_ui_zoom_mode_set_static_delegate = new efl_ui_zoom_mode_set_delegate(zoom_mode_set); descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(_Module.Module, "efl_ui_zoom_mode_set"), func = Marshal.GetFunctionPointerForDelegate(efl_ui_zoom_mode_set_static_delegate)}); return descs; } public override IntPtr GetEflClass() { return Efl.Ui.ZoomConcrete.efl_ui_zoom_interface_get(); } public static IntPtr GetEflClassStatic() { return Efl.Ui.ZoomConcrete.efl_ui_zoom_interface_get(); } [return: MarshalAs(UnmanagedType.U1)] private delegate bool efl_ui_zoom_animation_get_delegate(System.IntPtr obj, System.IntPtr pd); [return: MarshalAs(UnmanagedType.U1)] public delegate bool efl_ui_zoom_animation_get_api_delegate(System.IntPtr obj); public static Efl.Eo.FunctionWrapper efl_ui_zoom_animation_get_ptr = new Efl.Eo.FunctionWrapper(_Module, "efl_ui_zoom_animation_get"); private static bool zoom_animation_get(System.IntPtr obj, System.IntPtr pd) { Eina.Log.Debug("function efl_ui_zoom_animation_get was called"); Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.data_get(pd); if(wrapper != null) { bool _ret_var = default(bool); try { _ret_var = ((Zoom)wrapper).GetZoomAnimation(); } catch (Exception e) { Eina.Log.Warning($"Callback error: {e.ToString()}"); Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION); } return _ret_var; } else { return efl_ui_zoom_animation_get_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj))); } } private static efl_ui_zoom_animation_get_delegate efl_ui_zoom_animation_get_static_delegate; private delegate void efl_ui_zoom_animation_set_delegate(System.IntPtr obj, System.IntPtr pd, [MarshalAs(UnmanagedType.U1)] bool paused); public delegate void efl_ui_zoom_animation_set_api_delegate(System.IntPtr obj, [MarshalAs(UnmanagedType.U1)] bool paused); public static Efl.Eo.FunctionWrapper efl_ui_zoom_animation_set_ptr = new Efl.Eo.FunctionWrapper(_Module, "efl_ui_zoom_animation_set"); private static void zoom_animation_set(System.IntPtr obj, System.IntPtr pd, bool paused) { Eina.Log.Debug("function efl_ui_zoom_animation_set was called"); Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.data_get(pd); if(wrapper != null) { try { ((Zoom)wrapper).SetZoomAnimation( paused); } catch (Exception e) { Eina.Log.Warning($"Callback error: {e.ToString()}"); Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION); } } else { efl_ui_zoom_animation_set_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), paused); } } private static efl_ui_zoom_animation_set_delegate efl_ui_zoom_animation_set_static_delegate; private delegate double efl_ui_zoom_level_get_delegate(System.IntPtr obj, System.IntPtr pd); public delegate double efl_ui_zoom_level_get_api_delegate(System.IntPtr obj); public static Efl.Eo.FunctionWrapper efl_ui_zoom_level_get_ptr = new Efl.Eo.FunctionWrapper(_Module, "efl_ui_zoom_level_get"); private static double zoom_level_get(System.IntPtr obj, System.IntPtr pd) { Eina.Log.Debug("function efl_ui_zoom_level_get was called"); Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.data_get(pd); if(wrapper != null) { double _ret_var = default(double); try { _ret_var = ((Zoom)wrapper).GetZoomLevel(); } catch (Exception e) { Eina.Log.Warning($"Callback error: {e.ToString()}"); Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION); } return _ret_var; } else { return efl_ui_zoom_level_get_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj))); } } private static efl_ui_zoom_level_get_delegate efl_ui_zoom_level_get_static_delegate; private delegate void efl_ui_zoom_level_set_delegate(System.IntPtr obj, System.IntPtr pd, double zoom); public delegate void efl_ui_zoom_level_set_api_delegate(System.IntPtr obj, double zoom); public static Efl.Eo.FunctionWrapper efl_ui_zoom_level_set_ptr = new Efl.Eo.FunctionWrapper(_Module, "efl_ui_zoom_level_set"); private static void zoom_level_set(System.IntPtr obj, System.IntPtr pd, double zoom) { Eina.Log.Debug("function efl_ui_zoom_level_set was called"); Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.data_get(pd); if(wrapper != null) { try { ((Zoom)wrapper).SetZoomLevel( zoom); } catch (Exception e) { Eina.Log.Warning($"Callback error: {e.ToString()}"); Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION); } } else { efl_ui_zoom_level_set_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), zoom); } } private static efl_ui_zoom_level_set_delegate efl_ui_zoom_level_set_static_delegate; private delegate Efl.Ui.ZoomMode efl_ui_zoom_mode_get_delegate(System.IntPtr obj, System.IntPtr pd); public delegate Efl.Ui.ZoomMode efl_ui_zoom_mode_get_api_delegate(System.IntPtr obj); public static Efl.Eo.FunctionWrapper efl_ui_zoom_mode_get_ptr = new Efl.Eo.FunctionWrapper(_Module, "efl_ui_zoom_mode_get"); private static Efl.Ui.ZoomMode zoom_mode_get(System.IntPtr obj, System.IntPtr pd) { Eina.Log.Debug("function efl_ui_zoom_mode_get was called"); Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.data_get(pd); if(wrapper != null) { Efl.Ui.ZoomMode _ret_var = default(Efl.Ui.ZoomMode); try { _ret_var = ((Zoom)wrapper).GetZoomMode(); } catch (Exception e) { Eina.Log.Warning($"Callback error: {e.ToString()}"); Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION); } return _ret_var; } else { return efl_ui_zoom_mode_get_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj))); } } private static efl_ui_zoom_mode_get_delegate efl_ui_zoom_mode_get_static_delegate; private delegate void efl_ui_zoom_mode_set_delegate(System.IntPtr obj, System.IntPtr pd, Efl.Ui.ZoomMode mode); public delegate void efl_ui_zoom_mode_set_api_delegate(System.IntPtr obj, Efl.Ui.ZoomMode mode); public static Efl.Eo.FunctionWrapper efl_ui_zoom_mode_set_ptr = new Efl.Eo.FunctionWrapper(_Module, "efl_ui_zoom_mode_set"); private static void zoom_mode_set(System.IntPtr obj, System.IntPtr pd, Efl.Ui.ZoomMode mode) { Eina.Log.Debug("function efl_ui_zoom_mode_set was called"); Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.data_get(pd); if(wrapper != null) { try { ((Zoom)wrapper).SetZoomMode( mode); } catch (Exception e) { Eina.Log.Warning($"Callback error: {e.ToString()}"); Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION); } } else { efl_ui_zoom_mode_set_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), mode); } } private static efl_ui_zoom_mode_set_delegate efl_ui_zoom_mode_set_static_delegate; } } } namespace Efl { namespace Ui { /// Types of zoom available. public enum ZoomMode { /// Zoom controlled normally by efl_ui_zoom_set Manual = 0, /// Zoom until photo fits in zoomable object AutoFit = 1, /// Zoom until photo fills zoomable object AutoFill = 2, /// Zoom in until photo fits in zoomable object AutoFitIn = 3, /// Sentinel value to indicate last enum field during iteration Last = 4, } } }