X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=internals%2Fsrc%2FEflSharp%2FEflSharp%2Fefl%2Fefl_playable.eo.cs;h=1f78581873644d0c303b156f033c6722ca869cfe;hb=07e87ad5f5e45261cab98307bf1bc16bd7d1f23e;hp=f7a13bbf5294ccb2c01a94d92ec8255d9be6238c;hpb=901af237681283f6887ffc46fd7f66c4186bf280;p=platform%2Fcore%2Fcsapi%2Ftizenfx.git diff --git a/internals/src/EflSharp/EflSharp/efl/efl_playable.eo.cs b/internals/src/EflSharp/EflSharp/efl/efl_playable.eo.cs index f7a13bb..1f78581 100644 --- a/internals/src/EflSharp/EflSharp/efl/efl_playable.eo.cs +++ b/internals/src/EflSharp/EflSharp/efl/efl_playable.eo.cs @@ -3,19 +3,19 @@ using System; using System.Runtime.InteropServices; using System.Collections.Generic; using System.Linq; +using System.Threading; using System.ComponentModel; -namespace Efl { +namespace Efl { + /// Efl media playable interface -[IPlayableNativeInherit] +[Efl.IPlayableConcrete.NativeMethods] public interface IPlayable : Efl.Eo.IWrapper, IDisposable { /// Get the length of play for the media file. /// The length of the stream in seconds. double GetLength(); - /// -/// -bool GetPlayable(); + bool GetPlayable(); /// Get whether the media file is seekable. /// true if seekable. bool GetSeekable(); @@ -24,9 +24,7 @@ bool GetSeekable(); double Length { get ; } - /// -/// - bool Playable { + bool Playable { get ; } /// Get whether the media file is seekable. @@ -42,86 +40,119 @@ IPlayable { ///Pointer to the native class description. - public System.IntPtr NativeClass { - get { - if (((object)this).GetType() == typeof (IPlayableConcrete)) - return Efl.IPlayableNativeInherit.GetEflClassStatic(); + public System.IntPtr NativeClass + { + get + { + if (((object)this).GetType() == typeof(IPlayableConcrete)) + { + return GetEflClassStatic(); + } else + { return Efl.Eo.ClassRegister.klassFromType[((object)this).GetType()]; + } } } + private System.IntPtr handle; ///Pointer to the native instance. - public System.IntPtr NativeHandle { + public System.IntPtr NativeHandle + { get { return handle; } } + [System.Runtime.InteropServices.DllImport(efl.Libs.Efl)] internal static extern System.IntPtr efl_playable_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. + /// Initializes a new instance of the class. + /// Internal usage: This is used when interacting with C code and should not be used directly. private IPlayableConcrete(System.IntPtr raw) { handle = raw; - RegisterEventProxies(); } ///Destructor. ~IPlayableConcrete() { Dispose(false); } + ///Releases the underlying native instance. - void Dispose(bool disposing) + private void Dispose(bool disposing) { - if (handle != System.IntPtr.Zero) { - Efl.Eo.Globals.efl_unref(handle); - handle = System.IntPtr.Zero; + if (handle != System.IntPtr.Zero) + { + IntPtr h = handle; + handle = IntPtr.Zero; + + IntPtr gcHandlePtr = IntPtr.Zero; + if (disposing) + { + Efl.Eo.Globals.efl_mono_native_dispose(h, gcHandlePtr); + } + else + { + Monitor.Enter(Efl.All.InitLock); + if (Efl.All.MainLoopInitialized) + { + Efl.Eo.Globals.efl_mono_thread_safe_native_dispose(h, gcHandlePtr); + } + + Monitor.Exit(Efl.All.InitLock); + } } + } + ///Releases the underlying native instance. public void Dispose() { Dispose(true); GC.SuppressFinalize(this); } - ///Verifies if the given object is equal to this one. - public override bool Equals(object obj) + + /// Verifies if the given object is equal to this one. + /// The object to compare to. + /// True if both objects point to the same native object. + public override bool Equals(object instance) { - var other = obj as Efl.Object; + var other = instance 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. + + /// Gets the hash code for this object based on the native pointer it points to. + /// The value of the pointer, to be used as the hash code of this object. public override int GetHashCode() { return this.NativeHandle.ToInt32(); } - ///Turns the native pointer into a string representation. + + /// Turns the native pointer into a string representation. + /// A string with the type and the native pointer for this object. public override String ToString() { return $"{this.GetType().Name}@[{this.NativeHandle.ToInt32():x}]"; } - ///Register the Eo event wrappers making the bridge to C# events. Internal usage only. - void RegisterEventProxies() - { - } + /// Get the length of play for the media file. /// The length of the stream in seconds. public double GetLength() { - var _ret_var = Efl.IPlayableNativeInherit.efl_playable_length_get_ptr.Value.Delegate(this.NativeHandle); + var _ret_var = Efl.IPlayableConcrete.NativeMethods.efl_playable_length_get_ptr.Value.Delegate(this.NativeHandle); Eina.Error.RaiseIfUnhandledException(); return _ret_var; } - /// - /// public bool GetPlayable() { - var _ret_var = Efl.IPlayableNativeInherit.efl_playable_get_ptr.Value.Delegate(this.NativeHandle); + var _ret_var = Efl.IPlayableConcrete.NativeMethods.efl_playable_get_ptr.Value.Delegate(this.NativeHandle); Eina.Error.RaiseIfUnhandledException(); return _ret_var; } /// Get whether the media file is seekable. /// true if seekable. public bool GetSeekable() { - var _ret_var = Efl.IPlayableNativeInherit.efl_playable_seekable_get_ptr.Value.Delegate(this.NativeHandle); + var _ret_var = Efl.IPlayableConcrete.NativeMethods.efl_playable_seekable_get_ptr.Value.Delegate(this.NativeHandle); Eina.Error.RaiseIfUnhandledException(); return _ret_var; } @@ -130,9 +161,7 @@ IPlayable public double Length { get { return GetLength(); } } - /// -/// - public bool Playable { + public bool Playable { get { return GetPlayable(); } } /// Get whether the media file is seekable. @@ -144,109 +173,170 @@ IPlayable { return Efl.IPlayableConcrete.efl_playable_interface_get(); } -} -public class IPlayableNativeInherit : 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(); - var methods = Efl.Eo.Globals.GetUserMethods(type); - if (efl_playable_length_get_static_delegate == null) - efl_playable_length_get_static_delegate = new efl_playable_length_get_delegate(length_get); - if (methods.FirstOrDefault(m => m.Name == "GetLength") != null) - descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(_Module.Module, "efl_playable_length_get"), func = Marshal.GetFunctionPointerForDelegate(efl_playable_length_get_static_delegate)}); - if (efl_playable_get_static_delegate == null) - efl_playable_get_static_delegate = new efl_playable_get_delegate(playable_get); - if (methods.FirstOrDefault(m => m.Name == "GetPlayable") != null) - descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(_Module.Module, "efl_playable_get"), func = Marshal.GetFunctionPointerForDelegate(efl_playable_get_static_delegate)}); - if (efl_playable_seekable_get_static_delegate == null) - efl_playable_seekable_get_static_delegate = new efl_playable_seekable_get_delegate(seekable_get); - if (methods.FirstOrDefault(m => m.Name == "GetSeekable") != null) - descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(_Module.Module, "efl_playable_seekable_get"), func = Marshal.GetFunctionPointerForDelegate(efl_playable_seekable_get_static_delegate)}); - return descs; - } - public override IntPtr GetEflClass() - { - return Efl.IPlayableConcrete.efl_playable_interface_get(); - } - public static IntPtr GetEflClassStatic() + /// Wrapper for native methods and virtual method delegates. + /// For internal use by generated code only. + public class NativeMethods : Efl.Eo.NativeClass { - return Efl.IPlayableConcrete.efl_playable_interface_get(); - } + private static Efl.Eo.NativeModule Module = new Efl.Eo.NativeModule( efl.Libs.Efl); + /// Gets the list of Eo operations to override. + /// The list of Eo operations to be overload. + public override System.Collections.Generic.List GetEoOps(System.Type type) + { + var descs = new System.Collections.Generic.List(); + var methods = Efl.Eo.Globals.GetUserMethods(type); + if (efl_playable_length_get_static_delegate == null) + { + efl_playable_length_get_static_delegate = new efl_playable_length_get_delegate(length_get); + } - private delegate double efl_playable_length_get_delegate(System.IntPtr obj, System.IntPtr pd); + if (methods.FirstOrDefault(m => m.Name == "GetLength") != null) + { + descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(Module.Module, "efl_playable_length_get"), func = Marshal.GetFunctionPointerForDelegate(efl_playable_length_get_static_delegate) }); + } + if (efl_playable_get_static_delegate == null) + { + efl_playable_get_static_delegate = new efl_playable_get_delegate(playable_get); + } - public delegate double efl_playable_length_get_api_delegate(System.IntPtr obj); - public static Efl.Eo.FunctionWrapper efl_playable_length_get_ptr = new Efl.Eo.FunctionWrapper(_Module, "efl_playable_length_get"); - private static double length_get(System.IntPtr obj, System.IntPtr pd) - { - Eina.Log.Debug("function efl_playable_length_get was called"); - Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.PrivateDataGet(pd); - if(wrapper != null) { - double _ret_var = default(double); - try { - _ret_var = ((IPlayable)wrapper).GetLength(); - } catch (Exception e) { - Eina.Log.Warning($"Callback error: {e.ToString()}"); - Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION); + if (methods.FirstOrDefault(m => m.Name == "GetPlayable") != null) + { + descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(Module.Module, "efl_playable_get"), func = Marshal.GetFunctionPointerForDelegate(efl_playable_get_static_delegate) }); } - return _ret_var; - } else { - return efl_playable_length_get_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj))); + + if (efl_playable_seekable_get_static_delegate == null) + { + efl_playable_seekable_get_static_delegate = new efl_playable_seekable_get_delegate(seekable_get); + } + + if (methods.FirstOrDefault(m => m.Name == "GetSeekable") != null) + { + descs.Add(new Efl_Op_Description() {api_func = Efl.Eo.FunctionInterop.LoadFunctionPointer(Module.Module, "efl_playable_seekable_get"), func = Marshal.GetFunctionPointerForDelegate(efl_playable_seekable_get_static_delegate) }); + } + + return descs; + } + /// Returns the Eo class for the native methods of this class. + /// The native class pointer. + public override IntPtr GetEflClass() + { + return Efl.IPlayableConcrete.efl_playable_interface_get(); } - } - private static efl_playable_length_get_delegate efl_playable_length_get_static_delegate; + #pragma warning disable CA1707, SA1300, SA1600 - [return: MarshalAs(UnmanagedType.U1)] private delegate bool efl_playable_get_delegate(System.IntPtr obj, System.IntPtr pd); + + private delegate double efl_playable_length_get_delegate(System.IntPtr obj, System.IntPtr pd); + + public delegate double efl_playable_length_get_api_delegate(System.IntPtr obj); + + public static Efl.Eo.FunctionWrapper efl_playable_length_get_ptr = new Efl.Eo.FunctionWrapper(Module, "efl_playable_length_get"); + + private static double length_get(System.IntPtr obj, System.IntPtr pd) + { + Eina.Log.Debug("function efl_playable_length_get was called"); + Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.PrivateDataGet(pd); + if (wrapper != null) + { + double _ret_var = default(double); + try + { + _ret_var = ((IPlayable)wrapper).GetLength(); + } + catch (Exception e) + { + Eina.Log.Warning($"Callback error: {e.ToString()}"); + Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION); + } - [return: MarshalAs(UnmanagedType.U1)] public delegate bool efl_playable_get_api_delegate(System.IntPtr obj); - public static Efl.Eo.FunctionWrapper efl_playable_get_ptr = new Efl.Eo.FunctionWrapper(_Module, "efl_playable_get"); - private static bool playable_get(System.IntPtr obj, System.IntPtr pd) - { - Eina.Log.Debug("function efl_playable_get was called"); - Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.PrivateDataGet(pd); - if(wrapper != null) { - bool _ret_var = default(bool); - try { - _ret_var = ((IPlayable)wrapper).GetPlayable(); - } catch (Exception e) { - Eina.Log.Warning($"Callback error: {e.ToString()}"); - Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION); - } return _ret_var; - } else { - return efl_playable_get_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj))); + + } + else + { + return efl_playable_length_get_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj))); + } } - } - private static efl_playable_get_delegate efl_playable_get_static_delegate; + private static efl_playable_length_get_delegate efl_playable_length_get_static_delegate; - [return: MarshalAs(UnmanagedType.U1)] private delegate bool efl_playable_seekable_get_delegate(System.IntPtr obj, System.IntPtr pd); + [return: MarshalAs(UnmanagedType.U1)] + private delegate bool efl_playable_get_delegate(System.IntPtr obj, System.IntPtr pd); + [return: MarshalAs(UnmanagedType.U1)] + public delegate bool efl_playable_get_api_delegate(System.IntPtr obj); - [return: MarshalAs(UnmanagedType.U1)] public delegate bool efl_playable_seekable_get_api_delegate(System.IntPtr obj); - public static Efl.Eo.FunctionWrapper efl_playable_seekable_get_ptr = new Efl.Eo.FunctionWrapper(_Module, "efl_playable_seekable_get"); - private static bool seekable_get(System.IntPtr obj, System.IntPtr pd) - { - Eina.Log.Debug("function efl_playable_seekable_get was called"); - Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.PrivateDataGet(pd); - if(wrapper != null) { - bool _ret_var = default(bool); - try { - _ret_var = ((IPlayable)wrapper).GetSeekable(); - } catch (Exception e) { - Eina.Log.Warning($"Callback error: {e.ToString()}"); - Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION); + public static Efl.Eo.FunctionWrapper efl_playable_get_ptr = new Efl.Eo.FunctionWrapper(Module, "efl_playable_get"); + + private static bool playable_get(System.IntPtr obj, System.IntPtr pd) + { + Eina.Log.Debug("function efl_playable_get was called"); + Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.PrivateDataGet(pd); + if (wrapper != null) + { + bool _ret_var = default(bool); + try + { + _ret_var = ((IPlayable)wrapper).GetPlayable(); + } + catch (Exception e) + { + Eina.Log.Warning($"Callback error: {e.ToString()}"); + Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION); + } + + return _ret_var; + + } + else + { + return efl_playable_get_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj))); } + } + + private static efl_playable_get_delegate efl_playable_get_static_delegate; + + [return: MarshalAs(UnmanagedType.U1)] + private delegate bool efl_playable_seekable_get_delegate(System.IntPtr obj, System.IntPtr pd); + + [return: MarshalAs(UnmanagedType.U1)] + public delegate bool efl_playable_seekable_get_api_delegate(System.IntPtr obj); + + public static Efl.Eo.FunctionWrapper efl_playable_seekable_get_ptr = new Efl.Eo.FunctionWrapper(Module, "efl_playable_seekable_get"); + + private static bool seekable_get(System.IntPtr obj, System.IntPtr pd) + { + Eina.Log.Debug("function efl_playable_seekable_get was called"); + Efl.Eo.IWrapper wrapper = Efl.Eo.Globals.PrivateDataGet(pd); + if (wrapper != null) + { + bool _ret_var = default(bool); + try + { + _ret_var = ((IPlayable)wrapper).GetSeekable(); + } + catch (Exception e) + { + Eina.Log.Warning($"Callback error: {e.ToString()}"); + Eina.Error.Set(Eina.Error.UNHANDLED_EXCEPTION); + } + return _ret_var; - } else { - return efl_playable_seekable_get_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj))); + + } + else + { + return efl_playable_seekable_get_ptr.Value.Delegate(Efl.Eo.Globals.efl_super(obj, Efl.Eo.Globals.efl_class_get(obj))); + } } - } - private static efl_playable_seekable_get_delegate efl_playable_seekable_get_static_delegate; + + private static efl_playable_seekable_get_delegate efl_playable_seekable_get_static_delegate; + + #pragma warning restore CA1707, SA1300, SA1600 + +} } -} +} +