1 #pragma warning disable CS1591
3 using System.Runtime.InteropServices;
4 using System.Collections.Generic;
6 using System.ComponentModel;
7 namespace Efl { namespace Ui { namespace TextFactory {
8 /// <summary>Factory that creates images given key string
9 /// The key can be either a full image path, or associated with one. The factory will fallback if key was not matches with an image, and try to load it as a full path.
12 public class Images : Efl.Object, Efl.Eo.IWrapper,Efl.Canvas.TextFactory
14 public new static System.IntPtr klass = System.IntPtr.Zero;
15 public new static Efl.Ui.TextFactory.ImagesNativeInherit nativeInherit = new Efl.Ui.TextFactory.ImagesNativeInherit();
16 ///<summary>Pointer to the native class description.</summary>
17 public override System.IntPtr NativeClass {
19 if (((object)this).GetType() == typeof (Images))
20 return Efl.Ui.TextFactory.ImagesNativeInherit.GetEflClassStatic();
22 return Efl.Eo.ClassRegister.klassFromType[((object)this).GetType()];
25 [System.Runtime.InteropServices.DllImport(efl.Libs.Elementary)] internal static extern System.IntPtr
26 efl_ui_text_factory_images_class_get();
27 ///<summary>Creates a new instance.</summary>
28 ///<param name="parent">Parent instance.</param>
29 public Images(Efl.Object parent= null
31 base(efl_ui_text_factory_images_class_get(), typeof(Images), parent)
33 FinishInstantiation();
35 ///<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>
36 public Images(System.IntPtr raw) : base(raw)
38 register_event_proxies();
40 ///<summary>Internal usage: Constructor to forward the wrapper initialization to the root class that interfaces with native code. Should not be used directly.</summary>
41 protected Images(IntPtr base_klass, System.Type managed_type, Efl.Object parent) : base(base_klass, managed_type, parent) {}
42 ///<summary>Casts obj into an instance of this type.</summary>
43 public new static Images static_cast(Efl.Object obj)
46 throw new System.ArgumentNullException("obj");
47 return new Images(obj.NativeHandle);
49 ///<summary>Verifies if the given object is equal to this one.</summary>
50 public override bool Equals(object obj)
52 var other = obj as Efl.Object;
55 return this.NativeHandle == other.NativeHandle;
57 ///<summary>Gets the hash code for this object based on the native pointer it points to.</summary>
58 public override int GetHashCode()
60 return this.NativeHandle.ToInt32();
62 ///<summary>Turns the native pointer into a string representation.</summary>
63 public override String ToString()
65 return $"{this.GetType().Name}@[{this.NativeHandle.ToInt32():x}]";
67 protected override void register_event_proxies()
69 base.register_event_proxies();
71 /// <summary>Associates given name with a path of an image or EET file.
72 /// This can be used for quick retrieval (instead of providing actual filenames.
74 /// This <c>file</c> is associated with <c>name</c> is considered a full file path.
76 /// see <see cref="Efl.Ui.TextFactory.Images.AddMatchesMmap"/> for mmap version see <see cref="Efl.Ui.TextFactory.Images.DelMatches"/>
78 /// <param name="name">the name associated with filename
80 /// <param name="path">the image or EET file path
82 /// <param name="key">the key to use (in cases of loading an EET file
84 /// <returns><c>true</c> if successful, <c>false</c> otherwise
86 virtual public bool AddMatches( System.String name, System.String path, System.String key) {
87 var _ret_var = Efl.Ui.TextFactory.ImagesNativeInherit.efl_ui_text_factory_images_matches_add_ptr.Value.Delegate((inherited ? Efl.Eo.Globals.efl_super(this.NativeHandle, this.NativeClass) : this.NativeHandle), name, path, key);
88 Eina.Error.RaiseIfUnhandledException();
91 /// <summary>Deletes an association of <c>key</c> with its respective file path.
92 /// see <see cref="Efl.Ui.TextFactory.Images.AddMatches"/>
94 /// <param name="key">the entry's key to delete
96 /// <returns><c>true</c> if successful, <c>false</c> otherwise
98 virtual public bool DelMatches( System.String key) {
99 var _ret_var = Efl.Ui.TextFactory.ImagesNativeInherit.efl_ui_text_factory_images_matches_del_ptr.Value.Delegate((inherited ? Efl.Eo.Globals.efl_super(this.NativeHandle, this.NativeClass) : this.NativeHandle), key);
100 Eina.Error.RaiseIfUnhandledException();
103 /// <summary>Associates given name with a mmap'd image or EET file and key.
104 /// see <see cref="Efl.Ui.TextFactory.Images.AddMatches"/> for string file path version see <see cref="Efl.Ui.TextFactory.Images.DelMatchesMmap"/>
106 /// <param name="name">the name associated with filename
108 /// <param name="file">the image or EET file
110 /// <param name="key">the key to use (in cases of loading an EET file
112 /// <returns><c>true</c> if successful, <c>false</c> otherwise
114 virtual public bool AddMatchesMmap( System.String name, Eina.File file, System.String key) {
115 var _ret_var = Efl.Ui.TextFactory.ImagesNativeInherit.efl_ui_text_factory_images_matches_mmap_add_ptr.Value.Delegate((inherited ? Efl.Eo.Globals.efl_super(this.NativeHandle, this.NativeClass) : this.NativeHandle), name, file, key);
116 Eina.Error.RaiseIfUnhandledException();
119 /// <summary>Deletes an association of <c>key</c> with its respective file.
120 /// see <see cref="Efl.Ui.TextFactory.Images.AddMatchesMmap"/>
122 /// <param name="key">the entry's key to delete
124 /// <returns><c>true</c> if successful, <c>false</c> otherwise
126 virtual public bool DelMatchesMmap( System.String key) {
127 var _ret_var = Efl.Ui.TextFactory.ImagesNativeInherit.efl_ui_text_factory_images_matches_mmap_del_ptr.Value.Delegate((inherited ? Efl.Eo.Globals.efl_super(this.NativeHandle, this.NativeClass) : this.NativeHandle), key);
128 Eina.Error.RaiseIfUnhandledException();
131 /// <summary>Translates a given <c>key</c> to an item object, and returns the object. The returned object should be owned by the passed <c>object</c>.
133 /// <param name="kw_object">The parent of the created object
135 /// <param name="key">Key that is associated to an item object
137 /// <returns></returns>
138 virtual public Efl.Canvas.Object Create( Efl.Canvas.Object kw_object, System.String key) {
139 var _ret_var = Efl.Canvas.TextFactoryNativeInherit.efl_canvas_text_factory_create_ptr.Value.Delegate((inherited ? Efl.Eo.Globals.efl_super(this.NativeHandle, this.NativeClass) : this.NativeHandle), kw_object, key);
140 Eina.Error.RaiseIfUnhandledException();
143 private static new IntPtr GetEflClassStatic()
145 return Efl.Ui.TextFactory.Images.efl_ui_text_factory_images_class_get();
148 public class ImagesNativeInherit : Efl.ObjectNativeInherit{
149 public new static Efl.Eo.NativeModule _Module = new Efl.Eo.NativeModule(efl.Libs.Elementary);
150 public override System.Collections.Generic.List<Efl_Op_Description> GetEoOps(System.Type type)
152 var descs = new System.Collections.Generic.List<Efl_Op_Description>();
153 if (efl_ui_text_factory_images_matches_add_static_delegate == null)
154 efl_ui_text_factory_images_matches_add_static_delegate = new efl_ui_text_factory_images_matches_add_delegate(matches_add);
155 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(_Module.Module, "efl_ui_text_factory_images_matches_add"), func = Marshal.GetFunctionPointerForDelegate(efl_ui_text_factory_images_matches_add_static_delegate)});
156 if (efl_ui_text_factory_images_matches_del_static_delegate == null)
157 efl_ui_text_factory_images_matches_del_static_delegate = new efl_ui_text_factory_images_matches_del_delegate(matches_del);
158 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(_Module.Module, "efl_ui_text_factory_images_matches_del"), func = Marshal.GetFunctionPointerForDelegate(efl_ui_text_factory_images_matches_del_static_delegate)});
159 if (efl_ui_text_factory_images_matches_mmap_add_static_delegate == null)
160 efl_ui_text_factory_images_matches_mmap_add_static_delegate = new efl_ui_text_factory_images_matches_mmap_add_delegate(matches_mmap_add);
161 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(_Module.Module, "efl_ui_text_factory_images_matches_mmap_add"), func = Marshal.GetFunctionPointerForDelegate(efl_ui_text_factory_images_matches_mmap_add_static_delegate)});
162 if (efl_ui_text_factory_images_matches_mmap_del_static_delegate == null)
163 efl_ui_text_factory_images_matches_mmap_del_static_delegate = new efl_ui_text_factory_images_matches_mmap_del_delegate(matches_mmap_del);
164 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(_Module.Module, "efl_ui_text_factory_images_matches_mmap_del"), func = Marshal.GetFunctionPointerForDelegate(efl_ui_text_factory_images_matches_mmap_del_static_delegate)});
165 if (efl_canvas_text_factory_create_static_delegate == null)
166 efl_canvas_text_factory_create_static_delegate = new efl_canvas_text_factory_create_delegate(create);
167 descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(_Module.Module, "efl_canvas_text_factory_create"), func = Marshal.GetFunctionPointerForDelegate(efl_canvas_text_factory_create_static_delegate)});
168 descs.AddRange(base.GetEoOps(type));
171 public override IntPtr GetEflClass()
173 return Efl.Ui.TextFactory.Images.efl_ui_text_factory_images_class_get();
175 public static new IntPtr GetEflClassStatic()
177 return Efl.Ui.TextFactory.Images.efl_ui_text_factory_images_class_get();
181 [return: MarshalAs(UnmanagedType.U1)] private delegate bool efl_ui_text_factory_images_matches_add_delegate(System.IntPtr obj, System.IntPtr pd, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))] System.String name, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))] System.String path, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))] System.String key);
184 [return: MarshalAs(UnmanagedType.U1)] public delegate bool efl_ui_text_factory_images_matches_add_api_delegate(System.IntPtr obj, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))] System.String name, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))] System.String path, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))] System.String key);
185 public static Efl.Eo.FunctionWrapper<efl_ui_text_factory_images_matches_add_api_delegate> efl_ui_text_factory_images_matches_add_ptr = new Efl.Eo.FunctionWrapper<efl_ui_text_factory_images_matches_add_api_delegate>(_Module, "efl_ui_text_factory_images_matches_add");
186 private static bool matches_add(System.IntPtr obj, System.IntPtr pd, System.String name, System.String path, System.String key)
188 Eina.Log.Debug("function efl_ui_text_factory_images_matches_add was called");
189 Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.data_get(pd);
190 if(wrapper != null) {
191 bool _ret_var = default(bool);
193 _ret_var = ((Images)wrapper).AddMatches( name, path, key);
194 } catch (Exception e) {
195 Eina.Log.Warning($"Callback error: {e.ToString()}");
196 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
200 return efl_ui_text_factory_images_matches_add_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), name, path, key);
203 private static efl_ui_text_factory_images_matches_add_delegate efl_ui_text_factory_images_matches_add_static_delegate;
206 [return: MarshalAs(UnmanagedType.U1)] private delegate bool efl_ui_text_factory_images_matches_del_delegate(System.IntPtr obj, System.IntPtr pd, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))] System.String key);
209 [return: MarshalAs(UnmanagedType.U1)] public delegate bool efl_ui_text_factory_images_matches_del_api_delegate(System.IntPtr obj, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))] System.String key);
210 public static Efl.Eo.FunctionWrapper<efl_ui_text_factory_images_matches_del_api_delegate> efl_ui_text_factory_images_matches_del_ptr = new Efl.Eo.FunctionWrapper<efl_ui_text_factory_images_matches_del_api_delegate>(_Module, "efl_ui_text_factory_images_matches_del");
211 private static bool matches_del(System.IntPtr obj, System.IntPtr pd, System.String key)
213 Eina.Log.Debug("function efl_ui_text_factory_images_matches_del was called");
214 Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.data_get(pd);
215 if(wrapper != null) {
216 bool _ret_var = default(bool);
218 _ret_var = ((Images)wrapper).DelMatches( key);
219 } catch (Exception e) {
220 Eina.Log.Warning($"Callback error: {e.ToString()}");
221 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
225 return efl_ui_text_factory_images_matches_del_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), key);
228 private static efl_ui_text_factory_images_matches_del_delegate efl_ui_text_factory_images_matches_del_static_delegate;
231 [return: MarshalAs(UnmanagedType.U1)] private delegate bool efl_ui_text_factory_images_matches_mmap_add_delegate(System.IntPtr obj, System.IntPtr pd, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))] System.String name, Eina.File file, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))] System.String key);
234 [return: MarshalAs(UnmanagedType.U1)] public delegate bool efl_ui_text_factory_images_matches_mmap_add_api_delegate(System.IntPtr obj, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))] System.String name, Eina.File file, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))] System.String key);
235 public static Efl.Eo.FunctionWrapper<efl_ui_text_factory_images_matches_mmap_add_api_delegate> efl_ui_text_factory_images_matches_mmap_add_ptr = new Efl.Eo.FunctionWrapper<efl_ui_text_factory_images_matches_mmap_add_api_delegate>(_Module, "efl_ui_text_factory_images_matches_mmap_add");
236 private static bool matches_mmap_add(System.IntPtr obj, System.IntPtr pd, System.String name, Eina.File file, System.String key)
238 Eina.Log.Debug("function efl_ui_text_factory_images_matches_mmap_add was called");
239 Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.data_get(pd);
240 if(wrapper != null) {
241 bool _ret_var = default(bool);
243 _ret_var = ((Images)wrapper).AddMatchesMmap( name, file, key);
244 } catch (Exception e) {
245 Eina.Log.Warning($"Callback error: {e.ToString()}");
246 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
250 return efl_ui_text_factory_images_matches_mmap_add_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), name, file, key);
253 private static efl_ui_text_factory_images_matches_mmap_add_delegate efl_ui_text_factory_images_matches_mmap_add_static_delegate;
256 [return: MarshalAs(UnmanagedType.U1)] private delegate bool efl_ui_text_factory_images_matches_mmap_del_delegate(System.IntPtr obj, System.IntPtr pd, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))] System.String key);
259 [return: MarshalAs(UnmanagedType.U1)] public delegate bool efl_ui_text_factory_images_matches_mmap_del_api_delegate(System.IntPtr obj, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))] System.String key);
260 public static Efl.Eo.FunctionWrapper<efl_ui_text_factory_images_matches_mmap_del_api_delegate> efl_ui_text_factory_images_matches_mmap_del_ptr = new Efl.Eo.FunctionWrapper<efl_ui_text_factory_images_matches_mmap_del_api_delegate>(_Module, "efl_ui_text_factory_images_matches_mmap_del");
261 private static bool matches_mmap_del(System.IntPtr obj, System.IntPtr pd, System.String key)
263 Eina.Log.Debug("function efl_ui_text_factory_images_matches_mmap_del was called");
264 Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.data_get(pd);
265 if(wrapper != null) {
266 bool _ret_var = default(bool);
268 _ret_var = ((Images)wrapper).DelMatchesMmap( key);
269 } catch (Exception e) {
270 Eina.Log.Warning($"Callback error: {e.ToString()}");
271 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
275 return efl_ui_text_factory_images_matches_mmap_del_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), key);
278 private static efl_ui_text_factory_images_matches_mmap_del_delegate efl_ui_text_factory_images_matches_mmap_del_static_delegate;
281 [return:MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.MarshalTest<Efl.Canvas.Object, Efl.Eo.OwnTag>))] private delegate Efl.Canvas.Object efl_canvas_text_factory_create_delegate(System.IntPtr obj, System.IntPtr pd, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.MarshalTest<Efl.Canvas.Object, Efl.Eo.NonOwnTag>))] Efl.Canvas.Object kw_object, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))] System.String key);
284 [return:MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.MarshalTest<Efl.Canvas.Object, Efl.Eo.OwnTag>))] public delegate Efl.Canvas.Object efl_canvas_text_factory_create_api_delegate(System.IntPtr obj, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.MarshalTest<Efl.Canvas.Object, Efl.Eo.NonOwnTag>))] Efl.Canvas.Object kw_object, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef=typeof(Efl.Eo.StringKeepOwnershipMarshaler))] System.String key);
285 public static Efl.Eo.FunctionWrapper<efl_canvas_text_factory_create_api_delegate> efl_canvas_text_factory_create_ptr = new Efl.Eo.FunctionWrapper<efl_canvas_text_factory_create_api_delegate>(_Module, "efl_canvas_text_factory_create");
286 private static Efl.Canvas.Object create(System.IntPtr obj, System.IntPtr pd, Efl.Canvas.Object kw_object, System.String key)
288 Eina.Log.Debug("function efl_canvas_text_factory_create was called");
289 Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.data_get(pd);
290 if(wrapper != null) {
291 Efl.Canvas.Object _ret_var = default(Efl.Canvas.Object);
293 _ret_var = ((Images)wrapper).Create( kw_object, key);
294 } catch (Exception e) {
295 Eina.Log.Warning($"Callback error: {e.ToString()}");
296 Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION);
300 return efl_canvas_text_factory_create_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj)), kw_object, key);
303 private static efl_canvas_text_factory_create_delegate efl_canvas_text_factory_create_static_delegate;