From: huiyueun <35286162+huiyueun@users.noreply.github.com> Date: Tue, 15 Jan 2019 10:17:58 +0000 (+0900) Subject: [NUI] Clean NUI codes from Adaptor.cs to Window.cs (#652) X-Git-Tag: 5.5_M2~340 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=47c2a1b5c918c026a4b6dc6535db5d15851aa89b;p=platform%2Fcore%2Fcsapi%2Ftizenfx.git [NUI] Clean NUI codes from Adaptor.cs to Window.cs (#652) * [NUI] Clean NUI codes from Adaptor.cs to Window.cs Change-Id: Ic1e5458dd1b3b4ac43cff028204254ac378d2f86 Signed-off-by: huiyu.eun * [NUI] fix codecay Signed-off-by: huiyu.eun * Remove StereoMode Change-Id: If19a2e403114bf5375e914584e1e7fa513f7d889 * Sync dalihub and Samsung's TizenFX codes Change-Id: I634fbe56ff9772c05f5ba59736289b3eca7d3def Signed-off-by: dongsug.song Signed-off-by: huiyu.eun * [NUI] Remove deprecated APIs in native DALi Change-Id: Icc5d90e6e5752fc3b24ce3ea29cd11a89280b4b7 Signed-off-by: Seoyeon Kim * [fix codecay] Signed-off-by: huiyu.eun * [NUI] Add test sample for C# binding of MatchSystemLanguageDirection Change-Id: I0ac4e82c0e026ee1c5074ec00fb4677c4690ddfe * [NUI] Clean code: BaseComponents,UIComponents,CustomView Change-Id: I6fbd47154f179ba3a908d140f0cfb267c1e76c2d --- diff --git a/src/Tizen.NUI/src/internal/Application.cs b/src/Tizen.NUI/src/internal/Application.cs index dc868c8..e44d802 100755 --- a/src/Tizen.NUI/src/internal/Application.cs +++ b/src/Tizen.NUI/src/internal/Application.cs @@ -432,7 +432,7 @@ namespace Tizen.NUI ResourceDictionary _resources; public bool IsResourcesCreated => _resources != null; - public delegate void resChangeCb (object sender, ResourcesChangedEventArgs e); + public delegate void resChangeCb(object sender, ResourcesChangedEventArgs e); static private Dictionary> resourceChangeCallbackDict = new Dictionary>(); static public void AddResourceChangedCallback(object handle, resChangeCb cb) @@ -956,15 +956,11 @@ namespace Tizen.NUI // Initialize DisposeQueue Singleton class. This is also required to create DisposeQueue on main thread. DisposeQueue.Instance.Initialize(); - NUIApplicationInitEventArgs e = new NUIApplicationInitEventArgs(); - // Populate all members of "e" (NUIApplicationInitEventArgs) with real data - using (e.Application = Application.GetApplicationFromPtr(data)) + if (_applicationInitEventHandler != null) { - if (_applicationInitEventHandler != null) - { - //here we send all data to user event handlers - _applicationInitEventHandler(this, e); - } + NUIApplicationInitEventArgs e = new NUIApplicationInitEventArgs(); + e.Application = this; + _applicationInitEventHandler.Invoke(this, e); } } @@ -1007,17 +1003,14 @@ namespace Tizen.NUI // Callback for Application TerminateSignal private void OnNUIApplicationTerminate(IntPtr data) { - NUIApplicationTerminatingEventArgs e = new NUIApplicationTerminatingEventArgs(); - - // Populate all members of "e" (NUIApplicationTerminateEventArgs) with real data - using (e.Application = Application.GetApplicationFromPtr(data)) + if (_applicationTerminateEventHandler != null) { - if (_applicationTerminateEventHandler != null) - { - //here we send all data to user event handlers - _applicationTerminateEventHandler(this, e); - } + NUIApplicationTerminatingEventArgs e = new NUIApplicationTerminatingEventArgs(); + e.Application = this; + _applicationTerminateEventHandler.Invoke(this, e); } + + Window.Instance.DisconnectNativeSignals(); } /** @@ -1058,16 +1051,11 @@ namespace Tizen.NUI // Callback for Application PauseSignal private void OnNUIApplicationPause(IntPtr data) { - NUIApplicationPausedEventArgs e = new NUIApplicationPausedEventArgs(); - - // Populate all members of "e" (NUIApplicationPauseEventArgs) with real data - using (e.Application = Application.GetApplicationFromPtr(data)) + if (_applicationPauseEventHandler != null) { - if (_applicationPauseEventHandler != null) - { - //here we send all data to user event handlers - _applicationPauseEventHandler(this, e); - } + NUIApplicationPausedEventArgs e = new NUIApplicationPausedEventArgs(); + e.Application = this; + _applicationPauseEventHandler.Invoke(this, e); } } @@ -1109,16 +1097,11 @@ namespace Tizen.NUI // Callback for Application ResumeSignal private void OnNUIApplicationResume(IntPtr data) { - NUIApplicationResumedEventArgs e = new NUIApplicationResumedEventArgs(); - - // Populate all members of "e" (NUIApplicationResumeEventArgs) with real data - using (e.Application = Application.GetApplicationFromPtr(data)) + if (_applicationResumeEventHandler != null) { - if (_applicationResumeEventHandler != null) - { - //here we send all data to user event handlers - _applicationResumeEventHandler(this, e); - } + NUIApplicationResumedEventArgs e = new NUIApplicationResumedEventArgs(); + e.Application = this; + _applicationResumeEventHandler.Invoke(this, e); } } @@ -1160,16 +1143,11 @@ namespace Tizen.NUI // Callback for Application ResetSignal private void OnNUIApplicationReset(IntPtr data) { - NUIApplicationResetEventArgs e = new NUIApplicationResetEventArgs(); - - // Populate all members of "e" (NUIApplicationResetEventArgs) with real data - using (e.Application = Application.GetApplicationFromPtr(data)) + if (_applicationResetEventHandler != null) { - if (_applicationResetEventHandler != null) - { - //here we send all data to user event handlers - _applicationResetEventHandler(this, e); - } + NUIApplicationResetEventArgs e = new NUIApplicationResetEventArgs(); + e.Application = this; + _applicationResetEventHandler.Invoke(this, e); } } @@ -1211,16 +1189,11 @@ namespace Tizen.NUI // Callback for Application ResizeSignal private void OnNUIApplicationResize(IntPtr data) { - NUIApplicationResizedEventArgs e = new NUIApplicationResizedEventArgs(); - - // Populate all members of "e" (NUIApplicationResizeEventArgs) with real data - using (e.Application = Application.GetApplicationFromPtr(data)) + if (_applicationResizeEventHandler != null) { - if (_applicationResizeEventHandler != null) - { - //here we send all data to user event handlers - _applicationResizeEventHandler(this, e); - } + NUIApplicationResizedEventArgs e = new NUIApplicationResizedEventArgs(); + e.Application = this; + _applicationResizeEventHandler.Invoke(this, e); } } @@ -1262,16 +1235,11 @@ namespace Tizen.NUI // Callback for Application LanguageChangedSignal private void OnNUIApplicationLanguageChanged(IntPtr data) { - NUIApplicationLanguageChangedEventArgs e = new NUIApplicationLanguageChangedEventArgs(); - - // Populate all members of "e" (NUIApplicationLanguageChangedEventArgs) with real data - using (e.Application = Application.GetApplicationFromPtr(data)) + if (_applicationLanguageChangedEventHandler != null) { - if (_applicationLanguageChangedEventHandler != null) - { - //here we send all data to user event handlers - _applicationLanguageChangedEventHandler(this, e); - } + NUIApplicationLanguageChangedEventArgs e = new NUIApplicationLanguageChangedEventArgs(); + e.Application = this; + _applicationLanguageChangedEventHandler.Invoke(this, e); } } @@ -1313,16 +1281,11 @@ namespace Tizen.NUI // Callback for Application RegionChangedSignal private void OnNUIApplicationRegionChanged(IntPtr data) { - NUIApplicationRegionChangedEventArgs e = new NUIApplicationRegionChangedEventArgs(); - - // Populate all members of "e" (NUIApplicationRegionChangedEventArgs) with real data - using (e.Application = Application.GetApplicationFromPtr(data)) + if (_applicationRegionChangedEventHandler != null) { - if (_applicationRegionChangedEventHandler != null) - { - //here we send all data to user event handlers - _applicationRegionChangedEventHandler(this, e); - } + NUIApplicationRegionChangedEventArgs e = new NUIApplicationRegionChangedEventArgs(); + e.Application = this; + _applicationRegionChangedEventHandler.Invoke(this, e); } } @@ -1368,12 +1331,7 @@ namespace Tizen.NUI // Populate all members of "e" (NUIApplicationBatteryLowEventArgs) with real data e.BatteryStatus = status; - - if (_applicationBatteryLowEventHandler != null) - { - //here we send all data to user event handlers - _applicationBatteryLowEventHandler(this, e); - } + _applicationBatteryLowEventHandler?.Invoke(this, e); } /** @@ -1418,12 +1376,7 @@ namespace Tizen.NUI // Populate all members of "e" (NUIApplicationMemoryLowEventArgs) with real data e.MemoryStatus = status; - - if (_applicationMemoryLowEventHandler != null) - { - //here we send all data to user event handlers - _applicationMemoryLowEventHandler(this, e); - } + _applicationMemoryLowEventHandler?.Invoke(this, e); } /** @@ -1464,17 +1417,12 @@ namespace Tizen.NUI // Callback for Application AppControlSignal private void OnNUIApplicationAppControl(IntPtr application, IntPtr voidp) { - NUIApplicationAppControlEventArgs e = new NUIApplicationAppControlEventArgs(); - e.VoidP = voidp; - - // Populate all members of "e" (NUIApplicationAppControlEventArgs) with real data - using (e.Application = Application.GetApplicationFromPtr(application)) + if (_applicationAppControlEventHandler != null) { - if (_applicationAppControlEventHandler != null) - { - //here we send all data to user event handlers - _applicationAppControlEventHandler(this, e); - } + NUIApplicationAppControlEventArgs e = new NUIApplicationAppControlEventArgs(); + e.VoidP = voidp; + e.Application = this; + _applicationAppControlEventHandler.Invoke(this, e); } } @@ -1490,7 +1438,12 @@ namespace Tizen.NUI public static Application GetApplicationFromPtr(global::System.IntPtr cPtr) { - Application ret = new Application(cPtr, false); + if (cPtr == global::System.IntPtr.Zero) + { + return null; + } + + Application ret = Registry.GetManagedBaseHandleFromNativePtr(cPtr) as Application; if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } @@ -1662,32 +1615,6 @@ namespace Tizen.NUI return ret; } - internal void SetViewMode(ViewMode viewMode) - { - NDalicPINVOKE.Application_SetViewMode(swigCPtr, (int)viewMode); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - internal ViewMode GetViewMode() - { - ViewMode ret = (ViewMode)NDalicPINVOKE.Application_GetViewMode(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - public void SetStereoBase(float stereoBase) - { - NDalicPINVOKE.Application_SetStereoBase(swigCPtr, stereoBase); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - public float GetStereoBase() - { - float ret = NDalicPINVOKE.Application_GetStereoBase(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - public string GetLanguage() { string ret = NDalicPINVOKE.Application_GetLanguage(swigCPtr); diff --git a/src/Tizen.NUI/src/internal/DaliEnumConstants.cs b/src/Tizen.NUI/src/internal/DaliEnumConstants.cs index be815da..04d68cf 100755 --- a/src/Tizen.NUI/src/internal/DaliEnumConstants.cs +++ b/src/Tizen.NUI/src/internal/DaliEnumConstants.cs @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016 Samsung Electronics Co., Ltd. + * Copyright (c) 2018 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -21,53 +21,25 @@ using System.Runtime.CompilerServices; namespace Tizen.NUI { - namespace Constants - { - /// - /// Enumeration for texture types. - /// - /// 3 - public enum TextureType + namespace Constants { - /// - /// One 2D image - /// - /// 3 - Texture2D = Tizen.NUI.TextureType.TEXTURE_2D, - /// - /// Six 2D images arranged in a cube-shape - /// - /// 3 - TextureCube = Tizen.NUI.TextureType.TEXTURE_CUBE - } - - /// - /// Enumeration for stereoscopic view modes. - /// - /// 3 - public enum ViewMode - { - /// - /// Monoscopic (single camera). This is the default. - /// - /// 3 - Mono = Tizen.NUI.ViewMode.MONO, - /// - /// Stereoscopic. Frame buffer is split horizontally with the left and right camera views in their respective sides. - /// - /// 3 - StereoHorizontal = Tizen.NUI.ViewMode.STEREO_HORIZONTAL, - /// - /// Stereoscopic. Frame buffer is split vertically with the left camera view at the top and the right camera view at the bottom. - /// - /// 3 - StereoVertical = Tizen.NUI.ViewMode.STEREO_VERTICAL, - /// - /// Stereoscopic. Left/Right camera views are rendered into the framebuffer on alternate frames. - /// - /// 3 - StereoInterlaced = Tizen.NUI.ViewMode.STEREO_INTERLACED - } + /// + /// Enumeration for texture types. + /// + /// 3 + public enum TextureType + { + /// + /// One 2D image + /// + /// 3 + Texture2D = Tizen.NUI.TextureType.TEXTURE_2D, + /// + /// Six 2D images arranged in a cube-shape + /// + /// 3 + TextureCube = Tizen.NUI.TextureType.TEXTURE_CUBE + } /// /// Enumeration for the direction @@ -94,8 +66,6 @@ namespace Tizen.NUI } } - - /// /// ToolTip /// diff --git a/src/Tizen.NUI/src/internal/DisposeQueue.cs b/src/Tizen.NUI/src/internal/DisposeQueue.cs index dc75e9c..2f8e275 100755 --- a/src/Tizen.NUI/src/internal/DisposeQueue.cs +++ b/src/Tizen.NUI/src/internal/DisposeQueue.cs @@ -58,7 +58,7 @@ namespace Tizen.NUI } } - private void ProcessDisposables() + public void ProcessDisposables() { lock (_listLock) { diff --git a/src/Tizen.NUI/src/internal/Layouting/LayoutGroup.cs b/src/Tizen.NUI/src/internal/Layouting/LayoutGroup.cs index f96af9d..a838e83 100755 --- a/src/Tizen.NUI/src/internal/Layouting/LayoutGroup.cs +++ b/src/Tizen.NUI/src/internal/Layouting/LayoutGroup.cs @@ -129,7 +129,6 @@ namespace Tizen.NUI protected override void OnLayout(bool changed, LayoutLength left, LayoutLength top, LayoutLength right, LayoutLength bottom) { Log.Info("NUI", "OnLayout\n"); - for( uint i = 0; i < ChildCount; ++i ) { var childLayout = GetChildAt( i ); diff --git a/src/Tizen.NUI/src/internal/ManualPINVOKE.cs b/src/Tizen.NUI/src/internal/ManualPINVOKE.cs old mode 100644 new mode 100755 index 8d51bef..94a86c0 --- a/src/Tizen.NUI/src/internal/ManualPINVOKE.cs +++ b/src/Tizen.NUI/src/internal/ManualPINVOKE.cs @@ -6478,42 +6478,6 @@ namespace Tizen.NUI } } - [global::System.Runtime.InteropServices.DllImport(Graphics.GlesCSharpBinder, EntryPoint = "CSharp_Dali_Adaptor_SetViewMode")] - public static extern void Adaptor_SetViewMode_gl(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2); - - [global::System.Runtime.InteropServices.DllImport(Graphics.VulkanCSharpBinder, EntryPoint = "CSharp_Dali_Adaptor_SetViewMode")] - public static extern void Adaptor_SetViewMode_vulkan(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2); - - public static void Adaptor_SetViewMode(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2) - { - if (Tizen.NUI.Graphics.Backend == Tizen.NUI.Graphics.BackendType.Vulkan) - { - Adaptor_SetViewMode_vulkan(jarg1, jarg2); - } - else - { - Adaptor_SetViewMode_gl(jarg1, jarg2); - } - } - - [global::System.Runtime.InteropServices.DllImport(Graphics.GlesCSharpBinder, EntryPoint = "CSharp_Dali_Adaptor_SetStereoBase")] - public static extern void Adaptor_SetStereoBase_gl(global::System.Runtime.InteropServices.HandleRef jarg1, float jarg2); - - [global::System.Runtime.InteropServices.DllImport(Graphics.VulkanCSharpBinder, EntryPoint = "CSharp_Dali_Adaptor_SetStereoBase")] - public static extern void Adaptor_SetStereoBase_vulkan(global::System.Runtime.InteropServices.HandleRef jarg1, float jarg2); - - public static void Adaptor_SetStereoBase(global::System.Runtime.InteropServices.HandleRef jarg1, float jarg2) - { - if (Tizen.NUI.Graphics.Backend == Tizen.NUI.Graphics.BackendType.Vulkan) - { - Adaptor_SetStereoBase_vulkan(jarg1, jarg2); - } - else - { - Adaptor_SetStereoBase_gl(jarg1, jarg2); - } - } - [global::System.Runtime.InteropServices.DllImport(Graphics.GlesCSharpBinder, EntryPoint = "CSharp_Dali_Adaptor_ResizedSignal")] public static extern global::System.IntPtr Adaptor_ResizedSignal_gl(global::System.Runtime.InteropServices.HandleRef jarg1); @@ -10393,6 +10357,60 @@ namespace Tizen.NUI } } + [global::System.Runtime.InteropServices.DllImport(Graphics.GlesCSharpBinder, EntryPoint = "CSharp_TextLabel_Property_MATCH_SYSTEM_LANGUAGE_DIRECTION_get")] + public static extern int TextLabel_Property_MATCH_SYSTEM_LANGUAGE_DIRECTION_get_gl(); + + [global::System.Runtime.InteropServices.DllImport(Graphics.VulkanCSharpBinder, EntryPoint = "CSharp_TextLabel_Property_MATCH_SYSTEM_LANGUAGE_DIRECTION_get")] + public static extern int TextLabel_Property_MATCH_SYSTEM_LANGUAGE_DIRECTION_get_vulkan(); + + public static int TextLabel_Property_MATCH_SYSTEM_LANGUAGE_DIRECTION_get() + { + if (Tizen.NUI.Graphics.Backend == Tizen.NUI.Graphics.BackendType.Vulkan) + { + return TextLabel_Property_MATCH_SYSTEM_LANGUAGE_DIRECTION_get_vulkan(); + } + else + { + return TextLabel_Property_MATCH_SYSTEM_LANGUAGE_DIRECTION_get_gl(); + } + } + + [global::System.Runtime.InteropServices.DllImport(Graphics.GlesCSharpBinder, EntryPoint = "CSharp_TextField_Property_MATCH_SYSTEM_LANGUAGE_DIRECTION_get")] + public static extern int TextField_Property_MATCH_SYSTEM_LANGUAGE_DIRECTION_get_gl(); + + [global::System.Runtime.InteropServices.DllImport(Graphics.VulkanCSharpBinder, EntryPoint = "CSharp_TextField_Property_MATCH_SYSTEM_LANGUAGE_DIRECTION_get")] + public static extern int TextField_Property_MATCH_SYSTEM_LANGUAGE_DIRECTION_get_vulkan(); + + public static int TextField_Property_MATCH_SYSTEM_LANGUAGE_DIRECTION_get() + { + if (Tizen.NUI.Graphics.Backend == Tizen.NUI.Graphics.BackendType.Vulkan) + { + return TextField_Property_MATCH_SYSTEM_LANGUAGE_DIRECTION_get_vulkan(); + } + else + { + return TextField_Property_MATCH_SYSTEM_LANGUAGE_DIRECTION_get_gl(); + } + } + + [global::System.Runtime.InteropServices.DllImport(Graphics.GlesCSharpBinder, EntryPoint = "CSharp_TextEditor_Property_MATCH_SYSTEM_LANGUAGE_DIRECTION_get")] + public static extern int TextEditor_Property_MATCH_SYSTEM_LANGUAGE_DIRECTION_get_gl(); + + [global::System.Runtime.InteropServices.DllImport(Graphics.VulkanCSharpBinder, EntryPoint = "CSharp_TextEditor_Property_MATCH_SYSTEM_LANGUAGE_DIRECTION_get")] + public static extern int TextEditor_Property_MATCH_SYSTEM_LANGUAGE_DIRECTION_get_vulkan(); + + public static int TextEditor_Property_MATCH_SYSTEM_LANGUAGE_DIRECTION_get() + { + if (Tizen.NUI.Graphics.Backend == Tizen.NUI.Graphics.BackendType.Vulkan) + { + return TextEditor_Property_MATCH_SYSTEM_LANGUAGE_DIRECTION_get_vulkan(); + } + else + { + return TextEditor_Property_MATCH_SYSTEM_LANGUAGE_DIRECTION_get_gl(); + } + } + [global::System.Runtime.InteropServices.DllImport(Graphics.GlesCSharpBinder, EntryPoint = "CSharp_ImageView_IMAGE_VISUAL_ACTION_RELOAD_get")] public static extern int ImageView_IMAGE_VISUAL_ACTION_RELOAD_get_gl(); diff --git a/src/Tizen.NUI/src/internal/NDalicPINVOKE.cs b/src/Tizen.NUI/src/internal/NDalicPINVOKE.cs index 3f9b2a9..95ba653 100755 --- a/src/Tizen.NUI/src/internal/NDalicPINVOKE.cs +++ b/src/Tizen.NUI/src/internal/NDalicPINVOKE.cs @@ -205,6 +205,29 @@ namespace Tizen.NUI argumentNullDelegate, argumentOutOfRangeDelegate); } + + //Workaround for Vulkan. should be removed. + internal void SetAgain() + { + SWIGRegisterExceptionCallbacks_NDalic( + applicationDelegate, + arithmeticDelegate, + divideByZeroDelegate, + indexOutOfRangeDelegate, + invalidCastDelegate, + invalidOperationDelegate, + ioDelegate, + nullReferenceDelegate, + outOfMemoryDelegate, + overflowDelegate, + systemDelegate); + + SWIGRegisterExceptionCallbacksArgument_NDalic( + argumentDelegate, + argumentNullDelegate, + argumentOutOfRangeDelegate); + } + } protected static SWIGExceptionHelper swigExceptionHelper = new SWIGExceptionHelper(); @@ -296,10 +319,24 @@ namespace Tizen.NUI { SWIGRegisterStringCallback_NDalic(stringDelegate); } + + //Workaround for Vulkan. should be removed. + internal void SetAgain() + { + SWIGRegisterStringCallback_NDalic(stringDelegate); + } } static protected SWIGStringHelper swigStringHelper = new SWIGStringHelper(); + //Workaround for Vulkan. should be removed. + internal static void SetAgainExceptionHelperAndStringHelper() + { + swigExceptionHelper.SetAgain(); + swigStringHelper.SetAgain(); + Tizen.Log.Error("NUI", $"[NOT ERROR] SetAgainExceptionHelperAndStringHelper()"); + } + static NDalicPINVOKE() { @@ -19404,24 +19441,6 @@ namespace Tizen.NUI } } - [global::System.Runtime.InteropServices.DllImport(Graphics.GlesCSharpBinder, EntryPoint = "CSharp_Dali_Actor_Property_POSITION_INHERITANCE_get")] - public static extern int Actor_Property_POSITION_INHERITANCE_get_gl(); - - [global::System.Runtime.InteropServices.DllImport(Graphics.VulkanCSharpBinder, EntryPoint = "CSharp_Dali_Actor_Property_POSITION_INHERITANCE_get")] - public static extern int Actor_Property_POSITION_INHERITANCE_get_vulkan(); - - public static int Actor_Property_POSITION_INHERITANCE_get() - { - if (Tizen.NUI.Graphics.Backend == Tizen.NUI.Graphics.BackendType.Vulkan) - { - return Actor_Property_POSITION_INHERITANCE_get_vulkan(); - } - else - { - return Actor_Property_POSITION_INHERITANCE_get_gl(); - } - } - [global::System.Runtime.InteropServices.DllImport(Graphics.GlesCSharpBinder, EntryPoint = "CSharp_Dali_Actor_Property_DRAW_MODE_get")] public static extern int Actor_Property_DRAW_MODE_get_gl(); @@ -20430,24 +20449,6 @@ namespace Tizen.NUI } } - [global::System.Runtime.InteropServices.DllImport(Graphics.GlesCSharpBinder, EntryPoint = "CSharp_Dali_Actor_GetPositionInheritanceMode")] - public static extern int Actor_GetPositionInheritanceMode_gl(global::System.Runtime.InteropServices.HandleRef jarg1); - - [global::System.Runtime.InteropServices.DllImport(Graphics.VulkanCSharpBinder, EntryPoint = "CSharp_Dali_Actor_GetPositionInheritanceMode")] - public static extern int Actor_GetPositionInheritanceMode_vulkan(global::System.Runtime.InteropServices.HandleRef jarg1); - - public static int Actor_GetPositionInheritanceMode(global::System.Runtime.InteropServices.HandleRef jarg1) - { - if (Tizen.NUI.Graphics.Backend == Tizen.NUI.Graphics.BackendType.Vulkan) - { - return Actor_GetPositionInheritanceMode_vulkan(jarg1); - } - else - { - return Actor_GetPositionInheritanceMode_gl(jarg1); - } - } - [global::System.Runtime.InteropServices.DllImport(Graphics.GlesCSharpBinder, EntryPoint = "CSharp_Dali_Actor_IsPositionInherited")] public static extern bool Actor_IsPositionInherited_gl(global::System.Runtime.InteropServices.HandleRef jarg1); @@ -36828,6 +36829,24 @@ namespace Tizen.NUI } } + [global::System.Runtime.InteropServices.DllImport(Graphics.GlesCSharpBinder, EntryPoint = "CSharp_Dali_Window_SetPositionSize")] + public static extern void Window_SetPositionSize_gl(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2); + + [global::System.Runtime.InteropServices.DllImport(Graphics.VulkanCSharpBinder, EntryPoint = "CSharp_Dali_Window_SetPositionSize")] + public static extern void Window_SetPositionSize_vulkan(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2); + + public static void Window_SetPositionSize(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2) + { + if (Tizen.NUI.Graphics.Backend == Tizen.NUI.Graphics.BackendType.Vulkan) + { + Window_SetPositionSize_vulkan(jarg1, jarg2); + } + else + { + Window_SetPositionSize_gl(jarg1, jarg2); + } + } + [global::System.Runtime.InteropServices.DllImport(Graphics.GlesCSharpBinder, EntryPoint = "CSharp_Dali_Application_New__SWIG_0")] public static extern global::System.IntPtr Application_New__SWIG_0_gl(); @@ -37155,78 +37174,6 @@ namespace Tizen.NUI } } - [global::System.Runtime.InteropServices.DllImport(Graphics.GlesCSharpBinder, EntryPoint = "CSharp_Dali_Application_SetViewMode")] - public static extern void Application_SetViewMode_gl(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2); - - [global::System.Runtime.InteropServices.DllImport(Graphics.VulkanCSharpBinder, EntryPoint = "CSharp_Dali_Application_SetViewMode")] - public static extern void Application_SetViewMode_vulkan(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2); - - public static void Application_SetViewMode(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2) - { - if (Tizen.NUI.Graphics.Backend == Tizen.NUI.Graphics.BackendType.Vulkan) - { - Application_SetViewMode_vulkan(jarg1, jarg2); - } - else - { - Application_SetViewMode_gl(jarg1, jarg2); - } - } - - [global::System.Runtime.InteropServices.DllImport(Graphics.GlesCSharpBinder, EntryPoint = "CSharp_Dali_Application_GetViewMode")] - public static extern int Application_GetViewMode_gl(global::System.Runtime.InteropServices.HandleRef jarg1); - - [global::System.Runtime.InteropServices.DllImport(Graphics.VulkanCSharpBinder, EntryPoint = "CSharp_Dali_Application_GetViewMode")] - public static extern int Application_GetViewMode_vulkan(global::System.Runtime.InteropServices.HandleRef jarg1); - - public static int Application_GetViewMode(global::System.Runtime.InteropServices.HandleRef jarg1) - { - if (Tizen.NUI.Graphics.Backend == Tizen.NUI.Graphics.BackendType.Vulkan) - { - return Application_GetViewMode_vulkan(jarg1); - } - else - { - return Application_GetViewMode_gl(jarg1); - } - } - - [global::System.Runtime.InteropServices.DllImport(Graphics.GlesCSharpBinder, EntryPoint = "CSharp_Dali_Application_SetStereoBase")] - public static extern void Application_SetStereoBase_gl(global::System.Runtime.InteropServices.HandleRef jarg1, float jarg2); - - [global::System.Runtime.InteropServices.DllImport(Graphics.VulkanCSharpBinder, EntryPoint = "CSharp_Dali_Application_SetStereoBase")] - public static extern void Application_SetStereoBase_vulkan(global::System.Runtime.InteropServices.HandleRef jarg1, float jarg2); - - public static void Application_SetStereoBase(global::System.Runtime.InteropServices.HandleRef jarg1, float jarg2) - { - if (Tizen.NUI.Graphics.Backend == Tizen.NUI.Graphics.BackendType.Vulkan) - { - Application_SetStereoBase_vulkan(jarg1, jarg2); - } - else - { - Application_SetStereoBase_gl(jarg1, jarg2); - } - } - - [global::System.Runtime.InteropServices.DllImport(Graphics.GlesCSharpBinder, EntryPoint = "CSharp_Dali_Application_GetStereoBase")] - public static extern float Application_GetStereoBase_gl(global::System.Runtime.InteropServices.HandleRef jarg1); - - [global::System.Runtime.InteropServices.DllImport(Graphics.VulkanCSharpBinder, EntryPoint = "CSharp_Dali_Application_GetStereoBase")] - public static extern float Application_GetStereoBase_vulkan(global::System.Runtime.InteropServices.HandleRef jarg1); - - public static float Application_GetStereoBase(global::System.Runtime.InteropServices.HandleRef jarg1) - { - if (Tizen.NUI.Graphics.Backend == Tizen.NUI.Graphics.BackendType.Vulkan) - { - return Application_GetStereoBase_vulkan(jarg1); - } - else - { - return Application_GetStereoBase_gl(jarg1); - } - } - [global::System.Runtime.InteropServices.DllImport(Graphics.GlesCSharpBinder, EntryPoint = "CSharp_Dali_Application_GetLanguage")] public static extern string Application_GetLanguage_gl(global::System.Runtime.InteropServices.HandleRef jarg1); @@ -54236,42 +54183,6 @@ namespace Tizen.NUI } } - [global::System.Runtime.InteropServices.DllImport(Graphics.GlesCSharpBinder, EntryPoint = "CSharp_Dali_TextField_Property_SHADOW_OFFSET_get")] - public static extern int TextField_Property_SHADOW_OFFSET_get_gl(); - - [global::System.Runtime.InteropServices.DllImport(Graphics.VulkanCSharpBinder, EntryPoint = "CSharp_Dali_TextField_Property_SHADOW_OFFSET_get")] - public static extern int TextField_Property_SHADOW_OFFSET_get_vulkan(); - - public static int TextField_Property_SHADOW_OFFSET_get() - { - if (Tizen.NUI.Graphics.Backend == Tizen.NUI.Graphics.BackendType.Vulkan) - { - return TextField_Property_SHADOW_OFFSET_get_vulkan(); - } - else - { - return TextField_Property_SHADOW_OFFSET_get_gl(); - } - } - - [global::System.Runtime.InteropServices.DllImport(Graphics.GlesCSharpBinder, EntryPoint = "CSharp_Dali_TextField_Property_SHADOW_COLOR_get")] - public static extern int TextField_Property_SHADOW_COLOR_get_gl(); - - [global::System.Runtime.InteropServices.DllImport(Graphics.VulkanCSharpBinder, EntryPoint = "CSharp_Dali_TextField_Property_SHADOW_COLOR_get")] - public static extern int TextField_Property_SHADOW_COLOR_get_vulkan(); - - public static int TextField_Property_SHADOW_COLOR_get() - { - if (Tizen.NUI.Graphics.Backend == Tizen.NUI.Graphics.BackendType.Vulkan) - { - return TextField_Property_SHADOW_COLOR_get_vulkan(); - } - else - { - return TextField_Property_SHADOW_COLOR_get_gl(); - } - } - [global::System.Runtime.InteropServices.DllImport(Graphics.GlesCSharpBinder, EntryPoint = "CSharp_Dali_TextField_Property_PRIMARY_CURSOR_COLOR_get")] public static extern int TextField_Property_PRIMARY_CURSOR_COLOR_get_gl(); @@ -55262,96 +55173,6 @@ namespace Tizen.NUI } } - [global::System.Runtime.InteropServices.DllImport(Graphics.GlesCSharpBinder, EntryPoint = "CSharp_Dali_TextLabel_Property_SHADOW_OFFSET_get")] - public static extern int TextLabel_Property_SHADOW_OFFSET_get_gl(); - - [global::System.Runtime.InteropServices.DllImport(Graphics.VulkanCSharpBinder, EntryPoint = "CSharp_Dali_TextLabel_Property_SHADOW_OFFSET_get")] - public static extern int TextLabel_Property_SHADOW_OFFSET_get_vulkan(); - - public static int TextLabel_Property_SHADOW_OFFSET_get() - { - if (Tizen.NUI.Graphics.Backend == Tizen.NUI.Graphics.BackendType.Vulkan) - { - return TextLabel_Property_SHADOW_OFFSET_get_vulkan(); - } - else - { - return TextLabel_Property_SHADOW_OFFSET_get_gl(); - } - } - - [global::System.Runtime.InteropServices.DllImport(Graphics.GlesCSharpBinder, EntryPoint = "CSharp_Dali_TextLabel_Property_SHADOW_COLOR_get")] - public static extern int TextLabel_Property_SHADOW_COLOR_get_gl(); - - [global::System.Runtime.InteropServices.DllImport(Graphics.VulkanCSharpBinder, EntryPoint = "CSharp_Dali_TextLabel_Property_SHADOW_COLOR_get")] - public static extern int TextLabel_Property_SHADOW_COLOR_get_vulkan(); - - public static int TextLabel_Property_SHADOW_COLOR_get() - { - if (Tizen.NUI.Graphics.Backend == Tizen.NUI.Graphics.BackendType.Vulkan) - { - return TextLabel_Property_SHADOW_COLOR_get_vulkan(); - } - else - { - return TextLabel_Property_SHADOW_COLOR_get_gl(); - } - } - - [global::System.Runtime.InteropServices.DllImport(Graphics.GlesCSharpBinder, EntryPoint = "CSharp_Dali_TextLabel_Property_UNDERLINE_ENABLED_get")] - public static extern int TextLabel_Property_UNDERLINE_ENABLED_get_gl(); - - [global::System.Runtime.InteropServices.DllImport(Graphics.VulkanCSharpBinder, EntryPoint = "CSharp_Dali_TextLabel_Property_UNDERLINE_ENABLED_get")] - public static extern int TextLabel_Property_UNDERLINE_ENABLED_get_vulkan(); - - public static int TextLabel_Property_UNDERLINE_ENABLED_get() - { - if (Tizen.NUI.Graphics.Backend == Tizen.NUI.Graphics.BackendType.Vulkan) - { - return TextLabel_Property_UNDERLINE_ENABLED_get_vulkan(); - } - else - { - return TextLabel_Property_UNDERLINE_ENABLED_get_gl(); - } - } - - [global::System.Runtime.InteropServices.DllImport(Graphics.GlesCSharpBinder, EntryPoint = "CSharp_Dali_TextLabel_Property_UNDERLINE_COLOR_get")] - public static extern int TextLabel_Property_UNDERLINE_COLOR_get_gl(); - - [global::System.Runtime.InteropServices.DllImport(Graphics.VulkanCSharpBinder, EntryPoint = "CSharp_Dali_TextLabel_Property_UNDERLINE_COLOR_get")] - public static extern int TextLabel_Property_UNDERLINE_COLOR_get_vulkan(); - - public static int TextLabel_Property_UNDERLINE_COLOR_get() - { - if (Tizen.NUI.Graphics.Backend == Tizen.NUI.Graphics.BackendType.Vulkan) - { - return TextLabel_Property_UNDERLINE_COLOR_get_vulkan(); - } - else - { - return TextLabel_Property_UNDERLINE_COLOR_get_gl(); - } - } - - [global::System.Runtime.InteropServices.DllImport(Graphics.GlesCSharpBinder, EntryPoint = "CSharp_Dali_TextLabel_Property_UNDERLINE_HEIGHT_get")] - public static extern int TextLabel_Property_UNDERLINE_HEIGHT_get_gl(); - - [global::System.Runtime.InteropServices.DllImport(Graphics.VulkanCSharpBinder, EntryPoint = "CSharp_Dali_TextLabel_Property_UNDERLINE_HEIGHT_get")] - public static extern int TextLabel_Property_UNDERLINE_HEIGHT_get_vulkan(); - - public static int TextLabel_Property_UNDERLINE_HEIGHT_get() - { - if (Tizen.NUI.Graphics.Backend == Tizen.NUI.Graphics.BackendType.Vulkan) - { - return TextLabel_Property_UNDERLINE_HEIGHT_get_vulkan(); - } - else - { - return TextLabel_Property_UNDERLINE_HEIGHT_get_gl(); - } - } - [global::System.Runtime.InteropServices.DllImport(Graphics.GlesCSharpBinder, EntryPoint = "CSharp_Dali_TextLabel_Property_ENABLE_MARKUP_get")] public static extern int TextLabel_Property_ENABLE_MARKUP_get_gl(); @@ -67221,453 +67042,93 @@ namespace Tizen.NUI } } - [global::System.Runtime.InteropServices.DllImport(Graphics.GlesCSharpBinder, EntryPoint = "CSharp_Dali_WebViewSignal_Empty")] - public static extern bool WebViewSignal_Empty_gl(global::System.Runtime.InteropServices.HandleRef jarg1); - - [global::System.Runtime.InteropServices.DllImport(Graphics.VulkanCSharpBinder, EntryPoint = "CSharp_Dali_WebViewSignal_Empty")] - public static extern bool WebViewSignal_Empty_vulkan(global::System.Runtime.InteropServices.HandleRef jarg1); - - public static bool WebViewSignal_Empty(global::System.Runtime.InteropServices.HandleRef jarg1) - { - if (Tizen.NUI.Graphics.Backend == Tizen.NUI.Graphics.BackendType.Vulkan) - { - return WebViewSignal_Empty_vulkan(jarg1); - } - else - { - return WebViewSignal_Empty_gl(jarg1); - } - } - - [global::System.Runtime.InteropServices.DllImport(Graphics.GlesCSharpBinder, EntryPoint = "CSharp_Dali_WebViewSignal_GetConnectionCount")] - public static extern uint WebViewSignal_GetConnectionCount_gl(global::System.Runtime.InteropServices.HandleRef jarg1); + [global::System.Runtime.InteropServices.DllImport(Graphics.GlesCSharpBinder, EntryPoint = "CSharp_Dali_new_WebViewSignalProxy_PageLoadStarted")] + public static extern global::System.IntPtr new_WebViewSignalProxy_PageLoadStarted_gl(global::System.Runtime.InteropServices.HandleRef jarg1); - [global::System.Runtime.InteropServices.DllImport(Graphics.VulkanCSharpBinder, EntryPoint = "CSharp_Dali_WebViewSignal_GetConnectionCount")] - public static extern uint WebViewSignal_GetConnectionCount_vulkan(global::System.Runtime.InteropServices.HandleRef jarg1); + [global::System.Runtime.InteropServices.DllImport(Graphics.VulkanCSharpBinder, EntryPoint = "CSharp_Dali_new_WebViewSignalProxy_PageLoadStarted")] + public static extern global::System.IntPtr new_WebViewSignalProxy_PageLoadStarted_vulkan(global::System.Runtime.InteropServices.HandleRef jarg1); - public static uint WebViewSignal_GetConnectionCount(global::System.Runtime.InteropServices.HandleRef jarg1) + public static global::System.IntPtr new_WebViewSignalProxy_PageLoadStarted(global::System.Runtime.InteropServices.HandleRef jarg1) { if (Tizen.NUI.Graphics.Backend == Tizen.NUI.Graphics.BackendType.Vulkan) { - return WebViewSignal_GetConnectionCount_vulkan(jarg1); + return new_WebViewSignalProxy_PageLoadStarted_vulkan(jarg1); } else { - return WebViewSignal_GetConnectionCount_gl(jarg1); + return new_WebViewSignalProxy_PageLoadStarted_gl(jarg1); } } - [global::System.Runtime.InteropServices.DllImport(Graphics.GlesCSharpBinder, EntryPoint = "CSharp_Dali_WebViewSignal_Connect")] - public static extern void WebViewSignal_Connect_gl(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2); + [global::System.Runtime.InteropServices.DllImport(Graphics.GlesCSharpBinder, EntryPoint = "CSharp_Dali_new_WebViewSignalProxy_PageLoadFinished")] + public static extern global::System.IntPtr new_WebViewSignalProxy_PageLoadFinished_gl(global::System.Runtime.InteropServices.HandleRef jarg1); - [global::System.Runtime.InteropServices.DllImport(Graphics.VulkanCSharpBinder, EntryPoint = "CSharp_Dali_WebViewSignal_Connect")] - public static extern void WebViewSignal_Connect_vulkan(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2); + [global::System.Runtime.InteropServices.DllImport(Graphics.VulkanCSharpBinder, EntryPoint = "CSharp_Dali_new_WebViewSignalProxy_PageLoadFinished")] + public static extern global::System.IntPtr new_WebViewSignalProxy_PageLoadFinished_vulkan(global::System.Runtime.InteropServices.HandleRef jarg1); - public static void WebViewSignal_Connect(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2) + public static global::System.IntPtr new_WebViewSignalProxy_PageLoadFinished(global::System.Runtime.InteropServices.HandleRef jarg1) { if (Tizen.NUI.Graphics.Backend == Tizen.NUI.Graphics.BackendType.Vulkan) { - WebViewSignal_Connect_vulkan(jarg1, jarg2); + return new_WebViewSignalProxy_PageLoadFinished_vulkan(jarg1); } else { - WebViewSignal_Connect_gl(jarg1, jarg2); + return new_WebViewSignalProxy_PageLoadFinished_gl(jarg1); } } - [global::System.Runtime.InteropServices.DllImport(Graphics.GlesCSharpBinder, EntryPoint = "CSharp_Dali_WebViewSignal_Disconnect")] - public static extern void WebViewSignal_Disconnect_gl(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2); + [global::System.Runtime.InteropServices.DllImport(Graphics.GlesCSharpBinder, EntryPoint = "CSharp_Dali_delete_WebViewSignalProxy")] + public static extern void delete_WebViewSignalProxy_gl(global::System.Runtime.InteropServices.HandleRef jarg1); - [global::System.Runtime.InteropServices.DllImport(Graphics.VulkanCSharpBinder, EntryPoint = "CSharp_Dali_WebViewSignal_Disconnect")] - public static extern void WebViewSignal_Disconnect_vulkan(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2); + [global::System.Runtime.InteropServices.DllImport(Graphics.VulkanCSharpBinder, EntryPoint = "CSharp_Dali_delete_WebViewSignalProxy")] + public static extern void delete_WebViewSignalProxy_vulkan(global::System.Runtime.InteropServices.HandleRef jarg1); - public static void WebViewSignal_Disconnect(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2) + public static void delete_WebViewSignalProxy(global::System.Runtime.InteropServices.HandleRef jarg1) { if (Tizen.NUI.Graphics.Backend == Tizen.NUI.Graphics.BackendType.Vulkan) { - WebViewSignal_Disconnect_vulkan(jarg1, jarg2); + delete_WebViewSignalProxy_vulkan(jarg1); } else { - WebViewSignal_Disconnect_gl(jarg1, jarg2); + delete_WebViewSignalProxy_gl(jarg1); } } - [global::System.Runtime.InteropServices.DllImport(Graphics.GlesCSharpBinder, EntryPoint = "CSharp_Dali_WebViewSignal_Emit")] - public static extern void WebViewSignal_Emit_gl(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2); + [global::System.Runtime.InteropServices.DllImport(Graphics.GlesCSharpBinder, EntryPoint = "CSharp_Dali_WebViewSignalProxy_Connect")] + public static extern void WebViewSignalProxy_Connect_gl(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2); - [global::System.Runtime.InteropServices.DllImport(Graphics.VulkanCSharpBinder, EntryPoint = "CSharp_Dali_WebViewSignal_Emit")] - public static extern void WebViewSignal_Emit_vulkan(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2); + [global::System.Runtime.InteropServices.DllImport(Graphics.VulkanCSharpBinder, EntryPoint = "CSharp_Dali_WebViewSignalProxy_Connect")] + public static extern void WebViewSignalProxy_Connect_vulkan(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2); - public static void WebViewSignal_Emit(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2) + public static void WebViewSignalProxy_Connect(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2) { if (Tizen.NUI.Graphics.Backend == Tizen.NUI.Graphics.BackendType.Vulkan) { - WebViewSignal_Emit_vulkan(jarg1, jarg2); + WebViewSignalProxy_Connect_vulkan(jarg1, jarg2); } else { - WebViewSignal_Emit_gl(jarg1, jarg2); + WebViewSignalProxy_Connect_gl(jarg1, jarg2); } } - [global::System.Runtime.InteropServices.DllImport(Graphics.GlesCSharpBinder, EntryPoint = "CSharp_Dali_new_WebViewSignal")] - public static extern global::System.IntPtr new_WebViewSignal_gl(); + [global::System.Runtime.InteropServices.DllImport(Graphics.GlesCSharpBinder, EntryPoint = "CSharp_Dali_WebViewSignalProxy_Disconnect")] + public static extern void WebViewSignalProxy_Disconnect_gl(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2); - [global::System.Runtime.InteropServices.DllImport(Graphics.VulkanCSharpBinder, EntryPoint = "CSharp_Dali_new_WebViewSignal")] - public static extern global::System.IntPtr new_WebViewSignal_vulkan(); + [global::System.Runtime.InteropServices.DllImport(Graphics.VulkanCSharpBinder, EntryPoint = "CSharp_Dali_WebViewSignalProxy_Disconnect")] + public static extern void WebViewSignalProxy_Disconnect_vulkan(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2); - public static global::System.IntPtr new_WebViewSignal() + public static void WebViewSignalProxy_Disconnect(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2) { if (Tizen.NUI.Graphics.Backend == Tizen.NUI.Graphics.BackendType.Vulkan) { - return new_WebViewSignal_vulkan(); + WebViewSignalProxy_Disconnect_vulkan(jarg1, jarg2); } else { - return new_WebViewSignal_gl(); - } - } - - [global::System.Runtime.InteropServices.DllImport(Graphics.GlesCSharpBinder, EntryPoint = "CSharp_Dali_delete_WebViewSignal")] - public static extern void delete_WebViewSignal_gl(global::System.Runtime.InteropServices.HandleRef jarg1); - - [global::System.Runtime.InteropServices.DllImport(Graphics.VulkanCSharpBinder, EntryPoint = "CSharp_Dali_delete_WebViewSignal")] - public static extern void delete_WebViewSignal_vulkan(global::System.Runtime.InteropServices.HandleRef jarg1); - - public static void delete_WebViewSignal(global::System.Runtime.InteropServices.HandleRef jarg1) - { - if (Tizen.NUI.Graphics.Backend == Tizen.NUI.Graphics.BackendType.Vulkan) - { - delete_WebViewSignal_vulkan(jarg1); - } - else - { - delete_WebViewSignal_gl(jarg1); - } - } - - [global::System.Runtime.InteropServices.DllImport(Graphics.GlesCSharpBinder, EntryPoint = "CSharp_Dali_WebViewLite_New")] - public static extern global::System.IntPtr WebViewLite_New_gl(); - - [global::System.Runtime.InteropServices.DllImport(Graphics.VulkanCSharpBinder, EntryPoint = "CSharp_Dali_WebViewLite_New")] - public static extern global::System.IntPtr WebViewLite_New_vulkan(); - - public static global::System.IntPtr WebViewLite_New() - { - if (Tizen.NUI.Graphics.Backend == Tizen.NUI.Graphics.BackendType.Vulkan) - { - return WebViewLite_New_vulkan(); - } - else - { - return WebViewLite_New_gl(); - } - } - - [global::System.Runtime.InteropServices.DllImport(Graphics.GlesCSharpBinder, EntryPoint = "CSharp_Dali_new_WebViewLite__SWIG_0")] - public static extern global::System.IntPtr new_WebViewLite__SWIG_0_gl(); - - [global::System.Runtime.InteropServices.DllImport(Graphics.VulkanCSharpBinder, EntryPoint = "CSharp_Dali_new_WebViewLite__SWIG_0")] - public static extern global::System.IntPtr new_WebViewLite__SWIG_0_vulkan(); - - public static global::System.IntPtr new_WebViewLite__SWIG_0() - { - if (Tizen.NUI.Graphics.Backend == Tizen.NUI.Graphics.BackendType.Vulkan) - { - return new_WebViewLite__SWIG_0_vulkan(); - } - else - { - return new_WebViewLite__SWIG_0_gl(); - } - } - - [global::System.Runtime.InteropServices.DllImport(Graphics.GlesCSharpBinder, EntryPoint = "CSharp_Dali_delete_WebViewLite")] - public static extern void delete_WebViewLite_gl(global::System.Runtime.InteropServices.HandleRef jarg1); - - [global::System.Runtime.InteropServices.DllImport(Graphics.VulkanCSharpBinder, EntryPoint = "CSharp_Dali_delete_WebViewLite")] - public static extern void delete_WebViewLite_vulkan(global::System.Runtime.InteropServices.HandleRef jarg1); - - public static void delete_WebViewLite(global::System.Runtime.InteropServices.HandleRef jarg1) - { - if (Tizen.NUI.Graphics.Backend == Tizen.NUI.Graphics.BackendType.Vulkan) - { - delete_WebViewLite_vulkan(jarg1); - } - else - { - delete_WebViewLite_gl(jarg1); - } - } - - [global::System.Runtime.InteropServices.DllImport(Graphics.GlesCSharpBinder, EntryPoint = "CSharp_Dali_new_WebViewLite__SWIG_1")] - public static extern global::System.IntPtr new_WebViewLite__SWIG_1_gl(global::System.Runtime.InteropServices.HandleRef jarg1); - - [global::System.Runtime.InteropServices.DllImport(Graphics.VulkanCSharpBinder, EntryPoint = "CSharp_Dali_new_WebViewLite__SWIG_1")] - public static extern global::System.IntPtr new_WebViewLite__SWIG_1_vulkan(global::System.Runtime.InteropServices.HandleRef jarg1); - - public static global::System.IntPtr new_WebViewLite__SWIG_1(global::System.Runtime.InteropServices.HandleRef jarg1) - { - if (Tizen.NUI.Graphics.Backend == Tizen.NUI.Graphics.BackendType.Vulkan) - { - return new_WebViewLite__SWIG_1_vulkan(jarg1); - } - else - { - return new_WebViewLite__SWIG_1_gl(jarg1); - } - } - - [global::System.Runtime.InteropServices.DllImport(Graphics.GlesCSharpBinder, EntryPoint = "CSharp_Dali_WebViewLite_Assign")] - public static extern global::System.IntPtr WebViewLite_Assign_gl(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2); - - [global::System.Runtime.InteropServices.DllImport(Graphics.VulkanCSharpBinder, EntryPoint = "CSharp_Dali_WebViewLite_Assign")] - public static extern global::System.IntPtr WebViewLite_Assign_vulkan(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2); - - public static global::System.IntPtr WebViewLite_Assign(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2) - { - if (Tizen.NUI.Graphics.Backend == Tizen.NUI.Graphics.BackendType.Vulkan) - { - return WebViewLite_Assign_vulkan(jarg1, jarg2); - } - else - { - return WebViewLite_Assign_gl(jarg1, jarg2); - } - } - - [global::System.Runtime.InteropServices.DllImport(Graphics.GlesCSharpBinder, EntryPoint = "CSharp_Dali_WebViewLite_DownCast")] - public static extern global::System.IntPtr WebViewLite_DownCast_gl(global::System.Runtime.InteropServices.HandleRef jarg1); - - [global::System.Runtime.InteropServices.DllImport(Graphics.VulkanCSharpBinder, EntryPoint = "CSharp_Dali_WebViewLite_DownCast")] - public static extern global::System.IntPtr WebViewLite_DownCast_vulkan(global::System.Runtime.InteropServices.HandleRef jarg1); - - public static global::System.IntPtr WebViewLite_DownCast(global::System.Runtime.InteropServices.HandleRef jarg1) - { - if (Tizen.NUI.Graphics.Backend == Tizen.NUI.Graphics.BackendType.Vulkan) - { - return WebViewLite_DownCast_vulkan(jarg1); - } - else - { - return WebViewLite_DownCast_gl(jarg1); - } - } - - [global::System.Runtime.InteropServices.DllImport(Graphics.GlesCSharpBinder, EntryPoint = "CSharp_Dali_WebViewLite_CreateInstance")] - public static extern void WebViewLite_CreateInstance_gl(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2, int jarg3, int jarg4, int jarg5, string jarg6, string jarg7); - - [global::System.Runtime.InteropServices.DllImport(Graphics.VulkanCSharpBinder, EntryPoint = "CSharp_Dali_WebViewLite_CreateInstance")] - public static extern void WebViewLite_CreateInstance_vulkan(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2, int jarg3, int jarg4, int jarg5, string jarg6, string jarg7); - - public static void WebViewLite_CreateInstance(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2, int jarg3, int jarg4, int jarg5, string jarg6, string jarg7) - { - if (Tizen.NUI.Graphics.Backend == Tizen.NUI.Graphics.BackendType.Vulkan) - { - WebViewLite_CreateInstance_vulkan(jarg1, jarg2, jarg3, jarg4, jarg5, jarg6, jarg7); - } - else - { - WebViewLite_CreateInstance_gl(jarg1, jarg2, jarg3, jarg4, jarg5, jarg6, jarg7); - } - } - - [global::System.Runtime.InteropServices.DllImport(Graphics.GlesCSharpBinder, EntryPoint = "CSharp_Dali_WebViewLite_DestroyInstance")] - public static extern void WebViewLite_DestroyInstance_gl(global::System.Runtime.InteropServices.HandleRef jarg1); - - [global::System.Runtime.InteropServices.DllImport(Graphics.VulkanCSharpBinder, EntryPoint = "CSharp_Dali_WebViewLite_DestroyInstance")] - public static extern void WebViewLite_DestroyInstance_vulkan(global::System.Runtime.InteropServices.HandleRef jarg1); - - public static void WebViewLite_DestroyInstance(global::System.Runtime.InteropServices.HandleRef jarg1) - { - if (Tizen.NUI.Graphics.Backend == Tizen.NUI.Graphics.BackendType.Vulkan) - { - WebViewLite_DestroyInstance_vulkan(jarg1); - } - else - { - WebViewLite_DestroyInstance_gl(jarg1); - } - } - - [global::System.Runtime.InteropServices.DllImport(Graphics.GlesCSharpBinder, EntryPoint = "CSharp_Dali_WebViewLite_LoadHtml")] - public static extern void WebViewLite_LoadHtml_gl(global::System.Runtime.InteropServices.HandleRef jarg1, string jarg2); - - [global::System.Runtime.InteropServices.DllImport(Graphics.VulkanCSharpBinder, EntryPoint = "CSharp_Dali_WebViewLite_LoadHtml")] - public static extern void WebViewLite_LoadHtml_vulkan(global::System.Runtime.InteropServices.HandleRef jarg1, string jarg2); - - public static void WebViewLite_LoadHtml(global::System.Runtime.InteropServices.HandleRef jarg1, string jarg2) - { - if (Tizen.NUI.Graphics.Backend == Tizen.NUI.Graphics.BackendType.Vulkan) - { - WebViewLite_LoadHtml_vulkan(jarg1, jarg2); - } - else - { - WebViewLite_LoadHtml_gl(jarg1, jarg2); - } - } - - [global::System.Runtime.InteropServices.DllImport(Graphics.GlesCSharpBinder, EntryPoint = "CSharp_Dali_WebViewLite_FinishedSignal")] - public static extern global::System.IntPtr WebViewLite_FinishedSignal_gl(global::System.Runtime.InteropServices.HandleRef jarg1); - - [global::System.Runtime.InteropServices.DllImport(Graphics.VulkanCSharpBinder, EntryPoint = "CSharp_Dali_WebViewLite_FinishedSignal")] - public static extern global::System.IntPtr WebViewLite_FinishedSignal_vulkan(global::System.Runtime.InteropServices.HandleRef jarg1); - - public static global::System.IntPtr WebViewLite_FinishedSignal(global::System.Runtime.InteropServices.HandleRef jarg1) - { - if (Tizen.NUI.Graphics.Backend == Tizen.NUI.Graphics.BackendType.Vulkan) - { - return WebViewLite_FinishedSignal_vulkan(jarg1); - } - else - { - return WebViewLite_FinishedSignal_gl(jarg1); - } - } - - [global::System.Runtime.InteropServices.DllImport(Graphics.GlesCSharpBinder, EntryPoint = "CSharp_Dali_WebViewLiteSignal_Empty")] - public static extern bool WebViewLiteSignal_Empty_gl(global::System.Runtime.InteropServices.HandleRef jarg1); - - [global::System.Runtime.InteropServices.DllImport(Graphics.VulkanCSharpBinder, EntryPoint = "CSharp_Dali_WebViewLiteSignal_Empty")] - public static extern bool WebViewLiteSignal_Empty_vulkan(global::System.Runtime.InteropServices.HandleRef jarg1); - - public static bool WebViewLiteSignal_Empty(global::System.Runtime.InteropServices.HandleRef jarg1) - { - if (Tizen.NUI.Graphics.Backend == Tizen.NUI.Graphics.BackendType.Vulkan) - { - return WebViewLiteSignal_Empty_vulkan(jarg1); - } - else - { - return WebViewLiteSignal_Empty_gl(jarg1); - } - } - - [global::System.Runtime.InteropServices.DllImport(Graphics.GlesCSharpBinder, EntryPoint = "CSharp_Dali_WebViewLiteSignal_GetConnectionCount")] - public static extern uint WebViewLiteSignal_GetConnectionCount_gl(global::System.Runtime.InteropServices.HandleRef jarg1); - - [global::System.Runtime.InteropServices.DllImport(Graphics.VulkanCSharpBinder, EntryPoint = "CSharp_Dali_WebViewLiteSignal_GetConnectionCount")] - public static extern uint WebViewLiteSignal_GetConnectionCount_vulkan(global::System.Runtime.InteropServices.HandleRef jarg1); - - public static uint WebViewLiteSignal_GetConnectionCount(global::System.Runtime.InteropServices.HandleRef jarg1) - { - if (Tizen.NUI.Graphics.Backend == Tizen.NUI.Graphics.BackendType.Vulkan) - { - return WebViewLiteSignal_GetConnectionCount_vulkan(jarg1); - } - else - { - return WebViewLiteSignal_GetConnectionCount_gl(jarg1); - } - } - - [global::System.Runtime.InteropServices.DllImport(Graphics.GlesCSharpBinder, EntryPoint = "CSharp_Dali_WebViewLiteSignal_Connect")] - public static extern void WebViewLiteSignal_Connect_gl(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2); - - [global::System.Runtime.InteropServices.DllImport(Graphics.VulkanCSharpBinder, EntryPoint = "CSharp_Dali_WebViewLiteSignal_Connect")] - public static extern void WebViewLiteSignal_Connect_vulkan(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2); - - public static void WebViewLiteSignal_Connect(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2) - { - if (Tizen.NUI.Graphics.Backend == Tizen.NUI.Graphics.BackendType.Vulkan) - { - WebViewLiteSignal_Connect_vulkan(jarg1, jarg2); - } - else - { - WebViewLiteSignal_Connect_gl(jarg1, jarg2); - } - } - - [global::System.Runtime.InteropServices.DllImport(Graphics.GlesCSharpBinder, EntryPoint = "CSharp_Dali_WebViewLiteSignal_Disconnect")] - public static extern void WebViewLiteSignal_Disconnect_gl(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2); - - [global::System.Runtime.InteropServices.DllImport(Graphics.VulkanCSharpBinder, EntryPoint = "CSharp_Dali_WebViewLiteSignal_Disconnect")] - public static extern void WebViewLiteSignal_Disconnect_vulkan(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2); - - public static void WebViewLiteSignal_Disconnect(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2) - { - if (Tizen.NUI.Graphics.Backend == Tizen.NUI.Graphics.BackendType.Vulkan) - { - WebViewLiteSignal_Disconnect_vulkan(jarg1, jarg2); - } - else - { - WebViewLiteSignal_Disconnect_gl(jarg1, jarg2); - } - } - - [global::System.Runtime.InteropServices.DllImport(Graphics.GlesCSharpBinder, EntryPoint = "CSharp_Dali_WebViewLiteSignal_Emit")] - public static extern void WebViewLiteSignal_Emit_gl(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2); - - [global::System.Runtime.InteropServices.DllImport(Graphics.VulkanCSharpBinder, EntryPoint = "CSharp_Dali_WebViewLiteSignal_Emit")] - public static extern void WebViewLiteSignal_Emit_vulkan(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2); - - public static void WebViewLiteSignal_Emit(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2) - { - if (Tizen.NUI.Graphics.Backend == Tizen.NUI.Graphics.BackendType.Vulkan) - { - WebViewLiteSignal_Emit_vulkan(jarg1, jarg2); - } - else - { - WebViewLiteSignal_Emit_gl(jarg1, jarg2); - } - } - - [global::System.Runtime.InteropServices.DllImport(Graphics.GlesCSharpBinder, EntryPoint = "CSharp_Dali_new_WebViewLiteSignal")] - public static extern global::System.IntPtr new_WebViewLiteSignal_gl(); - - [global::System.Runtime.InteropServices.DllImport(Graphics.VulkanCSharpBinder, EntryPoint = "CSharp_Dali_new_WebViewLiteSignal")] - public static extern global::System.IntPtr new_WebViewLiteSignal_vulkan(); - - public static global::System.IntPtr new_WebViewLiteSignal() - { - if (Tizen.NUI.Graphics.Backend == Tizen.NUI.Graphics.BackendType.Vulkan) - { - return new_WebViewLiteSignal_vulkan(); - } - else - { - return new_WebViewLiteSignal_gl(); - } - } - - [global::System.Runtime.InteropServices.DllImport(Graphics.GlesCSharpBinder, EntryPoint = "CSharp_Dali_delete_WebViewLiteSignal")] - public static extern void delete_WebViewLiteSignal_gl(global::System.Runtime.InteropServices.HandleRef jarg1); - - [global::System.Runtime.InteropServices.DllImport(Graphics.VulkanCSharpBinder, EntryPoint = "CSharp_Dali_delete_WebViewLiteSignal")] - public static extern void delete_WebViewLiteSignal_vulkan(global::System.Runtime.InteropServices.HandleRef jarg1); - - public static void delete_WebViewLiteSignal(global::System.Runtime.InteropServices.HandleRef jarg1) - { - if (Tizen.NUI.Graphics.Backend == Tizen.NUI.Graphics.BackendType.Vulkan) - { - delete_WebViewLiteSignal_vulkan(jarg1); - } - else - { - delete_WebViewLiteSignal_gl(jarg1); - } - } - - [global::System.Runtime.InteropServices.DllImport(Graphics.GlesCSharpBinder, EntryPoint = "CSharp_Dali_WebViewLite_SWIGUpcast")] - public static extern global::System.IntPtr WebViewLite_SWIGUpcast_gl(global::System.IntPtr jarg1); - - [global::System.Runtime.InteropServices.DllImport(Graphics.VulkanCSharpBinder, EntryPoint = "CSharp_Dali_WebViewLite_SWIGUpcast")] - public static extern global::System.IntPtr WebViewLite_SWIGUpcast_vulkan(global::System.IntPtr jarg1); - - public static global::System.IntPtr WebViewLite_SWIGUpcast(global::System.IntPtr jarg1) - { - if (Tizen.NUI.Graphics.Backend == Tizen.NUI.Graphics.BackendType.Vulkan) - { - return WebViewLite_SWIGUpcast_vulkan(jarg1); - } - else - { - return WebViewLite_SWIGUpcast_gl(jarg1); + WebViewSignalProxy_Disconnect_gl(jarg1, jarg2); } } @@ -68555,42 +68016,6 @@ namespace Tizen.NUI } } - [global::System.Runtime.InteropServices.DllImport(Graphics.GlesCSharpBinder, EntryPoint = "CSharp_Dali_SetMaxTextureSize")] - public static extern void SetMaxTextureSize_gl(uint jarg1); - - [global::System.Runtime.InteropServices.DllImport(Graphics.VulkanCSharpBinder, EntryPoint = "CSharp_Dali_SetMaxTextureSize")] - public static extern void SetMaxTextureSize_vulkan(uint jarg1); - - public static void SetMaxTextureSize(uint jarg1) - { - if (Tizen.NUI.Graphics.Backend == Tizen.NUI.Graphics.BackendType.Vulkan) - { - SetMaxTextureSize_vulkan(jarg1); - } - else - { - SetMaxTextureSize_gl(jarg1); - } - } - - [global::System.Runtime.InteropServices.DllImport(Graphics.GlesCSharpBinder, EntryPoint = "CSharp_Dali_GetMaxTextureSize")] - public static extern uint GetMaxTextureSize_gl(); - - [global::System.Runtime.InteropServices.DllImport(Graphics.VulkanCSharpBinder, EntryPoint = "CSharp_Dali_GetMaxTextureSize")] - public static extern uint GetMaxTextureSize_vulkan(); - - public static uint GetMaxTextureSize() - { - if (Tizen.NUI.Graphics.Backend == Tizen.NUI.Graphics.BackendType.Vulkan) - { - return GetMaxTextureSize_vulkan(); - } - else - { - return GetMaxTextureSize_gl(); - } - } - [global::System.Runtime.InteropServices.DllImport(Graphics.GlesCSharpBinder, EntryPoint = "CSharp_Dali_GetEnvironmentVariable")] public static extern string EnvironmentVariable_GetEnvironmentVariable_gl(string jarg1); diff --git a/src/Tizen.NUI/src/internal/NUICoreBackend.cs b/src/Tizen.NUI/src/internal/NUICoreBackend.cs index 336a490..94000db 100755 --- a/src/Tizen.NUI/src/internal/NUICoreBackend.cs +++ b/src/Tizen.NUI/src/internal/NUICoreBackend.cs @@ -159,7 +159,7 @@ namespace Tizen.NUI { Log.Info("NUI", "NUICorebackend OnRegionChanged Called"); var handler = Handlers[EventType.RegionFormatChanged] as Action; - handler?.Invoke( new RegionFormatChangedEventArgs(e.Application.GetRegion())); + handler?.Invoke( new RegionFormatChangedEventArgs((source as Application)?.GetRegion())); } /// @@ -201,7 +201,7 @@ namespace Tizen.NUI { Log.Info("NUI", "NUICorebackend OnLanguageChanged Called"); var handler = Handlers[EventType.LocaleChanged] as Action; - handler?.Invoke( new LocaleChangedEventArgs(e.Application.GetLanguage())); + handler?.Invoke( new LocaleChangedEventArgs((source as Application)?.GetLanguage())); } /// diff --git a/src/Tizen.NUI/src/internal/VersionCheck.cs b/src/Tizen.NUI/src/internal/VersionCheck.cs index 33981fd..5326936 100755 --- a/src/Tizen.NUI/src/internal/VersionCheck.cs +++ b/src/Tizen.NUI/src/internal/VersionCheck.cs @@ -27,7 +27,7 @@ namespace Tizen.NUI //from dali_1.3.28 : NUI internal API version 502 //from dali_1.3.34 : NUI internal API version 503 //from dali_1.3.41 : NUI internal API version 504 - //from dali_1.3.43 : NUI internal API version 505 + //from dali_1.3.48 : NUI internal API version 505 public const int nuiAPIVer = 505; public const int reservedVer1 = 0; public const int reservedVer2 = 0; @@ -42,8 +42,7 @@ namespace Tizen.NUI { if (NDalicManualPINVOKE.InternalAPIVersionCheck(ref ver1, ref ver2, ref ver3) == true) { - //temporary permit 504 version. the 504 will be removed. - if (ver1 != nuiAPIVer && ver1 != 504) + if (ver1 != nuiAPIVer) { NUILog.Error($"NUI API version mismatch error! NUI API Version: ({nuiAPIVer}) but read version from native: ({ver1}.{ver2}.{ver3})"); throw new System.InvalidOperationException($"NUI API version mismatch error! NUI API version should be ({nuiAPIVer}) but read version from native: ({ver1}.{ver2}.{ver3})"); @@ -66,7 +65,7 @@ namespace Tizen.NUI } //[Conditional("DEBUG_ON")] - static private void PrintDaliNativeVersion() + static internal void PrintDaliNativeVersion() { int ver1 = -1; int ver2 = -1; diff --git a/src/Tizen.NUI/src/internal/ViewMode.cs b/src/Tizen.NUI/src/internal/ViewMode.cs deleted file mode 100755 index c41173c..0000000 --- a/src/Tizen.NUI/src/internal/ViewMode.cs +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright(c) 2017 Samsung Electronics Co., Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -namespace Tizen.NUI -{ - - internal enum ViewMode - { - MONO, - STEREO_HORIZONTAL, - STEREO_VERTICAL, - STEREO_INTERLACED - } - -} diff --git a/src/Tizen.NUI/src/internal/WatchApplication.cs b/src/Tizen.NUI/src/internal/WatchApplication.cs index 32f1a73..fbd378a 100755 --- a/src/Tizen.NUI/src/internal/WatchApplication.cs +++ b/src/Tizen.NUI/src/internal/WatchApplication.cs @@ -209,13 +209,10 @@ namespace Tizen.NUI private void OnTimeTick(IntPtr application, IntPtr watchTime) { TimeTickEventArgs e = new TimeTickEventArgs(); - using (e.Application = Application.GetApplicationFromPtr(application)) - { - using (e.WatchTime = WatchTime.GetWatchTimeFromPtr(watchTime)) - { - _timeTickEventHandler?.Invoke(this, e); - } - } + e.Application = this; + e.WatchTime = WatchTime.GetWatchTimeFromPtr(watchTime); + + _timeTickEventHandler?.Invoke(this, e); } @@ -289,13 +286,9 @@ namespace Tizen.NUI { AmbientTickEventArgs e = new AmbientTickEventArgs(); - using (e.Application = Application.GetApplicationFromPtr(application)) - { - using (e.WatchTime = WatchTime.GetWatchTimeFromPtr(watchTime)) - { - _ambientTickEventHandler?.Invoke(this, e); - } - } + e.Application = this; + e.WatchTime = WatchTime.GetWatchTimeFromPtr(watchTime); + _ambientTickEventHandler?.Invoke(this, e); } internal WatchTimeSignal AmbientTickSignal() @@ -367,11 +360,9 @@ namespace Tizen.NUI private void OnAmbientChanged(IntPtr application, bool changed) { AmbientChangedEventArgs e = new AmbientChangedEventArgs(); - using (e.Application = Application.GetApplicationFromPtr(application)) - { - e.Changed = changed; - _ambientChangedEventHandler?.Invoke(this, e); - } + e.Application = this; + e.Changed = changed; + _ambientChangedEventHandler?.Invoke(this, e); } internal WatchBoolSignal AmbientChangedSignal() diff --git a/src/Tizen.NUI/src/internal/WebView.cs b/src/Tizen.NUI/src/internal/WebView.cs index 4feefd4..8c11196 100755 --- a/src/Tizen.NUI/src/internal/WebView.cs +++ b/src/Tizen.NUI/src/internal/WebView.cs @@ -32,6 +32,16 @@ namespace Tizen.NUI internal WebView(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.WebView_SWIGUpcast(cPtr), cMemoryOwn) { swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); + + InitializeSignals(); + } + + private global::System.Runtime.InteropServices.HandleRef pageLoadStartedSignalProxy; + private global::System.Runtime.InteropServices.HandleRef pageLoadFinishedSignalProxy; + private void InitializeSignals() + { + pageLoadStartedSignalProxy = new global::System.Runtime.InteropServices.HandleRef(this, NDalicPINVOKE.new_WebViewSignalProxy_PageLoadStarted(swigCPtr)); + pageLoadFinishedSignalProxy = new global::System.Runtime.InteropServices.HandleRef(this, NDalicPINVOKE.new_WebViewSignalProxy_PageLoadFinished(swigCPtr)); } internal static global::System.Runtime.InteropServices.HandleRef getCPtr(WebView obj) @@ -63,7 +73,7 @@ namespace Tizen.NUI //You should not access any managed member here except static instance. //because the execution order of Finalizes is non-deterministic. - DisConnectFromSignals(); + DisposeSignals(); if (swigCPtr.Handle != global::System.IntPtr.Zero) { @@ -78,17 +88,27 @@ namespace Tizen.NUI base.Dispose(type); } - private void DisConnectFromSignals() + private void DisposeSignals() { - // Save current CPtr. - global::System.Runtime.InteropServices.HandleRef currentCPtr = swigCPtr; - - // Use BaseHandle CPtr as current might have been deleted already in derived classes. - swigCPtr = GetBaseHandleCPtrHandleRef; - - // BaseHandle CPtr is used in Registry and there is danger of deletion if we keep using it here. - // Restore current CPtr. - swigCPtr = currentCPtr; + if (pageLoadStartedSignalProxy.Handle != global::System.IntPtr.Zero) + { + if (pageLoadStartedCallback != null) + { + WebViewProxyDisconnect(pageLoadStartedSignalProxy, pageLoadStartedCallback); + } + NDalicPINVOKE.delete_WebViewSignalProxy(pageLoadStartedSignalProxy); + pageLoadStartedSignalProxy = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); + } + + if (pageLoadFinishedSignalProxy.Handle != global::System.IntPtr.Zero) + { + if (pageLoadFinishedCallback != null) + { + WebViewProxyDisconnect(pageLoadFinishedSignalProxy, pageLoadFinishedCallback); + } + NDalicPINVOKE.delete_WebViewSignalProxy(pageLoadFinishedSignalProxy); + pageLoadFinishedSignalProxy = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); + } } /// @@ -137,6 +157,149 @@ namespace Tizen.NUI } /// + /// Event arguments that passed via the webview signal. + /// + public class WebViewEventArgs : EventArgs + { + private WebView _webView; + /// + /// The view for displaying webpages. + /// + public WebView WebView + { + get + { + return _webView; + } + set + { + _webView = value; + } + } + + private string _pageUrl; + /// + /// The url string of current webpage. + /// + public string PageUrl + { + get + { + return _pageUrl; + } + set + { + _pageUrl = value; + } + } + } + + [UnmanagedFunctionPointer(CallingConvention.StdCall)] + private delegate void WebViewCallbackDelegate(IntPtr data, string pageUrl); + + private void WebViewProxyConnect(global::System.Runtime.InteropServices.HandleRef proxy, System.Delegate func) + { + System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); + { + NDalicPINVOKE.WebViewSignalProxy_Connect(proxy, new System.Runtime.InteropServices.HandleRef(this, ip)); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + } + + private void WebViewProxyDisconnect(global::System.Runtime.InteropServices.HandleRef proxy, System.Delegate func) + { + System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); + { + NDalicPINVOKE.WebViewSignalProxy_Disconnect(proxy, new System.Runtime.InteropServices.HandleRef(this, ip)); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + } + + private EventHandler pageLoadStartedEventHandler; + private WebViewCallbackDelegate pageLoadStartedCallback; + + /// + /// Event for the PageLoadStarted signal which can be used to subscribe or unsubscribe the event handler.
+ /// This signal is emitted when page loading has started.
+ ///
+ [EditorBrowsable(EditorBrowsableState.Never)] + public event EventHandler PageLoadStarted + { + add + { + if (pageLoadStartedEventHandler == null) + { + pageLoadStartedCallback = (OnPageLoadStarted); + WebViewProxyConnect(pageLoadStartedSignalProxy, pageLoadStartedCallback); + } + pageLoadStartedEventHandler += value; + } + remove + { + pageLoadStartedEventHandler -= value; + if (pageLoadStartedEventHandler == null && pageLoadStartedCallback != null) + { + WebViewProxyDisconnect(pageLoadStartedSignalProxy, pageLoadStartedCallback); + } + } + } + + private void OnPageLoadStarted(IntPtr data, string pageUrl) + { + WebViewEventArgs e = new WebViewEventArgs(); + + e.WebView = Registry.GetManagedBaseHandleFromNativePtr(data) as WebView; + e.PageUrl = pageUrl; + + if (pageLoadStartedEventHandler != null) + { + pageLoadStartedEventHandler(this, e); + } + } + + private EventHandler pageLoadFinishedEventHandler; + private WebViewCallbackDelegate pageLoadFinishedCallback; + + /// + /// Event for the PageLoadFinished signal which can be used to subscribe or unsubscribe the event handler.
+ /// This signal is emitted when page loading has finished.
+ ///
+ [EditorBrowsable(EditorBrowsableState.Never)] + public event EventHandler PageLoadFinished + { + add + { + if (pageLoadFinishedEventHandler == null) + { + pageLoadFinishedCallback = (OnPageLoadFinished); + WebViewProxyConnect(pageLoadFinishedSignalProxy, pageLoadFinishedCallback); + } + pageLoadFinishedEventHandler += value; + } + remove + { + pageLoadFinishedEventHandler -= value; + if (pageLoadFinishedEventHandler == null && pageLoadFinishedCallback != null) + { + WebViewProxyDisconnect(pageLoadFinishedSignalProxy, pageLoadFinishedCallback); + } + } + } + + private void OnPageLoadFinished(IntPtr data, string pageUrl) + { + WebViewEventArgs e = new WebViewEventArgs(); + + e.WebView = Registry.GetManagedBaseHandleFromNativePtr(data) as WebView; + e.PageUrl = pageUrl; + + if (pageLoadFinishedEventHandler != null) + { + pageLoadFinishedEventHandler(this, e); + } + } + + /// /// Loads a html. /// The path of Web /// diff --git a/src/Tizen.NUI/src/internal/Xaml/ApplyPropertiesVisitor.cs b/src/Tizen.NUI/src/internal/Xaml/ApplyPropertiesVisitor.cs index d7302a1..af8a7ad 100755 --- a/src/Tizen.NUI/src/internal/Xaml/ApplyPropertiesVisitor.cs +++ b/src/Tizen.NUI/src/internal/Xaml/ApplyPropertiesVisitor.cs @@ -100,6 +100,8 @@ namespace Tizen.NUI.Xaml if (propertyName != XmlName.Empty || TryGetPropertyName(node, parentNode, out propertyName)) { if (Skips.Contains(propertyName)) return; + if (parentElement == null) + return; if (parentElement.SkipProperties.Contains(propertyName)) return; @@ -234,8 +236,7 @@ namespace Tizen.NUI.Xaml if (value.GetType().GetTypeInfo().GetCustomAttribute() == null) serviceProvider = new XamlServiceProvider(node, Context); - if (serviceProvider != null && propertyName != XmlName.Empty) - { + if (serviceProvider != null && serviceProvider.IProvideValueTarget != null && propertyName != XmlName.Empty) { ((XamlValueTargetProvider)serviceProvider.IProvideValueTarget).TargetProperty = GetTargetProperty(source, propertyName, Context, node); } @@ -609,7 +610,7 @@ namespace Tizen.NUI.Xaml if (addMethod == null) return false; - if (serviceProvider != null) + if (serviceProvider != null && serviceProvider.IProvideValueTarget != null) ((XamlValueTargetProvider)serviceProvider.IProvideValueTarget).TargetProperty = targetProperty; addMethod.Invoke(collection, new [] { value.ConvertTo(addMethod.GetParameters() [0].ParameterType, (Func)null, serviceProvider) }); diff --git a/src/Tizen.NUI/src/internal/Xaml/CreateValuesVisitor.cs b/src/Tizen.NUI/src/internal/Xaml/CreateValuesVisitor.cs index 1e759f3..c148a6b 100755 --- a/src/Tizen.NUI/src/internal/Xaml/CreateValuesVisitor.cs +++ b/src/Tizen.NUI/src/internal/Xaml/CreateValuesVisitor.cs @@ -290,9 +290,16 @@ namespace Tizen.NUI.Xaml INode node; if (!enode.Properties.TryGetValue(name, out node)) { - throw new XamlParseException( - String.Format("The Property {0} is required to create a {1} object.", propname, ctorInfo.DeclaringType.FullName), - enode as IXmlLineInfo); + String msg = ""; + if (propname != null) + { + msg = String.Format("The Property {0} is required to create a {1} object.", propname, ctorInfo.DeclaringType.FullName); + } + else + { + msg = "propname is null."; + } + throw new XamlParseException(msg, enode as IXmlLineInfo); } if (!enode.SkipProperties.Contains(name)) enode.SkipProperties.Add(name); diff --git a/src/Tizen.NUI/src/internal/Xaml/MarkupExpressionParser.cs b/src/Tizen.NUI/src/internal/Xaml/MarkupExpressionParser.cs index 6dbc21a..188ec53 100755 --- a/src/Tizen.NUI/src/internal/Xaml/MarkupExpressionParser.cs +++ b/src/Tizen.NUI/src/internal/Xaml/MarkupExpressionParser.cs @@ -57,7 +57,7 @@ namespace Tizen.NUI.Xaml throw new Exception("Expression did not end in '}'"); var parser = Activator.CreateInstance(GetType()) as IExpressionParser; - return parser.Parse(match, ref expression, serviceProvider); + return parser?.Parse(match, ref expression, serviceProvider); } internal static bool MatchMarkup(out string match, string expression, out int end) diff --git a/src/Tizen.NUI/src/internal/Xaml/MarkupExtensions/StaticExtension.cs b/src/Tizen.NUI/src/internal/Xaml/MarkupExtensions/StaticExtension.cs index 629cf1d..d22e0ed 100755 --- a/src/Tizen.NUI/src/internal/Xaml/MarkupExtensions/StaticExtension.cs +++ b/src/Tizen.NUI/src/internal/Xaml/MarkupExtensions/StaticExtension.cs @@ -36,9 +36,9 @@ namespace Tizen.NUI.Xaml var type = typeResolver.Resolve(typename, serviceProvider); - var pinfo = type.GetRuntimeProperties().FirstOrDefault(pi => pi.Name == membername && pi.GetMethod.IsStatic); + var pinfo = type.GetRuntimeProperties().FirstOrDefault(pi => pi.GetMethod != null && pi.Name == membername && pi.GetMethod.IsStatic); if (pinfo != null) - return pinfo.GetMethod.Invoke(null, new object[] { }); + return pinfo.GetMethod?.Invoke(null, Array.Empty()); var finfo = type.GetRuntimeFields().FirstOrDefault(fi => fi.Name == membername && fi.IsStatic); if (finfo != null) diff --git a/src/Tizen.NUI/src/internal/XamlBinding/BindablePropertyConverter.cs b/src/Tizen.NUI/src/internal/XamlBinding/BindablePropertyConverter.cs index 5dfd12d..9f99006 100755 --- a/src/Tizen.NUI/src/internal/XamlBinding/BindablePropertyConverter.cs +++ b/src/Tizen.NUI/src/internal/XamlBinding/BindablePropertyConverter.cs @@ -104,7 +104,7 @@ namespace Tizen.NUI.Binding throw new XamlParseException($"Can't resolve {name} on {type.Name}", lineinfo); var bp = bpinfo.GetValue(null) as BindableProperty; var isObsolete = bpinfo.GetCustomAttribute() != null; - if (bp.PropertyName != propertyName && !isObsolete) + if (bp != null && bp.PropertyName != propertyName && !isObsolete) throw new XamlParseException($"The PropertyName of {type.Name}.{name} is not {propertyName}", lineinfo); return bp; } diff --git a/src/Tizen.NUI/src/internal/XamlBinding/Binding.cs b/src/Tizen.NUI/src/internal/XamlBinding/Binding.cs index be4bfaa..6debd8c 100755 --- a/src/Tizen.NUI/src/internal/XamlBinding/Binding.cs +++ b/src/Tizen.NUI/src/internal/XamlBinding/Binding.cs @@ -200,7 +200,7 @@ namespace Tizen.NUI.Binding string indexerName = defaultMember != null ? defaultMember.MemberName : "Item"; MethodInfo getterInfo = - declarerType.GetProperties().Where(pi => pi.Name == indexerName && pi.CanRead && pi.GetMethod.IsPublic && !pi.GetMethod.IsStatic).Select(pi => pi.GetMethod).FirstOrDefault(); + declarerType.GetProperties().Where(pi => (pi.GetMethod != null) && pi.Name == indexerName && pi.CanRead && pi.GetMethod.IsPublic && !pi.GetMethod.IsStatic).Select(pi => pi.GetMethod).FirstOrDefault(); if (getterInfo != null) { if (getterInfo == methodCall.Method) diff --git a/src/Tizen.NUI/src/internal/XamlBinding/BindingExpression.cs b/src/Tizen.NUI/src/internal/XamlBinding/BindingExpression.cs index 4724d83..ca83712 100755 --- a/src/Tizen.NUI/src/internal/XamlBinding/BindingExpression.cs +++ b/src/Tizen.NUI/src/internal/XamlBinding/BindingExpression.cs @@ -342,43 +342,48 @@ namespace Tizen.NUI.Binding if (property != null) { - if (property.CanRead && property.GetMethod.IsPublic && !property.GetMethod.IsStatic) + if (property.CanRead && property.GetMethod != null) { - part.LastGetter = property.GetMethod; + if (property.GetMethod.IsPublic && !property.GetMethod.IsStatic) + { + part.LastGetter = property.GetMethod; + } } - - if (property.CanWrite && property.SetMethod.IsPublic && !property.SetMethod.IsStatic) + if (property.CanWrite && property.SetMethod != null) { - part.LastSetter = property.SetMethod; - part.SetterType = part.LastSetter.GetParameters().Last().ParameterType; - - if (Binding.AllowChaining) + if(property.SetMethod.IsPublic && !property.SetMethod.IsStatic) { - FieldInfo bindablePropertyField = sourceType.GetDeclaredField(part.Content + "Property"); - if (bindablePropertyField != null && bindablePropertyField.FieldType == typeof(BindableProperty) && sourceType.ImplementedInterfaces.Contains(typeof(IElementController))) + part.LastSetter = property.SetMethod; + part.SetterType = part.LastSetter.GetParameters().Last().ParameterType; + + if (Binding.AllowChaining) { - MethodInfo setValueMethod = null; -#if NETSTANDARD1_0 - foreach (MethodInfo m in sourceType.AsType().GetRuntimeMethods()) + FieldInfo bindablePropertyField = sourceType.GetDeclaredField(part.Content + "Property"); + if (bindablePropertyField != null && bindablePropertyField.FieldType == typeof(BindableProperty) && sourceType.ImplementedInterfaces.Contains(typeof(IElementController))) { - if (m.Name.EndsWith("IElementController.SetValueFromRenderer")) + MethodInfo setValueMethod = null; +#if NETSTANDARD1_0 + foreach (MethodInfo m in sourceType.AsType().GetRuntimeMethods()) { - ParameterInfo[] parameters = m.GetParameters(); - if (parameters.Length == 2 && parameters[0].ParameterType == typeof(BindableProperty)) + if (m.Name.EndsWith("IElementController.SetValueFromRenderer")) { - setValueMethod = m; - break; + ParameterInfo[] parameters = m.GetParameters(); + if (parameters.Length == 2 && parameters[0].ParameterType == typeof(BindableProperty)) + { + setValueMethod = m; + break; + } } } - } #else - setValueMethod = typeof(IElementController).GetMethod("SetValueFromRenderer", new[] { typeof(BindableProperty), typeof(object) }); + setValueMethod = typeof(IElementController).GetMethod("SetValueFromRenderer", new[] { typeof(BindableProperty), typeof(object) }); #endif - if (setValueMethod != null) - { - part.LastSetter = setValueMethod; - part.IsBindablePropertySetter = true; - part.BindablePropertyField = bindablePropertyField.GetValue(null); + if (setValueMethod != null) + { + part.LastSetter = setValueMethod; + part.IsBindablePropertySetter = true; + part.BindablePropertyField = bindablePropertyField.GetValue(null); + } } } } diff --git a/src/Tizen.NUI/src/internal/XamlBinding/SynchronizedList.cs b/src/Tizen.NUI/src/internal/XamlBinding/SynchronizedList.cs index 73918cb..a0761b4 100755 --- a/src/Tizen.NUI/src/internal/XamlBinding/SynchronizedList.cs +++ b/src/Tizen.NUI/src/internal/XamlBinding/SynchronizedList.cs @@ -42,7 +42,11 @@ namespace Tizen.NUI.Binding public int Count { - get { return _list.Count; } + get + { + lock (_list) + return _list.Count; + } } bool ICollection.IsReadOnly @@ -71,14 +75,15 @@ namespace Tizen.NUI.Binding public IEnumerator GetEnumerator() { - ReadOnlyCollection snap = _snapshot; - if (snap == null) + lock (_list) { - lock (_list) + ReadOnlyCollection snap = _snapshot; + if (snap == null) + { _snapshot = snap = new ReadOnlyCollection(_list.ToList()); + } + return snap?.GetEnumerator(); } - - return snap?.GetEnumerator(); } public int IndexOf(T item) @@ -100,12 +105,14 @@ namespace Tizen.NUI.Binding { get { - ReadOnlyCollection snap = _snapshot; - if (snap != null) - return snap[index]; - lock (_list) + { + ReadOnlyCollection snap = _snapshot; + if (snap != null) + return snap[index]; + return _list[index]; + } } set diff --git a/src/Tizen.NUI/src/internal/XamlBinding/TizenPlatformServices.cs b/src/Tizen.NUI/src/internal/XamlBinding/TizenPlatformServices.cs index 8fc16b2..b1f804f 100755 --- a/src/Tizen.NUI/src/internal/XamlBinding/TizenPlatformServices.cs +++ b/src/Tizen.NUI/src/internal/XamlBinding/TizenPlatformServices.cs @@ -212,12 +212,15 @@ namespace Tizen.NUI.Binding try { Assembly refAsm = Assembly.Load(refName); - RegisterAssemblyRecursively(refAsm); - if (refName.Name == "Xamarin.Forms.Core") + if (refAsm != null) { - if (refAsm.GetType("Xamarin.Forms.PlatformConfiguration.TizenSpecific.VisualElement") != null) + RegisterAssemblyRecursively(refAsm); + if (refName.Name == "Xamarin.Forms.Core") { - IsTizenSpecificAvailable = true; + if (refAsm.GetType("Xamarin.Forms.PlatformConfiguration.TizenSpecific.VisualElement") != null) + { + IsTizenSpecificAvailable = true; + } } } } diff --git a/src/Tizen.NUI/src/public/Adaptor.cs b/src/Tizen.NUI/src/public/Adaptor.cs index cd11f18..d12748e 100755 --- a/src/Tizen.NUI/src/public/Adaptor.cs +++ b/src/Tizen.NUI/src/public/Adaptor.cs @@ -1,5 +1,5 @@ /* - * Copyright(c) 2017 Samsung Electronics Co., Ltd. + * Copyright(c) 2018 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -39,30 +39,34 @@ namespace Tizen.NUI /// 4 public class Adaptor : global::System.IDisposable { - private global::System.Runtime.InteropServices.HandleRef swigCPtr; /// swigCMemOwn. /// 4 protected bool swigCMemOwn; - internal Adaptor(global::System.IntPtr cPtr, bool cMemoryOwn) - { - swigCMemOwn = cMemoryOwn; - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); - } - - internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Adaptor obj) - { - return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; - } - - //A Flag to check who called Dispose(). (By User or DisposeQueue) - private bool isDisposeQueued = false; /// /// A Flat to check if it is already disposed. /// /// 4 protected bool disposed = false; + private static readonly Adaptor instance = Adaptor.Get(); + private global::System.Runtime.InteropServices.HandleRef swigCPtr; + + //A Flag to check who called Dispose(). (By User or DisposeQueue) + private bool isDisposeQueued = false; + + private EventHandler _resizedEventHandler; + private ResizedCallbackDelegate _resizedCallbackDelegate; + + private EventHandler _languageChangedEventHandler; + private LanguageChangedCallbackDelegate _languageChangedCallbackDelegate; + + internal Adaptor(global::System.IntPtr cPtr, bool cMemoryOwn) + { + swigCMemOwn = cMemoryOwn; + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); + } + /// /// Dispose. /// @@ -76,6 +80,75 @@ namespace Tizen.NUI } } + [UnmanagedFunctionPointer(CallingConvention.StdCall)] + private delegate void ResizedCallbackDelegate(IntPtr adaptor); + + [UnmanagedFunctionPointer(CallingConvention.StdCall)] + private delegate void LanguageChangedCallbackDelegate(IntPtr adaptor); + + /// + /// An event for the Resized signal which can be used to subscribe or unsubscribe the event handler + /// provided by the user. The Resized signal is emitted when the size changes.
+ ///
+ internal event EventHandler Resized + { + add + { + if (_resizedEventHandler == null) + { + _resizedCallbackDelegate = (OnResized); + ResizedSignal().Connect(_resizedCallbackDelegate); + } + _resizedEventHandler += value; + } + remove + { + _resizedEventHandler -= value; + if (_resizedEventHandler == null && ResizedSignal().Empty() == false) + { + ResizedSignal().Disconnect(_resizedCallbackDelegate); + } + } + } + + /// + /// An event for LanguageChanged signal which can be used to subscribe or unsubscribe the event handler + /// provided by the user. The LanguageChanged signal is emitted when the language changes.
+ ///
+ internal event EventHandler LanguageChanged + { + add + { + if (_languageChangedEventHandler == null) + { + _languageChangedCallbackDelegate = (OnLanguageChanged); + LanguageChangedSignal().Connect(_languageChangedCallbackDelegate); + } + _languageChangedEventHandler += value; + } + remove + { + _languageChangedEventHandler -= value; + if (_languageChangedEventHandler == null && LanguageChangedSignal().Empty() == false) + { + LanguageChangedSignal().Disconnect(_languageChangedCallbackDelegate); + } + } + } + + /// + /// Returns a reference to the instance of the adaptor used by the current thread. + /// + /// The adaptor has been initialized. This is only valid in the main thread. + /// 4 + public static Adaptor Instance + { + get + { + return instance; + } + } + /// 4 public void Dispose() { @@ -97,36 +170,30 @@ namespace Tizen.NUI } /// - /// Dispose. + /// Feeds a wheel event to the adaptor. /// + /// The wheel event. /// 4 - protected virtual void Dispose(DisposeTypes type) + public void FeedWheelEvent(Wheel wheelEvent) { - if (disposed) - { - return; - } - - if (type == DisposeTypes.Explicit) - { - //Called by User - //Release your own managed resources here. - //You should release all of your own disposable objects here. - - } - - //Release your own unmanaged resources here. - //You should not access any managed member here except static instance. - //because the execution order of Finalizes is non-deterministic. + NDalicManualPINVOKE.Adaptor_FeedWheelEvent(swigCPtr, Wheel.getCPtr(wheelEvent)); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } - if (swigCPtr.Handle != global::System.IntPtr.Zero) - { - swigCMemOwn = false; - NDalicManualPINVOKE.delete_Adaptor(swigCPtr); - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); - } + /// + /// Feeds a key event to the adaptor. + /// + /// The key event holding the key information. + /// 4 + public void FeedKeyEvent(Key keyEvent) + { + NDalicManualPINVOKE.Adaptor_FeedKeyEvent(swigCPtr, Key.getCPtr(keyEvent)); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } - disposed = true; + internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Adaptor obj) + { + return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; } internal static Adaptor GetAdaptorFromPtr(global::System.IntPtr cPtr) @@ -164,6 +231,24 @@ namespace Tizen.NUI return ret; } + internal static Adaptor Get() + { + Adaptor ret = new Adaptor(NDalicManualPINVOKE.Adaptor_Get(), false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + /// + /// Checks whether the adaptor is available. + /// + /// True if it is available, false otherwise. + internal static bool IsAvailable() + { + bool ret = NDalicManualPINVOKE.Adaptor_IsAvailable(); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + /// /// Starts the adaptor. /// @@ -273,39 +358,6 @@ namespace Tizen.NUI if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } - private static readonly Adaptor instance = Adaptor.Get(); - - internal static Adaptor Get() - { - Adaptor ret = new Adaptor(NDalicManualPINVOKE.Adaptor_Get(), false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - /// - /// Returns a reference to the instance of the adaptor used by the current thread. - /// - /// The adaptor has been initialized. This is only valid in the main thread. - /// 4 - public static Adaptor Instance - { - get - { - return instance; - } - } - - /// - /// Checks whether the adaptor is available. - /// - /// True if it is available, false otherwise. - internal static bool IsAvailable() - { - bool ret = NDalicManualPINVOKE.Adaptor_IsAvailable(); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - /// /// Calls this method to notify DALi when a scene is created and initialized. /// Notify the adaptor that the scene has been created. @@ -348,28 +400,6 @@ namespace Tizen.NUI } /// - /// Feeds a wheel event to the adaptor. - /// - /// The wheel event. - /// 4 - public void FeedWheelEvent(Wheel wheelEvent) - { - NDalicManualPINVOKE.Adaptor_FeedWheelEvent(swigCPtr, Wheel.getCPtr(wheelEvent)); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - /// - /// Feeds a key event to the adaptor. - /// - /// The key event holding the key information. - /// 4 - public void FeedKeyEvent(Key keyEvent) - { - NDalicManualPINVOKE.Adaptor_FeedKeyEvent(swigCPtr, Key.getCPtr(keyEvent)); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - /// /// Notifies core that the scene has been created. /// internal void SceneCreated() @@ -378,69 +408,51 @@ namespace Tizen.NUI if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } - internal void SetViewMode(ViewMode viewMode) + internal AdaptorSignalType ResizedSignal() { - NDalicManualPINVOKE.Adaptor_SetViewMode(swigCPtr, (int)viewMode); + AdaptorSignalType ret = new AdaptorSignalType(NDalicManualPINVOKE.Adaptor_ResizedSignal(swigCPtr), false); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; } - /// - /// Sets the stereo base (eye separation) for stereoscopic 3D. - /// The stereo base is the distance in millimetres between the eyes. Typical values are - /// between 50mm and 70mm. The default value is 65mm. - /// - /// The stereo base (eye separation) for stereoscopic 3D. - internal void SetStereoBase(float stereoBase) + internal AdaptorSignalType LanguageChangedSignal() { - NDalicManualPINVOKE.Adaptor_SetStereoBase(swigCPtr, stereoBase); + AdaptorSignalType ret = new AdaptorSignalType(NDalicManualPINVOKE.Adaptor_LanguageChangedSignal(swigCPtr), false); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; } /// - /// Event arguments that passed via the Resized signal. + /// Dispose. /// - internal class ResizedEventArgs : EventArgs + /// 4 + protected virtual void Dispose(DisposeTypes type) { - - /// - /// Adaptor - is the adaptor which has size changed. - /// - /// 4 - public Adaptor Adaptor + if (disposed) { - get; - set; + return; } - } - - [UnmanagedFunctionPointer(CallingConvention.StdCall)] - private delegate void ResizedCallbackDelegate(IntPtr adaptor); - private EventHandler _resizedEventHandler; - private ResizedCallbackDelegate _resizedCallbackDelegate; - /// - /// An event for the Resized signal which can be used to subscribe or unsubscribe the event handler - /// provided by the user. The Resized signal is emitted when the size changes.
- ///
- internal event EventHandler Resized - { - add + if (type == DisposeTypes.Explicit) { - if (_resizedEventHandler == null) - { - _resizedCallbackDelegate = (OnResized); - ResizedSignal().Connect(_resizedCallbackDelegate); - } - _resizedEventHandler += value; + //Called by User + //Release your own managed resources here. + //You should release all of your own disposable objects here. + } - remove + + //Release your own unmanaged resources here. + //You should not access any managed member here except static instance. + //because the execution order of Finalizes is non-deterministic. + + if (swigCPtr.Handle != global::System.IntPtr.Zero) { - _resizedEventHandler -= value; - if (_resizedEventHandler == null && ResizedSignal().Empty() == false) - { - ResizedSignal().Disconnect(_resizedCallbackDelegate); - } + swigCMemOwn = false; + NDalicManualPINVOKE.delete_Adaptor(swigCPtr); + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); } + + disposed = true; } private void OnResized(IntPtr adaptor) @@ -458,21 +470,26 @@ namespace Tizen.NUI } } - internal AdaptorSignalType ResizedSignal() + private void OnLanguageChanged(IntPtr adaptor) { - AdaptorSignalType ret = new AdaptorSignalType(NDalicManualPINVOKE.Adaptor_ResizedSignal(swigCPtr), false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; + LanguageChangedEventArgs e = new LanguageChangedEventArgs(); + e.Adaptor = Adaptor.GetAdaptorFromPtr(adaptor); + + if (_languageChangedEventHandler != null) + { + //here we send all data to user event handlers + _languageChangedEventHandler(this, e); + } } /// - /// Event arguments that passed via the LanguageChanged signal. + /// Event arguments that passed via the Resized signal. /// - internal class LanguageChangedEventArgs : EventArgs + internal class ResizedEventArgs : EventArgs { /// - /// Adaptor - is the adaptor which has language changed. + /// Adaptor - is the adaptor which has size changed. /// /// 4 public Adaptor Adaptor @@ -482,58 +499,23 @@ namespace Tizen.NUI } } - [UnmanagedFunctionPointer(CallingConvention.StdCall)] - private delegate void LanguageChangedCallbackDelegate(IntPtr adaptor); - private EventHandler _languageChangedEventHandler; - private LanguageChangedCallbackDelegate _languageChangedCallbackDelegate; - /// - /// An event for LanguageChanged signal which can be used to subscribe or unsubscribe the event handler - /// provided by the user. The LanguageChanged signal is emitted when the language changes.
+ /// Event arguments that passed via the LanguageChanged signal. ///
- internal event EventHandler LanguageChanged - { - add - { - if (_languageChangedEventHandler == null) - { - _languageChangedCallbackDelegate = (OnLanguageChanged); - LanguageChangedSignal().Connect(_languageChangedCallbackDelegate); - } - _languageChangedEventHandler += value; - } - remove - { - _languageChangedEventHandler -= value; - if (_languageChangedEventHandler == null && LanguageChangedSignal().Empty() == false) - { - LanguageChangedSignal().Disconnect(_languageChangedCallbackDelegate); - } - } - } - - private void OnLanguageChanged(IntPtr adaptor) + internal class LanguageChangedEventArgs : EventArgs { - LanguageChangedEventArgs e = new LanguageChangedEventArgs(); - if (adaptor != null) - { - e.Adaptor = Adaptor.GetAdaptorFromPtr(adaptor); - } - if (_languageChangedEventHandler != null) + /// + /// Adaptor - is the adaptor which has language changed. + /// + /// 4 + public Adaptor Adaptor { - //here we send all data to user event handlers - _languageChangedEventHandler(this, e); + get; + set; } } - internal AdaptorSignalType LanguageChangedSignal() - { - AdaptorSignalType ret = new AdaptorSignalType(NDalicManualPINVOKE.Adaptor_LanguageChangedSignal(swigCPtr), false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - } } \ No newline at end of file diff --git a/src/Tizen.NUI/src/public/AlphaFunction.cs b/src/Tizen.NUI/src/public/AlphaFunction.cs index f1e3178..1394a26 100755 --- a/src/Tizen.NUI/src/public/AlphaFunction.cs +++ b/src/Tizen.NUI/src/public/AlphaFunction.cs @@ -26,98 +26,18 @@ namespace Tizen.NUI /// 3 public class AlphaFunction : global::System.IDisposable { - private global::System.Runtime.InteropServices.HandleRef swigCPtr; /// swigCMemOwn. /// 3 protected bool swigCMemOwn; - - internal AlphaFunction(global::System.IntPtr cPtr, bool cMemoryOwn) - { - swigCMemOwn = cMemoryOwn; - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); - } - - internal static global::System.Runtime.InteropServices.HandleRef getCPtr(AlphaFunction obj) - { - return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; - } - - //A Flag to check who called Dispose(). (By User or DisposeQueue) - private bool isDisposeQueued = false; /// /// A Flat to check if it is already disposed. /// /// 3 protected bool disposed = false; - /// - /// Dispose. - /// - /// 3 - ~AlphaFunction() - { - if(!isDisposeQueued) - { - isDisposeQueued = true; - DisposeQueue.Instance.Add(this); - } - } - /// - /// To make the AlphaFunction instance be disposed. - /// - /// 3 - public void Dispose() - { - //Throw excpetion if Dispose() is called in separate thread. - if (!Window.IsInstalled()) - { - throw new System.InvalidOperationException("This API called from separate thread. This API must be called from MainThread."); - } - - if (isDisposeQueued) - { - Dispose(DisposeTypes.Implicit); - } - else - { - Dispose(DisposeTypes.Explicit); - System.GC.SuppressFinalize(this); - } - } - - /// - /// To make the AlphaFunction instance be disposed. - /// - /// 3 - protected virtual void Dispose(DisposeTypes type) - { - if (disposed) - { - return; - } - - if(type == DisposeTypes.Explicit) - { - //Called by User - //Release your own managed resources here. - //You should release all of your own disposable objects here. - } - - //Release your own unmanaged resources here. - //You should not access any managed member here except static instance. - //because the execution order of Finalizes is non-deterministic. - - if (swigCPtr.Handle != global::System.IntPtr.Zero) - { - if (swigCMemOwn) - { - swigCMemOwn = false; - NDalicPINVOKE.delete_AlphaFunction(swigCPtr); - } - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); - } - disposed = true; - } + private global::System.Runtime.InteropServices.HandleRef swigCPtr; + //A Flag to check who called Dispose(). (By User or DisposeQueue) + private bool isDisposeQueued = false; /// /// The constructor.
@@ -151,11 +71,6 @@ namespace Tizen.NUI if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } - internal AlphaFunction(SWIGTYPE_p_f_float__float function) : this(NDalicPINVOKE.new_AlphaFunction__SWIG_2(SWIGTYPE_p_f_float__float.getCPtr(function)), true) - { - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - /// /// The constructor.
/// Creates a bezier alpha function. The bezier will have the first point at (0,0) and the end point at (1,1).
@@ -169,52 +84,28 @@ namespace Tizen.NUI if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } - /// - /// Retrives the control points of the alpha function.
- ///
- /// A Vector2 which will be used as the first control point of the curve. - /// A Vector2 which will be used as the second control point of the curve. - /// 3 - public void GetBezierControlPoints(out Vector2 controlPoint0, out Vector2 controlPoint1) - { - Vector4 ret = new Vector4(NDalicPINVOKE.AlphaFunction_GetBezierControlPoints(swigCPtr), true); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - - controlPoint0 = new Vector2(ret.X, ret.Y); - controlPoint1 = new Vector2(ret.Z, ret.W); - } - - internal SWIGTYPE_p_f_float__float GetCustomFunction() + internal AlphaFunction(global::System.IntPtr cPtr, bool cMemoryOwn) { - global::System.IntPtr cPtr = NDalicPINVOKE.AlphaFunction_GetCustomFunction(swigCPtr); - SWIGTYPE_p_f_float__float ret = (cPtr == global::System.IntPtr.Zero) ? null : new SWIGTYPE_p_f_float__float(cPtr, false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; + swigCMemOwn = cMemoryOwn; + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); } - /// - /// Returns the built-in function used by the alpha function.
- /// In case no built-in function has been specified, it will return AlphaFunction::DEFAULT.
- ///
- /// One of the built-in alpha functions. - /// 3 - public AlphaFunction.BuiltinFunctions GetBuiltinFunction() + internal AlphaFunction(SWIGTYPE_p_f_float__float function) : this(NDalicPINVOKE.new_AlphaFunction__SWIG_2(SWIGTYPE_p_f_float__float.getCPtr(function)), true) { - AlphaFunction.BuiltinFunctions ret = (AlphaFunction.BuiltinFunctions)NDalicPINVOKE.AlphaFunction_GetBuiltinFunction(swigCPtr); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; } /// - /// Returns the functioning mode of the alpha function. + /// Dispose. /// - /// The functioning mode of the alpha function. /// 3 - public AlphaFunction.Modes GetMode() + ~AlphaFunction() { - AlphaFunction.Modes ret = (AlphaFunction.Modes)NDalicPINVOKE.AlphaFunction_GetMode(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; + if(!isDisposeQueued) + { + isDisposeQueued = true; + DisposeQueue.Instance.Add(this); + } } /// @@ -306,6 +197,74 @@ namespace Tizen.NUI Bezier } + /// + /// To make the AlphaFunction instance be disposed. + /// + /// 3 + public void Dispose() + { + //Throw excpetion if Dispose() is called in separate thread. + if (!Window.IsInstalled()) + { + throw new System.InvalidOperationException("This API called from separate thread. This API must be called from MainThread."); + } + + if (isDisposeQueued) + { + Dispose(DisposeTypes.Implicit); + } + else + { + Dispose(DisposeTypes.Explicit); + System.GC.SuppressFinalize(this); + } + } + + /// + /// Retrives the control points of the alpha function.
+ ///
+ /// A Vector2 which will be used as the first control point of the curve. + /// A Vector2 which will be used as the second control point of the curve. + /// 3 + public void GetBezierControlPoints(out Vector2 controlPoint0, out Vector2 controlPoint1) + { + Vector4 ret = new Vector4(NDalicPINVOKE.AlphaFunction_GetBezierControlPoints(swigCPtr), true); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + + controlPoint0 = new Vector2(ret.X, ret.Y); + controlPoint1 = new Vector2(ret.Z, ret.W); + } + + /// + /// Returns the built-in function used by the alpha function.
+ /// In case no built-in function has been specified, it will return AlphaFunction::DEFAULT.
+ ///
+ /// One of the built-in alpha functions. + /// 3 + public AlphaFunction.BuiltinFunctions GetBuiltinFunction() + { + AlphaFunction.BuiltinFunctions ret = (AlphaFunction.BuiltinFunctions)NDalicPINVOKE.AlphaFunction_GetBuiltinFunction(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + /// + /// Returns the functioning mode of the alpha function. + /// + /// The functioning mode of the alpha function. + /// 3 + public AlphaFunction.Modes GetMode() + { + AlphaFunction.Modes ret = (AlphaFunction.Modes)NDalicPINVOKE.AlphaFunction_GetMode(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + internal static global::System.Runtime.InteropServices.HandleRef getCPtr(AlphaFunction obj) + { + return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; + } + internal static string BuiltinToPropertyKey(BuiltinFunctions? alphaFunction) { string propertyKey = null; @@ -314,78 +273,120 @@ namespace Tizen.NUI switch (alphaFunction) { case Tizen.NUI.AlphaFunction.BuiltinFunctions.Linear: - { - propertyKey = "LINEAR"; - break; - } + { + propertyKey = "LINEAR"; + break; + } case Tizen.NUI.AlphaFunction.BuiltinFunctions.Reverse: - { - propertyKey = "REVERSE"; - break; - } + { + propertyKey = "REVERSE"; + break; + } case Tizen.NUI.AlphaFunction.BuiltinFunctions.EaseInSquare: - { - propertyKey = "EASE_IN_SQUARE"; - break; - } + { + propertyKey = "EASE_IN_SQUARE"; + break; + } case Tizen.NUI.AlphaFunction.BuiltinFunctions.EaseOutSquare: - { - propertyKey = "EASE_OUT_SQUARE"; - break; - } + { + propertyKey = "EASE_OUT_SQUARE"; + break; + } case Tizen.NUI.AlphaFunction.BuiltinFunctions.EaseIn: - { - propertyKey = "EASE_IN"; - break; - } + { + propertyKey = "EASE_IN"; + break; + } case Tizen.NUI.AlphaFunction.BuiltinFunctions.EaseOut: - { - propertyKey = "EASE_OUT"; - break; - } + { + propertyKey = "EASE_OUT"; + break; + } case Tizen.NUI.AlphaFunction.BuiltinFunctions.EaseInOut: - { - propertyKey = "EASE_IN_OUT"; - break; - } + { + propertyKey = "EASE_IN_OUT"; + break; + } case Tizen.NUI.AlphaFunction.BuiltinFunctions.EaseInSine: - { - propertyKey = "EASE_IN_SINE"; - break; - } + { + propertyKey = "EASE_IN_SINE"; + break; + } case Tizen.NUI.AlphaFunction.BuiltinFunctions.EaseOutSine: - { - propertyKey = "EASE_OUT_SINE"; - break; - } + { + propertyKey = "EASE_OUT_SINE"; + break; + } case Tizen.NUI.AlphaFunction.BuiltinFunctions.EaseInOutSine: - { - propertyKey = "EASE_IN_OUT_SINE"; - break; - } + { + propertyKey = "EASE_IN_OUT_SINE"; + break; + } case Tizen.NUI.AlphaFunction.BuiltinFunctions.Bounce: - { - propertyKey = "BOUNCE"; - break; - } + { + propertyKey = "BOUNCE"; + break; + } case Tizen.NUI.AlphaFunction.BuiltinFunctions.Sin: - { - propertyKey = "SIN"; - break; - } + { + propertyKey = "SIN"; + break; + } case Tizen.NUI.AlphaFunction.BuiltinFunctions.EaseOutBack: - { - propertyKey = "EASE_OUT_BACK"; - break; - } + { + propertyKey = "EASE_OUT_BACK"; + break; + } default: - { - propertyKey = "DEFAULT"; - break; - } + { + propertyKey = "DEFAULT"; + break; + } } } return propertyKey; } + + internal SWIGTYPE_p_f_float__float GetCustomFunction() + { + global::System.IntPtr cPtr = NDalicPINVOKE.AlphaFunction_GetCustomFunction(swigCPtr); + SWIGTYPE_p_f_float__float ret = (cPtr == global::System.IntPtr.Zero) ? null : new SWIGTYPE_p_f_float__float(cPtr, false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + /// + /// To make the AlphaFunction instance be disposed. + /// + /// 3 + protected virtual void Dispose(DisposeTypes type) + { + if (disposed) + { + return; + } + + if(type == DisposeTypes.Explicit) + { + //Called by User + //Release your own managed resources here. + //You should release all of your own disposable objects here. + } + + //Release your own unmanaged resources here. + //You should not access any managed member here except static instance. + //because the execution order of Finalizes is non-deterministic. + + if (swigCPtr.Handle != global::System.IntPtr.Zero) + { + if (swigCMemOwn) + { + swigCMemOwn = false; + NDalicPINVOKE.delete_AlphaFunction(swigCPtr); + } + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); + } + disposed = true; + } } } \ No newline at end of file diff --git a/src/Tizen.NUI/src/public/Animatable.cs b/src/Tizen.NUI/src/public/Animatable.cs index bbd98a7..99093e3 100755 --- a/src/Tizen.NUI/src/public/Animatable.cs +++ b/src/Tizen.NUI/src/public/Animatable.cs @@ -28,67 +28,33 @@ namespace Tizen.NUI { private global::System.Runtime.InteropServices.HandleRef swigCPtr; - internal Animatable(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.Handle_SWIGUpcast(cPtr), cMemoryOwn) - { - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); - } - - internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Animatable obj) - { - return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; - } - /// - /// To make the Animatable instance be disposed. + /// Create an instance of animatable. /// /// 3 - protected override void Dispose(DisposeTypes type) + public Animatable() : this(NDalicPINVOKE.Handle_New(), true) { - if (disposed) - { - return; - } - - if (type == DisposeTypes.Explicit) - { - //Called by User - //Release your own managed resources here. - //You should release all of your own disposable objects here. - - } - - //Release your own unmanaged resources here. - //You should not access any managed member here except static instance. - //because the execution order of Finalizes is non-deterministic. + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - if (swigCPtr.Handle != global::System.IntPtr.Zero) - { - if (swigCMemOwn) - { - swigCMemOwn = false; - NDalicPINVOKE.delete_Handle(swigCPtr); - } - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); - } + } - base.Dispose(type); + internal Animatable(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.Handle_SWIGUpcast(cPtr), cMemoryOwn) + { + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); } /// - /// Create an instance of animatable. + /// Enumeration for Handle's capabilities that can be queried. /// /// 3 - public Animatable() : this(NDalicPINVOKE.Handle_New(), true) - { - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - - } - - internal uint GetPropertyCount() + public enum Capability { - uint ret = NDalicPINVOKE.Handle_GetPropertyCount(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; + /// + /// Some objects support dynamic property creation at run-time. + /// New properties are registered by calling RegisterProperty() with an unused property name. + /// + /// 3 + DYNAMIC_PROPERTIES = 0x01 } /// @@ -227,13 +193,6 @@ namespace Tizen.NUI return ret; } - internal PropertyNotification AddPropertyNotification(int index, int componentIndex, PropertyCondition condition) - { - PropertyNotification ret = new PropertyNotification(NDalicPINVOKE.Handle_AddPropertyNotification__SWIG_1(swigCPtr, index, componentIndex, PropertyCondition.getCPtr(condition)), true); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - /// /// Removes a property notification from this object. /// @@ -255,6 +214,25 @@ namespace Tizen.NUI if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } + internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Animatable obj) + { + return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; + } + + internal uint GetPropertyCount() + { + uint ret = NDalicPINVOKE.Handle_GetPropertyCount(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + internal PropertyNotification AddPropertyNotification(int index, int componentIndex, PropertyCondition condition) + { + PropertyNotification ret = new PropertyNotification(NDalicPINVOKE.Handle_AddPropertyNotification__SWIG_1(swigCPtr, index, componentIndex, PropertyCondition.getCPtr(condition)), true); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + internal void RemoveConstraints() { NDalicPINVOKE.Handle_RemoveConstraints__SWIG_0(swigCPtr); @@ -268,17 +246,39 @@ namespace Tizen.NUI } /// - /// Enumeration for Handle's capabilities that can be queried. + /// To make the Animatable instance be disposed. /// /// 3 - public enum Capability + protected override void Dispose(DisposeTypes type) { - /// - /// Some objects support dynamic property creation at run-time. - /// New properties are registered by calling RegisterProperty() with an unused property name. - /// - /// 3 - DYNAMIC_PROPERTIES = 0x01 + if (disposed) + { + return; + } + + if (type == DisposeTypes.Explicit) + { + //Called by User + //Release your own managed resources here. + //You should release all of your own disposable objects here. + + } + + //Release your own unmanaged resources here. + //You should not access any managed member here except static instance. + //because the execution order of Finalizes is non-deterministic. + + if (swigCPtr.Handle != global::System.IntPtr.Zero) + { + if (swigCMemOwn) + { + swigCMemOwn = false; + NDalicPINVOKE.delete_Handle(swigCPtr); + } + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); + } + + base.Dispose(type); } } diff --git a/src/Tizen.NUI/src/public/Animation.cs b/src/Tizen.NUI/src/public/Animation.cs index 430cee5..de77c96 100755 --- a/src/Tizen.NUI/src/public/Animation.cs +++ b/src/Tizen.NUI/src/public/Animation.cs @@ -43,78 +43,19 @@ namespace Tizen.NUI /// 3 public class Animation : BaseHandle { - private global::System.Runtime.InteropServices.HandleRef swigCPtr; - - internal Animation(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.Animation_SWIGUpcast(cPtr), cMemoryOwn) - { - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); - - _animationFinishedEventCallback = OnFinished; - _finishedCallbackOfNative = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(_animationFinishedEventCallback); - } - - internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Animation obj) - { - return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; - } - - /// - /// To make animation instance be disposed. - /// - /// 3 - protected override void Dispose(DisposeTypes type) - { - if (this != null) - { - if (_animationFinishedEventCallback != null) - { - FinishedSignal().Disconnect(_finishedCallbackOfNative); - } - - if (_animationProgressReachedEventCallback != null) - { - - ProgressReachedSignal().Disconnect(_animationProgressReachedEventCallback); - } - } - - if(disposed) - { - return; - } - if(type == DisposeTypes.Explicit) - { - //Called by User - //Release your own managed resources here. - //You should release all of your own disposable objects here. - - } - else if(type == DisposeTypes.Implicit) - { - - } + private static bool? disableAnimation = null; - if (this != null) - { - this.Clear(); - } + private global::System.Runtime.InteropServices.HandleRef swigCPtr; - //Release your own unmanaged resources here. - //You should not access any managed member here except static instance. - //because the execution order of Finalizes is non-deterministic. + private AnimationFinishedEventCallbackType _animationFinishedEventCallback; + private System.IntPtr _finishedCallbackOfNative; - if (swigCPtr.Handle != global::System.IntPtr.Zero) - { - if (swigCMemOwn) - { - swigCMemOwn = false; - NDalicPINVOKE.delete_Animation(swigCPtr); - } - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); - } + private AnimationProgressReachedEventCallbackType _animationProgressReachedEventCallback; - base.Dispose(type); - } + private string[] _properties = null; + private string[] _destValue = null; + private int[] _startTime = null; + private int[] _endTime = null; /// /// Creates an initialized animation.
@@ -130,12 +71,21 @@ namespace Tizen.NUI if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } - private AnimationFinishedEventCallbackType _animationFinishedEventCallback; + internal Animation(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.Animation_SWIGUpcast(cPtr), cMemoryOwn) + { + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); + + _animationFinishedEventCallback = OnFinished; + _finishedCallbackOfNative = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(_animationFinishedEventCallback); + } + [UnmanagedFunctionPointer(CallingConvention.StdCall)] private delegate void AnimationFinishedEventCallbackType(IntPtr data); - private event EventHandler _animationFinishedEventHandler; - private System.IntPtr _finishedCallbackOfNative; + [UnmanagedFunctionPointer(CallingConvention.StdCall)] + private delegate void AnimationProgressReachedEventCallbackType(IntPtr data); + + private event EventHandler _animationFinishedEventHandler; /** * @brief Event for the finished signal which can be used to subscribe or unsubscribe the event handler. @@ -162,23 +112,13 @@ namespace Tizen.NUI } } } - private void OnFinished(IntPtr data) - { - if (_animationFinishedEventHandler != null) - { - //here we send all data to user event handlers - _animationFinishedEventHandler(this, null); - } - } - [UnmanagedFunctionPointer(CallingConvention.StdCall)] - private delegate void AnimationProgressReachedEventCallbackType(IntPtr data); - private AnimationProgressReachedEventCallbackType _animationProgressReachedEventCallback; private event EventHandler _animationProgressReachedEventHandler; + /** - * @brief Event for the ProgressReached signal, which can be used to subscribe or unsubscribe the event handler. - * The ProgressReached signal is emitted when the animation has reached a given progress percentage, this is set in the api SetProgressNotification. - */ + * @brief Event for the ProgressReached signal, which can be used to subscribe or unsubscribe the event handler. + * The ProgressReached signal is emitted when the animation has reached a given progress percentage, this is set in the api SetProgressNotification. + */ /// 3 public event EventHandler ProgressReached { @@ -202,26 +142,64 @@ namespace Tizen.NUI } } } - private void OnProgressReached(IntPtr data) + + /// + /// Enumeration for what to do when the animation ends, stopped, or destroyed. + /// + /// 3 + public enum EndActions { - if (_animationProgressReachedEventHandler != null) - { - //here we send all data to user event handlers - _animationProgressReachedEventHandler(this, null); - } + /// + /// When the animation ends, the animated property values are saved. + /// + Cancel, + /// + /// When the animation ends, the animated property values are forgotten. + /// + Discard, + /// + /// If the animation is stopped, the animated property values are saved as if the animation had run to completion, otherwise behaves like cancel. + /// + StopFinal } - private float MilliSecondsToSeconds(int millisec) + /// + /// Enumeration for what interpolation method to use on key-frame animations. + /// + /// 3 + public enum Interpolation { - return (float)millisec / 1000.0f; + /// + /// Values in between key frames are interpolated using a linear polynomial. (Default) + /// + Linear, + /// + /// Values in between key frames are interpolated using a cubic polynomial. + /// + Cubic } - private int SecondsToMilliSeconds(float sec) + /// + /// Enumeration for what state the animation is in. + /// + /// Calling Reset() on this class will not reset the animation. It will call the BaseHandle.Reset() which drops the object handle. + /// 3 + public enum States { - return (int)(sec * 1000); + /// + /// The animation has stopped. + /// + Stopped, + /// + /// The animation is playing. + /// + Playing, + /// + /// The animation is paused. + /// + Paused } - /// /// Gets or sets the duration in milliseconds of the animation. /// @@ -326,19 +304,6 @@ namespace Tizen.NUI } } - - /// - /// Stops the animation. - /// - /// The end action can be set. - /// 3 - public void Stop(EndActions action = EndActions.Cancel) - { - SetEndAction(action); - NDalicPINVOKE.Animation_Stop(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - /// /// Gets the current loop count.
/// A value 0 indicating the current loop count when looping.
@@ -462,178 +427,214 @@ namespace Tizen.NUI } /// - /// Animates a property value by a relative amount.
+ /// Gets or sets the properties of the animation. ///
- /// The target object to animate. - /// The target property to animate. - /// The property value will change by this amount. - /// The alpha function to apply. - /// 3 - public void AnimateBy(View target, string property, object relativeValue, AlphaFunction alphaFunction = null) + public string[] Properties { - Property _prop = PropertyHelper.GetPropertyFromString(target, property); - - PropertyType propertyType = target.GetPropertyType(_prop.propertyIndex); - if(propertyType.Equals(PropertyType.Float)) - { - System.Type type = relativeValue.GetType(); - if (type.Equals(typeof(System.Int32)) || type.Equals(typeof(int))) - { - int num = (int)relativeValue; - relativeValue = (float)num; - } - } - - PropertyValue val = PropertyValue.CreateFromObject(relativeValue); - - if (alphaFunction != null) + get { - AnimateBy(_prop, val, alphaFunction); + return _properties; } - else + set { - AnimateBy(_prop, val); + _properties = value; } } /// - /// Animates a property value by a relative amount.
+ /// Gets or sets the destination value for each property of the animation. ///
- /// The target object to animate. - /// The target property to animate. - /// The property value will change by this amount. - /// The start time of the animation. - /// The end time of the animation. - /// The alpha function to apply. - /// 3 - public void AnimateBy(View target, string property, object relativeValue, int startTime, int endTime, AlphaFunction alphaFunction = null) + public string[] DestValue { - Property _prop = PropertyHelper.GetPropertyFromString(target, property); - - PropertyType propertyType = target.GetPropertyType(_prop.propertyIndex); - if(propertyType.Equals(PropertyType.Float)) + get { - System.Type type = relativeValue.GetType(); - if (type.Equals(typeof(System.Int32)) || type.Equals(typeof(int))) - { - int num = (int)relativeValue; - relativeValue = (float)num; - } + return _destValue; } + set + { + _destValue = value; + } + } - PropertyValue val = PropertyValue.CreateFromObject(relativeValue); - - if (alphaFunction != null) + /// + /// Gets or sets the start time for each property of the animation. + /// + public int[] StartTime + { + get { - Tizen.NUI.TimePeriod time = new Tizen.NUI.TimePeriod(MilliSecondsToSeconds(startTime), MilliSecondsToSeconds(endTime - startTime)); - AnimateBy(_prop, val, alphaFunction, time); + return _startTime; } - else + set { - Tizen.NUI.TimePeriod time = new Tizen.NUI.TimePeriod(MilliSecondsToSeconds(startTime), MilliSecondsToSeconds(endTime - startTime)); - AnimateBy(_prop, val, time); + _startTime = value; } } /// - /// Animates a property to a destination value.
+ /// Gets or sets the end time for each property of the animation. ///
- /// The target object to animate. + public int[] EndTime + { + get + { + return _endTime; + } + set + { + _endTime = value; + } + } + + private bool DisableAnimation + { + get + { + if (disableAnimation.HasValue == false) + { + string type = Environment.GetEnvironmentVariable("PlatformSmartType"); + if (type == "Entry") + disableAnimation = true; + else + disableAnimation = false; + } + return disableAnimation.Value; + } + } + + /// + /// Downcasts a handle to animation handle.
+ /// If handle points to an animation object, the downcast produces a valid handle.
+ /// If not, the returned handle is left uninitialized.
+ ///
+ /// Handle to an object. + /// Handle to an animation object or an uninitialized handle. + /// 3 + public static Animation DownCast(BaseHandle handle) + { + Animation ret = Registry.GetManagedBaseHandleFromNativePtr(handle) as Animation; + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + /// + /// Stops the animation. + /// + /// The end action can be set. + /// 3 + public void Stop(EndActions action = EndActions.Cancel) + { + SetEndAction(action); + NDalicPINVOKE.Animation_Stop(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + /// + /// Animates a property value by a relative amount.
+ ///
+ /// The target object to animate. /// The target property to animate. - /// The destination value. + /// The property value will change by this amount. /// The alpha function to apply. /// 3 - public void AnimateTo(View target, string property, object destinationValue, AlphaFunction alphaFunction = null) + public void AnimateBy(View target, string property, object relativeValue, AlphaFunction alphaFunction = null) { Property _prop = PropertyHelper.GetPropertyFromString(target, property); PropertyType propertyType = target.GetPropertyType(_prop.propertyIndex); - if(propertyType.Equals(PropertyType.Float)) + if (propertyType.Equals(PropertyType.Float)) { - System.Type type = destinationValue.GetType(); + System.Type type = relativeValue.GetType(); if (type.Equals(typeof(System.Int32)) || type.Equals(typeof(int))) { - int num = (int)destinationValue; - destinationValue = (float)num; + int num = (int)relativeValue; + relativeValue = (float)num; } } - PropertyValue val = PropertyValue.CreateFromObject(destinationValue); + PropertyValue val = PropertyValue.CreateFromObject(relativeValue); if (alphaFunction != null) { - AnimateTo(_prop, val, alphaFunction); + AnimateBy(_prop, val, alphaFunction); } else { - AnimateTo(_prop, val); + AnimateBy(_prop, val); } } - private string[] _properties = null; /// - /// Gets or sets the properties of the animation. + /// Animates a property value by a relative amount.
///
- public string[] Properties + /// The target object to animate. + /// The target property to animate. + /// The property value will change by this amount. + /// The start time of the animation. + /// The end time of the animation. + /// The alpha function to apply. + /// 3 + public void AnimateBy(View target, string property, object relativeValue, int startTime, int endTime, AlphaFunction alphaFunction = null) { - get - { - return _properties; - } - set + Property _prop = PropertyHelper.GetPropertyFromString(target, property); + + PropertyType propertyType = target.GetPropertyType(_prop.propertyIndex); + if (propertyType.Equals(PropertyType.Float)) { - _properties = value; + System.Type type = relativeValue.GetType(); + if (type.Equals(typeof(System.Int32)) || type.Equals(typeof(int))) + { + int num = (int)relativeValue; + relativeValue = (float)num; + } } - } - private string[] _destValue = null; + PropertyValue val = PropertyValue.CreateFromObject(relativeValue); - /// - /// Gets or sets the destination value for each property of the animation. - /// - public string[] DestValue - { - get + if (alphaFunction != null) { - return _destValue; + Tizen.NUI.TimePeriod time = new Tizen.NUI.TimePeriod(MilliSecondsToSeconds(startTime), MilliSecondsToSeconds(endTime - startTime)); + AnimateBy(_prop, val, alphaFunction, time); } - set + else { - _destValue = value; + Tizen.NUI.TimePeriod time = new Tizen.NUI.TimePeriod(MilliSecondsToSeconds(startTime), MilliSecondsToSeconds(endTime - startTime)); + AnimateBy(_prop, val, time); } } - private int[] _startTime = null; - /// - /// Gets or sets the start time for each property of the animation. + /// Animates a property to a destination value.
///
- public int[] StartTime + /// The target object to animate. + /// The target property to animate. + /// The destination value. + /// The alpha function to apply. + /// 3 + public void AnimateTo(View target, string property, object destinationValue, AlphaFunction alphaFunction = null) { - get - { - return _startTime; - } - set + Property _prop = PropertyHelper.GetPropertyFromString(target, property); + + PropertyType propertyType = target.GetPropertyType(_prop.propertyIndex); + if (propertyType.Equals(PropertyType.Float)) { - _startTime = value; + System.Type type = destinationValue.GetType(); + if (type.Equals(typeof(System.Int32)) || type.Equals(typeof(int))) + { + int num = (int)destinationValue; + destinationValue = (float)num; + } } - } - private int[] _endTime = null; + PropertyValue val = PropertyValue.CreateFromObject(destinationValue); - /// - /// Gets or sets the end time for each property of the animation. - /// - public int[] EndTime - { - get + if (alphaFunction != null) { - return _endTime; + AnimateTo(_prop, val, alphaFunction); } - set + else { - _endTime = value; + AnimateTo(_prop, val); } } @@ -657,7 +658,7 @@ namespace Tizen.NUI { object destinationValue = ConvertTo(_destValue[index], propertyInfo.PropertyType); - if(destinationValue != null) + if (destinationValue != null) { AnimateTo(target, _properties[index], destinationValue, _startTime[index], _endTime[index]); } @@ -667,145 +668,6 @@ namespace Tizen.NUI } } - internal object ConvertTo(object value, Type toType) - { - Func getConverter = () => - { - string converterTypeName = GetTypeConverterTypeName(toType.GetTypeInfo().CustomAttributes); - if (converterTypeName == null) - return null; - - Type convertertype = Type.GetType(converterTypeName); - return Activator.CreateInstance(convertertype); - }; - - return ConvertTo(value, toType, getConverter); - } - - internal object ConvertTo(object value, Type toType, Func getConverter) - { - if (value == null) - return null; - - var str = value as string; - if (str != null) - { - //If there's a [TypeConverter], use it - object converter = getConverter?.Invoke(); - var xfTypeConverter = converter as Tizen.NUI.Binding.TypeConverter; - if (xfTypeConverter != null) - return value = xfTypeConverter.ConvertFromInvariantString(str); - var converterType = converter?.GetType(); - if (converterType != null) - { - var convertFromStringInvariant = converterType.GetRuntimeMethod("ConvertFromInvariantString", - new[] { typeof(string) }); - if (convertFromStringInvariant != null) - return value = convertFromStringInvariant.Invoke(converter, new object[] { str }); - } - - //If the type is nullable, as the value is not null, it's safe to assume we want the built-in conversion - if (toType.GetTypeInfo().IsGenericType && toType.GetGenericTypeDefinition() == typeof(Nullable<>)) - toType = Nullable.GetUnderlyingType(toType); - - //Obvious Built-in conversions - if (toType.GetTypeInfo().IsEnum) - return Enum.Parse(toType, str, true); - if (toType == typeof(SByte)) - return SByte.Parse(str, CultureInfo.InvariantCulture); - if (toType == typeof(Int16)) - return Int16.Parse(str, CultureInfo.InvariantCulture); - if (toType == typeof(Int32)) - return Int32.Parse(str, CultureInfo.InvariantCulture); - if (toType == typeof(Int64)) - return Int64.Parse(str, CultureInfo.InvariantCulture); - if (toType == typeof(Byte)) - return Byte.Parse(str, CultureInfo.InvariantCulture); - if (toType == typeof(UInt16)) - return UInt16.Parse(str, CultureInfo.InvariantCulture); - if (toType == typeof(UInt32)) - return UInt32.Parse(str, CultureInfo.InvariantCulture); - if (toType == typeof(UInt64)) - return UInt64.Parse(str, CultureInfo.InvariantCulture); - if (toType == typeof(Single)) - return Single.Parse(str, CultureInfo.InvariantCulture); - if (toType == typeof(Double)) - return Double.Parse(str, CultureInfo.InvariantCulture); - if (toType == typeof(Boolean)) - return Boolean.Parse(str); - if (toType == typeof(TimeSpan)) - return TimeSpan.Parse(str, CultureInfo.InvariantCulture); - if (toType == typeof(DateTime)) - return DateTime.Parse(str, CultureInfo.InvariantCulture); - if (toType == typeof(Char)) - { - char c = '\0'; - Char.TryParse(str, out c); - return c; - } - if (toType == typeof(String) && str.StartsWith("{}", StringComparison.Ordinal)) - return str.Substring(2); - if (toType == typeof(String)) - return value; - if (toType == typeof(Decimal)) - return Decimal.Parse(str, CultureInfo.InvariantCulture); - } - - //if the value is not assignable and there's an implicit conversion, convert - if (value != null && !toType.IsAssignableFrom(value.GetType())) - { - var opImplicit = GetImplicitConversionOperator(value.GetType(), value.GetType(), toType) - ?? GetImplicitConversionOperator(toType, value.GetType(), toType); - //var opImplicit = value.GetType().GetImplicitConversionOperator(fromType: value.GetType(), toType: toType) - // ?? toType.GetImplicitConversionOperator(fromType: value.GetType(), toType: toType); - - if (opImplicit != null) - { - value = opImplicit.Invoke(null, new[] { value }); - return value; - } - } - - var nativeValueConverterService = DependencyService.Get(); - - object nativeValue = null; - if (nativeValueConverterService != null && nativeValueConverterService.ConvertTo(value, toType, out nativeValue)) - return nativeValue; - - return value; - } - - internal string GetTypeConverterTypeName(IEnumerable attributes) - { - var converterAttribute = - attributes.FirstOrDefault(cad => Tizen.NUI.Binding.TypeConverterAttribute.TypeConvertersType.Contains(cad.AttributeType.FullName)); - if (converterAttribute == null) - return null; - if (converterAttribute.ConstructorArguments[0].ArgumentType == typeof(string)) - return (string)converterAttribute.ConstructorArguments[0].Value; - if (converterAttribute.ConstructorArguments[0].ArgumentType == typeof(Type)) - return ((Type)converterAttribute.ConstructorArguments[0].Value).AssemblyQualifiedName; - return null; - } - - internal MethodInfo GetImplicitConversionOperator(Type onType, Type fromType, Type toType) - { -#if NETSTANDARD1_0 - var mi = onType.GetRuntimeMethod("op_Implicit", new[] { fromType }); -#else - var bindingFlags = BindingFlags.Public | BindingFlags.Static | BindingFlags.FlattenHierarchy; - var mi = onType.GetMethod("op_Implicit", bindingFlags, null, new[] { fromType }, null); -#endif - if (mi == null) return null; - if (!mi.IsSpecialName) return null; - if (!mi.IsPublic) return null; - if (!mi.IsStatic) return null; - if (!toType.IsAssignableFrom(mi.ReturnType)) return null; - - return mi; - } - - /// /// Animates a property to a destination value.
///
@@ -821,7 +683,7 @@ namespace Tizen.NUI Property _prop = PropertyHelper.GetPropertyFromString(target, property); PropertyType propertyType = target.GetPropertyType(_prop.propertyIndex); - if(propertyType.Equals(PropertyType.Float)) + if (propertyType.Equals(PropertyType.Float)) { System.Type type = destinationValue.GetType(); if (type.Equals(typeof(System.Int32)) || type.Equals(typeof(int))) @@ -873,7 +735,6 @@ namespace Tizen.NUI } } - /// /// Animates a property between keyframes. /// @@ -947,37 +808,235 @@ namespace Tizen.NUI } } - /// - /// Creates an initialized animation.
- /// The animation will not loop.
- /// The default end action is "Cancel".
- /// The default alpha function is linear.
- ///
- /// 3 - public Animation() : this(NDalicPINVOKE.Animation_New(0.0f), true) + /// + /// Creates an initialized animation.
+ /// The animation will not loop.
+ /// The default end action is "Cancel".
+ /// The default alpha function is linear.
+ ///
+ /// 3 + public Animation() : this(NDalicPINVOKE.Animation_New(0.0f), true) + { + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + /// + /// Plays the animation. + /// + /// 3 + public void Play() + { + NDalicPINVOKE.Animation_Play(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + + if (DisableAnimation == true) + Stop(EndActions.StopFinal); + } + + /// + /// Plays the animation from a given point.
+ /// The progress must be in the 0-1 interval or in the play range interval if defined, + /// otherwise, it will be ignored.
+ ///
+ /// A value between [0,1], or between the play range if specified, from where the animation should start playing. + /// 3 + public void PlayFrom(float progress) + { + NDalicPINVOKE.Animation_PlayFrom(swigCPtr, progress); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + /// + /// Plays the animation after a given delay time.
+ /// The delay time is not included in the looping time.
+ /// When the delay time is a negative value, it would treat as play immediately.
+ ///
+ /// The delay time. + /// 4 + public void PlayAfter(int delayMilliseconds) + { + NDalicPINVOKE.Animation_PlayAfter(swigCPtr, MilliSecondsToSeconds(delayMilliseconds)); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + /// + /// Pauses the animation. + /// + /// 3 + public void Pause() + { + NDalicPINVOKE.Animation_Pause(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + /// + /// Stops the animation. + /// + /// 3 + public void Stop() + { + NDalicPINVOKE.Animation_Stop(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + /// + /// Clears the animation.
+ /// This disconnects any objects that were being animated, effectively stopping the animation.
+ ///
+ /// 3 + public void Clear() + { + NDalicPINVOKE.Animation_Clear(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Animation obj) + { + return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; + } + + internal object ConvertTo(object value, Type toType) + { + Func getConverter = () => + { + string converterTypeName = GetTypeConverterTypeName(toType.GetTypeInfo().CustomAttributes); + if (converterTypeName == null) + return null; + + Type convertertype = Type.GetType(converterTypeName); + return Activator.CreateInstance(convertertype); + }; + + return ConvertTo(value, toType, getConverter); + } + + internal object ConvertTo(object value, Type toType, Func getConverter) + { + if (value == null) + return null; + + var str = value as string; + if (str != null) + { + //If there's a [TypeConverter], use it + object converter = getConverter?.Invoke(); + var xfTypeConverter = converter as Tizen.NUI.Binding.TypeConverter; + if (xfTypeConverter != null) + return value = xfTypeConverter.ConvertFromInvariantString(str); + var converterType = converter?.GetType(); + if (converterType != null) + { + var convertFromStringInvariant = converterType.GetRuntimeMethod("ConvertFromInvariantString", + new[] { typeof(string) }); + if (convertFromStringInvariant != null) + return value = convertFromStringInvariant.Invoke(converter, new object[] { str }); + } + + //If the type is nullable, as the value is not null, it's safe to assume we want the built-in conversion + if (toType.GetTypeInfo().IsGenericType && toType.GetGenericTypeDefinition() == typeof(Nullable<>)) + toType = Nullable.GetUnderlyingType(toType); + + //Obvious Built-in conversions + if (toType.GetTypeInfo().IsEnum) + return Enum.Parse(toType, str, true); + if (toType == typeof(SByte)) + return SByte.Parse(str, CultureInfo.InvariantCulture); + if (toType == typeof(Int16)) + return Int16.Parse(str, CultureInfo.InvariantCulture); + if (toType == typeof(Int32)) + return Int32.Parse(str, CultureInfo.InvariantCulture); + if (toType == typeof(Int64)) + return Int64.Parse(str, CultureInfo.InvariantCulture); + if (toType == typeof(Byte)) + return Byte.Parse(str, CultureInfo.InvariantCulture); + if (toType == typeof(UInt16)) + return UInt16.Parse(str, CultureInfo.InvariantCulture); + if (toType == typeof(UInt32)) + return UInt32.Parse(str, CultureInfo.InvariantCulture); + if (toType == typeof(UInt64)) + return UInt64.Parse(str, CultureInfo.InvariantCulture); + if (toType == typeof(Single)) + return Single.Parse(str, CultureInfo.InvariantCulture); + if (toType == typeof(Double)) + return Double.Parse(str, CultureInfo.InvariantCulture); + if (toType == typeof(Boolean)) + return Boolean.Parse(str); + if (toType == typeof(TimeSpan)) + return TimeSpan.Parse(str, CultureInfo.InvariantCulture); + if (toType == typeof(DateTime)) + return DateTime.Parse(str, CultureInfo.InvariantCulture); + if (toType == typeof(Char)) + { + char c = '\0'; + Char.TryParse(str, out c); + return c; + } + if (toType == typeof(String) && str.StartsWith("{}", StringComparison.Ordinal)) + return str.Substring(2); + if (toType == typeof(String)) + return value; + if (toType == typeof(Decimal)) + return Decimal.Parse(str, CultureInfo.InvariantCulture); + } + + //if the value is not assignable and there's an implicit conversion, convert + if (value != null && !toType.IsAssignableFrom(value.GetType())) + { + var opImplicit = GetImplicitConversionOperator(value.GetType(), value.GetType(), toType) + ?? GetImplicitConversionOperator(toType, value.GetType(), toType); + //var opImplicit = value.GetType().GetImplicitConversionOperator(fromType: value.GetType(), toType: toType) + // ?? toType.GetImplicitConversionOperator(fromType: value.GetType(), toType: toType); + + if (opImplicit != null) + { + value = opImplicit.Invoke(null, new[] { value }); + return value; + } + } + + var nativeValueConverterService = DependencyService.Get(); + + object nativeValue = null; + if (nativeValueConverterService != null && nativeValueConverterService.ConvertTo(value, toType, out nativeValue)) + return nativeValue; + + return value; + } + + internal string GetTypeConverterTypeName(IEnumerable attributes) { - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + var converterAttribute = + attributes.FirstOrDefault(cad => Tizen.NUI.Binding.TypeConverterAttribute.TypeConvertersType.Contains(cad.AttributeType.FullName)); + if (converterAttribute == null) + return null; + if (converterAttribute.ConstructorArguments[0].ArgumentType == typeof(string)) + return (string)converterAttribute.ConstructorArguments[0].Value; + if (converterAttribute.ConstructorArguments[0].ArgumentType == typeof(Type)) + return ((Type)converterAttribute.ConstructorArguments[0].Value).AssemblyQualifiedName; + return null; } - internal Animation(float durationSeconds) : this(NDalicPINVOKE.Animation_New(durationSeconds), true) + internal MethodInfo GetImplicitConversionOperator(Type onType, Type fromType, Type toType) { - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); +#if NETSTANDARD1_0 + var mi = onType.GetRuntimeMethod("op_Implicit", new[] { fromType }); +#else + var bindingFlags = BindingFlags.Public | BindingFlags.Static | BindingFlags.FlattenHierarchy; + var mi = onType.GetMethod("op_Implicit", bindingFlags, null, new[] { fromType }, null); +#endif + if (mi == null) return null; + if (!mi.IsSpecialName) return null; + if (!mi.IsPublic) return null; + if (!mi.IsStatic) return null; + if (!toType.IsAssignableFrom(mi.ReturnType)) return null; + return mi; } - /// - /// Downcasts a handle to animation handle.
- /// If handle points to an animation object, the downcast produces a valid handle.
- /// If not, the returned handle is left uninitialized.
- ///
- /// Handle to an object. - /// Handle to an animation object or an uninitialized handle. - /// 3 - public static Animation DownCast(BaseHandle handle) + internal Animation(float durationSeconds) : this(NDalicPINVOKE.Animation_New(durationSeconds), true) { - Animation ret = Registry.GetManagedBaseHandleFromNativePtr(handle) as Animation; if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; + } internal Animation(Animation handle) : this(NDalicPINVOKE.new_Animation__SWIG_1(Animation.getCPtr(handle)), true) @@ -1116,72 +1175,6 @@ namespace Tizen.NUI return ret; } - private static bool? disableAnimation = null; - private bool DisableAnimation - { - get - { - if (disableAnimation.HasValue == false) - { - string type = Environment.GetEnvironmentVariable("PlatformSmartType"); - if (type == "Entry") - disableAnimation = true; - else - disableAnimation = false; - } - return disableAnimation.Value; - } - } - - /// - /// Plays the animation. - /// - /// 3 - public void Play() - { - NDalicPINVOKE.Animation_Play(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - - if (DisableAnimation == true) - Stop(EndActions.StopFinal); - } - - /// - /// Plays the animation from a given point.
- /// The progress must be in the 0-1 interval or in the play range interval if defined, - /// otherwise, it will be ignored.
- ///
- /// A value between [0,1], or between the play range if specified, from where the animation should start playing. - /// 3 - public void PlayFrom(float progress) - { - NDalicPINVOKE.Animation_PlayFrom(swigCPtr, progress); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - /// - /// Plays the animation after a given delay time.
- /// The delay time is not included in the looping time.
- /// When the delay time is a negative value, it would treat as play immediately.
- ///
- /// The delay time. - /// 4 - public void PlayAfter(int delayMilliseconds) - { - NDalicPINVOKE.Animation_PlayAfter(swigCPtr, MilliSecondsToSeconds(delayMilliseconds)); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - /// - /// Pauses the animation. - /// - /// 3 - public void Pause() - { - NDalicPINVOKE.Animation_Pause(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - internal Animation.States GetState() { Animation.States ret = (Animation.States)NDalicPINVOKE.Animation_GetState(swigCPtr); @@ -1189,27 +1182,6 @@ namespace Tizen.NUI return ret; } - /// - /// Stops the animation. - /// - /// 3 - public void Stop() - { - NDalicPINVOKE.Animation_Stop(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - /// - /// Clears the animation.
- /// This disconnects any objects that were being animated, effectively stopping the animation.
- ///
- /// 3 - public void Clear() - { - NDalicPINVOKE.Animation_Clear(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - internal AnimationSignal FinishedSignal() { AnimationSignal ret = new AnimationSignal(NDalicPINVOKE.Animation_FinishedSignal(swigCPtr), false); @@ -1357,60 +1329,89 @@ namespace Tizen.NUI } /// - /// Enumeration for what to do when the animation ends, stopped, or destroyed. + /// To make animation instance be disposed. /// /// 3 - public enum EndActions + protected override void Dispose(DisposeTypes type) { - /// - /// When the animation ends, the animated property values are saved. - /// - Cancel, - /// - /// When the animation ends, the animated property values are forgotten. - /// - Discard, - /// - /// If the animation is stopped, the animated property values are saved as if the animation had run to completion, otherwise behaves like cancel. - /// - StopFinal + if (this != null) + { + if (_animationFinishedEventCallback != null) + { + FinishedSignal().Disconnect(_finishedCallbackOfNative); + } + + if (_animationProgressReachedEventCallback != null) + { + + ProgressReachedSignal().Disconnect(_animationProgressReachedEventCallback); + } + } + + if(disposed) + { + return; + } + if(type == DisposeTypes.Explicit) + { + //Called by User + //Release your own managed resources here. + //You should release all of your own disposable objects here. + + } + else if(type == DisposeTypes.Implicit) + { + + } + + if (this != null) + { + this.Clear(); + } + + //Release your own unmanaged resources here. + //You should not access any managed member here except static instance. + //because the execution order of Finalizes is non-deterministic. + + if (swigCPtr.Handle != global::System.IntPtr.Zero) + { + if (swigCMemOwn) + { + swigCMemOwn = false; + NDalicPINVOKE.delete_Animation(swigCPtr); + } + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); + } + + base.Dispose(type); } - /// - /// Enumeration for what interpolation method to use on key-frame animations. - /// - /// 3 - public enum Interpolation + private void OnFinished(IntPtr data) { - /// - /// Values in between key frames are interpolated using a linear polynomial. (Default) - /// - Linear, - /// - /// Values in between key frames are interpolated using a cubic polynomial. - /// - Cubic + if (_animationFinishedEventHandler != null) + { + //here we send all data to user event handlers + _animationFinishedEventHandler(this, null); + } } - /// - /// Enumeration for what state the animation is in. - /// - /// Calling Reset() on this class will not reset the animation. It will call the BaseHandle.Reset() which drops the object handle. - /// 3 - public enum States + private void OnProgressReached(IntPtr data) { - /// - /// The animation has stopped. - /// - Stopped, - /// - /// The animation is playing. - /// - Playing, - /// - /// The animation is paused. - /// - Paused + if (_animationProgressReachedEventHandler != null) + { + //here we send all data to user event handlers + _animationProgressReachedEventHandler(this, null); + } + } + + private float MilliSecondsToSeconds(int millisec) + { + return (float)millisec / 1000.0f; + } + + private int SecondsToMilliSeconds(float sec) + { + return (int)(sec * 1000); } } diff --git a/src/Tizen.NUI/src/public/BaseComponents/CustomView.cs b/src/Tizen.NUI/src/public/BaseComponents/CustomView.cs index d0cd2d1..d9fb791 100755 --- a/src/Tizen.NUI/src/public/BaseComponents/CustomView.cs +++ b/src/Tizen.NUI/src/public/BaseComponents/CustomView.cs @@ -35,11 +35,12 @@ namespace Tizen.NUI.BaseComponents customView.SetKeyboardNavigationSupport((bool)newValue); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var customView = (CustomView)bindable; return customView.IsKeyboardNavigationSupported(); }); + /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public static readonly BindableProperty FocusGroupProperty = BindableProperty.Create("FocusGroup", typeof(bool), typeof(CustomView), false, propertyChanged: (bindable, oldValue, newValue) => @@ -50,7 +51,7 @@ namespace Tizen.NUI.BaseComponents customView.SetAsKeyboardFocusGroup((bool)newValue); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var customView = (CustomView)bindable; return customView.IsKeyboardFocusGroup(); @@ -114,37 +115,6 @@ namespace Tizen.NUI.BaseComponents } /// - /// Sets the background with a property map. - /// - /// The background property map. - /// 3 - public void SetBackground(Tizen.NUI.PropertyMap map) - { - viewWrapperImpl.SetBackground(map); - } - - /// - /// Allows deriving classes to enable any of the gesture detectors that are available.
- /// Gesture detection can be enabled one at a time or in a bitwise format.
- ///
- /// The gesture type(s) to enable. - /// 3 - public void EnableGestureDetection(Gesture.GestureType type) - { - viewWrapperImpl.EnableGestureDetection(type); - } - - /// - /// Allows deriving classes to disable any of the gesture detectors.
- /// Like EnableGestureDetection, this can also be called using bitwise or one at a time.
- ///
- /// The gesture type(s) to disable. - internal void DisableGestureDetection(Gesture.GestureType type) - { - viewWrapperImpl.DisableGestureDetection(type); - } - - /// /// Sets whether this control supports two dimensional keyboard navigation /// (i.e., whether it knows how to handle the keyboard focus movement between its child views).
/// The control doesn't support it by default.
@@ -162,21 +132,6 @@ namespace Tizen.NUI.BaseComponents } } - internal void SetKeyboardNavigationSupport(bool isSupported) - { - viewWrapperImpl.SetKeyboardNavigationSupport(isSupported); - } - - /// - /// Gets whether this control supports two-dimensional keyboard navigation. - /// - /// True if this control supports two-dimensional keyboard navigation. - internal bool IsKeyboardNavigationSupported() - { - return viewWrapperImpl.IsKeyboardNavigationSupported(); - } - - /// /// Sets or gets whether this control is a focus group for keyboard navigation. /// @@ -195,183 +150,24 @@ namespace Tizen.NUI.BaseComponents } /// - /// Sets whether this control is a focus group for keyboard navigation. - /// (i.e., the scope of keyboard focus movement can be limitied to its child views). The control is not a focus group by default. - /// - /// Whether this control is set as a focus group for keyboard navigation. - internal void SetAsKeyboardFocusGroup(bool isFocusGroup) - { - viewWrapperImpl.SetAsFocusGroup(isFocusGroup); - } - - /// - /// Gets whether this control is a focus group for keyboard navigation. - /// - internal bool IsKeyboardFocusGroup() - { - return viewWrapperImpl.IsFocusGroup(); - } - - /// - /// Requests a relayout, which means performing a size negotiation on this view, its parent, and children (and potentially whole scene).
- /// This method can also be called from a derived class every time it needs a different size.
- /// At the end of event processing, the relayout process starts and all controls which requested relayout will have their sizes (re)negotiated.
- /// It can be called multiple times; the size negotiation is still only performed once, i.e., there is no need to keep track of this in the calling side.
- ///
- /// 3 - protected void RelayoutRequest() - { - viewWrapperImpl.RelayoutRequest(); - } - - /// - /// Provides the view implementation of GetHeightForWidth. - /// - /// The width to use. - /// The height based on the width. - /// 3 - protected float GetHeightForWidthBase(float width) - { - return viewWrapperImpl.GetHeightForWidthBase(width); - } - - /// - /// Provides the view implementation of GetWidthForHeight. - /// - /// The height to use. - /// The width based on the height. - /// 3 - protected float GetWidthForHeightBase(float height) - { - return viewWrapperImpl.GetWidthForHeightBase(height); - } - - /// - /// Calculates the size for a child using the base view object. - /// - /// The child view to calculate the size for. - /// The dimension to calculate the size, for example, the width or the height. - /// Return the calculated size for the given dimension. If more than one dimension is requested, just return the first one found. - /// 3 - protected float CalculateChildSizeBase(View child, DimensionType dimension) - { - return viewWrapperImpl.CalculateChildSizeBase(child, dimension); - } - - /// - /// Determines if this view is dependent on it's children for relayout from the base class. - /// - /// The dimension(s) to check for. - /// Return if the view is dependent on it's children. - /// 3 - protected bool RelayoutDependentOnChildrenBase(DimensionType dimension) - { - return viewWrapperImpl.RelayoutDependentOnChildrenBase(dimension); - } - - /// - /// Determines if this view is dependent on it's children for relayout from the base class. - /// - /// Return if the view is dependent on it's children. - /// 3 - protected bool RelayoutDependentOnChildrenBase() - { - return viewWrapperImpl.RelayoutDependentOnChildrenBase(); - } - - /// - /// Registers a visual by property index, linking a view to visual when required.
- /// In the case of the visual being a view or control deeming visual not required, then the visual should be an empty handle.
- /// No parenting is done during registration, this should be done by a derived class.
- ///
- /// The property index of the visual used to reference visual. - /// The visual to register. - /// 3 - protected void RegisterVisual(int index, VisualBase visual) - { - viewWrapperImpl.RegisterVisual(index, visual); - } - - /// - /// Registers a visual by the property index, linking a view to visual when required.
- /// In the case of the visual being a view or control deeming visual not required, then the visual should be an empty handle.
- /// If enabled is false, then the visual is not set on the stage until enabled by the derived class.
- ///
- /// The property index of the visual used to reference visual. - /// The visual to register. - /// False if derived class wants to control when the visual is set on the stage. - /// 3 - protected void RegisterVisual(int index, VisualBase visual, bool enabled) - { - viewWrapperImpl.RegisterVisual(index, visual, enabled); - } - - /// - /// Erases the entry matching the given index from the list of registered visuals. - /// - /// The property index of the visual used to reference visual. - /// 3 - protected void UnregisterVisual(int index) - { - viewWrapperImpl.UnregisterVisual(index); - } - - /// - /// Retrieves the visual associated with the given property index.
- /// For managing the object lifecycle, do not store the returned visual as a member which increments its reference count.
- ///
- /// The property index of the visual used to reference visual. - /// The registered visual if exists, otherwise an empty handle. - /// 3 - protected VisualBase GetVisual(int index) - { - return viewWrapperImpl.GetVisual(index); - } - - /// - /// Sets the given visual to be displayed or not when parent staged.
- /// For managing the object lifecycle, do not store the returned visual as a member which increments its reference count.
- ///
- /// The property index of the visual, used to reference visual. - /// Flag set to enabled or disabled. - /// 3 - protected void EnableVisual(int index, bool enable) - { - viewWrapperImpl.EnableVisual(index, enable); - } - - /// - /// Queries if the given visual is to be displayed when parent staged.
- /// For managing the object lifecycle, do not store the returned visual as a member which increments its reference count.
- ///
- /// The property index of the visual. - /// Whether visual is enabled or not. - /// 3 - protected bool IsVisualEnabled(int index) - { - return viewWrapperImpl.IsVisualEnabled(index); - } - - /// - /// Creates a transition effect on the control. + /// Sets the background with a property map. /// - /// The transition data describing the effect to create. - /// A handle to an animation defined with the given effect, or an empty handle if no properties match. + /// The background property map. /// 3 - protected Animation CreateTransition(TransitionData transitionData) + public void SetBackground(Tizen.NUI.PropertyMap map) { - return viewWrapperImpl.CreateTransition(transitionData); + viewWrapperImpl.SetBackground(map); } /// - /// Emits the KeyInputFocusGained signal if true, else, emits the KeyInputFocusLost signal.
- /// Should be called last by the control after it acts on the input focus change.
+ /// Allows deriving classes to enable any of the gesture detectors that are available.
+ /// Gesture detection can be enabled one at a time or in a bitwise format.
///
- /// True if gained, false if lost. + /// The gesture type(s) to enable. /// 3 - protected void EmitFocusSignal(bool focusGained) + public void EnableGestureDetection(Gesture.GestureType type) { - viewWrapperImpl.EmitFocusSignal(focusGained); + viewWrapperImpl.EnableGestureDetection(type); } /// @@ -620,38 +416,113 @@ namespace Tizen.NUI.BaseComponents } /// - /// This method is called when the control accessibility is activated.
- /// Derived classes should override this to perform custom accessibility activation.
+ /// Called when the control gain key input focus. Should be overridden by derived classes if they need to customize what happens when the focus is gained. ///
- /// True if this control can perform accessibility activation. - internal virtual bool OnAccessibilityActivated() + /// 3 + public virtual void OnFocusGained() { - return false; } /// - /// This method should be overridden by deriving classes when they wish to respond the accessibility. + /// Called when the control loses key input focus. Should be overridden by derived classes if they need to customize what happens when the focus is lost. /// - /// The pan gesture. - /// True if the pan gesture has been consumed by this control. - internal virtual bool OnAccessibilityPan(PanGesture gestures) + /// 3 + public virtual void OnFocusLost() { - return false; } /// - /// This method should be overridden by deriving classes when they wish to respond the accessibility. + /// Gets the next keyboard focusable view in this control towards the given direction.
+ /// A control needs to override this function in order to support two dimensional keyboard navigation.
///
- /// The touch gesture. - /// True if the touch event has been consumed by this control. - internal virtual bool OnAccessibilityTouch(Touch touch) + /// The current focused view. + /// The direction to move the focus towards. + /// Whether the focus movement should be looped within the control. + /// The next keyboard focusable view in this control or an empty handle if no view can be focused. + /// 3 + public virtual View GetNextFocusableView(View currentFocusedView, View.FocusDirection direction, bool loopEnabled) { - return false; + return new View(); } /// - /// This method should be overridden by deriving classes when they wish to respond the accessibility up and down action (i.e., value change of slider control). - /// + /// Informs this control that its chosen focusable view will be focused.
+ /// This allows the application to preform any actions it wishes before the focus is actually moved to the chosen view.
+ ///
+ /// The commited focused view. + /// 3 + public virtual void OnFocusChangeCommitted(View commitedFocusableView) + { + } + + /// + /// This method is called when the control has enter pressed on it.
+ /// Derived classes should override this to perform custom actions.
+ ///
+ /// True if this control supported this action. + /// 3 + public virtual bool OnKeyboardEnter() + { + return false; + } + + /// + /// Called whenever a pan gesture is detected on this control.
+ /// This should be overridden by deriving classes when pan detection is enabled.
+ /// There is no default behavior with panning.
+ /// Pan detection should be enabled via EnableGestureDetection().
+ ///
+ /// The pan gesture. + /// 3 + public virtual void OnPan(PanGesture pan) + { + } + + /// + /// Called whenever a tap gesture is detected on this control.
+ /// This should be overridden by deriving classes when tap detection is enabled.
+ /// There is no default behavior with a tap.
+ /// Tap detection should be enabled via EnableGestureDetection().
+ ///
+ /// The tap gesture. + /// 3 + public virtual void OnTap(TapGesture tap) + { + } + + /// + /// This method is called when the control accessibility is activated.
+ /// Derived classes should override this to perform custom accessibility activation.
+ ///
+ /// True if this control can perform accessibility activation. + internal virtual bool OnAccessibilityActivated() + { + return false; + } + + /// + /// This method should be overridden by deriving classes when they wish to respond the accessibility. + /// + /// The pan gesture. + /// True if the pan gesture has been consumed by this control. + internal virtual bool OnAccessibilityPan(PanGesture gestures) + { + return false; + } + + /// + /// This method should be overridden by deriving classes when they wish to respond the accessibility. + /// + /// The touch gesture. + /// True if the touch event has been consumed by this control. + internal virtual bool OnAccessibilityTouch(Touch touch) + { + return false; + } + + /// + /// This method should be overridden by deriving classes when they wish to respond the accessibility up and down action (i.e., value change of slider control). + /// /// Whether the value should be increased or decreased. /// True if the value changed action has been consumed by this control. internal virtual bool OnAccessibilityValueChange(bool isIncrease) @@ -669,102 +540,232 @@ namespace Tizen.NUI.BaseComponents } /// - /// Called when the control gain key input focus. Should be overridden by derived classes if they need to customize what happens when the focus is gained. + /// Allows deriving classes to disable any of the gesture detectors.
+ /// Like EnableGestureDetection, this can also be called using bitwise or one at a time.
+ ///
+ /// The gesture type(s) to disable. + internal void DisableGestureDetection(Gesture.GestureType type) + { + viewWrapperImpl.DisableGestureDetection(type); + } + + internal void SetKeyboardNavigationSupport(bool isSupported) + { + viewWrapperImpl.SetKeyboardNavigationSupport(isSupported); + } + + /// + /// Gets whether this control supports two-dimensional keyboard navigation. + /// + /// True if this control supports two-dimensional keyboard navigation. + internal bool IsKeyboardNavigationSupported() + { + return viewWrapperImpl.IsKeyboardNavigationSupported(); + } + + /// + /// Sets whether this control is a focus group for keyboard navigation. + /// (i.e., the scope of keyboard focus movement can be limitied to its child views). The control is not a focus group by default. + /// + /// Whether this control is set as a focus group for keyboard navigation. + internal void SetAsKeyboardFocusGroup(bool isFocusGroup) + { + viewWrapperImpl.SetAsFocusGroup(isFocusGroup); + } + + /// + /// Gets whether this control is a focus group for keyboard navigation. + /// + internal bool IsKeyboardFocusGroup() + { + return viewWrapperImpl.IsFocusGroup(); + } + + /// + /// Called whenever a pinch gesture is detected on this control.
+ /// This can be overridden by deriving classes when pinch detection is enabled. The default behavior is to scale the control by the pinch scale.
+ /// If overridden, then the default behavior will not occur.
+ /// Pinch detection should be enabled via EnableGestureDetection().
+ ///
+ /// The pinch tap gesture. + internal virtual void OnPinch(PinchGesture pinch) + { + } + + /// + /// Called whenever a long press gesture is detected on this control.
+ /// This should be overridden by deriving classes when long press detection is enabled.
+ /// There is no default behavior associated with a long press.
+ /// Long press detection should be enabled via EnableGestureDetection().
+ ///
+ /// The long press gesture. + internal virtual void OnLongPress(LongPressGesture longPress) + { + } + + /// + /// Requests a relayout, which means performing a size negotiation on this view, its parent, and children (and potentially whole scene).
+ /// This method can also be called from a derived class every time it needs a different size.
+ /// At the end of event processing, the relayout process starts and all controls which requested relayout will have their sizes (re)negotiated.
+ /// It can be called multiple times; the size negotiation is still only performed once, i.e., there is no need to keep track of this in the calling side.
///
/// 3 - public virtual void OnFocusGained() + protected void RelayoutRequest() { + viewWrapperImpl.RelayoutRequest(); } /// - /// Called when the control loses key input focus. Should be overridden by derived classes if they need to customize what happens when the focus is lost. + /// Provides the view implementation of GetHeightForWidth. /// + /// The width to use. + /// The height based on the width. /// 3 - public virtual void OnFocusLost() + protected float GetHeightForWidthBase(float width) { + return viewWrapperImpl.GetHeightForWidthBase(width); } /// - /// Gets the next keyboard focusable view in this control towards the given direction.
- /// A control needs to override this function in order to support two dimensional keyboard navigation.
+ /// Provides the view implementation of GetWidthForHeight. ///
- /// The current focused view. - /// The direction to move the focus towards. - /// Whether the focus movement should be looped within the control. - /// The next keyboard focusable view in this control or an empty handle if no view can be focused. + /// The height to use. + /// The width based on the height. /// 3 - public virtual View GetNextFocusableView(View currentFocusedView, View.FocusDirection direction, bool loopEnabled) + protected float GetWidthForHeightBase(float height) { - return new View(); + return viewWrapperImpl.GetWidthForHeightBase(height); } /// - /// Informs this control that its chosen focusable view will be focused.
- /// This allows the application to preform any actions it wishes before the focus is actually moved to the chosen view.
+ /// Calculates the size for a child using the base view object. ///
- /// The commited focused view. + /// The child view to calculate the size for. + /// The dimension to calculate the size, for example, the width or the height. + /// Return the calculated size for the given dimension. If more than one dimension is requested, just return the first one found. /// 3 - public virtual void OnFocusChangeCommitted(View commitedFocusableView) + protected float CalculateChildSizeBase(View child, DimensionType dimension) { + return viewWrapperImpl.CalculateChildSizeBase(child, dimension); } /// - /// This method is called when the control has enter pressed on it.
- /// Derived classes should override this to perform custom actions.
+ /// Determines if this view is dependent on it's children for relayout from the base class. ///
- /// True if this control supported this action. + /// The dimension(s) to check for. + /// Return if the view is dependent on it's children. /// 3 - public virtual bool OnKeyboardEnter() + protected bool RelayoutDependentOnChildrenBase(DimensionType dimension) { - return false; + return viewWrapperImpl.RelayoutDependentOnChildrenBase(dimension); } /// - /// Called whenever a pinch gesture is detected on this control.
- /// This can be overridden by deriving classes when pinch detection is enabled. The default behavior is to scale the control by the pinch scale.
- /// If overridden, then the default behavior will not occur.
- /// Pinch detection should be enabled via EnableGestureDetection().
+ /// Determines if this view is dependent on it's children for relayout from the base class. ///
- /// The pinch tap gesture. - internal virtual void OnPinch(PinchGesture pinch) + /// Return if the view is dependent on it's children. + /// 3 + protected bool RelayoutDependentOnChildrenBase() { + return viewWrapperImpl.RelayoutDependentOnChildrenBase(); } /// - /// Called whenever a pan gesture is detected on this control.
- /// This should be overridden by deriving classes when pan detection is enabled.
- /// There is no default behavior with panning.
- /// Pan detection should be enabled via EnableGestureDetection().
+ /// Registers a visual by property index, linking a view to visual when required.
+ /// In the case of the visual being a view or control deeming visual not required, then the visual should be an empty handle.
+ /// No parenting is done during registration, this should be done by a derived class.
///
- /// The pan gesture. + /// The property index of the visual used to reference visual. + /// The visual to register. /// 3 - public virtual void OnPan(PanGesture pan) + protected void RegisterVisual(int index, VisualBase visual) { + viewWrapperImpl.RegisterVisual(index, visual); } /// - /// Called whenever a tap gesture is detected on this control.
- /// This should be overridden by deriving classes when tap detection is enabled.
- /// There is no default behavior with a tap.
- /// Tap detection should be enabled via EnableGestureDetection().
+ /// Registers a visual by the property index, linking a view to visual when required.
+ /// In the case of the visual being a view or control deeming visual not required, then the visual should be an empty handle.
+ /// If enabled is false, then the visual is not set on the stage until enabled by the derived class.
///
- /// The tap gesture. + /// The property index of the visual used to reference visual. + /// The visual to register. + /// False if derived class wants to control when the visual is set on the stage. /// 3 - public virtual void OnTap(TapGesture tap) + protected void RegisterVisual(int index, VisualBase visual, bool enabled) { + viewWrapperImpl.RegisterVisual(index, visual, enabled); } /// - /// Called whenever a long press gesture is detected on this control.
- /// This should be overridden by deriving classes when long press detection is enabled.
- /// There is no default behavior associated with a long press.
- /// Long press detection should be enabled via EnableGestureDetection().
+ /// Erases the entry matching the given index from the list of registered visuals. ///
- /// The long press gesture. - internal virtual void OnLongPress(LongPressGesture longPress) + /// The property index of the visual used to reference visual. + /// 3 + protected void UnregisterVisual(int index) + { + viewWrapperImpl.UnregisterVisual(index); + } + + /// + /// Retrieves the visual associated with the given property index.
+ /// For managing the object lifecycle, do not store the returned visual as a member which increments its reference count.
+ ///
+ /// The property index of the visual used to reference visual. + /// The registered visual if exists, otherwise an empty handle. + /// 3 + protected VisualBase GetVisual(int index) + { + return viewWrapperImpl.GetVisual(index); + } + + /// + /// Sets the given visual to be displayed or not when parent staged.
+ /// For managing the object lifecycle, do not store the returned visual as a member which increments its reference count.
+ ///
+ /// The property index of the visual, used to reference visual. + /// Flag set to enabled or disabled. + /// 3 + protected void EnableVisual(int index, bool enable) { + viewWrapperImpl.EnableVisual(index, enable); } + /// + /// Queries if the given visual is to be displayed when parent staged.
+ /// For managing the object lifecycle, do not store the returned visual as a member which increments its reference count.
+ ///
+ /// The property index of the visual. + /// Whether visual is enabled or not. + /// 3 + protected bool IsVisualEnabled(int index) + { + return viewWrapperImpl.IsVisualEnabled(index); + } + + /// + /// Creates a transition effect on the control. + /// + /// The transition data describing the effect to create. + /// A handle to an animation defined with the given effect, or an empty handle if no properties match. + /// 3 + protected Animation CreateTransition(TransitionData transitionData) + { + return viewWrapperImpl.CreateTransition(transitionData); + } + + /// + /// Emits the KeyInputFocusGained signal if true, else, emits the KeyInputFocusLost signal.
+ /// Should be called last by the control after it acts on the input focus change.
+ ///
+ /// True if gained, false if lost. + /// 3 + protected void EmitFocusSignal(bool focusGained) + { + viewWrapperImpl.EmitFocusSignal(focusGained); + } + + private void OnControlChildAdd(View child) { } diff --git a/src/Tizen.NUI/src/public/BaseComponents/FlexContainer.cs b/src/Tizen.NUI/src/public/BaseComponents/FlexContainer.cs index a85d1e9..0ca9632 100755 --- a/src/Tizen.NUI/src/public/BaseComponents/FlexContainer.cs +++ b/src/Tizen.NUI/src/public/BaseComponents/FlexContainer.cs @@ -134,74 +134,6 @@ namespace Tizen.NUI.BaseComponents private global::System.Runtime.InteropServices.HandleRef swigCPtr; - internal FlexContainer(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.FlexContainer_SWIGUpcast(cPtr), cMemoryOwn) - { - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); - } - - internal static global::System.Runtime.InteropServices.HandleRef getCPtr(FlexContainer obj) - { - return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; - } - - /// - /// To make the FlexContainer instance be disposed. - /// - /// 3 - protected override void Dispose(DisposeTypes type) - { - if(disposed) - { - return; - } - - if(type == DisposeTypes.Explicit) - { - //Called by User - //Release your own managed resources here. - //You should release all of your own disposable objects here. - } - - //Release your own unmanaged resources here. - //You should not access any managed member here except static instance. - //because the execution order of Finalizes is non-deterministic. - - if (swigCPtr.Handle != global::System.IntPtr.Zero) - { - if (swigCMemOwn) - { - swigCMemOwn = false; - NDalicPINVOKE.delete_FlexContainer(swigCPtr); - } - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); - } - - base.Dispose(type); - } - - - internal new class Property - { - internal static readonly int CONTENT_DIRECTION = NDalicPINVOKE.FlexContainer_Property_CONTENT_DIRECTION_get(); - internal static readonly int FLEX_DIRECTION = NDalicPINVOKE.FlexContainer_Property_FLEX_DIRECTION_get(); - internal static readonly int FLEX_WRAP = NDalicPINVOKE.FlexContainer_Property_FLEX_WRAP_get(); - internal static readonly int JUSTIFY_CONTENT = NDalicPINVOKE.FlexContainer_Property_JUSTIFY_CONTENT_get(); - internal static readonly int ALIGN_ITEMS = NDalicPINVOKE.FlexContainer_Property_ALIGN_ITEMS_get(); - internal static readonly int ALIGN_CONTENT = NDalicPINVOKE.FlexContainer_Property_ALIGN_CONTENT_get(); - - } - - /// - /// Enumeration for the instance of child properties belonging to the FlexContainer class. - /// - /// 3 - public class ChildProperty - { - internal static readonly int FLEX = NDalicPINVOKE.FlexContainer_ChildProperty_FLEX_get(); - internal static readonly int ALIGN_SELF = NDalicPINVOKE.FlexContainer_ChildProperty_ALIGN_SELF_get(); - internal static readonly int FLEX_MARGIN = NDalicPINVOKE.FlexContainer_ChildProperty_FLEX_MARGIN_get(); - } - /// /// Creates a FlexContainer handle. /// Calling member functions with an uninitialized handle is not allowed. @@ -210,7 +142,11 @@ namespace Tizen.NUI.BaseComponents public FlexContainer() : this(NDalicPINVOKE.FlexContainer_New(), true) { if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + internal FlexContainer(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.FlexContainer_SWIGUpcast(cPtr), cMemoryOwn) + { + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); } /// @@ -455,6 +391,65 @@ namespace Tizen.NUI.BaseComponents } } - } + internal static global::System.Runtime.InteropServices.HandleRef getCPtr(FlexContainer obj) + { + return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; + } + + /// + /// To make the FlexContainer instance be disposed. + /// + /// 3 + protected override void Dispose(DisposeTypes type) + { + if (disposed) + { + return; + } + + if (type == DisposeTypes.Explicit) + { + //Called by User + //Release your own managed resources here. + //You should release all of your own disposable objects here. + } + + //Release your own unmanaged resources here. + //You should not access any managed member here except static instance. + //because the execution order of Finalizes is non-deterministic. + + if (swigCPtr.Handle != global::System.IntPtr.Zero) + { + if (swigCMemOwn) + { + swigCMemOwn = false; + NDalicPINVOKE.delete_FlexContainer(swigCPtr); + } + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); + } + + base.Dispose(type); + } + + /// + /// Enumeration for the instance of child properties belonging to the FlexContainer class. + /// + /// 3 + public class ChildProperty + { + internal static readonly int FLEX = NDalicPINVOKE.FlexContainer_ChildProperty_FLEX_get(); + internal static readonly int ALIGN_SELF = NDalicPINVOKE.FlexContainer_ChildProperty_ALIGN_SELF_get(); + internal static readonly int FLEX_MARGIN = NDalicPINVOKE.FlexContainer_ChildProperty_FLEX_MARGIN_get(); + } + internal new class Property + { + internal static readonly int CONTENT_DIRECTION = NDalicPINVOKE.FlexContainer_Property_CONTENT_DIRECTION_get(); + internal static readonly int FLEX_DIRECTION = NDalicPINVOKE.FlexContainer_Property_FLEX_DIRECTION_get(); + internal static readonly int FLEX_WRAP = NDalicPINVOKE.FlexContainer_Property_FLEX_WRAP_get(); + internal static readonly int JUSTIFY_CONTENT = NDalicPINVOKE.FlexContainer_Property_JUSTIFY_CONTENT_get(); + internal static readonly int ALIGN_ITEMS = NDalicPINVOKE.FlexContainer_Property_ALIGN_ITEMS_get(); + internal static readonly int ALIGN_CONTENT = NDalicPINVOKE.FlexContainer_Property_ALIGN_CONTENT_get(); + } + } } \ No newline at end of file diff --git a/src/Tizen.NUI/src/public/BaseComponents/ImageView.cs b/src/Tizen.NUI/src/public/BaseComponents/ImageView.cs index 22f4e12..29c71f1 100755 --- a/src/Tizen.NUI/src/public/BaseComponents/ImageView.cs +++ b/src/Tizen.NUI/src/public/BaseComponents/ImageView.cs @@ -31,7 +31,7 @@ namespace Tizen.NUI.BaseComponents { /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty ResourceUrlProperty = BindableProperty.Create("ResourceUrl", typeof(string), typeof(ImageView), string.Empty, propertyChanged: (bindable, oldValue, newValue) => + public static readonly BindableProperty ResourceUrlProperty = BindableProperty.Create(nameof(ImageView.ResourceUrl), typeof(string), typeof(ImageView), string.Empty, propertyChanged: (bindable, oldValue, newValue) => { var imageView = (ImageView)bindable; if (newValue != null) @@ -46,7 +46,7 @@ namespace Tizen.NUI.BaseComponents imageView.UpdateImage(); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var imageView = (ImageView)bindable; Tizen.NUI.Object.GetProperty(imageView.swigCPtr, ImageView.Property.IMAGE).Get(out imageView._url); @@ -62,7 +62,7 @@ namespace Tizen.NUI.BaseComponents PropertyMap map = (PropertyMap)newValue; if (imageView.IsCreateByXaml) { - string url = "", alphaMaskURL="", auxiliaryImageURL = ""; + string url = "", alphaMaskURL = "", auxiliaryImageURL = ""; string resource = Tizen.Applications.Application.Current.DirectoryInfo.Resource; PropertyValue urlValue = map.Find(NDalic.IMAGE_VISUAL_URL); bool ret = false; @@ -84,7 +84,7 @@ namespace Tizen.NUI.BaseComponents } ret = false; - PropertyValue auxiliaryImageURLValue = map.Find(NDalic.IMAGE_VISUAL_AUXILIARY_IMAGE_URL); + PropertyValue auxiliaryImageURLValue = map.Find(NDalic.IMAGE_VISUAL_AUXILIARY_IMAGE_URL); if (auxiliaryImageURLValue != null) ret = auxiliaryImageURLValue.Get(out auxiliaryImageURL); if (ret && auxiliaryImageURL.Contains("*Resource*")) { @@ -100,7 +100,7 @@ namespace Tizen.NUI.BaseComponents } } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var imageView = (ImageView)bindable; if (imageView._border == null) @@ -124,7 +124,7 @@ namespace Tizen.NUI.BaseComponents Tizen.NUI.Object.SetProperty(imageView.swigCPtr, ImageView.Property.PRE_MULTIPLIED_ALPHA, new Tizen.NUI.PropertyValue((bool)newValue)); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var imageView = (ImageView)bindable; bool temp = false; @@ -133,7 +133,7 @@ namespace Tizen.NUI.BaseComponents }); /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty PixelAreaProperty = BindableProperty.Create("PixelArea", typeof(RelativeVector4), typeof(ImageView), new RelativeVector4(0,0,0,0), propertyChanged: (bindable, oldValue, newValue) => + public static readonly BindableProperty PixelAreaProperty = BindableProperty.Create("PixelArea", typeof(RelativeVector4), typeof(ImageView), new RelativeVector4(0, 0, 0, 0), propertyChanged: (bindable, oldValue, newValue) => { var imageView = (ImageView)bindable; if (newValue != null) @@ -141,7 +141,7 @@ namespace Tizen.NUI.BaseComponents Tizen.NUI.Object.SetProperty(imageView.swigCPtr, ImageView.Property.PIXEL_AREA, new Tizen.NUI.PropertyValue((RelativeVector4)newValue)); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var imageView = (ImageView)bindable; Vector4 temp = new Vector4(0.0f, 0.0f, 0.0f, 0.0f); @@ -151,7 +151,7 @@ namespace Tizen.NUI.BaseComponents }); /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty BorderProperty = BindableProperty.Create("Border", typeof(Rectangle), typeof(ImageView), new Rectangle(0,0,0,0), propertyChanged: (bindable, oldValue, newValue) => + public static readonly BindableProperty BorderProperty = BindableProperty.Create("Border", typeof(Rectangle), typeof(ImageView), new Rectangle(0, 0, 0, 0), propertyChanged: (bindable, oldValue, newValue) => { var imageView = (ImageView)bindable; if (newValue != null) @@ -160,7 +160,7 @@ namespace Tizen.NUI.BaseComponents imageView.UpdateImage(); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var imageView = (ImageView)bindable; return imageView._border; @@ -176,7 +176,7 @@ namespace Tizen.NUI.BaseComponents imageView.UpdateImage(); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var imageView = (ImageView)bindable; return imageView._borderOnly ?? false; @@ -192,7 +192,7 @@ namespace Tizen.NUI.BaseComponents imageView.UpdateImage(); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var imageView = (ImageView)bindable; return imageView._synchronousLoading ?? false; @@ -208,54 +208,62 @@ namespace Tizen.NUI.BaseComponents imageView.UpdateImage(); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var imageView = (ImageView)bindable; return imageView._orientationCorrection ?? false; }); private global::System.Runtime.InteropServices.HandleRef swigCPtr; + private EventHandler _resourceReadyEventHandler; + private ResourceReadyEventCallbackType _resourceReadyEventCallback; + private EventHandler _resourceLoadedEventHandler; + private _resourceLoadedCallbackType _resourceLoadedCallback; - internal ImageView(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.ImageView_SWIGUpcast(cPtr), cMemoryOwn) - { - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); - } + private Rectangle _border = null; + private PropertyMap _nPatchMap = null; + private bool? _synchronousLoading = null; + private bool? _borderOnly = null; + private string _url = null; + private bool? _orientationCorrection = null; - internal static global::System.Runtime.InteropServices.HandleRef getCPtr(ImageView obj) + + /// + /// Creates an initialized ImageView. + /// + /// 3 + public ImageView() : this(NDalicPINVOKE.ImageView_New__SWIG_0(), true) { - return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } - /// - /// Event arguments of resource ready. + /// Creates an initialized ImageView from a URL to an image resource.
+ /// If the string is empty, ImageView will not display anything.
///
+ /// The URL of the image resource to display. /// 3 - public class ResourceReadyEventArgs : EventArgs + public ImageView(string url) : this(NDalicPINVOKE.ImageView_New__SWIG_2(url), true) { - private View _view; + _url = url; + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - /// - /// The view whose resource is ready. - /// - /// 3 - public View View - { - get - { - return _view; - } - set - { - _view = value; - } - } + } + internal ImageView(string url, Uint16Pair size) : this(NDalicPINVOKE.ImageView_New__SWIG_3(url, Uint16Pair.getCPtr(size)), true) + { + _url = url; + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + + } + internal ImageView(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.ImageView_SWIGUpcast(cPtr), cMemoryOwn) + { + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); } - private EventHandler _resourceReadyEventHandler; [UnmanagedFunctionPointer(CallingConvention.StdCall)] private delegate void ResourceReadyEventCallbackType(IntPtr data); - private ResourceReadyEventCallbackType _resourceReadyEventCallback; + [UnmanagedFunctionPointer(CallingConvention.StdCall)] + private delegate void _resourceLoadedCallbackType(IntPtr view); /// /// An event for ResourceReady signal which can be used to subscribe or unsubscribe the event handler.
@@ -287,197 +295,56 @@ namespace Tizen.NUI.BaseComponents } } - // Callback for View ResourceReady signal - private void OnResourceReady(IntPtr data) + internal event EventHandler ResourceLoaded { - ResourceReadyEventArgs e = new ResourceReadyEventArgs(); - if (data != null) - { - e.View = Registry.GetManagedBaseHandleFromNativePtr(data) as View; - } - - if (_resourceReadyEventHandler != null) + add { - _resourceReadyEventHandler(this, e); - } - } + if (_resourceLoadedEventHandler == null) + { + _resourceLoadedCallback = OnResourceLoaded; + this.ResourceReadySignal(this).Connect(_resourceLoadedCallback); + } - /// - /// you can override it to clean-up your own resources. - /// - /// DisposeTypes - /// 3 - protected override void Dispose(DisposeTypes type) - { - if (disposed) - { - return; + _resourceLoadedEventHandler += value; } - - if (type == DisposeTypes.Explicit) + remove { - //Called by User - //Release your own managed resources here. - //You should release all of your own disposable objects here. - _border?.Dispose(); - _border = null; - _nPatchMap?.Dispose(); - _nPatchMap = null; - } - - //Release your own unmanaged resources here. - //You should not access any managed member here except static instance. - //because the execution order of Finalizes is non-deterministic. + _resourceLoadedEventHandler -= value; - if (swigCPtr.Handle != global::System.IntPtr.Zero) - { - if (swigCMemOwn) + if (_resourceLoadedEventHandler == null && this.ResourceReadySignal(this).Empty() == false) { - swigCMemOwn = false; - NDalicPINVOKE.delete_ImageView(swigCPtr); + this.ResourceReadySignal(this).Disconnect(_resourceLoadedCallback); } - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); } - - base.Dispose(type); - } - - internal new class Property - { - internal static readonly int RESOURCE_URL = NDalicPINVOKE.ImageView_Property_RESOURCE_URL_get(); - internal static readonly int IMAGE = NDalicPINVOKE.ImageView_Property_IMAGE_get(); - internal static readonly int PRE_MULTIPLIED_ALPHA = NDalicPINVOKE.ImageView_Property_PRE_MULTIPLIED_ALPHA_get(); - internal static readonly int PIXEL_AREA = NDalicPINVOKE.ImageView_Property_PIXEL_AREA_get(); - internal static readonly int ACTION_RELOAD = NDalicManualPINVOKE.ImageView_IMAGE_VISUAL_ACTION_RELOAD_get(); - internal static readonly int ACTION_PLAY = NDalicManualPINVOKE.ImageView_IMAGE_VISUAL_ACTION_PLAY_get(); - internal static readonly int ACTION_PAUSE = NDalicManualPINVOKE.ImageView_IMAGE_VISUAL_ACTION_PAUSE_get(); - internal static readonly int ACTION_STOP = NDalicManualPINVOKE.ImageView_IMAGE_VISUAL_ACTION_STOP_get(); - } - - /// - /// Creates an initialized ImageView. - /// - /// 3 - public ImageView() : this(NDalicPINVOKE.ImageView_New__SWIG_0(), true) - { - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - /// - /// Creates an initialized ImageView from a URL to an image resource.
- /// If the string is empty, ImageView will not display anything.
- ///
- /// The URL of the image resource to display. - /// 3 - public ImageView(string url) : this(NDalicPINVOKE.ImageView_New__SWIG_2(url), true) - { - _url = url; - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - - } - internal ImageView(string url, Uint16Pair size) : this(NDalicPINVOKE.ImageView_New__SWIG_3(url, Uint16Pair.getCPtr(size)), true) - { - _url = url; - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - - } - - /// - /// Downcasts a handle to imageView handle. - /// - /// Please do not use! this will be deprecated! - /// Instead please use as keyword. - /// 3 - [Obsolete("Please do not use! This will be deprecated! Please use as keyword instead! " + - "Like: " + - "BaseHandle handle = new ImageView(imagePath); " + - "ImageView image = handle as ImageView")] - [EditorBrowsable(EditorBrowsableState.Never)] - public static ImageView DownCast(BaseHandle handle) - { - ImageView ret = Registry.GetManagedBaseHandleFromNativePtr(handle) as ImageView; - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; } /// - /// Sets this ImageView from the given URL.
- /// If the URL is empty, ImageView will not display anything.
- ///
- /// The URL to the image resource to display. - /// 3 - public void SetImage(string url) - { - _url = url; - NDalicPINVOKE.ImageView_SetImage__SWIG_1(swigCPtr, url); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - internal void SetImage(string url, Uint16Pair size) - { - _url = url; - NDalicPINVOKE.ImageView_SetImage__SWIG_2(swigCPtr, url, Uint16Pair.getCPtr(size)); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - internal ViewResourceReadySignal ResourceReadySignal(View view) - { - ViewResourceReadySignal ret = new ViewResourceReadySignal(NDalicPINVOKE.ResourceReadySignal(View.getCPtr(view)), false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - /// - /// Queries if all resources required by a control are loaded and ready.
- /// Most resources are only loaded when the control is placed on the stage.
- /// True if the resources are loaded and ready, false otherwise.
- ///
- /// 3 - public new bool IsResourceReady() - { - bool ret = NDalicPINVOKE.IsResourceReady(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) - throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - /// - /// Forcefully reloads the image. All the visuals using this image will reload to the latest image. - /// - /// 5 - public void Reload() - { - this.DoAction(ImageView.Property.IMAGE, Property.ACTION_RELOAD, new PropertyValue(0)); - } - - /// - /// Plays the animated GIF. This is also the default playback mode. - /// - /// 5 - public void Play() - { - this.DoAction(ImageView.Property.IMAGE, Property.ACTION_PLAY, new PropertyValue(0)); - } - - /// - /// Pauses the animated GIF. - /// - /// 5 - public void Pause() - { - this.DoAction(ImageView.Property.IMAGE, Property.ACTION_PAUSE, new PropertyValue(0)); - } - - /// - /// Stops the animated GIF. + /// Enumeration for LoadingStatus of image. /// /// 5 - public void Stop() + public enum LoadingStatusType { - this.DoAction(ImageView.Property.IMAGE, Property.ACTION_STOP, new PropertyValue(0)); + /// + /// Loading preparing status. + /// + /// 5 + Preparing, + /// + /// Loading ready status. + /// + /// 5 + Ready, + /// + /// Loading failed status. + /// + /// 5 + Failed } /// /// ImageView ResourceUrl, type string. + /// This is one of mandatory property. Even if not set or null set, it sets empty string ("") internally. + /// When it is set as null, it gives empty string ("") to be read. /// /// 3 public string ResourceUrl @@ -488,7 +355,8 @@ namespace Tizen.NUI.BaseComponents } set { - SetValue(ResourceUrlProperty, value); + _url = (value == null? "" : value); + SetValue(ResourceUrlProperty, _url); NotifyPropertyChanged(); } } @@ -663,7 +531,6 @@ namespace Tizen.NUI.BaseComponents } } - /// /// Gets the loading state of the visual resource. /// @@ -677,28 +544,164 @@ namespace Tizen.NUI.BaseComponents } /// - /// Enumeration for LoadingStatus of image. + /// Downcasts a handle to imageView handle. + /// + /// Please do not use! this will be deprecated! + /// Instead please use as keyword. + /// 3 + [Obsolete("Please do not use! This will be deprecated! Please use as keyword instead! " + + "Like: " + + "BaseHandle handle = new ImageView(imagePath); " + + "ImageView image = handle as ImageView")] + [EditorBrowsable(EditorBrowsableState.Never)] + public static ImageView DownCast(BaseHandle handle) + { + ImageView ret = Registry.GetManagedBaseHandleFromNativePtr(handle) as ImageView; + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + /// + /// Sets this ImageView from the given URL.
+ /// If the URL is empty, ImageView will not display anything.
+ ///
+ /// The URL to the image resource to display. + /// 3 + public void SetImage(string url) + { + _url = url; + NDalicPINVOKE.ImageView_SetImage__SWIG_1(swigCPtr, url); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + /// + /// Queries if all resources required by a control are loaded and ready.
+ /// Most resources are only loaded when the control is placed on the stage.
+ /// True if the resources are loaded and ready, false otherwise.
+ ///
+ /// 3 + public new bool IsResourceReady() + { + bool ret = NDalicPINVOKE.IsResourceReady(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) + throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + /// + /// Forcefully reloads the image. All the visuals using this image will reload to the latest image. /// /// 5 - public enum LoadingStatusType + public void Reload() { - /// - /// Loading preparing status. - /// - /// 5 - Preparing, - /// - /// Loading ready status. - /// - /// 5 - Ready, - /// - /// Loading failed status. - /// - /// 5 - Failed + this.DoAction(ImageView.Property.IMAGE, Property.ACTION_RELOAD, new PropertyValue(0)); + } + + /// + /// Plays the animated GIF. This is also the default playback mode. + /// + /// 5 + public void Play() + { + this.DoAction(ImageView.Property.IMAGE, Property.ACTION_PLAY, new PropertyValue(0)); + } + + /// + /// Pauses the animated GIF. + /// + /// 5 + public void Pause() + { + this.DoAction(ImageView.Property.IMAGE, Property.ACTION_PAUSE, new PropertyValue(0)); + } + + /// + /// Stops the animated GIF. + /// + /// 5 + public void Stop() + { + this.DoAction(ImageView.Property.IMAGE, Property.ACTION_STOP, new PropertyValue(0)); + } + + internal static global::System.Runtime.InteropServices.HandleRef getCPtr(ImageView obj) + { + return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; + } + + internal void SetImage(string url, Uint16Pair size) + { + _url = url; + NDalicPINVOKE.ImageView_SetImage__SWIG_2(swigCPtr, url, Uint16Pair.getCPtr(size)); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + internal ViewResourceReadySignal ResourceReadySignal(View view) + { + ViewResourceReadySignal ret = new ViewResourceReadySignal(NDalicPINVOKE.ResourceReadySignal(View.getCPtr(view)), false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + internal ResourceLoadingStatusType GetResourceStatus() + { + return (ResourceLoadingStatusType)NDalicManualPINVOKE.View_GetVisualResourceStatus(this.swigCPtr, Property.IMAGE); + } + + /// + /// you can override it to clean-up your own resources. + /// + /// DisposeTypes + /// 3 + protected override void Dispose(DisposeTypes type) + { + if (disposed) + { + return; + } + + if (type == DisposeTypes.Explicit) + { + //Called by User + //Release your own managed resources here. + //You should release all of your own disposable objects here. + _border?.Dispose(); + _border = null; + _nPatchMap?.Dispose(); + _nPatchMap = null; + } + + //Release your own unmanaged resources here. + //You should not access any managed member here except static instance. + //because the execution order of Finalizes is non-deterministic. + + if (swigCPtr.Handle != global::System.IntPtr.Zero) + { + if (swigCMemOwn) + { + swigCMemOwn = false; + NDalicPINVOKE.delete_ImageView(swigCPtr); + } + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); + } + + base.Dispose(type); } + // Callback for View ResourceReady signal + private void OnResourceReady(IntPtr data) + { + ResourceReadyEventArgs e = new ResourceReadyEventArgs(); + if (data != null) + { + e.View = Registry.GetManagedBaseHandleFromNativePtr(data) as View; + } + + if (_resourceReadyEventHandler != null) + { + _resourceReadyEventHandler(this, e); + } + } private void UpdateImage() { @@ -731,75 +734,68 @@ namespace Tizen.NUI.BaseComponents } } - private Rectangle _border = null; - private PropertyMap _nPatchMap = null; - private bool? _synchronousLoading = null; - private bool? _borderOnly = null; - private string _url = null; - private bool? _orientationCorrection = null; + private void OnResourceLoaded(IntPtr view) + { + ResourceLoadedEventArgs e = new ResourceLoadedEventArgs(); + e.Status = (ResourceLoadingStatusType)NDalicManualPINVOKE.View_GetVisualResourceStatus(this.swigCPtr, Property.IMAGE); + if (_resourceLoadedEventHandler != null) + { + _resourceLoadedEventHandler(this, e); + } + } - internal class ResourceLoadedEventArgs : EventArgs + /// + /// Event arguments of resource ready. + /// + /// 3 + public class ResourceReadyEventArgs : EventArgs { - private ResourceLoadingStatusType status = ResourceLoadingStatusType.Invalid; - public ResourceLoadingStatusType Status + private View _view; + + /// + /// The view whose resource is ready. + /// + /// 3 + public View View { get { - return status; + return _view; } set { - status = value; + _view = value; } } } - private EventHandler _resourceLoadedEventHandler; - [UnmanagedFunctionPointer(CallingConvention.StdCall)] - private delegate void _resourceLoadedCallbackType(IntPtr view); - private _resourceLoadedCallbackType _resourceLoadedCallback; - - internal event EventHandler ResourceLoaded + internal class ResourceLoadedEventArgs : EventArgs { - add + private ResourceLoadingStatusType status = ResourceLoadingStatusType.Invalid; + public ResourceLoadingStatusType Status { - if (_resourceLoadedEventHandler == null) + get { - _resourceLoadedCallback = OnResourceLoaded; - this.ResourceReadySignal(this).Connect(_resourceLoadedCallback); + return status; } - - _resourceLoadedEventHandler += value; - } - remove - { - _resourceLoadedEventHandler -= value; - - if (_resourceLoadedEventHandler == null && this.ResourceReadySignal(this).Empty() == false) + set { - this.ResourceReadySignal(this).Disconnect(_resourceLoadedCallback); + status = value; } } } - private void OnResourceLoaded(IntPtr view) - { - ResourceLoadedEventArgs e = new ResourceLoadedEventArgs(); - e.Status = (ResourceLoadingStatusType)NDalicManualPINVOKE.View_GetVisualResourceStatus(this.swigCPtr, Property.IMAGE); - - if (_resourceLoadedEventHandler != null) - { - _resourceLoadedEventHandler(this, e); - } - } - - internal ResourceLoadingStatusType GetResourceStatus() + internal new class Property { - return (ResourceLoadingStatusType)NDalicManualPINVOKE.View_GetVisualResourceStatus(this.swigCPtr, Property.IMAGE); + internal static readonly int RESOURCE_URL = NDalicPINVOKE.ImageView_Property_RESOURCE_URL_get(); + internal static readonly int IMAGE = NDalicPINVOKE.ImageView_Property_IMAGE_get(); + internal static readonly int PRE_MULTIPLIED_ALPHA = NDalicPINVOKE.ImageView_Property_PRE_MULTIPLIED_ALPHA_get(); + internal static readonly int PIXEL_AREA = NDalicPINVOKE.ImageView_Property_PIXEL_AREA_get(); + internal static readonly int ACTION_RELOAD = NDalicManualPINVOKE.ImageView_IMAGE_VISUAL_ACTION_RELOAD_get(); + internal static readonly int ACTION_PLAY = NDalicManualPINVOKE.ImageView_IMAGE_VISUAL_ACTION_PLAY_get(); + internal static readonly int ACTION_PAUSE = NDalicManualPINVOKE.ImageView_IMAGE_VISUAL_ACTION_PAUSE_get(); + internal static readonly int ACTION_STOP = NDalicManualPINVOKE.ImageView_IMAGE_VISUAL_ACTION_STOP_get(); } - - } - } diff --git a/src/Tizen.NUI/src/public/BaseComponents/Scrollable.cs b/src/Tizen.NUI/src/public/BaseComponents/Scrollable.cs index eeba848..08a813e 100755 --- a/src/Tizen.NUI/src/public/BaseComponents/Scrollable.cs +++ b/src/Tizen.NUI/src/public/BaseComponents/Scrollable.cs @@ -38,7 +38,7 @@ namespace Tizen.NUI.BaseComponents Tizen.NUI.Object.SetProperty(scrollable.swigCPtr, Scrollable.Property.OVERSHOOT_EFFECT_COLOR, new Tizen.NUI.PropertyValue((Vector4)newValue)); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var scrollable = (Scrollable)bindable; Vector4 temp = new Vector4(0.0f, 0.0f, 0.0f, 0.0f); @@ -55,7 +55,7 @@ namespace Tizen.NUI.BaseComponents Tizen.NUI.Object.SetProperty(scrollable.swigCPtr, Scrollable.Property.OVERSHOOT_ANIMATION_SPEED, new Tizen.NUI.PropertyValue((float)newValue)); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var scrollable = (Scrollable)bindable; float temp = 0.0f; @@ -72,7 +72,7 @@ namespace Tizen.NUI.BaseComponents Tizen.NUI.Object.SetProperty(scrollable.swigCPtr, Scrollable.Property.OVERSHOOT_ENABLED, new Tizen.NUI.PropertyValue((bool)newValue)); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var scrollable = (Scrollable)bindable; bool temp = false; @@ -89,7 +89,7 @@ namespace Tizen.NUI.BaseComponents Tizen.NUI.Object.SetProperty(scrollable.swigCPtr, Scrollable.Property.OVERSHOOT_SIZE, new Tizen.NUI.PropertyValue((Vector2)newValue)); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var scrollable = (Scrollable)bindable; Vector2 temp = new Vector2(0.0f, 0.0f); @@ -106,7 +106,7 @@ namespace Tizen.NUI.BaseComponents Tizen.NUI.Object.SetProperty(scrollable.swigCPtr, Scrollable.Property.SCROLL_TO_ALPHA_FUNCTION, new Tizen.NUI.PropertyValue((int)newValue)); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var scrollable = (Scrollable)bindable; int temp = 0; @@ -123,7 +123,7 @@ namespace Tizen.NUI.BaseComponents Tizen.NUI.Object.SetProperty(scrollable.swigCPtr, Scrollable.Property.SCROLL_RELATIVE_POSITION, new Tizen.NUI.PropertyValue((Vector2)newValue)); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var scrollable = (Scrollable)bindable; Vector2 temp = new Vector2(0.0f, 0.0f); @@ -140,7 +140,7 @@ namespace Tizen.NUI.BaseComponents Tizen.NUI.Object.SetProperty(scrollable.swigCPtr, Scrollable.Property.SCROLL_POSITION_MIN, new Tizen.NUI.PropertyValue((Vector2)newValue)); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var scrollable = (Scrollable)bindable; Vector2 temp = new Vector2(0.0f, 0.0f); @@ -157,7 +157,7 @@ namespace Tizen.NUI.BaseComponents Tizen.NUI.Object.SetProperty(scrollable.swigCPtr, Scrollable.Property.SCROLL_POSITION_MAX, new Tizen.NUI.PropertyValue((Vector2)newValue)); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var scrollable = (Scrollable)bindable; Vector2 temp = new Vector2(0.0f, 0.0f); @@ -174,7 +174,7 @@ namespace Tizen.NUI.BaseComponents Tizen.NUI.Object.SetProperty(scrollable.swigCPtr, Scrollable.Property.CAN_SCROLL_VERTICAL, new Tizen.NUI.PropertyValue((bool)newValue)); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var scrollable = (Scrollable)bindable; bool temp = false; @@ -191,7 +191,7 @@ namespace Tizen.NUI.BaseComponents Tizen.NUI.Object.SetProperty(scrollable.swigCPtr, Scrollable.Property.CAN_SCROLL_HORIZONTAL, new Tizen.NUI.PropertyValue((bool)newValue)); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var scrollable = (Scrollable)bindable; bool temp = false; @@ -200,175 +200,35 @@ namespace Tizen.NUI.BaseComponents }); private global::System.Runtime.InteropServices.HandleRef swigCPtr; - - internal Scrollable(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.Scrollable_SWIGUpcast(cPtr), cMemoryOwn) - { - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); - } - - internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Scrollable obj) - { - return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; - } - - /// - /// you can override it to clean-up your own resources. - /// - /// DisposeTypes - /// 3 - protected override void Dispose(DisposeTypes type) - { - if (disposed) - { - return; - } - - if (type == DisposeTypes.Explicit) - { - //Called by User - //Release your own managed resources here. - //You should release all of your own disposable objects here. - - } - - //Release your own unmanaged resources here. - //You should not access any managed member here except static instance. - //because the execution order of Finalizes is non-deterministic. - if (this != null) - { - DisConnectFromSignals(); - } - - if (swigCPtr.Handle != global::System.IntPtr.Zero) - { - if (swigCMemOwn) - { - swigCMemOwn = false; - NDalicPINVOKE.delete_Scrollable(swigCPtr); - } - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); - } - - base.Dispose(type); - } - - private void DisConnectFromSignals() - { - // Save current CPtr. - global::System.Runtime.InteropServices.HandleRef currentCPtr = swigCPtr; - - // Use BaseHandle CPtr as current might have been deleted already in derived classes. - swigCPtr = GetBaseHandleCPtrHandleRef; - - if (_scrollableCompletedCallbackDelegate != null) - { - this.ScrollCompletedSignal().Disconnect(_scrollableCompletedCallbackDelegate); - } - - if (_scrollableUpdatedCallbackDelegate != null) - { - this.ScrollUpdatedSignal().Disconnect(_scrollableUpdatedCallbackDelegate); - } - - if (_scrollableStartedCallbackDelegate != null) - { - this.ScrollStartedSignal().Disconnect(_scrollableStartedCallbackDelegate); - } - - // BaseHandle CPtr is used in Registry and there is danger of deletion if we keep using it here. - // Restore current CPtr. - swigCPtr = currentCPtr; - } - - /// - /// The scroll animation started event arguments. - /// - /// 3 - public class StartedEventArgs : EventArgs - { - private Vector2 _vector2; - - /// - /// Vector2. - /// - /// 3 - public Vector2 Vector2 - { - get - { - return _vector2; - } - set - { - _vector2 = value; - } - } - } + private DaliEventHandler _scrollableStartedEventHandler; + private StartedCallbackDelegate _scrollableStartedCallbackDelegate; + private DaliEventHandler _scrollableUpdatedEventHandler; + private UpdatedCallbackDelegate _scrollableUpdatedCallbackDelegate; + private DaliEventHandler _scrollableCompletedEventHandler; + private CompletedCallbackDelegate _scrollableCompletedCallbackDelegate; /// - /// The scrollable updated event arguments. + /// Create an instance of scrollable. /// /// 3 - public class UpdatedEventArgs : EventArgs + public Scrollable() : this(NDalicPINVOKE.new_Scrollable__SWIG_0(), true) { - private Vector2 _vector2; - - /// - /// Vector2. - /// - /// 3 - public Vector2 Vector2 - { - get - { - return _vector2; - } - set - { - _vector2 = value; - } - } + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } - /// - /// The scroll animation completed event arguments. - /// - /// 3 - public class CompletedEventArgs : EventArgs + internal Scrollable(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.Scrollable_SWIGUpcast(cPtr), cMemoryOwn) { - private Vector2 _vector2; - - /// - /// Vector2. - /// - /// 3 - public Vector2 Vector2 - { - get - { - return _vector2; - } - set - { - _vector2 = value; - } - } + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); } [UnmanagedFunctionPointer(CallingConvention.StdCall)] private delegate void StartedCallbackDelegate(IntPtr vector2); - private DaliEventHandler _scrollableStartedEventHandler; - private StartedCallbackDelegate _scrollableStartedCallbackDelegate; [UnmanagedFunctionPointer(CallingConvention.StdCall)] private delegate void UpdatedCallbackDelegate(IntPtr vector2); - private DaliEventHandler _scrollableUpdatedEventHandler; - private UpdatedCallbackDelegate _scrollableUpdatedCallbackDelegate; [UnmanagedFunctionPointer(CallingConvention.StdCall)] private delegate void CompletedCallbackDelegate(IntPtr vector2); - private DaliEventHandler _scrollableCompletedEventHandler; - private CompletedCallbackDelegate _scrollableCompletedCallbackDelegate; /// /// The ScrollStarted event emitted when the Scrollable has moved (whether by touch or animation). @@ -405,21 +265,6 @@ namespace Tizen.NUI.BaseComponents } } - private void OnStarted(IntPtr vector2) - { - StartedEventArgs e = new StartedEventArgs(); - - // Populate all members of "e" (StartedEventArgs) with real data - e.Vector2 = Tizen.NUI.Vector2.GetVector2FromPtr(vector2); - - if (_scrollableStartedEventHandler != null) - { - //here we send all data to user event handlers - _scrollableStartedEventHandler(this, e); - } - - } - /// /// The ScrollUpdated event emitted when the Scrollable has moved (whether by touch or animation). /// @@ -455,21 +300,6 @@ namespace Tizen.NUI.BaseComponents } } - private void OnUpdated(IntPtr vector2) - { - UpdatedEventArgs e = new UpdatedEventArgs(); - - // Populate all members of "e" (UpdatedEventArgs) with real data - e.Vector2 = Tizen.NUI.Vector2.GetVector2FromPtr(vector2); - - if (_scrollableUpdatedEventHandler != null) - { - //here we send all data to user event handlers - _scrollableUpdatedEventHandler(this, e); - } - - } - /// /// The ScrollCompleted event emitted when the Scrollable has completed movement /// (whether by touch or animation). @@ -506,225 +336,62 @@ namespace Tizen.NUI.BaseComponents } } - private void OnCompleted(IntPtr vector2) + /// + /// Sets and Gets the color of the overshoot effect. + /// + /// 3 + public Vector4 OvershootEffectColor { - CompletedEventArgs e = new CompletedEventArgs(); - - // Populate all members of "e" (CompletedEventArgs) with real data - e.Vector2 = Tizen.NUI.Vector2.GetVector2FromPtr(vector2); + get + { + return (Vector4)GetValue(OvershootEffectColorProperty); + } + set + { + SetValue(OvershootEffectColorProperty, value); + NotifyPropertyChanged(); + } + } - if (_scrollableCompletedEventHandler != null) + /// + /// Sets and Gets the speed of overshoot animation in pixels per second. + /// + /// 3 + public float OvershootAnimationSpeed + { + get { - //here we send all data to user event handlers - _scrollableCompletedEventHandler(this, e); + return (float)GetValue(OvershootAnimationSpeedProperty); + } + set + { + SetValue(OvershootAnimationSpeedProperty, value); + NotifyPropertyChanged(); } + } + /// + /// Checks if scroll overshoot has been enabled or not. + /// + /// 3 + public bool OvershootEnabled + { + get + { + return (bool)GetValue(OvershootEnabledProperty); + } + set + { + SetValue(OvershootEnabledProperty, value); + NotifyPropertyChanged(); + } } /// - /// Enumeration for the instance of properties belonging to the Scrollable class. + /// Gets and Sets OvershootSize property. /// /// 3 - public new class Property - { - /// - /// The color of the overshoot effect. - /// - /// 3 - public static readonly int OVERSHOOT_EFFECT_COLOR = NDalicPINVOKE.Scrollable_Property_OVERSHOOT_EFFECT_COLOR_get(); - /// - /// The speed of overshoot animation in pixels per second. - /// - /// 3 - public static readonly int OVERSHOOT_ANIMATION_SPEED = NDalicPINVOKE.Scrollable_Property_OVERSHOOT_ANIMATION_SPEED_get(); - /// - /// Whether to enables or disable scroll overshoot. - /// - /// 3 - public static readonly int OVERSHOOT_ENABLED = NDalicPINVOKE.Scrollable_Property_OVERSHOOT_ENABLED_get(); - /// - /// The size of the overshoot. - /// - /// 3 - public static readonly int OVERSHOOT_SIZE = NDalicPINVOKE.Scrollable_Property_OVERSHOOT_SIZE_get(); - /// - /// scrollToAlphaFunction. - /// - /// 3 - public static readonly int SCROLL_TO_ALPHA_FUNCTION = NDalicPINVOKE.Scrollable_Property_SCROLL_TO_ALPHA_FUNCTION_get(); - /// - /// scrollRelativePosition - /// - /// 3 - public static readonly int SCROLL_RELATIVE_POSITION = NDalicPINVOKE.Scrollable_Property_SCROLL_RELATIVE_POSITION_get(); - /// - /// scrollPositionMin - /// - /// 3 - public static readonly int SCROLL_POSITION_MIN = NDalicPINVOKE.Scrollable_Property_SCROLL_POSITION_MIN_get(); - /// - /// scrollPositionMinX. - /// - /// 3 - public static readonly int SCROLL_POSITION_MIN_X = NDalicPINVOKE.Scrollable_Property_SCROLL_POSITION_MIN_X_get(); - /// - /// scrollPositionMinY. - /// - /// 3 - public static readonly int SCROLL_POSITION_MIN_Y = NDalicPINVOKE.Scrollable_Property_SCROLL_POSITION_MIN_Y_get(); - /// - /// scrollPositionMax. - /// - /// 3 - public static readonly int SCROLL_POSITION_MAX = NDalicPINVOKE.Scrollable_Property_SCROLL_POSITION_MAX_get(); - /// - /// scrollPositionMaxX. - /// - /// 3 - public static readonly int SCROLL_POSITION_MAX_X = NDalicPINVOKE.Scrollable_Property_SCROLL_POSITION_MAX_X_get(); - /// - /// scrollPositionMaxY. - /// - /// 3 - public static readonly int SCROLL_POSITION_MAX_Y = NDalicPINVOKE.Scrollable_Property_SCROLL_POSITION_MAX_Y_get(); - /// - /// canScrollVertical - /// - /// 3 - public static readonly int CAN_SCROLL_VERTICAL = NDalicPINVOKE.Scrollable_Property_CAN_SCROLL_VERTICAL_get(); - /// - /// canScrollHorizontal. - /// - /// 3 - public static readonly int CAN_SCROLL_HORIZONTAL = NDalicPINVOKE.Scrollable_Property_CAN_SCROLL_HORIZONTAL_get(); - - } - - /// - /// Create an instance of scrollable. - /// - /// 3 - public Scrollable() : this(NDalicPINVOKE.new_Scrollable__SWIG_0(), true) - { - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - private bool IsOvershootEnabled() - { - bool ret = NDalicPINVOKE.Scrollable_IsOvershootEnabled(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - private void SetOvershootEnabled(bool enable) - { - NDalicPINVOKE.Scrollable_SetOvershootEnabled(swigCPtr, enable); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - private void SetOvershootEffectColor(Vector4 color) - { - NDalicPINVOKE.Scrollable_SetOvershootEffectColor(swigCPtr, Vector4.getCPtr(color)); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - private Vector4 GetOvershootEffectColor() - { - Vector4 ret = new Vector4(NDalicPINVOKE.Scrollable_GetOvershootEffectColor(swigCPtr), true); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - private void SetOvershootAnimationSpeed(float pixelsPerSecond) - { - NDalicPINVOKE.Scrollable_SetOvershootAnimationSpeed(swigCPtr, pixelsPerSecond); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - private float GetOvershootAnimationSpeed() - { - float ret = NDalicPINVOKE.Scrollable_GetOvershootAnimationSpeed(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - internal ScrollableSignal ScrollStartedSignal() - { - ScrollableSignal ret = new ScrollableSignal(NDalicPINVOKE.Scrollable_ScrollStartedSignal(swigCPtr), false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - internal ScrollableSignal ScrollUpdatedSignal() - { - ScrollableSignal ret = new ScrollableSignal(NDalicPINVOKE.Scrollable_ScrollUpdatedSignal(swigCPtr), false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - internal ScrollableSignal ScrollCompletedSignal() - { - ScrollableSignal ret = new ScrollableSignal(NDalicPINVOKE.Scrollable_ScrollCompletedSignal(swigCPtr), false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - /// - /// Sets and Gets the color of the overshoot effect. - /// - /// 3 - public Vector4 OvershootEffectColor - { - get - { - return (Vector4)GetValue(OvershootEffectColorProperty); - } - set - { - SetValue(OvershootEffectColorProperty, value); - NotifyPropertyChanged(); - } - } - - /// - /// Sets and Gets the speed of overshoot animation in pixels per second. - /// - /// 3 - public float OvershootAnimationSpeed - { - get - { - return (float)GetValue(OvershootAnimationSpeedProperty); - } - set - { - SetValue(OvershootAnimationSpeedProperty, value); - NotifyPropertyChanged(); - } - } - - /// - /// Checks if scroll overshoot has been enabled or not. - /// - /// 3 - public bool OvershootEnabled - { - get - { - return (bool)GetValue(OvershootEnabledProperty); - } - set - { - SetValue(OvershootEnabledProperty, value); - NotifyPropertyChanged(); - } - } - - /// - /// Gets and Sets OvershootSize property. - /// - /// 3 - public Vector2 OvershootSize + public Vector2 OvershootSize { get { @@ -839,6 +506,336 @@ namespace Tizen.NUI.BaseComponents } } - } + internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Scrollable obj) + { + return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; + } + + internal ScrollableSignal ScrollStartedSignal() + { + ScrollableSignal ret = new ScrollableSignal(NDalicPINVOKE.Scrollable_ScrollStartedSignal(swigCPtr), false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + internal ScrollableSignal ScrollUpdatedSignal() + { + ScrollableSignal ret = new ScrollableSignal(NDalicPINVOKE.Scrollable_ScrollUpdatedSignal(swigCPtr), false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + internal ScrollableSignal ScrollCompletedSignal() + { + ScrollableSignal ret = new ScrollableSignal(NDalicPINVOKE.Scrollable_ScrollCompletedSignal(swigCPtr), false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + /// + /// you can override it to clean-up your own resources. + /// + /// DisposeTypes + /// 3 + protected override void Dispose(DisposeTypes type) + { + if (disposed) + { + return; + } + + if (type == DisposeTypes.Explicit) + { + //Called by User + //Release your own managed resources here. + //You should release all of your own disposable objects here. + + } + + //Release your own unmanaged resources here. + //You should not access any managed member here except static instance. + //because the execution order of Finalizes is non-deterministic. + if (this != null) + { + DisConnectFromSignals(); + } + + if (swigCPtr.Handle != global::System.IntPtr.Zero) + { + if (swigCMemOwn) + { + swigCMemOwn = false; + NDalicPINVOKE.delete_Scrollable(swigCPtr); + } + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); + } + base.Dispose(type); + } + + private void DisConnectFromSignals() + { + // Save current CPtr. + global::System.Runtime.InteropServices.HandleRef currentCPtr = swigCPtr; + + // Use BaseHandle CPtr as current might have been deleted already in derived classes. + swigCPtr = GetBaseHandleCPtrHandleRef; + + if (_scrollableCompletedCallbackDelegate != null) + { + this.ScrollCompletedSignal().Disconnect(_scrollableCompletedCallbackDelegate); + } + + if (_scrollableUpdatedCallbackDelegate != null) + { + this.ScrollUpdatedSignal().Disconnect(_scrollableUpdatedCallbackDelegate); + } + + if (_scrollableStartedCallbackDelegate != null) + { + this.ScrollStartedSignal().Disconnect(_scrollableStartedCallbackDelegate); + } + + // BaseHandle CPtr is used in Registry and there is danger of deletion if we keep using it here. + // Restore current CPtr. + swigCPtr = currentCPtr; + } + + private void OnStarted(IntPtr vector2) + { + StartedEventArgs e = new StartedEventArgs(); + + // Populate all members of "e" (StartedEventArgs) with real data + e.Vector2 = Tizen.NUI.Vector2.GetVector2FromPtr(vector2); + + if (_scrollableStartedEventHandler != null) + { + //here we send all data to user event handlers + _scrollableStartedEventHandler(this, e); + } + + } + + private void OnUpdated(IntPtr vector2) + { + UpdatedEventArgs e = new UpdatedEventArgs(); + + // Populate all members of "e" (UpdatedEventArgs) with real data + e.Vector2 = Tizen.NUI.Vector2.GetVector2FromPtr(vector2); + + if (_scrollableUpdatedEventHandler != null) + { + //here we send all data to user event handlers + _scrollableUpdatedEventHandler(this, e); + } + + } + + private void OnCompleted(IntPtr vector2) + { + CompletedEventArgs e = new CompletedEventArgs(); + + // Populate all members of "e" (CompletedEventArgs) with real data + e.Vector2 = Tizen.NUI.Vector2.GetVector2FromPtr(vector2); + + if (_scrollableCompletedEventHandler != null) + { + //here we send all data to user event handlers + _scrollableCompletedEventHandler(this, e); + } + + } + + private bool IsOvershootEnabled() + { + bool ret = NDalicPINVOKE.Scrollable_IsOvershootEnabled(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + private void SetOvershootEnabled(bool enable) + { + NDalicPINVOKE.Scrollable_SetOvershootEnabled(swigCPtr, enable); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + private void SetOvershootEffectColor(Vector4 color) + { + NDalicPINVOKE.Scrollable_SetOvershootEffectColor(swigCPtr, Vector4.getCPtr(color)); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + private Vector4 GetOvershootEffectColor() + { + Vector4 ret = new Vector4(NDalicPINVOKE.Scrollable_GetOvershootEffectColor(swigCPtr), true); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + private void SetOvershootAnimationSpeed(float pixelsPerSecond) + { + NDalicPINVOKE.Scrollable_SetOvershootAnimationSpeed(swigCPtr, pixelsPerSecond); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + private float GetOvershootAnimationSpeed() + { + float ret = NDalicPINVOKE.Scrollable_GetOvershootAnimationSpeed(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + /// + /// The scroll animation started event arguments. + /// + /// 3 + public class StartedEventArgs : EventArgs + { + private Vector2 _vector2; + + /// + /// Vector2. + /// + /// 3 + public Vector2 Vector2 + { + get + { + return _vector2; + } + set + { + _vector2 = value; + } + } + } + + /// + /// The scrollable updated event arguments. + /// + /// 3 + public class UpdatedEventArgs : EventArgs + { + private Vector2 _vector2; + + /// + /// Vector2. + /// + /// 3 + public Vector2 Vector2 + { + get + { + return _vector2; + } + set + { + _vector2 = value; + } + } + } + + /// + /// The scroll animation completed event arguments. + /// + /// 3 + public class CompletedEventArgs : EventArgs + { + private Vector2 _vector2; + + /// + /// Vector2. + /// + /// 3 + public Vector2 Vector2 + { + get + { + return _vector2; + } + set + { + _vector2 = value; + } + } + } + + /// + /// Enumeration for the instance of properties belonging to the Scrollable class. + /// + /// 3 + public new class Property + { + /// + /// The color of the overshoot effect. + /// + /// 3 + public static readonly int OVERSHOOT_EFFECT_COLOR = NDalicPINVOKE.Scrollable_Property_OVERSHOOT_EFFECT_COLOR_get(); + /// + /// The speed of overshoot animation in pixels per second. + /// + /// 3 + public static readonly int OVERSHOOT_ANIMATION_SPEED = NDalicPINVOKE.Scrollable_Property_OVERSHOOT_ANIMATION_SPEED_get(); + /// + /// Whether to enables or disable scroll overshoot. + /// + /// 3 + public static readonly int OVERSHOOT_ENABLED = NDalicPINVOKE.Scrollable_Property_OVERSHOOT_ENABLED_get(); + /// + /// The size of the overshoot. + /// + /// 3 + public static readonly int OVERSHOOT_SIZE = NDalicPINVOKE.Scrollable_Property_OVERSHOOT_SIZE_get(); + /// + /// scrollToAlphaFunction. + /// + /// 3 + public static readonly int SCROLL_TO_ALPHA_FUNCTION = NDalicPINVOKE.Scrollable_Property_SCROLL_TO_ALPHA_FUNCTION_get(); + /// + /// scrollRelativePosition + /// + /// 3 + public static readonly int SCROLL_RELATIVE_POSITION = NDalicPINVOKE.Scrollable_Property_SCROLL_RELATIVE_POSITION_get(); + /// + /// scrollPositionMin + /// + /// 3 + public static readonly int SCROLL_POSITION_MIN = NDalicPINVOKE.Scrollable_Property_SCROLL_POSITION_MIN_get(); + /// + /// scrollPositionMinX. + /// + /// 3 + public static readonly int SCROLL_POSITION_MIN_X = NDalicPINVOKE.Scrollable_Property_SCROLL_POSITION_MIN_X_get(); + /// + /// scrollPositionMinY. + /// + /// 3 + public static readonly int SCROLL_POSITION_MIN_Y = NDalicPINVOKE.Scrollable_Property_SCROLL_POSITION_MIN_Y_get(); + /// + /// scrollPositionMax. + /// + /// 3 + public static readonly int SCROLL_POSITION_MAX = NDalicPINVOKE.Scrollable_Property_SCROLL_POSITION_MAX_get(); + /// + /// scrollPositionMaxX. + /// + /// 3 + public static readonly int SCROLL_POSITION_MAX_X = NDalicPINVOKE.Scrollable_Property_SCROLL_POSITION_MAX_X_get(); + /// + /// scrollPositionMaxY. + /// + /// 3 + public static readonly int SCROLL_POSITION_MAX_Y = NDalicPINVOKE.Scrollable_Property_SCROLL_POSITION_MAX_Y_get(); + /// + /// canScrollVertical + /// + /// 3 + public static readonly int CAN_SCROLL_VERTICAL = NDalicPINVOKE.Scrollable_Property_CAN_SCROLL_VERTICAL_get(); + /// + /// canScrollHorizontal. + /// + /// 3 + public static readonly int CAN_SCROLL_HORIZONTAL = NDalicPINVOKE.Scrollable_Property_CAN_SCROLL_HORIZONTAL_get(); + } + } } \ No newline at end of file diff --git a/src/Tizen.NUI/src/public/BaseComponents/TableView.cs b/src/Tizen.NUI/src/public/BaseComponents/TableView.cs index 3ff33cc..c5698e4 100755 --- a/src/Tizen.NUI/src/public/BaseComponents/TableView.cs +++ b/src/Tizen.NUI/src/public/BaseComponents/TableView.cs @@ -42,7 +42,7 @@ namespace Tizen.NUI.BaseComponents Tizen.NUI.Object.SetProperty(tableView.swigCPtr, TableView.Property.ROWS, new Tizen.NUI.PropertyValue((int)newValue)); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var tableView = (TableView)bindable; int temp = 0; @@ -59,7 +59,7 @@ namespace Tizen.NUI.BaseComponents Tizen.NUI.Object.SetProperty(tableView.swigCPtr, TableView.Property.COLUMNS, new Tizen.NUI.PropertyValue((int)newValue)); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var tableView = (TableView)bindable; int temp = 0; @@ -76,7 +76,7 @@ namespace Tizen.NUI.BaseComponents Tizen.NUI.Object.SetProperty(tableView.swigCPtr, TableView.Property.CELL_PADDING, new Tizen.NUI.PropertyValue((Vector2)newValue)); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var tableView = (TableView)bindable; Vector2 temp = new Vector2(0.0f, 0.0f); @@ -93,7 +93,7 @@ namespace Tizen.NUI.BaseComponents Tizen.NUI.Object.SetProperty(tableView.swigCPtr, TableView.Property.LAYOUT_ROWS, new Tizen.NUI.PropertyValue((PropertyMap)newValue)); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var tableView = (TableView)bindable; PropertyMap temp = new PropertyMap(); @@ -110,7 +110,7 @@ namespace Tizen.NUI.BaseComponents Tizen.NUI.Object.SetProperty(tableView.swigCPtr, TableView.Property.LAYOUT_COLUMNS, new Tizen.NUI.PropertyValue((PropertyMap)newValue)); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var tableView = (TableView)bindable; PropertyMap temp = new PropertyMap(); @@ -118,405 +118,154 @@ namespace Tizen.NUI.BaseComponents return temp; }); - private global::System.Runtime.InteropServices.HandleRef swigCPtr; - internal TableView(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.TableView_SWIGUpcast(cPtr), cMemoryOwn) - { - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); - } - - internal static global::System.Runtime.InteropServices.HandleRef getCPtr(TableView obj) + /// + /// Creates the default TableView view. + /// + public TableView() : this(NDalicPINVOKE.TableView_New(1, 1), true) { - return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } /// - /// Dispose + /// Creates the TableView view. /// - /// The dispose type + /// Initial rows for the table. + /// Initial columns for the table. /// 3 - protected override void Dispose(DisposeTypes type) + public TableView(uint initialRows, uint initialColumns) : this(NDalicPINVOKE.TableView_New(initialRows, initialColumns), true) { - if (disposed) - { - return; - } - - if (type == DisposeTypes.Explicit) - { - //Called by User - //Release your own managed resources here. - //You should release all of your own disposable objects here. - } - - //Release your own unmanaged resources here. - //You should not access any managed member here except static instance. - //because the execution order of Finalizes is non-deterministic. - - if (swigCPtr.Handle != global::System.IntPtr.Zero) - { - if (swigCMemOwn) - { - swigCMemOwn = false; - NDalicPINVOKE.delete_TableView(swigCPtr); - } - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); - } + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - base.Dispose(type); } - - internal new class Property + /// + /// The Copy constructor. Creates another handle that points to the same real object. + /// + /// Handle to copy from. + /// 3 + public TableView(TableView handle) : this(NDalicPINVOKE.new_TableView__SWIG_1(TableView.getCPtr(handle)), true) { - internal static readonly int ROWS = NDalicPINVOKE.TableView_Property_ROWS_get(); - internal static readonly int COLUMNS = NDalicPINVOKE.TableView_Property_COLUMNS_get(); - internal static readonly int CELL_PADDING = NDalicPINVOKE.TableView_Property_CELL_PADDING_get(); - internal static readonly int LAYOUT_ROWS = NDalicPINVOKE.TableView_Property_LAYOUT_ROWS_get(); - internal static readonly int LAYOUT_COLUMNS = NDalicPINVOKE.TableView_Property_LAYOUT_COLUMNS_get(); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } - internal class ChildProperty + internal TableView(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.TableView_SWIGUpcast(cPtr), cMemoryOwn) { - internal static readonly int CELL_INDEX = NDalicPINVOKE.TableView_ChildProperty_CELL_INDEX_get(); - internal static readonly int ROW_SPAN = NDalicPINVOKE.TableView_ChildProperty_ROW_SPAN_get(); - internal static readonly int COLUMN_SPAN = NDalicPINVOKE.TableView_ChildProperty_COLUMN_SPAN_get(); - internal static readonly int CELL_HORIZONTAL_ALIGNMENT = NDalicPINVOKE.TableView_ChildProperty_CELL_HORIZONTAL_ALIGNMENT_get(); - internal static readonly int CELL_VERTICAL_ALIGNMENT = NDalicPINVOKE.TableView_ChildProperty_CELL_VERTICAL_ALIGNMENT_get(); + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); } /// - /// Class to specify the layout position for the child view. + /// Enumeration for describing how the size of a row or column has been set. /// /// 3 - public class CellPosition : global::System.IDisposable + public enum LayoutPolicy { - private global::System.Runtime.InteropServices.HandleRef swigCPtr; /// - /// swigCMemOwn + /// Fixed with the given value. /// /// 3 - protected bool swigCMemOwn; - - internal CellPosition(global::System.IntPtr cPtr, bool cMemoryOwn) - { - swigCMemOwn = cMemoryOwn; - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); - } - - internal static global::System.Runtime.InteropServices.HandleRef getCPtr(CellPosition obj) - { - return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; - } - - //A Flag to check who called Dispose(). (By User or DisposeQueue) - private bool isDisposeQueued = false; + Fixed, /// - /// A Flat to check if it is already disposed. + /// Calculated as percentage of the remainder after subtracting Padding and Fixed height/width. /// /// 3 - protected bool disposed = false; - + Relative, /// - /// Dispose. + /// Default policy, get the remainder of the 100% (after subtracting Fixed, Fit and Relative height/ width) divided evenly between 'fill' rows/columns. /// /// 3 - ~CellPosition() - { - if (!isDisposeQueued) - { - isDisposeQueued = true; - DisposeQueue.Instance.Add(this); - } - } - + Fill, /// - /// Dispose. + /// Fit around its children. /// /// 3 - public void Dispose() - { - //Throw excpetion if Dispose() is called in separate thread. - if (!Window.IsInstalled()) - { - throw new System.InvalidOperationException("This API called from separate thread. This API must be called from MainThread."); - } + Fit + } - if (isDisposeQueued) - { - Dispose(DisposeTypes.Implicit); - } - else - { - Dispose(DisposeTypes.Explicit); - System.GC.SuppressFinalize(this); - } + /// + /// The amount of rows in the table. + /// + /// 3 + public int Rows + { + get + { + return (int)GetValue(RowsProperty); } - - /// - /// Dispose. - /// - /// DisposeTypes - /// 3 - protected virtual void Dispose(DisposeTypes type) + set { - if (disposed) - { - return; - } - - if (type == DisposeTypes.Explicit) - { - //Called by User - //Release your own managed resources here. - //You should release all of your own disposable objects here. - } - - //Release your own unmanaged resources here. - //You should not access any managed member here except static instance. - //because the execution order of Finalizes is non-deterministic. - - if (swigCPtr.Handle != global::System.IntPtr.Zero) - { - if (swigCMemOwn) - { - swigCMemOwn = false; - NDalicPINVOKE.delete_TableView_CellPosition(swigCPtr); - } - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); - } - disposed = true; + SetValue(RowsProperty, value); + NotifyPropertyChanged(); } - - /// - /// The constructor. - /// - /// The row index initialized. - /// The column index initialized. - /// The row span initialized. - /// The column span initialized. - /// 3 - public CellPosition(uint rowIndex, uint columnIndex, uint rowSpan, uint columnSpan) : this(NDalicPINVOKE.new_TableView_CellPosition__SWIG_0(rowIndex, columnIndex, rowSpan, columnSpan), true) + } + /// + /// The amount of columns in the table. + /// + /// 3 + public int Columns + { + get { - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return (int)GetValue(ColumnsProperty); } - - /// - /// The constructor to initialize values to defaults for convenience. - /// - /// The row index initialized. - /// The column index initialized. - /// The row span initialized. - /// 3 - public CellPosition(uint rowIndex, uint columnIndex, uint rowSpan) : this(NDalicPINVOKE.new_TableView_CellPosition__SWIG_1(rowIndex, columnIndex, rowSpan), true) + set { - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + SetValue(ColumnsProperty, value); + NotifyPropertyChanged(); } - - /// - /// The constructor to initialize values to defaults for convenience. - /// - /// The row index initialized. - /// The column index initialized. - /// 3 - public CellPosition(uint rowIndex, uint columnIndex) : this(NDalicPINVOKE.new_TableView_CellPosition__SWIG_2(rowIndex, columnIndex), true) + } + /// + /// Padding between cells. + /// + /// 3 + public Vector2 CellPadding + { + get { - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return (Vector2)GetValue(CellPaddingProperty); } - - /// - /// The constructor to initialize values to default for convenience. - /// - /// The row index initialized. - /// 3 - public CellPosition(uint rowIndex) : this(NDalicPINVOKE.new_TableView_CellPosition__SWIG_3(rowIndex), true) + set { - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + SetValue(CellPaddingProperty, value); + NotifyPropertyChanged(); } + } - /// - /// The default constructor. - /// - /// 3 - public CellPosition() : this(NDalicPINVOKE.new_TableView_CellPosition__SWIG_4(), true) + /// + /// The number of layout rows. + /// + /// 3 + public PropertyMap LayoutRows + { + get { - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return (PropertyMap)GetValue(LayoutRowsProperty); } - - /// - /// The index of a row. - /// - /// 3 - [Obsolete("Please do not use! This will be deprecated! Please use RowIndex instead!")] - [EditorBrowsable(EditorBrowsableState.Never)] - public uint rowIndex - { - set - { - NDalicPINVOKE.TableView_CellPosition_rowIndex_set(swigCPtr, value); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - get - { - uint ret = NDalicPINVOKE.TableView_CellPosition_rowIndex_get(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - } - - /// - /// The index or position of a row. - /// - /// 5 - public uint RowIndex - { - get - { - uint ret = NDalicPINVOKE.TableView_CellPosition_rowIndex_get(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - } - - - /// - /// The index of a column. - /// - /// 3 - [Obsolete("Please do not use! This will be deprecated! Please use ColumnIndex instead!")] - [EditorBrowsable(EditorBrowsableState.Never)] - public uint columnIndex - { - set - { - NDalicPINVOKE.TableView_CellPosition_columnIndex_set(swigCPtr, value); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - get - { - uint ret = NDalicPINVOKE.TableView_CellPosition_columnIndex_get(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - } - - /// - /// The index or position of a column. - /// - /// 5 - public uint ColumnIndex - { - get - { - uint ret = NDalicPINVOKE.TableView_CellPosition_columnIndex_get(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - } - - /// - /// The span of a row. - /// - /// 3 - [Obsolete("Please do not use! This will be deprecated! Please use RowSpan instead!")] - [EditorBrowsable(EditorBrowsableState.Never)] - public uint rowSpan - { - set - { - NDalicPINVOKE.TableView_CellPosition_rowSpan_set(swigCPtr, value); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - get - { - uint ret = NDalicPINVOKE.TableView_CellPosition_rowSpan_get(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - } - - /// - /// The span of a row. - /// - /// 5 - public uint RowSpan - { - get - { - uint ret = NDalicPINVOKE.TableView_CellPosition_rowSpan_get(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - } - - /// - /// The span of a column. - /// - /// 3 - [Obsolete("Please do not use! This will be deprecated! Please use ColumnSpan instead!")] - [EditorBrowsable(EditorBrowsableState.Never)] - public uint columnSpan - { - set - { - NDalicPINVOKE.TableView_CellPosition_columnSpan_set(swigCPtr, value); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - get - { - uint ret = NDalicPINVOKE.TableView_CellPosition_columnSpan_get(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - } - - /// - /// The span of a column. - /// - /// 5 - public uint ColumnSpan + set { - get - { - uint ret = NDalicPINVOKE.TableView_CellPosition_columnSpan_get(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } + SetValue(LayoutRowsProperty, value); + NotifyPropertyChanged(); } - - - } - - /// - /// Creates the default TableView view. - /// - public TableView() : this(NDalicPINVOKE.TableView_New(1, 1), true) - { - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } /// - /// Creates the TableView view. + /// The number of layout columns. /// - /// Initial rows for the table. - /// Initial columns for the table. /// 3 - public TableView(uint initialRows, uint initialColumns) : this(NDalicPINVOKE.TableView_New(initialRows, initialColumns), true) + public PropertyMap LayoutColumns { - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - + get + { + return (PropertyMap)GetValue(LayoutColumnsProperty); + } + set + { + SetValue(LayoutColumnsProperty, value); + NotifyPropertyChanged(); + } } - /// - /// The Copy constructor. Creates another handle that points to the same real object. - /// - /// Handle to copy from. - /// 3 - public TableView(TableView handle) : this(NDalicPINVOKE.new_TableView__SWIG_1(TableView.getCPtr(handle)), true) - { - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } /// /// Adds a child to the table.
@@ -834,116 +583,365 @@ namespace Tizen.NUI.BaseComponents if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } - /// - /// Enumeration for describing how the size of a row or column has been set. - /// - /// 3 - public enum LayoutPolicy + internal static global::System.Runtime.InteropServices.HandleRef getCPtr(TableView obj) { - /// - /// Fixed with the given value. - /// - /// 3 - Fixed, - /// - /// Calculated as percentage of the remainder after subtracting Padding and Fixed height/width. - /// - /// 3 - Relative, - /// - /// Default policy, get the remainder of the 100% (after subtracting Fixed, Fit and Relative height/ width) divided evenly between 'fill' rows/columns. - /// - /// 3 - Fill, - /// - /// Fit around its children. - /// - /// 3 - Fit + return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; } /// - /// The amount of rows in the table. + /// Dispose /// + /// The dispose type /// 3 - public int Rows + protected override void Dispose(DisposeTypes type) { - get - { - return (int)GetValue(RowsProperty); - } - set + if (disposed) { - SetValue(RowsProperty, value); - NotifyPropertyChanged(); + return; } - } - /// - /// The amount of columns in the table. - /// - /// 3 - public int Columns - { - get + + if (type == DisposeTypes.Explicit) { - return (int)GetValue(ColumnsProperty); + //Called by User + //Release your own managed resources here. + //You should release all of your own disposable objects here. } - set + + //Release your own unmanaged resources here. + //You should not access any managed member here except static instance. + //because the execution order of Finalizes is non-deterministic. + + if (swigCPtr.Handle != global::System.IntPtr.Zero) { - SetValue(ColumnsProperty, value); - NotifyPropertyChanged(); + if (swigCMemOwn) + { + swigCMemOwn = false; + NDalicPINVOKE.delete_TableView(swigCPtr); + } + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); } + + base.Dispose(type); } + /// - /// Padding between cells. + /// Class to specify the layout position for the child view. /// /// 3 - public Vector2 CellPadding + public class CellPosition : global::System.IDisposable { - get - { - return (Vector2)GetValue(CellPaddingProperty); - } - set - { - SetValue(CellPaddingProperty, value); - NotifyPropertyChanged(); + /// + /// swigCMemOwn + /// + /// 3 + protected bool swigCMemOwn; + /// + /// A Flat to check if it is already disposed. + /// + /// 3 + protected bool disposed = false; + + private global::System.Runtime.InteropServices.HandleRef swigCPtr; + //A Flag to check who called Dispose(). (By User or DisposeQueue) + private bool isDisposeQueued = false; + + /// + /// The constructor. + /// + /// The row index initialized. + /// The column index initialized. + /// The row span initialized. + /// The column span initialized. + /// 3 + public CellPosition(uint rowIndex, uint columnIndex, uint rowSpan, uint columnSpan) : this(NDalicPINVOKE.new_TableView_CellPosition__SWIG_0(rowIndex, columnIndex, rowSpan, columnSpan), true) + { + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } - } - /// - /// The number of layout rows. - /// - /// 3 - public PropertyMap LayoutRows - { - get + /// + /// The constructor to initialize values to defaults for convenience. + /// + /// The row index initialized. + /// The column index initialized. + /// The row span initialized. + /// 3 + public CellPosition(uint rowIndex, uint columnIndex, uint rowSpan) : this(NDalicPINVOKE.new_TableView_CellPosition__SWIG_1(rowIndex, columnIndex, rowSpan), true) { - return (PropertyMap)GetValue(LayoutRowsProperty); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } - set + + /// + /// The constructor to initialize values to defaults for convenience. + /// + /// The row index initialized. + /// The column index initialized. + /// 3 + public CellPosition(uint rowIndex, uint columnIndex) : this(NDalicPINVOKE.new_TableView_CellPosition__SWIG_2(rowIndex, columnIndex), true) { - SetValue(LayoutRowsProperty, value); - NotifyPropertyChanged(); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } - } - /// - /// The number of layout columns. - /// - /// 3 - public PropertyMap LayoutColumns - { - get + /// + /// The constructor to initialize values to default for convenience. + /// + /// The row index initialized. + /// 3 + public CellPosition(uint rowIndex) : this(NDalicPINVOKE.new_TableView_CellPosition__SWIG_3(rowIndex), true) { - return (PropertyMap)GetValue(LayoutColumnsProperty); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } - set + + /// + /// The default constructor. + /// + /// 3 + public CellPosition() : this(NDalicPINVOKE.new_TableView_CellPosition__SWIG_4(), true) { - SetValue(LayoutColumnsProperty, value); - NotifyPropertyChanged(); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + internal CellPosition(global::System.IntPtr cPtr, bool cMemoryOwn) + { + swigCMemOwn = cMemoryOwn; + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); + } + + /// + /// Dispose. + /// + /// 3 + ~CellPosition() + { + if (!isDisposeQueued) + { + isDisposeQueued = true; + DisposeQueue.Instance.Add(this); + } + } + + /// + /// The index of a row. + /// + /// 3 + [Obsolete("Please do not use! This will be deprecated! Please use RowIndex instead!")] + [EditorBrowsable(EditorBrowsableState.Never)] + public uint rowIndex + { + set + { + NDalicPINVOKE.TableView_CellPosition_rowIndex_set(swigCPtr, value); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + get + { + uint ret = NDalicPINVOKE.TableView_CellPosition_rowIndex_get(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + } + + /// + /// The index or position of a row. + /// + /// 5 + public uint RowIndex + { + get + { + uint ret = NDalicPINVOKE.TableView_CellPosition_rowIndex_get(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + } + + + /// + /// The index of a column. + /// + /// 3 + [Obsolete("Please do not use! This will be deprecated! Please use ColumnIndex instead!")] + [EditorBrowsable(EditorBrowsableState.Never)] + public uint columnIndex + { + set + { + NDalicPINVOKE.TableView_CellPosition_columnIndex_set(swigCPtr, value); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + get + { + uint ret = NDalicPINVOKE.TableView_CellPosition_columnIndex_get(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + } + + /// + /// The index or position of a column. + /// + /// 5 + public uint ColumnIndex + { + get + { + uint ret = NDalicPINVOKE.TableView_CellPosition_columnIndex_get(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + } + + /// + /// The span of a row. + /// + /// 3 + [Obsolete("Please do not use! This will be deprecated! Please use RowSpan instead!")] + [EditorBrowsable(EditorBrowsableState.Never)] + public uint rowSpan + { + set + { + NDalicPINVOKE.TableView_CellPosition_rowSpan_set(swigCPtr, value); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + get + { + uint ret = NDalicPINVOKE.TableView_CellPosition_rowSpan_get(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + } + + /// + /// The span of a row. + /// + /// 5 + public uint RowSpan + { + get + { + uint ret = NDalicPINVOKE.TableView_CellPosition_rowSpan_get(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } } + + /// + /// The span of a column. + /// + /// 3 + [Obsolete("Please do not use! This will be deprecated! Please use ColumnSpan instead!")] + [EditorBrowsable(EditorBrowsableState.Never)] + public uint columnSpan + { + set + { + NDalicPINVOKE.TableView_CellPosition_columnSpan_set(swigCPtr, value); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + get + { + uint ret = NDalicPINVOKE.TableView_CellPosition_columnSpan_get(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + } + + /// + /// The span of a column. + /// + /// 5 + public uint ColumnSpan + { + get + { + uint ret = NDalicPINVOKE.TableView_CellPosition_columnSpan_get(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + } + + + /// + /// Dispose. + /// + /// 3 + public void Dispose() + { + //Throw excpetion if Dispose() is called in separate thread. + if (!Window.IsInstalled()) + { + throw new System.InvalidOperationException("This API called from separate thread. This API must be called from MainThread."); + } + + if (isDisposeQueued) + { + Dispose(DisposeTypes.Implicit); + } + else + { + Dispose(DisposeTypes.Explicit); + System.GC.SuppressFinalize(this); + } + } + + internal static global::System.Runtime.InteropServices.HandleRef getCPtr(CellPosition obj) + { + return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; + } + + /// + /// Dispose. + /// + /// DisposeTypes + /// 3 + protected virtual void Dispose(DisposeTypes type) + { + if (disposed) + { + return; + } + + if (type == DisposeTypes.Explicit) + { + //Called by User + //Release your own managed resources here. + //You should release all of your own disposable objects here. + } + + //Release your own unmanaged resources here. + //You should not access any managed member here except static instance. + //because the execution order of Finalizes is non-deterministic. + + if (swigCPtr.Handle != global::System.IntPtr.Zero) + { + if (swigCMemOwn) + { + swigCMemOwn = false; + NDalicPINVOKE.delete_TableView_CellPosition(swigCPtr); + } + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); + } + disposed = true; + } + + } + + internal new class Property + { + internal static readonly int ROWS = NDalicPINVOKE.TableView_Property_ROWS_get(); + internal static readonly int COLUMNS = NDalicPINVOKE.TableView_Property_COLUMNS_get(); + internal static readonly int CELL_PADDING = NDalicPINVOKE.TableView_Property_CELL_PADDING_get(); + internal static readonly int LAYOUT_ROWS = NDalicPINVOKE.TableView_Property_LAYOUT_ROWS_get(); + internal static readonly int LAYOUT_COLUMNS = NDalicPINVOKE.TableView_Property_LAYOUT_COLUMNS_get(); } + internal class ChildProperty + { + internal static readonly int CELL_INDEX = NDalicPINVOKE.TableView_ChildProperty_CELL_INDEX_get(); + internal static readonly int ROW_SPAN = NDalicPINVOKE.TableView_ChildProperty_ROW_SPAN_get(); + internal static readonly int COLUMN_SPAN = NDalicPINVOKE.TableView_ChildProperty_COLUMN_SPAN_get(); + internal static readonly int CELL_HORIZONTAL_ALIGNMENT = NDalicPINVOKE.TableView_ChildProperty_CELL_HORIZONTAL_ALIGNMENT_get(); + internal static readonly int CELL_VERTICAL_ALIGNMENT = NDalicPINVOKE.TableView_ChildProperty_CELL_VERTICAL_ALIGNMENT_get(); + } } } diff --git a/src/Tizen.NUI/src/public/BaseComponents/TextEditor.cs b/src/Tizen.NUI/src/public/BaseComponents/TextEditor.cs index 0f69340..32f0084 100755 --- a/src/Tizen.NUI/src/public/BaseComponents/TextEditor.cs +++ b/src/Tizen.NUI/src/public/BaseComponents/TextEditor.cs @@ -34,7 +34,7 @@ namespace Tizen.NUI.BaseComponents { /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty TextProperty = BindableProperty.Create("Text", typeof(string), typeof(TextEditor), string.Empty, propertyChanged: (bindable, oldValue, newValue) => + public static readonly BindableProperty TextProperty = BindableProperty.Create(nameof(Text), typeof(string), typeof(TextEditor), string.Empty, propertyChanged: (bindable, oldValue, newValue) => { var textEditor = (TextEditor)bindable; if (newValue != null) @@ -42,7 +42,7 @@ namespace Tizen.NUI.BaseComponents Tizen.NUI.Object.SetProperty(textEditor.swigCPtr, TextEditor.Property.TEXT, new Tizen.NUI.PropertyValue((string)newValue)); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var textEditor = (TextEditor)bindable; string temp; @@ -51,7 +51,7 @@ namespace Tizen.NUI.BaseComponents }); /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty TextColorProperty = BindableProperty.Create("TextColor", typeof(Vector4), typeof(TextEditor), Vector4.Zero, propertyChanged: (bindable, oldValue, newValue) => + public static readonly BindableProperty TextColorProperty = BindableProperty.Create(nameof(TextColor), typeof(Vector4), typeof(TextEditor), Vector4.Zero, propertyChanged: (bindable, oldValue, newValue) => { var textEditor = (TextEditor)bindable; if (newValue != null) @@ -59,7 +59,7 @@ namespace Tizen.NUI.BaseComponents Tizen.NUI.Object.SetProperty(textEditor.swigCPtr, TextEditor.Property.TEXT_COLOR, new Tizen.NUI.PropertyValue((Vector4)newValue)); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var textEditor = (TextEditor)bindable; Vector4 temp = new Vector4(0.0f, 0.0f, 0.0f, 0.0f); @@ -68,7 +68,7 @@ namespace Tizen.NUI.BaseComponents }); /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty FontFamilyProperty = BindableProperty.Create("FontFamily", typeof(string), typeof(TextEditor), string.Empty, propertyChanged: (bindable, oldValue, newValue) => + public static readonly BindableProperty FontFamilyProperty = BindableProperty.Create(nameof(FontFamily), typeof(string), typeof(TextEditor), string.Empty, propertyChanged: (bindable, oldValue, newValue) => { var textEditor = (TextEditor)bindable; if (newValue != null) @@ -76,7 +76,7 @@ namespace Tizen.NUI.BaseComponents Tizen.NUI.Object.SetProperty(textEditor.swigCPtr, TextEditor.Property.FONT_FAMILY, new Tizen.NUI.PropertyValue((string)newValue)); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var textEditor = (TextEditor)bindable; string temp; @@ -85,7 +85,7 @@ namespace Tizen.NUI.BaseComponents }); /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty FontStyleProperty = BindableProperty.Create("FontStyle", typeof(PropertyMap), typeof(TextEditor), new PropertyMap(), propertyChanged: (bindable, oldValue, newValue) => + public static readonly BindableProperty FontStyleProperty = BindableProperty.Create(nameof(FontStyle), typeof(PropertyMap), typeof(TextEditor), new PropertyMap(), propertyChanged: (bindable, oldValue, newValue) => { var textEditor = (TextEditor)bindable; if (newValue != null) @@ -93,7 +93,7 @@ namespace Tizen.NUI.BaseComponents Tizen.NUI.Object.SetProperty(textEditor.swigCPtr, TextEditor.Property.FONT_STYLE, new Tizen.NUI.PropertyValue((PropertyMap)newValue)); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var textEditor = (TextEditor)bindable; PropertyMap temp = new PropertyMap(); @@ -102,7 +102,7 @@ namespace Tizen.NUI.BaseComponents }); /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty PointSizeProperty = BindableProperty.Create("PointSize", typeof(float), typeof(TextEditor), default(float), propertyChanged: (bindable, oldValue, newValue) => + public static readonly BindableProperty PointSizeProperty = BindableProperty.Create(nameof(PointSize), typeof(float), typeof(TextEditor), default(float), propertyChanged: (bindable, oldValue, newValue) => { var textEditor = (TextEditor)bindable; if (newValue != null) @@ -110,7 +110,7 @@ namespace Tizen.NUI.BaseComponents Tizen.NUI.Object.SetProperty(textEditor.swigCPtr, TextEditor.Property.POINT_SIZE, new Tizen.NUI.PropertyValue((float)newValue)); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var textEditor = (TextEditor)bindable; float temp = 0.0f; @@ -119,7 +119,7 @@ namespace Tizen.NUI.BaseComponents }); /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty HorizontalAlignmentProperty = BindableProperty.Create("HorizontalAlignment", typeof(HorizontalAlignment), typeof(TextEditor), HorizontalAlignment.Begin, propertyChanged: (bindable, oldValue, newValue) => + public static readonly BindableProperty HorizontalAlignmentProperty = BindableProperty.Create(nameof(HorizontalAlignment), typeof(HorizontalAlignment), typeof(TextEditor), HorizontalAlignment.Begin, propertyChanged: (bindable, oldValue, newValue) => { var textEditor = (TextEditor)bindable; if (newValue != null) @@ -127,7 +127,7 @@ namespace Tizen.NUI.BaseComponents Tizen.NUI.Object.SetProperty(textEditor.swigCPtr, TextEditor.Property.HORIZONTAL_ALIGNMENT, new Tizen.NUI.PropertyValue((int)newValue)); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var textEditor = (TextEditor)bindable; string temp; @@ -150,7 +150,7 @@ namespace Tizen.NUI.BaseComponents }); /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty ScrollThresholdProperty = BindableProperty.Create("ScrollThreshold", typeof(float), typeof(TextEditor), default(float), propertyChanged: (bindable, oldValue, newValue) => + public static readonly BindableProperty ScrollThresholdProperty = BindableProperty.Create(nameof(ScrollThreshold), typeof(float), typeof(TextEditor), default(float), propertyChanged: (bindable, oldValue, newValue) => { var textEditor = (TextEditor)bindable; if (newValue != null) @@ -158,7 +158,7 @@ namespace Tizen.NUI.BaseComponents Tizen.NUI.Object.SetProperty(textEditor.swigCPtr, TextEditor.Property.SCROLL_THRESHOLD, new Tizen.NUI.PropertyValue((float)newValue)); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var textEditor = (TextEditor)bindable; float temp = 0.0f; @@ -167,7 +167,7 @@ namespace Tizen.NUI.BaseComponents }); /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty ScrollSpeedProperty = BindableProperty.Create("ScrollSpeed", typeof(float), typeof(TextEditor), default(float), propertyChanged: (bindable, oldValue, newValue) => + public static readonly BindableProperty ScrollSpeedProperty = BindableProperty.Create(nameof(ScrollSpeed), typeof(float), typeof(TextEditor), default(float), propertyChanged: (bindable, oldValue, newValue) => { var textEditor = (TextEditor)bindable; if (newValue != null) @@ -175,7 +175,7 @@ namespace Tizen.NUI.BaseComponents Tizen.NUI.Object.SetProperty(textEditor.swigCPtr, TextEditor.Property.SCROLL_SPEED, new Tizen.NUI.PropertyValue((float)newValue)); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var textEditor = (TextEditor)bindable; float temp = 0.0f; @@ -184,7 +184,7 @@ namespace Tizen.NUI.BaseComponents }); /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty PrimaryCursorColorProperty = BindableProperty.Create("PrimaryCursorColor", typeof(Vector4), typeof(TextEditor), Vector4.Zero, propertyChanged: (bindable, oldValue, newValue) => + public static readonly BindableProperty PrimaryCursorColorProperty = BindableProperty.Create(nameof(PrimaryCursorColor), typeof(Vector4), typeof(TextEditor), Vector4.Zero, propertyChanged: (bindable, oldValue, newValue) => { var textEditor = (TextEditor)bindable; if (newValue != null) @@ -192,7 +192,7 @@ namespace Tizen.NUI.BaseComponents Tizen.NUI.Object.SetProperty(textEditor.swigCPtr, TextEditor.Property.PRIMARY_CURSOR_COLOR, new Tizen.NUI.PropertyValue((Vector4)newValue)); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var textEditor = (TextEditor)bindable; Vector4 temp = new Vector4(0.0f, 0.0f, 0.0f, 0.0f); @@ -201,7 +201,7 @@ namespace Tizen.NUI.BaseComponents }); /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty SecondaryCursorColorProperty = BindableProperty.Create("SecondaryCursorColor", typeof(Vector4), typeof(TextEditor), Vector4.Zero, propertyChanged: (bindable, oldValue, newValue) => + public static readonly BindableProperty SecondaryCursorColorProperty = BindableProperty.Create(nameof(SecondaryCursorColor), typeof(Vector4), typeof(TextEditor), Vector4.Zero, propertyChanged: (bindable, oldValue, newValue) => { var textEditor = (TextEditor)bindable; if (newValue != null) @@ -209,7 +209,7 @@ namespace Tizen.NUI.BaseComponents Tizen.NUI.Object.SetProperty(textEditor.swigCPtr, TextEditor.Property.SECONDARY_CURSOR_COLOR, new Tizen.NUI.PropertyValue((Vector4)newValue)); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var textEditor = (TextEditor)bindable; Vector4 temp = new Vector4(0.0f, 0.0f, 0.0f, 0.0f); @@ -218,7 +218,7 @@ namespace Tizen.NUI.BaseComponents }); /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty EnableCursorBlinkProperty = BindableProperty.Create("EnableCursorBlink", typeof(bool), typeof(TextEditor), false, propertyChanged: (bindable, oldValue, newValue) => + public static readonly BindableProperty EnableCursorBlinkProperty = BindableProperty.Create(nameof(EnableCursorBlink), typeof(bool), typeof(TextEditor), false, propertyChanged: (bindable, oldValue, newValue) => { var textEditor = (TextEditor)bindable; if (newValue != null) @@ -226,7 +226,7 @@ namespace Tizen.NUI.BaseComponents Tizen.NUI.Object.SetProperty(textEditor.swigCPtr, TextEditor.Property.ENABLE_CURSOR_BLINK, new Tizen.NUI.PropertyValue((bool)newValue)); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var textEditor = (TextEditor)bindable; bool temp = false; @@ -235,7 +235,7 @@ namespace Tizen.NUI.BaseComponents }); /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty CursorBlinkIntervalProperty = BindableProperty.Create("CursorBlinkInterval", typeof(float), typeof(TextEditor), default(float), propertyChanged: (bindable, oldValue, newValue) => + public static readonly BindableProperty CursorBlinkIntervalProperty = BindableProperty.Create(nameof(CursorBlinkInterval), typeof(float), typeof(TextEditor), default(float), propertyChanged: (bindable, oldValue, newValue) => { var textEditor = (TextEditor)bindable; if (newValue != null) @@ -243,7 +243,7 @@ namespace Tizen.NUI.BaseComponents Tizen.NUI.Object.SetProperty(textEditor.swigCPtr, TextEditor.Property.CURSOR_BLINK_INTERVAL, new Tizen.NUI.PropertyValue((float)newValue)); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var textEditor = (TextEditor)bindable; float temp = 0.0f; @@ -252,7 +252,7 @@ namespace Tizen.NUI.BaseComponents }); /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty CursorBlinkDurationProperty = BindableProperty.Create("CursorBlinkDuration", typeof(float), typeof(TextEditor), default(float), propertyChanged: (bindable, oldValue, newValue) => + public static readonly BindableProperty CursorBlinkDurationProperty = BindableProperty.Create(nameof(CursorBlinkDuration), typeof(float), typeof(TextEditor), default(float), propertyChanged: (bindable, oldValue, newValue) => { var textEditor = (TextEditor)bindable; if (newValue != null) @@ -260,7 +260,7 @@ namespace Tizen.NUI.BaseComponents Tizen.NUI.Object.SetProperty(textEditor.swigCPtr, TextEditor.Property.CURSOR_BLINK_DURATION, new Tizen.NUI.PropertyValue((float)newValue)); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var textEditor = (TextEditor)bindable; float temp = 0.0f; @@ -269,7 +269,7 @@ namespace Tizen.NUI.BaseComponents }); /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty CursorWidthProperty = BindableProperty.Create("CursorWidth", typeof(int), typeof(TextEditor), default(int), propertyChanged: (bindable, oldValue, newValue) => + public static readonly BindableProperty CursorWidthProperty = BindableProperty.Create(nameof(CursorWidth), typeof(int), typeof(TextEditor), default(int), propertyChanged: (bindable, oldValue, newValue) => { var textEditor = (TextEditor)bindable; if (newValue != null) @@ -277,7 +277,7 @@ namespace Tizen.NUI.BaseComponents Tizen.NUI.Object.SetProperty(textEditor.swigCPtr, TextEditor.Property.CURSOR_WIDTH, new Tizen.NUI.PropertyValue((int)newValue)); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var textEditor = (TextEditor)bindable; int temp = 0; @@ -286,7 +286,7 @@ namespace Tizen.NUI.BaseComponents }); /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty GrabHandleImageProperty = BindableProperty.Create("GrabHandleImage", typeof(string), typeof(TextEditor), string.Empty, propertyChanged: (bindable, oldValue, newValue) => + public static readonly BindableProperty GrabHandleImageProperty = BindableProperty.Create(nameof(GrabHandleImage), typeof(string), typeof(TextEditor), string.Empty, propertyChanged: (bindable, oldValue, newValue) => { var textEditor = (TextEditor)bindable; if (newValue != null) @@ -294,7 +294,7 @@ namespace Tizen.NUI.BaseComponents Tizen.NUI.Object.SetProperty(textEditor.swigCPtr, TextEditor.Property.GRAB_HANDLE_IMAGE, new Tizen.NUI.PropertyValue((string)newValue)); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var textEditor = (TextEditor)bindable; string temp; @@ -303,7 +303,7 @@ namespace Tizen.NUI.BaseComponents }); /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty GrabHandlePressedImageProperty = BindableProperty.Create("GrabHandlePressedImage", typeof(string), typeof(TextEditor), string.Empty, propertyChanged: (bindable, oldValue, newValue) => + public static readonly BindableProperty GrabHandlePressedImageProperty = BindableProperty.Create(nameof(GrabHandlePressedImage), typeof(string), typeof(TextEditor), string.Empty, propertyChanged: (bindable, oldValue, newValue) => { var textEditor = (TextEditor)bindable; if (newValue != null) @@ -311,7 +311,7 @@ namespace Tizen.NUI.BaseComponents Tizen.NUI.Object.SetProperty(textEditor.swigCPtr, TextEditor.Property.GRAB_HANDLE_PRESSED_IMAGE, new Tizen.NUI.PropertyValue((string)newValue)); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var textEditor = (TextEditor)bindable; string temp; @@ -320,7 +320,7 @@ namespace Tizen.NUI.BaseComponents }); /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty SelectionHandleImageLeftProperty = BindableProperty.Create("SelectionHandleImageLeft", typeof(PropertyMap), typeof(TextEditor), new PropertyMap(), propertyChanged: (bindable, oldValue, newValue) => + public static readonly BindableProperty SelectionHandleImageLeftProperty = BindableProperty.Create(nameof(SelectionHandleImageLeft), typeof(PropertyMap), typeof(TextEditor), new PropertyMap(), propertyChanged: (bindable, oldValue, newValue) => { var textEditor = (TextEditor)bindable; if (newValue != null) @@ -328,7 +328,7 @@ namespace Tizen.NUI.BaseComponents Tizen.NUI.Object.SetProperty(textEditor.swigCPtr, TextEditor.Property.SELECTION_HANDLE_IMAGE_LEFT, new Tizen.NUI.PropertyValue((PropertyMap)newValue)); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var textEditor = (TextEditor)bindable; PropertyMap temp = new PropertyMap(); @@ -337,7 +337,7 @@ namespace Tizen.NUI.BaseComponents }); /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty SelectionHandleImageRightProperty = BindableProperty.Create("SelectionHandleImageRight", typeof(PropertyMap), typeof(TextEditor), new PropertyMap(), propertyChanged: (bindable, oldValue, newValue) => + public static readonly BindableProperty SelectionHandleImageRightProperty = BindableProperty.Create(nameof(SelectionHandleImageRight), typeof(PropertyMap), typeof(TextEditor), new PropertyMap(), propertyChanged: (bindable, oldValue, newValue) => { var textEditor = (TextEditor)bindable; if (newValue != null) @@ -345,7 +345,7 @@ namespace Tizen.NUI.BaseComponents Tizen.NUI.Object.SetProperty(textEditor.swigCPtr, TextEditor.Property.SELECTION_HANDLE_IMAGE_RIGHT, new Tizen.NUI.PropertyValue((PropertyMap)newValue)); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var textEditor = (TextEditor)bindable; PropertyMap temp = new PropertyMap(); @@ -354,7 +354,7 @@ namespace Tizen.NUI.BaseComponents }); /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty SelectionHandlePressedImageLeftProperty = BindableProperty.Create("SelectionHandlePressedImageLeft", typeof(PropertyMap), typeof(TextEditor), new PropertyMap(), propertyChanged: (bindable, oldValue, newValue) => + public static readonly BindableProperty SelectionHandlePressedImageLeftProperty = BindableProperty.Create(nameof(SelectionHandlePressedImageLeft), typeof(PropertyMap), typeof(TextEditor), new PropertyMap(), propertyChanged: (bindable, oldValue, newValue) => { var textEditor = (TextEditor)bindable; if (newValue != null) @@ -362,7 +362,7 @@ namespace Tizen.NUI.BaseComponents Tizen.NUI.Object.SetProperty(textEditor.swigCPtr, TextEditor.Property.SELECTION_HANDLE_PRESSED_IMAGE_LEFT, new Tizen.NUI.PropertyValue((PropertyMap)newValue)); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var textEditor = (TextEditor)bindable; PropertyMap temp = new PropertyMap(); @@ -371,7 +371,7 @@ namespace Tizen.NUI.BaseComponents }); /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty SelectionHandlePressedImageRightProperty = BindableProperty.Create("SelectionHandlePressedImageRight", typeof(PropertyMap), typeof(TextEditor), new PropertyMap(), propertyChanged: (bindable, oldValue, newValue) => + public static readonly BindableProperty SelectionHandlePressedImageRightProperty = BindableProperty.Create(nameof(SelectionHandlePressedImageRight), typeof(PropertyMap), typeof(TextEditor), new PropertyMap(), propertyChanged: (bindable, oldValue, newValue) => { var textEditor = (TextEditor)bindable; if (newValue != null) @@ -379,7 +379,7 @@ namespace Tizen.NUI.BaseComponents Tizen.NUI.Object.SetProperty(textEditor.swigCPtr, TextEditor.Property.SELECTION_HANDLE_PRESSED_IMAGE_RIGHT, new Tizen.NUI.PropertyValue((PropertyMap)newValue)); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var textEditor = (TextEditor)bindable; PropertyMap temp = new PropertyMap(); @@ -388,7 +388,7 @@ namespace Tizen.NUI.BaseComponents }); /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty SelectionHandleMarkerImageLeftProperty = BindableProperty.Create("SelectionHandleMarkerImageLeft", typeof(PropertyMap), typeof(TextEditor), new PropertyMap(), propertyChanged: (bindable, oldValue, newValue) => + public static readonly BindableProperty SelectionHandleMarkerImageLeftProperty = BindableProperty.Create(nameof(SelectionHandleMarkerImageLeft), typeof(PropertyMap), typeof(TextEditor), new PropertyMap(), propertyChanged: (bindable, oldValue, newValue) => { var textEditor = (TextEditor)bindable; if (newValue != null) @@ -396,7 +396,7 @@ namespace Tizen.NUI.BaseComponents Tizen.NUI.Object.SetProperty(textEditor.swigCPtr, TextEditor.Property.SELECTION_HANDLE_MARKER_IMAGE_LEFT, new Tizen.NUI.PropertyValue((PropertyMap)newValue)); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var textEditor = (TextEditor)bindable; PropertyMap temp = new PropertyMap(); @@ -405,7 +405,7 @@ namespace Tizen.NUI.BaseComponents }); /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty SelectionHandleMarkerImageRightProperty = BindableProperty.Create("SelectionHandleMarkerImageRight", typeof(PropertyMap), typeof(TextEditor), new PropertyMap(), propertyChanged: (bindable, oldValue, newValue) => + public static readonly BindableProperty SelectionHandleMarkerImageRightProperty = BindableProperty.Create(nameof(SelectionHandleMarkerImageRight), typeof(PropertyMap), typeof(TextEditor), new PropertyMap(), propertyChanged: (bindable, oldValue, newValue) => { var textEditor = (TextEditor)bindable; if (newValue != null) @@ -413,7 +413,7 @@ namespace Tizen.NUI.BaseComponents Tizen.NUI.Object.SetProperty(textEditor.swigCPtr, TextEditor.Property.SELECTION_HANDLE_MARKER_IMAGE_RIGHT, new Tizen.NUI.PropertyValue((PropertyMap)newValue)); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var textEditor = (TextEditor)bindable; PropertyMap temp = new PropertyMap(); @@ -422,7 +422,7 @@ namespace Tizen.NUI.BaseComponents }); /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty SelectionHighlightColorProperty = BindableProperty.Create("SelectionHighlightColor", typeof(Vector4), typeof(TextEditor), Vector4.Zero, propertyChanged: (bindable, oldValue, newValue) => + public static readonly BindableProperty SelectionHighlightColorProperty = BindableProperty.Create(nameof(SelectionHighlightColor), typeof(Vector4), typeof(TextEditor), Vector4.Zero, propertyChanged: (bindable, oldValue, newValue) => { var textEditor = (TextEditor)bindable; if (newValue != null) @@ -430,7 +430,7 @@ namespace Tizen.NUI.BaseComponents Tizen.NUI.Object.SetProperty(textEditor.swigCPtr, TextEditor.Property.SELECTION_HIGHLIGHT_COLOR, new Tizen.NUI.PropertyValue((Vector4)newValue)); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var textEditor = (TextEditor)bindable; Vector4 temp = new Vector4(0.0f, 0.0f, 0.0f, 0.0f); @@ -439,7 +439,7 @@ namespace Tizen.NUI.BaseComponents }); /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty DecorationBoundingBoxProperty = BindableProperty.Create("DecorationBoundingBox", typeof(Rectangle), typeof(TextEditor), new Rectangle(0,0,0,0), propertyChanged: (bindable, oldValue, newValue) => + public static readonly BindableProperty DecorationBoundingBoxProperty = BindableProperty.Create(nameof(DecorationBoundingBox), typeof(Rectangle), typeof(TextEditor), new Rectangle(0,0,0,0), propertyChanged: (bindable, oldValue, newValue) => { var textEditor = (TextEditor)bindable; if (newValue != null) @@ -447,7 +447,7 @@ namespace Tizen.NUI.BaseComponents Tizen.NUI.Object.SetProperty(textEditor.swigCPtr, TextEditor.Property.DECORATION_BOUNDING_BOX, new Tizen.NUI.PropertyValue((Rectangle)newValue)); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var textEditor = (TextEditor)bindable; Rectangle temp = new Rectangle(0, 0, 0, 0); @@ -456,7 +456,7 @@ namespace Tizen.NUI.BaseComponents }); /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty EnableMarkupProperty = BindableProperty.Create("EnableMarkup", typeof(bool), typeof(TextEditor), false, propertyChanged: (bindable, oldValue, newValue) => + public static readonly BindableProperty EnableMarkupProperty = BindableProperty.Create(nameof(EnableMarkup), typeof(bool), typeof(TextEditor), false, propertyChanged: (bindable, oldValue, newValue) => { var textEditor = (TextEditor)bindable; if (newValue != null) @@ -464,7 +464,7 @@ namespace Tizen.NUI.BaseComponents Tizen.NUI.Object.SetProperty(textEditor.swigCPtr, TextEditor.Property.ENABLE_MARKUP, new Tizen.NUI.PropertyValue((bool)newValue)); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var textEditor = (TextEditor)bindable; bool temp = false; @@ -473,7 +473,7 @@ namespace Tizen.NUI.BaseComponents }); /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty InputColorProperty = BindableProperty.Create("InputColor", typeof(Vector4), typeof(TextEditor), Vector4.Zero, propertyChanged: (bindable, oldValue, newValue) => + public static readonly BindableProperty InputColorProperty = BindableProperty.Create(nameof(InputColor), typeof(Vector4), typeof(TextEditor), Vector4.Zero, propertyChanged: (bindable, oldValue, newValue) => { var textEditor = (TextEditor)bindable; if (newValue != null) @@ -481,7 +481,7 @@ namespace Tizen.NUI.BaseComponents Tizen.NUI.Object.SetProperty(textEditor.swigCPtr, TextEditor.Property.INPUT_COLOR, new Tizen.NUI.PropertyValue((Vector4)newValue)); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var textEditor = (TextEditor)bindable; Vector4 temp = new Vector4(0.0f, 0.0f, 0.0f, 0.0f); @@ -490,7 +490,7 @@ namespace Tizen.NUI.BaseComponents }); /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty InputFontFamilyProperty = BindableProperty.Create("InputFontFamily", typeof(string), typeof(TextEditor), string.Empty, propertyChanged: (bindable, oldValue, newValue) => + public static readonly BindableProperty InputFontFamilyProperty = BindableProperty.Create(nameof(InputFontFamily), typeof(string), typeof(TextEditor), string.Empty, propertyChanged: (bindable, oldValue, newValue) => { var textEditor = (TextEditor)bindable; if (newValue != null) @@ -498,7 +498,7 @@ namespace Tizen.NUI.BaseComponents Tizen.NUI.Object.SetProperty(textEditor.swigCPtr, TextEditor.Property.INPUT_FONT_FAMILY, new Tizen.NUI.PropertyValue((string)newValue)); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var textEditor = (TextEditor)bindable; string temp; @@ -507,7 +507,7 @@ namespace Tizen.NUI.BaseComponents }); /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty InputFontStyleProperty = BindableProperty.Create("InputFontStyle", typeof(PropertyMap), typeof(TextEditor), new PropertyMap(), propertyChanged: (bindable, oldValue, newValue) => + public static readonly BindableProperty InputFontStyleProperty = BindableProperty.Create(nameof(InputFontStyle), typeof(PropertyMap), typeof(TextEditor), new PropertyMap(), propertyChanged: (bindable, oldValue, newValue) => { var textEditor = (TextEditor)bindable; if (newValue != null) @@ -515,7 +515,7 @@ namespace Tizen.NUI.BaseComponents Tizen.NUI.Object.SetProperty(textEditor.swigCPtr, TextEditor.Property.INPUT_FONT_STYLE, new Tizen.NUI.PropertyValue((PropertyMap)newValue)); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var textEditor = (TextEditor)bindable; PropertyMap temp = new PropertyMap(); @@ -524,7 +524,7 @@ namespace Tizen.NUI.BaseComponents }); /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty InputPointSizeProperty = BindableProperty.Create("InputPointSize", typeof(float), typeof(TextEditor), default(float), propertyChanged: (bindable, oldValue, newValue) => + public static readonly BindableProperty InputPointSizeProperty = BindableProperty.Create(nameof(InputPointSize), typeof(float), typeof(TextEditor), default(float), propertyChanged: (bindable, oldValue, newValue) => { var textEditor = (TextEditor)bindable; if (newValue != null) @@ -532,7 +532,7 @@ namespace Tizen.NUI.BaseComponents Tizen.NUI.Object.SetProperty(textEditor.swigCPtr, TextEditor.Property.INPUT_POINT_SIZE, new Tizen.NUI.PropertyValue((float)newValue)); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var textEditor = (TextEditor)bindable; float temp = 0.0f; @@ -541,7 +541,7 @@ namespace Tizen.NUI.BaseComponents }); /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty LineSpacingProperty = BindableProperty.Create("LineSpacing", typeof(float), typeof(TextEditor), default(float), propertyChanged: (bindable, oldValue, newValue) => + public static readonly BindableProperty LineSpacingProperty = BindableProperty.Create(nameof(LineSpacing), typeof(float), typeof(TextEditor), default(float), propertyChanged: (bindable, oldValue, newValue) => { var textEditor = (TextEditor)bindable; if (newValue != null) @@ -549,7 +549,7 @@ namespace Tizen.NUI.BaseComponents Tizen.NUI.Object.SetProperty(textEditor.swigCPtr, TextEditor.Property.LINE_SPACING, new Tizen.NUI.PropertyValue((float)newValue)); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var textEditor = (TextEditor)bindable; float temp = 0.0f; @@ -558,7 +558,7 @@ namespace Tizen.NUI.BaseComponents }); /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty InputLineSpacingProperty = BindableProperty.Create("InputLineSpacing", typeof(float), typeof(TextEditor), default(float), propertyChanged: (bindable, oldValue, newValue) => + public static readonly BindableProperty InputLineSpacingProperty = BindableProperty.Create(nameof(InputLineSpacing), typeof(float), typeof(TextEditor), default(float), propertyChanged: (bindable, oldValue, newValue) => { var textEditor = (TextEditor)bindable; if (newValue != null) @@ -566,7 +566,7 @@ namespace Tizen.NUI.BaseComponents Tizen.NUI.Object.SetProperty(textEditor.swigCPtr, TextEditor.Property.INPUT_LINE_SPACING, new Tizen.NUI.PropertyValue((float)newValue)); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var textEditor = (TextEditor)bindable; float temp = 0.0f; @@ -575,7 +575,7 @@ namespace Tizen.NUI.BaseComponents }); /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty UnderlineProperty = BindableProperty.Create("Underline", typeof(PropertyMap), typeof(TextEditor), new PropertyMap(), propertyChanged: (bindable, oldValue, newValue) => + public static readonly BindableProperty UnderlineProperty = BindableProperty.Create(nameof(Underline), typeof(PropertyMap), typeof(TextEditor), new PropertyMap(), propertyChanged: (bindable, oldValue, newValue) => { var textEditor = (TextEditor)bindable; if (newValue != null) @@ -583,7 +583,7 @@ namespace Tizen.NUI.BaseComponents Tizen.NUI.Object.SetProperty(textEditor.swigCPtr, TextEditor.Property.UNDERLINE, new Tizen.NUI.PropertyValue((PropertyMap)newValue)); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var textEditor = (TextEditor)bindable; PropertyMap temp = new PropertyMap(); @@ -592,7 +592,7 @@ namespace Tizen.NUI.BaseComponents }); /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty InputUnderlineProperty = BindableProperty.Create("InputUnderline", typeof(string), typeof(TextEditor), string.Empty, propertyChanged: (bindable, oldValue, newValue) => + public static readonly BindableProperty InputUnderlineProperty = BindableProperty.Create(nameof(InputUnderline), typeof(string), typeof(TextEditor), string.Empty, propertyChanged: (bindable, oldValue, newValue) => { var textEditor = (TextEditor)bindable; if (newValue != null) @@ -600,7 +600,7 @@ namespace Tizen.NUI.BaseComponents Tizen.NUI.Object.SetProperty(textEditor.swigCPtr, TextEditor.Property.INPUT_UNDERLINE, new Tizen.NUI.PropertyValue((string)newValue)); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var textEditor = (TextEditor)bindable; string temp; @@ -609,7 +609,7 @@ namespace Tizen.NUI.BaseComponents }); /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty ShadowProperty = BindableProperty.Create("Shadow", typeof(PropertyMap), typeof(TextEditor), new PropertyMap(), propertyChanged: (bindable, oldValue, newValue) => + public static readonly BindableProperty ShadowProperty = BindableProperty.Create(nameof(Shadow), typeof(PropertyMap), typeof(TextEditor), new PropertyMap(), propertyChanged: (bindable, oldValue, newValue) => { var textEditor = (TextEditor)bindable; if (newValue != null) @@ -617,7 +617,7 @@ namespace Tizen.NUI.BaseComponents Tizen.NUI.Object.SetProperty(textEditor.swigCPtr, TextEditor.Property.SHADOW, new Tizen.NUI.PropertyValue((PropertyMap)newValue)); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var textEditor = (TextEditor)bindable; PropertyMap temp = new PropertyMap(); @@ -626,7 +626,7 @@ namespace Tizen.NUI.BaseComponents }); /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty InputShadowProperty = BindableProperty.Create("InputShadow", typeof(string), typeof(TextEditor), string.Empty, propertyChanged: (bindable, oldValue, newValue) => + public static readonly BindableProperty InputShadowProperty = BindableProperty.Create(nameof(InputShadow), typeof(string), typeof(TextEditor), string.Empty, propertyChanged: (bindable, oldValue, newValue) => { var textEditor = (TextEditor)bindable; if (newValue != null) @@ -634,7 +634,7 @@ namespace Tizen.NUI.BaseComponents Tizen.NUI.Object.SetProperty(textEditor.swigCPtr, TextEditor.Property.INPUT_SHADOW, new Tizen.NUI.PropertyValue((string)newValue)); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var textEditor = (TextEditor)bindable; string temp; @@ -643,7 +643,7 @@ namespace Tizen.NUI.BaseComponents }); /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty EmbossProperty = BindableProperty.Create("Emboss", typeof(string), typeof(TextEditor), string.Empty, propertyChanged: (bindable, oldValue, newValue) => + public static readonly BindableProperty EmbossProperty = BindableProperty.Create(nameof(Emboss), typeof(string), typeof(TextEditor), string.Empty, propertyChanged: (bindable, oldValue, newValue) => { var textEditor = (TextEditor)bindable; if (newValue != null) @@ -651,7 +651,7 @@ namespace Tizen.NUI.BaseComponents Tizen.NUI.Object.SetProperty(textEditor.swigCPtr, TextEditor.Property.EMBOSS, new Tizen.NUI.PropertyValue((string)newValue)); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var textEditor = (TextEditor)bindable; string temp; @@ -660,7 +660,7 @@ namespace Tizen.NUI.BaseComponents }); /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty InputEmbossProperty = BindableProperty.Create("InputEmboss", typeof(string), typeof(TextEditor), string.Empty, propertyChanged: (bindable, oldValue, newValue) => + public static readonly BindableProperty InputEmbossProperty = BindableProperty.Create(nameof(InputEmboss), typeof(string), typeof(TextEditor), string.Empty, propertyChanged: (bindable, oldValue, newValue) => { var textEditor = (TextEditor)bindable; if (newValue != null) @@ -668,7 +668,7 @@ namespace Tizen.NUI.BaseComponents Tizen.NUI.Object.SetProperty(textEditor.swigCPtr, TextEditor.Property.INPUT_EMBOSS, new Tizen.NUI.PropertyValue((string)newValue)); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var textEditor = (TextEditor)bindable; string temp; @@ -677,7 +677,7 @@ namespace Tizen.NUI.BaseComponents }); /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty OutlineProperty = BindableProperty.Create("Outline", typeof(PropertyMap), typeof(TextEditor), new PropertyMap(), propertyChanged: (bindable, oldValue, newValue) => + public static readonly BindableProperty OutlineProperty = BindableProperty.Create(nameof(Outline), typeof(PropertyMap), typeof(TextEditor), new PropertyMap(), propertyChanged: (bindable, oldValue, newValue) => { var textEditor = (TextEditor)bindable; if (newValue != null) @@ -685,7 +685,7 @@ namespace Tizen.NUI.BaseComponents Tizen.NUI.Object.SetProperty(textEditor.swigCPtr, TextEditor.Property.OUTLINE, new Tizen.NUI.PropertyValue((PropertyMap)newValue)); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var textEditor = (TextEditor)bindable; PropertyMap temp = new PropertyMap(); @@ -694,7 +694,7 @@ namespace Tizen.NUI.BaseComponents }); /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty InputOutlineProperty = BindableProperty.Create("InputOutline", typeof(string), typeof(TextEditor), string.Empty, propertyChanged: (bindable, oldValue, newValue) => + public static readonly BindableProperty InputOutlineProperty = BindableProperty.Create(nameof(InputOutline), typeof(string), typeof(TextEditor), string.Empty, propertyChanged: (bindable, oldValue, newValue) => { var textEditor = (TextEditor)bindable; if (newValue != null) @@ -702,7 +702,7 @@ namespace Tizen.NUI.BaseComponents Tizen.NUI.Object.SetProperty(textEditor.swigCPtr, TextEditor.Property.INPUT_OUTLINE, new Tizen.NUI.PropertyValue((string)newValue)); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var textEditor = (TextEditor)bindable; string temp; @@ -711,7 +711,7 @@ namespace Tizen.NUI.BaseComponents }); /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty SmoothScrollProperty = BindableProperty.Create("SmoothScroll", typeof(bool), typeof(TextEditor), false, propertyChanged: (bindable, oldValue, newValue) => + public static readonly BindableProperty SmoothScrollProperty = BindableProperty.Create(nameof(SmoothScroll), typeof(bool), typeof(TextEditor), false, propertyChanged: (bindable, oldValue, newValue) => { var textEditor = (TextEditor)bindable; if (newValue != null) @@ -719,7 +719,7 @@ namespace Tizen.NUI.BaseComponents Tizen.NUI.Object.SetProperty(textEditor.swigCPtr, TextEditor.Property.SMOOTH_SCROLL, new Tizen.NUI.PropertyValue((bool)newValue)); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var textEditor = (TextEditor)bindable; bool temp = false; @@ -728,7 +728,7 @@ namespace Tizen.NUI.BaseComponents }); /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty SmoothScrollDurationProperty = BindableProperty.Create("SmoothScrollDuration", typeof(float), typeof(TextEditor), default(float), propertyChanged: (bindable, oldValue, newValue) => + public static readonly BindableProperty SmoothScrollDurationProperty = BindableProperty.Create(nameof(SmoothScrollDuration), typeof(float), typeof(TextEditor), default(float), propertyChanged: (bindable, oldValue, newValue) => { var textEditor = (TextEditor)bindable; if (newValue != null) @@ -736,7 +736,7 @@ namespace Tizen.NUI.BaseComponents Tizen.NUI.Object.SetProperty(textEditor.swigCPtr, TextEditor.Property.SMOOTH_SCROLL_DURATION, new Tizen.NUI.PropertyValue((float)newValue)); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var textEditor = (TextEditor)bindable; float temp = 0.0f; @@ -745,7 +745,7 @@ namespace Tizen.NUI.BaseComponents }); /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty EnableScrollBarProperty = BindableProperty.Create("EnableScrollBar", typeof(bool), typeof(TextEditor), false, propertyChanged: (bindable, oldValue, newValue) => + public static readonly BindableProperty EnableScrollBarProperty = BindableProperty.Create(nameof(EnableScrollBar), typeof(bool), typeof(TextEditor), false, propertyChanged: (bindable, oldValue, newValue) => { var textEditor = (TextEditor)bindable; if (newValue != null) @@ -753,7 +753,7 @@ namespace Tizen.NUI.BaseComponents Tizen.NUI.Object.SetProperty(textEditor.swigCPtr, TextEditor.Property.ENABLE_SCROLL_BAR, new Tizen.NUI.PropertyValue((bool)newValue)); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var textEditor = (TextEditor)bindable; bool temp = false; @@ -762,7 +762,7 @@ namespace Tizen.NUI.BaseComponents }); /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty ScrollBarShowDurationProperty = BindableProperty.Create("ScrollBarShowDuration", typeof(float), typeof(TextEditor), default(float), propertyChanged: (bindable, oldValue, newValue) => + public static readonly BindableProperty ScrollBarShowDurationProperty = BindableProperty.Create(nameof(ScrollBarShowDuration), typeof(float), typeof(TextEditor), default(float), propertyChanged: (bindable, oldValue, newValue) => { var textEditor = (TextEditor)bindable; if (newValue != null) @@ -770,7 +770,7 @@ namespace Tizen.NUI.BaseComponents Tizen.NUI.Object.SetProperty(textEditor.swigCPtr, TextEditor.Property.SCROLL_BAR_SHOW_DURATION, new Tizen.NUI.PropertyValue((float)newValue)); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var textEditor = (TextEditor)bindable; float temp = 0.0f; @@ -779,7 +779,7 @@ namespace Tizen.NUI.BaseComponents }); /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty ScrollBarFadeDurationProperty = BindableProperty.Create("ScrollBarFadeDuration", typeof(float), typeof(TextEditor), default(float), propertyChanged: (bindable, oldValue, newValue) => + public static readonly BindableProperty ScrollBarFadeDurationProperty = BindableProperty.Create(nameof(ScrollBarFadeDuration), typeof(float), typeof(TextEditor), default(float), propertyChanged: (bindable, oldValue, newValue) => { var textEditor = (TextEditor)bindable; if (newValue != null) @@ -787,7 +787,7 @@ namespace Tizen.NUI.BaseComponents Tizen.NUI.Object.SetProperty(textEditor.swigCPtr, TextEditor.Property.SCROLL_BAR_FADE_DURATION, new Tizen.NUI.PropertyValue((float)newValue)); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var textEditor = (TextEditor)bindable; float temp = 0.0f; @@ -796,7 +796,7 @@ namespace Tizen.NUI.BaseComponents }); /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty PixelSizeProperty = BindableProperty.Create("PixelSize", typeof(float), typeof(TextEditor), default(float), propertyChanged: (bindable, oldValue, newValue) => + public static readonly BindableProperty PixelSizeProperty = BindableProperty.Create(nameof(PixelSize), typeof(float), typeof(TextEditor), default(float), propertyChanged: (bindable, oldValue, newValue) => { var textEditor = (TextEditor)bindable; if (newValue != null) @@ -804,7 +804,7 @@ namespace Tizen.NUI.BaseComponents Tizen.NUI.Object.SetProperty(textEditor.swigCPtr, TextEditor.Property.PIXEL_SIZE, new Tizen.NUI.PropertyValue((float)newValue)); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var textEditor = (TextEditor)bindable; float temp = 0.0f; @@ -813,7 +813,7 @@ namespace Tizen.NUI.BaseComponents }); /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty PlaceholderTextProperty = BindableProperty.Create("PlaceholderText", typeof(string), typeof(TextEditor), string.Empty, propertyChanged: (bindable, oldValue, newValue) => + public static readonly BindableProperty PlaceholderTextProperty = BindableProperty.Create(nameof(PlaceholderText), typeof(string), typeof(TextEditor), string.Empty, propertyChanged: (bindable, oldValue, newValue) => { var textEditor = (TextEditor)bindable; if (newValue != null) @@ -821,7 +821,7 @@ namespace Tizen.NUI.BaseComponents Tizen.NUI.Object.SetProperty(textEditor.swigCPtr, TextEditor.Property.PLACEHOLDER_TEXT, new Tizen.NUI.PropertyValue((string)newValue)); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var textEditor = (TextEditor)bindable; string temp; @@ -830,7 +830,7 @@ namespace Tizen.NUI.BaseComponents }); /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty PlaceholderTextColorProperty = BindableProperty.Create("PlaceholderTextColor", typeof(Color), typeof(TextEditor), Color.Transparent, propertyChanged: (bindable, oldValue, newValue) => + public static readonly BindableProperty PlaceholderTextColorProperty = BindableProperty.Create(nameof(PlaceholderTextColor), typeof(Color), typeof(TextEditor), Color.Transparent, propertyChanged: (bindable, oldValue, newValue) => { var textEditor = (TextEditor)bindable; if (newValue != null) @@ -838,7 +838,7 @@ namespace Tizen.NUI.BaseComponents Tizen.NUI.Object.SetProperty(textEditor.swigCPtr, TextEditor.Property.PLACEHOLDER_TEXT_COLOR, new Tizen.NUI.PropertyValue((Color)newValue)); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var textEditor = (TextEditor)bindable; Color temp = new Color(0.0f, 0.0f, 0.0f, 0.0f); @@ -847,7 +847,7 @@ namespace Tizen.NUI.BaseComponents }); /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty EnableSelectionProperty = BindableProperty.Create("EnableSelection", typeof(bool), typeof(TextEditor), false, propertyChanged: (bindable, oldValue, newValue) => + public static readonly BindableProperty EnableSelectionProperty = BindableProperty.Create(nameof(EnableSelection), typeof(bool), typeof(TextEditor), false, propertyChanged: (bindable, oldValue, newValue) => { var textEditor = (TextEditor)bindable; if (newValue != null) @@ -855,7 +855,7 @@ namespace Tizen.NUI.BaseComponents Tizen.NUI.Object.SetProperty(textEditor.swigCPtr, TextEditor.Property.ENABLE_SELECTION, new Tizen.NUI.PropertyValue((bool)newValue)); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var textEditor = (TextEditor)bindable; bool temp = false; @@ -864,7 +864,7 @@ namespace Tizen.NUI.BaseComponents }); /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty PlaceholderProperty = BindableProperty.Create("Placeholder", typeof(PropertyMap), typeof(TextEditor), new PropertyMap(), propertyChanged: (bindable, oldValue, newValue) => + public static readonly BindableProperty PlaceholderProperty = BindableProperty.Create(nameof(Placeholder), typeof(PropertyMap), typeof(TextEditor), new PropertyMap(), propertyChanged: (bindable, oldValue, newValue) => { var textEditor = (TextEditor)bindable; if (newValue != null) @@ -872,7 +872,7 @@ namespace Tizen.NUI.BaseComponents Tizen.NUI.Object.SetProperty(textEditor.swigCPtr, TextEditor.Property.PLACEHOLDER, new Tizen.NUI.PropertyValue((PropertyMap)newValue)); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var textEditor = (TextEditor)bindable; Tizen.NUI.PropertyMap temp = new Tizen.NUI.PropertyMap(); @@ -881,7 +881,7 @@ namespace Tizen.NUI.BaseComponents }); /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty LineWrapModeProperty = BindableProperty.Create("LineWrapMode", typeof(LineWrapMode), typeof(TextEditor), LineWrapMode.Word, propertyChanged: (bindable, oldValue, newValue) => + public static readonly BindableProperty LineWrapModeProperty = BindableProperty.Create(nameof(LineWrapMode), typeof(LineWrapMode), typeof(TextEditor), LineWrapMode.Word, propertyChanged: (bindable, oldValue, newValue) => { var textEditor = (TextEditor)bindable; if (newValue != null) @@ -889,11 +889,11 @@ namespace Tizen.NUI.BaseComponents Tizen.NUI.Object.SetProperty(textEditor.swigCPtr, TextEditor.Property.LINE_WRAP_MODE, new Tizen.NUI.PropertyValue((int)newValue)); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var textEditor = (TextEditor)bindable; int temp; - if(Tizen.NUI.Object.GetProperty(textEditor.swigCPtr, TextEditor.Property.LINE_WRAP_MODE).Get(out temp) == false) + if (Tizen.NUI.Object.GetProperty(textEditor.swigCPtr, TextEditor.Property.LINE_WRAP_MODE).Get(out temp) == false) { NUILog.Error("LineWrapMode get error!"); } @@ -901,7 +901,7 @@ namespace Tizen.NUI.BaseComponents }); /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty EnableShiftSelectionProperty = BindableProperty.Create("EnableShiftSelection", typeof(bool), typeof(TextEditor), true, propertyChanged: (bindable, oldValue, newValue) => + public static readonly BindableProperty EnableShiftSelectionProperty = BindableProperty.Create(nameof(TextEditor.EnableShiftSelection), typeof(bool), typeof(TextEditor), true, propertyChanged: (bindable, oldValue, newValue) => { var textEditor = (TextEditor)bindable; if (newValue != null) @@ -909,7 +909,7 @@ namespace Tizen.NUI.BaseComponents Tizen.NUI.Object.SetProperty(textEditor.swigCPtr, TextEditor.Property.ENABLE_SHIFT_SELECTION, new Tizen.NUI.PropertyValue((bool)newValue)); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var textEditor = (TextEditor)bindable; //textEditor.mShiftSelectionFlag(true); @@ -917,6 +917,23 @@ namespace Tizen.NUI.BaseComponents Tizen.NUI.Object.GetProperty(textEditor.swigCPtr, TextEditor.Property.ENABLE_SHIFT_SELECTION).Get(out temp); return temp; }); + /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty MatchSystemLanguageDirectionProperty = BindableProperty.Create(nameof(TextEditor.MatchSystemLanguageDirection), typeof(bool), typeof(TextEditor), false, propertyChanged: (bindable, oldValue, newValue) => + { + var textEditor = (TextEditor)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty(textEditor.swigCPtr, TextEditor.Property.MATCH_SYSTEM_LANGUAGE_DIRECTION, new Tizen.NUI.PropertyValue((bool)newValue)); + } + }, + defaultValueCreator: (bindable) => + { + var textEditor = (TextEditor)bindable; + bool temp = false; + Tizen.NUI.Object.GetProperty(textEditor.swigCPtr, TextEditor.Property.MATCH_SYSTEM_LANGUAGE_DIRECTION).Get(out temp); + return (bool)temp; + }); private global::System.Runtime.InteropServices.HandleRef swigCPtr; private string textEditorTextSid = null; @@ -924,87 +941,36 @@ namespace Tizen.NUI.BaseComponents private bool systemlangTextFlag = false; private InputMethodContext inputMethodContext = null; - internal TextEditor(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.TextEditor_SWIGUpcast(cPtr), cMemoryOwn) - { - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); - } + private EventHandler _textEditorTextChangedEventHandler; + private TextChangedCallbackDelegate _textEditorTextChangedCallbackDelegate; - internal static global::System.Runtime.InteropServices.HandleRef getCPtr(TextEditor obj) - { - return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; - } + private EventHandler _textEditorScrollStateChangedEventHandler; + private ScrollStateChangedCallbackDelegate _textEditorScrollStateChangedCallbackDelegate; /// - /// Dispose. + /// Creates the TextEditor control. /// /// 3 - protected override void Dispose(DisposeTypes type) + public TextEditor() : this(NDalicPINVOKE.TextEditor_New(), true) { - if (disposed) - { - return; - } - - if(type == DisposeTypes.Explicit) - { - //Called by User - //Release your own managed resources here. - //You should release all of your own disposable objects here. - } - - //Release your own unmanaged resources here. - //You should not access any managed member here except static instance. - //because the execution order of Finalizes is non-deterministic. - - if (this.HasBody() && _textEditorTextChangedCallbackDelegate != null) - { - TextChangedSignal().Disconnect(_textEditorTextChangedCallbackDelegate); - } - - if (swigCPtr.Handle != global::System.IntPtr.Zero) - { - if (swigCMemOwn) - { - swigCMemOwn = false; - // In order to speed up IME hide, temporarily add - GetInputMethodContext()?.DestroyContext(); - NDalicPINVOKE.delete_TextEditor(swigCPtr); - } - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); - } - - base.Dispose(type); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } - /// - /// Event arguments that passed via the TextChanged signal. - /// - /// 3 - public class TextChangedEventArgs : EventArgs + internal TextEditor(TextEditor handle) : this(NDalicPINVOKE.new_TextEditor__SWIG_1(TextEditor.getCPtr(handle)), true) { - private TextEditor _textEditor; + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } - /// - /// TextEditor - is the texteditor control which has the text contents changed. - /// - /// 3 - public TextEditor TextEditor - { - get - { - return _textEditor; - } - set - { - _textEditor = value; - } - } + internal TextEditor(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.TextEditor_SWIGUpcast(cPtr), cMemoryOwn) + { + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); } [UnmanagedFunctionPointer(CallingConvention.StdCall)] private delegate void TextChangedCallbackDelegate(IntPtr textEditor); - private EventHandler _textEditorTextChangedEventHandler; - private TextChangedCallbackDelegate _textEditorTextChangedCallbackDelegate; + + [UnmanagedFunctionPointer(CallingConvention.StdCall)] + private delegate void ScrollStateChangedCallbackDelegate(IntPtr textEditor, ScrollState state); /// /// An event for the TextChanged signal which can be used to subscribe or unsubscribe the event handler @@ -1032,376 +998,122 @@ namespace Tizen.NUI.BaseComponents } } - private void OnTextChanged(IntPtr textEditor) - { - TextChangedEventArgs e = new TextChangedEventArgs(); - - // Populate all members of "e" (TextChangedEventArgs) with real data - e.TextEditor = Registry.GetManagedBaseHandleFromNativePtr(textEditor) as TextEditor; - - if (_textEditorTextChangedEventHandler != null) - { - //here we send all data to user event handlers - _textEditorTextChangedEventHandler(this, e); - } - - } - /// - /// Event arguments that passed via the ScrollStateChanged signal. + /// Event for the ScrollStateChanged signal which can be used to subscribe or unsubscribe the event handler + /// provided by the user. The ScrollStateChanged signal is emitted when the scroll state changes.
///
/// 3 - public class ScrollStateChangedEventArgs : EventArgs + public event EventHandler ScrollStateChanged { - private TextEditor _textEditor; - private ScrollState _scrollState; - - /// - /// TextEditor - is the texteditor control which has the scroll state changed. - /// - /// 3 - public TextEditor TextEditor + add { - get + if (_textEditorScrollStateChangedEventHandler == null) { - return _textEditor; + _textEditorScrollStateChangedCallbackDelegate = OnScrollStateChanged; + ScrollStateChangedSignal(this).Connect(_textEditorScrollStateChangedCallbackDelegate); } - set + _textEditorScrollStateChangedEventHandler += value; + } + remove + { + _textEditorScrollStateChangedEventHandler -= value; + if (_textEditorScrollStateChangedEventHandler == null && ScrollStateChangedSignal(this).Empty() == false) { - _textEditor = value; + ScrollStateChangedSignal(this).Disconnect(_textEditorScrollStateChangedCallbackDelegate); } } + } - /// - /// ScrollState - is the texteditor control scroll state. - /// - /// 3 - public ScrollState ScrollState + /// + /// The TranslatableText property.
+ /// The text can set the SID value.
+ ///
+ /// + /// ResourceManager about multilingual is null. + /// + /// 4 + public string TranslatableText + { + get { - get + return textEditorTextSid; + } + set + { + if (NUIApplication.MultilingualResourceManager == null) { - return _scrollState; + throw new ArgumentNullException("ResourceManager about multilingual is null"); } - set + textEditorTextSid = value; + Text = SetTranslatable(textEditorTextSid); + NotifyPropertyChanged(); + } + } + /// + /// The TranslatablePlaceholderText property.
+ /// The text can set the SID value.
+ ///
+ /// + /// ResourceManager about multilingual is null. + /// + /// 4 + public string TranslatablePlaceholderText + { + get + { + return textEditorPlaceHolderTextSid; + } + set + { + if (NUIApplication.MultilingualResourceManager == null) { - _scrollState = value; + throw new ArgumentNullException("ResourceManager about multilingual is null"); } + textEditorPlaceHolderTextSid = value; + PlaceholderText = SetTranslatable(textEditorPlaceHolderTextSid); + NotifyPropertyChanged(); } } - [UnmanagedFunctionPointer(CallingConvention.StdCall)] - private delegate void ScrollStateChangedCallbackDelegate(IntPtr textEditor, ScrollState state); - private EventHandler _textEditorScrollStateChangedEventHandler; - private ScrollStateChangedCallbackDelegate _textEditorScrollStateChangedCallbackDelegate; - /// - /// Event for the ScrollStateChanged signal which can be used to subscribe or unsubscribe the event handler - /// provided by the user. The ScrollStateChanged signal is emitted when the scroll state changes.
+ /// The Text property. ///
/// 3 - public event EventHandler ScrollStateChanged + public string Text { - add + get { - if (_textEditorScrollStateChangedEventHandler == null) - { - _textEditorScrollStateChangedCallbackDelegate = OnScrollStateChanged; - ScrollStateChangedSignal(this).Connect(_textEditorScrollStateChangedCallbackDelegate); - } - _textEditorScrollStateChangedEventHandler += value; + return (string)GetValue(TextProperty); } - remove + set { - _textEditorScrollStateChangedEventHandler -= value; - if (_textEditorScrollStateChangedEventHandler == null && ScrollStateChangedSignal(this).Empty() == false) - { - ScrollStateChangedSignal(this).Disconnect(_textEditorScrollStateChangedCallbackDelegate); - } + SetValueAndForceSendChangeSignal(TextProperty, value); + NotifyPropertyChanged(); } } - private void OnScrollStateChanged(IntPtr textEditor, ScrollState state) + /// + /// The TextColor property. + /// + /// 3 + public Vector4 TextColor { - ScrollStateChangedEventArgs e = new ScrollStateChangedEventArgs(); - - if (textEditor != global::System.IntPtr.Zero) + get { - // Populate all members of "e" (ScrollStateChangedEventArgs) with real data - e.TextEditor = Registry.GetManagedBaseHandleFromNativePtr(textEditor) as TextEditor; - e.ScrollState = state; + return (Vector4)GetValue(TextColorProperty); } - - if (_textEditorScrollStateChangedEventHandler != null) + set { - //here we send all data to user event handlers - _textEditorScrollStateChangedEventHandler(this, e); + SetValue(TextColorProperty, value); + NotifyPropertyChanged(); } } - internal new class Property - { - internal static readonly int RENDERING_BACKEND = NDalicPINVOKE.TextEditor_Property_RENDERING_BACKEND_get(); - internal static readonly int TEXT = NDalicPINVOKE.TextEditor_Property_TEXT_get(); - internal static readonly int TEXT_COLOR = NDalicPINVOKE.TextEditor_Property_TEXT_COLOR_get(); - internal static readonly int FONT_FAMILY = NDalicPINVOKE.TextEditor_Property_FONT_FAMILY_get(); - internal static readonly int FONT_STYLE = NDalicPINVOKE.TextEditor_Property_FONT_STYLE_get(); - internal static readonly int POINT_SIZE = NDalicPINVOKE.TextEditor_Property_POINT_SIZE_get(); - internal static readonly int HORIZONTAL_ALIGNMENT = NDalicPINVOKE.TextEditor_Property_HORIZONTAL_ALIGNMENT_get(); - internal static readonly int SCROLL_THRESHOLD = NDalicPINVOKE.TextEditor_Property_SCROLL_THRESHOLD_get(); - internal static readonly int SCROLL_SPEED = NDalicPINVOKE.TextEditor_Property_SCROLL_SPEED_get(); - internal static readonly int PRIMARY_CURSOR_COLOR = NDalicPINVOKE.TextEditor_Property_PRIMARY_CURSOR_COLOR_get(); - internal static readonly int SECONDARY_CURSOR_COLOR = NDalicPINVOKE.TextEditor_Property_SECONDARY_CURSOR_COLOR_get(); - internal static readonly int ENABLE_CURSOR_BLINK = NDalicPINVOKE.TextEditor_Property_ENABLE_CURSOR_BLINK_get(); - internal static readonly int CURSOR_BLINK_INTERVAL = NDalicPINVOKE.TextEditor_Property_CURSOR_BLINK_INTERVAL_get(); - internal static readonly int CURSOR_BLINK_DURATION = NDalicPINVOKE.TextEditor_Property_CURSOR_BLINK_DURATION_get(); - internal static readonly int CURSOR_WIDTH = NDalicPINVOKE.TextEditor_Property_CURSOR_WIDTH_get(); - internal static readonly int GRAB_HANDLE_IMAGE = NDalicPINVOKE.TextEditor_Property_GRAB_HANDLE_IMAGE_get(); - internal static readonly int GRAB_HANDLE_PRESSED_IMAGE = NDalicPINVOKE.TextEditor_Property_GRAB_HANDLE_PRESSED_IMAGE_get(); - internal static readonly int SELECTION_HANDLE_IMAGE_LEFT = NDalicPINVOKE.TextEditor_Property_SELECTION_HANDLE_IMAGE_LEFT_get(); - internal static readonly int SELECTION_HANDLE_IMAGE_RIGHT = NDalicPINVOKE.TextEditor_Property_SELECTION_HANDLE_IMAGE_RIGHT_get(); - internal static readonly int SELECTION_HANDLE_PRESSED_IMAGE_LEFT = NDalicPINVOKE.TextEditor_Property_SELECTION_HANDLE_PRESSED_IMAGE_LEFT_get(); - internal static readonly int SELECTION_HANDLE_PRESSED_IMAGE_RIGHT = NDalicPINVOKE.TextEditor_Property_SELECTION_HANDLE_PRESSED_IMAGE_RIGHT_get(); - internal static readonly int SELECTION_HANDLE_MARKER_IMAGE_LEFT = NDalicPINVOKE.TextEditor_Property_SELECTION_HANDLE_MARKER_IMAGE_LEFT_get(); - internal static readonly int SELECTION_HANDLE_MARKER_IMAGE_RIGHT = NDalicPINVOKE.TextEditor_Property_SELECTION_HANDLE_MARKER_IMAGE_RIGHT_get(); - internal static readonly int SELECTION_HIGHLIGHT_COLOR = NDalicPINVOKE.TextEditor_Property_SELECTION_HIGHLIGHT_COLOR_get(); - internal static readonly int DECORATION_BOUNDING_BOX = NDalicPINVOKE.TextEditor_Property_DECORATION_BOUNDING_BOX_get(); - internal static readonly int ENABLE_MARKUP = NDalicPINVOKE.TextEditor_Property_ENABLE_MARKUP_get(); - internal static readonly int INPUT_COLOR = NDalicPINVOKE.TextEditor_Property_INPUT_COLOR_get(); - internal static readonly int INPUT_FONT_FAMILY = NDalicPINVOKE.TextEditor_Property_INPUT_FONT_FAMILY_get(); - internal static readonly int INPUT_FONT_STYLE = NDalicPINVOKE.TextEditor_Property_INPUT_FONT_STYLE_get(); - internal static readonly int INPUT_POINT_SIZE = NDalicPINVOKE.TextEditor_Property_INPUT_POINT_SIZE_get(); - internal static readonly int LINE_SPACING = NDalicPINVOKE.TextEditor_Property_LINE_SPACING_get(); - internal static readonly int INPUT_LINE_SPACING = NDalicPINVOKE.TextEditor_Property_INPUT_LINE_SPACING_get(); - internal static readonly int UNDERLINE = NDalicPINVOKE.TextEditor_Property_UNDERLINE_get(); - internal static readonly int INPUT_UNDERLINE = NDalicPINVOKE.TextEditor_Property_INPUT_UNDERLINE_get(); - internal static readonly int SHADOW = NDalicPINVOKE.TextEditor_Property_SHADOW_get(); - internal static readonly int INPUT_SHADOW = NDalicPINVOKE.TextEditor_Property_INPUT_SHADOW_get(); - internal static readonly int EMBOSS = NDalicPINVOKE.TextEditor_Property_EMBOSS_get(); - internal static readonly int INPUT_EMBOSS = NDalicPINVOKE.TextEditor_Property_INPUT_EMBOSS_get(); - internal static readonly int OUTLINE = NDalicPINVOKE.TextEditor_Property_OUTLINE_get(); - internal static readonly int INPUT_OUTLINE = NDalicPINVOKE.TextEditor_Property_INPUT_OUTLINE_get(); - internal static readonly int SMOOTH_SCROLL = NDalicManualPINVOKE.TextEditor_Property_SMOOTH_SCROLL_get(); - internal static readonly int SMOOTH_SCROLL_DURATION = NDalicManualPINVOKE.TextEditor_Property_SMOOTH_SCROLL_DURATION_get(); - internal static readonly int ENABLE_SCROLL_BAR = NDalicManualPINVOKE.TextEditor_Property_ENABLE_SCROLL_BAR_get(); - internal static readonly int SCROLL_BAR_SHOW_DURATION = NDalicManualPINVOKE.TextEditor_Property_SCROLL_BAR_SHOW_DURATION_get(); - internal static readonly int SCROLL_BAR_FADE_DURATION = NDalicManualPINVOKE.TextEditor_Property_SCROLL_BAR_FADE_DURATION_get(); - internal static readonly int PIXEL_SIZE = NDalicManualPINVOKE.TextEditor_Property_PIXEL_SIZE_get(); - internal static readonly int LINE_COUNT = NDalicManualPINVOKE.TextEditor_Property_LINE_COUNT_get(); - internal static readonly int ENABLE_SELECTION = NDalicManualPINVOKE.TextEditor_Property_ENABLE_SELECTION_get(); - internal static readonly int PLACEHOLDER = NDalicManualPINVOKE.TextEditor_Property_PLACEHOLDER_get(); - internal static readonly int LINE_WRAP_MODE = NDalicManualPINVOKE.TextEditor_Property_LINE_WRAP_MODE_get(); - internal static readonly int PLACEHOLDER_TEXT = NDalicManualPINVOKE.TextEditor_Property_PLACEHOLDER_TEXT_get(); - internal static readonly int PLACEHOLDER_TEXT_COLOR = NDalicManualPINVOKE.TextEditor_Property_PLACEHOLDER_TEXT_COLOR_get(); - internal static readonly int ENABLE_SHIFT_SELECTION = NDalicManualPINVOKE.TextEditor_Property_ENABLE_SHIFT_SELECTION_get(); - } - - internal class InputStyle - { - internal enum Mask - { - None = 0x0000, - Color = 0x0001, - FontFamily = 0x0002, - PointSize = 0x0004, - FontStyle = 0x0008, - LineSpacing = 0x0010, - Underline = 0x0020, - Shadow = 0x0040, - Emboss = 0x0080, - Outline = 0x0100 - } - } - - /// - /// Creates the TextEditor control. - /// - /// 3 - public TextEditor() : this(NDalicPINVOKE.TextEditor_New(), true) - { - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - internal override bool IsCreateByXaml - { - get - { - return base.IsCreateByXaml; - } - set - { - base.IsCreateByXaml = value; - - if (value == true) - { - this.TextChanged += (obj, e) => - { - this.Text = this.Text; - }; - } - } - } - - internal TextEditor(TextEditor handle) : this(NDalicPINVOKE.new_TextEditor__SWIG_1(TextEditor.getCPtr(handle)), true) - { - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - /// - /// Get the InputMethodContext instance. - /// - /// The InputMethodContext instance. - /// 5 - public InputMethodContext GetInputMethodContext() - { - if (inputMethodContext == null) - { - /*Avoid raising InputMethodContext reference count.*/ - inputMethodContext = new InputMethodContext(NDalicPINVOKE.TextEditor_GetInputMethodContext(swigCPtr), true); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - return inputMethodContext; - } - - internal TextEditorSignal TextChangedSignal() - { - TextEditorSignal ret = new TextEditorSignal(NDalicPINVOKE.TextEditor_TextChangedSignal(swigCPtr), false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - internal ScrollStateChangedSignal ScrollStateChangedSignal(TextEditor textEditor) - { - ScrollStateChangedSignal ret = new ScrollStateChangedSignal(NDalicManualPINVOKE.TextEditor_ScrollStateChangedSignal(TextEditor.getCPtr(textEditor)), false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - internal SWIGTYPE_p_Dali__SignalT_void_fDali__Toolkit__TextEditor_Dali__Toolkit__TextEditor__InputStyle__MaskF_t InputStyleChangedSignal() - { - SWIGTYPE_p_Dali__SignalT_void_fDali__Toolkit__TextEditor_Dali__Toolkit__TextEditor__InputStyle__MaskF_t ret = new SWIGTYPE_p_Dali__SignalT_void_fDali__Toolkit__TextEditor_Dali__Toolkit__TextEditor__InputStyle__MaskF_t(NDalicPINVOKE.TextEditor_InputStyleChangedSignal(swigCPtr), false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - /// - /// The TranslatableText property.
- /// The text can set the SID value.
- ///
- /// - /// ResourceManager about multilingual is null. - /// - /// 4 - public string TranslatableText - { - get - { - return textEditorTextSid; - } - set - { - if (NUIApplication.MultilingualResourceManager == null) - { - throw new ArgumentNullException("ResourceManager about multilingual is null"); - } - textEditorTextSid = value; - Text = SetTranslatable(textEditorTextSid); - NotifyPropertyChanged(); - } - } - /// - /// The TranslatablePlaceholderText property.
- /// The text can set the SID value.
- ///
- /// - /// ResourceManager about multilingual is null. - /// - /// 4 - public string TranslatablePlaceholderText - { - get - { - return textEditorPlaceHolderTextSid; - } - set - { - if (NUIApplication.MultilingualResourceManager == null) - { - throw new ArgumentNullException("ResourceManager about multilingual is null"); - } - textEditorPlaceHolderTextSid = value; - PlaceholderText = SetTranslatable(textEditorPlaceHolderTextSid); - NotifyPropertyChanged(); - } - } - private string SetTranslatable(string textEditorSid) - { - string translatableText = null; - translatableText = NUIApplication.MultilingualResourceManager?.GetString(textEditorSid, new CultureInfo(SystemSettings.LocaleLanguage.Replace("_", "-"))); - if (translatableText != null) - { - if (systemlangTextFlag == false) - { - SystemSettings.LocaleLanguageChanged += new WeakEventHandler(SystemSettings_LocaleLanguageChanged).Handler; - systemlangTextFlag = true; - } - return translatableText; - } - else - { - translatableText = ""; - return translatableText; - } - } - private void SystemSettings_LocaleLanguageChanged(object sender, LocaleLanguageChangedEventArgs e) - { - if (textEditorTextSid != null) - { - Text = NUIApplication.MultilingualResourceManager?.GetString(textEditorTextSid, new CultureInfo(e.Value.Replace("_", "-"))); - } - if (textEditorPlaceHolderTextSid != null) - { - PlaceholderText = NUIApplication.MultilingualResourceManager?.GetString(textEditorPlaceHolderTextSid, new CultureInfo(e.Value.Replace("_", "-"))); - } - } - /// - /// The Text property. - /// - /// 3 - public string Text - { - get - { - return (string)GetValue(TextProperty); - } - set - { - SetValueAndForceSendChangeSignal(TextProperty, value); - NotifyPropertyChanged(); - } - } - - /// - /// The TextColor property. - /// - /// 3 - public Vector4 TextColor - { - get - { - return (Vector4)GetValue(TextColorProperty); - } - set - { - SetValue(TextColorProperty, value); - NotifyPropertyChanged(); - } - } - - /// - /// The FontFamily property. - /// - /// 3 - public string FontFamily + /// + /// The FontFamily property. + /// + /// 3 + public string FontFamily { get { @@ -2268,6 +1980,334 @@ namespace Tizen.NUI.BaseComponents } } - + /// + /// The text alignment to match the direction of the system language. + /// + /// 5 + /// This will be released at Tizen.NET API Level 5, so currently this would be used as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + public bool MatchSystemLanguageDirection + { + get + { + return (bool)GetValue(MatchSystemLanguageDirectionProperty); + } + set + { + SetValue(MatchSystemLanguageDirectionProperty, value); + NotifyPropertyChanged(); + } + } + + internal override bool IsCreateByXaml + { + get + { + return base.IsCreateByXaml; + } + set + { + base.IsCreateByXaml = value; + + if (value == true) + { + this.TextChanged += (obj, e) => + { + this.Text = this.Text; + }; + } + } + } + + /// + /// Get the InputMethodContext instance. + /// + /// The InputMethodContext instance. + /// 5 + public InputMethodContext GetInputMethodContext() + { + if (inputMethodContext == null) + { + /*Avoid raising InputMethodContext reference count.*/ + inputMethodContext = new InputMethodContext(NDalicPINVOKE.TextEditor_GetInputMethodContext(swigCPtr), true); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + return inputMethodContext; + } + + internal static global::System.Runtime.InteropServices.HandleRef getCPtr(TextEditor obj) + { + return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; + } + + internal TextEditorSignal TextChangedSignal() + { + TextEditorSignal ret = new TextEditorSignal(NDalicPINVOKE.TextEditor_TextChangedSignal(swigCPtr), false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + internal ScrollStateChangedSignal ScrollStateChangedSignal(TextEditor textEditor) + { + ScrollStateChangedSignal ret = new ScrollStateChangedSignal(NDalicManualPINVOKE.TextEditor_ScrollStateChangedSignal(TextEditor.getCPtr(textEditor)), false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + internal SWIGTYPE_p_Dali__SignalT_void_fDali__Toolkit__TextEditor_Dali__Toolkit__TextEditor__InputStyle__MaskF_t InputStyleChangedSignal() + { + SWIGTYPE_p_Dali__SignalT_void_fDali__Toolkit__TextEditor_Dali__Toolkit__TextEditor__InputStyle__MaskF_t ret = new SWIGTYPE_p_Dali__SignalT_void_fDali__Toolkit__TextEditor_Dali__Toolkit__TextEditor__InputStyle__MaskF_t(NDalicPINVOKE.TextEditor_InputStyleChangedSignal(swigCPtr), false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + /// + /// Dispose. + /// + /// 3 + protected override void Dispose(DisposeTypes type) + { + if (disposed) + { + return; + } + + if (type == DisposeTypes.Explicit) + { + //Called by User + //Release your own managed resources here. + //You should release all of your own disposable objects here. + } + + //Release your own unmanaged resources here. + //You should not access any managed member here except static instance. + //because the execution order of Finalizes is non-deterministic. + + if (this.HasBody() && _textEditorTextChangedCallbackDelegate != null) + { + TextChangedSignal().Disconnect(_textEditorTextChangedCallbackDelegate); + } + + if (swigCPtr.Handle != global::System.IntPtr.Zero) + { + if (swigCMemOwn) + { + swigCMemOwn = false; + // In order to speed up IME hide, temporarily add + GetInputMethodContext()?.DestroyContext(); + NDalicPINVOKE.delete_TextEditor(swigCPtr); + } + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); + } + + base.Dispose(type); + } + + private void OnTextChanged(IntPtr textEditor) + { + TextChangedEventArgs e = new TextChangedEventArgs(); + + // Populate all members of "e" (TextChangedEventArgs) with real data + e.TextEditor = Registry.GetManagedBaseHandleFromNativePtr(textEditor) as TextEditor; + + if (_textEditorTextChangedEventHandler != null) + { + //here we send all data to user event handlers + _textEditorTextChangedEventHandler(this, e); + } + + } + + private void OnScrollStateChanged(IntPtr textEditor, ScrollState state) + { + ScrollStateChangedEventArgs e = new ScrollStateChangedEventArgs(); + + if (textEditor != global::System.IntPtr.Zero) + { + // Populate all members of "e" (ScrollStateChangedEventArgs) with real data + e.TextEditor = Registry.GetManagedBaseHandleFromNativePtr(textEditor) as TextEditor; + e.ScrollState = state; + } + + if (_textEditorScrollStateChangedEventHandler != null) + { + //here we send all data to user event handlers + _textEditorScrollStateChangedEventHandler(this, e); + } + } + + private string SetTranslatable(string textEditorSid) + { + string translatableText = null; + translatableText = NUIApplication.MultilingualResourceManager?.GetString(textEditorSid, new CultureInfo(SystemSettings.LocaleLanguage.Replace("_", "-"))); + if (translatableText != null) + { + if (systemlangTextFlag == false) + { + SystemSettings.LocaleLanguageChanged += new WeakEventHandler(SystemSettings_LocaleLanguageChanged).Handler; + systemlangTextFlag = true; + } + return translatableText; + } + else + { + translatableText = ""; + return translatableText; + } + } + + private void SystemSettings_LocaleLanguageChanged(object sender, LocaleLanguageChangedEventArgs e) + { + if (textEditorTextSid != null) + { + Text = NUIApplication.MultilingualResourceManager?.GetString(textEditorTextSid, new CultureInfo(e.Value.Replace("_", "-"))); + } + if (textEditorPlaceHolderTextSid != null) + { + PlaceholderText = NUIApplication.MultilingualResourceManager?.GetString(textEditorPlaceHolderTextSid, new CultureInfo(e.Value.Replace("_", "-"))); + } + } + + /// + /// Event arguments that passed via the TextChanged signal. + /// + /// 3 + public class TextChangedEventArgs : EventArgs + { + private TextEditor _textEditor; + + /// + /// TextEditor - is the texteditor control which has the text contents changed. + /// + /// 3 + public TextEditor TextEditor + { + get + { + return _textEditor; + } + set + { + _textEditor = value; + } + } + } + + /// + /// Event arguments that passed via the ScrollStateChanged signal. + /// + /// 3 + public class ScrollStateChangedEventArgs : EventArgs + { + private TextEditor _textEditor; + private ScrollState _scrollState; + + /// + /// TextEditor - is the texteditor control which has the scroll state changed. + /// + /// 3 + public TextEditor TextEditor + { + get + { + return _textEditor; + } + set + { + _textEditor = value; + } + } + + /// + /// ScrollState - is the texteditor control scroll state. + /// + /// 3 + public ScrollState ScrollState + { + get + { + return _scrollState; + } + set + { + _scrollState = value; + } + } + } + + internal new class Property + { + internal static readonly int RENDERING_BACKEND = NDalicPINVOKE.TextEditor_Property_RENDERING_BACKEND_get(); + internal static readonly int TEXT = NDalicPINVOKE.TextEditor_Property_TEXT_get(); + internal static readonly int TEXT_COLOR = NDalicPINVOKE.TextEditor_Property_TEXT_COLOR_get(); + internal static readonly int FONT_FAMILY = NDalicPINVOKE.TextEditor_Property_FONT_FAMILY_get(); + internal static readonly int FONT_STYLE = NDalicPINVOKE.TextEditor_Property_FONT_STYLE_get(); + internal static readonly int POINT_SIZE = NDalicPINVOKE.TextEditor_Property_POINT_SIZE_get(); + internal static readonly int HORIZONTAL_ALIGNMENT = NDalicPINVOKE.TextEditor_Property_HORIZONTAL_ALIGNMENT_get(); + internal static readonly int SCROLL_THRESHOLD = NDalicPINVOKE.TextEditor_Property_SCROLL_THRESHOLD_get(); + internal static readonly int SCROLL_SPEED = NDalicPINVOKE.TextEditor_Property_SCROLL_SPEED_get(); + internal static readonly int PRIMARY_CURSOR_COLOR = NDalicPINVOKE.TextEditor_Property_PRIMARY_CURSOR_COLOR_get(); + internal static readonly int SECONDARY_CURSOR_COLOR = NDalicPINVOKE.TextEditor_Property_SECONDARY_CURSOR_COLOR_get(); + internal static readonly int ENABLE_CURSOR_BLINK = NDalicPINVOKE.TextEditor_Property_ENABLE_CURSOR_BLINK_get(); + internal static readonly int CURSOR_BLINK_INTERVAL = NDalicPINVOKE.TextEditor_Property_CURSOR_BLINK_INTERVAL_get(); + internal static readonly int CURSOR_BLINK_DURATION = NDalicPINVOKE.TextEditor_Property_CURSOR_BLINK_DURATION_get(); + internal static readonly int CURSOR_WIDTH = NDalicPINVOKE.TextEditor_Property_CURSOR_WIDTH_get(); + internal static readonly int GRAB_HANDLE_IMAGE = NDalicPINVOKE.TextEditor_Property_GRAB_HANDLE_IMAGE_get(); + internal static readonly int GRAB_HANDLE_PRESSED_IMAGE = NDalicPINVOKE.TextEditor_Property_GRAB_HANDLE_PRESSED_IMAGE_get(); + internal static readonly int SELECTION_HANDLE_IMAGE_LEFT = NDalicPINVOKE.TextEditor_Property_SELECTION_HANDLE_IMAGE_LEFT_get(); + internal static readonly int SELECTION_HANDLE_IMAGE_RIGHT = NDalicPINVOKE.TextEditor_Property_SELECTION_HANDLE_IMAGE_RIGHT_get(); + internal static readonly int SELECTION_HANDLE_PRESSED_IMAGE_LEFT = NDalicPINVOKE.TextEditor_Property_SELECTION_HANDLE_PRESSED_IMAGE_LEFT_get(); + internal static readonly int SELECTION_HANDLE_PRESSED_IMAGE_RIGHT = NDalicPINVOKE.TextEditor_Property_SELECTION_HANDLE_PRESSED_IMAGE_RIGHT_get(); + internal static readonly int SELECTION_HANDLE_MARKER_IMAGE_LEFT = NDalicPINVOKE.TextEditor_Property_SELECTION_HANDLE_MARKER_IMAGE_LEFT_get(); + internal static readonly int SELECTION_HANDLE_MARKER_IMAGE_RIGHT = NDalicPINVOKE.TextEditor_Property_SELECTION_HANDLE_MARKER_IMAGE_RIGHT_get(); + internal static readonly int SELECTION_HIGHLIGHT_COLOR = NDalicPINVOKE.TextEditor_Property_SELECTION_HIGHLIGHT_COLOR_get(); + internal static readonly int DECORATION_BOUNDING_BOX = NDalicPINVOKE.TextEditor_Property_DECORATION_BOUNDING_BOX_get(); + internal static readonly int ENABLE_MARKUP = NDalicPINVOKE.TextEditor_Property_ENABLE_MARKUP_get(); + internal static readonly int INPUT_COLOR = NDalicPINVOKE.TextEditor_Property_INPUT_COLOR_get(); + internal static readonly int INPUT_FONT_FAMILY = NDalicPINVOKE.TextEditor_Property_INPUT_FONT_FAMILY_get(); + internal static readonly int INPUT_FONT_STYLE = NDalicPINVOKE.TextEditor_Property_INPUT_FONT_STYLE_get(); + internal static readonly int INPUT_POINT_SIZE = NDalicPINVOKE.TextEditor_Property_INPUT_POINT_SIZE_get(); + internal static readonly int LINE_SPACING = NDalicPINVOKE.TextEditor_Property_LINE_SPACING_get(); + internal static readonly int INPUT_LINE_SPACING = NDalicPINVOKE.TextEditor_Property_INPUT_LINE_SPACING_get(); + internal static readonly int UNDERLINE = NDalicPINVOKE.TextEditor_Property_UNDERLINE_get(); + internal static readonly int INPUT_UNDERLINE = NDalicPINVOKE.TextEditor_Property_INPUT_UNDERLINE_get(); + internal static readonly int SHADOW = NDalicPINVOKE.TextEditor_Property_SHADOW_get(); + internal static readonly int INPUT_SHADOW = NDalicPINVOKE.TextEditor_Property_INPUT_SHADOW_get(); + internal static readonly int EMBOSS = NDalicPINVOKE.TextEditor_Property_EMBOSS_get(); + internal static readonly int INPUT_EMBOSS = NDalicPINVOKE.TextEditor_Property_INPUT_EMBOSS_get(); + internal static readonly int OUTLINE = NDalicPINVOKE.TextEditor_Property_OUTLINE_get(); + internal static readonly int INPUT_OUTLINE = NDalicPINVOKE.TextEditor_Property_INPUT_OUTLINE_get(); + internal static readonly int SMOOTH_SCROLL = NDalicManualPINVOKE.TextEditor_Property_SMOOTH_SCROLL_get(); + internal static readonly int SMOOTH_SCROLL_DURATION = NDalicManualPINVOKE.TextEditor_Property_SMOOTH_SCROLL_DURATION_get(); + internal static readonly int ENABLE_SCROLL_BAR = NDalicManualPINVOKE.TextEditor_Property_ENABLE_SCROLL_BAR_get(); + internal static readonly int SCROLL_BAR_SHOW_DURATION = NDalicManualPINVOKE.TextEditor_Property_SCROLL_BAR_SHOW_DURATION_get(); + internal static readonly int SCROLL_BAR_FADE_DURATION = NDalicManualPINVOKE.TextEditor_Property_SCROLL_BAR_FADE_DURATION_get(); + internal static readonly int PIXEL_SIZE = NDalicManualPINVOKE.TextEditor_Property_PIXEL_SIZE_get(); + internal static readonly int LINE_COUNT = NDalicManualPINVOKE.TextEditor_Property_LINE_COUNT_get(); + internal static readonly int ENABLE_SELECTION = NDalicManualPINVOKE.TextEditor_Property_ENABLE_SELECTION_get(); + internal static readonly int PLACEHOLDER = NDalicManualPINVOKE.TextEditor_Property_PLACEHOLDER_get(); + internal static readonly int LINE_WRAP_MODE = NDalicManualPINVOKE.TextEditor_Property_LINE_WRAP_MODE_get(); + internal static readonly int PLACEHOLDER_TEXT = NDalicManualPINVOKE.TextEditor_Property_PLACEHOLDER_TEXT_get(); + internal static readonly int PLACEHOLDER_TEXT_COLOR = NDalicManualPINVOKE.TextEditor_Property_PLACEHOLDER_TEXT_COLOR_get(); + internal static readonly int ENABLE_SHIFT_SELECTION = NDalicManualPINVOKE.TextEditor_Property_ENABLE_SHIFT_SELECTION_get(); + internal static readonly int MATCH_SYSTEM_LANGUAGE_DIRECTION = NDalicManualPINVOKE.TextEditor_Property_MATCH_SYSTEM_LANGUAGE_DIRECTION_get(); + } + + internal class InputStyle + { + internal enum Mask + { + None = 0x0000, + Color = 0x0001, + FontFamily = 0x0002, + PointSize = 0x0004, + FontStyle = 0x0008, + LineSpacing = 0x0010, + Underline = 0x0020, + Shadow = 0x0040, + Emboss = 0x0080, + Outline = 0x0100 + } + } } } diff --git a/src/Tizen.NUI/src/public/BaseComponents/TextField.cs b/src/Tizen.NUI/src/public/BaseComponents/TextField.cs index 1519d7f..f350233 100755 --- a/src/Tizen.NUI/src/public/BaseComponents/TextField.cs +++ b/src/Tizen.NUI/src/public/BaseComponents/TextField.cs @@ -33,7 +33,7 @@ namespace Tizen.NUI.BaseComponents { /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty TextProperty = BindableProperty.Create("Text", typeof(string), typeof(TextField), string.Empty, propertyChanged: (bindable, oldValue, newValue) => + public static readonly BindableProperty TextProperty = BindableProperty.Create(nameof(Text), typeof(string), typeof(TextField), string.Empty, propertyChanged: (bindable, oldValue, newValue) => { var textField = (TextField)bindable; if (newValue != null) @@ -41,7 +41,7 @@ namespace Tizen.NUI.BaseComponents Tizen.NUI.Object.SetProperty(textField.swigCPtr, TextField.Property.TEXT, new Tizen.NUI.PropertyValue((string)newValue)); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var textField = (TextField)bindable; string temp; @@ -50,7 +50,7 @@ namespace Tizen.NUI.BaseComponents }); /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty PlaceholderTextProperty = BindableProperty.Create("PlaceholderText", typeof(string), typeof(TextField), string.Empty, propertyChanged: (bindable, oldValue, newValue) => + public static readonly BindableProperty PlaceholderTextProperty = BindableProperty.Create(nameof(PlaceholderText), typeof(string), typeof(TextField), string.Empty, propertyChanged: (bindable, oldValue, newValue) => { var textField = (TextField)bindable; if (newValue != null) @@ -58,7 +58,7 @@ namespace Tizen.NUI.BaseComponents Tizen.NUI.Object.SetProperty(textField.swigCPtr, TextField.Property.PLACEHOLDER_TEXT, new Tizen.NUI.PropertyValue((string)newValue)); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var textField = (TextField)bindable; string temp; @@ -67,7 +67,7 @@ namespace Tizen.NUI.BaseComponents }); /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty PlaceholderTextFocusedProperty = BindableProperty.Create("PlaceholderTextFocused", typeof(string), typeof(TextField), string.Empty, propertyChanged: (bindable, oldValue, newValue) => + public static readonly BindableProperty PlaceholderTextFocusedProperty = BindableProperty.Create(nameof(PlaceholderTextFocused), typeof(string), typeof(TextField), string.Empty, propertyChanged: (bindable, oldValue, newValue) => { var textField = (TextField)bindable; if (newValue != null) @@ -75,7 +75,7 @@ namespace Tizen.NUI.BaseComponents Tizen.NUI.Object.SetProperty(textField.swigCPtr, TextField.Property.PLACEHOLDER_TEXT_FOCUSED, new Tizen.NUI.PropertyValue((string)newValue)); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var textField = (TextField)bindable; string temp; @@ -84,7 +84,7 @@ namespace Tizen.NUI.BaseComponents }); /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty FontFamilyProperty = BindableProperty.Create("FontFamily", typeof(string), typeof(TextField), string.Empty, propertyChanged: (bindable, oldValue, newValue) => + public static readonly BindableProperty FontFamilyProperty = BindableProperty.Create(nameof(FontFamily), typeof(string), typeof(TextField), string.Empty, propertyChanged: (bindable, oldValue, newValue) => { var textField = (TextField)bindable; if (newValue != null) @@ -92,7 +92,7 @@ namespace Tizen.NUI.BaseComponents Tizen.NUI.Object.SetProperty(textField.swigCPtr, TextField.Property.FONT_FAMILY, new Tizen.NUI.PropertyValue((string)newValue)); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var textField = (TextField)bindable; string temp; @@ -101,7 +101,7 @@ namespace Tizen.NUI.BaseComponents }); /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty FontStyleProperty = BindableProperty.Create("FontStyle", typeof(PropertyMap), typeof(TextField), new PropertyMap(), propertyChanged: (bindable, oldValue, newValue) => + public static readonly BindableProperty FontStyleProperty = BindableProperty.Create(nameof(FontStyle), typeof(PropertyMap), typeof(TextField), new PropertyMap(), propertyChanged: (bindable, oldValue, newValue) => { var textField = (TextField)bindable; if (newValue != null) @@ -109,7 +109,7 @@ namespace Tizen.NUI.BaseComponents Tizen.NUI.Object.SetProperty(textField.swigCPtr, TextField.Property.FONT_STYLE, new Tizen.NUI.PropertyValue((PropertyMap)newValue)); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var textField = (TextField)bindable; PropertyMap temp = new PropertyMap(); @@ -118,7 +118,7 @@ namespace Tizen.NUI.BaseComponents }); /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty PointSizeProperty = BindableProperty.Create("PointSize", typeof(float), typeof(TextField), default(float), propertyChanged: (bindable, oldValue, newValue) => + public static readonly BindableProperty PointSizeProperty = BindableProperty.Create(nameof(PointSize), typeof(float), typeof(TextField), default(float), propertyChanged: (bindable, oldValue, newValue) => { var textField = (TextField)bindable; if (newValue != null) @@ -126,7 +126,7 @@ namespace Tizen.NUI.BaseComponents Tizen.NUI.Object.SetProperty(textField.swigCPtr, TextField.Property.POINT_SIZE, new Tizen.NUI.PropertyValue((float)newValue)); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var textField = (TextField)bindable; float temp = 0.0f; @@ -135,7 +135,7 @@ namespace Tizen.NUI.BaseComponents }); /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty MaxLengthProperty = BindableProperty.Create("MaxLength", typeof(int), typeof(TextField), default(int), propertyChanged: (bindable, oldValue, newValue) => + public static readonly BindableProperty MaxLengthProperty = BindableProperty.Create(nameof(MaxLength), typeof(int), typeof(TextField), default(int), propertyChanged: (bindable, oldValue, newValue) => { var textField = (TextField)bindable; if (newValue != null) @@ -143,7 +143,7 @@ namespace Tizen.NUI.BaseComponents Tizen.NUI.Object.SetProperty(textField.swigCPtr, TextField.Property.MAX_LENGTH, new Tizen.NUI.PropertyValue((int)newValue)); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var textField = (TextField)bindable; int temp = 0; @@ -152,7 +152,7 @@ namespace Tizen.NUI.BaseComponents }); /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty ExceedPolicyProperty = BindableProperty.Create("ExceedPolicy", typeof(int), typeof(TextField), default(int), propertyChanged: (bindable, oldValue, newValue) => + public static readonly BindableProperty ExceedPolicyProperty = BindableProperty.Create(nameof(ExceedPolicy), typeof(int), typeof(TextField), default(int), propertyChanged: (bindable, oldValue, newValue) => { var textField = (TextField)bindable; if (newValue != null) @@ -160,7 +160,7 @@ namespace Tizen.NUI.BaseComponents Tizen.NUI.Object.SetProperty(textField.swigCPtr, TextField.Property.EXCEED_POLICY, new Tizen.NUI.PropertyValue((int)newValue)); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var textField = (TextField)bindable; int temp = 0; @@ -169,7 +169,7 @@ namespace Tizen.NUI.BaseComponents }); /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty HorizontalAlignmentProperty = BindableProperty.Create("HorizontalAlignment", typeof(HorizontalAlignment), typeof(TextField), HorizontalAlignment.Begin, propertyChanged: (bindable, oldValue, newValue) => + public static readonly BindableProperty HorizontalAlignmentProperty = BindableProperty.Create(nameof(HorizontalAlignment), typeof(HorizontalAlignment), typeof(TextField), HorizontalAlignment.Begin, propertyChanged: (bindable, oldValue, newValue) => { var textField = (TextField)bindable; if (newValue != null) @@ -177,7 +177,7 @@ namespace Tizen.NUI.BaseComponents Tizen.NUI.Object.SetProperty(textField.swigCPtr, TextField.Property.HORIZONTAL_ALIGNMENT, new Tizen.NUI.PropertyValue((int)newValue)); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var textField = (TextField)bindable; string temp; @@ -188,15 +188,15 @@ namespace Tizen.NUI.BaseComponents switch (temp) { - case "BEGIN": return HorizontalAlignment.Begin; - case "CENTER": return HorizontalAlignment.Center; - case "END": return HorizontalAlignment.End; - default: return HorizontalAlignment.Begin; + case "BEGIN": return HorizontalAlignment.Begin; + case "CENTER": return HorizontalAlignment.Center; + case "END": return HorizontalAlignment.End; + default: return HorizontalAlignment.Begin; } }); /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty VerticalAlignmentProperty = BindableProperty.Create("VerticalAlignment", typeof(VerticalAlignment), typeof(TextField), VerticalAlignment.Bottom, propertyChanged: (bindable, oldValue, newValue) => + public static readonly BindableProperty VerticalAlignmentProperty = BindableProperty.Create(nameof(TextField.VerticalAlignment), typeof(VerticalAlignment), typeof(TextField), VerticalAlignment.Bottom, propertyChanged: (bindable, oldValue, newValue) => { var textField = (TextField)bindable; if (newValue != null) @@ -204,7 +204,7 @@ namespace Tizen.NUI.BaseComponents Tizen.NUI.Object.SetProperty(textField.swigCPtr, TextField.Property.VERTICAL_ALIGNMENT, new Tizen.NUI.PropertyValue((int)newValue)); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var textField = (TextField)bindable; string temp; @@ -223,7 +223,7 @@ namespace Tizen.NUI.BaseComponents }); /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty TextColorProperty = BindableProperty.Create("TextColor", typeof(Color), typeof(TextField), Color.Transparent, propertyChanged: (bindable, oldValue, newValue) => + public static readonly BindableProperty TextColorProperty = BindableProperty.Create(nameof(TextField.TextColor), typeof(Color), typeof(TextField), Color.Transparent, propertyChanged: (bindable, oldValue, newValue) => { var textField = (TextField)bindable; if (newValue != null) @@ -231,7 +231,7 @@ namespace Tizen.NUI.BaseComponents Tizen.NUI.Object.SetProperty(textField.swigCPtr, TextField.Property.TEXT_COLOR, new Tizen.NUI.PropertyValue((Color)newValue)); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var textField = (TextField)bindable; Color temp = new Color(0.0f, 0.0f, 0.0f, 0.0f); @@ -240,7 +240,7 @@ namespace Tizen.NUI.BaseComponents }); /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty PlaceholderTextColorProperty = BindableProperty.Create("PlaceholderTextColor", typeof(Vector4), typeof(TextField), Vector4.Zero, propertyChanged: (bindable, oldValue, newValue) => + public static readonly BindableProperty PlaceholderTextColorProperty = BindableProperty.Create(nameof(TextField.PlaceholderTextColor), typeof(Vector4), typeof(TextField), Vector4.Zero, propertyChanged: (bindable, oldValue, newValue) => { var textField = (TextField)bindable; if (newValue != null) @@ -248,7 +248,7 @@ namespace Tizen.NUI.BaseComponents Tizen.NUI.Object.SetProperty(textField.swigCPtr, TextField.Property.PLACEHOLDER_TEXT_COLOR, new Tizen.NUI.PropertyValue((Vector4)newValue)); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var textField = (TextField)bindable; Vector4 temp = new Vector4(0.0f, 0.0f, 0.0f, 0.0f); @@ -257,40 +257,6 @@ namespace Tizen.NUI.BaseComponents }); /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty ShadowOffsetProperty = BindableProperty.Create("ShadowOffset", typeof(Vector2), typeof(TextField), Vector2.Zero, propertyChanged: (bindable, oldValue, newValue) => - { - var textField = (TextField)bindable; - if (newValue != null) - { - Tizen.NUI.Object.SetProperty(textField.swigCPtr, TextField.Property.SHADOW_OFFSET, new Tizen.NUI.PropertyValue((Vector2)newValue)); - } - }, - defaultValueCreator:(bindable) => - { - var textField = (TextField)bindable; - Vector2 temp = new Vector2(0.0f, 0.0f); - Tizen.NUI.Object.GetProperty(textField.swigCPtr, TextField.Property.SHADOW_OFFSET).Get(temp); - return temp; - }); - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty ShadowColorProperty = BindableProperty.Create("ShadowColor", typeof(Vector4), typeof(TextField), Vector4.Zero, propertyChanged: (bindable, oldValue, newValue) => - { - var textField = (TextField)bindable; - if (newValue != null) - { - Tizen.NUI.Object.SetProperty(textField.swigCPtr, TextField.Property.SHADOW_COLOR, new Tizen.NUI.PropertyValue((Vector4)newValue)); - } - }, - defaultValueCreator:(bindable) => - { - var textField = (TextField)bindable; - Vector4 temp = new Vector4(0.0f, 0.0f, 0.0f, 0.0f); - Tizen.NUI.Object.GetProperty(textField.swigCPtr, TextField.Property.SHADOW_COLOR).Get(temp); - return temp; - }); - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] public static readonly BindableProperty PrimaryCursorColorProperty = BindableProperty.Create("PrimaryCursorColor", typeof(Vector4), typeof(TextField), Vector4.Zero, propertyChanged: (bindable, oldValue, newValue) => { var textField = (TextField)bindable; @@ -299,7 +265,7 @@ namespace Tizen.NUI.BaseComponents Tizen.NUI.Object.SetProperty(textField.swigCPtr, TextField.Property.PRIMARY_CURSOR_COLOR, new Tizen.NUI.PropertyValue((Vector4)newValue)); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var textField = (TextField)bindable; Vector4 temp = new Vector4(0.0f, 0.0f, 0.0f, 0.0f); @@ -308,7 +274,7 @@ namespace Tizen.NUI.BaseComponents }); /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty SecondaryCursorColorProperty = BindableProperty.Create("SecondaryCursorColor", typeof(Vector4), typeof(TextField), Vector4.Zero, propertyChanged: (bindable, oldValue, newValue) => + public static readonly BindableProperty SecondaryCursorColorProperty = BindableProperty.Create(nameof(TextField.SecondaryCursorColor), typeof(Vector4), typeof(TextField), Vector4.Zero, propertyChanged: (bindable, oldValue, newValue) => { var textField = (TextField)bindable; if (newValue != null) @@ -316,7 +282,7 @@ namespace Tizen.NUI.BaseComponents Tizen.NUI.Object.SetProperty(textField.swigCPtr, TextField.Property.SECONDARY_CURSOR_COLOR, new Tizen.NUI.PropertyValue((Vector4)newValue)); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var textField = (TextField)bindable; Vector4 temp = new Vector4(0.0f, 0.0f, 0.0f, 0.0f); @@ -325,7 +291,7 @@ namespace Tizen.NUI.BaseComponents }); /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty EnableCursorBlinkProperty = BindableProperty.Create("EnableCursorBlink", typeof(bool), typeof(TextField), false, propertyChanged: (bindable, oldValue, newValue) => + public static readonly BindableProperty EnableCursorBlinkProperty = BindableProperty.Create(nameof(TextField.EnableCursorBlink), typeof(bool), typeof(TextField), false, propertyChanged: (bindable, oldValue, newValue) => { var textField = (TextField)bindable; if (newValue != null) @@ -333,7 +299,7 @@ namespace Tizen.NUI.BaseComponents Tizen.NUI.Object.SetProperty(textField.swigCPtr, TextField.Property.ENABLE_CURSOR_BLINK, new Tizen.NUI.PropertyValue((bool)newValue)); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var textField = (TextField)bindable; bool temp = false; @@ -342,7 +308,7 @@ namespace Tizen.NUI.BaseComponents }); /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty CursorBlinkIntervalProperty = BindableProperty.Create("CursorBlinkInterval", typeof(float), typeof(TextField), default(float), propertyChanged: (bindable, oldValue, newValue) => + public static readonly BindableProperty CursorBlinkIntervalProperty = BindableProperty.Create(nameof(TextField.CursorBlinkInterval), typeof(float), typeof(TextField), default(float), propertyChanged: (bindable, oldValue, newValue) => { var textField = (TextField)bindable; if (newValue != null) @@ -350,7 +316,7 @@ namespace Tizen.NUI.BaseComponents Tizen.NUI.Object.SetProperty(textField.swigCPtr, TextField.Property.CURSOR_BLINK_INTERVAL, new Tizen.NUI.PropertyValue((float)newValue)); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var textField = (TextField)bindable; float temp = 0.0f; @@ -359,7 +325,7 @@ namespace Tizen.NUI.BaseComponents }); /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty CursorBlinkDurationProperty = BindableProperty.Create("CursorBlinkDuration", typeof(float), typeof(TextField), default(float), propertyChanged: (bindable, oldValue, newValue) => + public static readonly BindableProperty CursorBlinkDurationProperty = BindableProperty.Create(nameof(TextField.CursorBlinkDuration), typeof(float), typeof(TextField), default(float), propertyChanged: (bindable, oldValue, newValue) => { var textField = (TextField)bindable; if (newValue != null) @@ -367,7 +333,7 @@ namespace Tizen.NUI.BaseComponents Tizen.NUI.Object.SetProperty(textField.swigCPtr, TextField.Property.CURSOR_BLINK_DURATION, new Tizen.NUI.PropertyValue((float)newValue)); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var textField = (TextField)bindable; float temp = 0.0f; @@ -376,7 +342,7 @@ namespace Tizen.NUI.BaseComponents }); /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty CursorWidthProperty = BindableProperty.Create("CursorWidth", typeof(int), typeof(TextField), default(int), propertyChanged: (bindable, oldValue, newValue) => + public static readonly BindableProperty CursorWidthProperty = BindableProperty.Create(nameof(TextField.CursorWidth), typeof(int), typeof(TextField), default(int), propertyChanged: (bindable, oldValue, newValue) => { var textField = (TextField)bindable; if (newValue != null) @@ -384,7 +350,7 @@ namespace Tizen.NUI.BaseComponents Tizen.NUI.Object.SetProperty(textField.swigCPtr, TextField.Property.CURSOR_WIDTH, new Tizen.NUI.PropertyValue((int)newValue)); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var textField = (TextField)bindable; int temp = 0; @@ -393,7 +359,7 @@ namespace Tizen.NUI.BaseComponents }); /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty GrabHandleImageProperty = BindableProperty.Create("GrabHandleImage", typeof(string), typeof(TextField), string.Empty, propertyChanged: (bindable, oldValue, newValue) => + public static readonly BindableProperty GrabHandleImageProperty = BindableProperty.Create(nameof(TextField.GrabHandleImage), typeof(string), typeof(TextField), string.Empty, propertyChanged: (bindable, oldValue, newValue) => { var textField = (TextField)bindable; if (newValue != null) @@ -401,7 +367,7 @@ namespace Tizen.NUI.BaseComponents Tizen.NUI.Object.SetProperty(textField.swigCPtr, TextField.Property.GRAB_HANDLE_IMAGE, new Tizen.NUI.PropertyValue((string)newValue)); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var textField = (TextField)bindable; string temp; @@ -410,7 +376,7 @@ namespace Tizen.NUI.BaseComponents }); /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty GrabHandlePressedImageProperty = BindableProperty.Create("GrabHandlePressedImage", typeof(string), typeof(TextField), string.Empty, propertyChanged: (bindable, oldValue, newValue) => + public static readonly BindableProperty GrabHandlePressedImageProperty = BindableProperty.Create(nameof(TextField.GrabHandlePressedImage), typeof(string), typeof(TextField), string.Empty, propertyChanged: (bindable, oldValue, newValue) => { var textField = (TextField)bindable; if (newValue != null) @@ -418,7 +384,7 @@ namespace Tizen.NUI.BaseComponents Tizen.NUI.Object.SetProperty(textField.swigCPtr, TextField.Property.GRAB_HANDLE_PRESSED_IMAGE, new Tizen.NUI.PropertyValue((string)newValue)); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var textField = (TextField)bindable; string temp; @@ -427,7 +393,7 @@ namespace Tizen.NUI.BaseComponents }); /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty ScrollThresholdProperty = BindableProperty.Create("ScrollThreshold", typeof(float), typeof(TextField), default(float), propertyChanged: (bindable, oldValue, newValue) => + public static readonly BindableProperty ScrollThresholdProperty = BindableProperty.Create(nameof(TextField.ScrollThreshold), typeof(float), typeof(TextField), default(float), propertyChanged: (bindable, oldValue, newValue) => { var textField = (TextField)bindable; if (newValue != null) @@ -435,7 +401,7 @@ namespace Tizen.NUI.BaseComponents Tizen.NUI.Object.SetProperty(textField.swigCPtr, TextField.Property.SCROLL_THRESHOLD, new Tizen.NUI.PropertyValue((float)newValue)); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var textField = (TextField)bindable; float temp = 0.0f; @@ -444,7 +410,7 @@ namespace Tizen.NUI.BaseComponents }); /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty ScrollSpeedProperty = BindableProperty.Create("ScrollSpeed", typeof(float), typeof(TextField), default(float), propertyChanged: (bindable, oldValue, newValue) => + public static readonly BindableProperty ScrollSpeedProperty = BindableProperty.Create(nameof(TextField.ScrollSpeed), typeof(float), typeof(TextField), default(float), propertyChanged: (bindable, oldValue, newValue) => { var textField = (TextField)bindable; if (newValue != null) @@ -452,7 +418,7 @@ namespace Tizen.NUI.BaseComponents Tizen.NUI.Object.SetProperty(textField.swigCPtr, TextField.Property.SCROLL_SPEED, new Tizen.NUI.PropertyValue((float)newValue)); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var textField = (TextField)bindable; float temp = 0.0f; @@ -461,7 +427,7 @@ namespace Tizen.NUI.BaseComponents }); /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty SelectionHandleImageLeftProperty = BindableProperty.Create("SelectionHandleImageLeft", typeof(PropertyMap), typeof(TextField), new PropertyMap(), propertyChanged: (bindable, oldValue, newValue) => + public static readonly BindableProperty SelectionHandleImageLeftProperty = BindableProperty.Create(nameof(TextField.SelectionHandleImageLeft), typeof(PropertyMap), typeof(TextField), new PropertyMap(), propertyChanged: (bindable, oldValue, newValue) => { var textField = (TextField)bindable; if (newValue != null) @@ -469,7 +435,7 @@ namespace Tizen.NUI.BaseComponents Tizen.NUI.Object.SetProperty(textField.swigCPtr, TextField.Property.SELECTION_HANDLE_IMAGE_LEFT, new Tizen.NUI.PropertyValue((PropertyMap)newValue)); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var textField = (TextField)bindable; PropertyMap temp = new PropertyMap(); @@ -478,7 +444,7 @@ namespace Tizen.NUI.BaseComponents }); /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty SelectionHandleImageRightProperty = BindableProperty.Create("SelectionHandleImageRight", typeof(PropertyMap), typeof(TextField), new PropertyMap(), propertyChanged: (bindable, oldValue, newValue) => + public static readonly BindableProperty SelectionHandleImageRightProperty = BindableProperty.Create(nameof(TextField.SelectionHandleImageLeft), typeof(PropertyMap), typeof(TextField), new PropertyMap(), propertyChanged: (bindable, oldValue, newValue) => { var textField = (TextField)bindable; if (newValue != null) @@ -486,7 +452,7 @@ namespace Tizen.NUI.BaseComponents Tizen.NUI.Object.SetProperty(textField.swigCPtr, TextField.Property.SELECTION_HANDLE_IMAGE_RIGHT, new Tizen.NUI.PropertyValue((PropertyMap)newValue)); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var textField = (TextField)bindable; PropertyMap temp = new PropertyMap(); @@ -495,7 +461,7 @@ namespace Tizen.NUI.BaseComponents }); /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty SelectionHandlePressedImageLeftProperty = BindableProperty.Create("SelectionHandlePressedImageLeft", typeof(PropertyMap), typeof(TextField), new PropertyMap(), propertyChanged: (bindable, oldValue, newValue) => + public static readonly BindableProperty SelectionHandlePressedImageLeftProperty = BindableProperty.Create(nameof(TextField.SelectionHandlePressedImageLeft), typeof(PropertyMap), typeof(TextField), new PropertyMap(), propertyChanged: (bindable, oldValue, newValue) => { var textField = (TextField)bindable; if (newValue != null) @@ -503,7 +469,7 @@ namespace Tizen.NUI.BaseComponents Tizen.NUI.Object.SetProperty(textField.swigCPtr, TextField.Property.SELECTION_HANDLE_PRESSED_IMAGE_LEFT, new Tizen.NUI.PropertyValue((PropertyMap)newValue)); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var textField = (TextField)bindable; PropertyMap temp = new PropertyMap(); @@ -512,7 +478,7 @@ namespace Tizen.NUI.BaseComponents }); /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty SelectionHandlePressedImageRightProperty = BindableProperty.Create("SelectionHandlePressedImageRight", typeof(PropertyMap), typeof(TextField), new PropertyMap(), propertyChanged: (bindable, oldValue, newValue) => + public static readonly BindableProperty SelectionHandlePressedImageRightProperty = BindableProperty.Create(nameof(TextField.SelectionHandlePressedImageRight), typeof(PropertyMap), typeof(TextField), new PropertyMap(), propertyChanged: (bindable, oldValue, newValue) => { var textField = (TextField)bindable; if (newValue != null) @@ -520,7 +486,7 @@ namespace Tizen.NUI.BaseComponents Tizen.NUI.Object.SetProperty(textField.swigCPtr, TextField.Property.SELECTION_HANDLE_PRESSED_IMAGE_RIGHT, new Tizen.NUI.PropertyValue((PropertyMap)newValue)); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var textField = (TextField)bindable; PropertyMap temp = new PropertyMap(); @@ -529,7 +495,7 @@ namespace Tizen.NUI.BaseComponents }); /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty SelectionHandleMarkerImageLeftProperty = BindableProperty.Create("SelectionHandleMarkerImageLeft", typeof(PropertyMap), typeof(TextField), new PropertyMap(), propertyChanged: (bindable, oldValue, newValue) => + public static readonly BindableProperty SelectionHandleMarkerImageLeftProperty = BindableProperty.Create(nameof(TextField.SelectionHandleMarkerImageLeft), typeof(PropertyMap), typeof(TextField), new PropertyMap(), propertyChanged: (bindable, oldValue, newValue) => { var textField = (TextField)bindable; if (newValue != null) @@ -537,7 +503,7 @@ namespace Tizen.NUI.BaseComponents Tizen.NUI.Object.SetProperty(textField.swigCPtr, TextField.Property.SELECTION_HANDLE_MARKER_IMAGE_LEFT, new Tizen.NUI.PropertyValue((PropertyMap)newValue)); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var textField = (TextField)bindable; PropertyMap temp = new PropertyMap(); @@ -546,7 +512,7 @@ namespace Tizen.NUI.BaseComponents }); /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty SelectionHandleMarkerImageRightProperty = BindableProperty.Create("SelectionHandleMarkerImageRight", typeof(PropertyMap), typeof(TextField), new PropertyMap(), propertyChanged: (bindable, oldValue, newValue) => + public static readonly BindableProperty SelectionHandleMarkerImageRightProperty = BindableProperty.Create(nameof(TextField.SelectionHandleMarkerImageRight), typeof(PropertyMap), typeof(TextField), new PropertyMap(), propertyChanged: (bindable, oldValue, newValue) => { var textField = (TextField)bindable; if (newValue != null) @@ -554,7 +520,7 @@ namespace Tizen.NUI.BaseComponents Tizen.NUI.Object.SetProperty(textField.swigCPtr, TextField.Property.SELECTION_HANDLE_MARKER_IMAGE_RIGHT, new Tizen.NUI.PropertyValue((PropertyMap)newValue)); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var textField = (TextField)bindable; PropertyMap temp = new PropertyMap(); @@ -563,7 +529,7 @@ namespace Tizen.NUI.BaseComponents }); /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty SelectionHighlightColorProperty = BindableProperty.Create("SelectionHighlightColor", typeof(Vector4), typeof(TextField), Vector4.Zero, propertyChanged: (bindable, oldValue, newValue) => + public static readonly BindableProperty SelectionHighlightColorProperty = BindableProperty.Create(nameof(TextField.SelectionHighlightColor), typeof(Vector4), typeof(TextField), Vector4.Zero, propertyChanged: (bindable, oldValue, newValue) => { var textField = (TextField)bindable; if (newValue != null) @@ -571,7 +537,7 @@ namespace Tizen.NUI.BaseComponents Tizen.NUI.Object.SetProperty(textField.swigCPtr, TextField.Property.SELECTION_HIGHLIGHT_COLOR, new Tizen.NUI.PropertyValue((Vector4)newValue)); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var textField = (TextField)bindable; Vector4 temp = new Vector4(0.0f, 0.0f, 0.0f, 0.0f); @@ -580,7 +546,7 @@ namespace Tizen.NUI.BaseComponents }); /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty DecorationBoundingBoxProperty = BindableProperty.Create("DecorationBoundingBox", typeof(Rectangle), typeof(TextField), new Rectangle(0,0,0,0), propertyChanged: (bindable, oldValue, newValue) => + public static readonly BindableProperty DecorationBoundingBoxProperty = BindableProperty.Create(nameof(TextField.DecorationBoundingBox), typeof(Rectangle), typeof(TextField), new Rectangle(0,0,0,0), propertyChanged: (bindable, oldValue, newValue) => { var textField = (TextField)bindable; if (newValue != null) @@ -588,7 +554,7 @@ namespace Tizen.NUI.BaseComponents Tizen.NUI.Object.SetProperty(textField.swigCPtr, TextField.Property.DECORATION_BOUNDING_BOX, new Tizen.NUI.PropertyValue((Rectangle)newValue)); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var textField = (TextField)bindable; Rectangle temp = new Rectangle(0, 0, 0, 0); @@ -597,7 +563,7 @@ namespace Tizen.NUI.BaseComponents }); /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty InputMethodSettingsProperty = BindableProperty.Create("InputMethodSettings", typeof(PropertyMap), typeof(TextField), new PropertyMap(), propertyChanged: (bindable, oldValue, newValue) => + public static readonly BindableProperty InputMethodSettingsProperty = BindableProperty.Create(nameof(TextField.InputMethodSettings), typeof(PropertyMap), typeof(TextField), new PropertyMap(), propertyChanged: (bindable, oldValue, newValue) => { var textField = (TextField)bindable; if (newValue != null) @@ -605,7 +571,7 @@ namespace Tizen.NUI.BaseComponents Tizen.NUI.Object.SetProperty(textField.swigCPtr, TextField.Property.INPUT_METHOD_SETTINGS, new Tizen.NUI.PropertyValue((PropertyMap)newValue)); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var textField = (TextField)bindable; PropertyMap temp = new PropertyMap(); @@ -614,7 +580,7 @@ namespace Tizen.NUI.BaseComponents }); /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty InputColorProperty = BindableProperty.Create("InputColor", typeof(Vector4), typeof(TextField), Vector4.Zero, propertyChanged: (bindable, oldValue, newValue) => + public static readonly BindableProperty InputColorProperty = BindableProperty.Create(nameof(TextField.InputColor), typeof(Vector4), typeof(TextField), Vector4.Zero, propertyChanged: (bindable, oldValue, newValue) => { var textField = (TextField)bindable; if (newValue != null) @@ -622,7 +588,7 @@ namespace Tizen.NUI.BaseComponents Tizen.NUI.Object.SetProperty(textField.swigCPtr, TextField.Property.INPUT_COLOR, new Tizen.NUI.PropertyValue((Vector4)newValue)); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var textField = (TextField)bindable; Vector4 temp = new Vector4(0.0f, 0.0f, 0.0f, 0.0f); @@ -631,7 +597,7 @@ namespace Tizen.NUI.BaseComponents }); /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty EnableMarkupProperty = BindableProperty.Create("EnableMarkup", typeof(bool), typeof(TextField), false, propertyChanged: (bindable, oldValue, newValue) => + public static readonly BindableProperty EnableMarkupProperty = BindableProperty.Create(nameof(TextField.EnableMarkup), typeof(bool), typeof(TextField), false, propertyChanged: (bindable, oldValue, newValue) => { var textField = (TextField)bindable; if (newValue != null) @@ -639,7 +605,7 @@ namespace Tizen.NUI.BaseComponents Tizen.NUI.Object.SetProperty(textField.swigCPtr, TextField.Property.ENABLE_MARKUP, new Tizen.NUI.PropertyValue((bool)newValue)); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var textField = (TextField)bindable; bool temp = false; @@ -648,7 +614,7 @@ namespace Tizen.NUI.BaseComponents }); /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty InputFontFamilyProperty = BindableProperty.Create("InputFontFamily", typeof(string), typeof(TextField), string.Empty, propertyChanged: (bindable, oldValue, newValue) => + public static readonly BindableProperty InputFontFamilyProperty = BindableProperty.Create(nameof(TextField.InputFontFamily), typeof(string), typeof(TextField), string.Empty, propertyChanged: (bindable, oldValue, newValue) => { var textField = (TextField)bindable; if (newValue != null) @@ -656,7 +622,7 @@ namespace Tizen.NUI.BaseComponents Tizen.NUI.Object.SetProperty(textField.swigCPtr, TextField.Property.INPUT_FONT_FAMILY, new Tizen.NUI.PropertyValue((string)newValue)); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var textField = (TextField)bindable; string temp; @@ -665,7 +631,7 @@ namespace Tizen.NUI.BaseComponents }); /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty InputFontStyleProperty = BindableProperty.Create("InputFontStyle", typeof(PropertyMap), typeof(TextField), new PropertyMap(), propertyChanged: (bindable, oldValue, newValue) => + public static readonly BindableProperty InputFontStyleProperty = BindableProperty.Create(nameof(TextField.InputFontStyle), typeof(PropertyMap), typeof(TextField), new PropertyMap(), propertyChanged: (bindable, oldValue, newValue) => { var textField = (TextField)bindable; if (newValue != null) @@ -673,7 +639,7 @@ namespace Tizen.NUI.BaseComponents Tizen.NUI.Object.SetProperty(textField.swigCPtr, TextField.Property.INPUT_FONT_STYLE, new Tizen.NUI.PropertyValue((PropertyMap)newValue)); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var textField = (TextField)bindable; PropertyMap temp = new PropertyMap(); @@ -682,7 +648,7 @@ namespace Tizen.NUI.BaseComponents }); /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty InputPointSizeProperty = BindableProperty.Create("InputPointSize", typeof(float), typeof(TextField), default(float), propertyChanged: (bindable, oldValue, newValue) => + public static readonly BindableProperty InputPointSizeProperty = BindableProperty.Create(nameof(TextField.InputPointSize), typeof(float), typeof(TextField), default(float), propertyChanged: (bindable, oldValue, newValue) => { var textField = (TextField)bindable; if (newValue != null) @@ -690,7 +656,7 @@ namespace Tizen.NUI.BaseComponents Tizen.NUI.Object.SetProperty(textField.swigCPtr, TextField.Property.INPUT_POINT_SIZE, new Tizen.NUI.PropertyValue((float)newValue)); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var textField = (TextField)bindable; float temp = 0.0f; @@ -699,7 +665,7 @@ namespace Tizen.NUI.BaseComponents }); /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty UnderlineProperty = BindableProperty.Create("Underline", typeof(PropertyMap), typeof(TextField), new PropertyMap(), propertyChanged: (bindable, oldValue, newValue) => + public static readonly BindableProperty UnderlineProperty = BindableProperty.Create(nameof(TextField.Underline), typeof(PropertyMap), typeof(TextField), new PropertyMap(), propertyChanged: (bindable, oldValue, newValue) => { var textField = (TextField)bindable; if (newValue != null) @@ -707,7 +673,7 @@ namespace Tizen.NUI.BaseComponents Tizen.NUI.Object.SetProperty(textField.swigCPtr, TextField.Property.UNDERLINE, new Tizen.NUI.PropertyValue((PropertyMap)newValue)); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var textField = (TextField)bindable; PropertyMap temp = new PropertyMap(); @@ -716,7 +682,7 @@ namespace Tizen.NUI.BaseComponents }); /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty InputUnderlineProperty = BindableProperty.Create("InputUnderline", typeof(string), typeof(TextField), string.Empty, propertyChanged: (bindable, oldValue, newValue) => + public static readonly BindableProperty InputUnderlineProperty = BindableProperty.Create(nameof(TextField.InputUnderline), typeof(string), typeof(TextField), string.Empty, propertyChanged: (bindable, oldValue, newValue) => { var textField = (TextField)bindable; if (newValue != null) @@ -724,7 +690,7 @@ namespace Tizen.NUI.BaseComponents Tizen.NUI.Object.SetProperty(textField.swigCPtr, TextField.Property.INPUT_UNDERLINE, new Tizen.NUI.PropertyValue((string)newValue)); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var textField = (TextField)bindable; string temp; @@ -733,7 +699,7 @@ namespace Tizen.NUI.BaseComponents }); /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty ShadowProperty = BindableProperty.Create("Shadow", typeof(PropertyMap), typeof(TextField), new PropertyMap(), propertyChanged: (bindable, oldValue, newValue) => + public static readonly BindableProperty ShadowProperty = BindableProperty.Create(nameof(TextField.Shadow), typeof(PropertyMap), typeof(TextField), new PropertyMap(), propertyChanged: (bindable, oldValue, newValue) => { var textField = (TextField)bindable; if (newValue != null) @@ -741,7 +707,7 @@ namespace Tizen.NUI.BaseComponents Tizen.NUI.Object.SetProperty(textField.swigCPtr, TextField.Property.SHADOW, new Tizen.NUI.PropertyValue((PropertyMap)newValue)); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var textField = (TextField)bindable; PropertyMap temp = new PropertyMap(); @@ -750,7 +716,7 @@ namespace Tizen.NUI.BaseComponents }); /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty InputShadowProperty = BindableProperty.Create("InputShadow", typeof(string), typeof(TextField), string.Empty, propertyChanged: (bindable, oldValue, newValue) => + public static readonly BindableProperty InputShadowProperty = BindableProperty.Create(nameof(TextField.InputShadow), typeof(string), typeof(TextField), string.Empty, propertyChanged: (bindable, oldValue, newValue) => { var textField = (TextField)bindable; if (newValue != null) @@ -758,7 +724,7 @@ namespace Tizen.NUI.BaseComponents Tizen.NUI.Object.SetProperty(textField.swigCPtr, TextField.Property.INPUT_SHADOW, new Tizen.NUI.PropertyValue((string)newValue)); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var textField = (TextField)bindable; string temp; @@ -767,7 +733,7 @@ namespace Tizen.NUI.BaseComponents }); /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty EmbossProperty = BindableProperty.Create("Emboss", typeof(string), typeof(TextField), string.Empty, propertyChanged: (bindable, oldValue, newValue) => + public static readonly BindableProperty EmbossProperty = BindableProperty.Create(nameof(TextField.Emboss), typeof(string), typeof(TextField), string.Empty, propertyChanged: (bindable, oldValue, newValue) => { var textField = (TextField)bindable; if (newValue != null) @@ -775,7 +741,7 @@ namespace Tizen.NUI.BaseComponents Tizen.NUI.Object.SetProperty(textField.swigCPtr, TextField.Property.EMBOSS, new Tizen.NUI.PropertyValue((string)newValue)); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var textField = (TextField)bindable; string temp; @@ -784,7 +750,7 @@ namespace Tizen.NUI.BaseComponents }); /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty InputEmbossProperty = BindableProperty.Create("InputEmboss", typeof(string), typeof(TextField), string.Empty, propertyChanged: (bindable, oldValue, newValue) => + public static readonly BindableProperty InputEmbossProperty = BindableProperty.Create(nameof(TextField.InputEmboss), typeof(string), typeof(TextField), string.Empty, propertyChanged: (bindable, oldValue, newValue) => { var textField = (TextField)bindable; if (newValue != null) @@ -792,7 +758,7 @@ namespace Tizen.NUI.BaseComponents Tizen.NUI.Object.SetProperty(textField.swigCPtr, TextField.Property.INPUT_EMBOSS, new Tizen.NUI.PropertyValue((string)newValue)); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var textField = (TextField)bindable; string temp; @@ -801,7 +767,7 @@ namespace Tizen.NUI.BaseComponents }); /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty OutlineProperty = BindableProperty.Create("Outline", typeof(PropertyMap), typeof(TextField), new PropertyMap(), propertyChanged: (bindable, oldValue, newValue) => + public static readonly BindableProperty OutlineProperty = BindableProperty.Create(nameof(TextField.Outline), typeof(PropertyMap), typeof(TextField), new PropertyMap(), propertyChanged: (bindable, oldValue, newValue) => { var textField = (TextField)bindable; if (newValue != null) @@ -809,7 +775,7 @@ namespace Tizen.NUI.BaseComponents Tizen.NUI.Object.SetProperty(textField.swigCPtr, TextField.Property.OUTLINE, new Tizen.NUI.PropertyValue((PropertyMap)newValue)); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var textField = (TextField)bindable; PropertyMap temp = new PropertyMap(); @@ -818,7 +784,7 @@ namespace Tizen.NUI.BaseComponents }); /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty InputOutlineProperty = BindableProperty.Create("InputOutline", typeof(string), typeof(TextField), string.Empty, propertyChanged: (bindable, oldValue, newValue) => + public static readonly BindableProperty InputOutlineProperty = BindableProperty.Create(nameof(TextField.InputOutline), typeof(string), typeof(TextField), string.Empty, propertyChanged: (bindable, oldValue, newValue) => { var textField = (TextField)bindable; if (newValue != null) @@ -826,7 +792,7 @@ namespace Tizen.NUI.BaseComponents Tizen.NUI.Object.SetProperty(textField.swigCPtr, TextField.Property.INPUT_OUTLINE, new Tizen.NUI.PropertyValue((string)newValue)); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var textField = (TextField)bindable; string temp; @@ -835,7 +801,7 @@ namespace Tizen.NUI.BaseComponents }); /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty HiddenInputSettingsProperty = BindableProperty.Create("HiddenInputSettings", typeof(PropertyMap), typeof(TextField), new PropertyMap(), propertyChanged: (bindable, oldValue, newValue) => + public static readonly BindableProperty HiddenInputSettingsProperty = BindableProperty.Create(nameof(TextField.HiddenInputSettings), typeof(PropertyMap), typeof(TextField), new PropertyMap(), propertyChanged: (bindable, oldValue, newValue) => { var textField = (TextField)bindable; if (newValue != null) @@ -843,7 +809,7 @@ namespace Tizen.NUI.BaseComponents Tizen.NUI.Object.SetProperty(textField.swigCPtr, TextField.Property.HIDDEN_INPUT_SETTINGS, new Tizen.NUI.PropertyValue((PropertyMap)newValue)); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var textField = (TextField)bindable; Tizen.NUI.PropertyMap temp = new Tizen.NUI.PropertyMap(); @@ -852,7 +818,7 @@ namespace Tizen.NUI.BaseComponents }); /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty PixelSizeProperty = BindableProperty.Create("PixelSize", typeof(float), typeof(TextField), default(float), propertyChanged: (bindable, oldValue, newValue) => + public static readonly BindableProperty PixelSizeProperty = BindableProperty.Create(nameof(TextField.PixelSize), typeof(float), typeof(TextField), default(float), propertyChanged: (bindable, oldValue, newValue) => { var textField = (TextField)bindable; if (newValue != null) @@ -860,7 +826,7 @@ namespace Tizen.NUI.BaseComponents Tizen.NUI.Object.SetProperty(textField.swigCPtr, TextField.Property.PIXEL_SIZE, new Tizen.NUI.PropertyValue((float)newValue)); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var textField = (TextField)bindable; float temp = 0.0f; @@ -869,7 +835,7 @@ namespace Tizen.NUI.BaseComponents }); /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty EnableSelectionProperty = BindableProperty.Create("EnableSelection", typeof(bool), typeof(TextField), false, propertyChanged: (bindable, oldValue, newValue) => + public static readonly BindableProperty EnableSelectionProperty = BindableProperty.Create(nameof(TextField.EnableSelection), typeof(bool), typeof(TextField), false, propertyChanged: (bindable, oldValue, newValue) => { var textField = (TextField)bindable; if (newValue != null) @@ -877,7 +843,7 @@ namespace Tizen.NUI.BaseComponents Tizen.NUI.Object.SetProperty(textField.swigCPtr, TextField.Property.ENABLE_SELECTION, new Tizen.NUI.PropertyValue((bool)newValue)); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var textField = (TextField)bindable; bool temp = false; @@ -886,7 +852,7 @@ namespace Tizen.NUI.BaseComponents }); /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty PlaceholderProperty = BindableProperty.Create("Placeholder", typeof(PropertyMap), typeof(TextField), new PropertyMap(), propertyChanged: (bindable, oldValue, newValue) => + public static readonly BindableProperty PlaceholderProperty = BindableProperty.Create(nameof(TextField.Placeholder), typeof(PropertyMap), typeof(TextField), new PropertyMap(), propertyChanged: (bindable, oldValue, newValue) => { var textField = (TextField)bindable; if (newValue != null) @@ -894,7 +860,7 @@ namespace Tizen.NUI.BaseComponents Tizen.NUI.Object.SetProperty(textField.swigCPtr, TextField.Property.PLACEHOLDER, new Tizen.NUI.PropertyValue((PropertyMap)newValue)); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var textField = (TextField)bindable; Tizen.NUI.PropertyMap temp = new Tizen.NUI.PropertyMap(); @@ -903,7 +869,7 @@ namespace Tizen.NUI.BaseComponents }); /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty EllipsisProperty = BindableProperty.Create("Ellipsis", typeof(bool), typeof(TextField), false, propertyChanged: (bindable, oldValue, newValue) => + public static readonly BindableProperty EllipsisProperty = BindableProperty.Create(nameof(TextField.Ellipsis), typeof(bool), typeof(TextField), false, propertyChanged: (bindable, oldValue, newValue) => { var textField = (TextField)bindable; if (newValue != null) @@ -911,7 +877,7 @@ namespace Tizen.NUI.BaseComponents Tizen.NUI.Object.SetProperty(textField.swigCPtr, TextField.Property.ELLIPSIS, new Tizen.NUI.PropertyValue((bool)newValue)); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var textField = (TextField)bindable; bool temp = false; @@ -920,7 +886,7 @@ namespace Tizen.NUI.BaseComponents }); /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty EnableShiftSelectionProperty = BindableProperty.Create("EnableShiftSelection", typeof(bool), typeof(TextField), false, propertyChanged: (bindable, oldValue, newValue) => + public static readonly BindableProperty EnableShiftSelectionProperty = BindableProperty.Create(nameof(TextField.EnableShiftSelection), typeof(bool), typeof(TextField), false, propertyChanged: (bindable, oldValue, newValue) => { var textField = (TextField)bindable; if (newValue != null) @@ -928,142 +894,65 @@ namespace Tizen.NUI.BaseComponents Tizen.NUI.Object.SetProperty(textField.swigCPtr, TextField.Property.ENABLE_SHIFT_SELECTION, new Tizen.NUI.PropertyValue((bool)newValue)); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var textField = (TextField)bindable; bool temp = false; Tizen.NUI.Object.GetProperty(textField.swigCPtr, TextField.Property.ENABLE_SHIFT_SELECTION).Get(out temp); return temp; }); - - + /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + public static readonly BindableProperty MatchSystemLanguageDirectionProperty = BindableProperty.Create(nameof(TextField.MatchSystemLanguageDirection), typeof(bool), typeof(TextField), false, propertyChanged: (bindable, oldValue, newValue) => + { + var textField = (TextField)bindable; + if (newValue != null) + { + Tizen.NUI.Object.SetProperty(textField.swigCPtr, TextField.Property.MATCH_SYSTEM_LANGUAGE_DIRECTION, new Tizen.NUI.PropertyValue((bool)newValue)); + } + }, + defaultValueCreator: (bindable) => + { + var textField = (TextField)bindable; + bool temp = false; + Tizen.NUI.Object.GetProperty(textField.swigCPtr, TextField.Property.MATCH_SYSTEM_LANGUAGE_DIRECTION).Get(out temp); + return (bool)temp; + }); private global::System.Runtime.InteropServices.HandleRef swigCPtr; private string textFieldTextSid = null; private string textFieldPlaceHolderTextSid = null; private bool systemlangTextFlag = false; private InputMethodContext inputMethodCotext = null; - - internal TextField(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.TextField_SWIGUpcast(cPtr), cMemoryOwn) - { - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); - } - - internal static global::System.Runtime.InteropServices.HandleRef getCPtr(TextField obj) - { - return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; - } + private EventHandler _textFieldTextChangedEventHandler; + private TextChangedCallbackDelegate _textFieldTextChangedCallbackDelegate; + private EventHandler _textFieldMaxLengthReachedEventHandler; + private MaxLengthReachedCallbackDelegate _textFieldMaxLengthReachedCallbackDelegate; /// - /// Dispose. + /// Creates the TextField control. /// /// 3 - protected override void Dispose(DisposeTypes type) + public TextField() : this(NDalicPINVOKE.TextField_New(), true) { - if (disposed) - { - DisposeQueue.Instance.Add(this); - return; - } - - if (type == DisposeTypes.Explicit) - { - //Called by User - //Release your own managed resources here. - //You should release all of your own disposable objects here. - } - - //Release your own unmanaged resources here. - //You should not access any managed member here except static instance. - //because the execution order of Finalizes is non-deterministic. - if (this.HasBody()) - { - if (_textFieldMaxLengthReachedCallbackDelegate != null) - { - this.MaxLengthReachedSignal().Disconnect(_textFieldMaxLengthReachedCallbackDelegate); - } - - if (_textFieldTextChangedCallbackDelegate != null) - { - TextChangedSignal().Disconnect(_textFieldTextChangedCallbackDelegate); - } - } - - if (swigCPtr.Handle != global::System.IntPtr.Zero) - { - if (swigCMemOwn) - { - swigCMemOwn = false; - // In order to speed up IME hide, temporarily add - GetInputMethodContext()?.DestroyContext(); - NDalicPINVOKE.delete_TextField(swigCPtr); - } - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); - } - - base.Dispose(type); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } - /// - /// The TextChanged event arguments. - /// - /// 3 - public class TextChangedEventArgs : EventArgs + internal TextField(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.TextField_SWIGUpcast(cPtr), cMemoryOwn) { - private TextField _textField; - - /// - /// TextField. - /// - /// 3 - public TextField TextField - { - get - { - return _textField; - } - set - { - _textField = value; - } - } + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); } - /// - /// The MaxLengthReached event arguments. - /// - /// 3 - public class MaxLengthReachedEventArgs : EventArgs + internal TextField(TextField handle) : this(NDalicPINVOKE.new_TextField__SWIG_1(TextField.getCPtr(handle)), true) { - private TextField _textField; - - /// - /// TextField. - /// - /// 3 - public TextField TextField - { - get - { - return _textField; - } - set - { - _textField = value; - } - } + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } - [UnmanagedFunctionPointer(CallingConvention.StdCall)] private delegate void TextChangedCallbackDelegate(IntPtr textField); - private EventHandler _textFieldTextChangedEventHandler; - private TextChangedCallbackDelegate _textFieldTextChangedCallbackDelegate; [UnmanagedFunctionPointer(CallingConvention.StdCall)] private delegate void MaxLengthReachedCallbackDelegate(IntPtr textField); - private EventHandler _textFieldMaxLengthReachedEventHandler; - private MaxLengthReachedCallbackDelegate _textFieldMaxLengthReachedCallbackDelegate; /// /// The TextChanged event. @@ -1090,21 +979,6 @@ namespace Tizen.NUI.BaseComponents } } - private void OnTextChanged(IntPtr textField) - { - TextChangedEventArgs e = new TextChangedEventArgs(); - - // Populate all members of "e" (TextChangedEventArgs) with real data - e.TextField = Registry.GetManagedBaseHandleFromNativePtr(textField) as TextField; - - if (_textFieldTextChangedEventHandler != null) - { - //here we send all data to user event handlers - _textFieldTextChangedEventHandler(this, e); - } - - } - /// /// The MaxLengthReached event. /// @@ -1130,274 +1004,86 @@ namespace Tizen.NUI.BaseComponents } } - private void OnMaxLengthReached(IntPtr textField) + internal enum ExceedPolicyType { - MaxLengthReachedEventArgs e = new MaxLengthReachedEventArgs(); + ExceedPolicyOriginal, + ExceedPolicyClip + } - // Populate all members of "e" (MaxLengthReachedEventArgs) with real data - e.TextField = Registry.GetManagedBaseHandleFromNativePtr(textField) as TextField; + /// + /// The TranslatableText property.
+ /// The text can set the SID value.
+ ///
+ /// + /// ResourceManager about multilingual is null. + /// + /// 4 + public string TranslatableText + { + get + { + return textFieldTextSid; + } + set + { + if (NUIApplication.MultilingualResourceManager == null) + { + throw new ArgumentNullException("ResourceManager about multilingual is null"); + } + textFieldTextSid = value; + Text = SetTranslatable(textFieldTextSid); + NotifyPropertyChanged(); + } + } - if (_textFieldMaxLengthReachedEventHandler != null) + /// + /// The TranslatablePlaceholderText property.
+ /// The text can set the SID value.
+ ///
+ /// + /// ResourceManager about multilingual is null. + /// + /// 4 + public string TranslatablePlaceholderText + { + get { - //here we send all data to user event handlers - _textFieldMaxLengthReachedEventHandler(this, e); + return textFieldPlaceHolderTextSid; + } + set + { + if (NUIApplication.MultilingualResourceManager == null) + { + throw new ArgumentNullException("ResourceManager about multilingual is null"); + } + textFieldPlaceHolderTextSid = value; + PlaceholderText = SetTranslatable(textFieldPlaceHolderTextSid); + NotifyPropertyChanged(); } + } + /// + /// The Text property. + /// + /// 3 + public string Text + { + get + { + return (string)GetValue(TextProperty); + } + set + { + SetValueAndForceSendChangeSignal(TextProperty, value); + NotifyPropertyChanged(); + } } - internal new class Property - { - internal static readonly int RENDERING_BACKEND = NDalicPINVOKE.TextField_Property_RENDERING_BACKEND_get(); - internal static readonly int TEXT = NDalicPINVOKE.TextField_Property_TEXT_get(); - internal static readonly int PLACEHOLDER_TEXT = NDalicPINVOKE.TextField_Property_PLACEHOLDER_TEXT_get(); - internal static readonly int PLACEHOLDER_TEXT_FOCUSED = NDalicPINVOKE.TextField_Property_PLACEHOLDER_TEXT_FOCUSED_get(); - internal static readonly int FONT_FAMILY = NDalicPINVOKE.TextField_Property_FONT_FAMILY_get(); - internal static readonly int FONT_STYLE = NDalicPINVOKE.TextField_Property_FONT_STYLE_get(); - internal static readonly int POINT_SIZE = NDalicPINVOKE.TextField_Property_POINT_SIZE_get(); - internal static readonly int MAX_LENGTH = NDalicPINVOKE.TextField_Property_MAX_LENGTH_get(); - internal static readonly int EXCEED_POLICY = NDalicPINVOKE.TextField_Property_EXCEED_POLICY_get(); - internal static readonly int HORIZONTAL_ALIGNMENT = NDalicPINVOKE.TextField_Property_HORIZONTAL_ALIGNMENT_get(); - internal static readonly int VERTICAL_ALIGNMENT = NDalicPINVOKE.TextField_Property_VERTICAL_ALIGNMENT_get(); - internal static readonly int TEXT_COLOR = NDalicPINVOKE.TextField_Property_TEXT_COLOR_get(); - internal static readonly int PLACEHOLDER_TEXT_COLOR = NDalicPINVOKE.TextField_Property_PLACEHOLDER_TEXT_COLOR_get(); - internal static readonly int SHADOW_OFFSET = NDalicPINVOKE.TextField_Property_SHADOW_OFFSET_get(); - internal static readonly int SHADOW_COLOR = NDalicPINVOKE.TextField_Property_SHADOW_COLOR_get(); - internal static readonly int PRIMARY_CURSOR_COLOR = NDalicPINVOKE.TextField_Property_PRIMARY_CURSOR_COLOR_get(); - internal static readonly int SECONDARY_CURSOR_COLOR = NDalicPINVOKE.TextField_Property_SECONDARY_CURSOR_COLOR_get(); - internal static readonly int ENABLE_CURSOR_BLINK = NDalicPINVOKE.TextField_Property_ENABLE_CURSOR_BLINK_get(); - internal static readonly int CURSOR_BLINK_INTERVAL = NDalicPINVOKE.TextField_Property_CURSOR_BLINK_INTERVAL_get(); - internal static readonly int CURSOR_BLINK_DURATION = NDalicPINVOKE.TextField_Property_CURSOR_BLINK_DURATION_get(); - internal static readonly int CURSOR_WIDTH = NDalicPINVOKE.TextField_Property_CURSOR_WIDTH_get(); - internal static readonly int GRAB_HANDLE_IMAGE = NDalicPINVOKE.TextField_Property_GRAB_HANDLE_IMAGE_get(); - internal static readonly int GRAB_HANDLE_PRESSED_IMAGE = NDalicPINVOKE.TextField_Property_GRAB_HANDLE_PRESSED_IMAGE_get(); - internal static readonly int SCROLL_THRESHOLD = NDalicPINVOKE.TextField_Property_SCROLL_THRESHOLD_get(); - internal static readonly int SCROLL_SPEED = NDalicPINVOKE.TextField_Property_SCROLL_SPEED_get(); - internal static readonly int SELECTION_HANDLE_IMAGE_LEFT = NDalicPINVOKE.TextField_Property_SELECTION_HANDLE_IMAGE_LEFT_get(); - internal static readonly int SELECTION_HANDLE_IMAGE_RIGHT = NDalicPINVOKE.TextField_Property_SELECTION_HANDLE_IMAGE_RIGHT_get(); - internal static readonly int SELECTION_HANDLE_PRESSED_IMAGE_LEFT = NDalicPINVOKE.TextField_Property_SELECTION_HANDLE_PRESSED_IMAGE_LEFT_get(); - internal static readonly int SELECTION_HANDLE_PRESSED_IMAGE_RIGHT = NDalicPINVOKE.TextField_Property_SELECTION_HANDLE_PRESSED_IMAGE_RIGHT_get(); - internal static readonly int SELECTION_HANDLE_MARKER_IMAGE_LEFT = NDalicPINVOKE.TextField_Property_SELECTION_HANDLE_MARKER_IMAGE_LEFT_get(); - internal static readonly int SELECTION_HANDLE_MARKER_IMAGE_RIGHT = NDalicPINVOKE.TextField_Property_SELECTION_HANDLE_MARKER_IMAGE_RIGHT_get(); - internal static readonly int SELECTION_HIGHLIGHT_COLOR = NDalicPINVOKE.TextField_Property_SELECTION_HIGHLIGHT_COLOR_get(); - internal static readonly int DECORATION_BOUNDING_BOX = NDalicPINVOKE.TextField_Property_DECORATION_BOUNDING_BOX_get(); - internal static readonly int INPUT_METHOD_SETTINGS = NDalicPINVOKE.TextField_Property_INPUT_METHOD_SETTINGS_get(); - internal static readonly int INPUT_COLOR = NDalicPINVOKE.TextField_Property_INPUT_COLOR_get(); - internal static readonly int ENABLE_MARKUP = NDalicPINVOKE.TextField_Property_ENABLE_MARKUP_get(); - internal static readonly int INPUT_FONT_FAMILY = NDalicPINVOKE.TextField_Property_INPUT_FONT_FAMILY_get(); - internal static readonly int INPUT_FONT_STYLE = NDalicPINVOKE.TextField_Property_INPUT_FONT_STYLE_get(); - internal static readonly int INPUT_POINT_SIZE = NDalicPINVOKE.TextField_Property_INPUT_POINT_SIZE_get(); - internal static readonly int UNDERLINE = NDalicPINVOKE.TextField_Property_UNDERLINE_get(); - internal static readonly int INPUT_UNDERLINE = NDalicPINVOKE.TextField_Property_INPUT_UNDERLINE_get(); - internal static readonly int SHADOW = NDalicPINVOKE.TextField_Property_SHADOW_get(); - internal static readonly int INPUT_SHADOW = NDalicPINVOKE.TextField_Property_INPUT_SHADOW_get(); - internal static readonly int EMBOSS = NDalicPINVOKE.TextField_Property_EMBOSS_get(); - internal static readonly int INPUT_EMBOSS = NDalicPINVOKE.TextField_Property_INPUT_EMBOSS_get(); - internal static readonly int OUTLINE = NDalicPINVOKE.TextField_Property_OUTLINE_get(); - internal static readonly int INPUT_OUTLINE = NDalicPINVOKE.TextField_Property_INPUT_OUTLINE_get(); - internal static readonly int HIDDEN_INPUT_SETTINGS = NDalicManualPINVOKE.TextField_Property_HIDDEN_INPUT_SETTINGS_get(); - internal static readonly int PIXEL_SIZE = NDalicManualPINVOKE.TextField_Property_PIXEL_SIZE_get(); - internal static readonly int ENABLE_SELECTION = NDalicManualPINVOKE.TextField_Property_ENABLE_SELECTION_get(); - internal static readonly int PLACEHOLDER = NDalicManualPINVOKE.TextField_Property_PLACEHOLDER_get(); - internal static readonly int ELLIPSIS = NDalicManualPINVOKE.TextField_Property_ELLIPSIS_get(); - internal static readonly int ENABLE_SHIFT_SELECTION = NDalicManualPINVOKE.TextField_Property_ENABLE_SHIFT_SELECTION_get(); - } - - internal class InputStyle - { - internal enum Mask - { - None = 0x0000, - Color = 0x0001, - FontFamily = 0x0002, - PointSize = 0x0004, - FontStyle = 0x0008, - Underline = 0x0010, - Shadow = 0x0020, - Emboss = 0x0040, - Outline = 0x0080 - } - - } - - /// - /// Creates the TextField control. - /// - /// 3 - public TextField() : this(NDalicPINVOKE.TextField_New(), true) - { - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - internal override bool IsCreateByXaml - { - get - { - return base.IsCreateByXaml; - } - set - { - base.IsCreateByXaml = value; - - if (value == true) - { - this.TextChanged += (obj, e) => - { - this.Text = this.Text; - }; - } - } - } - - internal TextField(TextField handle) : this(NDalicPINVOKE.new_TextField__SWIG_1(TextField.getCPtr(handle)), true) - { - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - /// - /// Get the InputMethodContext instance. - /// - /// The InputMethodContext instance. - /// 5 - public InputMethodContext GetInputMethodContext() - { - if (inputMethodCotext == null) - { - /*Avoid raising InputMethodContext reference count.*/ - inputMethodCotext = new InputMethodContext(NDalicPINVOKE.TextField_GetInputMethodContext(swigCPtr), true); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - return inputMethodCotext; - } - - internal TextFieldSignal TextChangedSignal() - { - TextFieldSignal ret = new TextFieldSignal(NDalicPINVOKE.TextField_TextChangedSignal(swigCPtr), false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - internal TextFieldSignal MaxLengthReachedSignal() - { - TextFieldSignal ret = new TextFieldSignal(NDalicPINVOKE.TextField_MaxLengthReachedSignal(swigCPtr), false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - internal SWIGTYPE_p_Dali__SignalT_void_fDali__Toolkit__TextField_Dali__Toolkit__TextField__InputStyle__MaskF_t InputStyleChangedSignal() - { - SWIGTYPE_p_Dali__SignalT_void_fDali__Toolkit__TextField_Dali__Toolkit__TextField__InputStyle__MaskF_t ret = new SWIGTYPE_p_Dali__SignalT_void_fDali__Toolkit__TextField_Dali__Toolkit__TextField__InputStyle__MaskF_t(NDalicPINVOKE.TextField_InputStyleChangedSignal(swigCPtr), false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - internal enum ExceedPolicyType - { - ExceedPolicyOriginal, - ExceedPolicyClip - } - - /// - /// The TranslatableText property.
- /// The text can set the SID value.
- ///
- /// - /// ResourceManager about multilingual is null. - /// - /// 4 - public string TranslatableText - { - get - { - return textFieldTextSid; - } - set - { - if (NUIApplication.MultilingualResourceManager == null) - { - throw new ArgumentNullException("ResourceManager about multilingual is null"); - } - textFieldTextSid = value; - Text = SetTranslatable(textFieldTextSid); - NotifyPropertyChanged(); - } - } - /// - /// The TranslatablePlaceholderText property.
- /// The text can set the SID value.
- ///
- /// - /// ResourceManager about multilingual is null. - /// - /// 4 - public string TranslatablePlaceholderText - { - get - { - return textFieldPlaceHolderTextSid; - } - set - { - if (NUIApplication.MultilingualResourceManager == null) - { - throw new ArgumentNullException("ResourceManager about multilingual is null"); - } - textFieldPlaceHolderTextSid = value; - PlaceholderText = SetTranslatable(textFieldPlaceHolderTextSid); - NotifyPropertyChanged(); - } - } - private string SetTranslatable(string textFieldSid) - { - string translatableText = null; - translatableText = NUIApplication.MultilingualResourceManager?.GetString(textFieldSid, new CultureInfo(SystemSettings.LocaleLanguage.Replace("_", "-"))); - if (translatableText != null) - { - if (systemlangTextFlag == false) - { - SystemSettings.LocaleLanguageChanged += new WeakEventHandler(SystemSettings_LocaleLanguageChanged).Handler; - systemlangTextFlag = true; - } - return translatableText; - } - else - { - translatableText = ""; - return translatableText; - } - } - private void SystemSettings_LocaleLanguageChanged(object sender, LocaleLanguageChangedEventArgs e) - { - if (textFieldTextSid != null) - { - Text = NUIApplication.MultilingualResourceManager?.GetString(textFieldTextSid, new CultureInfo(e.Value.Replace("_", "-"))); - } - if (textFieldPlaceHolderTextSid != null) - { - PlaceholderText = NUIApplication.MultilingualResourceManager?.GetString(textFieldPlaceHolderTextSid, new CultureInfo(e.Value.Replace("_", "-"))); - } - } - /// - /// The Text property. - /// - /// 3 - public string Text - { - get - { - return (string)GetValue(TextProperty); - } - set - { - SetValueAndForceSendChangeSignal(TextProperty, value); - NotifyPropertyChanged(); - } - } - - /// - /// The PlaceholderText property. - /// - /// 3 - public string PlaceholderText + /// + /// The PlaceholderText property. + /// + /// 3 + public string PlaceholderText { get { @@ -1585,15 +1271,23 @@ namespace Tizen.NUI.BaseComponents /// The ShadowOffset property. ///
/// 3 + [Obsolete("Please do not use! This will be deprecated! Please use Shadow property instead!")] + [EditorBrowsable(EditorBrowsableState.Never)] public Vector2 ShadowOffset { get { - return (Vector2)GetValue(ShadowOffsetProperty); + PropertyMap map = new PropertyMap(); + GetProperty(TextField.Property.SHADOW).Get(map); + Vector2 shadowOffset = new Vector2(); + map.Find(TextField.Property.SHADOW, "offset")?.Get(shadowOffset); + return shadowOffset; } set { - SetValue(ShadowOffsetProperty, value); + PropertyMap temp = new PropertyMap(); + temp.Insert("offset", new PropertyValue(value)); + SetValue(ShadowProperty, temp); NotifyPropertyChanged(); } } @@ -1602,15 +1296,23 @@ namespace Tizen.NUI.BaseComponents /// The ShadowColor property. ///
/// 3 + [Obsolete("Please do not use! This will be deprecated! Please use Shadow property instead!")] + [EditorBrowsable(EditorBrowsableState.Never)] public Vector4 ShadowColor { get { - return (Vector4)GetValue(ShadowColorProperty); + PropertyMap map = new PropertyMap(); + GetProperty(TextField.Property.SHADOW).Get(map); + Vector4 shadowColor = new Vector4(); + map.Find(TextField.Property.SHADOW, "color")?.Get(shadowColor); + return shadowColor; } set { - SetValue(ShadowColorProperty, value); + PropertyMap temp = new PropertyMap(); + temp.Insert("color", new PropertyValue(value)); + SetValue(ShadowProperty, temp); NotifyPropertyChanged(); } } @@ -2285,5 +1987,319 @@ namespace Tizen.NUI.BaseComponents NotifyPropertyChanged(); } } + + + /// + /// The text alignment to match the direction of the system language. + /// + /// 5 + /// This will be released at Tizen.NET API Level 5, so currently this would be used as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + public bool MatchSystemLanguageDirection + { + get + { + return (bool)GetValue(MatchSystemLanguageDirectionProperty); + } + set + { + SetValue(MatchSystemLanguageDirectionProperty, value); + NotifyPropertyChanged(); + } + } + + internal override bool IsCreateByXaml + { + get + { + return base.IsCreateByXaml; + } + set + { + base.IsCreateByXaml = value; + + if (value == true) + { + this.TextChanged += (obj, e) => + { + this.Text = this.Text; + }; + } + } + } + + /// + /// Get the InputMethodContext instance. + /// + /// The InputMethodContext instance. + /// 5 + public InputMethodContext GetInputMethodContext() + { + if (inputMethodCotext == null) + { + /*Avoid raising InputMethodContext reference count.*/ + inputMethodCotext = new InputMethodContext(NDalicPINVOKE.TextField_GetInputMethodContext(swigCPtr), true); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + return inputMethodCotext; + } + + internal static global::System.Runtime.InteropServices.HandleRef getCPtr(TextField obj) + { + return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; + } + + internal TextFieldSignal TextChangedSignal() + { + TextFieldSignal ret = new TextFieldSignal(NDalicPINVOKE.TextField_TextChangedSignal(swigCPtr), false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + internal TextFieldSignal MaxLengthReachedSignal() + { + TextFieldSignal ret = new TextFieldSignal(NDalicPINVOKE.TextField_MaxLengthReachedSignal(swigCPtr), false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + internal SWIGTYPE_p_Dali__SignalT_void_fDali__Toolkit__TextField_Dali__Toolkit__TextField__InputStyle__MaskF_t InputStyleChangedSignal() + { + SWIGTYPE_p_Dali__SignalT_void_fDali__Toolkit__TextField_Dali__Toolkit__TextField__InputStyle__MaskF_t ret = new SWIGTYPE_p_Dali__SignalT_void_fDali__Toolkit__TextField_Dali__Toolkit__TextField__InputStyle__MaskF_t(NDalicPINVOKE.TextField_InputStyleChangedSignal(swigCPtr), false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + /// + /// Dispose. + /// + /// 3 + protected override void Dispose(DisposeTypes type) + { + if (disposed) + { + DisposeQueue.Instance.Add(this); + return; + } + + if (type == DisposeTypes.Explicit) + { + //Called by User + //Release your own managed resources here. + //You should release all of your own disposable objects here. + } + + //Release your own unmanaged resources here. + //You should not access any managed member here except static instance. + //because the execution order of Finalizes is non-deterministic. + if (this.HasBody()) + { + if (_textFieldMaxLengthReachedCallbackDelegate != null) + { + this.MaxLengthReachedSignal().Disconnect(_textFieldMaxLengthReachedCallbackDelegate); + } + + if (_textFieldTextChangedCallbackDelegate != null) + { + TextChangedSignal().Disconnect(_textFieldTextChangedCallbackDelegate); + } + } + + if (swigCPtr.Handle != global::System.IntPtr.Zero) + { + if (swigCMemOwn) + { + swigCMemOwn = false; + // In order to speed up IME hide, temporarily add + GetInputMethodContext()?.DestroyContext(); + NDalicPINVOKE.delete_TextField(swigCPtr); + } + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); + } + + base.Dispose(type); + } + + private void OnTextChanged(IntPtr textField) + { + TextChangedEventArgs e = new TextChangedEventArgs(); + + // Populate all members of "e" (TextChangedEventArgs) with real data + e.TextField = Registry.GetManagedBaseHandleFromNativePtr(textField) as TextField; + + if (_textFieldTextChangedEventHandler != null) + { + //here we send all data to user event handlers + _textFieldTextChangedEventHandler(this, e); + } + } + + private void OnMaxLengthReached(IntPtr textField) + { + MaxLengthReachedEventArgs e = new MaxLengthReachedEventArgs(); + + // Populate all members of "e" (MaxLengthReachedEventArgs) with real data + e.TextField = Registry.GetManagedBaseHandleFromNativePtr(textField) as TextField; + + if (_textFieldMaxLengthReachedEventHandler != null) + { + //here we send all data to user event handlers + _textFieldMaxLengthReachedEventHandler(this, e); + } + } + + private string SetTranslatable(string textFieldSid) + { + string translatableText = null; + translatableText = NUIApplication.MultilingualResourceManager?.GetString(textFieldSid, new CultureInfo(SystemSettings.LocaleLanguage.Replace("_", "-"))); + if (translatableText != null) + { + if (systemlangTextFlag == false) + { + SystemSettings.LocaleLanguageChanged += new WeakEventHandler(SystemSettings_LocaleLanguageChanged).Handler; + systemlangTextFlag = true; + } + return translatableText; + } + else + { + translatableText = ""; + return translatableText; + } + } + + private void SystemSettings_LocaleLanguageChanged(object sender, LocaleLanguageChangedEventArgs e) + { + if (textFieldTextSid != null) + { + Text = NUIApplication.MultilingualResourceManager?.GetString(textFieldTextSid, new CultureInfo(e.Value.Replace("_", "-"))); + } + if (textFieldPlaceHolderTextSid != null) + { + PlaceholderText = NUIApplication.MultilingualResourceManager?.GetString(textFieldPlaceHolderTextSid, new CultureInfo(e.Value.Replace("_", "-"))); + } + } + + /// + /// The TextChanged event arguments. + /// + /// 3 + public class TextChangedEventArgs : EventArgs + { + private TextField _textField; + + /// + /// TextField. + /// + /// 3 + public TextField TextField + { + get + { + return _textField; + } + set + { + _textField = value; + } + } + } + + /// + /// The MaxLengthReached event arguments. + /// + /// 3 + public class MaxLengthReachedEventArgs : EventArgs + { + private TextField _textField; + + /// + /// TextField. + /// + /// 3 + public TextField TextField + { + get + { + return _textField; + } + set + { + _textField = value; + } + } + } + + internal new class Property + { + internal static readonly int RENDERING_BACKEND = NDalicPINVOKE.TextField_Property_RENDERING_BACKEND_get(); + internal static readonly int TEXT = NDalicPINVOKE.TextField_Property_TEXT_get(); + internal static readonly int PLACEHOLDER_TEXT = NDalicPINVOKE.TextField_Property_PLACEHOLDER_TEXT_get(); + internal static readonly int PLACEHOLDER_TEXT_FOCUSED = NDalicPINVOKE.TextField_Property_PLACEHOLDER_TEXT_FOCUSED_get(); + internal static readonly int FONT_FAMILY = NDalicPINVOKE.TextField_Property_FONT_FAMILY_get(); + internal static readonly int FONT_STYLE = NDalicPINVOKE.TextField_Property_FONT_STYLE_get(); + internal static readonly int POINT_SIZE = NDalicPINVOKE.TextField_Property_POINT_SIZE_get(); + internal static readonly int MAX_LENGTH = NDalicPINVOKE.TextField_Property_MAX_LENGTH_get(); + internal static readonly int EXCEED_POLICY = NDalicPINVOKE.TextField_Property_EXCEED_POLICY_get(); + internal static readonly int HORIZONTAL_ALIGNMENT = NDalicPINVOKE.TextField_Property_HORIZONTAL_ALIGNMENT_get(); + internal static readonly int VERTICAL_ALIGNMENT = NDalicPINVOKE.TextField_Property_VERTICAL_ALIGNMENT_get(); + internal static readonly int TEXT_COLOR = NDalicPINVOKE.TextField_Property_TEXT_COLOR_get(); + internal static readonly int PLACEHOLDER_TEXT_COLOR = NDalicPINVOKE.TextField_Property_PLACEHOLDER_TEXT_COLOR_get(); + internal static readonly int PRIMARY_CURSOR_COLOR = NDalicPINVOKE.TextField_Property_PRIMARY_CURSOR_COLOR_get(); + internal static readonly int SECONDARY_CURSOR_COLOR = NDalicPINVOKE.TextField_Property_SECONDARY_CURSOR_COLOR_get(); + internal static readonly int ENABLE_CURSOR_BLINK = NDalicPINVOKE.TextField_Property_ENABLE_CURSOR_BLINK_get(); + internal static readonly int CURSOR_BLINK_INTERVAL = NDalicPINVOKE.TextField_Property_CURSOR_BLINK_INTERVAL_get(); + internal static readonly int CURSOR_BLINK_DURATION = NDalicPINVOKE.TextField_Property_CURSOR_BLINK_DURATION_get(); + internal static readonly int CURSOR_WIDTH = NDalicPINVOKE.TextField_Property_CURSOR_WIDTH_get(); + internal static readonly int GRAB_HANDLE_IMAGE = NDalicPINVOKE.TextField_Property_GRAB_HANDLE_IMAGE_get(); + internal static readonly int GRAB_HANDLE_PRESSED_IMAGE = NDalicPINVOKE.TextField_Property_GRAB_HANDLE_PRESSED_IMAGE_get(); + internal static readonly int SCROLL_THRESHOLD = NDalicPINVOKE.TextField_Property_SCROLL_THRESHOLD_get(); + internal static readonly int SCROLL_SPEED = NDalicPINVOKE.TextField_Property_SCROLL_SPEED_get(); + internal static readonly int SELECTION_HANDLE_IMAGE_LEFT = NDalicPINVOKE.TextField_Property_SELECTION_HANDLE_IMAGE_LEFT_get(); + internal static readonly int SELECTION_HANDLE_IMAGE_RIGHT = NDalicPINVOKE.TextField_Property_SELECTION_HANDLE_IMAGE_RIGHT_get(); + internal static readonly int SELECTION_HANDLE_PRESSED_IMAGE_LEFT = NDalicPINVOKE.TextField_Property_SELECTION_HANDLE_PRESSED_IMAGE_LEFT_get(); + internal static readonly int SELECTION_HANDLE_PRESSED_IMAGE_RIGHT = NDalicPINVOKE.TextField_Property_SELECTION_HANDLE_PRESSED_IMAGE_RIGHT_get(); + internal static readonly int SELECTION_HANDLE_MARKER_IMAGE_LEFT = NDalicPINVOKE.TextField_Property_SELECTION_HANDLE_MARKER_IMAGE_LEFT_get(); + internal static readonly int SELECTION_HANDLE_MARKER_IMAGE_RIGHT = NDalicPINVOKE.TextField_Property_SELECTION_HANDLE_MARKER_IMAGE_RIGHT_get(); + internal static readonly int SELECTION_HIGHLIGHT_COLOR = NDalicPINVOKE.TextField_Property_SELECTION_HIGHLIGHT_COLOR_get(); + internal static readonly int DECORATION_BOUNDING_BOX = NDalicPINVOKE.TextField_Property_DECORATION_BOUNDING_BOX_get(); + internal static readonly int INPUT_METHOD_SETTINGS = NDalicPINVOKE.TextField_Property_INPUT_METHOD_SETTINGS_get(); + internal static readonly int INPUT_COLOR = NDalicPINVOKE.TextField_Property_INPUT_COLOR_get(); + internal static readonly int ENABLE_MARKUP = NDalicPINVOKE.TextField_Property_ENABLE_MARKUP_get(); + internal static readonly int INPUT_FONT_FAMILY = NDalicPINVOKE.TextField_Property_INPUT_FONT_FAMILY_get(); + internal static readonly int INPUT_FONT_STYLE = NDalicPINVOKE.TextField_Property_INPUT_FONT_STYLE_get(); + internal static readonly int INPUT_POINT_SIZE = NDalicPINVOKE.TextField_Property_INPUT_POINT_SIZE_get(); + internal static readonly int UNDERLINE = NDalicPINVOKE.TextField_Property_UNDERLINE_get(); + internal static readonly int INPUT_UNDERLINE = NDalicPINVOKE.TextField_Property_INPUT_UNDERLINE_get(); + internal static readonly int SHADOW = NDalicPINVOKE.TextField_Property_SHADOW_get(); + internal static readonly int INPUT_SHADOW = NDalicPINVOKE.TextField_Property_INPUT_SHADOW_get(); + internal static readonly int EMBOSS = NDalicPINVOKE.TextField_Property_EMBOSS_get(); + internal static readonly int INPUT_EMBOSS = NDalicPINVOKE.TextField_Property_INPUT_EMBOSS_get(); + internal static readonly int OUTLINE = NDalicPINVOKE.TextField_Property_OUTLINE_get(); + internal static readonly int INPUT_OUTLINE = NDalicPINVOKE.TextField_Property_INPUT_OUTLINE_get(); + internal static readonly int HIDDEN_INPUT_SETTINGS = NDalicManualPINVOKE.TextField_Property_HIDDEN_INPUT_SETTINGS_get(); + internal static readonly int PIXEL_SIZE = NDalicManualPINVOKE.TextField_Property_PIXEL_SIZE_get(); + internal static readonly int ENABLE_SELECTION = NDalicManualPINVOKE.TextField_Property_ENABLE_SELECTION_get(); + internal static readonly int PLACEHOLDER = NDalicManualPINVOKE.TextField_Property_PLACEHOLDER_get(); + internal static readonly int ELLIPSIS = NDalicManualPINVOKE.TextField_Property_ELLIPSIS_get(); + internal static readonly int ENABLE_SHIFT_SELECTION = NDalicManualPINVOKE.TextField_Property_ENABLE_SHIFT_SELECTION_get(); + internal static readonly int MATCH_SYSTEM_LANGUAGE_DIRECTION = NDalicManualPINVOKE.TextField_Property_MATCH_SYSTEM_LANGUAGE_DIRECTION_get(); + } + + internal class InputStyle + { + internal enum Mask + { + None = 0x0000, + Color = 0x0001, + FontFamily = 0x0002, + PointSize = 0x0004, + FontStyle = 0x0008, + Underline = 0x0010, + Shadow = 0x0020, + Emboss = 0x0040, + Outline = 0x0080 + } + } } } diff --git a/src/Tizen.NUI/src/public/BaseComponents/TextLabel.cs b/src/Tizen.NUI/src/public/BaseComponents/TextLabel.cs index 03ba911..a3f6f99 100755 --- a/src/Tizen.NUI/src/public/BaseComponents/TextLabel.cs +++ b/src/Tizen.NUI/src/public/BaseComponents/TextLabel.cs @@ -37,12 +37,12 @@ namespace Tizen.NUI.BaseComponents public static readonly BindableProperty TextProperty = BindableProperty.Create(nameof(Text), typeof(string), typeof(TextLabel), string.Empty, propertyChanged: (bindable, oldValue, newValue) => { var textLabel = (TextLabel)bindable; - if (newValue != null) + if (newValue != null) { Tizen.NUI.Object.SetProperty(textLabel.swigCPtr, TextLabel.Property.TEXT, new Tizen.NUI.PropertyValue((string)newValue)); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var textLabel = (TextLabel)bindable; string temp; @@ -51,7 +51,7 @@ namespace Tizen.NUI.BaseComponents }); /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty FontFamilyProperty = BindableProperty.Create("FontFamily", typeof(string), typeof(TextLabel), string.Empty, propertyChanged: (bindable, oldValue, newValue) => + public static readonly BindableProperty FontFamilyProperty = BindableProperty.Create(nameof(FontFamily), typeof(string), typeof(TextLabel), string.Empty, propertyChanged: (bindable, oldValue, newValue) => { var textLabel = (TextLabel)bindable; if (newValue != null) @@ -59,7 +59,7 @@ namespace Tizen.NUI.BaseComponents Tizen.NUI.Object.SetProperty(textLabel.swigCPtr, TextLabel.Property.FONT_FAMILY, new Tizen.NUI.PropertyValue((string)newValue)); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var textLabel = (TextLabel)bindable; string temp; @@ -68,7 +68,7 @@ namespace Tizen.NUI.BaseComponents }); /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty FontStyleProperty = BindableProperty.Create("FontStyle", typeof(PropertyMap), typeof(TextLabel), new PropertyMap(), propertyChanged: (bindable, oldValue, newValue) => + public static readonly BindableProperty FontStyleProperty = BindableProperty.Create(nameof(FontStyle), typeof(PropertyMap), typeof(TextLabel), new PropertyMap(), propertyChanged: (bindable, oldValue, newValue) => { var textLabel = (TextLabel)bindable; if (newValue != null) @@ -76,7 +76,7 @@ namespace Tizen.NUI.BaseComponents Tizen.NUI.Object.SetProperty(textLabel.swigCPtr, TextLabel.Property.FONT_STYLE, new Tizen.NUI.PropertyValue((PropertyMap)newValue)); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var textLabel = (TextLabel)bindable; PropertyMap temp = new PropertyMap(); @@ -85,7 +85,7 @@ namespace Tizen.NUI.BaseComponents }); /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty PointSizeProperty = BindableProperty.Create("PointSize", typeof(float), typeof(TextLabel), default(float), propertyChanged: (bindable, oldValue, newValue) => + public static readonly BindableProperty PointSizeProperty = BindableProperty.Create(nameof(PointSize), typeof(float), typeof(TextLabel), default(float), propertyChanged: (bindable, oldValue, newValue) => { var textLabel = (TextLabel)bindable; if (newValue != null) @@ -93,7 +93,7 @@ namespace Tizen.NUI.BaseComponents Tizen.NUI.Object.SetProperty(textLabel.swigCPtr, TextLabel.Property.POINT_SIZE, new Tizen.NUI.PropertyValue((float)newValue)); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var textLabel = (TextLabel)bindable; float temp = 0.0f; @@ -102,7 +102,7 @@ namespace Tizen.NUI.BaseComponents }); /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty MultiLineProperty = BindableProperty.Create("MultiLine", typeof(bool), typeof(TextLabel), false, propertyChanged: (bindable, oldValue, newValue) => + public static readonly BindableProperty MultiLineProperty = BindableProperty.Create(nameof(MultiLine), typeof(bool), typeof(TextLabel), false, propertyChanged: (bindable, oldValue, newValue) => { var textLabel = (TextLabel)bindable; if (newValue != null) @@ -110,7 +110,7 @@ namespace Tizen.NUI.BaseComponents Tizen.NUI.Object.SetProperty(textLabel.swigCPtr, TextLabel.Property.MULTI_LINE, new Tizen.NUI.PropertyValue((bool)newValue)); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var textLabel = (TextLabel)bindable; bool temp = false; @@ -119,7 +119,7 @@ namespace Tizen.NUI.BaseComponents }); /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty HorizontalAlignmentProperty = BindableProperty.Create("HorizontalAlignment", typeof(HorizontalAlignment), typeof(TextLabel), HorizontalAlignment.Begin, propertyChanged: (bindable, oldValue, newValue) => + public static readonly BindableProperty HorizontalAlignmentProperty = BindableProperty.Create(nameof(HorizontalAlignment), typeof(HorizontalAlignment), typeof(TextLabel), HorizontalAlignment.Begin, propertyChanged: (bindable, oldValue, newValue) => { var textLabel = (TextLabel)bindable; string valueToString = ""; @@ -135,7 +135,7 @@ namespace Tizen.NUI.BaseComponents Tizen.NUI.Object.SetProperty(textLabel.swigCPtr, TextLabel.Property.HORIZONTAL_ALIGNMENT, new Tizen.NUI.PropertyValue(valueToString)); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var textLabel = (TextLabel)bindable; string temp; @@ -146,14 +146,14 @@ namespace Tizen.NUI.BaseComponents switch (temp) { case "BEGIN": return HorizontalAlignment.Begin; - case "CENTER": return HorizontalAlignment.Center; - case "END": return HorizontalAlignment.End; + case "CENTER": return HorizontalAlignment.Center; + case "END": return HorizontalAlignment.End; default: return HorizontalAlignment.Begin; } }); /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty VerticalAlignmentProperty = BindableProperty.Create("VerticalAlignment", typeof(VerticalAlignment), typeof(TextLabel), VerticalAlignment.Bottom, propertyChanged: (bindable, oldValue, newValue) => + public static readonly BindableProperty VerticalAlignmentProperty = BindableProperty.Create(nameof(VerticalAlignment), typeof(VerticalAlignment), typeof(TextLabel), VerticalAlignment.Bottom, propertyChanged: (bindable, oldValue, newValue) => { var textLabel = (TextLabel)bindable; string valueToString = ""; @@ -169,7 +169,7 @@ namespace Tizen.NUI.BaseComponents Tizen.NUI.Object.SetProperty(textLabel.swigCPtr, TextLabel.Property.VERTICAL_ALIGNMENT, new Tizen.NUI.PropertyValue(valueToString)); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var textLabel = (TextLabel)bindable; string temp; @@ -188,7 +188,7 @@ namespace Tizen.NUI.BaseComponents }); /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty TextColorProperty = BindableProperty.Create("TextColor", typeof(Color), typeof(TextLabel), Color.Transparent, propertyChanged: (bindable, oldValue, newValue) => + public static readonly BindableProperty TextColorProperty = BindableProperty.Create(nameof(TextColor), typeof(Color), typeof(TextLabel), Color.Transparent, propertyChanged: (bindable, oldValue, newValue) => { var textLabel = (TextLabel)bindable; if (newValue != null) @@ -196,7 +196,7 @@ namespace Tizen.NUI.BaseComponents Tizen.NUI.Object.SetProperty(textLabel.swigCPtr, TextLabel.Property.TEXT_COLOR, new Tizen.NUI.PropertyValue((Color)newValue)); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var textLabel = (TextLabel)bindable; Color temp = new Color(0.0f, 0.0f, 0.0f, 0.0f); @@ -205,91 +205,6 @@ namespace Tizen.NUI.BaseComponents }); /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty ShadowOffsetProperty = BindableProperty.Create("ShadowOffset", typeof(Vector2), typeof(TextLabel), Vector2.Zero, propertyChanged: (bindable, oldValue, newValue) => - { - var textLabel = (TextLabel)bindable; - if (newValue != null) - { - Tizen.NUI.Object.SetProperty(textLabel.swigCPtr, TextLabel.Property.SHADOW_OFFSET, new Tizen.NUI.PropertyValue((Vector2)newValue)); - } - }, - defaultValueCreator:(bindable) => - { - var textLabel = (TextLabel)bindable; - Vector2 temp = new Vector2(0.0f, 0.0f); - Tizen.NUI.Object.GetProperty(textLabel.swigCPtr, TextLabel.Property.SHADOW_OFFSET).Get(temp); - return temp; - }); - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty ShadowColorProperty = BindableProperty.Create("ShadowColor", typeof(Vector4), typeof(TextLabel), Vector4.Zero, propertyChanged: (bindable, oldValue, newValue) => - { - var textLabel = (TextLabel)bindable; - if (newValue != null) - { - Tizen.NUI.Object.SetProperty(textLabel.swigCPtr, TextLabel.Property.SHADOW_COLOR, new Tizen.NUI.PropertyValue((Vector4)newValue)); - } - }, - defaultValueCreator:(bindable) => - { - var textLabel = (TextLabel)bindable; - Vector4 temp = new Vector4(0.0f, 0.0f, 0.0f, 0.0f); - Tizen.NUI.Object.GetProperty(textLabel.swigCPtr, TextLabel.Property.SHADOW_COLOR).Get(temp); - return temp; - }); - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty UnderlineEnabledProperty = BindableProperty.Create("UnderlineEnabled", typeof(bool), typeof(TextLabel), false, propertyChanged: (bindable, oldValue, newValue) => - { - var textLabel = (TextLabel)bindable; - if (newValue != null) - { - Tizen.NUI.Object.SetProperty(textLabel.swigCPtr, TextLabel.Property.UNDERLINE_ENABLED, new Tizen.NUI.PropertyValue((bool)newValue)); - } - }, - defaultValueCreator:(bindable) => - { - var textLabel = (TextLabel)bindable; - bool temp = false; - Tizen.NUI.Object.GetProperty(textLabel.swigCPtr, TextLabel.Property.UNDERLINE_ENABLED).Get(out temp); - return temp; - }); - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty UnderlineColorProperty = BindableProperty.Create("UnderlineColor", typeof(Vector4), typeof(TextLabel), Vector4.Zero, propertyChanged: (bindable, oldValue, newValue) => - { - var textLabel = (TextLabel)bindable; - if (newValue != null) - { - Tizen.NUI.Object.SetProperty(textLabel.swigCPtr, TextLabel.Property.UNDERLINE_COLOR, new Tizen.NUI.PropertyValue((Vector4)newValue)); - } - }, - defaultValueCreator:(bindable) => - { - var textLabel = (TextLabel)bindable; - Vector4 temp = new Vector4(0.0f, 0.0f, 0.0f, 0.0f); - Tizen.NUI.Object.GetProperty(textLabel.swigCPtr, TextLabel.Property.UNDERLINE_COLOR).Get(temp); - return temp; - }); - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty UnderlineHeightProperty = BindableProperty.Create("UnderlineHeight", typeof(float), typeof(TextLabel), default(float), propertyChanged: (bindable, oldValue, newValue) => - { - var textLabel = (TextLabel)bindable; - if (newValue != null) - { - Tizen.NUI.Object.SetProperty(textLabel.swigCPtr, TextLabel.Property.UNDERLINE_HEIGHT, new Tizen.NUI.PropertyValue((float)newValue)); - } - }, - defaultValueCreator:(bindable) => - { - var textLabel = (TextLabel)bindable; - float temp = 0.0f; - Tizen.NUI.Object.GetProperty(textLabel.swigCPtr, TextLabel.Property.UNDERLINE_HEIGHT).Get(out temp); - return temp; - }); - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] public static readonly BindableProperty EnableMarkupProperty = BindableProperty.Create("EnableMarkup", typeof(bool), typeof(TextLabel), false, propertyChanged: (bindable, oldValue, newValue) => { var textLabel = (TextLabel)bindable; @@ -298,7 +213,7 @@ namespace Tizen.NUI.BaseComponents Tizen.NUI.Object.SetProperty(textLabel.swigCPtr, TextLabel.Property.ENABLE_MARKUP, new Tizen.NUI.PropertyValue((bool)newValue)); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var textLabel = (TextLabel)bindable; bool temp = false; @@ -307,7 +222,7 @@ namespace Tizen.NUI.BaseComponents }); /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty EnableAutoScrollProperty = BindableProperty.Create("EnableAutoScroll", typeof(bool), typeof(TextLabel), false, propertyChanged: (bindable, oldValue, newValue) => + public static readonly BindableProperty EnableAutoScrollProperty = BindableProperty.Create(nameof(EnableAutoScroll), typeof(bool), typeof(TextLabel), false, propertyChanged: (bindable, oldValue, newValue) => { var textLabel = (TextLabel)bindable; if (newValue != null) @@ -315,7 +230,7 @@ namespace Tizen.NUI.BaseComponents Tizen.NUI.Object.SetProperty(textLabel.swigCPtr, TextLabel.Property.ENABLE_AUTO_SCROLL, new Tizen.NUI.PropertyValue((bool)newValue)); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var textLabel = (TextLabel)bindable; bool temp = false; @@ -324,7 +239,7 @@ namespace Tizen.NUI.BaseComponents }); /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty AutoScrollSpeedProperty = BindableProperty.Create("AutoScrollSpeed", typeof(int), typeof(TextLabel), default(int), propertyChanged: (bindable, oldValue, newValue) => + public static readonly BindableProperty AutoScrollSpeedProperty = BindableProperty.Create(nameof(AutoScrollSpeed), typeof(int), typeof(TextLabel), default(int), propertyChanged: (bindable, oldValue, newValue) => { var textLabel = (TextLabel)bindable; if (newValue != null) @@ -332,7 +247,7 @@ namespace Tizen.NUI.BaseComponents Tizen.NUI.Object.SetProperty(textLabel.swigCPtr, TextLabel.Property.AUTO_SCROLL_SPEED, new Tizen.NUI.PropertyValue((int)newValue)); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var textLabel = (TextLabel)bindable; int temp = 0; @@ -341,7 +256,7 @@ namespace Tizen.NUI.BaseComponents }); /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty AutoScrollLoopCountProperty = BindableProperty.Create("AutoScrollLoopCount", typeof(int), typeof(TextLabel), default(int), propertyChanged: (bindable, oldValue, newValue) => + public static readonly BindableProperty AutoScrollLoopCountProperty = BindableProperty.Create(nameof(AutoScrollLoopCount), typeof(int), typeof(TextLabel), default(int), propertyChanged: (bindable, oldValue, newValue) => { var textLabel = (TextLabel)bindable; if (newValue != null) @@ -349,7 +264,7 @@ namespace Tizen.NUI.BaseComponents Tizen.NUI.Object.SetProperty(textLabel.swigCPtr, TextLabel.Property.AUTO_SCROLL_LOOP_COUNT, new Tizen.NUI.PropertyValue((int)newValue)); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var textLabel = (TextLabel)bindable; int temp = 0; @@ -358,7 +273,7 @@ namespace Tizen.NUI.BaseComponents }); /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty AutoScrollGapProperty = BindableProperty.Create("AutoScrollGap", typeof(float), typeof(TextLabel), default(float), propertyChanged: (bindable, oldValue, newValue) => + public static readonly BindableProperty AutoScrollGapProperty = BindableProperty.Create(nameof(AutoScrollGap), typeof(float), typeof(TextLabel), default(float), propertyChanged: (bindable, oldValue, newValue) => { var textLabel = (TextLabel)bindable; if (newValue != null) @@ -366,7 +281,7 @@ namespace Tizen.NUI.BaseComponents Tizen.NUI.Object.SetProperty(textLabel.swigCPtr, TextLabel.Property.AUTO_SCROLL_GAP, new Tizen.NUI.PropertyValue((float)newValue)); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var textLabel = (TextLabel)bindable; float temp = 0.0f; @@ -375,7 +290,7 @@ namespace Tizen.NUI.BaseComponents }); /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty LineSpacingProperty = BindableProperty.Create("LineSpacing", typeof(float), typeof(TextLabel), default(float), propertyChanged: (bindable, oldValue, newValue) => + public static readonly BindableProperty LineSpacingProperty = BindableProperty.Create(nameof(LineSpacing), typeof(float), typeof(TextLabel), default(float), propertyChanged: (bindable, oldValue, newValue) => { var textLabel = (TextLabel)bindable; if (newValue != null) @@ -383,7 +298,7 @@ namespace Tizen.NUI.BaseComponents Tizen.NUI.Object.SetProperty(textLabel.swigCPtr, TextLabel.Property.LINE_SPACING, new Tizen.NUI.PropertyValue((float)newValue)); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var textLabel = (TextLabel)bindable; float temp = 0.0f; @@ -392,7 +307,7 @@ namespace Tizen.NUI.BaseComponents }); /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty UnderlineProperty = BindableProperty.Create("Underline", typeof(PropertyMap), typeof(TextLabel), new PropertyMap(), propertyChanged: (bindable, oldValue, newValue) => + public static readonly BindableProperty UnderlineProperty = BindableProperty.Create(nameof(Underline), typeof(PropertyMap), typeof(TextLabel), new PropertyMap(), propertyChanged: (bindable, oldValue, newValue) => { var textLabel = (TextLabel)bindable; if (newValue != null) @@ -400,7 +315,7 @@ namespace Tizen.NUI.BaseComponents Tizen.NUI.Object.SetProperty(textLabel.swigCPtr, TextLabel.Property.UNDERLINE, new Tizen.NUI.PropertyValue((PropertyMap)newValue)); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var textLabel = (TextLabel)bindable; PropertyMap temp = new PropertyMap(); @@ -409,7 +324,7 @@ namespace Tizen.NUI.BaseComponents }); /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty ShadowProperty = BindableProperty.Create("Shadow", typeof(PropertyMap), typeof(TextLabel), new PropertyMap(), propertyChanged: (bindable, oldValue, newValue) => + public static readonly BindableProperty ShadowProperty = BindableProperty.Create(nameof(Shadow), typeof(PropertyMap), typeof(TextLabel), new PropertyMap(), propertyChanged: (bindable, oldValue, newValue) => { var textLabel = (TextLabel)bindable; if (newValue != null) @@ -417,7 +332,7 @@ namespace Tizen.NUI.BaseComponents Tizen.NUI.Object.SetProperty(textLabel.swigCPtr, TextLabel.Property.SHADOW, new Tizen.NUI.PropertyValue((PropertyMap)newValue)); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var textLabel = (TextLabel)bindable; PropertyMap temp = new PropertyMap(); @@ -426,7 +341,7 @@ namespace Tizen.NUI.BaseComponents }); /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty EmbossProperty = BindableProperty.Create("Emboss", typeof(string), typeof(TextLabel), string.Empty, propertyChanged: (bindable, oldValue, newValue) => + public static readonly BindableProperty EmbossProperty = BindableProperty.Create(nameof(Emboss), typeof(string), typeof(TextLabel), string.Empty, propertyChanged: (bindable, oldValue, newValue) => { var textLabel = (TextLabel)bindable; if (newValue != null) @@ -434,7 +349,7 @@ namespace Tizen.NUI.BaseComponents Tizen.NUI.Object.SetProperty(textLabel.swigCPtr, TextLabel.Property.EMBOSS, new Tizen.NUI.PropertyValue((string)newValue)); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var textLabel = (TextLabel)bindable; string temp; @@ -443,7 +358,7 @@ namespace Tizen.NUI.BaseComponents }); /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty OutlineProperty = BindableProperty.Create("Outline", typeof(PropertyMap), typeof(TextLabel), new PropertyMap(), propertyChanged: (bindable, oldValue, newValue) => + public static readonly BindableProperty OutlineProperty = BindableProperty.Create(nameof(Outline), typeof(PropertyMap), typeof(TextLabel), new PropertyMap(), propertyChanged: (bindable, oldValue, newValue) => { var textLabel = (TextLabel)bindable; if (newValue != null) @@ -451,7 +366,7 @@ namespace Tizen.NUI.BaseComponents Tizen.NUI.Object.SetProperty(textLabel.swigCPtr, TextLabel.Property.OUTLINE, new Tizen.NUI.PropertyValue((PropertyMap)newValue)); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var textLabel = (TextLabel)bindable; PropertyMap temp = new PropertyMap(); @@ -460,7 +375,7 @@ namespace Tizen.NUI.BaseComponents }); /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty PixelSizeProperty = BindableProperty.Create("PixelSize", typeof(float), typeof(TextLabel), default(float), propertyChanged: (bindable, oldValue, newValue) => + public static readonly BindableProperty PixelSizeProperty = BindableProperty.Create(nameof(PixelSize), typeof(float), typeof(TextLabel), default(float), propertyChanged: (bindable, oldValue, newValue) => { var textLabel = (TextLabel)bindable; if (newValue != null) @@ -468,7 +383,7 @@ namespace Tizen.NUI.BaseComponents Tizen.NUI.Object.SetProperty(textLabel.swigCPtr, TextLabel.Property.PIXEL_SIZE, new Tizen.NUI.PropertyValue((float)newValue)); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var textLabel = (TextLabel)bindable; float temp = 0.0f; @@ -477,7 +392,7 @@ namespace Tizen.NUI.BaseComponents }); /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty EllipsisProperty = BindableProperty.Create("Ellipsis", typeof(bool), typeof(TextLabel), false, propertyChanged: (bindable, oldValue, newValue) => + public static readonly BindableProperty EllipsisProperty = BindableProperty.Create(nameof(Ellipsis), typeof(bool), typeof(TextLabel), false, propertyChanged: (bindable, oldValue, newValue) => { var textLabel = (TextLabel)bindable; if (newValue != null) @@ -485,7 +400,7 @@ namespace Tizen.NUI.BaseComponents Tizen.NUI.Object.SetProperty(textLabel.swigCPtr, TextLabel.Property.ELLIPSIS, new Tizen.NUI.PropertyValue((bool)newValue)); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var textLabel = (TextLabel)bindable; bool temp = false; @@ -494,7 +409,7 @@ namespace Tizen.NUI.BaseComponents }); /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty AutoScrollLoopDelayProperty = BindableProperty.Create("AutoScrollLoopDelay", typeof(float), typeof(TextLabel), default(float), propertyChanged: (bindable, oldValue, newValue) => + public static readonly BindableProperty AutoScrollLoopDelayProperty = BindableProperty.Create(nameof(AutoScrollLoopDelay), typeof(float), typeof(TextLabel), default(float), propertyChanged: (bindable, oldValue, newValue) => { var textLabel = (TextLabel)bindable; if (newValue != null) @@ -502,7 +417,7 @@ namespace Tizen.NUI.BaseComponents Tizen.NUI.Object.SetProperty(textLabel.swigCPtr, TextLabel.Property.AUTO_SCROLL_LOOP_DELAY, new Tizen.NUI.PropertyValue((float)newValue)); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var textLabel = (TextLabel)bindable; float temp = 0.0f; @@ -511,7 +426,7 @@ namespace Tizen.NUI.BaseComponents }); /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty AutoScrollStopModeProperty = BindableProperty.Create("AutoScrollStopMode", typeof(AutoScrollStopMode), typeof(TextLabel), AutoScrollStopMode.FinishLoop, propertyChanged: (bindable, oldValue, newValue) => + public static readonly BindableProperty AutoScrollStopModeProperty = BindableProperty.Create(nameof(AutoScrollStopMode), typeof(AutoScrollStopMode), typeof(TextLabel), AutoScrollStopMode.FinishLoop, propertyChanged: (bindable, oldValue, newValue) => { var textLabel = (TextLabel)bindable; if (newValue != null) @@ -519,11 +434,11 @@ namespace Tizen.NUI.BaseComponents Tizen.NUI.Object.SetProperty(textLabel.swigCPtr, TextLabel.Property.AUTO_SCROLL_STOP_MODE, new Tizen.NUI.PropertyValue((int)newValue)); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var textLabel = (TextLabel)bindable; string temp; - if(Tizen.NUI.Object.GetProperty(textLabel.swigCPtr, TextLabel.Property.AUTO_SCROLL_STOP_MODE).Get(out temp) == false) + if (Tizen.NUI.Object.GetProperty(textLabel.swigCPtr, TextLabel.Property.AUTO_SCROLL_STOP_MODE).Get(out temp) == false) { NUILog.Error("AutoScrollStopMode get error!"); } @@ -536,7 +451,7 @@ namespace Tizen.NUI.BaseComponents }); /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty LineWrapModeProperty = BindableProperty.Create("LineWrapMode", typeof(LineWrapMode), typeof(TextLabel), LineWrapMode.Word, propertyChanged: (bindable, oldValue, newValue) => + public static readonly BindableProperty LineWrapModeProperty = BindableProperty.Create(nameof(LineWrapMode), typeof(LineWrapMode), typeof(TextLabel), LineWrapMode.Word, propertyChanged: (bindable, oldValue, newValue) => { var textLabel = (TextLabel)bindable; if (newValue != null) @@ -544,7 +459,7 @@ namespace Tizen.NUI.BaseComponents Tizen.NUI.Object.SetProperty(textLabel.swigCPtr, TextLabel.Property.LINE_WRAP_MODE, new Tizen.NUI.PropertyValue((int)newValue)); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var textLabel = (TextLabel)bindable; int temp; @@ -556,7 +471,7 @@ namespace Tizen.NUI.BaseComponents }); /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty VerticalLineAlignmentProperty = BindableProperty.Create("VerticalLineAlignment", typeof(VerticalLineAlignment), typeof(TextLabel), VerticalLineAlignment.Bottom, propertyChanged: (bindable, oldValue, newValue) => + public static readonly BindableProperty VerticalLineAlignmentProperty = BindableProperty.Create(nameof(VerticalLineAlignment), typeof(VerticalLineAlignment), typeof(TextLabel), VerticalLineAlignment.Bottom, propertyChanged: (bindable, oldValue, newValue) => { var textLabel = (TextLabel)bindable; if (newValue != null) @@ -564,119 +479,34 @@ namespace Tizen.NUI.BaseComponents Tizen.NUI.Object.SetProperty(textLabel.swigCPtr, TextLabel.Property.VERTICAL_LINE_ALIGNMENT, new Tizen.NUI.PropertyValue((int)newValue)); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var textLabel = (TextLabel)bindable; int temp = 0; Tizen.NUI.Object.GetProperty(textLabel.swigCPtr, TextLabel.Property.VERTICAL_LINE_ALIGNMENT).Get(out temp); return (VerticalLineAlignment)temp; }); - - - private global::System.Runtime.InteropServices.HandleRef swigCPtr; - private string textLabelSid = null; - private bool systemlangTextFlag = false; - internal TextLabel(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.TextLabel_SWIGUpcast(cPtr), cMemoryOwn) - { - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); - } - - internal static global::System.Runtime.InteropServices.HandleRef getCPtr(TextLabel obj) - { - return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; - } - - /// - /// Downcasts a handle to textLabel handle - /// - /// - /// - /// 3 - /// Please do not use! this will be deprecated! - /// Instead please use as keyword. - [Obsolete("Please do not use! This will be deprecated! Please use as keyword instead! " + - "Like: " + - "BaseHandle handle = new TextLabel(\"Hello World!\"); " + - "TextLabel label = handle as TextLabel")] + /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] - public static TextLabel DownCast(BaseHandle handle) - { - TextLabel ret = Registry.GetManagedBaseHandleFromNativePtr(handle) as TextLabel; - - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - /// - /// Dispose. - /// - /// 3 - protected override void Dispose(DisposeTypes type) + public static readonly BindableProperty MatchSystemLanguageDirectionProperty = BindableProperty.Create(nameof(MatchSystemLanguageDirection), typeof(bool), typeof(TextLabel), false, propertyChanged: (bindable, oldValue, newValue) => { - if (disposed) - { - return; - } - - if(type == DisposeTypes.Explicit) - { - //Called by User - //Release your own managed resources here. - //You should release all of your own disposable objects here. - } - - //Release your own unmanaged resources here. - //You should not access any managed member here except static instance. - //because the execution order of Finalizes is non-deterministic. - - if (swigCPtr.Handle != global::System.IntPtr.Zero) + var textLabel = (TextLabel)bindable; + if (newValue != null) { - if (swigCMemOwn) - { - swigCMemOwn = false; - NDalicPINVOKE.delete_TextLabel(swigCPtr); - } - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); + Tizen.NUI.Object.SetProperty(textLabel.swigCPtr, TextLabel.Property.MATCH_SYSTEM_LANGUAGE_DIRECTION, new Tizen.NUI.PropertyValue((bool)newValue)); } - - base.Dispose(type); - } - - internal new class Property + }, + defaultValueCreator: (bindable) => { - internal static readonly int RENDERING_BACKEND = NDalicPINVOKE.TextLabel_Property_RENDERING_BACKEND_get(); - internal static readonly int TEXT = NDalicPINVOKE.TextLabel_Property_TEXT_get(); - internal static readonly int FONT_FAMILY = NDalicPINVOKE.TextLabel_Property_FONT_FAMILY_get(); - internal static readonly int FONT_STYLE = NDalicPINVOKE.TextLabel_Property_FONT_STYLE_get(); - internal static readonly int POINT_SIZE = NDalicPINVOKE.TextLabel_Property_POINT_SIZE_get(); - internal static readonly int MULTI_LINE = NDalicPINVOKE.TextLabel_Property_MULTI_LINE_get(); - internal static readonly int HORIZONTAL_ALIGNMENT = NDalicPINVOKE.TextLabel_Property_HORIZONTAL_ALIGNMENT_get(); - internal static readonly int VERTICAL_ALIGNMENT = NDalicPINVOKE.TextLabel_Property_VERTICAL_ALIGNMENT_get(); - internal static readonly int TEXT_COLOR = NDalicPINVOKE.TextLabel_Property_TEXT_COLOR_get(); - internal static readonly int SHADOW_OFFSET = NDalicPINVOKE.TextLabel_Property_SHADOW_OFFSET_get(); - internal static readonly int SHADOW_COLOR = NDalicPINVOKE.TextLabel_Property_SHADOW_COLOR_get(); - internal static readonly int UNDERLINE_ENABLED = NDalicPINVOKE.TextLabel_Property_UNDERLINE_ENABLED_get(); - internal static readonly int UNDERLINE_COLOR = NDalicPINVOKE.TextLabel_Property_UNDERLINE_COLOR_get(); - internal static readonly int UNDERLINE_HEIGHT = NDalicPINVOKE.TextLabel_Property_UNDERLINE_HEIGHT_get(); - internal static readonly int ENABLE_MARKUP = NDalicPINVOKE.TextLabel_Property_ENABLE_MARKUP_get(); - internal static readonly int ENABLE_AUTO_SCROLL = NDalicPINVOKE.TextLabel_Property_ENABLE_AUTO_SCROLL_get(); - internal static readonly int AUTO_SCROLL_SPEED = NDalicPINVOKE.TextLabel_Property_AUTO_SCROLL_SPEED_get(); - internal static readonly int AUTO_SCROLL_LOOP_COUNT = NDalicPINVOKE.TextLabel_Property_AUTO_SCROLL_LOOP_COUNT_get(); - internal static readonly int AUTO_SCROLL_GAP = NDalicPINVOKE.TextLabel_Property_AUTO_SCROLL_GAP_get(); - internal static readonly int LINE_SPACING = NDalicPINVOKE.TextLabel_Property_LINE_SPACING_get(); - internal static readonly int UNDERLINE = NDalicPINVOKE.TextLabel_Property_UNDERLINE_get(); - internal static readonly int SHADOW = NDalicPINVOKE.TextLabel_Property_SHADOW_get(); - internal static readonly int EMBOSS = NDalicPINVOKE.TextLabel_Property_EMBOSS_get(); - internal static readonly int OUTLINE = NDalicPINVOKE.TextLabel_Property_OUTLINE_get(); - internal static readonly int PIXEL_SIZE = NDalicManualPINVOKE.TextLabel_Property_PIXEL_SIZE_get(); - internal static readonly int ELLIPSIS = NDalicManualPINVOKE.TextLabel_Property_ELLIPSIS_get(); - internal static readonly int AUTO_SCROLL_STOP_MODE = NDalicManualPINVOKE.TextLabel_Property_AUTO_SCROLL_STOP_MODE_get(); - internal static readonly int AUTO_SCROLL_LOOP_DELAY = NDalicManualPINVOKE.TextLabel_Property_AUTO_SCROLL_LOOP_DELAY_get(); - internal static readonly int LINE_COUNT = NDalicManualPINVOKE.TextLabel_Property_LINE_COUNT_get(); - internal static readonly int LINE_WRAP_MODE = NDalicManualPINVOKE.TextLabel_Property_LINE_WRAP_MODE_get(); - internal static readonly int TEXT_DIRECTION = NDalicManualPINVOKE.TextLabel_Property_TEXT_DIRECTION_get(); - internal static readonly int VERTICAL_LINE_ALIGNMENT = NDalicManualPINVOKE.TextLabel_Property_VERTICAL_LINE_ALIGNMENT_get(); - } + var textLabel = (TextLabel)bindable; + bool temp = false; + Tizen.NUI.Object.GetProperty(textLabel.swigCPtr, TextLabel.Property.MATCH_SYSTEM_LANGUAGE_DIRECTION).Get(out temp); + return temp; + }); + + private global::System.Runtime.InteropServices.HandleRef swigCPtr; + private string textLabelSid = null; + private bool systemlangTextFlag = false; /// /// Creates the TextLabel control. @@ -685,7 +515,6 @@ namespace Tizen.NUI.BaseComponents public TextLabel() : this(NDalicPINVOKE.TextLabel_New__SWIG_0(), true) { if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } /// @@ -696,7 +525,6 @@ namespace Tizen.NUI.BaseComponents public TextLabel(string text) : this(NDalicPINVOKE.TextLabel_New__SWIG_1(text), true) { if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } internal TextLabel(TextLabel handle) : this(NDalicPINVOKE.new_TextLabel__SWIG_1(TextLabel.getCPtr(handle)), true) @@ -704,12 +532,9 @@ namespace Tizen.NUI.BaseComponents if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } - /// - /// Invoked whenever the binding context of the textlabel changes. Implement this method to add class handling for this event. - /// - protected override void OnBindingContextChanged() + internal TextLabel(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.TextLabel_SWIGUpcast(cPtr), cMemoryOwn) { - base.OnBindingContextChanged(); + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); } /// @@ -751,10 +576,6 @@ namespace Tizen.NUI.BaseComponents NotifyPropertyChanged(); } } - private void SystemSettings_LocaleLanguageChanged(object sender, LocaleLanguageChangedEventArgs e) - { - Text = NUIApplication.MultilingualResourceManager?.GetString(textLabelSid, new CultureInfo(e.Value.Replace("_", "-"))); - } /// /// The Text property.
@@ -907,15 +728,23 @@ namespace Tizen.NUI.BaseComponents /// The drop shadow offset 0 indicates no shadow.
///
/// 3 + [Obsolete("Please do not use! This will be deprecated! Please use Shadow property instead!")] + [EditorBrowsable(EditorBrowsableState.Never)] public Vector2 ShadowOffset { get { - return (Vector2)GetValue(ShadowOffsetProperty); + PropertyMap map = new PropertyMap(); + GetProperty(TextLabel.Property.SHADOW).Get(map); + Vector2 shadowOffset = new Vector2(); + map.Find(TextLabel.Property.SHADOW, "offset")?.Get(shadowOffset); + return shadowOffset; } set { - SetValue(ShadowOffsetProperty, value); + PropertyMap temp = new PropertyMap(); + temp.Insert("offset", new PropertyValue(value)); + SetValue(ShadowProperty, temp); NotifyPropertyChanged(); } } @@ -925,15 +754,23 @@ namespace Tizen.NUI.BaseComponents /// The color of a drop shadow.
///
/// 3 + [Obsolete("Please do not use! This will be deprecated! Please use Shadow property instead!")] + [EditorBrowsable(EditorBrowsableState.Never)] public Vector4 ShadowColor { get { - return (Vector4)GetValue(ShadowColorProperty); + PropertyMap map = new PropertyMap(); + GetProperty(TextLabel.Property.SHADOW).Get(map); + Vector4 shadowColor = new Vector4(); + map.Find(TextLabel.Property.SHADOW, "color")?.Get(shadowColor); + return shadowColor; } set { - SetValue(ShadowColorProperty, value); + PropertyMap temp = new PropertyMap(); + temp.Insert("color", new PropertyValue(value)); + SetValue(ShadowProperty, temp); NotifyPropertyChanged(); } } @@ -943,15 +780,23 @@ namespace Tizen.NUI.BaseComponents /// The underline enabled flag.
///
/// 3 + [Obsolete("Please do not use! This will be deprecated! Please use Underline property instead!")] + [EditorBrowsable(EditorBrowsableState.Never)] public bool UnderlineEnabled { get { - return (bool)GetValue(UnderlineEnabledProperty); + PropertyMap map = new PropertyMap(); + GetProperty(TextLabel.Property.UNDERLINE).Get(map); + bool underlineEnabled = false; + map.Find(TextLabel.Property.UNDERLINE, "enable")?.Get(out underlineEnabled); + return underlineEnabled; } set { - SetValue(UnderlineEnabledProperty, value); + PropertyMap temp = new PropertyMap(); + temp.Insert("enable", new PropertyValue(value)); + SetValue(UnderlineProperty, temp); NotifyPropertyChanged(); } } @@ -961,15 +806,23 @@ namespace Tizen.NUI.BaseComponents /// Overrides the underline height from font metrics.
///
/// 3 + [Obsolete("Please do not use! This will be deprecated! Please use Underline property instead!")] + [EditorBrowsable(EditorBrowsableState.Never)] public Vector4 UnderlineColor { get { - return (Vector4)GetValue(UnderlineColorProperty); + PropertyMap map = new PropertyMap(); + GetProperty(TextLabel.Property.UNDERLINE).Get(map); + Vector4 underlineColor = new Vector4(); + map.Find(TextLabel.Property.UNDERLINE, "color")?.Get(underlineColor); + return underlineColor; } set { - SetValue(UnderlineColorProperty, value); + PropertyMap temp = new PropertyMap(); + temp.Insert("color", new PropertyValue(value)); + SetValue(UnderlineProperty, temp); NotifyPropertyChanged(); } } @@ -979,15 +832,23 @@ namespace Tizen.NUI.BaseComponents /// Overrides the underline height from font metrics.
///
/// 3 + [Obsolete("Please do not use! This will be deprecated! Please use Underline property instead!")] + [EditorBrowsable(EditorBrowsableState.Never)] public float UnderlineHeight { get { - return (float)GetValue(UnderlineHeightProperty); + PropertyMap map = new PropertyMap(); + GetProperty(TextLabel.Property.UNDERLINE).Get(map); + float underlineHeight = 0.0f; + map.Find(TextLabel.Property.UNDERLINE, "height")?.Get(out underlineHeight); + return underlineHeight; } set { - SetValue(UnderlineHeightProperty, value); + PropertyMap temp = new PropertyMap(); + temp.Insert("height", new PropertyValue(value)); + SetValue(UnderlineProperty, temp); NotifyPropertyChanged(); } } @@ -1310,5 +1171,129 @@ namespace Tizen.NUI.BaseComponents NotifyPropertyChanged(); } } + + /// + /// The text alignment to match the direction of the system language. + /// + /// 5 + /// This will be released at Tizen.NET API Level 5, so currently this would be used as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + public bool MatchSystemLanguageDirection + { + get + { + return (bool)GetValue(MatchSystemLanguageDirectionProperty); + } + set + { + SetValue(MatchSystemLanguageDirectionProperty, value); + NotifyPropertyChanged(); + } + } + + /// Downcasts a handle to textLabel handle + ///
+ /// + /// + /// 3 + /// Please do not use! this will be deprecated! + /// Instead please use as keyword. + [Obsolete("Please do not use! This will be deprecated! Please use as keyword instead! " + + "Like: " + + "BaseHandle handle = new TextLabel(\"Hello World!\"); " + + "TextLabel label = handle as TextLabel")] + [EditorBrowsable(EditorBrowsableState.Never)] + public static TextLabel DownCast(BaseHandle handle) + { + TextLabel ret = Registry.GetManagedBaseHandleFromNativePtr(handle) as TextLabel; + + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + internal static global::System.Runtime.InteropServices.HandleRef getCPtr(TextLabel obj) + { + return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; + } + + /// + /// Dispose. + /// + /// 3 + protected override void Dispose(DisposeTypes type) + { + if (disposed) + { + return; + } + + if (type == DisposeTypes.Explicit) + { + //Called by User + //Release your own managed resources here. + //You should release all of your own disposable objects here. + } + + //Release your own unmanaged resources here. + //You should not access any managed member here except static instance. + //because the execution order of Finalizes is non-deterministic. + + if (swigCPtr.Handle != global::System.IntPtr.Zero) + { + if (swigCMemOwn) + { + swigCMemOwn = false; + NDalicPINVOKE.delete_TextLabel(swigCPtr); + } + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); + } + + base.Dispose(type); + } + + /// + /// Invoked whenever the binding context of the textlabel changes. Implement this method to add class handling for this event. + /// + protected override void OnBindingContextChanged() + { + base.OnBindingContextChanged(); + } + + private void SystemSettings_LocaleLanguageChanged(object sender, LocaleLanguageChangedEventArgs e) + { + Text = NUIApplication.MultilingualResourceManager?.GetString(textLabelSid, new CultureInfo(e.Value.Replace("_", "-"))); + } + + internal new class Property + { + internal static readonly int RENDERING_BACKEND = NDalicPINVOKE.TextLabel_Property_RENDERING_BACKEND_get(); + internal static readonly int TEXT = NDalicPINVOKE.TextLabel_Property_TEXT_get(); + internal static readonly int FONT_FAMILY = NDalicPINVOKE.TextLabel_Property_FONT_FAMILY_get(); + internal static readonly int FONT_STYLE = NDalicPINVOKE.TextLabel_Property_FONT_STYLE_get(); + internal static readonly int POINT_SIZE = NDalicPINVOKE.TextLabel_Property_POINT_SIZE_get(); + internal static readonly int MULTI_LINE = NDalicPINVOKE.TextLabel_Property_MULTI_LINE_get(); + internal static readonly int HORIZONTAL_ALIGNMENT = NDalicPINVOKE.TextLabel_Property_HORIZONTAL_ALIGNMENT_get(); + internal static readonly int VERTICAL_ALIGNMENT = NDalicPINVOKE.TextLabel_Property_VERTICAL_ALIGNMENT_get(); + internal static readonly int TEXT_COLOR = NDalicPINVOKE.TextLabel_Property_TEXT_COLOR_get(); + internal static readonly int ENABLE_MARKUP = NDalicPINVOKE.TextLabel_Property_ENABLE_MARKUP_get(); + internal static readonly int ENABLE_AUTO_SCROLL = NDalicPINVOKE.TextLabel_Property_ENABLE_AUTO_SCROLL_get(); + internal static readonly int AUTO_SCROLL_SPEED = NDalicPINVOKE.TextLabel_Property_AUTO_SCROLL_SPEED_get(); + internal static readonly int AUTO_SCROLL_LOOP_COUNT = NDalicPINVOKE.TextLabel_Property_AUTO_SCROLL_LOOP_COUNT_get(); + internal static readonly int AUTO_SCROLL_GAP = NDalicPINVOKE.TextLabel_Property_AUTO_SCROLL_GAP_get(); + internal static readonly int LINE_SPACING = NDalicPINVOKE.TextLabel_Property_LINE_SPACING_get(); + internal static readonly int UNDERLINE = NDalicPINVOKE.TextLabel_Property_UNDERLINE_get(); + internal static readonly int SHADOW = NDalicPINVOKE.TextLabel_Property_SHADOW_get(); + internal static readonly int EMBOSS = NDalicPINVOKE.TextLabel_Property_EMBOSS_get(); + internal static readonly int OUTLINE = NDalicPINVOKE.TextLabel_Property_OUTLINE_get(); + internal static readonly int PIXEL_SIZE = NDalicManualPINVOKE.TextLabel_Property_PIXEL_SIZE_get(); + internal static readonly int ELLIPSIS = NDalicManualPINVOKE.TextLabel_Property_ELLIPSIS_get(); + internal static readonly int AUTO_SCROLL_STOP_MODE = NDalicManualPINVOKE.TextLabel_Property_AUTO_SCROLL_STOP_MODE_get(); + internal static readonly int AUTO_SCROLL_LOOP_DELAY = NDalicManualPINVOKE.TextLabel_Property_AUTO_SCROLL_LOOP_DELAY_get(); + internal static readonly int LINE_COUNT = NDalicManualPINVOKE.TextLabel_Property_LINE_COUNT_get(); + internal static readonly int LINE_WRAP_MODE = NDalicManualPINVOKE.TextLabel_Property_LINE_WRAP_MODE_get(); + internal static readonly int TEXT_DIRECTION = NDalicManualPINVOKE.TextLabel_Property_TEXT_DIRECTION_get(); + internal static readonly int VERTICAL_LINE_ALIGNMENT = NDalicManualPINVOKE.TextLabel_Property_VERTICAL_LINE_ALIGNMENT_get(); + internal static readonly int MATCH_SYSTEM_LANGUAGE_DIRECTION = NDalicManualPINVOKE.TextLabel_Property_MATCH_SYSTEM_LANGUAGE_DIRECTION_get(); + } } } diff --git a/src/Tizen.NUI/src/public/BaseComponents/VideoView.cs b/src/Tizen.NUI/src/public/BaseComponents/VideoView.cs index 544a5a9..c881947 100755 --- a/src/Tizen.NUI/src/public/BaseComponents/VideoView.cs +++ b/src/Tizen.NUI/src/public/BaseComponents/VideoView.cs @@ -37,7 +37,7 @@ namespace Tizen.NUI.BaseComponents Tizen.NUI.Object.SetProperty(videoView.swigCPtr, VideoView.Property.VIDEO, new Tizen.NUI.PropertyValue((PropertyMap)newValue)); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var videoView = (VideoView)bindable; PropertyMap temp = new PropertyMap(); @@ -54,7 +54,7 @@ namespace Tizen.NUI.BaseComponents Tizen.NUI.Object.SetProperty(videoView.swigCPtr, VideoView.Property.LOOPING, new Tizen.NUI.PropertyValue((bool)newValue)); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var videoView = (VideoView)bindable; bool temp = false; @@ -71,7 +71,7 @@ namespace Tizen.NUI.BaseComponents Tizen.NUI.Object.SetProperty(videoView.swigCPtr, VideoView.Property.MUTED, new Tizen.NUI.PropertyValue((bool)newValue)); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var videoView = (VideoView)bindable; bool temp = false; @@ -88,7 +88,7 @@ namespace Tizen.NUI.BaseComponents Tizen.NUI.Object.SetProperty(videoView.swigCPtr, VideoView.Property.VOLUME, new Tizen.NUI.PropertyValue((PropertyMap)newValue)); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var videoView = (VideoView)bindable; PropertyMap temp = new PropertyMap(); @@ -105,7 +105,7 @@ namespace Tizen.NUI.BaseComponents Tizen.NUI.Object.SetProperty(videoView.swigCPtr, VideoView.Property.UNDERLAY, new Tizen.NUI.PropertyValue((bool)newValue)); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var videoView = (VideoView)bindable; bool temp = false; @@ -122,7 +122,7 @@ namespace Tizen.NUI.BaseComponents Tizen.NUI.Object.SetProperty(videoView.swigCPtr, VideoView.Property.VIDEO, new Tizen.NUI.PropertyValue((string)newValue)); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var videoView = (VideoView)bindable; string temp; @@ -131,89 +131,41 @@ namespace Tizen.NUI.BaseComponents }); private global::System.Runtime.InteropServices.HandleRef swigCPtr; - - internal VideoView(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.VideoView_SWIGUpcast(cPtr), cMemoryOwn) - { - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); - } - - internal static global::System.Runtime.InteropServices.HandleRef getCPtr(VideoView obj) - { - return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; - } + private FinishedCallbackDelegate _videoViewFinishedCallbackDelegate; + private EventHandler _videoViewFinishedEventHandler; /// - /// Dispose. + /// Creates an initialized VideoView. /// - /// DisposeTypes /// 3 - protected override void Dispose(DisposeTypes type) + public VideoView() : this(NDalicPINVOKE.VideoView_New__SWIG_0(), true) { - if(disposed) - { - return; - } - - if(type == DisposeTypes.Explicit) - { - //Called by User - //Release your own managed resources here. - //You should release all of your own disposable objects here. - } - - //Release your own unmanaged resources here. - //You should not access any managed member here except static instance. - //because the execution order of Finalizes is non-deterministic. - - if (this != null && _videoViewFinishedCallbackDelegate != null) - { - FinishedSignal().Disconnect(_videoViewFinishedCallbackDelegate); - } - - if (swigCPtr.Handle != global::System.IntPtr.Zero) - { - if (swigCMemOwn) - { - swigCMemOwn = false; - NDalicPINVOKE.delete_VideoView(swigCPtr); - } - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); - } - - base.Dispose(type); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } /// - /// Event arguments that passed via the finished signal. + /// Creates an initialized VideoView.
+ /// If the string is empty, VideoView will not display anything.
///
+ /// The URL of the video resource to display. /// 3 - public class FinishedEventArgs : EventArgs + public VideoView(string url) : this(NDalicPINVOKE.VideoView_New__SWIG_1(url), true) { - private VideoView _videoView; + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } - /// - /// The view for video playback and display. - /// - /// 3 - public VideoView VideoView - { - get - { - return _videoView; - } - set - { - _videoView = value; - } - } + internal VideoView(VideoView videoView) : this(NDalicPINVOKE.new_VideoView__SWIG_1(VideoView.getCPtr(videoView)), true) + { + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } + internal VideoView(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.VideoView_SWIGUpcast(cPtr), cMemoryOwn) + { + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); + } [UnmanagedFunctionPointer(CallingConvention.StdCall)] private delegate void FinishedCallbackDelegate(IntPtr data); - private EventHandler _videoViewFinishedEventHandler; - private FinishedCallbackDelegate _videoViewFinishedCallbackDelegate; - /// /// Event for the finished signal which can be used to subscribe or unsubscribe the event handler @@ -241,54 +193,107 @@ namespace Tizen.NUI.BaseComponents } } - // Callback for VideoView Finished signal - private void OnFinished(IntPtr data) + /// + /// Video file setting type of PropertyMap. + /// + /// 3 + public PropertyMap Video { - FinishedEventArgs e = new FinishedEventArgs(); - - // Populate all members of "e" (FinishedEventArgs) with real data - e.VideoView = Registry.GetManagedBaseHandleFromNativePtr(data) as VideoView; - - if (_videoViewFinishedEventHandler != null) + get { - //here we send all data to user event handlers - _videoViewFinishedEventHandler(this, e); + return (PropertyMap)GetValue(VideoProperty); + } + set + { + SetValue(VideoProperty, value); + NotifyPropertyChanged(); } } - internal new class Property + /// + /// The looping status, true or false. + /// + /// 3 + public bool Looping { - internal static readonly int VIDEO = NDalicPINVOKE.VideoView_Property_VIDEO_get(); - internal static readonly int LOOPING = NDalicPINVOKE.VideoView_Property_LOOPING_get(); - internal static readonly int MUTED = NDalicPINVOKE.VideoView_Property_MUTED_get(); - internal static readonly int VOLUME = NDalicPINVOKE.VideoView_Property_VOLUME_get(); - internal static readonly int UNDERLAY = NDalicPINVOKE.VideoView_Property_UNDERLAY_get(); + get + { + return (bool)GetValue(LoopingProperty); + } + set + { + SetValue(LoopingProperty, value); + NotifyPropertyChanged(); + } } /// - /// Creates an initialized VideoView. + /// The mute status, true or false. /// /// 3 - public VideoView() : this(NDalicPINVOKE.VideoView_New__SWIG_0(), true) + public bool Muted { - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - + get + { + return (bool)GetValue(MutedProperty); + } + set + { + SetValue(MutedProperty, value); + NotifyPropertyChanged(); + } } /// - /// Creates an initialized VideoView.
- /// If the string is empty, VideoView will not display anything.
+ /// The left and the right volume scalar as float type, PropertyMap with two values ( "left" and "right" ). ///
- /// The URL of the video resource to display. /// 3 - public VideoView(string url) : this(NDalicPINVOKE.VideoView_New__SWIG_1(url), true) + public PropertyMap Volume { - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + get + { + return (PropertyMap)GetValue(VolumeProperty); + } + set + { + SetValue(VolumeProperty, value); + NotifyPropertyChanged(); + } + } + /// + /// Video rendering by underlay, true or false.
+ /// This shows video composited underneath the window by the system. This means it may ignore rotation of the video-view. + ///
+ /// 4 + public bool Underlay + { + get + { + return (bool)GetValue(UnderlayProperty); + } + set + { + SetValue(UnderlayProperty, value); + NotifyPropertyChanged(); + } } - internal VideoView(VideoView videoView) : this(NDalicPINVOKE.new_VideoView__SWIG_1(VideoView.getCPtr(videoView)), true) + + /// + /// Video file URL as string type. + /// + /// 4 + public string ResourceUrl { - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + get + { + return (string)GetValue(ResourceUrlProperty); + } + set + { + SetValue(ResourceUrlProperty, value); + NotifyPropertyChanged(); + } } /// @@ -350,109 +355,99 @@ namespace Tizen.NUI.BaseComponents return ret; } - /// - /// Video file setting type of PropertyMap. - /// - /// 3 - public PropertyMap Video + internal static global::System.Runtime.InteropServices.HandleRef getCPtr(VideoView obj) { - get - { - return (PropertyMap)GetValue(VideoProperty); - } - set - { - SetValue(VideoProperty, value); - NotifyPropertyChanged(); - } + return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; } /// - /// The looping status, true or false. + /// Dispose. /// + /// DisposeTypes /// 3 - public bool Looping + protected override void Dispose(DisposeTypes type) { - get + if (disposed) { - return (bool)GetValue(LoopingProperty); + return; } - set + + if (type == DisposeTypes.Explicit) { - SetValue(LoopingProperty, value); - NotifyPropertyChanged(); + //Called by User + //Release your own managed resources here. + //You should release all of your own disposable objects here. } - } - /// - /// The mute status, true or false. - /// - /// 3 - public bool Muted - { - get + //Release your own unmanaged resources here. + //You should not access any managed member here except static instance. + //because the execution order of Finalizes is non-deterministic. + + if (this != null && _videoViewFinishedCallbackDelegate != null) { - return (bool)GetValue(MutedProperty); + FinishedSignal().Disconnect(_videoViewFinishedCallbackDelegate); } - set + + if (swigCPtr.Handle != global::System.IntPtr.Zero) { - SetValue(MutedProperty, value); - NotifyPropertyChanged(); + if (swigCMemOwn) + { + swigCMemOwn = false; + NDalicPINVOKE.delete_VideoView(swigCPtr); + } + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); } + + base.Dispose(type); } - /// - /// The left and the right volume scalar as float type, PropertyMap with two values ( "left" and "right" ). - /// - /// 3 - public PropertyMap Volume + // Callback for VideoView Finished signal + private void OnFinished(IntPtr data) { - get - { - return (PropertyMap)GetValue(VolumeProperty); - } - set + FinishedEventArgs e = new FinishedEventArgs(); + + // Populate all members of "e" (FinishedEventArgs) with real data + e.VideoView = Registry.GetManagedBaseHandleFromNativePtr(data) as VideoView; + + if (_videoViewFinishedEventHandler != null) { - SetValue(VolumeProperty, value); - NotifyPropertyChanged(); + //here we send all data to user event handlers + _videoViewFinishedEventHandler(this, e); } } /// - /// Video rendering by underlay, true or false.
- /// This shows video composited underneath the window by the system. This means it may ignore rotation of the video-view. + /// Event arguments that passed via the finished signal. ///
- /// 4 - public bool Underlay + /// 3 + public class FinishedEventArgs : EventArgs { - get - { - return (bool)GetValue(UnderlayProperty); - } - set + private VideoView _videoView; + + /// + /// The view for video playback and display. + /// + /// 3 + public VideoView VideoView { - SetValue(UnderlayProperty, value); - NotifyPropertyChanged(); + get + { + return _videoView; + } + set + { + _videoView = value; + } } } - /// - /// Video file URL as string type. - /// - /// 4 - public string ResourceUrl + internal new class Property { - get - { - return (string)GetValue(ResourceUrlProperty); - } - set - { - SetValue(ResourceUrlProperty, value); - NotifyPropertyChanged(); - } + internal static readonly int VIDEO = NDalicPINVOKE.VideoView_Property_VIDEO_get(); + internal static readonly int LOOPING = NDalicPINVOKE.VideoView_Property_LOOPING_get(); + internal static readonly int MUTED = NDalicPINVOKE.VideoView_Property_MUTED_get(); + internal static readonly int VOLUME = NDalicPINVOKE.VideoView_Property_VOLUME_get(); + internal static readonly int UNDERLAY = NDalicPINVOKE.VideoView_Property_UNDERLAY_get(); } - } - } diff --git a/src/Tizen.NUI/src/public/BaseComponents/View.cs b/src/Tizen.NUI/src/public/BaseComponents/View.cs index 5050725..41c9e2e 100755 --- a/src/Tizen.NUI/src/public/BaseComponents/View.cs +++ b/src/Tizen.NUI/src/public/BaseComponents/View.cs @@ -22,43 +22,49 @@ using Tizen.NUI.Binding; namespace Tizen.NUI.BaseComponents { /// - /// View is the base class for all views. + /// The View layout Direction type. /// - /// 3 - public class View : Container, IResourcesProvider + /// 4 + public enum ViewLayoutDirectionType { - /// - /// Flag to allow Layouting to be disabled for Views. - /// Once a View has a Layout set then any children added to Views from then on will receive - /// automatic Layouts. + /// Left to right. /// - private static bool layoutingDisabled = true; + /// 4 + LTR, + /// + /// Right to left. + /// + /// 4 + RTL + } - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - public bool IsResourcesCreated - { - get - { - return Application.Current.IsResourcesCreated; - } - } + internal enum ChildLayoutData + { + /// + /// Constant which indicates child size should match parent size + /// + MatchParent = -1, + /// + /// Constant which indicates parent should take the smallest size possible to wrap it's children with their desired size + /// + WrapContent = -2, + } - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - public ResourceDictionary XamlResources - { - get - { - return Application.Current.XamlResources; - } - set - { - Application.Current.XamlResources = value; - } - } + internal enum ResourceLoadingStatusType + { + Invalid = -1, + Preparing = 0, + Ready, + Failed, + } + /// + /// View is the base class for all views. + /// + /// 3 + public class View : Container, IResourcesProvider + { /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] public static readonly BindableProperty StyleNameProperty = BindableProperty.Create("StyleName", typeof(string), typeof(View), string.Empty, propertyChanged: (bindable, oldValue, newValue) => @@ -69,7 +75,7 @@ namespace Tizen.NUI.BaseComponents Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.STYLE_NAME, new Tizen.NUI.PropertyValue((string)newValue)); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var view = (View)bindable; string temp; @@ -86,7 +92,7 @@ namespace Tizen.NUI.BaseComponents Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.BACKGROUND, new Tizen.NUI.PropertyValue((Color)newValue)); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var view = (View)bindable; Color backgroundColor = new Color(0.0f, 0.0f, 0.0f, 0.0f); @@ -111,7 +117,7 @@ namespace Tizen.NUI.BaseComponents Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.BACKGROUND, new Tizen.NUI.PropertyValue((string)newValue)); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var view = (View)bindable; string backgroundImage = ""; @@ -136,7 +142,7 @@ namespace Tizen.NUI.BaseComponents Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.BACKGROUND, new Tizen.NUI.PropertyValue((PropertyMap)newValue)); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var view = (View)bindable; Tizen.NUI.PropertyMap temp = new Tizen.NUI.PropertyMap(); @@ -153,7 +159,7 @@ namespace Tizen.NUI.BaseComponents Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.STATE, new Tizen.NUI.PropertyValue((int)newValue)); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var view = (View)bindable; int temp = 0; @@ -175,13 +181,13 @@ namespace Tizen.NUI.BaseComponents { case States.Normal: { valueToString = "NORMAL"; break; } case States.Focused: { valueToString = "FOCUSED"; break; } - case States.Disabled: { valueToString = "DISABLED"; break; } + case States.Disabled: { valueToString = "DISABLED"; break; } default: { valueToString = "NORMAL"; break; } } Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.SUB_STATE, new Tizen.NUI.PropertyValue(valueToString)); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var view = (View)bindable; string temp; @@ -207,7 +213,7 @@ namespace Tizen.NUI.BaseComponents Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.TOOLTIP, new Tizen.NUI.PropertyValue((PropertyMap)newValue)); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var view = (View)bindable; Tizen.NUI.PropertyMap temp = new Tizen.NUI.PropertyMap(); @@ -232,7 +238,7 @@ namespace Tizen.NUI.BaseComponents Tizen.NUI.Object.SetProperty(view.swigCPtr, FlexContainer.ChildProperty.FLEX, new Tizen.NUI.PropertyValue((float)newValue)); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var view = (View)bindable; float temp = 0.0f; @@ -249,7 +255,7 @@ namespace Tizen.NUI.BaseComponents Tizen.NUI.Object.SetProperty(view.swigCPtr, FlexContainer.ChildProperty.ALIGN_SELF, new Tizen.NUI.PropertyValue((int)newValue)); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var view = (View)bindable; int temp = 0; @@ -266,7 +272,7 @@ namespace Tizen.NUI.BaseComponents Tizen.NUI.Object.SetProperty(view.swigCPtr, FlexContainer.ChildProperty.FLEX_MARGIN, new Tizen.NUI.PropertyValue((Vector4)newValue)); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var view = (View)bindable; Vector4 temp = new Vector4(0.0f, 0.0f, 0.0f, 0.0f); @@ -283,7 +289,7 @@ namespace Tizen.NUI.BaseComponents Tizen.NUI.Object.SetProperty(view.swigCPtr, TableView.ChildProperty.CELL_INDEX, new Tizen.NUI.PropertyValue((Vector2)newValue)); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var view = (View)bindable; Vector2 temp = new Vector2(0.0f, 0.0f); @@ -300,7 +306,7 @@ namespace Tizen.NUI.BaseComponents Tizen.NUI.Object.SetProperty(view.swigCPtr, TableView.ChildProperty.ROW_SPAN, new Tizen.NUI.PropertyValue((float)newValue)); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var view = (View)bindable; float temp = 0.0f; @@ -317,7 +323,7 @@ namespace Tizen.NUI.BaseComponents Tizen.NUI.Object.SetProperty(view.swigCPtr, TableView.ChildProperty.COLUMN_SPAN, new Tizen.NUI.PropertyValue((float)newValue)); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var view = (View)bindable; float temp = 0.0f; @@ -343,7 +349,7 @@ namespace Tizen.NUI.BaseComponents Tizen.NUI.Object.SetProperty(view.swigCPtr, TableView.ChildProperty.CELL_HORIZONTAL_ALIGNMENT, new Tizen.NUI.PropertyValue(valueToString)); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var view = (View)bindable; string temp; @@ -379,7 +385,7 @@ namespace Tizen.NUI.BaseComponents Tizen.NUI.Object.SetProperty(view.swigCPtr, TableView.ChildProperty.CELL_VERTICAL_ALIGNMENT, new Tizen.NUI.PropertyValue(valueToString)); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var view = (View)bindable; string temp; @@ -392,7 +398,7 @@ namespace Tizen.NUI.BaseComponents { case "top": return Tizen.NUI.VerticalAlignmentType.Top; case "center": return Tizen.NUI.VerticalAlignmentType.Center; - case "bottom": return Tizen.NUI.VerticalAlignmentType.Bottom; + case "bottom": return Tizen.NUI.VerticalAlignmentType.Bottom; default: return Tizen.NUI.VerticalAlignmentType.Top; } }); @@ -406,7 +412,7 @@ namespace Tizen.NUI.BaseComponents Tizen.NUI.Object.SetProperty(view.swigCPtr, LinearLayout.ChildProperty.WEIGHT, new Tizen.NUI.PropertyValue((float)newValue)); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var view = (View)bindable; float temp = 0.0f; @@ -415,13 +421,13 @@ namespace Tizen.NUI.BaseComponents }); /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty LeftFocusableViewProperty = BindableProperty.Create("LeftFocusableView", typeof(View), typeof(View), default(View), propertyChanged: (bindable, oldValue, newValue) => + public static readonly BindableProperty LeftFocusableViewProperty = BindableProperty.Create(nameof(View.LeftFocusableView), typeof(View), typeof(View), default(View), propertyChanged: (bindable, oldValue, newValue) => { var view = (View)bindable; - if (newValue != null) { view.LeftFocusableViewId = (int)(newValue as View).GetId(); } + if (newValue != null) { view.LeftFocusableViewId = (int)(newValue as View)?.GetId(); } else { view.LeftFocusableViewId = -1; } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var view = (View)bindable; if (view.LeftFocusableViewId >= 0) { return view.ConvertIdToView((uint)view.LeftFocusableViewId); } @@ -429,27 +435,28 @@ namespace Tizen.NUI.BaseComponents }); /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty RightFocusableViewProperty = BindableProperty.Create("RightFocusableView", typeof(View), typeof(View), default(View), propertyChanged: (bindable, oldValue, newValue) => + public static readonly BindableProperty RightFocusableViewProperty = BindableProperty.Create(nameof(View.RightFocusableView), typeof(View), typeof(View), default(View), propertyChanged: (bindable, oldValue, newValue) => { var view = (View)bindable; - if (newValue != null) { view.RightFocusableViewId = (int)(newValue as View).GetId(); } + if (newValue != null) { view.RightFocusableViewId = (int)(newValue as View)?.GetId(); } else { view.RightFocusableViewId = -1; } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var view = (View)bindable; - if (view.RightFocusableViewId >= 0) { return view.ConvertIdToView((uint)view.RightFocusableViewId); } + if (view.RightFocusableViewId >= 0) { return view.ConvertIdToView((uint)view.RightFocusableViewId); } return null; }); /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty UpFocusableViewProperty = BindableProperty.Create("UpFocusableView", typeof(View), typeof(View), default(View), propertyChanged: (bindable, oldValue, newValue) => + public static readonly BindableProperty UpFocusableViewProperty = BindableProperty.Create(nameof(View.UpFocusableView), typeof(View), typeof(View), default(View), propertyChanged: (bindable, oldValue, newValue) => { var view = (View)bindable; + if (newValue != null) { view.UpFocusableViewId = (int)(newValue as View).GetId(); } - else { view.UpFocusableViewId = -1; } + else { view.UpFocusableViewId = -1; } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var view = (View)bindable; if (view.UpFocusableViewId >= 0) { return view.ConvertIdToView((uint)view.UpFocusableViewId); } @@ -457,13 +464,13 @@ namespace Tizen.NUI.BaseComponents }); /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty DownFocusableViewProperty = BindableProperty.Create("DownFocusableView", typeof(View), typeof(View), default(View), propertyChanged: (bindable, oldValue, newValue) => + public static readonly BindableProperty DownFocusableViewProperty = BindableProperty.Create(nameof(View.DownFocusableView), typeof(View), typeof(View), default(View), propertyChanged: (bindable, oldValue, newValue) => { var view = (View)bindable; - if (newValue != null) { view.DownFocusableViewId = (int)(newValue as View).GetId(); } + if (newValue != null) { view.DownFocusableViewId = (int)(newValue as View)?.GetId(); } else { view.DownFocusableViewId = -1; } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var view = (View)bindable; if (view.DownFocusableViewId >= 0) { return view.ConvertIdToView((uint)view.DownFocusableViewId); } @@ -474,24 +481,24 @@ namespace Tizen.NUI.BaseComponents public static readonly BindableProperty FocusableProperty = BindableProperty.Create("Focusable", typeof(bool), typeof(View), false, propertyChanged: (bindable, oldValue, newValue) => { var view = (View)bindable; - if (newValue != null) { view.SetKeyboardFocusable((bool)newValue); } + if (newValue != null) { view.SetKeyboardFocusable((bool)newValue); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var view = (View)bindable; return view.IsKeyboardFocusable(); }); /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty Size2DProperty = BindableProperty.Create("Size2D", typeof(Size2D), typeof(View), new Size2D(0,0), propertyChanged: (bindable, oldValue, newValue) => + public static readonly BindableProperty Size2DProperty = BindableProperty.Create("Size2D", typeof(Size2D), typeof(View), new Size2D(0, 0), propertyChanged: (bindable, oldValue, newValue) => { var view = (View)bindable; if (newValue != null) { - Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.SIZE, new Tizen.NUI.PropertyValue( new Size((Size2D)newValue))); + Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.SIZE, new Tizen.NUI.PropertyValue(new Size((Size2D)newValue))); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var view = (View)bindable; Size temp = new Size(0.0f, 0.0f, 0.0f); @@ -509,7 +516,7 @@ namespace Tizen.NUI.BaseComponents Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.OPACITY, new Tizen.NUI.PropertyValue((float)newValue)); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var view = (View)bindable; float temp = 0.0f; @@ -518,15 +525,15 @@ namespace Tizen.NUI.BaseComponents }); /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty Position2DProperty = BindableProperty.Create("Position2D", typeof(Position2D), typeof(View), new Position2D(0,0), propertyChanged: (bindable, oldValue, newValue) => + public static readonly BindableProperty Position2DProperty = BindableProperty.Create("Position2D", typeof(Position2D), typeof(View), new Position2D(0, 0), propertyChanged: (bindable, oldValue, newValue) => { var view = (View)bindable; if (newValue != null) { - Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.POSITION, new Tizen.NUI.PropertyValue( new Position((Position2D)newValue) )); + Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.POSITION, new Tizen.NUI.PropertyValue(new Position((Position2D)newValue))); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var view = (View)bindable; Position temp = new Position(0.0f, 0.0f, 0.0f); @@ -543,7 +550,7 @@ namespace Tizen.NUI.BaseComponents Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.POSITION_USES_ANCHOR_POINT, new Tizen.NUI.PropertyValue((bool)newValue)); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var view = (View)bindable; bool temp = false; @@ -559,7 +566,7 @@ namespace Tizen.NUI.BaseComponents if (newValue != null) { value = (int)newValue; - if(value < 0) + if (value < 0) { NUILog.Error("SiblingOrder should be bigger than 0 or equal to 0."); return; @@ -581,7 +588,7 @@ namespace Tizen.NUI.BaseComponents } } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var view = (View)bindable; var parentChildren = view.GetParent()?.Children; @@ -606,7 +613,7 @@ namespace Tizen.NUI.BaseComponents Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.PARENT_ORIGIN, new Tizen.NUI.PropertyValue((Position)newValue)); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var view = (View)bindable; Position temp = new Position(0.0f, 0.0f, 0.0f); @@ -624,7 +631,7 @@ namespace Tizen.NUI.BaseComponents Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.ANCHOR_POINT, new Tizen.NUI.PropertyValue((Position)newValue)); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var view = (View)bindable; Position temp = new Position(0.0f, 0.0f, 0.0f); @@ -641,7 +648,7 @@ namespace Tizen.NUI.BaseComponents Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.SIZE_WIDTH, new Tizen.NUI.PropertyValue((float)newValue)); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var view = (View)bindable; float temp = 0.0f; @@ -658,7 +665,7 @@ namespace Tizen.NUI.BaseComponents Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.SIZE_HEIGHT, new Tizen.NUI.PropertyValue((float)newValue)); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var view = (View)bindable; float temp = 0.0f; @@ -675,7 +682,7 @@ namespace Tizen.NUI.BaseComponents Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.POSITION, new Tizen.NUI.PropertyValue((Position)newValue)); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var view = (View)bindable; Position temp = new Position(0.0f, 0.0f, 0.0f); @@ -692,7 +699,7 @@ namespace Tizen.NUI.BaseComponents Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.POSITION_X, new Tizen.NUI.PropertyValue((float)newValue)); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var view = (View)bindable; float temp = 0.0f; @@ -709,7 +716,7 @@ namespace Tizen.NUI.BaseComponents Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.POSITION_Y, new Tizen.NUI.PropertyValue((float)newValue)); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var view = (View)bindable; float temp = 0.0f; @@ -726,7 +733,7 @@ namespace Tizen.NUI.BaseComponents Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.POSITION_Z, new Tizen.NUI.PropertyValue((float)newValue)); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var view = (View)bindable; float temp = 0.0f; @@ -743,7 +750,7 @@ namespace Tizen.NUI.BaseComponents Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.ORIENTATION, new Tizen.NUI.PropertyValue((Rotation)newValue)); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var view = (View)bindable; Rotation temp = new Rotation(); @@ -760,7 +767,7 @@ namespace Tizen.NUI.BaseComponents Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.SCALE, new Tizen.NUI.PropertyValue((Vector3)newValue)); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var view = (View)bindable; Vector3 temp = new Vector3(0.0f, 0.0f, 0.0f); @@ -777,7 +784,7 @@ namespace Tizen.NUI.BaseComponents Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.SCALE_X, new Tizen.NUI.PropertyValue((float)newValue)); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var view = (View)bindable; float temp = 0.0f; @@ -794,7 +801,7 @@ namespace Tizen.NUI.BaseComponents Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.SCALE_Y, new Tizen.NUI.PropertyValue((float)newValue)); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var view = (View)bindable; float temp = 0.0f; @@ -811,7 +818,7 @@ namespace Tizen.NUI.BaseComponents Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.SCALE_Z, new Tizen.NUI.PropertyValue((float)newValue)); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var view = (View)bindable; float temp = 0.0f; @@ -828,7 +835,7 @@ namespace Tizen.NUI.BaseComponents Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.NAME, new Tizen.NUI.PropertyValue((string)newValue)); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var view = (View)bindable; string temp; @@ -845,7 +852,7 @@ namespace Tizen.NUI.BaseComponents Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.SENSITIVE, new Tizen.NUI.PropertyValue((bool)newValue)); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var view = (View)bindable; bool temp = false; @@ -862,7 +869,7 @@ namespace Tizen.NUI.BaseComponents Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.LEAVE_REQUIRED, new Tizen.NUI.PropertyValue((bool)newValue)); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var view = (View)bindable; bool temp = false; @@ -879,7 +886,7 @@ namespace Tizen.NUI.BaseComponents Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.INHERIT_ORIENTATION, new Tizen.NUI.PropertyValue((bool)newValue)); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var view = (View)bindable; bool temp = false; @@ -896,7 +903,7 @@ namespace Tizen.NUI.BaseComponents Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.INHERIT_SCALE, new Tizen.NUI.PropertyValue((bool)newValue)); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var view = (View)bindable; bool temp = false; @@ -913,7 +920,7 @@ namespace Tizen.NUI.BaseComponents Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.DRAW_MODE, new Tizen.NUI.PropertyValue((int)newValue)); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var view = (View)bindable; string temp; @@ -939,7 +946,7 @@ namespace Tizen.NUI.BaseComponents Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.SIZE_MODE_FACTOR, new Tizen.NUI.PropertyValue((Vector3)newValue)); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var view = (View)bindable; Vector3 temp = new Vector3(0.0f, 0.0f, 0.0f); @@ -956,7 +963,7 @@ namespace Tizen.NUI.BaseComponents Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.WIDTH_RESIZE_POLICY, new Tizen.NUI.PropertyValue((int)newValue)); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var view = (View)bindable; string temp; @@ -987,7 +994,7 @@ namespace Tizen.NUI.BaseComponents Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.HEIGHT_RESIZE_POLICY, new Tizen.NUI.PropertyValue((int)newValue)); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var view = (View)bindable; string temp; @@ -998,7 +1005,7 @@ namespace Tizen.NUI.BaseComponents switch (temp) { case "FIXED": return ResizePolicyType.Fixed; - case "USE_NATURAL_SIZE": return ResizePolicyType.UseNaturalSize; + case "USE_NATURAL_SIZE": return ResizePolicyType.UseNaturalSize; case "FILL_TO_PARENT": return ResizePolicyType.FillToParent; case "SIZE_RELATIVE_TO_PARENT": return ResizePolicyType.SizeRelativeToParent; case "SIZE_FIXED_OFFSET_FROM_PARENT": return ResizePolicyType.SizeFixedOffsetFromParent; @@ -1026,7 +1033,7 @@ namespace Tizen.NUI.BaseComponents Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.SIZE_SCALE_POLICY, new Tizen.NUI.PropertyValue(valueToString)); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var view = (View)bindable; string temp; @@ -1052,7 +1059,7 @@ namespace Tizen.NUI.BaseComponents Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.WIDTH_FOR_HEIGHT, new Tizen.NUI.PropertyValue((bool)newValue)); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var view = (View)bindable; bool temp = false; @@ -1069,7 +1076,7 @@ namespace Tizen.NUI.BaseComponents Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.HEIGHT_FOR_WIDTH, new Tizen.NUI.PropertyValue((bool)newValue)); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var view = (View)bindable; bool temp = false; @@ -1078,7 +1085,7 @@ namespace Tizen.NUI.BaseComponents }); /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty PaddingProperty = BindableProperty.Create("Padding", typeof(Extents), typeof(View), new Extents(0,0,0,0), propertyChanged: (bindable, oldValue, newValue) => + public static readonly BindableProperty PaddingProperty = BindableProperty.Create("Padding", typeof(Extents), typeof(View), new Extents(0, 0, 0, 0), propertyChanged: (bindable, oldValue, newValue) => { var view = (View)bindable; if (newValue != null) @@ -1086,7 +1093,7 @@ namespace Tizen.NUI.BaseComponents Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.PADDING, new Tizen.NUI.PropertyValue((Extents)newValue)); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var view = (View)bindable; Extents temp = new Extents(0, 0, 0, 0); @@ -1095,7 +1102,7 @@ namespace Tizen.NUI.BaseComponents }); /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty SizeProperty = BindableProperty.Create("Size", typeof(Size), typeof(View), new Size(0,0,0), propertyChanged: (bindable, oldValue, newValue) => + public static readonly BindableProperty SizeProperty = BindableProperty.Create("Size", typeof(Size), typeof(View), new Size(0, 0, 0), propertyChanged: (bindable, oldValue, newValue) => { var view = (View)bindable; if (newValue != null) @@ -1103,7 +1110,8 @@ namespace Tizen.NUI.BaseComponents Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.SIZE, new Tizen.NUI.PropertyValue((Size)newValue)); } }, - defaultValueCreator: (bindable) => { + defaultValueCreator: (bindable) => + { var view = (View)bindable; Size temp = new Size(0, 0, 0); Tizen.NUI.Object.GetProperty(view.swigCPtr, View.Property.SIZE).Get(temp); @@ -1111,7 +1119,7 @@ namespace Tizen.NUI.BaseComponents }); /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty MinimumSizeProperty = BindableProperty.Create("MinimumSize", typeof(Size2D), typeof(View), new Size2D(0,0), propertyChanged: (bindable, oldValue, newValue) => + public static readonly BindableProperty MinimumSizeProperty = BindableProperty.Create("MinimumSize", typeof(Size2D), typeof(View), new Size2D(0, 0), propertyChanged: (bindable, oldValue, newValue) => { var view = (View)bindable; if (newValue != null) @@ -1119,7 +1127,7 @@ namespace Tizen.NUI.BaseComponents Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.MINIMUM_SIZE, new Tizen.NUI.PropertyValue((Size2D)newValue)); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var view = (View)bindable; Size2D temp = new Size2D(0, 0); @@ -1128,7 +1136,7 @@ namespace Tizen.NUI.BaseComponents }); /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty MaximumSizeProperty = BindableProperty.Create("MaximumSize", typeof(Size2D), typeof(View), new Size2D(0,0), propertyChanged: (bindable, oldValue, newValue) => + public static readonly BindableProperty MaximumSizeProperty = BindableProperty.Create("MaximumSize", typeof(Size2D), typeof(View), new Size2D(0, 0), propertyChanged: (bindable, oldValue, newValue) => { var view = (View)bindable; if (newValue != null) @@ -1136,7 +1144,7 @@ namespace Tizen.NUI.BaseComponents Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.MAXIMUM_SIZE, new Tizen.NUI.PropertyValue((Size2D)newValue)); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var view = (View)bindable; Size2D temp = new Size2D(0, 0); @@ -1153,7 +1161,7 @@ namespace Tizen.NUI.BaseComponents Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.INHERIT_POSITION, new Tizen.NUI.PropertyValue((bool)newValue)); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var view = (View)bindable; bool temp = false; @@ -1170,7 +1178,7 @@ namespace Tizen.NUI.BaseComponents Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.CLIPPING_MODE, new Tizen.NUI.PropertyValue((int)newValue)); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var view = (View)bindable; int temp = 0; @@ -1190,7 +1198,7 @@ namespace Tizen.NUI.BaseComponents Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.INHERIT_LAYOUT_DIRECTION, new Tizen.NUI.PropertyValue((bool)newValue)); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var view = (View)bindable; bool temp = false; @@ -1207,7 +1215,7 @@ namespace Tizen.NUI.BaseComponents Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.LAYOUT_DIRECTION, new Tizen.NUI.PropertyValue((int)newValue)); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var view = (View)bindable; int temp; @@ -1219,7 +1227,7 @@ namespace Tizen.NUI.BaseComponents }); /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty MarginProperty = BindableProperty.Create("Margin", typeof(Extents), typeof(View), new Extents(0,0,0,0), propertyChanged: (bindable, oldValue, newValue) => + public static readonly BindableProperty MarginProperty = BindableProperty.Create("Margin", typeof(Extents), typeof(View), new Extents(0, 0, 0, 0), propertyChanged: (bindable, oldValue, newValue) => { var view = (View)bindable; if (newValue != null) @@ -1227,7 +1235,7 @@ namespace Tizen.NUI.BaseComponents Tizen.NUI.Object.SetProperty(view.swigCPtr, View.Property.MARGIN, new Tizen.NUI.PropertyValue((Extents)newValue)); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var view = (View)bindable; Extents temp = new Extents(0, 0, 0, 0); @@ -1236,13 +1244,59 @@ namespace Tizen.NUI.BaseComponents }); /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] - public static readonly BindableProperty StyleProperty = BindableProperty.Create("Style", typeof(Style), typeof(View), default(Style), - propertyChanged: (bindable, oldvalue, newvalue) => ((View)bindable)._mergedStyle.Style = (Style)newvalue); - + public static readonly BindableProperty StyleProperty = BindableProperty.Create("Style", typeof(Style), typeof(View), default(Style), propertyChanged: (bindable, oldvalue, newvalue) => ((View)bindable)._mergedStyle.Style = (Style)newvalue); + internal readonly MergedStyle _mergedStyle; + /// + /// Flag to allow Layouting to be disabled for Views. + /// Once a View has a Layout set then any children added to Views from then on will receive + /// automatic Layouts. + /// + private static bool layoutingDisabled = true; private global::System.Runtime.InteropServices.HandleRef swigCPtr; private bool layoutSet = false; // Flag to indicate if SetLayout was called or View was automatically given a Layout + private bool _backgroundImageSynchronosLoading = false; + private EventHandler _offWindowEventHandler; + private OffWindowEventCallbackType _offWindowEventCallback; + private EventHandlerWithReturnType _wheelEventHandler; + private WheelEventCallbackType _wheelEventCallback; + private EventHandlerWithReturnType _keyEventHandler; + private KeyCallbackType _keyCallback; + private EventHandlerWithReturnType _touchDataEventHandler; + private TouchDataCallbackType _touchDataCallback; + private EventHandlerWithReturnType _hoverEventHandler; + private HoverEventCallbackType _hoverEventCallback; + private EventHandler _visibilityChangedEventHandler; + private VisibilityChangedEventCallbackType _visibilityChangedEventCallback; + private EventHandler _keyInputFocusGainedEventHandler; + private KeyInputFocusGainedCallbackType _keyInputFocusGainedCallback; + private EventHandler _keyInputFocusLostEventHandler; + private KeyInputFocusLostCallbackType _keyInputFocusLostCallback; + private EventHandler _onRelayoutEventHandler; + private OnRelayoutEventCallbackType _onRelayoutEventCallback; + private EventHandler _onWindowEventHandler; + private OnWindowEventCallbackType _onWindowEventCallback; + private EventHandler _layoutDirectionChangedEventHandler; + private LayoutDirectionChangedEventCallbackType _layoutDirectionChangedEventCallback; + // Resource Ready Signal + private EventHandler _resourcesLoadedEventHandler; + private ResourcesLoadedCallbackType _ResourcesLoadedCallback; + private EventHandler _backgroundResourceLoadedEventHandler; + private _backgroundResourceLoadedCallbackType _backgroundResourceLoadedCallback; + + /// + /// Creates a new instance of a view. + /// + /// 3 + public View() : this(NDalicPINVOKE.View_New(), true) + { + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + internal View(View uiControl) : this(NDalicPINVOKE.new_View__SWIG_1(View.getCPtr(uiControl)), true) + { + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } internal View(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.View_SWIGUpcast(cPtr), cMemoryOwn) { @@ -1254,1605 +1308,2321 @@ namespace Tizen.NUI.BaseComponents _mergedStyle = new MergedStyle(GetType(), this); } - internal static global::System.Runtime.InteropServices.HandleRef getCPtr(View obj) + internal View(ViewImpl implementation) : this(NDalicPINVOKE.new_View__SWIG_2(ViewImpl.getCPtr(implementation)), true) { - return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } + [UnmanagedFunctionPointer(CallingConvention.StdCall)] + private delegate void OffWindowEventCallbackType(IntPtr control); + [UnmanagedFunctionPointer(CallingConvention.StdCall)] + private delegate bool WheelEventCallbackType(IntPtr view, IntPtr wheelEvent); + [UnmanagedFunctionPointer(CallingConvention.StdCall)] + private delegate bool KeyCallbackType(IntPtr control, IntPtr keyEvent); + [UnmanagedFunctionPointer(CallingConvention.StdCall)] + private delegate bool TouchDataCallbackType(IntPtr view, IntPtr touchData); + [UnmanagedFunctionPointer(CallingConvention.StdCall)] + private delegate bool HoverEventCallbackType(IntPtr view, IntPtr hoverEvent); + [UnmanagedFunctionPointer(CallingConvention.StdCall)] + private delegate void VisibilityChangedEventCallbackType(IntPtr data, bool visibility, VisibilityChangeType type); + [UnmanagedFunctionPointer(CallingConvention.StdCall)] + private delegate void ResourcesLoadedCallbackType(IntPtr control); + [UnmanagedFunctionPointer(CallingConvention.StdCall)] + private delegate void _backgroundResourceLoadedCallbackType(IntPtr view); + [UnmanagedFunctionPointer(CallingConvention.StdCall)] + private delegate void KeyInputFocusGainedCallbackType(IntPtr control); + [UnmanagedFunctionPointer(CallingConvention.StdCall)] + private delegate void KeyInputFocusLostCallbackType(IntPtr control); + [UnmanagedFunctionPointer(CallingConvention.StdCall)] + private delegate void OnRelayoutEventCallbackType(IntPtr control); + [UnmanagedFunctionPointer(CallingConvention.StdCall)] + private delegate void OnWindowEventCallbackType(IntPtr control); + [UnmanagedFunctionPointer(CallingConvention.StdCall)] + private delegate void LayoutDirectionChangedEventCallbackType(IntPtr data, ViewLayoutDirectionType type); + /// - /// Event argument passed through the ChildAdded event. + /// Event when a child is removed. /// /// 5 - public class ChildAddedEventArgs : EventArgs - { - /// - /// Added child view at moment. - /// - /// 5 - public View Added { get; set; } - } - + public new event EventHandler ChildRemoved; /// /// Event when a child is added. /// /// 5 public new event EventHandler ChildAdded; - // From Container Base class /// - /// Adds a child view to this view. + /// An event for the KeyInputFocusGained signal which can be used to subscribe or unsubscribe the event handler provided by the user.
+ /// The KeyInputFocusGained signal is emitted when the control gets the key input focus.
///
- /// - /// 4 - public override void Add(View child) + /// 3 + public event EventHandler FocusGained { - if (null == child) + add { - Tizen.Log.Fatal("NUI", "Child is null"); - return; - } + if (_keyInputFocusGainedEventHandler == null) + { + _keyInputFocusGainedCallback = OnKeyInputFocusGained; + this.KeyInputFocusGainedSignal().Connect(_keyInputFocusGainedCallback); + } - Log.Info("NUI", "Adding Child:" + child.Name + " to " + Name + "\n"); + _keyInputFocusGainedEventHandler += value; + } - Container oldParent = child.GetParent(); - if (oldParent != this) + remove { - if (oldParent != null) - { - oldParent.Remove(child); - } - child.InternalParent = this; + _keyInputFocusGainedEventHandler -= value; - // Only give children a layout if their parent is an explicit container or a pure View. - // Pure View meaning not derived from a View, e.g a Legacy container. - // layoutSet flag is true when the View became a layout using the set Layout API opposed to automatically due to it's parent. - // First time the set Layout API is used by any View the Window no longer has layoutingDisabled. - if ((true == layoutSet || GetType() == typeof(View)) && null == child.Layout && false == layoutingDisabled ) + if (_keyInputFocusGainedEventHandler == null && KeyInputFocusGainedSignal().Empty() == false) { - Log.Info("NUI", "Parent[" + Name + "] Layout set[" + layoutSet.ToString() + "] Pure View[" + (!layoutSet).ToString() + "]\n"); - // If child is a View or explicitly set to require layouting then set child as a LayoutGroup. - // If the child is derived from a View then it may be a legacy or existing container hence will do layouting itself. - if( child.GetType() == typeof(View) || true == child.LayoutingRequired ) - { - Log.Info("NUI", "Creating LayoutGroup for " + child.Name + " LayoutingRequired[" + child.LayoutingRequired.ToString() + "]\n"); - child.SetLayout( new LayoutGroup() ); - } - else - { - // Adding child as a leaf, layouting will not propagate past this child. - // Legacy containers will be a LayoutItems too and layout their children how they wish. - Log.Info("NUI", "Creating LayoutItem for " + child.Name + "\n"); - child.SetLayout( new LayoutItem() ); - } + this.KeyInputFocusGainedSignal().Disconnect(_keyInputFocusGainedCallback); } + } + } - if (Layout) + /// + /// An event for the KeyInputFocusLost signal which can be used to subscribe or unsubscribe the event handler provided by the user.
+ /// The KeyInputFocusLost signal is emitted when the control loses the key input focus.
+ ///
+ /// 3 + public event EventHandler FocusLost + { + add + { + if (_keyInputFocusLostEventHandler == null) { - Layout.LayoutChildren.Add(child.Layout); + _keyInputFocusLostCallback = OnKeyInputFocusLost; + this.KeyInputFocusLostSignal().Connect(_keyInputFocusLostCallback); } - NDalicPINVOKE.Actor_Add(swigCPtr, View.getCPtr(child)); - if (NDalicPINVOKE.SWIGPendingException.Pending) - throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - Children.Add(child); + _keyInputFocusLostEventHandler += value; + } - if (ChildAdded != null) + remove + { + _keyInputFocusLostEventHandler -= value; + + if (_keyInputFocusLostEventHandler == null && KeyInputFocusLostSignal().Empty() == false) { - ChildAddedEventArgs e = new ChildAddedEventArgs - { - Added = child - }; - ChildAdded(this, e); + this.KeyInputFocusLostSignal().Disconnect(_keyInputFocusLostCallback); } } } /// - /// Event argument passed through the ChildRemoved event. + /// An event for the KeyPressed signal which can be used to subscribe or unsubscribe the event handler provided by the user.
+ /// The KeyPressed signal is emitted when the key event is received.
///
- /// 5 - public class ChildRemovedEventArgs : EventArgs + /// 3 + public event EventHandlerWithReturnType KeyEvent { - /// - /// Removed child view at moment. - /// - /// 5 - public View Removed { get; set; } - } + add + { + if (_keyEventHandler == null) + { + _keyCallback = OnKeyEvent; + this.KeyEventSignal().Connect(_keyCallback); + } - /// - /// Event when a child is removed. - /// - /// 5 - public new event EventHandler ChildRemoved; + _keyEventHandler += value; + } + + remove + { + _keyEventHandler -= value; + if (_keyEventHandler == null && KeyEventSignal().Empty() == false) + { + this.KeyEventSignal().Disconnect(_keyCallback); + } + } + } /// - /// Removes a child view from this View. If the view was not a child of this view, this is a no-op. + /// An event for the OnRelayout signal which can be used to subscribe or unsubscribe the event handler.
+ /// The OnRelayout signal is emitted after the size has been set on the view during relayout.
///
- /// - /// 4 - public override void Remove(View child) + /// 3 + public event EventHandler Relayout { - NDalicPINVOKE.Actor_Remove(swigCPtr, View.getCPtr(child)); - if (NDalicPINVOKE.SWIGPendingException.Pending) - throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - - Children.Remove(child); - child.InternalParent = null; - - if (Layout) + add { - if(child.Layout) + if (_onRelayoutEventHandler == null) { - Layout.LayoutChildren.Remove(child.Layout); + _onRelayoutEventCallback = OnRelayout; + this.OnRelayoutSignal().Connect(_onRelayoutEventCallback); } + + _onRelayoutEventHandler += value; } - if (ChildRemoved != null) + remove { - ChildRemovedEventArgs e = new ChildRemovedEventArgs + _onRelayoutEventHandler -= value; + + if (_onRelayoutEventHandler == null && OnRelayoutSignal().Empty() == false) { - Removed = child - }; - ChildRemoved(this, e); + this.OnRelayoutSignal().Disconnect(_onRelayoutEventCallback); + } + } } /// - /// Retrieves a child view by index. + /// An event for the touched signal which can be used to subscribe or unsubscribe the event handler provided by the user.
+ /// The touched signal is emitted when the touch input is received.
///
- /// - /// 4 - public override View GetChildAt(uint index) + /// 3 + public event EventHandlerWithReturnType TouchEvent { - if (index < Children.Count) + add { - return Children[Convert.ToInt32(index)]; + if (_touchDataEventHandler == null) + { + _touchDataCallback = OnTouch; + this.TouchSignal().Connect(_touchDataCallback); + } + + _touchDataEventHandler += value; } - else + + remove { - return null; + _touchDataEventHandler -= value; + + if (_touchDataEventHandler == null && TouchSignal().Empty() == false) + { + this.TouchSignal().Disconnect(_touchDataCallback); + } + } } /// - /// Retrieves the number of children held by the view. + /// An event for the hovered signal which can be used to subscribe or unsubscribe the event handler provided by the user.
+ /// The hovered signal is emitted when the hover input is received.
///
- /// - /// 4 - public override uint GetChildCount() + /// 3 + public event EventHandlerWithReturnType HoverEvent { - return Convert.ToUInt32(Children.Count); - } + add + { + if (_hoverEventHandler == null) + { + _hoverEventCallback = OnHoverEvent; + this.HoveredSignal().Connect(_hoverEventCallback); + } - /// - /// Gets the views parent. - /// - /// - /// 4 - public override Container GetParent() - { - return this.InternalParent as Container; - } + _hoverEventHandler += value; + } - internal bool IsTopLevelView() - { - if (GetParent() is Layer) + remove { - return true; + _hoverEventHandler -= value; + + if (_hoverEventHandler == null && HoveredSignal().Empty() == false) + { + this.HoveredSignal().Disconnect(_hoverEventCallback); + } + } - return false; } /// - /// you can override it to clean-up your own resources. + /// An event for the WheelMoved signal which can be used to subscribe or unsubscribe the event handler provided by the user.
+ /// The WheelMoved signal is emitted when the wheel event is received.
///
- /// DisposeTypes /// 3 - protected override void Dispose(DisposeTypes type) + public event EventHandlerWithReturnType WheelEvent { - if (disposed) + add { - return; - } + if (_wheelEventHandler == null) + { + _wheelEventCallback = OnWheelEvent; + this.WheelEventSignal().Connect(_wheelEventCallback); + } - if (type == DisposeTypes.Explicit) - { - //Called by User - //Release your own managed resources here. - //You should release all of your own disposable objects here. + _wheelEventHandler += value; } - //Release your own unmanaged resources here. - //You should not access any managed member here except static instance. - //because the execution order of Finalizes is non-deterministic. - if (this != null) + remove { - DisConnectFromSignals(); - } + _wheelEventHandler -= value; - if (swigCPtr.Handle != global::System.IntPtr.Zero) - { - if (swigCMemOwn) + if (_wheelEventHandler == null && WheelEventSignal().Empty() == false) { - swigCMemOwn = false; - NDalicPINVOKE.delete_View(swigCPtr); + this.WheelEventSignal().Disconnect(_wheelEventCallback); } - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); - } - foreach (View view in Children) - { - view.InternalParent = null; } - - base.Dispose(type); - } - private void DisConnectFromSignals() + /// + /// An event for the OnWindow signal which can be used to subscribe or unsubscribe the event handler.
+ /// The OnWindow signal is emitted after the view has been connected to the window.
+ ///
+ /// 3 + public event EventHandler AddedToWindow { - // Save current CPtr. - global::System.Runtime.InteropServices.HandleRef currentCPtr = swigCPtr; - - // Use BaseHandle CPtr as current might have been deleted already in derived classes. - swigCPtr = GetBaseHandleCPtrHandleRef; - - if (_onRelayoutEventCallback != null) + add { - this.OnRelayoutSignal().Disconnect(_onRelayoutEventCallback); - } + if (_onWindowEventHandler == null) + { + _onWindowEventCallback = OnWindow; + this.OnWindowSignal().Connect(_onWindowEventCallback); + } - if (_offWindowEventCallback != null) - { - this.OffWindowSignal().Disconnect(_offWindowEventCallback); + _onWindowEventHandler += value; } - if (_onWindowEventCallback != null) + remove { - this.OnWindowSignal().Disconnect(_onWindowEventCallback); - } + _onWindowEventHandler -= value; - if (_wheelEventCallback != null) - { - this.WheelEventSignal().Disconnect(_wheelEventCallback); + if (_onWindowEventHandler == null && OnWindowSignal().Empty() == false) + { + this.OnWindowSignal().Disconnect(_onWindowEventCallback); + } } + } - if (_hoverEventCallback != null) + /// + /// An event for the OffWindow signal, which can be used to subscribe or unsubscribe the event handler.
+ /// OffWindow signal is emitted after the view has been disconnected from the window.
+ ///
+ /// 3 + public event EventHandler RemovedFromWindow + { + add { - this.HoveredSignal().Disconnect(_hoverEventCallback); - } + if (_offWindowEventHandler == null) + { + _offWindowEventCallback = OffWindow; + this.OffWindowSignal().Connect(_offWindowEventCallback); + } - if (_touchDataCallback != null) - { - this.TouchSignal().Disconnect(_touchDataCallback); + _offWindowEventHandler += value; } - if (_ResourcesLoadedCallback != null) + remove { - this.ResourcesLoadedSignal().Disconnect(_ResourcesLoadedCallback); - } + _offWindowEventHandler -= value; - if (_offWindowEventCallback != null) - { - this.OffWindowSignal().Disconnect(_offWindowEventCallback); + if (_offWindowEventHandler == null && OffWindowSignal().Empty() == false) + { + this.OffWindowSignal().Disconnect(_offWindowEventCallback); + } } + } - if (_onWindowEventCallback != null) + /// + /// An event for visibility change which can be used to subscribe or unsubscribe the event handler.
+ /// This signal is emitted when the visible property of this or a parent view is changed.
+ ///
+ /// 3 + public event EventHandler VisibilityChanged + { + add { - this.OnWindowSignal().Disconnect(_onWindowEventCallback); - } - - if (_wheelEventCallback != null) - { - this.WheelEventSignal().Disconnect(_wheelEventCallback); - } + if (_visibilityChangedEventHandler == null) + { + _visibilityChangedEventCallback = OnVisibilityChanged; + VisibilityChangedSignal(this).Connect(_visibilityChangedEventCallback); + } - if (_hoverEventCallback != null) - { - this.HoveredSignal().Disconnect(_hoverEventCallback); + _visibilityChangedEventHandler += value; } - if (_touchDataCallback != null) + remove { - this.TouchSignal().Disconnect(_touchDataCallback); - } + _visibilityChangedEventHandler -= value; - if (_onRelayoutEventCallback != null) - { - this.OnRelayoutSignal().Disconnect(_onRelayoutEventCallback); + if (_visibilityChangedEventHandler == null && VisibilityChangedSignal(this).Empty() == false) + { + VisibilityChangedSignal(this).Disconnect(_visibilityChangedEventCallback); + } } + } - if (_keyCallback != null) + /// + /// Event for layout direction change which can be used to subscribe/unsubscribe the event handler.
+ /// This signal is emitted when the layout direction property of this or a parent view is changed.
+ ///
+ /// 4 + public event EventHandler LayoutDirectionChanged + { + add { - this.KeyEventSignal().Disconnect(_keyCallback); - } + if (_layoutDirectionChangedEventHandler == null) + { + _layoutDirectionChangedEventCallback = OnLayoutDirectionChanged; + LayoutDirectionChangedSignal(this).Connect(_layoutDirectionChangedEventCallback); + } - if (_keyInputFocusLostCallback != null) - { - this.KeyInputFocusLostSignal().Disconnect(_keyInputFocusLostCallback); + _layoutDirectionChangedEventHandler += value; } - if (_keyInputFocusGainedCallback != null) + remove { - this.KeyInputFocusGainedSignal().Disconnect(_keyInputFocusGainedCallback); - } + _layoutDirectionChangedEventHandler -= value; - if (_backgroundResourceLoadedCallback != null) - { - this.ResourcesLoadedSignal().Disconnect(_backgroundResourceLoadedCallback); + if (_layoutDirectionChangedEventHandler == null && LayoutDirectionChangedSignal(this).Empty() == false) + { + LayoutDirectionChangedSignal(this).Disconnect(_layoutDirectionChangedEventCallback); + } } - - // BaseHandle CPtr is used in Registry and there is danger of deletion if we keep using it here. - // Restore current CPtr. - swigCPtr = currentCPtr; } - private EventHandler _keyInputFocusGainedEventHandler; - [UnmanagedFunctionPointer(CallingConvention.StdCall)] - private delegate void KeyInputFocusGainedCallbackType(IntPtr control); - private KeyInputFocusGainedCallbackType _keyInputFocusGainedCallback; - /// - /// An event for the KeyInputFocusGained signal which can be used to subscribe or unsubscribe the event handler provided by the user.
- /// The KeyInputFocusGained signal is emitted when the control gets the key input focus.
+ /// An event for the ResourcesLoadedSignal signal which can be used to subscribe or unsubscribe the event handler provided by the user.
+ /// This signal is emitted after all resources required by a view are loaded and ready.
///
/// 3 - public event EventHandler FocusGained + public event EventHandler ResourcesLoaded { add { - if (_keyInputFocusGainedEventHandler == null) + if (_resourcesLoadedEventHandler == null) { - _keyInputFocusGainedCallback = OnKeyInputFocusGained; - this.KeyInputFocusGainedSignal().Connect(_keyInputFocusGainedCallback); + _ResourcesLoadedCallback = OnResourcesLoaded; + this.ResourcesLoadedSignal().Connect(_ResourcesLoadedCallback); } - _keyInputFocusGainedEventHandler += value; + _resourcesLoadedEventHandler += value; } remove { - _keyInputFocusGainedEventHandler -= value; + _resourcesLoadedEventHandler -= value; - if (_keyInputFocusGainedEventHandler == null && KeyInputFocusGainedSignal().Empty() == false) + if (_resourcesLoadedEventHandler == null && ResourcesLoadedSignal().Empty() == false) { - this.KeyInputFocusGainedSignal().Disconnect(_keyInputFocusGainedCallback); + this.ResourcesLoadedSignal().Disconnect(_ResourcesLoadedCallback); } } } - private void OnKeyInputFocusGained(IntPtr view) - { - if (_keyInputFocusGainedEventHandler != null) - { - _keyInputFocusGainedEventHandler(this, null); - } - } - - - private EventHandler _keyInputFocusLostEventHandler; - [UnmanagedFunctionPointer(CallingConvention.StdCall)] - private delegate void KeyInputFocusLostCallbackType(IntPtr control); - private KeyInputFocusLostCallbackType _keyInputFocusLostCallback; - - /// - /// An event for the KeyInputFocusLost signal which can be used to subscribe or unsubscribe the event handler provided by the user.
- /// The KeyInputFocusLost signal is emitted when the control loses the key input focus.
- ///
- /// 3 - public event EventHandler FocusLost + internal event EventHandler BackgroundResourceLoaded { add { - if (_keyInputFocusLostEventHandler == null) + if (_backgroundResourceLoadedEventHandler == null) { - _keyInputFocusLostCallback = OnKeyInputFocusLost; - this.KeyInputFocusLostSignal().Connect(_keyInputFocusLostCallback); + _backgroundResourceLoadedCallback = OnBackgroundResourceLoaded; + this.ResourcesLoadedSignal().Connect(_backgroundResourceLoadedCallback); } - _keyInputFocusLostEventHandler += value; + _backgroundResourceLoadedEventHandler += value; } - remove { - _keyInputFocusLostEventHandler -= value; + _backgroundResourceLoadedEventHandler -= value; - if (_keyInputFocusLostEventHandler == null && KeyInputFocusLostSignal().Empty() == false) + if (_backgroundResourceLoadedEventHandler == null && ResourcesLoadedSignal().Empty() == false) { - this.KeyInputFocusLostSignal().Disconnect(_keyInputFocusLostCallback); + this.ResourcesLoadedSignal().Disconnect(_backgroundResourceLoadedCallback); } } } - private void OnKeyInputFocusLost(IntPtr view) + /// + /// Enumeration for describing the states of the view. + /// + /// 3 + public enum States { - if (_keyInputFocusLostEventHandler != null) - { - _keyInputFocusLostEventHandler(this, null); - } + /// + /// The normal state. + /// + Normal, + /// + /// The focused state. + /// + Focused, + /// + /// The disabled state. + /// + Disabled } /// - /// Event arguments that passed via the KeyEvent signal. + /// Describes the direction to move the focus towards. /// /// 3 - public class KeyEventArgs : EventArgs + public enum FocusDirection { - private Key _key; - /// - /// Key - is the key sent to the view. + /// Move keyboard focus towards the left direction. /// /// 3 - public Key Key + Left, + /// + /// Move keyboard focus towards the right direction. + /// + /// 3 + Right, + /// + /// Move keyboard focus towards the up direction. + /// + /// 3 + Up, + /// + /// Move keyboard focus towards the down direction. + /// + /// 3 + Down, + /// + /// Move keyboard focus towards the previous page direction. + /// + /// 3 + PageUp, + /// + /// Move keyboard focus towards the next page direction. + /// + /// 3 + PageDown + } + + internal enum PropertyRange + { + PROPERTY_START_INDEX = PropertyRanges.PROPERTY_REGISTRATION_START_INDEX, + CONTROL_PROPERTY_START_INDEX = PROPERTY_START_INDEX, + CONTROL_PROPERTY_END_INDEX = CONTROL_PROPERTY_START_INDEX + 1000 + } + + /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + public bool IsResourcesCreated + { + get { - get - { - return _key; - } - set - { - _key = value; - } + return Application.Current.IsResourcesCreated; } } - private EventHandlerWithReturnType _keyEventHandler; - [UnmanagedFunctionPointer(CallingConvention.StdCall)] - private delegate bool KeyCallbackType(IntPtr control, IntPtr keyEvent); - private KeyCallbackType _keyCallback; + /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + public ResourceDictionary XamlResources + { + get + { + return Application.Current.XamlResources; + } + set + { + Application.Current.XamlResources = value; + } + } /// - /// An event for the KeyPressed signal which can be used to subscribe or unsubscribe the event handler provided by the user.
- /// The KeyPressed signal is emitted when the key event is received.
+ /// The StyleName, type string. ///
/// 3 - public event EventHandlerWithReturnType KeyEvent + public string StyleName { - add + get { - if (_keyEventHandler == null) - { - _keyCallback = OnKeyEvent; - this.KeyEventSignal().Connect(_keyCallback); - } - - _keyEventHandler += value; + return (string)GetValue(StyleNameProperty); } - - remove + set { - _keyEventHandler -= value; - - if (_keyEventHandler == null && KeyEventSignal().Empty() == false) - { - this.KeyEventSignal().Disconnect(_keyCallback); - } + SetValue(StyleNameProperty, value); + NotifyPropertyChanged(); } } - private bool OnKeyEvent(IntPtr view, IntPtr keyEvent) + /// + /// The mutually exclusive with BACKGROUND_IMAGE and BACKGROUND type Vector4. + /// + /// 3 + public Color BackgroundColor { - if (keyEvent == global::System.IntPtr.Zero) + get { - NUILog.Error("keyEvent should not be null!"); - return true; + return (Color)GetValue(BackgroundColorProperty); } - - KeyEventArgs e = new KeyEventArgs(); - - bool result = false; - - e.Key = Tizen.NUI.Key.GetKeyFromPtr(keyEvent); - - if (_keyEventHandler != null) + set { - Delegate[] delegateList = _keyEventHandler.GetInvocationList(); - - // Oring the result of each callback. - foreach (EventHandlerWithReturnType del in delegateList) - { - result |= del(this, e); - } + SetValue(BackgroundColorProperty, value); + NotifyPropertyChanged(); } - - return result; } - private EventHandler _onRelayoutEventHandler; - [UnmanagedFunctionPointer(CallingConvention.StdCall)] - private delegate void OnRelayoutEventCallbackType(IntPtr control); - private OnRelayoutEventCallbackType _onRelayoutEventCallback; - /// - /// An event for the OnRelayout signal which can be used to subscribe or unsubscribe the event handler.
- /// The OnRelayout signal is emitted after the size has been set on the view during relayout.
+ /// The mutually exclusive with BACKGROUND_COLOR and BACKGROUND type Map. ///
/// 3 - public event EventHandler Relayout + public string BackgroundImage { - add + get { - if (_onRelayoutEventHandler == null) - { - _onRelayoutEventCallback = OnRelayout; - this.OnRelayoutSignal().Connect(_onRelayoutEventCallback); - } - - _onRelayoutEventHandler += value; + return (string)GetValue(BackgroundImageProperty); } - - remove + set { - _onRelayoutEventHandler -= value; - - if (_onRelayoutEventHandler == null && OnRelayoutSignal().Empty() == false) - { - this.OnRelayoutSignal().Disconnect(_onRelayoutEventCallback); - } - + SetValue(BackgroundImageProperty, value); + NotifyPropertyChanged(); } } - // Callback for View OnRelayout signal - private void OnRelayout(IntPtr data) + /// + /// The background of view. + /// + /// 3 + public Tizen.NUI.PropertyMap Background { - if (_onRelayoutEventHandler != null) + get { - _onRelayoutEventHandler(this, null); + return (PropertyMap)GetValue(BackgroundProperty); + } + set + { + SetValue(BackgroundProperty, value); + NotifyPropertyChanged(); } } + /// - /// Event arguments that passed via the touch signal. + /// The current state of the view. /// /// 3 - public class TouchEventArgs : EventArgs + public States State { - private Touch _touch; - - /// - /// Touch - contains the information of touch points. - /// - /// 3 - public Touch Touch + get { - get - { - return _touch; - } - set - { - _touch = value; - } + return (States)GetValue(StateProperty); + } + set + { + SetValue(StateProperty, value); + NotifyPropertyChanged(); } } - private EventHandlerWithReturnType _touchDataEventHandler; - [UnmanagedFunctionPointer(CallingConvention.StdCall)] - private delegate bool TouchDataCallbackType(IntPtr view, IntPtr touchData); - private TouchDataCallbackType _touchDataCallback; - /// - /// An event for the touched signal which can be used to subscribe or unsubscribe the event handler provided by the user.
- /// The touched signal is emitted when the touch input is received.
+ /// The current sub state of the view. ///
/// 3 - public event EventHandlerWithReturnType TouchEvent + public States SubState { - add + get { - if (_touchDataEventHandler == null) - { - _touchDataCallback = OnTouch; - this.TouchSignal().Connect(_touchDataCallback); - } - - _touchDataEventHandler += value; + return (States)GetValue(SubStateProperty); } - - remove + set { - _touchDataEventHandler -= value; - - if (_touchDataEventHandler == null && TouchSignal().Empty() == false) - { - this.TouchSignal().Disconnect(_touchDataCallback); - } - + SetValue(SubStateProperty, value); + NotifyPropertyChanged(); } } - // Callback for View TouchSignal - private bool OnTouch(IntPtr view, IntPtr touchData) + /// + /// Displays a tooltip + /// + /// 3 + public Tizen.NUI.PropertyMap Tooltip { - if (touchData == global::System.IntPtr.Zero) + get { - NUILog.Error("touchData should not be null!"); - return true; + return (PropertyMap)GetValue(TooltipProperty); } - - TouchEventArgs e = new TouchEventArgs(); - - e.Touch = Tizen.NUI.Touch.GetTouchFromPtr(touchData); - - if (_touchDataEventHandler != null) + set { - return _touchDataEventHandler(this, e); + SetValue(TooltipProperty, value); + NotifyPropertyChanged(); } - return false; } - /// - /// Event arguments that passed via the hover signal. + /// Displays a tooltip as a text. /// /// 3 - public class HoverEventArgs : EventArgs + public string TooltipText { - private Hover _hover; - - /// - /// Hover - contains touch points that represent the points that are currently being hovered or the points where a hover has stopped. - /// - /// 3 - public Hover Hover + set { - get - { - return _hover; - } - set - { - _hover = value; - } + SetProperty(View.Property.TOOLTIP, new Tizen.NUI.PropertyValue(value)); + NotifyPropertyChanged(); } } - private EventHandlerWithReturnType _hoverEventHandler; - [UnmanagedFunctionPointer(CallingConvention.StdCall)] - private delegate bool HoverEventCallbackType(IntPtr view, IntPtr hoverEvent); - private HoverEventCallbackType _hoverEventCallback; - /// - /// An event for the hovered signal which can be used to subscribe or unsubscribe the event handler provided by the user.
- /// The hovered signal is emitted when the hover input is received.
+ /// The Child property of FlexContainer.
+ /// The proportion of the free space in the container, the flex item will receive.
+ /// If all items in the container set this property, their sizes will be proportional to the specified flex factor.
///
/// 3 - public event EventHandlerWithReturnType HoverEvent + public float Flex { - add + get { - if (_hoverEventHandler == null) - { - _hoverEventCallback = OnHoverEvent; - this.HoveredSignal().Connect(_hoverEventCallback); - } - - _hoverEventHandler += value; + return (float)GetValue(FlexProperty); } - - remove + set { - _hoverEventHandler -= value; - - if (_hoverEventHandler == null && HoveredSignal().Empty() == false) - { - this.HoveredSignal().Disconnect(_hoverEventCallback); - } - + SetValue(FlexProperty, value); + NotifyPropertyChanged(); } } - // Callback for View Hover signal - private bool OnHoverEvent(IntPtr view, IntPtr hoverEvent) + /// + /// The Child property of FlexContainer.
+ /// The alignment of the flex item along the cross axis, which, if set, overides the default alignment for all items in the container.
+ ///
+ /// 3 + public int AlignSelf { - if (hoverEvent == global::System.IntPtr.Zero) + get { - NUILog.Error("hoverEvent should not be null!"); - return true; + return (int)GetValue(AlignSelfProperty); } - - HoverEventArgs e = new HoverEventArgs(); - - e.Hover = Tizen.NUI.Hover.GetHoverFromPtr(hoverEvent); - - if (_hoverEventHandler != null) + set { - return _hoverEventHandler(this, e); + SetValue(AlignSelfProperty, value); + NotifyPropertyChanged(); } - return false; } - /// - /// Event arguments that passed via the wheel signal. + /// The Child property of FlexContainer.
+ /// The space around the flex item.
///
/// 3 - public class WheelEventArgs : EventArgs + public Vector4 FlexMargin { - private Wheel _wheel; - - /// - /// WheelEvent - store a wheel rolling type: MOUSE_WHEEL or CUSTOM_WHEEL. - /// - /// 3 - public Wheel Wheel + get { - get - { - return _wheel; - } - set - { - _wheel = value; - } + return (Vector4)GetValue(FlexMarginProperty); + } + set + { + SetValue(FlexMarginProperty, value); + NotifyPropertyChanged(); } } - private EventHandlerWithReturnType _wheelEventHandler; - [UnmanagedFunctionPointer(CallingConvention.StdCall)] - private delegate bool WheelEventCallbackType(IntPtr view, IntPtr wheelEvent); - private WheelEventCallbackType _wheelEventCallback; - /// - /// An event for the WheelMoved signal which can be used to subscribe or unsubscribe the event handler provided by the user.
- /// The WheelMoved signal is emitted when the wheel event is received.
+ /// The top-left cell this child occupies, if not set, the first available cell is used. ///
/// 3 - public event EventHandlerWithReturnType WheelEvent + public Vector2 CellIndex { - add + get { - if (_wheelEventHandler == null) - { - _wheelEventCallback = OnWheelEvent; - this.WheelEventSignal().Connect(_wheelEventCallback); - } - - _wheelEventHandler += value; + return (Vector2)GetValue(CellIndexProperty); } - - remove + set { - _wheelEventHandler -= value; - - if (_wheelEventHandler == null && WheelEventSignal().Empty() == false) - { - this.WheelEventSignal().Disconnect(_wheelEventCallback); - } - + SetValue(CellIndexProperty, value); + NotifyPropertyChanged(); } } - // Callback for View Wheel signal - private bool OnWheelEvent(IntPtr view, IntPtr wheelEvent) + /// + /// The number of rows this child occupies, if not set, the default value is 1. + /// + /// 3 + public float RowSpan { - if (wheelEvent == global::System.IntPtr.Zero) + get { - NUILog.Error("wheelEvent should not be null!"); - return true; + return (float)GetValue(RowSpanProperty); } - - WheelEventArgs e = new WheelEventArgs(); - - e.Wheel = Tizen.NUI.Wheel.GetWheelFromPtr(wheelEvent); - - if (_wheelEventHandler != null) + set { - return _wheelEventHandler(this, e); + SetValue(RowSpanProperty, value); + NotifyPropertyChanged(); } - return false; } - - private EventHandler _onWindowEventHandler; - [UnmanagedFunctionPointer(CallingConvention.StdCall)] - private delegate void OnWindowEventCallbackType(IntPtr control); - private OnWindowEventCallbackType _onWindowEventCallback; - /// - /// An event for the OnWindow signal which can be used to subscribe or unsubscribe the event handler.
- /// The OnWindow signal is emitted after the view has been connected to the window.
+ /// The number of columns this child occupies, if not set, the default value is 1. ///
/// 3 - public event EventHandler AddedToWindow + public float ColumnSpan { - add + get { - if (_onWindowEventHandler == null) - { - _onWindowEventCallback = OnWindow; - this.OnWindowSignal().Connect(_onWindowEventCallback); - } - - _onWindowEventHandler += value; + return (float)GetValue(ColumnSpanProperty); } - - remove + set { - _onWindowEventHandler -= value; - - if (_onWindowEventHandler == null && OnWindowSignal().Empty() == false) - { - this.OnWindowSignal().Disconnect(_onWindowEventCallback); - } + SetValue(ColumnSpanProperty, value); + NotifyPropertyChanged(); } } - // Callback for View OnWindow signal - private void OnWindow(IntPtr data) + /// + /// The horizontal alignment of this child inside the cells, if not set, the default value is 'left'. + /// + /// 3 + public Tizen.NUI.HorizontalAlignmentType CellHorizontalAlignment { - if (_onWindowEventHandler != null) + get { - _onWindowEventHandler(this, null); + return (HorizontalAlignmentType)GetValue(CellHorizontalAlignmentProperty); + } + set + { + SetValue(CellHorizontalAlignmentProperty, value); + NotifyPropertyChanged(); } } - - private EventHandler _offWindowEventHandler; - [UnmanagedFunctionPointer(CallingConvention.StdCall)] - private delegate void OffWindowEventCallbackType(IntPtr control); - private OffWindowEventCallbackType _offWindowEventCallback; - /// - /// An event for the OffWindow signal, which can be used to subscribe or unsubscribe the event handler.
- /// OffWindow signal is emitted after the view has been disconnected from the window.
+ /// The vertical alignment of this child inside the cells, if not set, the default value is 'top'. ///
/// 3 - public event EventHandler RemovedFromWindow + public Tizen.NUI.VerticalAlignmentType CellVerticalAlignment { - add + get { - if (_offWindowEventHandler == null) - { - _offWindowEventCallback = OffWindow; - this.OffWindowSignal().Connect(_offWindowEventCallback); - } - - _offWindowEventHandler += value; + return (VerticalAlignmentType)GetValue(CellVerticalAlignmentProperty); } - - remove + set { - _offWindowEventHandler -= value; - - if (_offWindowEventHandler == null && OffWindowSignal().Empty() == false) - { - this.OffWindowSignal().Disconnect(_offWindowEventCallback); - } + SetValue(CellVerticalAlignmentProperty, value); + NotifyPropertyChanged(); } } - // Callback for View OffWindow signal - private void OffWindow(IntPtr data) + /// + /// The left focusable view.
+ /// This will return null if not set.
+ /// This will also return null if the specified left focusable view is not on a window.
+ ///
+ /// 3 + public View LeftFocusableView { - if (_offWindowEventHandler != null) + // As native side will be only storing IDs so need a logic to convert View to ID and vice-versa. + get { - _offWindowEventHandler(this, null); + return (View)GetValue(LeftFocusableViewProperty); + } + set + { + SetValue(LeftFocusableViewProperty, value); + NotifyPropertyChanged(); } } /// - /// Event arguments of visibility changed. + /// The right focusable view.
+ /// This will return null if not set.
+ /// This will also return null if the specified right focusable view is not on a window.
///
/// 3 - public class VisibilityChangedEventArgs : EventArgs + public View RightFocusableView { - private View _view; - private bool _visibility; - private VisibilityChangeType _type; - - /// - /// The view, or child of view, whose visibility has changed. - /// - /// 3 - public View View - { - get - { - return _view; - } - set - { - _view = value; - } - } - - /// - /// Whether the view is now visible or not. - /// - /// 3 - public bool Visibility + // As native side will be only storing IDs so need a logic to convert View to ID and vice-versa. + get { - get - { - return _visibility; - } - set - { - _visibility = value; - } + return (View)GetValue(RightFocusableViewProperty); } - - /// - /// Whether the view's visible property has changed or a parent's. - /// - /// 3 - public VisibilityChangeType Type + set { - get - { - return _type; - } - set - { - _type = value; - } + SetValue(RightFocusableViewProperty, value); + NotifyPropertyChanged(); } } - private EventHandler _visibilityChangedEventHandler; - [UnmanagedFunctionPointer(CallingConvention.StdCall)] - private delegate void VisibilityChangedEventCallbackType(IntPtr data, bool visibility, VisibilityChangeType type); - private VisibilityChangedEventCallbackType _visibilityChangedEventCallback; - /// - /// An event for visibility change which can be used to subscribe or unsubscribe the event handler.
- /// This signal is emitted when the visible property of this or a parent view is changed.
+ /// The up focusable view.
+ /// This will return null if not set.
+ /// This will also return null if the specified up focusable view is not on a window.
///
/// 3 - public event EventHandler VisibilityChanged + public View UpFocusableView { - add + // As native side will be only storing IDs so need a logic to convert View to ID and vice-versa. + get { - if (_visibilityChangedEventHandler == null) - { - _visibilityChangedEventCallback = OnVisibilityChanged; - VisibilityChangedSignal(this).Connect(_visibilityChangedEventCallback); - } - - _visibilityChangedEventHandler += value; + return (View)GetValue(UpFocusableViewProperty); } - - remove + set { - _visibilityChangedEventHandler -= value; - - if (_visibilityChangedEventHandler == null && VisibilityChangedSignal(this).Empty() == false) - { - VisibilityChangedSignal(this).Disconnect(_visibilityChangedEventCallback); - } + SetValue(UpFocusableViewProperty, value); + NotifyPropertyChanged(); } } - // Callback for View visibility change signal - private void OnVisibilityChanged(IntPtr data, bool visibility, VisibilityChangeType type) - { - VisibilityChangedEventArgs e = new VisibilityChangedEventArgs(); - if (data != null) + /// + /// The down focusable view.
+ /// This will return null if not set.
+ /// This will also return null if the specified down focusable view is not on a window.
+ ///
+ /// 3 + public View DownFocusableView + { + // As native side will be only storing IDs so need a logic to convert View to ID and vice-versa. + get { - e.View = Registry.GetManagedBaseHandleFromNativePtr(data) as View; + return (View)GetValue(DownFocusableViewProperty); } - e.Visibility = visibility; - e.Type = type; - - if (_visibilityChangedEventHandler != null) + set { - _visibilityChangedEventHandler(this, e); + SetValue(DownFocusableViewProperty, value); + NotifyPropertyChanged(); } } - /// - /// Event arguments of layout direction changed. + /// Whether the view should be focusable by keyboard navigation. /// - /// 4 - public class LayoutDirectionChangedEventArgs : EventArgs + /// 3 + public bool Focusable { - private View _view; - private ViewLayoutDirectionType _type; - - /// - /// The view, or child of view, whose layout direction has changed. - /// - /// 4 - public View View + set { - get - { - return _view; - } - set - { - _view = value; - } + SetValue(FocusableProperty, value); + NotifyPropertyChanged(); } - - /// - /// Whether the view's layout direction property has changed or a parent's. - /// - /// 4 - public ViewLayoutDirectionType Type + get { - get - { - return _type; - } - set - { - _type = value; - } + return (bool)GetValue(FocusableProperty); } } - private EventHandler _layoutDirectionChangedEventHandler; - [UnmanagedFunctionPointer(CallingConvention.StdCall)] - private delegate void LayoutDirectionChangedEventCallbackType(IntPtr data, ViewLayoutDirectionType type); - private LayoutDirectionChangedEventCallbackType _layoutDirectionChangedEventCallback; - /// - /// Event for layout direction change which can be used to subscribe/unsubscribe the event handler.
- /// This signal is emitted when the layout direction property of this or a parent view is changed.
+ /// Retrieves the position of the view.
+ /// The coordinates are relative to the view's parent.
///
- /// 4 - public event EventHandler LayoutDirectionChanged + /// 3 + public Position CurrentPosition { - add + get { - if (_layoutDirectionChangedEventHandler == null) - { - _layoutDirectionChangedEventCallback = OnLayoutDirectionChanged; - LayoutDirectionChangedSignal(this).Connect(_layoutDirectionChangedEventCallback); - } - - _layoutDirectionChangedEventHandler += value; + return GetCurrentPosition(); } + } - remove + /// + /// Sets the size of a view for the width and the height.
+ /// Geometry can be scaled to fit within this area.
+ /// This does not interfere with the view's scale factor.
+ /// The views default depth is the minimum of width and height.
+ ///
+ /// + /// This NUI object (Size2D) typed property can be configured by multiple cascade setting.
+ /// For example, this code ( view.Size2D.Width = 100; view.Size2D.Height = 100; ) is equivalent to this ( view.Size2D = new Size2D(100, 100); ).
+ /// Please note that this multi-cascade setting is especially possible for this NUI object (Size2D).
+ /// This means by default others are impossible so it is recommended that NUI object typed properties are configured by their constructor with parameters.
+ /// For example, this code is working fine : view.Scale = new Vector3( 2.0f, 1.5f, 0.0f);
+ /// but this will not work! : view.Scale.X = 2.0f; view.Scale.Y = 1.5f;
+ /// It may not match the current value in some cases, i.e. when the animation is progressing or the maximum or minimu size is set.
+ ///
+ /// 3 + public Size2D Size2D + { + get { - _layoutDirectionChangedEventHandler -= value; - - if (_layoutDirectionChangedEventHandler == null && LayoutDirectionChangedSignal(this).Empty() == false) - { - LayoutDirectionChangedSignal(this).Disconnect(_layoutDirectionChangedEventCallback); - } + Size2D temp = (Size2D)GetValue(Size2DProperty); + return new Size2D(OnSize2DChanged, temp.Width, temp.Height); + } + set + { + SetValue(Size2DProperty, value); + // Set Specification so when layouts measure this View it matches the value set here. + // All Views are currently Layouts. + SetProperty(LayoutItemWrapper.ChildProperty.WIDTH_SPECIFICATION, new Tizen.NUI.PropertyValue(value.Width)); + SetProperty(LayoutItemWrapper.ChildProperty.HEIGHT_SPECIFICATION, new Tizen.NUI.PropertyValue(value.Height)); + NotifyPropertyChanged(); } } - // Callback for View layout direction change signal - private void OnLayoutDirectionChanged(IntPtr data, ViewLayoutDirectionType type) + /// + /// Retrieves the size of the view.
+ /// The coordinates are relative to the view's parent.
+ ///
+ /// 3 + public Size2D CurrentSize { - LayoutDirectionChangedEventArgs e = new LayoutDirectionChangedEventArgs(); - if (data != null) + get { - e.View = Registry.GetManagedBaseHandleFromNativePtr(data) as View; + return GetCurrentSize(); } - e.Type = type; + } - if (_layoutDirectionChangedEventHandler != null) + /// + /// Retrieves and sets the view's opacity.
+ ///
+ /// 3 + public float Opacity + { + get { - _layoutDirectionChangedEventHandler(this, e); + return (float)GetValue(OpacityProperty); + } + set + { + SetValue(OpacityProperty, value); + NotifyPropertyChanged(); } } - // Resource Ready Signal - - private EventHandler _resourcesLoadedEventHandler; - [UnmanagedFunctionPointer(CallingConvention.StdCall)] - private delegate void ResourcesLoadedCallbackType(IntPtr control); - private ResourcesLoadedCallbackType _ResourcesLoadedCallback; - /// - /// An event for the ResourcesLoadedSignal signal which can be used to subscribe or unsubscribe the event handler provided by the user.
- /// This signal is emitted after all resources required by a view are loaded and ready.
+ /// Sets the position of the view for X and Y.
+ /// By default, sets the position vector between the parent origin and the pivot point (default).
+ /// If the position inheritance is disabled, sets the world position.
///
+ /// + /// This NUI object (Position2D) typed property can be configured by multiple cascade setting.
+ /// For example, this code ( view.Position2D.X = 100; view.Position2D.Y = 100; ) is equivalent to this ( view.Position2D = new Position2D(100, 100); ).
+ /// Please note that this multi-cascade setting is especially possible for this NUI object (Position2D).
+ /// This means by default others are impossible so it is recommended that NUI object typed properties are configured by their constructor with parameters.
+ /// For example, this code is working fine : view.Scale = new Vector3( 2.0f, 1.5f, 0.0f);
+ /// but this will not work! : view.Scale.X = 2.0f; view.Scale.Y = 1.5f;
+ ///
/// 3 - public event EventHandler ResourcesLoaded + public Position2D Position2D { - add + get { - if (_resourcesLoadedEventHandler == null) - { - _ResourcesLoadedCallback = OnResourcesLoaded; - this.ResourcesLoadedSignal().Connect(_ResourcesLoadedCallback); - } - - _resourcesLoadedEventHandler += value; + Position2D temp = (Position2D)GetValue(Position2DProperty); + return new Position2D(OnPosition2DChanged, temp.X, temp.Y); } - - remove + set { - _resourcesLoadedEventHandler -= value; - - if (_resourcesLoadedEventHandler == null && ResourcesLoadedSignal().Empty() == false) - { - this.ResourcesLoadedSignal().Disconnect(_ResourcesLoadedCallback); - } + SetValue(Position2DProperty, value); + NotifyPropertyChanged(); } } - private void OnResourcesLoaded(IntPtr view) + /// + /// Retrieves the screen postion of the view.
+ ///
+ /// 3 + public Vector2 ScreenPosition { - if (_resourcesLoadedEventHandler != null) + get { - _resourcesLoadedEventHandler(this, null); + Vector2 temp = new Vector2(0.0f, 0.0f); + GetProperty(View.Property.SCREEN_POSITION).Get(temp); + return temp; } } - internal IntPtr GetPtrfromView() + /// + /// Determines whether the pivot point should be used to determine the position of the view. + /// This is true by default. + /// + /// If false, then the top-left of the view is used for the position. + /// Setting this to false will allow scaling or rotation around the anchor-point without affecting the view's position. + /// + /// 3 + public bool PositionUsesPivotPoint { - return (IntPtr)swigCPtr; + get + { + return (bool)GetValue(PositionUsesPivotPointProperty); + } + set + { + SetValue(PositionUsesPivotPointProperty, value); + NotifyPropertyChanged(); + } } - internal class Property + /// + /// Please do not use! this will be deprecated. + /// + /// Please do not use! this will be deprecated! + /// Instead please use PositionUsesPivotPoint. + /// 3 + [Obsolete("Please do not use! This will be deprecated! Please use PositionUsesPivotPoint instead! " + + "Like: " + + "View view = new View(); " + + "view.PivotPoint = PivotPoint.Center; " + + "view.PositionUsesPivotPoint = true;")] + [EditorBrowsable(EditorBrowsableState.Never)] + public bool PositionUsesAnchorPoint { - internal static readonly int TOOLTIP = NDalicManualPINVOKE.View_Property_TOOLTIP_get(); - internal static readonly int STATE = NDalicManualPINVOKE.View_Property_STATE_get(); - internal static readonly int SUB_STATE = NDalicManualPINVOKE.View_Property_SUB_STATE_get(); - internal static readonly int LEFT_FOCUSABLE_VIEW_ID = NDalicManualPINVOKE.View_Property_LEFT_FOCUSABLE_ACTOR_ID_get(); - internal static readonly int RIGHT_FOCUSABLE_VIEW_ID = NDalicManualPINVOKE.View_Property_RIGHT_FOCUSABLE_ACTOR_ID_get(); - internal static readonly int UP_FOCUSABLE_VIEW_ID = NDalicManualPINVOKE.View_Property_UP_FOCUSABLE_ACTOR_ID_get(); - internal static readonly int DOWN_FOCUSABLE_VIEW_ID = NDalicManualPINVOKE.View_Property_DOWN_FOCUSABLE_ACTOR_ID_get(); - internal static readonly int STYLE_NAME = NDalicPINVOKE.View_Property_STYLE_NAME_get(); - internal static readonly int BACKGROUND = NDalicPINVOKE.View_Property_BACKGROUND_get(); - internal static readonly int SIBLING_ORDER = NDalicManualPINVOKE.Actor_Property_SIBLING_ORDER_get(); - internal static readonly int OPACITY = NDalicManualPINVOKE.Actor_Property_OPACITY_get(); - internal static readonly int SCREEN_POSITION = NDalicManualPINVOKE.Actor_Property_SCREEN_POSITION_get(); - internal static readonly int POSITION_USES_ANCHOR_POINT = NDalicManualPINVOKE.Actor_Property_POSITION_USES_ANCHOR_POINT_get(); - internal static readonly int PARENT_ORIGIN = NDalicPINVOKE.Actor_Property_PARENT_ORIGIN_get(); - internal static readonly int PARENT_ORIGIN_X = NDalicPINVOKE.Actor_Property_PARENT_ORIGIN_X_get(); - internal static readonly int PARENT_ORIGIN_Y = NDalicPINVOKE.Actor_Property_PARENT_ORIGIN_Y_get(); - internal static readonly int PARENT_ORIGIN_Z = NDalicPINVOKE.Actor_Property_PARENT_ORIGIN_Z_get(); - internal static readonly int ANCHOR_POINT = NDalicPINVOKE.Actor_Property_ANCHOR_POINT_get(); - internal static readonly int ANCHOR_POINT_X = NDalicPINVOKE.Actor_Property_ANCHOR_POINT_X_get(); - internal static readonly int ANCHOR_POINT_Y = NDalicPINVOKE.Actor_Property_ANCHOR_POINT_Y_get(); - internal static readonly int ANCHOR_POINT_Z = NDalicPINVOKE.Actor_Property_ANCHOR_POINT_Z_get(); - internal static readonly int SIZE = NDalicPINVOKE.Actor_Property_SIZE_get(); - internal static readonly int SIZE_WIDTH = NDalicPINVOKE.Actor_Property_SIZE_WIDTH_get(); - internal static readonly int SIZE_HEIGHT = NDalicPINVOKE.Actor_Property_SIZE_HEIGHT_get(); - internal static readonly int SIZE_DEPTH = NDalicPINVOKE.Actor_Property_SIZE_DEPTH_get(); - internal static readonly int POSITION = NDalicPINVOKE.Actor_Property_POSITION_get(); - internal static readonly int POSITION_X = NDalicPINVOKE.Actor_Property_POSITION_X_get(); - internal static readonly int POSITION_Y = NDalicPINVOKE.Actor_Property_POSITION_Y_get(); - internal static readonly int POSITION_Z = NDalicPINVOKE.Actor_Property_POSITION_Z_get(); - internal static readonly int WORLD_POSITION = NDalicPINVOKE.Actor_Property_WORLD_POSITION_get(); - internal static readonly int WORLD_POSITION_X = NDalicPINVOKE.Actor_Property_WORLD_POSITION_X_get(); - internal static readonly int WORLD_POSITION_Y = NDalicPINVOKE.Actor_Property_WORLD_POSITION_Y_get(); - internal static readonly int WORLD_POSITION_Z = NDalicPINVOKE.Actor_Property_WORLD_POSITION_Z_get(); - internal static readonly int ORIENTATION = NDalicPINVOKE.Actor_Property_ORIENTATION_get(); - internal static readonly int WORLD_ORIENTATION = NDalicPINVOKE.Actor_Property_WORLD_ORIENTATION_get(); - internal static readonly int SCALE = NDalicPINVOKE.Actor_Property_SCALE_get(); - internal static readonly int SCALE_X = NDalicPINVOKE.Actor_Property_SCALE_X_get(); - internal static readonly int SCALE_Y = NDalicPINVOKE.Actor_Property_SCALE_Y_get(); - internal static readonly int SCALE_Z = NDalicPINVOKE.Actor_Property_SCALE_Z_get(); - internal static readonly int WORLD_SCALE = NDalicPINVOKE.Actor_Property_WORLD_SCALE_get(); - internal static readonly int VISIBLE = NDalicPINVOKE.Actor_Property_VISIBLE_get(); - internal static readonly int WORLD_COLOR = NDalicPINVOKE.Actor_Property_WORLD_COLOR_get(); - internal static readonly int WORLD_MATRIX = NDalicPINVOKE.Actor_Property_WORLD_MATRIX_get(); - internal static readonly int NAME = NDalicPINVOKE.Actor_Property_NAME_get(); - internal static readonly int SENSITIVE = NDalicPINVOKE.Actor_Property_SENSITIVE_get(); - internal static readonly int LEAVE_REQUIRED = NDalicPINVOKE.Actor_Property_LEAVE_REQUIRED_get(); - internal static readonly int INHERIT_ORIENTATION = NDalicPINVOKE.Actor_Property_INHERIT_ORIENTATION_get(); - internal static readonly int INHERIT_SCALE = NDalicPINVOKE.Actor_Property_INHERIT_SCALE_get(); - internal static readonly int DRAW_MODE = NDalicPINVOKE.Actor_Property_DRAW_MODE_get(); - internal static readonly int SIZE_MODE_FACTOR = NDalicPINVOKE.Actor_Property_SIZE_MODE_FACTOR_get(); - internal static readonly int WIDTH_RESIZE_POLICY = NDalicPINVOKE.Actor_Property_WIDTH_RESIZE_POLICY_get(); - internal static readonly int HEIGHT_RESIZE_POLICY = NDalicPINVOKE.Actor_Property_HEIGHT_RESIZE_POLICY_get(); - internal static readonly int SIZE_SCALE_POLICY = NDalicPINVOKE.Actor_Property_SIZE_SCALE_POLICY_get(); - internal static readonly int WIDTH_FOR_HEIGHT = NDalicPINVOKE.Actor_Property_WIDTH_FOR_HEIGHT_get(); - internal static readonly int HEIGHT_FOR_WIDTH = NDalicPINVOKE.Actor_Property_HEIGHT_FOR_WIDTH_get(); - internal static readonly int MINIMUM_SIZE = NDalicPINVOKE.Actor_Property_MINIMUM_SIZE_get(); - internal static readonly int MAXIMUM_SIZE = NDalicPINVOKE.Actor_Property_MAXIMUM_SIZE_get(); - internal static readonly int INHERIT_POSITION = NDalicPINVOKE.Actor_Property_INHERIT_POSITION_get(); - internal static readonly int CLIPPING_MODE = NDalicPINVOKE.Actor_Property_CLIPPING_MODE_get(); - internal static readonly int INHERIT_LAYOUT_DIRECTION = NDalicManualPINVOKE.Actor_Property_INHERIT_LAYOUT_DIRECTION_get(); - internal static readonly int LAYOUT_DIRECTION = NDalicManualPINVOKE.Actor_Property_LAYOUT_DIRECTION_get(); - internal static readonly int MARGIN = NDalicPINVOKE.View_Property_MARGIN_get(); - internal static readonly int PADDING = NDalicPINVOKE.View_Property_PADDING_get(); + get + { + bool temp = false; + GetProperty(View.Property.POSITION_USES_ANCHOR_POINT).Get(out temp); + return temp; + } + set + { + SetProperty(View.Property.POSITION_USES_ANCHOR_POINT, new Tizen.NUI.PropertyValue(value)); + NotifyPropertyChanged(); + } + } + + /// + /// Queries whether the view is connected to the stage.
+ /// When a view is connected, it will be directly or indirectly parented to the root view.
+ ///
+ /// 3 + public bool IsOnWindow + { + get + { + return OnWindow(); + } + } + + /// + /// Gets the depth in the hierarchy for the view. + /// + /// 3 + public int HierarchyDepth + { + get + { + return GetHierarchyDepth(); + } + } + + /// + /// Sets the sibling order of the view so the depth position can be defined within the same parent. + /// + /// + /// Note the initial value is 0. SiblingOrder should be bigger than 0 or equal to 0. + /// Raise, Lower, RaiseToTop, LowerToBottom, RaiseAbove, and LowerBelow will override the sibling order. + /// The values set by this property will likely change. + /// + /// 3 + public int SiblingOrder + { + get + { + return (int)GetValue(SiblingOrderProperty); + } + set + { + SetValue(SiblingOrderProperty, value); + NotifyPropertyChanged(); + } + } + + /// + /// Returns the natural size of the view. + /// + /// + /// Deriving classes stipulate the natural size and by default a view has a zero natural size. + /// + /// 5 + public Vector3 NaturalSize + { + get + { + Vector3 ret = new Vector3(NDalicPINVOKE.Actor_GetNaturalSize(swigCPtr), true); + if (NDalicPINVOKE.SWIGPendingException.Pending) + throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + } + + /// + /// Returns the natural size (Size2D) of the view. + /// + /// + /// Deriving classes stipulate the natural size and by default a view has a zero natural size. + /// + /// 4 + public Size2D NaturalSize2D + { + get + { + Vector3 temp = new Vector3(NDalicPINVOKE.Actor_GetNaturalSize(swigCPtr), true); + if (NDalicPINVOKE.SWIGPendingException.Pending) + throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + + return new Size2D((int)temp.Width, (int)temp.Height); + } + } + + /// + /// Gets or sets the origin of a view within its parent's area.
+ /// This is expressed in unit coordinates, such that (0.0, 0.0, 0.5) is the top-left corner of the parent, and (1.0, 1.0, 0.5) is the bottom-right corner.
+ /// The default parent-origin is ParentOrigin.TopLeft (0.0, 0.0, 0.5).
+ /// A view's position is the distance between this origin and the view's anchor-point.
+ ///
+ ///
The view has been initialized.
+ /// 3 + public Position ParentOrigin + { + get + { + return (Position)GetValue(ParentOriginProperty); + } + set + { + SetValue(ParentOriginProperty, value); + NotifyPropertyChanged(); + } + } + + /// + /// Gets or sets the anchor-point of a view.
+ /// This is expressed in unit coordinates, such that (0.0, 0.0, 0.5) is the top-left corner of the view, and (1.0, 1.0, 0.5) is the bottom-right corner.
+ /// The default pivot point is PivotPoint.Center (0.5, 0.5, 0.5).
+ /// A view position is the distance between its parent-origin and this anchor-point.
+ /// A view's orientation is the rotation from its default orientation, the rotation is centered around its anchor-point.
+ ///
The view has been initialized.
+ ///
+ /// 3 + public Position PivotPoint + { + get + { + return (Position)GetValue(PivotPointProperty); + } + set + { + SetValue(PivotPointProperty, value); + NotifyPropertyChanged(); + } + } + + /// + /// Gets or sets the size width of the view. + /// + /// 3 + public float SizeWidth + { + get + { + return (float)GetValue(SizeWidthProperty); + } + set + { + SetValue(SizeWidthProperty, value); + NotifyPropertyChanged(); + } + } + + /// + /// Gets or sets the size height of the view. + /// + /// 3 + public float SizeHeight + { + get + { + return (float)GetValue(SizeHeightProperty); + } + set + { + SetValue(SizeHeightProperty, value); + NotifyPropertyChanged(); + } + } + + /// + /// Gets or sets the position of the view.
+ /// By default, sets the position vector between the parent origin and pivot point (default).
+ /// If the position inheritance is disabled, sets the world position.
+ ///
+ /// 3 + public Position Position + { + get + { + return (Position)GetValue(PositionProperty); + } + set + { + SetValue(PositionProperty, value); + NotifyPropertyChanged(); + } + } + + /// + /// Gets or sets the position X of the view. + /// + /// 3 + public float PositionX + { + get + { + return (float)GetValue(PositionXProperty); + } + set + { + SetValue(PositionXProperty, value); + NotifyPropertyChanged(); + } + } + + /// + /// Gets or sets the position Y of the view. + /// + /// 3 + public float PositionY + { + get + { + return (float)GetValue(PositionYProperty); + } + set + { + SetValue(PositionYProperty, value); + NotifyPropertyChanged(); + } + } + + /// + /// Gets or sets the position Z of the view. + /// + /// 3 + public float PositionZ + { + get + { + return (float)GetValue(PositionZProperty); + } + set + { + SetValue(PositionZProperty, value); + NotifyPropertyChanged(); + } + } + + /// + /// Gets or sets the world position of the view. + /// + /// 3 + public Vector3 WorldPosition + { + get + { + Vector3 temp = new Vector3(0.0f, 0.0f, 0.0f); + GetProperty(View.Property.WORLD_POSITION).Get(temp); + return temp; + } + } + + /// + /// Gets or sets the orientation of the view.
+ /// The view's orientation is the rotation from its default orientation, and the rotation is centered around its anchor-point.
+ ///
+ /// This is an asynchronous method. + /// 3 + public Rotation Orientation + { + get + { + return (Rotation)GetValue(OrientationProperty); + } + set + { + SetValue(OrientationProperty, value); + NotifyPropertyChanged(); + } + } + + /// + /// Gets or sets the world orientation of the view.
+ ///
+ /// 3 + public Rotation WorldOrientation + { + get + { + Rotation temp = new Rotation(); + GetProperty(View.Property.WORLD_ORIENTATION).Get(temp); + return temp; + } + } + + /// + /// Gets or sets the scale factor applied to the view.
+ ///
+ /// 3 + public Vector3 Scale + { + get + { + return (Vector3)GetValue(ScaleProperty); + } + set + { + SetValue(ScaleProperty, value); + NotifyPropertyChanged(); + } + } + + /// + /// Gets or sets the scale X factor applied to the view. + /// + /// 3 + public float ScaleX + { + get + { + return (float)GetValue(ScaleXProperty); + } + set + { + SetValue(ScaleXProperty, value); + NotifyPropertyChanged(); + } + } + + /// + /// Gets or sets the scale Y factor applied to the view. + /// + /// 3 + public float ScaleY + { + get + { + return (float)GetValue(ScaleYProperty); + } + set + { + SetValue(ScaleYProperty, value); + NotifyPropertyChanged(); + } + } + + /// + /// Gets or sets the scale Z factor applied to the view. + /// + /// 3 + public float ScaleZ + { + get + { + return (float)GetValue(ScaleZProperty); + } + set + { + SetValue(ScaleZProperty, value); + NotifyPropertyChanged(); + } + } + + /// + /// Gets the world scale of the view. + /// + /// 3 + public Vector3 WorldScale + { + get + { + Vector3 temp = new Vector3(0.0f, 0.0f, 0.0f); + GetProperty(View.Property.WORLD_SCALE).Get(temp); + return temp; + } + } + + /// + /// Retrieves the visibility flag of the view. + /// + /// + /// If the view is not visible, then the view and its children will not be rendered. + /// This is regardless of the individual visibility values of the children, i.e., the view will only be rendered if all of its parents have visibility set to true. + /// + /// 3 + public bool Visibility + { + get + { + bool temp = false; + GetProperty(View.Property.VISIBLE).Get(out temp); + return temp; + } + } + + /// + /// Gets the view's world color. + /// + /// 3 + public Vector4 WorldColor + { + get + { + Vector4 temp = new Vector4(0.0f, 0.0f, 0.0f, 0.0f); + GetProperty(View.Property.WORLD_COLOR).Get(temp); + return temp; + } + } + + /// + /// Gets or sets the view's name. + /// + /// 3 + public string Name + { + get + { + return (string)GetValue(NameProperty); + } + set + { + SetValue(NameProperty, value); + NotifyPropertyChanged(); + } + } + + /// + /// Get the number of children held by the view. + /// + /// 3 + public new uint ChildCount + { + get + { + return GetChildCount(); + } + } + + /// + /// Gets the view's ID. + /// Readonly + /// + /// 3 + public uint ID + { + get + { + return GetId(); + } + } + + /// + /// Gets or sets the status of whether the view should emit touch or hover signals. + /// + /// 3 + public bool Sensitive + { + get + { + return (bool)GetValue(SensitiveProperty); + } + set + { + SetValue(SensitiveProperty, value); + NotifyPropertyChanged(); + } + } + + /// + /// Gets or sets the status of whether the view should receive a notification when touch or hover motion events leave the boundary of the view. + /// + /// 3 + public bool LeaveRequired + { + get + { + return (bool)GetValue(LeaveRequiredProperty); + } + set + { + SetValue(LeaveRequiredProperty, value); + NotifyPropertyChanged(); + } + } + + /// + /// Gets or sets the status of whether a child view inherits it's parent's orientation. + /// + /// 3 + public bool InheritOrientation + { + get + { + return (bool)GetValue(InheritOrientationProperty); + } + set + { + SetValue(InheritOrientationProperty, value); + NotifyPropertyChanged(); + } + } + + /// + /// Gets or sets the status of whether a child view inherits it's parent's scale. + /// + /// 3 + public bool InheritScale + { + get + { + return (bool)GetValue(InheritScaleProperty); + } + set + { + SetValue(InheritScaleProperty, value); + NotifyPropertyChanged(); + } + } + + /// + /// Gets or sets the status of how the view and its children should be drawn.
+ /// Not all views are renderable, but DrawMode can be inherited from any view.
+ /// If an object is in a 3D layer, it will be depth-tested against other objects in the world, i.e., it may be obscured if other objects are in front.
+ /// If DrawMode.Overlay2D is used, the view and its children will be drawn as a 2D overlay.
+ /// Overlay views are drawn in a separate pass, after all non-overlay views within the layer.
+ /// For overlay views, the drawing order is with respect to tree levels of views, and depth-testing will not be used.
+ ///
+ /// 3 + public DrawModeType DrawMode + { + get + { + return (DrawModeType)GetValue(DrawModeProperty); + } + set + { + SetValue(DrawModeProperty, value); + NotifyPropertyChanged(); + } + } + + /// + /// Gets or sets the relative to parent size factor of the view.
+ /// This factor is only used when ResizePolicyType is set to either: ResizePolicyType.SizeRelativeToParent or ResizePolicyType.SizeFixedOffsetFromParent.
+ /// This view's size is set to the view's size multiplied by or added to this factor, depending on ResizePolicyType.
+ ///
+ /// 3 + public Vector3 SizeModeFactor + { + get + { + return (Vector3)GetValue(SizeModeFactorProperty); + } + set + { + SetValue(SizeModeFactorProperty, value); + NotifyPropertyChanged(); + } + } + + /// + /// Gets or sets the width resize policy to be used. + /// + /// 3 + public ResizePolicyType WidthResizePolicy + { + get + { + return (ResizePolicyType)GetValue(WidthResizePolicyProperty); + } + set + { + SetValue(WidthResizePolicyProperty, value); + // Match ResizePolicy to new Layouting. + // Parent relative policies can not be mapped at this point as parent size unknown. + switch (value) + { + case ResizePolicyType.UseNaturalSize: + { + SetProperty(LayoutItemWrapper.ChildProperty.WIDTH_SPECIFICATION, new Tizen.NUI.PropertyValue(NaturalSize.Width)); + break; + } + case ResizePolicyType.FillToParent: + { + SetProperty(LayoutItemWrapper.ChildProperty.WIDTH_SPECIFICATION, new Tizen.NUI.PropertyValue((int)ChildLayoutData.MatchParent)); + break; + } + case ResizePolicyType.FitToChildren: + { + SetProperty(LayoutItemWrapper.ChildProperty.WIDTH_SPECIFICATION, new Tizen.NUI.PropertyValue((int)ChildLayoutData.WrapContent)); + break; + } + default: + break; + } + NotifyPropertyChanged(); + } } /// - /// Describes the direction to move the focus towards. + /// Gets or sets the height resize policy to be used. /// /// 3 - public enum FocusDirection + public ResizePolicyType HeightResizePolicy { - /// - /// Move keyboard focus towards the left direction. - /// - /// 3 - Left, - /// - /// Move keyboard focus towards the right direction. - /// - /// 3 - Right, - /// - /// Move keyboard focus towards the up direction. - /// - /// 3 - Up, - /// - /// Move keyboard focus towards the down direction. - /// - /// 3 - Down, - /// - /// Move keyboard focus towards the previous page direction. - /// - /// 3 - PageUp, - /// - /// Move keyboard focus towards the next page direction. - /// - /// 3 - PageDown + get + { + return (ResizePolicyType)GetValue(HeightResizePolicyProperty); + } + set + { + SetValue(HeightResizePolicyProperty, value); + // Match ResizePolicy to new Layouting. + // Parent relative policies can not be mapped at this point as parent size unknown. + switch (value) + { + case ResizePolicyType.UseNaturalSize: + { + SetProperty(LayoutItemWrapper.ChildProperty.HEIGHT_SPECIFICATION, new Tizen.NUI.PropertyValue(NaturalSize.Height)); + break; + } + case ResizePolicyType.FillToParent: + { + SetProperty(LayoutItemWrapper.ChildProperty.HEIGHT_SPECIFICATION, new Tizen.NUI.PropertyValue((int)ChildLayoutData.MatchParent)); + break; + } + case ResizePolicyType.FitToChildren: + { + SetProperty(LayoutItemWrapper.ChildProperty.HEIGHT_SPECIFICATION, new Tizen.NUI.PropertyValue((int)ChildLayoutData.WrapContent)); + break; + } + default: + break; + } + NotifyPropertyChanged(); + } } /// - /// Creates a new instance of a view. + /// Gets or sets the policy to use when setting size with size negotiation.
+ /// Defaults to SizeScalePolicyType.UseSizeSet.
///
/// 3 - public View() : this(NDalicPINVOKE.View_New(), true) + public SizeScalePolicyType SizeScalePolicy { - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + get + { + return (SizeScalePolicyType)GetValue(SizeScalePolicyProperty); + } + set + { + SetValue(SizeScalePolicyProperty, value); + NotifyPropertyChanged(); + } } - internal View(View uiControl) : this(NDalicPINVOKE.new_View__SWIG_1(View.getCPtr(uiControl)), true) + + /// + /// Gets or sets the status of whether the width size is dependent on the height size. + /// + /// 3 + public bool WidthForHeight { - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + get + { + return (bool)GetValue(WidthForHeightProperty); + } + set + { + SetValue(WidthForHeightProperty, value); + NotifyPropertyChanged(); + } } - private View ConvertIdToView(uint id) + /// + /// Gets or sets the status of whether the height size is dependent on the width size. + /// + /// 3 + public bool HeightForWidth { - View view = null; - if (GetParent() is View) + get { - View parentView = GetParent() as View; - view = parentView.FindChildById(id); + return (bool)GetValue(HeightForWidthProperty); + } + set + { + SetValue(HeightForWidthProperty, value); + NotifyPropertyChanged(); + } + } + + /// + /// Gets or sets the padding for use in layout. + /// + /// 5 + public Extents Padding + { + get + { + return (Extents)GetValue(PaddingProperty); + } + set + { + SetValue(PaddingProperty, value); + NotifyPropertyChanged(); + } + } + + /// + /// Gets or sets the minimum size the view can be assigned in size negotiation. + /// + /// 3 + public Size2D MinimumSize + { + get + { + return (Size2D)GetValue(MinimumSizeProperty); + } + set + { + if (Layout != null) + { + // Note: it only works if minimum size is >= than natural size. + // To force the size it should be done through the width&height spec or Size2D. + Layout.MinimumWidth = new Tizen.NUI.LayoutLength(value.Width); + Layout.MinimumHeight = new Tizen.NUI.LayoutLength(value.Height); + } + SetValue(MinimumSizeProperty, value); + NotifyPropertyChanged(); + } + } + + /// + /// Gets or sets the maximum size the view can be assigned in size negotiation. + /// + /// 3 + public Size2D MaximumSize + { + get + { + return (Size2D)GetValue(MaximumSizeProperty); + } + set + { + // We don't have Layout.Maximum(Width|Height) so we cannot apply it to layout. + // MATCH_PARENT spec + parent container size can be used to limit + SetValue(MaximumSizeProperty, value); + NotifyPropertyChanged(); + } + } + + /// + /// Gets or sets whether a child view inherits it's parent's position.
+ /// Default is to inherit.
+ /// Switching this off means that using position sets the view's world position, i.e., translates from the world origin (0,0,0) to the pivot point of the view.
+ ///
+ /// 3 + public bool InheritPosition + { + get + { + return (bool)GetValue(InheritPositionProperty); + } + set + { + SetValue(InheritPositionProperty, value); + NotifyPropertyChanged(); + } + } + + /// + /// Gets or sets the clipping behavior (mode) of it's children. + /// + /// 3 + public ClippingModeType ClippingMode + { + get + { + return (ClippingModeType)GetValue(ClippingModeProperty); + } + set + { + SetValue(ClippingModeProperty, value); + NotifyPropertyChanged(); + } + } + + /// + /// Gets the number of renderers held by the view. + /// + /// 3 + public uint RendererCount + { + get + { + return GetRendererCount(); + } + } + + /// + /// [Obsolete("Please do not use! this will be deprecated")] + /// + /// 3 + /// Please do not use! this will be deprecated! + /// Instead please use PivotPoint. + [Obsolete("Please do not use! This will be deprecated! Please use PivotPoint instead! " + + "Like: " + + "View view = new View(); " + + "view.PivotPoint = PivotPoint.Center; " + + "view.PositionUsesPivotPoint = true;")] + [EditorBrowsable(EditorBrowsableState.Never)] + public Position AnchorPoint + { + get + { + Position temp = new Position(0.0f, 0.0f, 0.0f); + GetProperty(View.Property.ANCHOR_POINT).Get(temp); + return temp; } - - if (!view) + set { - view = Window.Instance.GetRootLayer().FindChildById(id); + SetProperty(View.Property.ANCHOR_POINT, new Tizen.NUI.PropertyValue(value)); + NotifyPropertyChanged(); } - - return view; } - internal void SetKeyInputFocus() + /// + /// Sets the size of a view for the width, the height and the depth.
+ /// Geometry can be scaled to fit within this area.
+ /// This does not interfere with the view's scale factor.
+ /// The views default depth is the minimum of width and height.
+ ///
+ /// + /// Please note that multi-cascade setting is not possible for this NUI object.
+ /// It is recommended that NUI object typed properties are configured by their constructor with parameters.
+ /// For example, this code is working fine : view.Size = new Size( 1.0f, 1.0f, 0.0f);
+ /// but this will not work! : view.Size.Width = 2.0f; view.Size.Height = 2.0f;
+ /// It may not match the current value in some cases, i.e. when the animation is progressing or the maximum or minimu size is set.
+ ///
+ /// 5 + public Size Size { - NDalicPINVOKE.View_SetKeyInputFocus(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + get + { + return (Size)GetValue(SizeProperty); + } + set + { + SetValue(SizeProperty, value); + // Set Specification so when layouts measure this View it matches the value set here. + // All Views are currently Layouts. + SetProperty(LayoutItemWrapper.ChildProperty.WIDTH_SPECIFICATION, new Tizen.NUI.PropertyValue(value.Width)); + SetProperty(LayoutItemWrapper.ChildProperty.HEIGHT_SPECIFICATION, new Tizen.NUI.PropertyValue(value.Height)); + NotifyPropertyChanged(); + } } /// - /// Queries whether the view has a focus. + /// "Please DO NOT use! This will be deprecated! Please use 'Container GetParent() for derived class' instead!" /// - /// True if this view has a focus. /// 3 - public bool HasFocus() + [Obsolete("Please do not use! This will be deprecated! Please use 'Container GetParent() for derived class' instead! " + + "Like: " + + "Container parent = view.GetParent(); " + + "View view = parent as View;")] + [EditorBrowsable(EditorBrowsableState.Never)] + public new View Parent { - bool ret = NDalicPINVOKE.View_HasKeyInputFocus(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } + get + { + View ret; + IntPtr cPtr = NDalicPINVOKE.Actor_GetParent(swigCPtr); + HandleRef CPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); + BaseHandle basehandle = Registry.GetManagedBaseHandleFromNativePtr(CPtr.Handle); - internal void ClearKeyInputFocus() - { - NDalicPINVOKE.View_ClearKeyInputFocus(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } + if (basehandle is Layer layer) + { + ret = new View(Layer.getCPtr(layer).Handle, false); + NUILog.Error("This Parent property is deprecated, shoud do not be used"); + } + else + { + ret = basehandle as View; + } - internal PinchGestureDetector GetPinchGestureDetector() - { - PinchGestureDetector ret = new PinchGestureDetector(NDalicPINVOKE.View_GetPinchGestureDetector(swigCPtr), true); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } + NDalicPINVOKE.delete_BaseHandle(CPtr); + CPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); - internal PanGestureDetector GetPanGestureDetector() - { - PanGestureDetector ret = new PanGestureDetector(NDalicPINVOKE.View_GetPanGestureDetector(swigCPtr), true); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; + if (NDalicPINVOKE.SWIGPendingException.Pending) + throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } } - internal TapGestureDetector GetTapGestureDetector() + /// + /// Gets/Sets whether inherit parent's the layout Direction. + /// + /// 4 + public bool InheritLayoutDirection { - TapGestureDetector ret = new TapGestureDetector(NDalicPINVOKE.View_GetTapGestureDetector(swigCPtr), true); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; + get + { + return (bool)GetValue(InheritLayoutDirectionProperty); + } + set + { + SetValue(InheritLayoutDirectionProperty, value); + NotifyPropertyChanged(); + } } - internal LongPressGestureDetector GetLongPressGestureDetector() + /// + /// Gets/Sets the layout Direction. + /// + /// 4 + public ViewLayoutDirectionType LayoutDirection { - LongPressGestureDetector ret = new LongPressGestureDetector(NDalicPINVOKE.View_GetLongPressGestureDetector(swigCPtr), true); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; + get + { + return (ViewLayoutDirectionType)GetValue(LayoutDirectionProperty); + } + set + { + SetValue(LayoutDirectionProperty, value); + NotifyPropertyChanged(); + } } /// - /// Sets the name of the style to be applied to the view. + /// Gets or sets the Margin for use in layout. /// - /// A string matching a style described in a stylesheet. - /// 3 - public void SetStyleName(string styleName) + /// + /// Margin property is supported by Layout algorithms and containers. + /// Please Set Layout if you want to use Margin property. + /// + /// 4 + public Extents Margin { - NDalicPINVOKE.View_SetStyleName(swigCPtr, styleName); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + get + { + return (Extents)GetValue(MarginProperty); + } + set + { + SetValue(MarginProperty, value); + NotifyPropertyChanged(); + } } /// - /// Retrieves the name of the style to be applied to the view (if any). + /// [Obsolete("Please do not use! this will be deprecated")] /// - /// A string matching a style, or an empty string. - /// 3 - public string GetStyleName() + /// Please do not use! this will be deprecated! + /// Instead please use Padding. + /// 4 + [Obsolete("Please do not use! this will be deprecated, instead please use Padding.")] + [EditorBrowsable(EditorBrowsableState.Never)] + public Extents PaddingEX { - string ret = NDalicPINVOKE.View_GetStyleName(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; + get + { + Extents temp = new Extents(0, 0, 0, 0); + GetProperty(View.Property.PADDING).Get(temp); + return temp; + } + set + { + SetProperty(View.Property.PADDING, new Tizen.NUI.PropertyValue(value)); + NotifyPropertyChanged(); + } } - internal void SetBackgroundColor(Vector4 color) + internal Style Style { - NDalicPINVOKE.View_SetBackgroundColor(swigCPtr, Vector4.getCPtr(color)); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + get + { + return (Style)GetValue(StyleProperty); + } + set + { + SetValue(StyleProperty, value); + } } - internal Vector4 GetBackgroundColor() + /// + /// Child property to specify desired width + /// + internal int LayoutWidthSpecificationFixed { - Vector4 ret = new Vector4(NDalicPINVOKE.View_GetBackgroundColor(swigCPtr), true); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; + get + { + int tmp = 0; + if (GetProperty(LayoutItemWrapper.ChildProperty.WIDTH_SPECIFICATION).Get(out tmp) == false) + { + NUILog.Error("WidthSpecificationFixed get error!"); + } + return tmp; + } + set + { + SetProperty(LayoutItemWrapper.ChildProperty.WIDTH_SPECIFICATION, new Tizen.NUI.PropertyValue(value)); + } } - internal void SetBackgroundImage(Image image) + /// + /// Child property to specify desired height + /// + internal int LayoutHeightSpecificationFixed { - NDalicPINVOKE.View_SetBackgroundImage(swigCPtr, Image.getCPtr(image)); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + get + { + int tmp = 0; + if (GetProperty(LayoutItemWrapper.ChildProperty.HEIGHT_SPECIFICATION).Get(out tmp) == false) + { + NUILog.Error("HeightSpecificationFixed get error!"); + } + return tmp; + } + set + { + SetProperty(LayoutItemWrapper.ChildProperty.HEIGHT_SPECIFICATION, new Tizen.NUI.PropertyValue(value)); + } } /// - /// Clears the background. + /// Child property to specify desired width, use MatchParent/WrapContent) /// - /// 3 - public void ClearBackground() + internal ChildLayoutData LayoutWidthSpecification { - NDalicPINVOKE.View_ClearBackground(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + get + { + int tmp = 0; + if (GetProperty(LayoutItemWrapper.ChildProperty.WIDTH_SPECIFICATION).Get(out tmp) == false) + { + NUILog.Error("WidthSpecificationFixed get error!"); + } + return (ChildLayoutData)tmp; + } + set + { + SetProperty(LayoutItemWrapper.ChildProperty.WIDTH_SPECIFICATION, new Tizen.NUI.PropertyValue((int)value)); + } + } + + /// + /// Child property to specify desired height, use MatchParent/WrapContent) + /// + internal ChildLayoutData LayoutHeightSpecification + { + get + { + int tmp = 0; + if (GetProperty(LayoutItemWrapper.ChildProperty.HEIGHT_SPECIFICATION).Get(out tmp) == false) + { + NUILog.Error("HeightSpecificationFixed get error!"); + } + return (ChildLayoutData)tmp; + } + set + { + SetProperty(LayoutItemWrapper.ChildProperty.HEIGHT_SPECIFICATION, new Tizen.NUI.PropertyValue((int)value)); + } } - internal ControlKeySignal KeyEventSignal() + internal float Weight { - ControlKeySignal ret = new ControlKeySignal(NDalicPINVOKE.View_KeyEventSignal(swigCPtr), false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; + get + { + return (float)GetValue(WeightProperty); + } + set + { + SetValue(WeightProperty, value); + NotifyPropertyChanged(); + } } - internal KeyInputFocusSignal KeyInputFocusGainedSignal() + internal bool BackgroundImageSynchronosLoading { - KeyInputFocusSignal ret = new KeyInputFocusSignal(NDalicPINVOKE.View_KeyInputFocusGainedSignal(swigCPtr), false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; + get + { + return _backgroundImageSynchronosLoading; + } + set + { + if (value != _backgroundImageSynchronosLoading) + { + string bgUrl = ""; + PropertyMap bgMap = this.Background; + int visualType = 0; + bgMap.Find(Visual.Property.Type)?.Get(out visualType); + if (visualType == (int)Visual.Type.Image) + { + bgMap.Find(ImageVisualProperty.URL)?.Get(out bgUrl); + } + if (bgUrl.Length != 0) + { + _backgroundImageSynchronosLoading = value; + bgMap.Add("synchronousLoading", new PropertyValue(_backgroundImageSynchronosLoading)); + this.Background = bgMap; + } + } + } } - internal KeyInputFocusSignal KeyInputFocusLostSignal() + internal float WorldPositionX { - KeyInputFocusSignal ret = new KeyInputFocusSignal(NDalicPINVOKE.View_KeyInputFocusLostSignal(swigCPtr), false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; + get + { + float temp = 0.0f; + GetProperty(View.Property.WORLD_POSITION_X).Get(out temp); + return temp; + } } - internal View(ViewImpl implementation) : this(NDalicPINVOKE.new_View__SWIG_2(ViewImpl.getCPtr(implementation)), true) + internal float WorldPositionY { - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + get + { + float temp = 0.0f; + GetProperty(View.Property.WORLD_POSITION_Y).Get(out temp); + return temp; + } } - internal enum PropertyRange + internal float WorldPositionZ { - PROPERTY_START_INDEX = PropertyRanges.PROPERTY_REGISTRATION_START_INDEX, - CONTROL_PROPERTY_START_INDEX = PROPERTY_START_INDEX, - CONTROL_PROPERTY_END_INDEX = CONTROL_PROPERTY_START_INDEX + 1000 + get + { + float temp = 0.0f; + GetProperty(View.Property.WORLD_POSITION_Z).Get(out temp); + return temp; + } } - /// - /// The StyleName, type string. - /// - /// 3 - public string StyleName + internal bool FocusState { get { - return (string)GetValue(StyleNameProperty); + return IsKeyboardFocusable(); } set { - SetValue(StyleNameProperty, value); - NotifyPropertyChanged(); + SetKeyboardFocusable(value); } } /// - /// The mutually exclusive with BACKGROUND_IMAGE and BACKGROUND type Vector4. + /// Set the layout on this control. /// - /// 3 - public Color BackgroundColor + /// + /// + internal LayoutItem Layout { get { - return (Color)GetValue(BackgroundColorProperty); + IntPtr cPtr = Tizen.NUI.NDalicManualPINVOKE.GetLayout__SWIG_1(View.getCPtr(this)); + + HandleRef CPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); + BaseHandle basehandle = Registry.GetManagedBaseHandleFromNativePtr(CPtr.Handle); + NDalicPINVOKE.delete_BaseHandle(CPtr); + CPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); + + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + + return basehandle as LayoutItem; } set { - SetValue(BackgroundColorProperty, value); - NotifyPropertyChanged(); + Log.Info("NUI", "Set Layout on:" + Name + "\n"); + layoutingDisabled = false; + layoutSet = true; + SetLayout(value); } } /// - /// Creates an animation to animate the background color visual. If there is no - /// background visual, creates one with transparent black as it's mixColor. + /// Set that layouting is required on this View. It will automatically receive a Layout. /// - /// 3 - public Animation AnimateBackgroundColor(object destinationValue, - int startTime, - int endTime, - AlphaFunction.BuiltinFunctions? alphaFunction = null, - object initialValue = null) + /// + /// + internal bool LayoutingRequired { - Tizen.NUI.PropertyMap background = Background; - - if (background.Empty()) + get { - // If there is no background yet, ensure there is a transparent - // color visual - BackgroundColor = new Color(0.0f, 0.0f, 0.0f, 0.0f); - background = Background; + bool result = Tizen.NUI.NDalicManualPINVOKE.View_IsLayoutingRequired(View.getCPtr(this)); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return result; + } + set + { + Tizen.NUI.NDalicManualPINVOKE.View_SetLayoutingRequired(View.getCPtr(this), value); } - return AnimateColor("background", destinationValue, startTime, endTime, alphaFunction, initialValue); } - /// - /// Creates an animation to animate the mixColor of the named visual. - /// - /// 3 - public Animation AnimateColor(string targetVisual, object destinationColor, int startTime, int endTime, AlphaFunction.BuiltinFunctions? alphaFunction = null, object initialColor = null) + internal float ParentOriginX { - Animation animation = null; + get { - PropertyMap _animator = new PropertyMap(); - if (alphaFunction != null) - { - _animator.Add("alphaFunction", new PropertyValue(AlphaFunction.BuiltinToPropertyKey(alphaFunction))); - } - - PropertyMap _timePeriod = new PropertyMap(); - _timePeriod.Add("duration", new PropertyValue((endTime - startTime) / 1000.0f)); - _timePeriod.Add("delay", new PropertyValue(startTime / 1000.0f)); - _animator.Add("timePeriod", new PropertyValue(_timePeriod)); - - PropertyMap _transition = new PropertyMap(); - _transition.Add("animator", new PropertyValue(_animator)); - _transition.Add("target", new PropertyValue(targetVisual)); - _transition.Add("property", new PropertyValue("mixColor")); - - if (initialColor != null) - { - PropertyValue initValue = PropertyValue.CreateFromObject(initialColor); - _transition.Add("initialValue", initValue); - } - - PropertyValue destValue = PropertyValue.CreateFromObject(destinationColor); - _transition.Add("targetValue", destValue); - TransitionData _transitionData = new TransitionData(_transition); - - animation = new Animation(NDalicManualPINVOKE.View_CreateTransition(swigCPtr, TransitionData.getCPtr(_transitionData)), true); - if (NDalicPINVOKE.SWIGPendingException.Pending) - throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + float temp = 0.0f; + GetProperty(View.Property.PARENT_ORIGIN_X).Get(out temp); + return temp; + } + set + { + SetProperty(View.Property.PARENT_ORIGIN_X, new Tizen.NUI.PropertyValue(value)); + NotifyPropertyChanged(); } - return animation; } - /// - /// The mutually exclusive with BACKGROUND_COLOR and BACKGROUND type Map. - /// - /// 3 - public string BackgroundImage + internal float ParentOriginY { get { - return (string)GetValue(BackgroundImageProperty); + float temp = 0.0f; + GetProperty(View.Property.PARENT_ORIGIN_Y).Get(out temp); + return temp; } set { - SetValue(BackgroundImageProperty, value); + SetProperty(View.Property.PARENT_ORIGIN_Y, new Tizen.NUI.PropertyValue(value)); NotifyPropertyChanged(); } } - /// - /// The background of view. - /// - /// 3 - public Tizen.NUI.PropertyMap Background + internal float ParentOriginZ { get { - return (PropertyMap)GetValue(BackgroundProperty); + float temp = 0.0f; + GetProperty(View.Property.PARENT_ORIGIN_Z).Get(out temp); + return temp; } set { - SetValue(BackgroundProperty, value); + SetProperty(View.Property.PARENT_ORIGIN_Z, new Tizen.NUI.PropertyValue(value)); NotifyPropertyChanged(); } } - - /// - /// The current state of the view. - /// - /// 3 - public States State + internal float PivotPointX { get { - return (States)GetValue(StateProperty); + float temp = 0.0f; + GetProperty(View.Property.ANCHOR_POINT_X).Get(out temp); + return temp; } set { - SetValue(StateProperty, value); - NotifyPropertyChanged(); + SetProperty(View.Property.ANCHOR_POINT_X, new Tizen.NUI.PropertyValue(value)); } } - /// - /// The current sub state of the view. - /// - /// 3 - public States SubState + internal float PivotPointY { get { - return (States)GetValue(SubStateProperty); + float temp = 0.0f; + GetProperty(View.Property.ANCHOR_POINT_Y).Get(out temp); + return temp; } set { - SetValue(SubStateProperty, value); - NotifyPropertyChanged(); + SetProperty(View.Property.ANCHOR_POINT_Y, new Tizen.NUI.PropertyValue(value)); } } - /// - /// Displays a tooltip - /// - /// 3 - public Tizen.NUI.PropertyMap Tooltip + internal float PivotPointZ { get { - return (PropertyMap)GetValue(TooltipProperty); + float temp = 0.0f; + GetProperty(View.Property.ANCHOR_POINT_Z).Get(out temp); + return temp; } set { - SetValue(TooltipProperty, value); - NotifyPropertyChanged(); + SetProperty(View.Property.ANCHOR_POINT_Z, new Tizen.NUI.PropertyValue(value)); } } - /// - /// Displays a tooltip as a text. - /// - /// 3 - public string TooltipText + internal Matrix WorldMatrix { - set + get { - SetProperty(View.Property.TOOLTIP, new Tizen.NUI.PropertyValue(value)); - NotifyPropertyChanged(); + Matrix temp = new Matrix(); + GetProperty(View.Property.WORLD_MATRIX).Get(temp); + return temp; } } @@ -2913,617 +3683,546 @@ namespace Tizen.NUI.BaseComponents } /// - /// The Child property of FlexContainer.
- /// The proportion of the free space in the container, the flex item will receive.
- /// If all items in the container set this property, their sizes will be proportional to the specified flex factor.
+ /// Perform an action on a visual registered to this view.
+ /// Visuals will have actions. This API is used to perform one of these actions with the given attributes. ///
- /// 3 - public float Flex + /// The Property index of the visual. + /// The action to perform. See Visual to find the supported actions. + /// Optional attributes for the action. + /// 5 + public void DoAction(int propertyIndexOfVisual, int propertyIndexOfActionId, PropertyValue attributes) { - get - { - return (float)GetValue(FlexProperty); - } - set - { - SetValue(FlexProperty, value); - NotifyPropertyChanged(); - } + NDalicManualPINVOKE.View_DoAction(swigCPtr, propertyIndexOfVisual, propertyIndexOfActionId, PropertyValue.getCPtr(attributes)); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } /// - /// The Child property of FlexContainer.
- /// The alignment of the flex item along the cross axis, which, if set, overides the default alignment for all items in the container.
+ /// Creates an animation to animate the background color visual. If there is no + /// background visual, creates one with transparent black as it's mixColor. ///
/// 3 - public int AlignSelf + public Animation AnimateBackgroundColor(object destinationValue, + int startTime, + int endTime, + AlphaFunction.BuiltinFunctions? alphaFunction = null, + object initialValue = null) { - get - { - return (int)GetValue(AlignSelfProperty); - } - set - { - SetValue(AlignSelfProperty, value); - NotifyPropertyChanged(); - } - } + Tizen.NUI.PropertyMap background = Background; - /// - /// The Child property of FlexContainer.
- /// The space around the flex item.
- ///
- /// 3 - public Vector4 FlexMargin - { - get - { - return (Vector4)GetValue(FlexMarginProperty); - } - set + if (background.Empty()) { - SetValue(FlexMarginProperty, value); - NotifyPropertyChanged(); + // If there is no background yet, ensure there is a transparent + // color visual + BackgroundColor = new Color(0.0f, 0.0f, 0.0f, 0.0f); + background = Background; } + return AnimateColor("background", destinationValue, startTime, endTime, alphaFunction, initialValue); } /// - /// The top-left cell this child occupies, if not set, the first available cell is used. + /// Creates an animation to animate the mixColor of the named visual. /// /// 3 - public Vector2 CellIndex + public Animation AnimateColor(string targetVisual, object destinationColor, int startTime, int endTime, AlphaFunction.BuiltinFunctions? alphaFunction = null, object initialColor = null) { - get - { - return (Vector2)GetValue(CellIndexProperty); - } - set + Animation animation = null; { - SetValue(CellIndexProperty, value); - NotifyPropertyChanged(); - } - } + PropertyMap _animator = new PropertyMap(); + if (alphaFunction != null) + { + _animator.Add("alphaFunction", new PropertyValue(AlphaFunction.BuiltinToPropertyKey(alphaFunction))); + } - /// - /// The number of rows this child occupies, if not set, the default value is 1. - /// - /// 3 - public float RowSpan - { - get - { - return (float)GetValue(RowSpanProperty); - } - set - { - SetValue(RowSpanProperty, value); - NotifyPropertyChanged(); - } - } + PropertyMap _timePeriod = new PropertyMap(); + _timePeriod.Add("duration", new PropertyValue((endTime - startTime) / 1000.0f)); + _timePeriod.Add("delay", new PropertyValue(startTime / 1000.0f)); + _animator.Add("timePeriod", new PropertyValue(_timePeriod)); - /// - /// The number of columns this child occupies, if not set, the default value is 1. - /// - /// 3 - public float ColumnSpan - { - get - { - return (float)GetValue(ColumnSpanProperty); - } - set - { - SetValue(ColumnSpanProperty, value); - NotifyPropertyChanged(); - } - } + PropertyMap _transition = new PropertyMap(); + _transition.Add("animator", new PropertyValue(_animator)); + _transition.Add("target", new PropertyValue(targetVisual)); + _transition.Add("property", new PropertyValue("mixColor")); - /// - /// The horizontal alignment of this child inside the cells, if not set, the default value is 'left'. - /// - /// 3 - public Tizen.NUI.HorizontalAlignmentType CellHorizontalAlignment - { - get - { - return (HorizontalAlignmentType)GetValue(CellHorizontalAlignmentProperty); - } - set - { - SetValue(CellHorizontalAlignmentProperty, value); - NotifyPropertyChanged(); + if (initialColor != null) + { + PropertyValue initValue = PropertyValue.CreateFromObject(initialColor); + _transition.Add("initialValue", initValue); + } + + PropertyValue destValue = PropertyValue.CreateFromObject(destinationColor); + _transition.Add("targetValue", destValue); + TransitionData _transitionData = new TransitionData(_transition); + + animation = new Animation(NDalicManualPINVOKE.View_CreateTransition(swigCPtr, TransitionData.getCPtr(_transitionData)), true); + if (NDalicPINVOKE.SWIGPendingException.Pending) + throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } + return animation; } + // From Container Base class /// - /// The vertical alignment of this child inside the cells, if not set, the default value is 'top'. + /// Adds a child view to this view. /// - /// 3 - public Tizen.NUI.VerticalAlignmentType CellVerticalAlignment + /// + /// 4 + public override void Add(View child) { - get + if (null == child) { - return (VerticalAlignmentType)GetValue(CellVerticalAlignmentProperty); + Tizen.Log.Fatal("NUI", "Child is null"); + return; } - set + + Log.Info("NUI", "Adding Child:" + child.Name + " to " + Name + "\n"); + + Container oldParent = child.GetParent(); + if (oldParent != this) { - SetValue(CellVerticalAlignmentProperty, value); - NotifyPropertyChanged(); + if (oldParent != null) + { + oldParent.Remove(child); + } + child.InternalParent = this; + + // Only give children a layout if their parent is an explicit container or a pure View. + // Pure View meaning not derived from a View, e.g a Legacy container. + // layoutSet flag is true when the View became a layout using the set Layout API opposed to automatically due to it's parent. + // First time the set Layout API is used by any View the Window no longer has layoutingDisabled. + if ((true == layoutSet || GetType() == typeof(View)) && null == child.Layout && false == layoutingDisabled) + { + Log.Info("NUI", "Parent[" + Name + "] Layout set[" + layoutSet.ToString() + "] Pure View[" + (!layoutSet).ToString() + "]\n"); + // If child is a View or explicitly set to require layouting then set child as a LayoutGroup. + // If the child is derived from a View then it may be a legacy or existing container hence will do layouting itself. + if (child.GetType() == typeof(View) || true == child.LayoutingRequired) + { + Log.Info("NUI", "Creating LayoutGroup for " + child.Name + " LayoutingRequired[" + child.LayoutingRequired.ToString() + "]\n"); + child.SetLayout(new LayoutGroup()); + } + else + { + // Adding child as a leaf, layouting will not propagate past this child. + // Legacy containers will be a LayoutItems too and layout their children how they wish. + Log.Info("NUI", "Creating LayoutItem for " + child.Name + "\n"); + child.SetLayout(new LayoutItem()); + } + } + + if (Layout) + { + Layout.LayoutChildren.Add(child.Layout); + } + + NDalicPINVOKE.Actor_Add(swigCPtr, View.getCPtr(child)); + if (NDalicPINVOKE.SWIGPendingException.Pending) + throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + Children.Add(child); + + if (ChildAdded != null) + { + ChildAddedEventArgs e = new ChildAddedEventArgs + { + Added = child + }; + ChildAdded(this, e); + } } } /// - /// The left focusable view.
- /// This will return null if not set.
- /// This will also return null if the specified left focusable view is not on a window.
+ /// Removes a child view from this View. If the view was not a child of this view, this is a no-op. ///
- /// 3 - public View LeftFocusableView + /// + /// 4 + public override void Remove(View child) { - // As native side will be only storing IDs so need a logic to convert View to ID and vice-versa. - get + NDalicPINVOKE.Actor_Remove(swigCPtr, View.getCPtr(child)); + if (NDalicPINVOKE.SWIGPendingException.Pending) + throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + + Children.Remove(child); + child.InternalParent = null; + + if (Layout) { - return (View)GetValue(LeftFocusableViewProperty); + if (child.Layout) + { + Layout.LayoutChildren.Remove(child.Layout); + } } - set + + if (ChildRemoved != null) { - SetValue(LeftFocusableViewProperty, value); - NotifyPropertyChanged(); + ChildRemovedEventArgs e = new ChildRemovedEventArgs + { + Removed = child + }; + ChildRemoved(this, e); } } /// - /// The right focusable view.
- /// This will return null if not set.
- /// This will also return null if the specified right focusable view is not on a window.
+ /// Retrieves a child view by index. ///
- /// 3 - public View RightFocusableView + /// + /// 4 + public override View GetChildAt(uint index) { - // As native side will be only storing IDs so need a logic to convert View to ID and vice-versa. - get + if (index < Children.Count) { - return (View)GetValue(RightFocusableViewProperty); + return Children[Convert.ToInt32(index)]; } - set + else { - SetValue(RightFocusableViewProperty, value); - NotifyPropertyChanged(); + return null; } } /// - /// The up focusable view.
- /// This will return null if not set.
- /// This will also return null if the specified up focusable view is not on a window.
+ /// Retrieves the number of children held by the view. ///
- /// 3 - public View UpFocusableView + /// + /// 4 + public override uint GetChildCount() { - // As native side will be only storing IDs so need a logic to convert View to ID and vice-versa. - get - { - return (View)GetValue(UpFocusableViewProperty); - } - set - { - SetValue(UpFocusableViewProperty, value); - NotifyPropertyChanged(); - } + return Convert.ToUInt32(Children.Count); } /// - /// The down focusable view.
- /// This will return null if not set.
- /// This will also return null if the specified down focusable view is not on a window.
+ /// Gets the views parent. ///
- /// 3 - public View DownFocusableView + /// + /// 4 + public override Container GetParent() { - // As native side will be only storing IDs so need a logic to convert View to ID and vice-versa. - get - { - return (View)GetValue(DownFocusableViewProperty); - } - set - { - SetValue(DownFocusableViewProperty, value); - NotifyPropertyChanged(); - } + return this.InternalParent as Container; } /// - /// Whether the view should be focusable by keyboard navigation. + /// Queries whether the view has a focus. /// + /// True if this view has a focus. /// 3 - public bool Focusable + public bool HasFocus() { - set - { - SetValue(FocusableProperty, value); - NotifyPropertyChanged(); - } - get - { - return (bool)GetValue(FocusableProperty); - } + bool ret = NDalicPINVOKE.View_HasKeyInputFocus(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; } /// - /// Enumeration for describing the states of the view. + /// Sets the name of the style to be applied to the view. /// + /// A string matching a style described in a stylesheet. /// 3 - public enum States + public void SetStyleName(string styleName) { - /// - /// The normal state. - /// - Normal, - /// - /// The focused state. - /// - Focused, - /// - /// The disabled state. - /// - Disabled + NDalicPINVOKE.View_SetStyleName(swigCPtr, styleName); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } /// - /// Retrieves the position of the view.
- /// The coordinates are relative to the view's parent.
+ /// Retrieves the name of the style to be applied to the view (if any). ///
+ /// A string matching a style, or an empty string. /// 3 - public Position CurrentPosition + public string GetStyleName() { - get - { - return GetCurrentPosition(); - } + string ret = NDalicPINVOKE.View_GetStyleName(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; } /// - /// Sets the size of a view for the width and the height.
- /// Geometry can be scaled to fit within this area.
- /// This does not interfere with the view's scale factor.
- /// The views default depth is the minimum of width and height.
+ /// Clears the background. ///
- /// - /// This NUI object (Size2D) typed property can be configured by multiple cascade setting.
- /// For example, this code ( view.Size2D.Width = 100; view.Size2D.Height = 100; ) is equivalent to this ( view.Size2D = new Size2D(100, 100); ).
- /// Please note that this multi-cascade setting is especially possible for this NUI object (Size2D).
- /// This means by default others are impossible so it is recommended that NUI object typed properties are configured by their constructor with parameters.
- /// For example, this code is working fine : view.Scale = new Vector3( 2.0f, 1.5f, 0.0f);
- /// but this will not work! : view.Scale.X = 2.0f; view.Scale.Y = 1.5f;
- /// It may not match the current value in some cases, i.e. when the animation is progressing or the maximum or minimu size is set.
- ///
/// 3 - public Size2D Size2D + public void ClearBackground() { - get - { - Size2D temp = (Size2D)GetValue(Size2DProperty); - return new Size2D(OnSize2DChanged, temp.Width, temp.Height); - } - set - { - SetValue(Size2DProperty, value); - // Set Specification so when layouts measure this View it matches the value set here. - // All Views are currently Layouts. - SetProperty(LayoutItemWrapper.ChildProperty.WIDTH_SPECIFICATION, new Tizen.NUI.PropertyValue(value.Width)); - SetProperty(LayoutItemWrapper.ChildProperty.HEIGHT_SPECIFICATION, new Tizen.NUI.PropertyValue(value.Height)); - NotifyPropertyChanged(); - } + NDalicPINVOKE.View_ClearBackground(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } - private void OnSize2DChanged(int width, int height) + /// + /// Shows the view. + /// + /// + /// This is an asynchronous method. + /// + /// 3 + public void Show() { - Size2D = new Size2D(width, height); + SetVisible(true); } /// - /// Retrieves the size of the view.
- /// The coordinates are relative to the view's parent.
+ /// Hides the view. ///
+ /// + /// This is an asynchronous method. + /// If the view is hidden, then the view and its children will not be rendered. + /// This is regardless of the individual visibility of the children, i.e., the view will only be rendered if all of its parents are shown. + /// /// 3 - public Size2D CurrentSize + public void Hide() { - get - { - return GetCurrentSize(); - } + SetVisible(false); } /// - /// Retrieves and sets the view's opacity.
+ /// Raises the view above all other views. ///
+ /// + /// Sibling order of views within the parent will be updated automatically. + /// Once a raise or lower API is used, that view will then have an exclusive sibling order independent of insertion. + /// /// 3 - public float Opacity + public void RaiseToTop() { - get - { - return (float)GetValue(OpacityProperty); - } - set + var parentChildren = GetParent()?.Children; + + if (parentChildren != null) { - SetValue(OpacityProperty, value); - NotifyPropertyChanged(); + parentChildren.Remove(this); + parentChildren.Add(this); + + NDalicPINVOKE.RaiseToTop(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) + throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } + } /// - /// Sets the position of the view for X and Y.
- /// By default, sets the position vector between the parent origin and the pivot point (default).
- /// If the position inheritance is disabled, sets the world position.
+ /// Lowers the view to the bottom of all views. ///
/// - /// This NUI object (Position2D) typed property can be configured by multiple cascade setting.
- /// For example, this code ( view.Position2D.X = 100; view.Position2D.Y = 100; ) is equivalent to this ( view.Position2D = new Position2D(100, 100); ).
- /// Please note that this multi-cascade setting is especially possible for this NUI object (Position2D).
- /// This means by default others are impossible so it is recommended that NUI object typed properties are configured by their constructor with parameters.
- /// For example, this code is working fine : view.Scale = new Vector3( 2.0f, 1.5f, 0.0f);
- /// but this will not work! : view.Scale.X = 2.0f; view.Scale.Y = 1.5f;
+ /// The sibling order of views within the parent will be updated automatically. + /// Once a raise or lower API is used that view will then have an exclusive sibling order independent of insertion. ///
/// 3 - public Position2D Position2D + public void LowerToBottom() { - get - { - Position2D temp = (Position2D)GetValue(Position2DProperty); - return new Position2D(OnPosition2DChanged, temp.X, temp.Y); - } - set + var parentChildren = GetParent()?.Children; + + if (parentChildren != null) { - SetValue(Position2DProperty, value); - NotifyPropertyChanged(); + parentChildren.Remove(this); + parentChildren.Insert(0, this); + + NDalicPINVOKE.LowerToBottom(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) + throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } } - private void OnPosition2DChanged(int x, int y) + /// + /// Queries if all resources required by a view are loaded and ready. + /// + /// Most resources are only loaded when the control is placed on the stage. + /// + /// 3 + public bool IsResourceReady() { - Position2D = new Position2D(x, y); + bool ret = NDalicPINVOKE.IsResourceReady(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; } /// - /// Retrieves the screen postion of the view.
+ /// Gets the parent layer of this view.If a view has no parent, this method does not do anything. ///
- /// 3 - public Vector2 ScreenPosition + ///
The view has been initialized. 
+ /// The parent layer of view + /// 5 + public Layer GetLayer() { - get - { - Vector2 temp = new Vector2(0.0f, 0.0f); - GetProperty(View.Property.SCREEN_POSITION).Get(temp); - return temp; - } + //to fix memory leak issue, match the handle count with native side. + IntPtr cPtr = NDalicPINVOKE.Actor_GetLayer(swigCPtr); + HandleRef CPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); + Layer ret = Registry.GetManagedBaseHandleFromNativePtr(CPtr.Handle) as Layer; + NDalicPINVOKE.delete_BaseHandle(CPtr); + CPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); + + if (NDalicPINVOKE.SWIGPendingException.Pending) + throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; } /// - /// Determines whether the pivot point should be used to determine the position of the view. - /// This is true by default. + /// Removes a view from its parent view or layer. If a view has no parent, this method does nothing. /// - /// If false, then the top-left of the view is used for the position. - /// Setting this to false will allow scaling or rotation around the anchor-point without affecting the view's position. - /// - /// 3 - public bool PositionUsesPivotPoint + ///
The (child) view has been initialized. 
+ /// 4 + public void Unparent() { - get - { - return (bool)GetValue(PositionUsesPivotPointProperty); - } - set - { - SetValue(PositionUsesPivotPointProperty, value); - NotifyPropertyChanged(); - } + GetParent()?.Remove(this); } /// - /// Please do not use! this will be deprecated. + /// Search through this view's hierarchy for a view with the given name. + /// The view itself is also considered in the search. /// - /// Please do not use! this will be deprecated! - /// Instead please use PositionUsesPivotPoint. + ///
The view has been initialized.
+ /// The name of the view to find. + /// A handle to the view if found, or an empty handle if not. /// 3 - [Obsolete("Please do not use! This will be deprecated! Please use PositionUsesPivotPoint instead! " + - "Like: " + - "View view = new View(); " + - "view.PivotPoint = PivotPoint.Center; " + - "view.PositionUsesPivotPoint = true;")] - [EditorBrowsable(EditorBrowsableState.Never)] - public bool PositionUsesAnchorPoint + public View FindChildByName(string viewName) { - get - { - bool temp = false; - GetProperty(View.Property.POSITION_USES_ANCHOR_POINT).Get(out temp); - return temp; - } - set - { - SetProperty(View.Property.POSITION_USES_ANCHOR_POINT, new Tizen.NUI.PropertyValue(value)); - NotifyPropertyChanged(); - } + //to fix memory leak issue, match the handle count with native side. + IntPtr cPtr = NDalicPINVOKE.Actor_FindChildByName(swigCPtr, viewName); + HandleRef CPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); + View ret = Registry.GetManagedBaseHandleFromNativePtr(CPtr.Handle) as View; + NDalicPINVOKE.delete_BaseHandle(CPtr); + CPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); + + if (NDalicPINVOKE.SWIGPendingException.Pending) + throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; } - internal bool FocusState + /// + /// Converts screen coordinates into the view's coordinate system using the default camera. + /// + ///
The view has been initialized.
+ /// The view coordinates are relative to the top-left(0.0, 0.0, 0.5). + /// On return, the X-coordinate relative to the view. + /// On return, the Y-coordinate relative to the view. + /// The screen X-coordinate. + /// The screen Y-coordinate. + /// True if the conversion succeeded. + /// 3 + public bool ScreenToLocal(out float localX, out float localY, float screenX, float screenY) { - get - { - return IsKeyboardFocusable(); - } - set - { - SetKeyboardFocusable(value); - } + bool ret = NDalicPINVOKE.Actor_ScreenToLocal(swigCPtr, out localX, out localY, screenX, screenY); + if (NDalicPINVOKE.SWIGPendingException.Pending) + throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; } /// - /// Queries whether the view is connected to the stage.
- /// When a view is connected, it will be directly or indirectly parented to the root view.
+ /// Sets the relative to parent size factor of the view.
+ /// This factor is only used when ResizePolicy is set to either: + /// ResizePolicy::SIZE_RELATIVE_TO_PARENT or ResizePolicy::SIZE_FIXED_OFFSET_FROM_PARENT.
+ /// This view's size is set to the view's size multiplied by or added to this factor, depending on ResizePolicy.
///
+ ///
The view has been initialized.
+ /// A Vector3 representing the relative factor to be applied to each axis. /// 3 - public bool IsOnWindow + public void SetSizeModeFactor(Vector3 factor) { - get - { - return OnWindow(); - } + NDalicPINVOKE.Actor_SetSizeModeFactor(swigCPtr, Vector3.getCPtr(factor)); + if (NDalicPINVOKE.SWIGPendingException.Pending) + throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } - /// - /// Gets the depth in the hierarchy for the view. + /// Calculates the height of the view given a width.
+ /// The natural size is used for default calculation.
+ /// Size 0 is treated as aspect ratio 1:1.
///
+ /// The width to use. + /// The height based on the width. /// 3 - public int HierarchyDepth + public float GetHeightForWidth(float width) { - get - { - return GetHierarchyDepth(); - } + float ret = NDalicPINVOKE.Actor_GetHeightForWidth(swigCPtr, width); + if (NDalicPINVOKE.SWIGPendingException.Pending) + throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; } /// - /// Sets the sibling order of the view so the depth position can be defined within the same parent. + /// Calculates the width of the view given a height.
+ /// The natural size is used for default calculation.
+ /// Size 0 is treated as aspect ratio 1:1.
///
- /// - /// Note the initial value is 0. SiblingOrder should be bigger than 0 or equal to 0. - /// Raise, Lower, RaiseToTop, LowerToBottom, RaiseAbove, and LowerBelow will override the sibling order. - /// The values set by this property will likely change. - /// + /// The height to use. + /// The width based on the height. /// 3 - public int SiblingOrder + public float GetWidthForHeight(float height) { - get - { - return (int)GetValue(SiblingOrderProperty); - } - set - { - SetValue(SiblingOrderProperty, value); - NotifyPropertyChanged(); - } + float ret = NDalicPINVOKE.Actor_GetWidthForHeight(swigCPtr, height); + if (NDalicPINVOKE.SWIGPendingException.Pending) + throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; } /// - /// Returns the natural size of the view. + /// Return the amount of size allocated for relayout. /// - /// - /// Deriving classes stipulate the natural size and by default a view has a zero natural size. - /// - /// 5 - public Vector3 NaturalSize + /// The dimension to retrieve. + /// Return the size. + /// 3 + public float GetRelayoutSize(DimensionType dimension) { - get - { - Vector3 ret = new Vector3(NDalicPINVOKE.Actor_GetNaturalSize(swigCPtr), true); - if (NDalicPINVOKE.SWIGPendingException.Pending) - throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } + float ret = NDalicPINVOKE.Actor_GetRelayoutSize(swigCPtr, (int)dimension); + if (NDalicPINVOKE.SWIGPendingException.Pending) + throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; } /// - /// Returns the natural size (Size2D) of the view. + /// Set the padding for the view. /// - /// - /// Deriving classes stipulate the natural size and by default a view has a zero natural size. - /// - /// 4 - public Size2D NaturalSize2D + /// Padding for the view. + /// 3 + public void SetPadding(PaddingType padding) { - get - { - Vector3 temp = new Vector3(NDalicPINVOKE.Actor_GetNaturalSize(swigCPtr), true); - if (NDalicPINVOKE.SWIGPendingException.Pending) - throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - - return new Size2D((int)temp.Width, (int)temp.Height); - } + NDalicPINVOKE.Actor_SetPadding(swigCPtr, PaddingType.getCPtr(padding)); + if (NDalicPINVOKE.SWIGPendingException.Pending) + throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } /// - /// Set the layout on this control. + /// Return the value of padding for the view. /// - /// - /// - internal LayoutItem Layout + /// the value of padding for the view + /// 3 + public void GetPadding(PaddingType paddingOut) { - get - { - IntPtr cPtr = Tizen.NUI.NDalicManualPINVOKE.GetLayout__SWIG_1(View.getCPtr(this)); - - HandleRef CPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); - BaseHandle basehandle = Registry.GetManagedBaseHandleFromNativePtr(CPtr.Handle); - NDalicPINVOKE.delete_BaseHandle(CPtr); - CPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); - - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - - return basehandle as LayoutItem; - } - set - { - Log.Info("NUI", "Set Layout on:" + Name + "\n"); - layoutingDisabled = false; - layoutSet = true; - SetLayout( value ); - } + NDalicPINVOKE.Actor_GetPadding(swigCPtr, PaddingType.getCPtr(paddingOut)); + if (NDalicPINVOKE.SWIGPendingException.Pending) + throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } - internal void SetLayout( LayoutItem layout ) + /// 3 + public uint AddRenderer(Renderer renderer) { - Tizen.NUI.NDalicManualPINVOKE.SetLayout__SWIG_1(View.getCPtr(this), LayoutItem.getCPtr(layout) ); - layout.LayoutChildren.Clear(); - foreach (View view in Children) - { - layout.LayoutChildren.Add(view.Layout); - } + uint ret = NDalicPINVOKE.Actor_AddRenderer(swigCPtr, Renderer.getCPtr(renderer)); + if (NDalicPINVOKE.SWIGPendingException.Pending) + throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; } - /// - /// Set that layouting is required on this View. It will automatically receive a Layout. - /// - /// - /// - internal bool LayoutingRequired + /// 3 + public Renderer GetRendererAt(uint index) { - get - { - bool result = Tizen.NUI.NDalicManualPINVOKE.View_IsLayoutingRequired(View.getCPtr(this)); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return result; - } - set - { - Tizen.NUI.NDalicManualPINVOKE.View_SetLayoutingRequired(View.getCPtr(this), value); - } + //to fix memory leak issue, match the handle count with native side. + IntPtr cPtr = NDalicPINVOKE.Actor_GetRendererAt(swigCPtr, index); + HandleRef CPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); + Renderer ret = Registry.GetManagedBaseHandleFromNativePtr(CPtr.Handle) as Renderer; + NDalicPINVOKE.delete_BaseHandle(CPtr); + CPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); + + if (NDalicPINVOKE.SWIGPendingException.Pending) + throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; } - /// - /// Shows the view. - /// - /// - /// This is an asynchronous method. - /// /// 3 - public void Show() + public void RemoveRenderer(Renderer renderer) { - SetVisible(true); + NDalicPINVOKE.Actor_RemoveRenderer__SWIG_0(swigCPtr, Renderer.getCPtr(renderer)); + if (NDalicPINVOKE.SWIGPendingException.Pending) + throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } - /// - /// Hides the view. - /// - /// - /// This is an asynchronous method. - /// If the view is hidden, then the view and its children will not be rendered. - /// This is regardless of the individual visibility of the children, i.e., the view will only be rendered if all of its parents are shown. - /// /// 3 - public void Hide() + public void RemoveRenderer(uint index) { - SetVisible(false); + NDalicPINVOKE.Actor_RemoveRenderer__SWIG_1(swigCPtr, index); + if (NDalicPINVOKE.SWIGPendingException.Pending) + throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } internal void Raise() @@ -3546,7 +4245,6 @@ namespace Tizen.NUI.BaseComponents throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } } - } internal void Lower() @@ -3572,66 +4270,6 @@ namespace Tizen.NUI.BaseComponents } /// - /// Raises the view above all other views. - /// - /// - /// Sibling order of views within the parent will be updated automatically. - /// Once a raise or lower API is used, that view will then have an exclusive sibling order independent of insertion. - /// - /// 3 - public void RaiseToTop() - { - var parentChildren = GetParent()?.Children; - - if (parentChildren != null) - { - parentChildren.Remove(this); - parentChildren.Add(this); - - NDalicPINVOKE.RaiseToTop(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) - throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - } - - /// - /// Lowers the view to the bottom of all views. - /// - /// - /// The sibling order of views within the parent will be updated automatically. - /// Once a raise or lower API is used that view will then have an exclusive sibling order independent of insertion. - /// - /// 3 - public void LowerToBottom() - { - var parentChildren = GetParent()?.Children; - - if (parentChildren != null) - { - parentChildren.Remove(this); - parentChildren.Insert(0, this); - - NDalicPINVOKE.LowerToBottom(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) - throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - } - - /// - /// Queries if all resources required by a view are loaded and ready. - /// - /// Most resources are only loaded when the control is placed on the stage. - /// - /// 3 - public bool IsResourceReady() - { - bool ret = NDalicPINVOKE.IsResourceReady(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - /// /// Raises the view to above the target view. /// /// The sibling order of views within the parent will be updated automatically. @@ -3745,58 +4383,6 @@ namespace Tizen.NUI.BaseComponents return ret; } - /// - /// Gets the parent layer of this view.If a view has no parent, this method does not do anything. - /// - ///
The view has been initialized. 
- /// The parent layer of view - /// 5 - public Layer GetLayer() - { - //to fix memory leak issue, match the handle count with native side. - IntPtr cPtr = NDalicPINVOKE.Actor_GetLayer(swigCPtr); - HandleRef CPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); - Layer ret = Registry.GetManagedBaseHandleFromNativePtr(CPtr.Handle) as Layer; - NDalicPINVOKE.delete_BaseHandle(CPtr); - CPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); - - if (NDalicPINVOKE.SWIGPendingException.Pending) - throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - /// - /// Removes a view from its parent view or layer. If a view has no parent, this method does nothing. - /// - ///
The (child) view has been initialized. 
- /// 4 - public void Unparent() - { - GetParent()?.Remove(this); - } - - /// - /// Search through this view's hierarchy for a view with the given name. - /// The view itself is also considered in the search. - /// - ///
The view has been initialized.
- /// The name of the view to find. - /// A handle to the view if found, or an empty handle if not. - /// 3 - public View FindChildByName(string viewName) - { - //to fix memory leak issue, match the handle count with native side. - IntPtr cPtr = NDalicPINVOKE.Actor_FindChildByName(swigCPtr, viewName); - HandleRef CPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); - View ret = Registry.GetManagedBaseHandleFromNativePtr(CPtr.Handle) as View; - NDalicPINVOKE.delete_BaseHandle(CPtr); - CPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); - - if (NDalicPINVOKE.SWIGPendingException.Pending) - throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - internal View FindChildById(uint id) { //to fix memory leak issue, match the handle count with native side. @@ -4197,25 +4783,6 @@ namespace Tizen.NUI.BaseComponents return ret; } - /// - /// Converts screen coordinates into the view's coordinate system using the default camera. - /// - ///
The view has been initialized.
- /// The view coordinates are relative to the top-left(0.0, 0.0, 0.5). - /// On return, the X-coordinate relative to the view. - /// On return, the Y-coordinate relative to the view. - /// The screen X-coordinate. - /// The screen Y-coordinate. - /// True if the conversion succeeded. - /// 3 - public bool ScreenToLocal(out float localX, out float localY, float screenX, float screenY) - { - bool ret = NDalicPINVOKE.Actor_ScreenToLocal(swigCPtr, out localX, out localY, screenX, screenY); - if (NDalicPINVOKE.SWIGPendingException.Pending) - throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - internal void SetKeyboardFocusable(bool focusable) { NDalicPINVOKE.Actor_SetKeyboardFocusable(swigCPtr, focusable); @@ -4242,102 +4809,16 @@ namespace Tizen.NUI.BaseComponents { ResizePolicyType ret = (ResizePolicyType)NDalicPINVOKE.Actor_GetResizePolicy(swigCPtr, (int)dimension); if (NDalicPINVOKE.SWIGPendingException.Pending) - throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - /// - /// Sets the relative to parent size factor of the view.
- /// This factor is only used when ResizePolicy is set to either: - /// ResizePolicy::SIZE_RELATIVE_TO_PARENT or ResizePolicy::SIZE_FIXED_OFFSET_FROM_PARENT.
- /// This view's size is set to the view's size multiplied by or added to this factor, depending on ResizePolicy.
- ///
- ///
The view has been initialized.
- /// A Vector3 representing the relative factor to be applied to each axis. - /// 3 - public void SetSizeModeFactor(Vector3 factor) - { - NDalicPINVOKE.Actor_SetSizeModeFactor(swigCPtr, Vector3.getCPtr(factor)); - if (NDalicPINVOKE.SWIGPendingException.Pending) - throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - internal Vector3 GetSizeModeFactor() - { - Vector3 ret = new Vector3(NDalicPINVOKE.Actor_GetSizeModeFactor(swigCPtr), true); - if (NDalicPINVOKE.SWIGPendingException.Pending) - throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - /// - /// Calculates the height of the view given a width.
- /// The natural size is used for default calculation.
- /// Size 0 is treated as aspect ratio 1:1.
- ///
- /// The width to use. - /// The height based on the width. - /// 3 - public float GetHeightForWidth(float width) - { - float ret = NDalicPINVOKE.Actor_GetHeightForWidth(swigCPtr, width); - if (NDalicPINVOKE.SWIGPendingException.Pending) - throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - /// - /// Calculates the width of the view given a height.
- /// The natural size is used for default calculation.
- /// Size 0 is treated as aspect ratio 1:1.
- ///
- /// The height to use. - /// The width based on the height. - /// 3 - public float GetWidthForHeight(float height) - { - float ret = NDalicPINVOKE.Actor_GetWidthForHeight(swigCPtr, height); - if (NDalicPINVOKE.SWIGPendingException.Pending) - throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - /// - /// Return the amount of size allocated for relayout. - /// - /// The dimension to retrieve. - /// Return the size. - /// 3 - public float GetRelayoutSize(DimensionType dimension) - { - float ret = NDalicPINVOKE.Actor_GetRelayoutSize(swigCPtr, (int)dimension); - if (NDalicPINVOKE.SWIGPendingException.Pending) - throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - /// - /// Set the padding for the view. - /// - /// Padding for the view. - /// 3 - public void SetPadding(PaddingType padding) - { - NDalicPINVOKE.Actor_SetPadding(swigCPtr, PaddingType.getCPtr(padding)); - if (NDalicPINVOKE.SWIGPendingException.Pending) - throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - /// - /// Return the value of padding for the view. - /// - /// the value of padding for the view - /// 3 - public void GetPadding(PaddingType paddingOut) + throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + internal Vector3 GetSizeModeFactor() { - NDalicPINVOKE.Actor_GetPadding(swigCPtr, PaddingType.getCPtr(paddingOut)); + Vector3 ret = new Vector3(NDalicPINVOKE.Actor_GetSizeModeFactor(swigCPtr), true); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; } internal void SetMinimumSize(Vector2 size) @@ -4378,15 +4859,6 @@ namespace Tizen.NUI.BaseComponents return ret; } - /// 3 - public uint AddRenderer(Renderer renderer) - { - uint ret = NDalicPINVOKE.Actor_AddRenderer(swigCPtr, Renderer.getCPtr(renderer)); - if (NDalicPINVOKE.SWIGPendingException.Pending) - throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - internal uint GetRendererCount() { uint ret = NDalicPINVOKE.Actor_GetRendererCount(swigCPtr); @@ -4395,37 +4867,6 @@ namespace Tizen.NUI.BaseComponents return ret; } - /// 3 - public Renderer GetRendererAt(uint index) - { - //to fix memory leak issue, match the handle count with native side. - IntPtr cPtr = NDalicPINVOKE.Actor_GetRendererAt(swigCPtr, index); - HandleRef CPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); - Renderer ret = Registry.GetManagedBaseHandleFromNativePtr(CPtr.Handle) as Renderer; - NDalicPINVOKE.delete_BaseHandle(CPtr); - CPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); - - if (NDalicPINVOKE.SWIGPendingException.Pending) - throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - /// 3 - public void RemoveRenderer(Renderer renderer) - { - NDalicPINVOKE.Actor_RemoveRenderer__SWIG_0(swigCPtr, Renderer.getCPtr(renderer)); - if (NDalicPINVOKE.SWIGPendingException.Pending) - throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - /// 3 - public void RemoveRenderer(uint index) - { - NDalicPINVOKE.Actor_RemoveRenderer__SWIG_1(swigCPtr, index); - if (NDalicPINVOKE.SWIGPendingException.Pending) - throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - internal TouchDataSignal TouchSignal() { TouchDataSignal ret = new TouchDataSignal(NDalicPINVOKE.Actor_TouchSignal(swigCPtr), false); @@ -4470,1176 +4911,722 @@ namespace Tizen.NUI.BaseComponents { ViewSignal ret = new ViewSignal(NDalicPINVOKE.Actor_OnRelayoutSignal(swigCPtr), false); if (NDalicPINVOKE.SWIGPendingException.Pending) - throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - internal ViewVisibilityChangedSignal VisibilityChangedSignal(View view) - { - ViewVisibilityChangedSignal ret = new ViewVisibilityChangedSignal(NDalicPINVOKE.VisibilityChangedSignal(View.getCPtr(view)), false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - - internal ViewLayoutDirectionChangedSignal LayoutDirectionChangedSignal(View view) - { - ViewLayoutDirectionChangedSignal ret = new ViewLayoutDirectionChangedSignal(NDalicManualPINVOKE.LayoutDirectionChangedSignal(View.getCPtr(view)), false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - - internal ViewSignal ResourcesLoadedSignal() - { - ViewSignal ret = new ViewSignal(NDalicPINVOKE.ResourceReadySignal(swigCPtr), false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - /// - /// Gets or sets the origin of a view within its parent's area.
- /// This is expressed in unit coordinates, such that (0.0, 0.0, 0.5) is the top-left corner of the parent, and (1.0, 1.0, 0.5) is the bottom-right corner.
- /// The default parent-origin is ParentOrigin.TopLeft (0.0, 0.0, 0.5).
- /// A view's position is the distance between this origin and the view's anchor-point.
- ///
- ///
The view has been initialized.
- /// 3 - public Position ParentOrigin - { - get - { - return (Position)GetValue(ParentOriginProperty); - } - set - { - SetValue(ParentOriginProperty, value); - NotifyPropertyChanged(); - } - } - - internal float ParentOriginX - { - get - { - float temp = 0.0f; - GetProperty(View.Property.PARENT_ORIGIN_X).Get(out temp); - return temp; - } - set - { - SetProperty(View.Property.PARENT_ORIGIN_X, new Tizen.NUI.PropertyValue(value)); - NotifyPropertyChanged(); - } - } - - internal float ParentOriginY - { - get - { - float temp = 0.0f; - GetProperty(View.Property.PARENT_ORIGIN_Y).Get(out temp); - return temp; - } - set - { - SetProperty(View.Property.PARENT_ORIGIN_Y, new Tizen.NUI.PropertyValue(value)); - NotifyPropertyChanged(); - } - } - - internal float ParentOriginZ - { - get - { - float temp = 0.0f; - GetProperty(View.Property.PARENT_ORIGIN_Z).Get(out temp); - return temp; - } - set - { - SetProperty(View.Property.PARENT_ORIGIN_Z, new Tizen.NUI.PropertyValue(value)); - NotifyPropertyChanged(); - } - } - - /// - /// Gets or sets the anchor-point of a view.
- /// This is expressed in unit coordinates, such that (0.0, 0.0, 0.5) is the top-left corner of the view, and (1.0, 1.0, 0.5) is the bottom-right corner.
- /// The default pivot point is PivotPoint.Center (0.5, 0.5, 0.5).
- /// A view position is the distance between its parent-origin and this anchor-point.
- /// A view's orientation is the rotation from its default orientation, the rotation is centered around its anchor-point.
- ///
The view has been initialized.
- ///
- /// 3 - public Position PivotPoint - { - get - { - return (Position)GetValue(PivotPointProperty); - } - set - { - SetValue(PivotPointProperty, value); - NotifyPropertyChanged(); - } - } - - internal float PivotPointX - { - get - { - float temp = 0.0f; - GetProperty(View.Property.ANCHOR_POINT_X).Get(out temp); - return temp; - } - set - { - SetProperty(View.Property.ANCHOR_POINT_X, new Tizen.NUI.PropertyValue(value)); - } - } - - internal float PivotPointY - { - get - { - float temp = 0.0f; - GetProperty(View.Property.ANCHOR_POINT_Y).Get(out temp); - return temp; - } - set - { - SetProperty(View.Property.ANCHOR_POINT_Y, new Tizen.NUI.PropertyValue(value)); - } - } - - internal float PivotPointZ - { - get - { - float temp = 0.0f; - GetProperty(View.Property.ANCHOR_POINT_Z).Get(out temp); - return temp; - } - set - { - SetProperty(View.Property.ANCHOR_POINT_Z, new Tizen.NUI.PropertyValue(value)); - } - } - - /// - /// Gets or sets the size width of the view. - /// - /// 3 - public float SizeWidth - { - get - { - return (float)GetValue(SizeWidthProperty); - } - set - { - SetValue(SizeWidthProperty, value); - NotifyPropertyChanged(); - } - } - - /// - /// Gets or sets the size height of the view. - /// - /// 3 - public float SizeHeight - { - get - { - return (float)GetValue(SizeHeightProperty); - } - set - { - SetValue(SizeHeightProperty, value); - NotifyPropertyChanged(); - } - } - - /// - /// Gets or sets the position of the view.
- /// By default, sets the position vector between the parent origin and pivot point (default).
- /// If the position inheritance is disabled, sets the world position.
- ///
- /// 3 - public Position Position - { - get - { - return (Position)GetValue(PositionProperty); - } - set - { - SetValue(PositionProperty, value); - NotifyPropertyChanged(); - } + throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; } - /// - /// Gets or sets the position X of the view. - /// - /// 3 - public float PositionX + internal ViewVisibilityChangedSignal VisibilityChangedSignal(View view) { - get - { - return (float)GetValue(PositionXProperty); - } - set - { - SetValue(PositionXProperty, value); - NotifyPropertyChanged(); - } + ViewVisibilityChangedSignal ret = new ViewVisibilityChangedSignal(NDalicPINVOKE.VisibilityChangedSignal(View.getCPtr(view)), false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; } - /// - /// Gets or sets the position Y of the view. - /// - /// 3 - public float PositionY + internal ViewLayoutDirectionChangedSignal LayoutDirectionChangedSignal(View view) { - get - { - return (float)GetValue(PositionYProperty); - } - set - { - SetValue(PositionYProperty, value); - NotifyPropertyChanged(); - } + ViewLayoutDirectionChangedSignal ret = new ViewLayoutDirectionChangedSignal(NDalicManualPINVOKE.LayoutDirectionChangedSignal(View.getCPtr(view)), false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; } - /// - /// Gets or sets the position Z of the view. - /// - /// 3 - public float PositionZ + internal ViewSignal ResourcesLoadedSignal() { - get - { - return (float)GetValue(PositionZProperty); - } - set - { - SetValue(PositionZProperty, value); - NotifyPropertyChanged(); - } + ViewSignal ret = new ViewSignal(NDalicPINVOKE.ResourceReadySignal(swigCPtr), false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; } - /// - /// Gets or sets the world position of the view. - /// - /// 3 - public Vector3 WorldPosition + internal static global::System.Runtime.InteropServices.HandleRef getCPtr(View obj) { - get - { - Vector3 temp = new Vector3(0.0f, 0.0f, 0.0f); - GetProperty(View.Property.WORLD_POSITION).Get(temp); - return temp; - } + return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; } - internal float WorldPositionX + internal bool IsTopLevelView() { - get + if (GetParent() is Layer) { - float temp = 0.0f; - GetProperty(View.Property.WORLD_POSITION_X).Get(out temp); - return temp; + return true; } + return false; } - internal float WorldPositionY + internal void SetKeyInputFocus() { - get - { - float temp = 0.0f; - GetProperty(View.Property.WORLD_POSITION_Y).Get(out temp); - return temp; - } + NDalicPINVOKE.View_SetKeyInputFocus(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } - internal float WorldPositionZ + internal void ClearKeyInputFocus() { - get - { - float temp = 0.0f; - GetProperty(View.Property.WORLD_POSITION_Z).Get(out temp); - return temp; - } + NDalicPINVOKE.View_ClearKeyInputFocus(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } - /// - /// Gets or sets the orientation of the view.
- /// The view's orientation is the rotation from its default orientation, and the rotation is centered around its anchor-point.
- ///
- /// This is an asynchronous method. - /// 3 - public Rotation Orientation + internal PinchGestureDetector GetPinchGestureDetector() { - get - { - return (Rotation)GetValue(OrientationProperty); - } - set - { - SetValue(OrientationProperty, value); - NotifyPropertyChanged(); - } + PinchGestureDetector ret = new PinchGestureDetector(NDalicPINVOKE.View_GetPinchGestureDetector(swigCPtr), true); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; } - /// - /// Gets or sets the world orientation of the view.
- ///
- /// 3 - public Rotation WorldOrientation + internal PanGestureDetector GetPanGestureDetector() { - get - { - Rotation temp = new Rotation(); - GetProperty(View.Property.WORLD_ORIENTATION).Get(temp); - return temp; - } + PanGestureDetector ret = new PanGestureDetector(NDalicPINVOKE.View_GetPanGestureDetector(swigCPtr), true); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; } - /// - /// Gets or sets the scale factor applied to the view.
- ///
- /// 3 - public Vector3 Scale + internal TapGestureDetector GetTapGestureDetector() { - get - { - return (Vector3)GetValue(ScaleProperty); - } - set - { - SetValue(ScaleProperty, value); - NotifyPropertyChanged(); - } + TapGestureDetector ret = new TapGestureDetector(NDalicPINVOKE.View_GetTapGestureDetector(swigCPtr), true); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; } - /// - /// Gets or sets the scale X factor applied to the view. - /// - /// 3 - public float ScaleX + internal LongPressGestureDetector GetLongPressGestureDetector() { - get - { - return (float)GetValue(ScaleXProperty); - } - set - { - SetValue(ScaleXProperty, value); - NotifyPropertyChanged(); - } + LongPressGestureDetector ret = new LongPressGestureDetector(NDalicPINVOKE.View_GetLongPressGestureDetector(swigCPtr), true); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; } - /// - /// Gets or sets the scale Y factor applied to the view. - /// - /// 3 - public float ScaleY + internal void SetBackgroundColor(Vector4 color) { - get - { - return (float)GetValue(ScaleYProperty); - } - set - { - SetValue(ScaleYProperty, value); - NotifyPropertyChanged(); - } + NDalicPINVOKE.View_SetBackgroundColor(swigCPtr, Vector4.getCPtr(color)); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } - /// - /// Gets or sets the scale Z factor applied to the view. - /// - /// 3 - public float ScaleZ + internal Vector4 GetBackgroundColor() { - get - { - return (float)GetValue(ScaleZProperty); - } - set - { - SetValue(ScaleZProperty, value); - NotifyPropertyChanged(); - } + Vector4 ret = new Vector4(NDalicPINVOKE.View_GetBackgroundColor(swigCPtr), true); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; } - /// - /// Gets the world scale of the view. - /// - /// 3 - public Vector3 WorldScale + internal void SetBackgroundImage(Image image) { - get - { - Vector3 temp = new Vector3(0.0f, 0.0f, 0.0f); - GetProperty(View.Property.WORLD_SCALE).Get(temp); - return temp; - } + NDalicPINVOKE.View_SetBackgroundImage(swigCPtr, Image.getCPtr(image)); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } - /// - /// Retrieves the visibility flag of the view. - /// - /// - /// If the view is not visible, then the view and its children will not be rendered. - /// This is regardless of the individual visibility values of the children, i.e., the view will only be rendered if all of its parents have visibility set to true. - /// - /// 3 - public bool Visibility + internal ControlKeySignal KeyEventSignal() { - get - { - bool temp = false; - GetProperty(View.Property.VISIBLE).Get(out temp); - return temp; - } + ControlKeySignal ret = new ControlKeySignal(NDalicPINVOKE.View_KeyEventSignal(swigCPtr), false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; } - /// - /// Gets the view's world color. - /// - /// 3 - public Vector4 WorldColor + internal KeyInputFocusSignal KeyInputFocusGainedSignal() { - get - { - Vector4 temp = new Vector4(0.0f, 0.0f, 0.0f, 0.0f); - GetProperty(View.Property.WORLD_COLOR).Get(temp); - return temp; - } + KeyInputFocusSignal ret = new KeyInputFocusSignal(NDalicPINVOKE.View_KeyInputFocusGainedSignal(swigCPtr), false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + internal KeyInputFocusSignal KeyInputFocusLostSignal() + { + KeyInputFocusSignal ret = new KeyInputFocusSignal(NDalicPINVOKE.View_KeyInputFocusLostSignal(swigCPtr), false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; } - internal Matrix WorldMatrix + internal IntPtr GetPtrfromView() { - get - { - Matrix temp = new Matrix(); - GetProperty(View.Property.WORLD_MATRIX).Get(temp); - return temp; - } + return (IntPtr)swigCPtr; } - /// - /// Gets or sets the view's name. - /// - /// 3 - public string Name + internal void SetLayout(LayoutItem layout) { - get - { - return (string)GetValue(NameProperty); - } - set + Tizen.NUI.NDalicManualPINVOKE.SetLayout__SWIG_1(View.getCPtr(this), LayoutItem.getCPtr(layout)); + layout.LayoutChildren.Clear(); + foreach (View view in Children) { - SetValue(NameProperty, value); - NotifyPropertyChanged(); + layout.LayoutChildren.Add(view.Layout); } } - /// - /// Get the number of children held by the view. - /// - /// 3 - public new uint ChildCount + internal ResourceLoadingStatusType GetBackgroundResourceStatus() { - get - { - return GetChildCount(); - } + return (ResourceLoadingStatusType)NDalicManualPINVOKE.View_GetVisualResourceStatus(this.swigCPtr, Property.BACKGROUND); } /// - /// Gets the view's ID. - /// Readonly + /// you can override it to clean-up your own resources. /// + /// DisposeTypes /// 3 - public uint ID + protected override void Dispose(DisposeTypes type) { - get + if (disposed) { - return GetId(); + return; } - } - /// - /// Gets or sets the status of whether the view should emit touch or hover signals. - /// - /// 3 - public bool Sensitive - { - get + if (type == DisposeTypes.Explicit) { - return (bool)GetValue(SensitiveProperty); + //Called by User + //Release your own managed resources here. + //You should release all of your own disposable objects here. } - set + + //Release your own unmanaged resources here. + //You should not access any managed member here except static instance. + //because the execution order of Finalizes is non-deterministic. + if (this != null) { - SetValue(SensitiveProperty, value); - NotifyPropertyChanged(); + DisConnectFromSignals(); } - } - /// - /// Gets or sets the status of whether the view should receive a notification when touch or hover motion events leave the boundary of the view. - /// - /// 3 - public bool LeaveRequired - { - get + if (swigCPtr.Handle != global::System.IntPtr.Zero) { - return (bool)GetValue(LeaveRequiredProperty); + if (swigCMemOwn) + { + swigCMemOwn = false; + NDalicPINVOKE.delete_View(swigCPtr); + } + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); } - set + + foreach (View view in Children) { - SetValue(LeaveRequiredProperty, value); - NotifyPropertyChanged(); + view.InternalParent = null; } + + base.Dispose(type); + } - /// - /// Gets or sets the status of whether a child view inherits it's parent's orientation. - /// - /// 3 - public bool InheritOrientation + private void OnSize2DChanged(int width, int height) { - get - { - return (bool)GetValue(InheritOrientationProperty); - } - set - { - SetValue(InheritOrientationProperty, value); - NotifyPropertyChanged(); - } + Size2D = new Size2D(width, height); } - /// - /// Gets or sets the status of whether a child view inherits it's parent's scale. - /// - /// 3 - public bool InheritScale + private void OnPosition2DChanged(int x, int y) { - get + Position2D = new Position2D(x, y); + } + + private void DisConnectFromSignals() + { + // Save current CPtr. + global::System.Runtime.InteropServices.HandleRef currentCPtr = swigCPtr; + + // Use BaseHandle CPtr as current might have been deleted already in derived classes. + swigCPtr = GetBaseHandleCPtrHandleRef; + + if (_onRelayoutEventCallback != null) { - return (bool)GetValue(InheritScaleProperty); + this.OnRelayoutSignal().Disconnect(_onRelayoutEventCallback); } - set + + if (_offWindowEventCallback != null) { - SetValue(InheritScaleProperty, value); - NotifyPropertyChanged(); + this.OffWindowSignal().Disconnect(_offWindowEventCallback); } - } - /// - /// Gets or sets the status of how the view and its children should be drawn.
- /// Not all views are renderable, but DrawMode can be inherited from any view.
- /// If an object is in a 3D layer, it will be depth-tested against other objects in the world, i.e., it may be obscured if other objects are in front.
- /// If DrawMode.Overlay2D is used, the view and its children will be drawn as a 2D overlay.
- /// Overlay views are drawn in a separate pass, after all non-overlay views within the layer.
- /// For overlay views, the drawing order is with respect to tree levels of views, and depth-testing will not be used.
- ///
- /// 3 - public DrawModeType DrawMode - { - get + if (_onWindowEventCallback != null) { - return (DrawModeType)GetValue(DrawModeProperty); + this.OnWindowSignal().Disconnect(_onWindowEventCallback); } - set + + if (_wheelEventCallback != null) { - SetValue(DrawModeProperty, value); - NotifyPropertyChanged(); + this.WheelEventSignal().Disconnect(_wheelEventCallback); } - } - /// - /// Gets or sets the relative to parent size factor of the view.
- /// This factor is only used when ResizePolicyType is set to either: ResizePolicyType.SizeRelativeToParent or ResizePolicyType.SizeFixedOffsetFromParent.
- /// This view's size is set to the view's size multiplied by or added to this factor, depending on ResizePolicyType.
- ///
- /// 3 - public Vector3 SizeModeFactor - { - get + if (_hoverEventCallback != null) { - return (Vector3)GetValue(SizeModeFactorProperty); + this.HoveredSignal().Disconnect(_hoverEventCallback); } - set + + if (_touchDataCallback != null) { - SetValue(SizeModeFactorProperty, value); - NotifyPropertyChanged(); + this.TouchSignal().Disconnect(_touchDataCallback); } - } - /// - /// Gets or sets the width resize policy to be used. - /// - /// 3 - public ResizePolicyType WidthResizePolicy - { - get + if (_ResourcesLoadedCallback != null) { - return (ResizePolicyType)GetValue(WidthResizePolicyProperty); + this.ResourcesLoadedSignal().Disconnect(_ResourcesLoadedCallback); } - set + + if (_offWindowEventCallback != null) { - SetValue(WidthResizePolicyProperty, value); - // Match ResizePolicy to new Layouting. - // Parent relative policies can not be mapped at this point as parent size unknown. - switch( value ) - { - case ResizePolicyType.UseNaturalSize : - { - SetProperty(LayoutItemWrapper.ChildProperty.WIDTH_SPECIFICATION, new Tizen.NUI.PropertyValue( NaturalSize.Width) ); - break; - } - case ResizePolicyType.FillToParent : - { - SetProperty(LayoutItemWrapper.ChildProperty.WIDTH_SPECIFICATION, new Tizen.NUI.PropertyValue( (int)ChildLayoutData.MatchParent ) ); - break; - } - case ResizePolicyType.FitToChildren : - { - SetProperty(LayoutItemWrapper.ChildProperty.WIDTH_SPECIFICATION, new Tizen.NUI.PropertyValue( (int)ChildLayoutData.WrapContent ) ); - break; - } - default: - break; - } - NotifyPropertyChanged(); + this.OffWindowSignal().Disconnect(_offWindowEventCallback); } - } - /// - /// Gets or sets the height resize policy to be used. - /// - /// 3 - public ResizePolicyType HeightResizePolicy - { - get + if (_onWindowEventCallback != null) { - return (ResizePolicyType)GetValue(HeightResizePolicyProperty); + this.OnWindowSignal().Disconnect(_onWindowEventCallback); } - set + + if (_wheelEventCallback != null) { - SetValue(HeightResizePolicyProperty, value); - // Match ResizePolicy to new Layouting. - // Parent relative policies can not be mapped at this point as parent size unknown. - switch( value ) - { - case ResizePolicyType.UseNaturalSize : - { - SetProperty(LayoutItemWrapper.ChildProperty.HEIGHT_SPECIFICATION, new Tizen.NUI.PropertyValue( NaturalSize.Height) ); - break; - } - case ResizePolicyType.FillToParent : - { - SetProperty(LayoutItemWrapper.ChildProperty.HEIGHT_SPECIFICATION, new Tizen.NUI.PropertyValue( (int)ChildLayoutData.MatchParent ) ); - break; - } - case ResizePolicyType.FitToChildren : - { - SetProperty(LayoutItemWrapper.ChildProperty.HEIGHT_SPECIFICATION, new Tizen.NUI.PropertyValue( (int)ChildLayoutData.WrapContent ) ); - break; - } - default: - break; - } - NotifyPropertyChanged(); + this.WheelEventSignal().Disconnect(_wheelEventCallback); } - } - /// - /// Gets or sets the policy to use when setting size with size negotiation.
- /// Defaults to SizeScalePolicyType.UseSizeSet.
- ///
- /// 3 - public SizeScalePolicyType SizeScalePolicy - { - get + if (_hoverEventCallback != null) { - return (SizeScalePolicyType)GetValue(SizeScalePolicyProperty); + this.HoveredSignal().Disconnect(_hoverEventCallback); } - set + + if (_touchDataCallback != null) { - SetValue(SizeScalePolicyProperty, value); - NotifyPropertyChanged(); + this.TouchSignal().Disconnect(_touchDataCallback); } - } - /// - /// Gets or sets the status of whether the width size is dependent on the height size. - /// - /// 3 - public bool WidthForHeight - { - get + if (_onRelayoutEventCallback != null) { - return (bool)GetValue(WidthForHeightProperty); + this.OnRelayoutSignal().Disconnect(_onRelayoutEventCallback); } - set + + if (_keyCallback != null) + { + this.KeyEventSignal().Disconnect(_keyCallback); + } + + if (_keyInputFocusLostCallback != null) { - SetValue(WidthForHeightProperty, value); - NotifyPropertyChanged(); + this.KeyInputFocusLostSignal().Disconnect(_keyInputFocusLostCallback); } - } - /// - /// Gets or sets the status of whether the height size is dependent on the width size. - /// - /// 3 - public bool HeightForWidth - { - get + if (_keyInputFocusGainedCallback != null) { - return (bool)GetValue(HeightForWidthProperty); + this.KeyInputFocusGainedSignal().Disconnect(_keyInputFocusGainedCallback); } - set + + if (_backgroundResourceLoadedCallback != null) { - SetValue(HeightForWidthProperty, value); - NotifyPropertyChanged(); + this.ResourcesLoadedSignal().Disconnect(_backgroundResourceLoadedCallback); } + + // BaseHandle CPtr is used in Registry and there is danger of deletion if we keep using it here. + // Restore current CPtr. + swigCPtr = currentCPtr; } - /// - /// Gets or sets the padding for use in layout. - /// - /// 5 - public Extents Padding + private void OnKeyInputFocusGained(IntPtr view) { - get + if (_keyInputFocusGainedEventHandler != null) { - return (Extents)GetValue(PaddingProperty); + _keyInputFocusGainedEventHandler(this, null); } - set + } + + private void OnKeyInputFocusLost(IntPtr view) + { + if (_keyInputFocusLostEventHandler != null) { - SetValue(PaddingProperty, value); - NotifyPropertyChanged(); + _keyInputFocusLostEventHandler(this, null); } } - /// - /// Gets or sets the minimum size the view can be assigned in size negotiation. - /// - /// 3 - public Size2D MinimumSize + private bool OnKeyEvent(IntPtr view, IntPtr keyEvent) { - get + if (keyEvent == global::System.IntPtr.Zero) { - return (Size2D)GetValue(MinimumSizeProperty); + NUILog.Error("keyEvent should not be null!"); + return true; } - set + + KeyEventArgs e = new KeyEventArgs(); + + bool result = false; + + e.Key = Tizen.NUI.Key.GetKeyFromPtr(keyEvent); + + if (_keyEventHandler != null) { - if (Layout != null) + Delegate[] delegateList = _keyEventHandler.GetInvocationList(); + + // Oring the result of each callback. + foreach (EventHandlerWithReturnType del in delegateList) { - // Note: it only works if minimum size is >= than natural size. - // To force the size it should be done through the width&height spec or Size2D. - Layout.MinimumWidth = new Tizen.NUI.LayoutLength(value.Width); - Layout.MinimumHeight = new Tizen.NUI.LayoutLength(value.Height); + result |= del(this, e); } - SetValue(MinimumSizeProperty, value); - NotifyPropertyChanged(); } + + return result; } - /// - /// Gets or sets the maximum size the view can be assigned in size negotiation. - /// - /// 3 - public Size2D MaximumSize + // Callback for View OnRelayout signal + private void OnRelayout(IntPtr data) { - get - { - return (Size2D)GetValue(MaximumSizeProperty); - } - set + if (_onRelayoutEventHandler != null) { - // We don't have Layout.Maximum(Width|Height) so we cannot apply it to layout. - // MATCH_PARENT spec + parent container size can be used to limit - SetValue(MaximumSizeProperty, value); - NotifyPropertyChanged(); + _onRelayoutEventHandler(this, null); } } - /// - /// Gets or sets whether a child view inherits it's parent's position.
- /// Default is to inherit.
- /// Switching this off means that using position sets the view's world position, i.e., translates from the world origin (0,0,0) to the pivot point of the view.
- ///
- /// 3 - public bool InheritPosition + // Callback for View TouchSignal + private bool OnTouch(IntPtr view, IntPtr touchData) { - get + if (touchData == global::System.IntPtr.Zero) { - return (bool)GetValue(InheritPositionProperty); + NUILog.Error("touchData should not be null!"); + return true; } - set + + TouchEventArgs e = new TouchEventArgs(); + + e.Touch = Tizen.NUI.Touch.GetTouchFromPtr(touchData); + + if (_touchDataEventHandler != null) { - SetValue(InheritPositionProperty, value); - NotifyPropertyChanged(); + return _touchDataEventHandler(this, e); } + return false; } - /// - /// Gets or sets the clipping behavior (mode) of it's children. - /// - /// 3 - public ClippingModeType ClippingMode + // Callback for View Hover signal + private bool OnHoverEvent(IntPtr view, IntPtr hoverEvent) { - get - { - return (ClippingModeType)GetValue(ClippingModeProperty); - } - set + if (hoverEvent == global::System.IntPtr.Zero) { - SetValue(ClippingModeProperty, value); - NotifyPropertyChanged(); + NUILog.Error("hoverEvent should not be null!"); + return true; } - } - /// - /// Gets the number of renderers held by the view. - /// - /// 3 - public uint RendererCount - { - get + HoverEventArgs e = new HoverEventArgs(); + + e.Hover = Tizen.NUI.Hover.GetHoverFromPtr(hoverEvent); + + if (_hoverEventHandler != null) { - return GetRendererCount(); + return _hoverEventHandler(this, e); } + return false; } - /// - /// [Obsolete("Please do not use! this will be deprecated")] - /// - /// 3 - /// Please do not use! this will be deprecated! - /// Instead please use PivotPoint. - [Obsolete("Please do not use! This will be deprecated! Please use PivotPoint instead! " + - "Like: " + - "View view = new View(); " + - "view.PivotPoint = PivotPoint.Center; " + - "view.PositionUsesPivotPoint = true;")] - [EditorBrowsable(EditorBrowsableState.Never)] - public Position AnchorPoint + // Callback for View Wheel signal + private bool OnWheelEvent(IntPtr view, IntPtr wheelEvent) { - get + if (wheelEvent == global::System.IntPtr.Zero) { - Position temp = new Position(0.0f, 0.0f, 0.0f); - GetProperty(View.Property.ANCHOR_POINT).Get(temp); - return temp; + NUILog.Error("wheelEvent should not be null!"); + return true; } - set + + WheelEventArgs e = new WheelEventArgs(); + + e.Wheel = Tizen.NUI.Wheel.GetWheelFromPtr(wheelEvent); + + if (_wheelEventHandler != null) { - SetProperty(View.Property.ANCHOR_POINT, new Tizen.NUI.PropertyValue(value)); - NotifyPropertyChanged(); + return _wheelEventHandler(this, e); } + return false; } - /// - /// Sets the size of a view for the width, the height and the depth.
- /// Geometry can be scaled to fit within this area.
- /// This does not interfere with the view's scale factor.
- /// The views default depth is the minimum of width and height.
- ///
- /// - /// Please note that multi-cascade setting is not possible for this NUI object.
- /// It is recommended that NUI object typed properties are configured by their constructor with parameters.
- /// For example, this code is working fine : view.Size = new Size( 1.0f, 1.0f, 0.0f);
- /// but this will not work! : view.Size.Width = 2.0f; view.Size.Height = 2.0f;
- /// It may not match the current value in some cases, i.e. when the animation is progressing or the maximum or minimu size is set.
- ///
- /// 5 - public Size Size + // Callback for View OnWindow signal + private void OnWindow(IntPtr data) { - get + if (_onWindowEventHandler != null) { - return (Size)GetValue(SizeProperty); + _onWindowEventHandler(this, null); } - set + } + + // Callback for View OffWindow signal + private void OffWindow(IntPtr data) + { + if (_offWindowEventHandler != null) { - SetValue(SizeProperty, value); - // Set Specification so when layouts measure this View it matches the value set here. - // All Views are currently Layouts. - SetProperty(LayoutItemWrapper.ChildProperty.WIDTH_SPECIFICATION, new Tizen.NUI.PropertyValue(value.Width)); - SetProperty(LayoutItemWrapper.ChildProperty.HEIGHT_SPECIFICATION, new Tizen.NUI.PropertyValue(value.Height)); - NotifyPropertyChanged(); + _offWindowEventHandler(this, null); } } - /// - /// "Please DO NOT use! This will be deprecated! Please use 'Container GetParent() for derived class' instead!" - /// - /// 3 - [Obsolete("Please do not use! This will be deprecated! Please use 'Container GetParent() for derived class' instead! " + - "Like: " + - "Container parent = view.GetParent(); " + - "View view = parent as View;")] - [EditorBrowsable(EditorBrowsableState.Never)] - public new View Parent + // Callback for View visibility change signal + private void OnVisibilityChanged(IntPtr data, bool visibility, VisibilityChangeType type) { - get + VisibilityChangedEventArgs e = new VisibilityChangedEventArgs(); + if (data != null) { - View ret; - IntPtr cPtr = NDalicPINVOKE.Actor_GetParent(swigCPtr); - HandleRef CPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); - BaseHandle basehandle = Registry.GetManagedBaseHandleFromNativePtr(CPtr.Handle); - - if (basehandle is Layer layer) - { - ret = new View(Layer.getCPtr(layer).Handle, false); - NUILog.Error("This Parent property is deprecated, shoud do not be used"); - } - else - { - ret = basehandle as View; - } - - NDalicPINVOKE.delete_BaseHandle(CPtr); - CPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); + e.View = Registry.GetManagedBaseHandleFromNativePtr(data) as View; + } + e.Visibility = visibility; + e.Type = type; - if (NDalicPINVOKE.SWIGPendingException.Pending) - throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; + if (_visibilityChangedEventHandler != null) + { + _visibilityChangedEventHandler(this, e); } } - /// - /// Gets/Sets whether inherit parent's the layout Direction. - /// - /// 4 - public bool InheritLayoutDirection + // Callback for View layout direction change signal + private void OnLayoutDirectionChanged(IntPtr data, ViewLayoutDirectionType type) { - get + LayoutDirectionChangedEventArgs e = new LayoutDirectionChangedEventArgs(); + if (data != null) { - return (bool)GetValue(InheritLayoutDirectionProperty); + e.View = Registry.GetManagedBaseHandleFromNativePtr(data) as View; } - set + e.Type = type; + + if (_layoutDirectionChangedEventHandler != null) { - SetValue(InheritLayoutDirectionProperty, value); - NotifyPropertyChanged(); + _layoutDirectionChangedEventHandler(this, e); } } - /// - /// Gets/Sets the layout Direction. - /// - /// 4 - public ViewLayoutDirectionType LayoutDirection + private void OnResourcesLoaded(IntPtr view) { - get - { - return (ViewLayoutDirectionType)GetValue(LayoutDirectionProperty); - } - set + if (_resourcesLoadedEventHandler != null) { - SetValue(LayoutDirectionProperty, value); - NotifyPropertyChanged(); + _resourcesLoadedEventHandler(this, null); } } - /// - /// Gets or sets the Margin for use in layout. - /// - /// - /// Margin property is supported by Layout algorithms and containers. - /// Please Set Layout if you want to use Margin property. - /// - /// 4 - public Extents Margin + private View ConvertIdToView(uint id) { - get + View view = null; + if (GetParent() is View) { - return (Extents)GetValue(MarginProperty); + View parentView = GetParent() as View; + view = parentView.FindChildById(id); } - set + + if (!view) { - SetValue(MarginProperty, value); - NotifyPropertyChanged(); + view = Window.Instance.GetRootLayer().FindChildById(id); } + + return view; } - internal Style Style + private void OnBackgroundResourceLoaded(IntPtr view) { - get - { - return (Style)GetValue(StyleProperty); - } - set + BackgroundResourceLoadedEventArgs e = new BackgroundResourceLoadedEventArgs(); + e.Status = (ResourceLoadingStatusType)NDalicManualPINVOKE.View_GetVisualResourceStatus(this.swigCPtr, Property.BACKGROUND); + + if (_backgroundResourceLoadedEventHandler != null) { - SetValue(StyleProperty, value); + _backgroundResourceLoadedEventHandler(this, e); } } /// - /// [Obsolete("Please do not use! this will be deprecated")] + /// Event argument passed through the ChildAdded event. /// - /// Please do not use! this will be deprecated! - /// Instead please use Padding. - /// 4 - [Obsolete("Please do not use! this will be deprecated, instead please use Padding.")] - [EditorBrowsable(EditorBrowsableState.Never)] - public Extents PaddingEX + /// 5 + public class ChildAddedEventArgs : EventArgs { - get - { - Extents temp = new Extents(0, 0, 0, 0); - GetProperty(View.Property.PADDING).Get(temp); - return temp; - } - set - { - SetProperty(View.Property.PADDING, new Tizen.NUI.PropertyValue(value)); - NotifyPropertyChanged(); - } + /// + /// Added child view at moment. + /// + /// 5 + public View Added { get; set; } } /// - /// Perform an action on a visual registered to this view.
- /// Visuals will have actions. This API is used to perform one of these actions with the given attributes. + /// Event argument passed through the ChildRemoved event. ///
- /// The Property index of the visual. - /// The action to perform. See Visual to find the supported actions. - /// Optional attributes for the action. /// 5 - public void DoAction(int propertyIndexOfVisual, int propertyIndexOfActionId, PropertyValue attributes) + public class ChildRemovedEventArgs : EventArgs { - NDalicManualPINVOKE.View_DoAction(swigCPtr, propertyIndexOfVisual, propertyIndexOfActionId, PropertyValue.getCPtr(attributes)); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + /// + /// Removed child view at moment. + /// + /// 5 + public View Removed { get; set; } } - internal readonly MergedStyle _mergedStyle; + /// + /// Event arguments that passed via the KeyEvent signal. + /// + /// 3 + public class KeyEventArgs : EventArgs + { + private Key _key; + + /// + /// Key - is the key sent to the view. + /// + /// 3 + public Key Key + { + get + { + return _key; + } + set + { + _key = value; + } + } + } /// - /// Child property to specify desired width + /// Event arguments that passed via the touch signal. /// - internal int LayoutWidthSpecificationFixed + /// 3 + public class TouchEventArgs : EventArgs { - get + private Touch _touch; + + /// + /// Touch - contains the information of touch points. + /// + /// 3 + public Touch Touch { - int tmp = 0; - if (GetProperty(LayoutItemWrapper.ChildProperty.WIDTH_SPECIFICATION).Get(out tmp) == false) + get { - NUILog.Error("WidthSpecificationFixed get error!"); + return _touch; + } + set + { + _touch = value; } - return tmp; } - set + } + + /// + /// Event arguments that passed via the hover signal. + /// + /// 3 + public class HoverEventArgs : EventArgs + { + private Hover _hover; + + /// + /// Hover - contains touch points that represent the points that are currently being hovered or the points where a hover has stopped. + /// + /// 3 + public Hover Hover { - SetProperty(LayoutItemWrapper.ChildProperty.WIDTH_SPECIFICATION, new Tizen.NUI.PropertyValue(value)); + get + { + return _hover; + } + set + { + _hover = value; + } } } /// - /// Child property to specify desired height + /// Event arguments that passed via the wheel signal. /// - internal int LayoutHeightSpecificationFixed + /// 3 + public class WheelEventArgs : EventArgs { - get + private Wheel _wheel; + + /// + /// WheelEvent - store a wheel rolling type: MOUSE_WHEEL or CUSTOM_WHEEL. + /// + /// 3 + public Wheel Wheel { - int tmp = 0; - if (GetProperty(LayoutItemWrapper.ChildProperty.HEIGHT_SPECIFICATION).Get(out tmp) == false) + get + { + return _wheel; + } + set + { + _wheel = value; + } + } + } + + /// + /// Event arguments of visibility changed. + /// + /// 3 + public class VisibilityChangedEventArgs : EventArgs + { + private View _view; + private bool _visibility; + private VisibilityChangeType _type; + + /// + /// The view, or child of view, whose visibility has changed. + /// + /// 3 + public View View + { + get + { + return _view; + } + set + { + _view = value; + } + } + + /// + /// Whether the view is now visible or not. + /// + /// 3 + public bool Visibility + { + get + { + return _visibility; + } + set { - NUILog.Error("HeightSpecificationFixed get error!"); + _visibility = value; } - return tmp; - } - set - { - SetProperty(LayoutItemWrapper.ChildProperty.HEIGHT_SPECIFICATION, new Tizen.NUI.PropertyValue(value)); } - } - /// - /// Child property to specify desired width, use MatchParent/WrapContent) - /// - internal ChildLayoutData LayoutWidthSpecification - { - get + /// + /// Whether the view's visible property has changed or a parent's. + /// + /// 3 + public VisibilityChangeType Type { - int tmp = 0; - if (GetProperty(LayoutItemWrapper.ChildProperty.WIDTH_SPECIFICATION).Get(out tmp) == false) + get { - NUILog.Error("WidthSpecificationFixed get error!"); + return _type; + } + set + { + _type = value; } - return (ChildLayoutData)tmp; - } - set - { - SetProperty(LayoutItemWrapper.ChildProperty.WIDTH_SPECIFICATION, new Tizen.NUI.PropertyValue((int)value)); } } /// - /// Child property to specify desired height, use MatchParent/WrapContent) + /// Event arguments of layout direction changed. /// - internal ChildLayoutData LayoutHeightSpecification + /// 4 + public class LayoutDirectionChangedEventArgs : EventArgs { - get + private View _view; + private ViewLayoutDirectionType _type; + + /// + /// The view, or child of view, whose layout direction has changed. + /// + /// 4 + public View View { - int tmp = 0; - if (GetProperty(LayoutItemWrapper.ChildProperty.HEIGHT_SPECIFICATION).Get(out tmp) == false) + get { - NUILog.Error("HeightSpecificationFixed get error!"); + return _view; + } + set + { + _view = value; } - return (ChildLayoutData)tmp; - } - set - { - SetProperty(LayoutItemWrapper.ChildProperty.HEIGHT_SPECIFICATION, new Tizen.NUI.PropertyValue((int)value)); - } - } - - internal float Weight - { - get - { - return (float)GetValue(WeightProperty); - } - set - { - SetValue(WeightProperty, value); - NotifyPropertyChanged(); } - } - private bool _backgroundImageSynchronosLoading = false; - internal bool BackgroundImageSynchronosLoading - { - get - { - return _backgroundImageSynchronosLoading; - } - set + /// + /// Whether the view's layout direction property has changed or a parent's. + /// + /// 4 + public ViewLayoutDirectionType Type { - if (value != _backgroundImageSynchronosLoading) + get { - string bgUrl = ""; - PropertyMap bgMap = this.Background; - int visualType = 0; - bgMap.Find(Visual.Property.Type)?.Get(out visualType); - if (visualType == (int)Visual.Type.Image) - { - bgMap.Find(ImageVisualProperty.URL)?.Get(out bgUrl); - } - if (bgUrl.Length != 0) - { - _backgroundImageSynchronosLoading = value; - bgMap.Add("synchronousLoading", new PropertyValue(_backgroundImageSynchronosLoading)); - this.Background = bgMap; - } + return _type; + } + set + { + _type = value; } } } @@ -5660,89 +5647,71 @@ namespace Tizen.NUI.BaseComponents } } - private EventHandler _backgroundResourceLoadedEventHandler; - [UnmanagedFunctionPointer(CallingConvention.StdCall)] - private delegate void _backgroundResourceLoadedCallbackType(IntPtr view); - private _backgroundResourceLoadedCallbackType _backgroundResourceLoadedCallback; - - internal event EventHandler BackgroundResourceLoaded - { - add - { - if (_backgroundResourceLoadedEventHandler == null) - { - _backgroundResourceLoadedCallback = OnBackgroundResourceLoaded; - this.ResourcesLoadedSignal().Connect(_backgroundResourceLoadedCallback); - } - - _backgroundResourceLoadedEventHandler += value; - } - remove - { - _backgroundResourceLoadedEventHandler -= value; - - if (_backgroundResourceLoadedEventHandler == null && ResourcesLoadedSignal().Empty() == false) - { - this.ResourcesLoadedSignal().Disconnect(_backgroundResourceLoadedCallback); - } - } - } - - private void OnBackgroundResourceLoaded(IntPtr view) - { - BackgroundResourceLoadedEventArgs e = new BackgroundResourceLoadedEventArgs(); - e.Status = (ResourceLoadingStatusType)NDalicManualPINVOKE.View_GetVisualResourceStatus(this.swigCPtr, Property.BACKGROUND); - - if (_backgroundResourceLoadedEventHandler != null) - { - _backgroundResourceLoadedEventHandler(this, e); - } - } - - internal ResourceLoadingStatusType GetBackgroundResourceStatus() + internal class Property { - return (ResourceLoadingStatusType)NDalicManualPINVOKE.View_GetVisualResourceStatus(this.swigCPtr, Property.BACKGROUND); + internal static readonly int TOOLTIP = NDalicManualPINVOKE.View_Property_TOOLTIP_get(); + internal static readonly int STATE = NDalicManualPINVOKE.View_Property_STATE_get(); + internal static readonly int SUB_STATE = NDalicManualPINVOKE.View_Property_SUB_STATE_get(); + internal static readonly int LEFT_FOCUSABLE_VIEW_ID = NDalicManualPINVOKE.View_Property_LEFT_FOCUSABLE_ACTOR_ID_get(); + internal static readonly int RIGHT_FOCUSABLE_VIEW_ID = NDalicManualPINVOKE.View_Property_RIGHT_FOCUSABLE_ACTOR_ID_get(); + internal static readonly int UP_FOCUSABLE_VIEW_ID = NDalicManualPINVOKE.View_Property_UP_FOCUSABLE_ACTOR_ID_get(); + internal static readonly int DOWN_FOCUSABLE_VIEW_ID = NDalicManualPINVOKE.View_Property_DOWN_FOCUSABLE_ACTOR_ID_get(); + internal static readonly int STYLE_NAME = NDalicPINVOKE.View_Property_STYLE_NAME_get(); + internal static readonly int BACKGROUND = NDalicPINVOKE.View_Property_BACKGROUND_get(); + internal static readonly int SIBLING_ORDER = NDalicManualPINVOKE.Actor_Property_SIBLING_ORDER_get(); + internal static readonly int OPACITY = NDalicManualPINVOKE.Actor_Property_OPACITY_get(); + internal static readonly int SCREEN_POSITION = NDalicManualPINVOKE.Actor_Property_SCREEN_POSITION_get(); + internal static readonly int POSITION_USES_ANCHOR_POINT = NDalicManualPINVOKE.Actor_Property_POSITION_USES_ANCHOR_POINT_get(); + internal static readonly int PARENT_ORIGIN = NDalicPINVOKE.Actor_Property_PARENT_ORIGIN_get(); + internal static readonly int PARENT_ORIGIN_X = NDalicPINVOKE.Actor_Property_PARENT_ORIGIN_X_get(); + internal static readonly int PARENT_ORIGIN_Y = NDalicPINVOKE.Actor_Property_PARENT_ORIGIN_Y_get(); + internal static readonly int PARENT_ORIGIN_Z = NDalicPINVOKE.Actor_Property_PARENT_ORIGIN_Z_get(); + internal static readonly int ANCHOR_POINT = NDalicPINVOKE.Actor_Property_ANCHOR_POINT_get(); + internal static readonly int ANCHOR_POINT_X = NDalicPINVOKE.Actor_Property_ANCHOR_POINT_X_get(); + internal static readonly int ANCHOR_POINT_Y = NDalicPINVOKE.Actor_Property_ANCHOR_POINT_Y_get(); + internal static readonly int ANCHOR_POINT_Z = NDalicPINVOKE.Actor_Property_ANCHOR_POINT_Z_get(); + internal static readonly int SIZE = NDalicPINVOKE.Actor_Property_SIZE_get(); + internal static readonly int SIZE_WIDTH = NDalicPINVOKE.Actor_Property_SIZE_WIDTH_get(); + internal static readonly int SIZE_HEIGHT = NDalicPINVOKE.Actor_Property_SIZE_HEIGHT_get(); + internal static readonly int SIZE_DEPTH = NDalicPINVOKE.Actor_Property_SIZE_DEPTH_get(); + internal static readonly int POSITION = NDalicPINVOKE.Actor_Property_POSITION_get(); + internal static readonly int POSITION_X = NDalicPINVOKE.Actor_Property_POSITION_X_get(); + internal static readonly int POSITION_Y = NDalicPINVOKE.Actor_Property_POSITION_Y_get(); + internal static readonly int POSITION_Z = NDalicPINVOKE.Actor_Property_POSITION_Z_get(); + internal static readonly int WORLD_POSITION = NDalicPINVOKE.Actor_Property_WORLD_POSITION_get(); + internal static readonly int WORLD_POSITION_X = NDalicPINVOKE.Actor_Property_WORLD_POSITION_X_get(); + internal static readonly int WORLD_POSITION_Y = NDalicPINVOKE.Actor_Property_WORLD_POSITION_Y_get(); + internal static readonly int WORLD_POSITION_Z = NDalicPINVOKE.Actor_Property_WORLD_POSITION_Z_get(); + internal static readonly int ORIENTATION = NDalicPINVOKE.Actor_Property_ORIENTATION_get(); + internal static readonly int WORLD_ORIENTATION = NDalicPINVOKE.Actor_Property_WORLD_ORIENTATION_get(); + internal static readonly int SCALE = NDalicPINVOKE.Actor_Property_SCALE_get(); + internal static readonly int SCALE_X = NDalicPINVOKE.Actor_Property_SCALE_X_get(); + internal static readonly int SCALE_Y = NDalicPINVOKE.Actor_Property_SCALE_Y_get(); + internal static readonly int SCALE_Z = NDalicPINVOKE.Actor_Property_SCALE_Z_get(); + internal static readonly int WORLD_SCALE = NDalicPINVOKE.Actor_Property_WORLD_SCALE_get(); + internal static readonly int VISIBLE = NDalicPINVOKE.Actor_Property_VISIBLE_get(); + internal static readonly int WORLD_COLOR = NDalicPINVOKE.Actor_Property_WORLD_COLOR_get(); + internal static readonly int WORLD_MATRIX = NDalicPINVOKE.Actor_Property_WORLD_MATRIX_get(); + internal static readonly int NAME = NDalicPINVOKE.Actor_Property_NAME_get(); + internal static readonly int SENSITIVE = NDalicPINVOKE.Actor_Property_SENSITIVE_get(); + internal static readonly int LEAVE_REQUIRED = NDalicPINVOKE.Actor_Property_LEAVE_REQUIRED_get(); + internal static readonly int INHERIT_ORIENTATION = NDalicPINVOKE.Actor_Property_INHERIT_ORIENTATION_get(); + internal static readonly int INHERIT_SCALE = NDalicPINVOKE.Actor_Property_INHERIT_SCALE_get(); + internal static readonly int DRAW_MODE = NDalicPINVOKE.Actor_Property_DRAW_MODE_get(); + internal static readonly int SIZE_MODE_FACTOR = NDalicPINVOKE.Actor_Property_SIZE_MODE_FACTOR_get(); + internal static readonly int WIDTH_RESIZE_POLICY = NDalicPINVOKE.Actor_Property_WIDTH_RESIZE_POLICY_get(); + internal static readonly int HEIGHT_RESIZE_POLICY = NDalicPINVOKE.Actor_Property_HEIGHT_RESIZE_POLICY_get(); + internal static readonly int SIZE_SCALE_POLICY = NDalicPINVOKE.Actor_Property_SIZE_SCALE_POLICY_get(); + internal static readonly int WIDTH_FOR_HEIGHT = NDalicPINVOKE.Actor_Property_WIDTH_FOR_HEIGHT_get(); + internal static readonly int HEIGHT_FOR_WIDTH = NDalicPINVOKE.Actor_Property_HEIGHT_FOR_WIDTH_get(); + internal static readonly int MINIMUM_SIZE = NDalicPINVOKE.Actor_Property_MINIMUM_SIZE_get(); + internal static readonly int MAXIMUM_SIZE = NDalicPINVOKE.Actor_Property_MAXIMUM_SIZE_get(); + internal static readonly int INHERIT_POSITION = NDalicPINVOKE.Actor_Property_INHERIT_POSITION_get(); + internal static readonly int CLIPPING_MODE = NDalicPINVOKE.Actor_Property_CLIPPING_MODE_get(); + internal static readonly int INHERIT_LAYOUT_DIRECTION = NDalicManualPINVOKE.Actor_Property_INHERIT_LAYOUT_DIRECTION_get(); + internal static readonly int LAYOUT_DIRECTION = NDalicManualPINVOKE.Actor_Property_LAYOUT_DIRECTION_get(); + internal static readonly int MARGIN = NDalicPINVOKE.View_Property_MARGIN_get(); + internal static readonly int PADDING = NDalicPINVOKE.View_Property_PADDING_get(); } - - - } - - /// - /// The View layout Direction type. - /// - /// 4 - public enum ViewLayoutDirectionType - { - /// - /// Left to right. - /// - /// 4 - LTR, - /// - /// Right to left. - /// - /// 4 - RTL - } - - internal enum ChildLayoutData - { - /// - /// Constant which indicates child size should match parent size - /// - MatchParent = -1, - /// - /// Constant which indicates parent should take the smallest size possible to wrap it's children with their desired size - /// - WrapContent = -2, - } - - internal enum ResourceLoadingStatusType - { - Invalid = -1, - Preparing = 0, - Ready, - Failed, } - } diff --git a/src/Tizen.NUI/src/public/BaseComponents/VisualView.cs b/src/Tizen.NUI/src/public/BaseComponents/VisualView.cs index 5e85b8b..e27587a 100755 --- a/src/Tizen.NUI/src/public/BaseComponents/VisualView.cs +++ b/src/Tizen.NUI/src/public/BaseComponents/VisualView.cs @@ -13,14 +13,14 @@ // limitations under the License. // +using System; +using System.Text; +using System.Runtime.InteropServices; +using System.Collections.Generic; +using System.Linq; + namespace Tizen.NUI.BaseComponents { - using System; - using System.Text; - using System.Runtime.InteropServices; - using System.Collections.Generic; - using System.Linq; - /// /// A visual view control if a user adds any visual to it. /// @@ -46,9 +46,12 @@ namespace Tizen.NUI.BaseComponents private Dictionary _tranformDictionary = null; private PropertyArray _animateArray = null; - static CustomView CreateInstance() + /// + /// Constructor. + /// + /// 3 + public VisualView() : base(typeof(VisualView).FullName, CustomViewBehaviour.ViewBehaviourDefault) { - return new VisualView(); } // static constructor registers the control type (for user can add kinds of visuals to it) @@ -60,11 +63,15 @@ namespace Tizen.NUI.BaseComponents } /// - /// Constructor. + /// Gets the total number of visuals which are added by users. /// /// 3 - public VisualView() : base(typeof(VisualView).FullName, CustomViewBehaviour.ViewBehaviourDefault) + public int NumberOfVisuals { + get + { + return _visualDictionary.Count; + } } /// @@ -152,18 +159,6 @@ namespace Tizen.NUI.BaseComponents } /// - /// Gets the total number of visuals which are added by users. - /// - /// 3 - public int NumberOfVisuals - { - get - { - return _visualDictionary.Count; - } - } - - /// /// Removes all visuals of the visual view. /// /// 3 @@ -198,23 +193,6 @@ namespace Tizen.NUI.BaseComponents } } - internal void UpdateVisual(int visualIndex, string visualName, VisualMap visualMap) - { - VisualBase visual = null; - - visual = VisualFactory.Instance.CreateVisual(visualMap.OutputVisualMap); - visual.Name = visualName; - visual.DepthIndex = visualMap.DepthIndex; - - RegisterVisual(visualIndex, visual); - - _visualDictionary[visualIndex] = visual; - _tranformDictionary[visualIndex] = visualMap.OutputTransformMap; - - RelayoutRequest(); - NUILog.Debug("UpdateVisual() name=" + visualName); - } - /// /// Creates a visual animation (transition) with the input parameters. /// @@ -312,7 +290,7 @@ namespace Tizen.NUI.BaseComponents if (item.Value.Name == target.Name) { PropertyMap _animator = new PropertyMap(); - if ( _alphaFunction != null) {_animator.Add("alphaFunction", new PropertyValue(_alphaFunction));} + if (_alphaFunction != null) { _animator.Add("alphaFunction", new PropertyValue(_alphaFunction)); } PropertyMap _timePeriod = new PropertyMap(); _timePeriod.Add("duration", new PropertyValue((endTime - startTime) / 1000.0f)); @@ -322,7 +300,7 @@ namespace Tizen.NUI.BaseComponents StringBuilder sb = new StringBuilder(property); sb[0] = (char)(sb[0] | 0x20); string _str = sb.ToString(); - if (_str == "position") {_str = "offset";} + if (_str == "position") { _str = "offset"; } PropertyValue destVal = PropertyValue.CreateFromObject(destinationValue); @@ -440,7 +418,7 @@ namespace Tizen.NUI.BaseComponents if (item.Value.Name == target.Name) { PropertyMap _animator = new PropertyMap(); - if ( _alphaFunction != null) {_animator.Add("alphaFunction", new PropertyValue(_alphaFunction));} + if (_alphaFunction != null) { _animator.Add("alphaFunction", new PropertyValue(_alphaFunction)); } PropertyMap _timePeriod = new PropertyMap(); _timePeriod.Add("duration", new PropertyValue((endTime - startTime) / 1000.0f)); @@ -450,7 +428,7 @@ namespace Tizen.NUI.BaseComponents StringBuilder sb = new StringBuilder(property); sb[0] = (char)(sb[0] | 0x20); string _str = sb.ToString(); - if (_str == "position") {_str = "offset";} + if (_str == "position") { _str = "offset"; } PropertyValue destVal = PropertyValue.CreateFromObject(destinationValue); @@ -477,7 +455,7 @@ namespace Tizen.NUI.BaseComponents /// 3 public Animation AnimateVisualAddFinish() { - if ( _animateArray == null || _animateArray.Empty()) + if (_animateArray == null || _animateArray.Empty()) { Tizen.Log.Fatal("NUI", "animate visual property array is empty!"); return null; @@ -505,5 +483,26 @@ namespace Tizen.NUI.BaseComponents } //temporary fix to pass TCT + internal void UpdateVisual(int visualIndex, string visualName, VisualMap visualMap) + { + VisualBase visual = null; + + visual = VisualFactory.Instance.CreateVisual(visualMap.OutputVisualMap); + visual.Name = visualName; + visual.DepthIndex = visualMap.DepthIndex; + + RegisterVisual(visualIndex, visual); + + _visualDictionary[visualIndex] = visual; + _tranformDictionary[visualIndex] = visualMap.OutputTransformMap; + + RelayoutRequest(); + NUILog.Debug("UpdateVisual() name=" + visualName); + } + + static CustomView CreateInstance() + { + return new VisualView(); + } } } \ No newline at end of file diff --git a/src/Tizen.NUI/src/public/BaseHandle.cs b/src/Tizen.NUI/src/public/BaseHandle.cs index 5b7355e..012e523 100755 --- a/src/Tizen.NUI/src/public/BaseHandle.cs +++ b/src/Tizen.NUI/src/public/BaseHandle.cs @@ -29,30 +29,48 @@ namespace Tizen.NUI /// 3 public class BaseHandle : Element, global::System.IDisposable { - /// - /// Event when a property is set. - /// - /// 5 - public event PropertyChangedEventHandler PropertySet; - - internal void NotifyPropertyChanged([CallerMemberName] String propertyName = "") - { - PropertySet?.Invoke(this, new PropertyChangedEventArgs(propertyName)); - } - internal static readonly BindablePropertyKey NavigationPropertyKey = BindableProperty.CreateReadOnly("Navigation", typeof(INavigation), typeof(/*VisualElement*/BaseHandle), default(INavigation)); + /// /// Backing store for the Navigation property. /// internal static readonly BindableProperty NavigationProperty = NavigationPropertyKey.BindableProperty; - private global::System.Runtime.InteropServices.HandleRef swigCPtr; /// /// swigCMemOwn /// /// 3 protected bool swigCMemOwn; + + /// + /// A Flat to check if it is already disposed. + /// + /// 3 + protected bool disposed = false; + + private global::System.Runtime.InteropServices.HandleRef swigCPtr; private bool _registerMe; + //A Flag to check who called Dispose(). (By User or DisposeQueue) + private bool isDisposeQueued = false; + + /// + /// Create an instance of BaseHandle. + /// + /// 3 + public BaseHandle() : this(NDalicPINVOKE.new_BaseHandle__SWIG_1()) + { + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + /// + /// Create an instance of BaseHandle. + /// + /// The BaseHandle instance. + /// 3 + public BaseHandle(BaseHandle handle) : this(NDalicPINVOKE.new_BaseHandle__SWIG_2(BaseHandle.getCPtr(handle))) + { + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } internal BaseHandle(global::System.IntPtr cPtr, bool cMemoryOwn) { @@ -92,20 +110,6 @@ namespace Tizen.NUI } } - internal static global::System.Runtime.InteropServices.HandleRef getCPtr(BaseHandle obj) - { - return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; - } - - //A Flag to check who called Dispose(). (By User or DisposeQueue) - private bool isDisposeQueued = false; - - /// - /// A Flat to check if it is already disposed. - /// - /// 3 - protected bool disposed = false; - /// /// Dispose. /// @@ -120,65 +124,34 @@ namespace Tizen.NUI } /// - /// Dispose. + /// Event when a property is set. /// - /// 3 - public void Dispose() - { - //Throw excpetion if Dispose() is called in separate thread. - if (!Window.IsInstalled()) - { - throw new System.InvalidOperationException("This API called from separate thread. This API must be called from MainThread."); - } + /// 5 + public event PropertyChangedEventHandler PropertySet; - if (isDisposeQueued) - { - Dispose(DisposeTypes.Implicit); - } - else + internal global::System.Runtime.InteropServices.HandleRef GetBaseHandleCPtrHandleRef + { + get { - Dispose(DisposeTypes.Explicit); - System.GC.SuppressFinalize(this); + return swigCPtr; } } /// - /// Dispose. + /// For internal use. /// - /// 3 - protected virtual void Dispose(DisposeTypes type) + internal NavigationProxy NavigationProxy { - if (disposed) - { - return; - } - - if (type == DisposeTypes.Explicit) - { - //Called by User - //Release your own managed resources here. - //You should release all of your own disposable objects here. - - } - - //Release your own unmanaged resources here. - //You should not access any managed member here except static instance. - //because the execution order of Finalizes is non-deterministic. - - //Unreference this instance from Registry. - if (_registerMe) - { - Registry.Unregister(this); - } - - if (swigCPtr.Handle != global::System.IntPtr.Zero) - { - swigCMemOwn = false; - NDalicPINVOKE.delete_BaseHandle(swigCPtr); - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); - } + get { return Navigation as NavigationProxy; } + } - disposed = true; + /// + /// Gets the navigation. + /// + internal INavigation Navigation + { + get { return (INavigation)GetValue(NavigationProperty); } + set { SetValue(NavigationPropertyKey, value); } } /// @@ -341,25 +314,28 @@ namespace Tizen.NUI } /// - /// Create an instance of BaseHandle. + /// Dispose. /// /// 3 - public BaseHandle() : this(NDalicPINVOKE.new_BaseHandle__SWIG_1()) + public void Dispose() { - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } + //Throw excpetion if Dispose() is called in separate thread. + if (!Window.IsInstalled()) + { + throw new System.InvalidOperationException("This API called from separate thread. This API must be called from MainThread."); + } - /// - /// Create an instance of BaseHandle. - /// - /// The BaseHandle instance. - /// 3 - public BaseHandle(BaseHandle handle) : this(NDalicPINVOKE.new_BaseHandle__SWIG_2(BaseHandle.getCPtr(handle))) - { - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + if (isDisposeQueued) + { + Dispose(DisposeTypes.Implicit); + } + else + { + Dispose(DisposeTypes.Explicit); + System.GC.SuppressFinalize(this); + } } - /// /// Performs an action on this object with the given action name and attributes. /// @@ -437,14 +413,6 @@ namespace Tizen.NUI return ret; } - internal RefObject GetObjectPtr() - { - global::System.IntPtr cPtr = NDalicPINVOKE.BaseHandle_GetObjectPtr(swigCPtr); - RefObject ret = (cPtr == global::System.IntPtr.Zero) ? null : new RefObject(cPtr, false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - /// /// To check the BaseHandle instance has body or not. /// @@ -480,29 +448,61 @@ namespace Tizen.NUI return ret; } - internal global::System.Runtime.InteropServices.HandleRef GetBaseHandleCPtrHandleRef + internal static global::System.Runtime.InteropServices.HandleRef getCPtr(BaseHandle obj) { - get - { - return swigCPtr; - } + return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; } - /// - /// For internal use. - /// - internal NavigationProxy NavigationProxy + internal void NotifyPropertyChanged([CallerMemberName] String propertyName = "") { - get { return Navigation as NavigationProxy; } + PropertySet?.Invoke(this, new PropertyChangedEventArgs(propertyName)); + } + + internal RefObject GetObjectPtr() + { + global::System.IntPtr cPtr = NDalicPINVOKE.BaseHandle_GetObjectPtr(swigCPtr); + RefObject ret = (cPtr == global::System.IntPtr.Zero) ? null : new RefObject(cPtr, false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; } /// - /// Gets the navigation. + /// Dispose. /// - internal INavigation Navigation + /// 3 + protected virtual void Dispose(DisposeTypes type) { - get { return (INavigation)GetValue(NavigationProperty); } - set { SetValue(NavigationPropertyKey, value); } + if (disposed) + { + return; + } + + if (type == DisposeTypes.Explicit) + { + //Called by User + //Release your own managed resources here. + //You should release all of your own disposable objects here. + + } + + //Release your own unmanaged resources here. + //You should not access any managed member here except static instance. + //because the execution order of Finalizes is non-deterministic. + + //Unreference this instance from Registry. + if (_registerMe) + { + Registry.Unregister(this); + } + + if (swigCPtr.Handle != global::System.IntPtr.Zero) + { + swigCMemOwn = false; + NDalicPINVOKE.delete_BaseHandle(swigCPtr); + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); + } + + disposed = true; } /// diff --git a/src/Tizen.NUI/src/public/Color.cs b/src/Tizen.NUI/src/public/Color.cs index eb97c04..0bb24ea 100755 --- a/src/Tizen.NUI/src/public/Color.cs +++ b/src/Tizen.NUI/src/public/Color.cs @@ -27,32 +27,115 @@ namespace Tizen.NUI [TypeConverter(typeof(ColorTypeConverter))] public class Color : global::System.IDisposable { - private global::System.Runtime.InteropServices.HandleRef swigCPtr; + + /// + /// Gets the black colored Color class. + /// + /// 3 + public static readonly Color Black = new Color(0.0f, 0.0f, 0.0f, 1.0f); + + /// + /// Gets the white colored Color class. + /// + /// 3 + public static readonly Color White = new Color(1.0f, 1.0f, 1.0f, 1.0f); + + /// + /// Gets the red colored Color class. + /// + /// 3 + public static readonly Color Red = new Color(1.0f, 0.0f, 0.0f, 1.0f); + + /// + /// Gets the green colored Color class. + /// + /// 3 + public static readonly Color Green = new Color(0.0f, 1.0f, 0.0f, 1.0f); + + /// + /// Gets the blue colored Color class. + /// + /// 3 + public static readonly Color Blue = new Color(0.0f, 0.0f, 1.0f, 1.0f); + + /// + /// Gets the yellow colored Color class. + /// + /// 3 + public static readonly Color Yellow = new Color(1.0f, 1.0f, 0.0f, 1.0f); + + /// + /// Gets the magenta colored Color class. + /// + /// 3 + public static readonly Color Magenta = new Color(1.0f, 0.0f, 1.0f, 1.0f); + + /// + /// Gets the cyan colored Color class. + /// + /// 3 + public static readonly Color Cyan = new Color(0.0f, 1.0f, 1.0f, 1.0f); + + /// + /// Gets the transparent colored Color class. + /// + /// 3 + public static readonly Color Transparent = new Color(0.0f, 0.0f, 0.0f, 0.0f); + /// /// swigCMemOwn /// /// 3 protected bool swigCMemOwn; - internal Color(global::System.IntPtr cPtr, bool cMemoryOwn) + /// + /// A Flat to check if it is already disposed. + /// + /// 3 + protected bool disposed = false; + + private global::System.Runtime.InteropServices.HandleRef swigCPtr; + //A Flag to check who called Dispose(). (By User or DisposeQueue) + private bool isDisposeQueued = false; + + /// + /// Default constructor + /// + /// 3 + public Color() : this(NDalicPINVOKE.new_Vector4__SWIG_0(), true) { - swigCMemOwn = cMemoryOwn; - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } - internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Color obj) + + /// + /// The constructor. + /// + /// The red component. + /// The green component. + /// The blue component. + /// The alpha component. + /// 3 + public Color(float r, float g, float b, float a) : this(NDalicPINVOKE.new_Vector4__SWIG_1(ValueCheck(r), ValueCheck(g), ValueCheck(b), ValueCheck(a)), true) { - return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } - //A Flag to check who called Dispose(). (By User or DisposeQueue) - private bool isDisposeQueued = false; - /// - /// A Flat to check if it is already disposed. + /// The conversion constructor from an array of four floats. /// + /// array Array of R,G,B,A. /// 3 - protected bool disposed = false; + public Color(float[] array) : this(NDalicPINVOKE.new_Vector4__SWIG_2(ValueCheck(array)), true) + { + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + internal Color(global::System.IntPtr cPtr, bool cMemoryOwn) + { + swigCMemOwn = cMemoryOwn; + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); + } /// /// Dispose. @@ -60,7 +143,7 @@ namespace Tizen.NUI /// 3 ~Color() { - if(!isDisposeQueued) + if (!isDisposeQueued) { isDisposeQueued = true; DisposeQueue.Instance.Add(this); @@ -68,60 +151,113 @@ namespace Tizen.NUI } /// - /// To make a color instance be disposed. + /// The red component. /// /// 3 - public void Dispose() + public float R { - //Throw excpetion if Dispose() is called in separate thread. - if (!Window.IsInstalled()) + set { - throw new System.InvalidOperationException("This API called from separate thread. This API must be called from MainThread."); + NDalicPINVOKE.Vector4_r_set(swigCPtr, ValueCheck(value)); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + get + { + float ret = NDalicPINVOKE.Vector4_r_get(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; } + } - if (isDisposeQueued) + /// + /// The green component. + /// + /// 3 + public float G + { + set { - Dispose(DisposeTypes.Implicit); + NDalicPINVOKE.Vector4_g_set(swigCPtr, ValueCheck(value)); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } - else + get { - Dispose(DisposeTypes.Explicit); - System.GC.SuppressFinalize(this); + float ret = NDalicPINVOKE.Vector4_g_get(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; } } /// - /// Dispose. + /// The blue component. /// /// 3 - protected virtual void Dispose(DisposeTypes type) + public float B { - if (disposed) + set { - return; + NDalicPINVOKE.Vector4_b_set(swigCPtr, ValueCheck(value)); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } - - if(type == DisposeTypes.Explicit) + get { - //Called by User - //Release your own managed resources here. - //You should release all of your own disposable objects here. + float ret = NDalicPINVOKE.Vector4_b_get(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; } + } - //Release your own unmanaged resources here. - //You should not access any managed member here except static instance. - //because the execution order of Finalizes is non-deterministic. + /// + /// The alpha component. + /// + /// 3 + public float A + { + set + { + NDalicPINVOKE.Vector4_a_set(swigCPtr, ValueCheck(value)); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + get + { + float ret = NDalicPINVOKE.Vector4_a_get(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + } - if (swigCPtr.Handle != global::System.IntPtr.Zero) + /// + /// The array subscript operator overload. + /// + /// The subscript index. + /// The float at the given index. + /// 3 + public float this[uint index] + { + get { - if (swigCMemOwn) - { - swigCMemOwn = false; - NDalicPINVOKE.delete_Vector4(swigCPtr); - } - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); + return ValueOfIndex(index); } - disposed = true; + } + + /// + /// Converts the Color class to Vector4 class implicitly. + /// + /// A color to be converted to Vector4 + /// 3 + public static implicit operator Vector4(Color color) + { + return new Vector4(color.R, color.G, color.B, color.A); + } + + /// + /// Converts Vector4 class to Color class implicitly. + /// + /// A Vector4 to be converted to color. + /// 3 + public static implicit operator Color(Vector4 vec) + { + return new Color(vec.R, vec.G, vec.B, vec.A); } /// @@ -182,7 +318,7 @@ namespace Tizen.NUI /// The second value. /// The color containing the result of the multiplication. /// 3 - public static Color operator*(Color arg1, float arg2) + public static Color operator *(Color arg1, float arg2) { Color result = arg1.Multiply(arg2); return ValueCheck(result); @@ -208,64 +344,186 @@ namespace Tizen.NUI /// The second value. /// The color containing the result of the division. /// 3 - public static Color operator/(Color arg1, float arg2) + public static Color operator /(Color arg1, float arg2) { Color result = arg1.Divide(arg2); return ValueCheck(result); } /// - /// The array subscript operator overload. + /// To make a color instance be disposed. /// - /// The subscript index. - /// The float at the given index. /// 3 - public float this[uint index] + public void Dispose() { - get + //Throw excpetion if Dispose() is called in separate thread. + if (!Window.IsInstalled()) { - return ValueOfIndex(index); + throw new System.InvalidOperationException("This API called from separate thread. This API must be called from MainThread."); } - } - internal static Color GetColorFromPtr(global::System.IntPtr cPtr) - { - Color ret = new Color(cPtr, false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; + if (isDisposeQueued) + { + Dispose(DisposeTypes.Implicit); + } + else + { + Dispose(DisposeTypes.Explicit); + System.GC.SuppressFinalize(this); + } } /// - /// Default constructor + /// Checks if two color classes are same. /// + /// A color to be compared. + /// If two colors are are same, then true. /// 3 - public Color() : this(NDalicPINVOKE.new_Vector4__SWIG_0(), true) + public bool EqualTo(Color rhs) { + bool ret = NDalicPINVOKE.Vector4_EqualTo(swigCPtr, Color.getCPtr(rhs)); + + if (rhs == null) return false; + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; } - /// - /// The constructor. + /// Checks if two color classes are different. /// - /// The red component. - /// The green component. - /// The blue component. - /// The alpha component. + /// A color to be compared. + /// If two colors are are different, then true. /// 3 - public Color(float r, float g, float b, float a) : this(NDalicPINVOKE.new_Vector4__SWIG_1(ValueCheck(r), ValueCheck(g), ValueCheck(b), ValueCheck(a)), true) + public bool NotEqualTo(Color rhs) { + bool ret = NDalicPINVOKE.Vector4_NotEqualTo(swigCPtr, Color.getCPtr(rhs)); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Color obj) + { + return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; + } + + internal static Color GetColorFromPtr(global::System.IntPtr cPtr) + { + Color ret = new Color(cPtr, false); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + internal static Color ValueCheck(Color color) + { + if (color.R < 0.0f) + { + color.R = 0.0f; + NUILog.Error("The value of Result is invalid! Should be between [0, 1]."); + } + else if (color.R > 1.0f) + { + color.R = 1.0f; + NUILog.Error("The value of Result is invalid! Should be between [0, 1]."); + } + if (color.G < 0.0f) + { + color.G = 0.0f; + NUILog.Error("The value of Result is invalid! Should be between [0, 1]."); + } + else if (color.G > 1.0f) + { + color.G = 1.0f; + NUILog.Error("The value of Result is invalid! Should be between [0, 1]."); + } + if (color.B < 0.0f) + { + color.B = 0.0f; + NUILog.Error("The value of Result is invalid! Should be between [0, 1]."); + } + else if (color.B > 1.0f) + { + color.B = 1.0f; + NUILog.Error("The value of Result is invalid! Should be between [0, 1]."); + } + if (color.A < 0.0f) + { + color.A = 0.0f; + NUILog.Error("The value of Result is invalid! Should be between [0, 1]."); + } + else if (color.A > 1.0f) + { + color.A = 1.0f; + NUILog.Error("The value of Result is invalid! Should be between [0, 1]."); + } + return color; + } + + internal static float ValueCheck(float value) + { + if (value < 0.0f) + { + value = 0.0f; + NUILog.Error("The value of Parameters is invalid! Should be between [0, 1]."); + } + else if (value > 1.0f) + { + value = 1.0f; + NUILog.Error("The value of Parameters is invalid! Should be between [0, 1]."); + } + return value; + } + + internal static float[] ValueCheck(float[] arr) + { + for (int i = 0; i < arr.Length; i++) + { + if (arr[i] < 0.0f) + { + arr[i] = 0.0f; + NUILog.Error("The value of Parameters is invalid! Should be between [0, 1]."); + } + else if (arr[i] > 1.0f) + { + arr[i] = 1.0f; + NUILog.Error("The value of Parameters is invalid! Should be between [0, 1]."); + } + } + return arr; } /// - /// The conversion constructor from an array of four floats. + /// Dispose. /// - /// array Array of R,G,B,A. /// 3 - public Color(float[] array) : this(NDalicPINVOKE.new_Vector4__SWIG_2(ValueCheck(array)), true) + protected virtual void Dispose(DisposeTypes type) { - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + if (disposed) + { + return; + } + + if(type == DisposeTypes.Explicit) + { + //Called by User + //Release your own managed resources here. + //You should release all of your own disposable objects here. + } + + //Release your own unmanaged resources here. + //You should not access any managed member here except static instance. + //because the execution order of Finalizes is non-deterministic. + + if (swigCPtr.Handle != global::System.IntPtr.Zero) + { + if (swigCMemOwn) + { + swigCMemOwn = false; + NDalicPINVOKE.delete_Vector4(swigCPtr); + } + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); + } + disposed = true; } private Color Add(Color rhs) @@ -359,36 +617,6 @@ namespace Tizen.NUI return ret; } - /// - /// Checks if two color classes are same. - /// - /// A color to be compared. - /// If two colors are are same, then true. - /// 3 - public bool EqualTo(Color rhs) - { - bool ret = NDalicPINVOKE.Vector4_EqualTo(swigCPtr, Color.getCPtr(rhs)); - - if (rhs == null) return false; - - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - /// - /// Checks if two color classes are different. - /// - /// A color to be compared. - /// If two colors are are different, then true. - /// 3 - public bool NotEqualTo(Color rhs) - { - bool ret = NDalicPINVOKE.Vector4_NotEqualTo(swigCPtr, Color.getCPtr(rhs)); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - private float ValueOfIndex(uint index) { float ret = NDalicPINVOKE.Vector4_ValueOfIndex__SWIG_0(swigCPtr, index); @@ -396,234 +624,6 @@ namespace Tizen.NUI return ret; } - /// - /// The red component. - /// - /// 3 - public float R - { - set - { - NDalicPINVOKE.Vector4_r_set(swigCPtr, ValueCheck(value)); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - get - { - float ret = NDalicPINVOKE.Vector4_r_get(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - } - - /// - /// The green component. - /// - /// 3 - public float G - { - set - { - NDalicPINVOKE.Vector4_g_set(swigCPtr, ValueCheck(value)); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - get - { - float ret = NDalicPINVOKE.Vector4_g_get(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - } - - /// - /// The blue component. - /// - /// 3 - public float B - { - set - { - NDalicPINVOKE.Vector4_b_set(swigCPtr, ValueCheck(value)); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - get - { - float ret = NDalicPINVOKE.Vector4_b_get(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - } - - /// - /// The alpha component. - /// - /// 3 - public float A - { - set - { - NDalicPINVOKE.Vector4_a_set(swigCPtr, ValueCheck(value)); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - get - { - float ret = NDalicPINVOKE.Vector4_a_get(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - } - - /// - /// Gets the black colored Color class. - /// - /// 3 - public static readonly Color Black = new Color(0.0f, 0.0f, 0.0f, 1.0f); - - /// - /// Gets the white colored Color class. - /// - /// 3 - public static readonly Color White = new Color(1.0f, 1.0f, 1.0f, 1.0f); - - /// - /// Gets the red colored Color class. - /// - /// 3 - public static readonly Color Red = new Color(1.0f, 0.0f, 0.0f, 1.0f); - - /// - /// Gets the green colored Color class. - /// - /// 3 - public static readonly Color Green = new Color(0.0f, 1.0f, 0.0f, 1.0f); - - /// - /// Gets the blue colored Color class. - /// - /// 3 - public static readonly Color Blue = new Color(0.0f, 0.0f, 1.0f, 1.0f); - - /// - /// Gets the yellow colored Color class. - /// - /// 3 - public static readonly Color Yellow = new Color(1.0f, 1.0f, 0.0f, 1.0f); - - /// - /// Gets the magenta colored Color class. - /// - /// 3 - public static readonly Color Magenta = new Color(1.0f, 0.0f, 1.0f, 1.0f); - - /// - /// Gets the cyan colored Color class. - /// - /// 3 - public static readonly Color Cyan = new Color(0.0f, 1.0f, 1.0f, 1.0f); - - /// - /// Gets the transparent colored Color class. - /// - /// 3 - public static readonly Color Transparent = new Color(0.0f, 0.0f, 0.0f, 0.0f); - - /// - /// Converts the Color class to Vector4 class implicitly. - /// - /// A color to be converted to Vector4 - /// 3 - public static implicit operator Vector4(Color color) - { - return new Vector4(color.R, color.G, color.B, color.A); - } - - /// - /// Converts Vector4 class to Color class implicitly. - /// - /// A Vector4 to be converted to color. - /// 3 - public static implicit operator Color(Vector4 vec) - { - return new Color(vec.R, vec.G, vec.B, vec.A); - } - - internal static Color ValueCheck(Color color) - { - if (color.R < 0.0f) - { - color.R = 0.0f; - NUILog.Error( "The value of Result is invalid! Should be between [0, 1]."); - } - else if (color.R > 1.0f) - { - color.R = 1.0f; - NUILog.Error( "The value of Result is invalid! Should be between [0, 1]."); - } - if (color.G < 0.0f) - { - color.G = 0.0f; - NUILog.Error( "The value of Result is invalid! Should be between [0, 1]."); - } - else if (color.G > 1.0f) - { - color.G = 1.0f; - NUILog.Error( "The value of Result is invalid! Should be between [0, 1]."); - } - if (color.B < 0.0f) - { - color.B = 0.0f; - NUILog.Error( "The value of Result is invalid! Should be between [0, 1]."); - } - else if (color.B > 1.0f) - { - color.B = 1.0f; - NUILog.Error( "The value of Result is invalid! Should be between [0, 1]."); - } - if (color.A < 0.0f) - { - color.A = 0.0f; - NUILog.Error( "The value of Result is invalid! Should be between [0, 1]."); - } - else if (color.A > 1.0f) - { - color.A = 1.0f; - NUILog.Error( "The value of Result is invalid! Should be between [0, 1]."); - } - return color; - } - - internal static float ValueCheck(float value) - { - if (value < 0.0f) - { - value = 0.0f; - NUILog.Error( "The value of Parameters is invalid! Should be between [0, 1]."); - } - else if (value > 1.0f) - { - value = 1.0f; - NUILog.Error( "The value of Parameters is invalid! Should be between [0, 1]."); - } - return value; - } - - internal static float[] ValueCheck(float[] arr) - { - for(int i = 0; i < arr.Length; i++) - { - if (arr[i] < 0.0f) - { - arr[i] = 0.0f; - NUILog.Error( "The value of Parameters is invalid! Should be between [0, 1]."); - } - else if (arr[i] > 1.0f) - { - arr[i] = 1.0f; - NUILog.Error( "The value of Parameters is invalid! Should be between [0, 1]."); - } - } - return arr; - } - } } diff --git a/src/Tizen.NUI/src/public/Container.cs b/src/Tizen.NUI/src/public/Container.cs index 648d5bb..2c05dc6 100755 --- a/src/Tizen.NUI/src/public/Container.cs +++ b/src/Tizen.NUI/src/public/Container.cs @@ -28,9 +28,13 @@ namespace Tizen.NUI /// 4 public abstract class Container : Animatable { - - private List _childViews = new List(); internal BaseHandle InternalParent; + private List _childViews = new List(); + + internal Container(global::System.IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemoryOwn) + { + // No un-managed data hence no need to store a native ptr + } /// /// List of children of Container. @@ -44,23 +48,34 @@ namespace Tizen.NUI } } - internal Container(global::System.IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemoryOwn) + /// + /// Gets the parent container. + /// Read only + /// + ///
The child container has been initialized.
+ /// The parent container. + /// 4 + public new Container Parent { - // No un-managed data hence no need to store a native ptr + get + { + return GetParent(); + } } /// - /// Dispose. + /// Gets the number of children for this container. + /// Read only /// + ///
The container has been initialized.
+ /// The number of children. /// 4 - protected override void Dispose(DisposeTypes type) + public uint ChildCount { - if (disposed) + get { - return; + return GetChildCount(); } - - base.Dispose(type); } /// @@ -71,7 +86,7 @@ namespace Tizen.NUI /// If the child already has a parent, it will be removed from the old parent and reparented to this view. This may change child's position, color, scale, etc. as it now inherits them from this view. /// The child view to add. /// 4 - public abstract void Add( View view ); + public abstract void Add(View view); /// /// Removes a child view from this view. If the view was not a child of this view, this is a no-op. @@ -79,7 +94,7 @@ namespace Tizen.NUI ///
This View(the parent) has been initialized. The child view is not the same as the parent view.
/// The view to remove /// 4 - public abstract void Remove( View view ); + public abstract void Remove(View view); /// /// Retrieves the child view by the index. @@ -88,7 +103,7 @@ namespace Tizen.NUI /// The index of the child to retrieve. /// The view for the given index or empty handle if children are not initialized. /// 4 - public abstract View GetChildAt( uint index ); + public abstract View GetChildAt(uint index); /// /// Gets the parent of this container. @@ -107,33 +122,18 @@ namespace Tizen.NUI public abstract UInt32 GetChildCount(); /// - /// Gets the parent container. - /// Read only + /// Dispose. /// - ///
The child container has been initialized.
- /// The parent container. /// 4 - public new Container Parent + protected override void Dispose(DisposeTypes type) { - get + if (disposed) { - return GetParent(); + return; } - } - /// - /// Gets the number of children for this container. - /// Read only - /// - ///
The container has been initialized.
- /// The number of children. - /// 4 - public uint ChildCount - { - get - { - return GetChildCount(); - } + base.Dispose(type); } + } } // namespace Tizen.NUI diff --git a/src/Tizen.NUI/src/public/CustomView/Spin.cs b/src/Tizen.NUI/src/public/CustomView/Spin.cs index ef22f18..a0bb48f 100755 --- a/src/Tizen.NUI/src/public/CustomView/Spin.cs +++ b/src/Tizen.NUI/src/public/CustomView/Spin.cs @@ -45,12 +45,6 @@ namespace Tizen.NUI private Color _textBackgroundColor; private int _maxTextLength; - // Called by DALi Builder if it finds a Spin control in a JSON file - static CustomView CreateInstance() - { - return new Spin(); - } - // static constructor registers the control type (only runs once) static Spin() { @@ -68,136 +62,6 @@ namespace Tizen.NUI } /// - /// Overrides the method of OnInitialize() for the CustomView class.
- /// This method is called after the control has been initialized.
- /// Derived classes should do any second phase initialization by overriding this method.
- ///
- /// 3 - public override void OnInitialize() - { - // Initialize the propertiesControl - _arrowImage = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "picture.png"; - _textBackgroundColor = new Color(0.6f, 0.6f, 0.6f, 1.0f); - _currentValue = 0; - _minValue = 0; - _maxValue = 0; - _singleStep = 1; - _maxTextLength = 0; - - // Create image visual for the arrow keys - _arrowVisualPropertyIndex = RegisterProperty("ArrowImage", new PropertyValue(_arrowImage), Tizen.NUI.PropertyAccessMode.ReadWrite); - _arrowVisual = VisualFactory.Instance.CreateVisual( - new PropertyMap().Add(Visual.Property.Type, new PropertyValue((int)Visual.Type.Image)) - .Add(ImageVisualProperty.URL, new PropertyValue(_arrowImage)) - .Add(ImageVisualProperty.DesiredHeight, new PropertyValue(150)) - .Add(ImageVisualProperty.DesiredWidth, new PropertyValue(150))); - RegisterVisual(_arrowVisualPropertyIndex, _arrowVisual); - - // Create a text field - _textField = new TextField(); - _textField.PivotPoint = Tizen.NUI.PivotPoint.Center; - _textField.WidthResizePolicy = ResizePolicyType.SizeRelativeToParent; - _textField.HeightResizePolicy = ResizePolicyType.SizeRelativeToParent; - _textField.SizeModeFactor = new Vector3(1.0f, 0.45f, 1.0f); - _textField.PlaceholderText = "----"; - _textField.BackgroundColor = _textBackgroundColor; - _textField.HorizontalAlignment = HorizontalAlignment.Center; - _textField.VerticalAlignment = VerticalAlignment.Center; - _textField.Focusable = (true); - _textField.Name = "_textField"; - _textField.Position2D = new Position2D(0, 40); - - this.Add(_textField); - - _textField.FocusGained += TextFieldKeyInputFocusGained; - _textField.FocusLost += TextFieldKeyInputFocusLost; - } - - /// - /// Overrides the method of GetNaturalSize() for the CustomView class.
- /// Returns the natural size of the actor.
- ///
- /// Natural size of this spin itself. - /// 3 - public override Size2D GetNaturalSize() - { - return new Size2D(150, 150); - } - - /// - /// An event handler is used when the TextField in the spin gets the key focus.
- /// Make sure when the current spin that takes input focus, also takes the keyboard focus.
- /// For example, when you tap the spin directly.
- ///
- /// Sender of this event. - /// Event arguments. - /// 3 - public void TextFieldKeyInputFocusGained(object source, EventArgs e) - { - FocusManager.Instance.SetCurrentFocusView(_textField); - } - - /// - /// An event handler when the TextField in the spin looses it's key focus. - /// - /// - /// - /// 3 - public void TextFieldKeyInputFocusLost(object source, EventArgs e) - { - int previousValue = _currentValue; - - // If the input value is invalid, change it back to the previous valid value - if (int.TryParse(_textField.Text, out _currentValue)) - { - if (_currentValue < _minValue || _currentValue > _maxValue) - { - _currentValue = previousValue; - } - } - else - { - _currentValue = previousValue; - } - - // Otherwise take the new value - this.Value = _currentValue; - } - - /// - /// Overrides the method of GetNextKeyboardFocusableView() for the CustomView class.
- /// Gets the next key focusable view in this view towards the given direction.
- /// A view needs to override this function in order to support two-dimensional key navigation.
- ///
- /// The current focused view. - /// The direction to move the focus towards. - /// Whether the focus movement should be looped within the control. - /// The next keyboard focusable view in this control or an empty handle if no view can be focused. - /// 3 - public override View GetNextFocusableView(View currentFocusedView, View.FocusDirection direction, bool loopEnabled) - { - // Respond to Up/Down keys to change the value while keeping the current spin focused - View nextFocusedView = currentFocusedView; - if (direction == View.FocusDirection.Up) - { - this.Value += this.Step; - nextFocusedView = _textField; - } - else if (direction == View.FocusDirection.Down) - { - this.Value -= this.Step; - nextFocusedView = _textField; - } - else - { - // Return null - return null; - } - - return nextFocusedView; - } - - /// /// Value to be set in the spin. /// /// 3 @@ -210,7 +74,6 @@ namespace Tizen.NUI } set { - NUILog.Debug("Value set to " + value); _currentValue = value; @@ -390,5 +253,141 @@ namespace Tizen.NUI RegisterVisual(_arrowVisualPropertyIndex, _arrowVisual); } } + + // Called by DALi Builder if it finds a Spin control in a JSON file + static CustomView CreateInstance() + { + return new Spin(); + } + + /// + /// Overrides the method of OnInitialize() for the CustomView class.
+ /// This method is called after the control has been initialized.
+ /// Derived classes should do any second phase initialization by overriding this method.
+ ///
+ /// 3 + public override void OnInitialize() + { + // Initialize the propertiesControl + _arrowImage = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "picture.png"; + _textBackgroundColor = new Color(0.6f, 0.6f, 0.6f, 1.0f); + _currentValue = 0; + _minValue = 0; + _maxValue = 0; + _singleStep = 1; + _maxTextLength = 0; + + // Create image visual for the arrow keys + _arrowVisualPropertyIndex = RegisterProperty("ArrowImage", new PropertyValue(_arrowImage), Tizen.NUI.PropertyAccessMode.ReadWrite); + _arrowVisual = VisualFactory.Instance.CreateVisual( + new PropertyMap().Add(Visual.Property.Type, new PropertyValue((int)Visual.Type.Image)) + .Add(ImageVisualProperty.URL, new PropertyValue(_arrowImage)) + .Add(ImageVisualProperty.DesiredHeight, new PropertyValue(150)) + .Add(ImageVisualProperty.DesiredWidth, new PropertyValue(150))); + RegisterVisual(_arrowVisualPropertyIndex, _arrowVisual); + + // Create a text field + _textField = new TextField(); + _textField.PivotPoint = Tizen.NUI.PivotPoint.Center; + _textField.WidthResizePolicy = ResizePolicyType.SizeRelativeToParent; + _textField.HeightResizePolicy = ResizePolicyType.SizeRelativeToParent; + _textField.SizeModeFactor = new Vector3(1.0f, 0.45f, 1.0f); + _textField.PlaceholderText = "----"; + _textField.BackgroundColor = _textBackgroundColor; + _textField.HorizontalAlignment = HorizontalAlignment.Center; + _textField.VerticalAlignment = VerticalAlignment.Center; + _textField.Focusable = (true); + _textField.Name = "_textField"; + _textField.Position2D = new Position2D(0, 40); + + this.Add(_textField); + + _textField.FocusGained += TextFieldKeyInputFocusGained; + _textField.FocusLost += TextFieldKeyInputFocusLost; + } + + /// + /// Overrides the method of GetNaturalSize() for the CustomView class.
+ /// Returns the natural size of the actor.
+ ///
+ /// Natural size of this spin itself. + /// 3 + public override Size2D GetNaturalSize() + { + return new Size2D(150, 150); + } + + /// + /// An event handler is used when the TextField in the spin gets the key focus.
+ /// Make sure when the current spin that takes input focus, also takes the keyboard focus.
+ /// For example, when you tap the spin directly.
+ ///
+ /// Sender of this event. + /// Event arguments. + /// 3 + public void TextFieldKeyInputFocusGained(object source, EventArgs e) + { + FocusManager.Instance.SetCurrentFocusView(_textField); + } + + /// + /// An event handler when the TextField in the spin looses it's key focus. + /// + /// + /// + /// 3 + public void TextFieldKeyInputFocusLost(object source, EventArgs e) + { + int previousValue = _currentValue; + + // If the input value is invalid, change it back to the previous valid value + if (int.TryParse(_textField.Text, out _currentValue)) + { + if (_currentValue < _minValue || _currentValue > _maxValue) + { + _currentValue = previousValue; + } + } + else + { + _currentValue = previousValue; + } + + // Otherwise take the new value + this.Value = _currentValue; + } + + /// + /// Overrides the method of GetNextKeyboardFocusableView() for the CustomView class.
+ /// Gets the next key focusable view in this view towards the given direction.
+ /// A view needs to override this function in order to support two-dimensional key navigation.
+ ///
+ /// The current focused view. + /// The direction to move the focus towards. + /// Whether the focus movement should be looped within the control. + /// The next keyboard focusable view in this control or an empty handle if no view can be focused. + /// 3 + public override View GetNextFocusableView(View currentFocusedView, View.FocusDirection direction, bool loopEnabled) + { + // Respond to Up/Down keys to change the value while keeping the current spin focused + View nextFocusedView = currentFocusedView; + if (direction == View.FocusDirection.Up) + { + this.Value += this.Step; + nextFocusedView = _textField; + } + else if (direction == View.FocusDirection.Down) + { + this.Value -= this.Step; + nextFocusedView = _textField; + } + else + { + // Return null + return null; + } + + return nextFocusedView; + } } } \ No newline at end of file diff --git a/src/Tizen.NUI/src/public/CustomViewRegistry.cs b/src/Tizen.NUI/src/public/CustomViewRegistry.cs index 58292f7..92b0d2b 100755 --- a/src/Tizen.NUI/src/public/CustomViewRegistry.cs +++ b/src/Tizen.NUI/src/public/CustomViewRegistry.cs @@ -74,6 +74,16 @@ namespace Tizen.NUI /// 3 public class ScriptableProperty : System.Attribute { + + /// 3 + public readonly ScriptableType type; + + /// 3 + public ScriptableProperty(ScriptableType type = ScriptableType.Default) + { + this.type = type; + } + /// /// Rhe enum of ScriptableType /// @@ -87,15 +97,6 @@ namespace Tizen.NUI Default, // Read Writable, non-animatable property, event thread only // Animatable // Animatable property, Currently disabled, UK } - /// 3 - public readonly ScriptableType type; - - - /// 3 - public ScriptableProperty(ScriptableType type = ScriptableType.Default) - { - this.type = type; - } } /// @@ -135,30 +136,6 @@ namespace Tizen.NUI /// 3 public sealed class CustomViewRegistry { - /// - /// ViewRegistry is a singleton. - /// - private static CustomViewRegistry instance = null; - - [UnmanagedFunctionPointer(CallingConvention.StdCall)] - private delegate IntPtr CreateControlDelegate(IntPtr cPtrControlName); - - [UnmanagedFunctionPointer(CallingConvention.StdCall)] - private delegate IntPtr GetPropertyDelegate(IntPtr controlPtr, IntPtr propertyName); - - [UnmanagedFunctionPointer(CallingConvention.StdCall)] - private delegate void SetPropertyDelegate(IntPtr controlPtr, IntPtr propertyName, IntPtr propertyValue); - - private CreateControlDelegate _createCallback; - private SetPropertyDelegate _setPropertyCallback; - private GetPropertyDelegate _getPropertyCallback; - private PropertyRangeManager _propertyRangeManager; - - /// - /// Maps the name of a custom view to a create instance function - /// For example, given a string "Spin", we can get a function used to create the Spin View. - /// - private Dictionary> _constructorMap; /// /// Lookup table to match C# types to DALi types, used for the automatic property registration. @@ -183,6 +160,21 @@ namespace Tizen.NUI // { "Matrix", PropertyType.MATRIX }, }; + /// + /// ViewRegistry is a singleton. + /// + private static CustomViewRegistry instance = null; + + private CreateControlDelegate _createCallback; + private SetPropertyDelegate _setPropertyCallback; + private GetPropertyDelegate _getPropertyCallback; + private PropertyRangeManager _propertyRangeManager; + + /// + /// Maps the name of a custom view to a create instance function + /// For example, given a string "Spin", we can get a function used to create the Spin View. + /// + private Dictionary> _constructorMap; private CustomViewRegistry() { @@ -194,70 +186,14 @@ namespace Tizen.NUI _propertyRangeManager = new PropertyRangeManager(); } - private Tizen.NUI.PropertyType GetDaliPropertyType(string cSharpTypeName) - { - Tizen.NUI.PropertyType daliType; - if (_daliPropertyTypeLookup.TryGetValue(cSharpTypeName, out daliType)) - { - NUILog.Debug("mapped " + cSharpTypeName + " to dAli type " + daliType); - - return daliType; - } - else - { - NUILog.Debug("Failed to find a mapping between C# property" + cSharpTypeName + " and DALi type"); - - return PropertyType.None; - } - } - - /// - /// Called directly from DALi C++ type registry to create a control (view) using no marshalling. - /// - /// Pointer to the control (views) handle. - /// C pointer to the control (view) name. - private static IntPtr CreateControl(IntPtr cPtrControlName) - { - string controlName = System.Runtime.InteropServices.Marshal.PtrToStringAnsi(cPtrControlName); - - NUILog.Debug("Create controlled called from C++ create a " + controlName); - - Func controlConstructor; - - // find the control constructor - if (Instance._constructorMap.TryGetValue(controlName, out controlConstructor)) - { - // Create the control - CustomView newControl = controlConstructor(); - if (newControl != null) - { - return newControl.GetPtrfromView(); // return pointer to handle - } - else - { - return IntPtr.Zero; - } - } - else - { - throw new global::System.InvalidOperationException("C# View not registererd with ViewRegistry" + controlName); - } - } - - private static IntPtr GetProperty(IntPtr controlPtr, IntPtr propertyName) - { - string name = System.Runtime.InteropServices.Marshal.PtrToStringAnsi(propertyName); - return Instance.GetPropertyValue(controlPtr, name); - } - - private static void SetProperty(IntPtr controlPtr, IntPtr propertyName, IntPtr propertyValue) - { - string name = System.Runtime.InteropServices.Marshal.PtrToStringAnsi(propertyName); + [UnmanagedFunctionPointer(CallingConvention.StdCall)] + private delegate IntPtr CreateControlDelegate(IntPtr cPtrControlName); - NUILog.Debug("SetControlProperty called for:" + name); + [UnmanagedFunctionPointer(CallingConvention.StdCall)] + private delegate IntPtr GetPropertyDelegate(IntPtr controlPtr, IntPtr propertyName); - Instance.SetPropertyValue(controlPtr, name, propertyValue); - } + [UnmanagedFunctionPointer(CallingConvention.StdCall)] + private delegate void SetPropertyDelegate(IntPtr controlPtr, IntPtr propertyName, IntPtr propertyValue); /// 3 public static CustomViewRegistry Instance @@ -332,6 +268,71 @@ namespace Tizen.NUI } /// + /// Called directly from DALi C++ type registry to create a control (view) using no marshalling. + /// + /// Pointer to the control (views) handle. + /// C pointer to the control (view) name. + private static IntPtr CreateControl(IntPtr cPtrControlName) + { + string controlName = System.Runtime.InteropServices.Marshal.PtrToStringAnsi(cPtrControlName); + + NUILog.Debug("Create controlled called from C++ create a " + controlName); + + Func controlConstructor; + + // find the control constructor + if (Instance._constructorMap.TryGetValue(controlName, out controlConstructor)) + { + // Create the control + CustomView newControl = controlConstructor(); + if (newControl != null) + { + return newControl.GetPtrfromView(); // return pointer to handle + } + else + { + return IntPtr.Zero; + } + } + else + { + throw new global::System.InvalidOperationException("C# View not registererd with ViewRegistry" + controlName); + } + } + + private static IntPtr GetProperty(IntPtr controlPtr, IntPtr propertyName) + { + string name = System.Runtime.InteropServices.Marshal.PtrToStringAnsi(propertyName); + return Instance.GetPropertyValue(controlPtr, name); + } + + private static void SetProperty(IntPtr controlPtr, IntPtr propertyName, IntPtr propertyValue) + { + string name = System.Runtime.InteropServices.Marshal.PtrToStringAnsi(propertyName); + + NUILog.Debug("SetControlProperty called for:" + name); + + Instance.SetPropertyValue(controlPtr, name, propertyValue); + } + + private Tizen.NUI.PropertyType GetDaliPropertyType(string cSharpTypeName) + { + Tizen.NUI.PropertyType daliType; + if (_daliPropertyTypeLookup.TryGetValue(cSharpTypeName, out daliType)) + { + NUILog.Debug("mapped " + cSharpTypeName + " to dAli type " + daliType); + + return daliType; + } + else + { + NUILog.Debug("Failed to find a mapping between C# property" + cSharpTypeName + " and DALi type"); + + return PropertyType.None; + } + } + + /// /// Gets a property value from a view. /// private IntPtr GetPropertyValue(IntPtr refObjectPtr, string propertyName) diff --git a/src/Tizen.NUI/src/public/Degree.cs b/src/Tizen.NUI/src/public/Degree.cs index f0d6d9c..6975988 100755 --- a/src/Tizen.NUI/src/public/Degree.cs +++ b/src/Tizen.NUI/src/public/Degree.cs @@ -25,31 +25,58 @@ namespace Tizen.NUI /// 3 public class Degree : global::System.IDisposable { - private global::System.Runtime.InteropServices.HandleRef swigCPtr; + /// /// swigCMemOwn. /// /// 3 protected bool swigCMemOwn; - internal Degree(global::System.IntPtr cPtr, bool cMemoryOwn) + /// + /// A Flat to check if it is already disposed. + /// + /// 3 + protected bool disposed = false; + + private global::System.Runtime.InteropServices.HandleRef swigCPtr; + + //A Flag to check who called Dispose(). (By User or DisposeQueue) + private bool isDisposeQueued = false; + + /// + /// The constructor. + /// + /// 3 + public Degree() : this(NDalicPINVOKE.new_Degree__SWIG_0(), true) { - swigCMemOwn = cMemoryOwn; - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } - internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Degree obj) + /// + /// Creates an angle in degrees. + /// + /// The initial value in degrees. + /// 3 + public Degree(float value) : this(NDalicPINVOKE.new_Degree__SWIG_1(value), true) { - return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } - //A Flag to check who called Dispose(). (By User or DisposeQueue) - private bool isDisposeQueued = false; /// - /// A Flat to check if it is already disposed. + /// Creates an angle in degrees from a radian. /// + /// The initial value in radians. /// 3 - protected bool disposed = false; + public Degree(Radian value) : this(NDalicPINVOKE.new_Degree__SWIG_2(Radian.getCPtr(value)), true) + { + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + internal Degree(global::System.IntPtr cPtr, bool cMemoryOwn) + { + swigCMemOwn = cMemoryOwn; + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); + } /// /// Dispose. @@ -57,7 +84,7 @@ namespace Tizen.NUI /// 3 ~Degree() { - if(!isDisposeQueued) + if (!isDisposeQueued) { isDisposeQueued = true; DisposeQueue.Instance.Add(this); @@ -65,6 +92,25 @@ namespace Tizen.NUI } /// + /// The value of degree. + /// + /// 3 + public float Value + { + set + { + NDalicPINVOKE.Degree_degree_set(swigCPtr, value); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + get + { + float ret = NDalicPINVOKE.Degree_degree_get(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + } + + /// /// Dispose. /// /// 3 @@ -87,6 +133,11 @@ namespace Tizen.NUI } } + internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Degree obj) + { + return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; + } + /// /// Dispose. /// @@ -121,54 +172,6 @@ namespace Tizen.NUI disposed = true; } - /// - /// The constructor. - /// - /// 3 - public Degree() : this(NDalicPINVOKE.new_Degree__SWIG_0(), true) - { - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - /// - /// Creates an angle in degrees. - /// - /// The initial value in degrees. - /// 3 - public Degree(float value) : this(NDalicPINVOKE.new_Degree__SWIG_1(value), true) - { - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - /// - /// Creates an angle in degrees from a radian. - /// - /// The initial value in radians. - /// 3 - public Degree(Radian value) : this(NDalicPINVOKE.new_Degree__SWIG_2(Radian.getCPtr(value)), true) - { - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - /// - /// The value of degree. - /// - /// 3 - public float Value - { - set - { - NDalicPINVOKE.Degree_degree_set(swigCPtr, value); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - get - { - float ret = NDalicPINVOKE.Degree_degree_get(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - } - } } \ No newline at end of file diff --git a/src/Tizen.NUI/src/public/Extents.cs b/src/Tizen.NUI/src/public/Extents.cs index 3a7ad14..87907fd 100755 --- a/src/Tizen.NUI/src/public/Extents.cs +++ b/src/Tizen.NUI/src/public/Extents.cs @@ -26,102 +26,23 @@ namespace Tizen.NUI [TypeConverter(typeof(ExtentsTypeConverter))] public class Extents : global::System.IDisposable { - private global::System.Runtime.InteropServices.HandleRef swigCPtr; + /// /// Extents class /// /// 4 protected bool swigCMemOwn; - internal Extents(global::System.IntPtr cPtr, bool cMemoryOwn) - { - swigCMemOwn = cMemoryOwn; - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); - } - - internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Extents obj) - { - return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; - } - - //A Flag to check who called Dispose(). (By User or DisposeQueue) - private bool isDisposeQueued = false; /// /// A Flat to check if it is already disposed. /// /// 4 protected bool disposed = false; - /// - /// Destructor. - /// - /// 4 - ~Extents() - { - if (!isDisposeQueued) - { - isDisposeQueued = true; - DisposeQueue.Instance.Add(this); - } - } - - /// - /// To make a Extents instance be disposed. - /// - /// 4 - public void Dispose() - { - //Throw excpetion if Dispose() is called in separate thread. - if (!Window.IsInstalled()) - { - throw new System.InvalidOperationException("This API called from separate thread. This API must be called from MainThread."); - } - - if (isDisposeQueued) - { - Dispose(DisposeTypes.Implicit); - } - else - { - Dispose(DisposeTypes.Explicit); - System.GC.SuppressFinalize(this); - } - } - - /// - /// To make a Extents instance be disposed. - /// - /// Extents type - /// 4 - protected virtual void Dispose(DisposeTypes type) - { - if (disposed) - { - return; - } - - if (type == DisposeTypes.Explicit) - { - //Called by User - //Release your own managed resources here. - //You should release all of your own disposable objects here. - } - - //Release your own unmanaged resources here. - //You should not access any managed member here except static instance. - //because the execution order of Finalizes is non-deterministic. + private global::System.Runtime.InteropServices.HandleRef swigCPtr; - if (swigCPtr.Handle != global::System.IntPtr.Zero) - { - if (swigCMemOwn) - { - swigCMemOwn = false; - NDalicPINVOKE.delete_Extents(swigCPtr); - } - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); - } - disposed = true; - } + //A Flag to check who called Dispose(). (By User or DisposeQueue) + private bool isDisposeQueued = false; /// /// Constructor. @@ -155,44 +76,23 @@ namespace Tizen.NUI if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } - internal Extents Assign(SWIGTYPE_p_uint16_t array) - { - Extents ret = new Extents(NDalicPINVOKE.Extents_Assign__SWIG_1(swigCPtr, SWIGTYPE_p_uint16_t.getCPtr(array)), false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - internal Extents Assign(Extents copy) + internal Extents(global::System.IntPtr cPtr, bool cMemoryOwn) { - Extents ret = new Extents(NDalicPINVOKE.Extents_Assign__SWIG_0(swigCPtr, Extents.getCPtr(copy)), false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; + swigCMemOwn = cMemoryOwn; + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); } /// - /// Equality operator. + /// Destructor. /// - /// The Extents to test against. - /// True if the extents are not equal. /// 4 - public bool EqualTo(Extents rhs) - { - bool ret = NDalicPINVOKE.Extents_EqualTo(swigCPtr, Extents.getCPtr(rhs)); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - /// - /// Inequality operator. - /// - /// The Extents to test against. - /// True if the extents are not equal. - /// 4 - public bool NotEqualTo(Extents rhs) + ~Extents() { - bool ret = NDalicPINVOKE.Extents_NotEqualTo(swigCPtr, Extents.getCPtr(rhs)); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; + if (!isDisposeQueued) + { + isDisposeQueued = true; + DisposeQueue.Instance.Add(this); + } } /// @@ -271,6 +171,109 @@ namespace Tizen.NUI } } + /// + /// To make a Extents instance be disposed. + /// + /// 4 + public void Dispose() + { + //Throw excpetion if Dispose() is called in separate thread. + if (!Window.IsInstalled()) + { + throw new System.InvalidOperationException("This API called from separate thread. This API must be called from MainThread."); + } + + if (isDisposeQueued) + { + Dispose(DisposeTypes.Implicit); + } + else + { + Dispose(DisposeTypes.Explicit); + System.GC.SuppressFinalize(this); + } + } + + /// + /// Equality operator. + /// + /// The Extents to test against. + /// True if the extents are not equal. + /// 4 + public bool EqualTo(Extents rhs) + { + bool ret = NDalicPINVOKE.Extents_EqualTo(swigCPtr, Extents.getCPtr(rhs)); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + /// + /// Inequality operator. + /// + /// The Extents to test against. + /// True if the extents are not equal. + /// 4 + public bool NotEqualTo(Extents rhs) + { + bool ret = NDalicPINVOKE.Extents_NotEqualTo(swigCPtr, Extents.getCPtr(rhs)); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Extents obj) + { + return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; + } + + internal Extents Assign(SWIGTYPE_p_uint16_t array) + { + Extents ret = new Extents(NDalicPINVOKE.Extents_Assign__SWIG_1(swigCPtr, SWIGTYPE_p_uint16_t.getCPtr(array)), false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + internal Extents Assign(Extents copy) + { + Extents ret = new Extents(NDalicPINVOKE.Extents_Assign__SWIG_0(swigCPtr, Extents.getCPtr(copy)), false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + /// + /// To make a Extents instance be disposed. + /// + /// Extents type + /// 4 + protected virtual void Dispose(DisposeTypes type) + { + if (disposed) + { + return; + } + + if (type == DisposeTypes.Explicit) + { + //Called by User + //Release your own managed resources here. + //You should release all of your own disposable objects here. + } + + //Release your own unmanaged resources here. + //You should not access any managed member here except static instance. + //because the execution order of Finalizes is non-deterministic. + + if (swigCPtr.Handle != global::System.IntPtr.Zero) + { + if (swigCMemOwn) + { + swigCMemOwn = false; + NDalicPINVOKE.delete_Extents(swigCPtr); + } + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); + } + disposed = true; + } + } } diff --git a/src/Tizen.NUI/src/public/FilterModeType.cs b/src/Tizen.NUI/src/public/FilterModeType.cs old mode 100644 new mode 100755 diff --git a/src/Tizen.NUI/src/public/FocusManager.cs b/src/Tizen.NUI/src/public/FocusManager.cs index d00acb3..0c0dd31 100755 --- a/src/Tizen.NUI/src/public/FocusManager.cs +++ b/src/Tizen.NUI/src/public/FocusManager.cs @@ -30,82 +30,49 @@ namespace Tizen.NUI /// 3 public class FocusManager : BaseHandle { + private static readonly FocusManager instance = FocusManager.Get(); private global::System.Runtime.InteropServices.HandleRef swigCPtr; private CustomAlgorithmInterfaceWrapper _customAlgorithmInterfaceWrapper; + private EventHandlerWithReturnType _preFocusChangeEventHandler; + private PreFocusChangeEventCallback _preFocusChangeCallback; + + private EventHandler _focusChangedEventHandler; + private FocusChangedEventCallback _focusChangedEventCallback; + + private EventHandler _focusGroupChangedEventHandler; + private FocusGroupChangedEventCallback _focusGroupChangedEventCallback; + + private EventHandler _focusedViewEnterKeyEventHandler; + private FocusedViewEnterKeyEventCallback _focusedViewEnterKeyEventCallback; + + private EventHandler _focusedViewEnterKeyEventHandler2; + private FocusedViewEnterKeyEventCallback2 _focusedViewEnterKeyEventCallback2; + internal FocusManager(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicManualPINVOKE.FocusManager_SWIGUpcast(cPtr), cMemoryOwn) { swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); } - internal static global::System.Runtime.InteropServices.HandleRef getCPtr(FocusManager obj) + internal FocusManager() : this(NDalicManualPINVOKE.new_FocusManager(), true) { - return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } - /// - /// Event arguments that passed via the PreFocusChange signal. - /// - /// 3 - public class PreFocusChangeEventArgs : EventArgs - { - private View _current; - private View _proposed; - private View.FocusDirection _direction; + [UnmanagedFunctionPointer(CallingConvention.StdCall)] + internal delegate IntPtr PreFocusChangeEventCallback(IntPtr current, IntPtr proposed, View.FocusDirection direction); - /// - /// The current focus view. - /// - /// 3 - public View CurrentView - { - get - { - return _current; - } - set - { - _current = value; - } - } + [UnmanagedFunctionPointer(CallingConvention.StdCall)] + internal delegate void FocusChangedEventCallback(IntPtr current, IntPtr next); - /// - /// The proposed view. - /// - /// 3 - public View ProposedView - { - get - { - return _proposed; - } - set - { - _proposed = value; - } - } + [UnmanagedFunctionPointer(CallingConvention.StdCall)] + private delegate void FocusGroupChangedEventCallback(IntPtr current, bool forwardDirection); - /// - /// The focus move direction. - /// - /// 3 - public View.FocusDirection Direction - { - get - { - return _direction; - } - set - { - _direction = value; - } - } - } + [UnmanagedFunctionPointer(CallingConvention.StdCall)] + private delegate void FocusedViewEnterKeyEventCallback(IntPtr view); - private EventHandlerWithReturnType _preFocusChangeEventHandler; [UnmanagedFunctionPointer(CallingConvention.StdCall)] - internal delegate IntPtr PreFocusChangeEventCallback(IntPtr current, IntPtr proposed, View.FocusDirection direction); - private PreFocusChangeEventCallback _preFocusChangeCallback; + private delegate void FocusedViewEnterKeyEventCallback2(IntPtr view); /// /// PreFocusChange will be triggered before the focus is going to be changed.
@@ -136,83 +103,6 @@ namespace Tizen.NUI } } - private IntPtr OnPreFocusChange(IntPtr current, IntPtr proposed, View.FocusDirection direction) - { - View view = null; - PreFocusChangeEventArgs e = new PreFocusChangeEventArgs(); - - if (current != global::System.IntPtr.Zero) - { - e.CurrentView = Registry.GetManagedBaseHandleFromNativePtr(current) as View; - } - if (proposed != global::System.IntPtr.Zero) - { - e.ProposedView = Registry.GetManagedBaseHandleFromNativePtr(proposed) as View; - } - e.Direction = direction; - - if (_preFocusChangeEventHandler != null) - { - view = _preFocusChangeEventHandler(this, e); - } - - if (view) - { - return view.GetPtrfromView(); - } - else - { - if (e.ProposedView) return proposed; - else return current; - } - } - - /// - /// Event arguments that passed via the FocusChanged signal. - /// - /// 3 - public class FocusChangedEventArgs : EventArgs - { - private View _current; - private View _next; - - /// - /// The current focus view. - /// - /// 3 - public View CurrentView - { - get - { - return _current; - } - set - { - _current = value; - } - } - /// - /// The next focus view. - /// - /// 3 - public View NextView - { - get - { - return _next; - } - set - { - _next = value; - } - } - } - - private EventHandler _focusChangedEventHandler; - [UnmanagedFunctionPointer(CallingConvention.StdCall)] - internal delegate void FocusChangedEventCallback(IntPtr current, IntPtr next); - private FocusChangedEventCallback _focusChangedEventCallback; - /// /// The FocusGroupChanged will be triggered after the current focused view has been changed. /// @@ -239,66 +129,6 @@ namespace Tizen.NUI } } - private void OnFocusChanged(IntPtr current, IntPtr next) - { - FocusChangedEventArgs e = new FocusChangedEventArgs(); - - e.CurrentView = Registry.GetManagedBaseHandleFromNativePtr(current) as View; - e.NextView = Registry.GetManagedBaseHandleFromNativePtr(next) as View; - - if (_focusChangedEventHandler != null) - { - _focusChangedEventHandler(this, e); - } - } - - /// - /// Event arguments that passed via the FocusGroupChanged signal. - /// - /// 3 - public class FocusGroupChangedEventArgs : EventArgs - { - private View _current; - private bool _forwardDirection; - - /// - /// The current focus view. - /// - /// 3 - public View CurrentView - { - get - { - return _current; - } - set - { - _current = value; - } - } - - /// - /// The forward direction. - /// - /// 3 - public bool ForwardDirection - { - get - { - return _forwardDirection; - } - set - { - _forwardDirection = value; - } - } - } - - private EventHandler _focusGroupChangedEventHandler; - [UnmanagedFunctionPointer(CallingConvention.StdCall)] - private delegate void FocusGroupChangedEventCallback(IntPtr current, bool forwardDirection); - private FocusGroupChangedEventCallback _focusGroupChangedEventCallback; - /// /// The FocusGroupChanged will be triggered when the focus group has been changed.
/// If the current focus group has a parent layout control, the FocusManager will make the best guess for the next focus group to move the focus to in the given direction (forward or backward).
@@ -327,98 +157,130 @@ namespace Tizen.NUI } } - private void OnFocusGroupChanged(IntPtr current, bool forwardDirection) - { - FocusGroupChangedEventArgs e = new FocusGroupChangedEventArgs(); - - e.CurrentView = Registry.GetManagedBaseHandleFromNativePtr(current) as View; - e.ForwardDirection = forwardDirection; - - if (_focusGroupChangedEventHandler != null) - { - _focusGroupChangedEventHandler(this, e); - } - } - - /// - /// Event arguments that passed via the FocusedViewEnterKey signal. + /// + /// The FocusedViewActivated will be triggered when the current focused view has the enter key pressed on it. /// /// 3 - public class FocusedViewActivatedEventArgs : EventArgs + public event EventHandler FocusedViewActivated { - private View _view; - - /// - /// View. - /// - /// 3 - public View View + add { - get + if (_focusedViewEnterKeyEventCallback == null) { - return _view; + _focusedViewEnterKeyEventCallback = OnFocusedViewEnterKey; + FocusedViewEnterKeySignal().Connect(_focusedViewEnterKeyEventCallback); } - set + _focusedViewEnterKeyEventHandler += value; + } + remove + { + _focusedViewEnterKeyEventHandler -= value; + + if (_focusedViewEnterKeyEventCallback != null && FocusedViewEnterKeySignal().Empty() == false) { - _view = value; + FocusedViewEnterKeySignal().Disconnect(_focusedViewEnterKeyEventCallback); } } } - private EventHandler _focusedViewEnterKeyEventHandler; - [UnmanagedFunctionPointer(CallingConvention.StdCall)] - private delegate void FocusedViewEnterKeyEventCallback(IntPtr view); - private FocusedViewEnterKeyEventCallback _focusedViewEnterKeyEventCallback; - /// - /// The FocusedViewActivated will be triggered when the current focused view has the enter key pressed on it. + /// [Obsolete("Please do not use! this will be deprecated")] /// /// 3 - public event EventHandler FocusedViewActivated + /// Please do not use! this will be deprecated! + /// Instead please use FocusedViewActivated. + [Obsolete("Please do not use! This will be deprecated! Please use FocusManager.FocusedViewActivated instead! " + + "Like: " + + "FocusManager.Instance.FocusedViewActivated = OnFocusedViewActivated; " + + "private void OnFocusedViewActivated(object source, FocusManager.FocusedViewActivatedEventArgs args) {...}")] + [EditorBrowsable(EditorBrowsableState.Never)] + public event EventHandler FocusedViewEnterKeyPressed { add { - if (_focusedViewEnterKeyEventCallback == null) + if (_focusedViewEnterKeyEventCallback2 == null) { - _focusedViewEnterKeyEventCallback = OnFocusedViewEnterKey; - FocusedViewEnterKeySignal().Connect(_focusedViewEnterKeyEventCallback); + _focusedViewEnterKeyEventCallback2 = OnFocusedViewEnterKey2; + FocusedViewEnterKeySignal().Connect(_focusedViewEnterKeyEventCallback2); } - _focusedViewEnterKeyEventHandler += value; + _focusedViewEnterKeyEventHandler2 += value; } remove { - _focusedViewEnterKeyEventHandler -= value; + _focusedViewEnterKeyEventHandler2 -= value; - if (_focusedViewEnterKeyEventCallback != null && FocusedViewEnterKeySignal().Empty() == false) + if (_focusedViewEnterKeyEventCallback2 != null && FocusedViewEnterKeySignal().Empty() == false) { - FocusedViewEnterKeySignal().Disconnect(_focusedViewEnterKeyEventCallback); + FocusedViewEnterKeySignal().Disconnect(_focusedViewEnterKeyEventCallback2); } } } - private void OnFocusedViewEnterKey(IntPtr view) + /// + /// ICustomFocusAlgorithm is used to provide the custom keyboard focus algorithm for retrieving the next focusable view.
+ /// The application can implement the interface and override the keyboard focus behavior.
+ /// If the focus is changing within a layout container, then the layout container is queried first to provide the next focusable view.
+ /// If this does not provide a valid view, then the Keyboard FocusManager will check focusable properties to determine the next focusable actor.
+ /// If focusable properties are not set, then the keyboard FocusManager calls the GetNextFocusableView() method of this interface.
+ ///
+ /// 3 + public interface ICustomFocusAlgorithm { - FocusedViewActivatedEventArgs e = new FocusedViewActivatedEventArgs(); - - e.View = Registry.GetManagedBaseHandleFromNativePtr(view) as View; + /// + /// Get the next focus actor. + /// + /// The current focus view. + /// The proposed focus view + /// The focus move direction + /// The next focus actor. + /// 3 + View GetNextFocusableView(View current, View proposed, View.FocusDirection direction); + } - if (_focusedViewEnterKeyEventHandler != null) + /// + /// Gets or sets the status of whether the focus movement should be looped within the same focus group.
+ /// The focus movement is not looped by default.
+ ///
+ /// 3 + public bool FocusGroupLoop + { + set { - _focusedViewEnterKeyEventHandler(this, e); + SetFocusGroupLoop(value); + } + get + { + return GetFocusGroupLoop(); } } - - internal FocusManager() : this(NDalicManualPINVOKE.new_FocusManager(), true) + /// + /// Gets or sets the focus indicator view.
+ /// This will replace the default focus indicator view in the FocusManager and will be added to the focused view as a highlight.
+ ///
+ /// 3 + public View FocusIndicator { - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + set + { + SetFocusIndicatorView(value); + } + get + { + return GetFocusIndicatorView(); + } } - internal static FocusManager Get() + /// + /// Gets the singleton of the FocusManager object. + /// + /// 3 + public static FocusManager Instance { - FocusManager ret = new FocusManager(NDalicManualPINVOKE.FocusManager_Get(), true); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; + get + { + return instance; + } } /// @@ -493,36 +355,6 @@ namespace Tizen.NUI } /// - /// Gets or sets the status of whether the focus movement should be looped within the same focus group.
- /// The focus movement is not looped by default.
- ///
- /// 3 - public bool FocusGroupLoop - { - set - { - SetFocusGroupLoop(value); - } - get - { - return GetFocusGroupLoop(); - } - } - - internal void SetFocusGroupLoop(bool enabled) - { - NDalicManualPINVOKE.FocusManager_SetFocusGroupLoop(swigCPtr, enabled); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - internal bool GetFocusGroupLoop() - { - bool ret = NDalicManualPINVOKE.FocusManager_GetFocusGroupLoop(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - /// /// Sets whether the view is a focus group that can limit the scope of the focus movement to its child views in the focus chain.
/// Layout controls set themselves as focus groups by default.
///
@@ -567,20 +399,42 @@ namespace Tizen.NUI } /// - /// Gets or sets the focus indicator view.
- /// This will replace the default focus indicator view in the FocusManager and will be added to the focused view as a highlight.
+ /// Provides the implementation of a custom focus algorithm interface to allow the application to define the focus logic.
///
+ /// The user's implementation of ICustomFocusAlgorithm. /// 3 - public View FocusIndicator + public void SetCustomAlgorithm(ICustomFocusAlgorithm arg0) { - set - { - SetFocusIndicatorView(value); - } - get - { - return GetFocusIndicatorView(); - } + _customAlgorithmInterfaceWrapper = new CustomAlgorithmInterfaceWrapper(); + _customAlgorithmInterfaceWrapper.SetFocusAlgorithm(arg0); + + NDalicPINVOKE.SetCustomAlgorithm(swigCPtr, CustomAlgorithmInterface.getCPtr(_customAlgorithmInterfaceWrapper)); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + internal static global::System.Runtime.InteropServices.HandleRef getCPtr(FocusManager obj) + { + return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; + } + + internal static FocusManager Get() + { + FocusManager ret = new FocusManager(NDalicManualPINVOKE.FocusManager_Get(), true); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + internal void SetFocusGroupLoop(bool enabled) + { + NDalicManualPINVOKE.FocusManager_SetFocusGroupLoop(swigCPtr, enabled); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + internal bool GetFocusGroupLoop() + { + bool ret = NDalicManualPINVOKE.FocusManager_GetFocusGroupLoop(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; } internal void SetFocusIndicatorView(View indicator) @@ -601,20 +455,6 @@ namespace Tizen.NUI return ret; } - /// - /// Provides the implementation of a custom focus algorithm interface to allow the application to define the focus logic.
- ///
- /// The user's implementation of ICustomFocusAlgorithm. - /// 3 - public void SetCustomAlgorithm(ICustomFocusAlgorithm arg0) - { - _customAlgorithmInterfaceWrapper = new CustomAlgorithmInterfaceWrapper(); - _customAlgorithmInterfaceWrapper.SetFocusAlgorithm(arg0); - - NDalicPINVOKE.SetCustomAlgorithm(swigCPtr, CustomAlgorithmInterface.getCPtr(_customAlgorithmInterfaceWrapper)); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - internal PreFocusChangeSignal PreFocusChangeSignal() { PreFocusChangeSignal ret = new PreFocusChangeSignal(NDalicManualPINVOKE.FocusManager_PreFocusChangeSignal(swigCPtr), false); @@ -643,74 +483,241 @@ namespace Tizen.NUI return ret; } - private static readonly FocusManager instance = FocusManager.Get(); + private IntPtr OnPreFocusChange(IntPtr current, IntPtr proposed, View.FocusDirection direction) + { + View view = null; + PreFocusChangeEventArgs e = new PreFocusChangeEventArgs(); + + if (current != global::System.IntPtr.Zero) + { + e.CurrentView = Registry.GetManagedBaseHandleFromNativePtr(current) as View; + } + if (proposed != global::System.IntPtr.Zero) + { + e.ProposedView = Registry.GetManagedBaseHandleFromNativePtr(proposed) as View; + } + e.Direction = direction; + + if (_preFocusChangeEventHandler != null) + { + view = _preFocusChangeEventHandler(this, e); + } + + if (view) + { + return view.GetPtrfromView(); + } + else + { + if (e.ProposedView) return proposed; + else return current; + } + } + + private void OnFocusChanged(IntPtr current, IntPtr next) + { + FocusChangedEventArgs e = new FocusChangedEventArgs(); + + e.CurrentView = Registry.GetManagedBaseHandleFromNativePtr(current) as View; + e.NextView = Registry.GetManagedBaseHandleFromNativePtr(next) as View; + + if (_focusChangedEventHandler != null) + { + _focusChangedEventHandler(this, e); + } + } + + private void OnFocusGroupChanged(IntPtr current, bool forwardDirection) + { + FocusGroupChangedEventArgs e = new FocusGroupChangedEventArgs(); + + e.CurrentView = Registry.GetManagedBaseHandleFromNativePtr(current) as View; + e.ForwardDirection = forwardDirection; + + if (_focusGroupChangedEventHandler != null) + { + _focusGroupChangedEventHandler(this, e); + } + } + + private void OnFocusedViewEnterKey(IntPtr view) + { + FocusedViewActivatedEventArgs e = new FocusedViewActivatedEventArgs(); + + e.View = Registry.GetManagedBaseHandleFromNativePtr(view) as View; + + if (_focusedViewEnterKeyEventHandler != null) + { + _focusedViewEnterKeyEventHandler(this, e); + } + } /// - /// Gets the singleton of the FocusManager object. + /// Please do not use! this will be deprecated! /// - /// 3 - public static FocusManager Instance + /// Please do not use! this will be deprecated! + /// Instead please use OnFocusedViewEnterKey. + [Obsolete("Please do not use! This will be deprecated! Please use FocusManager.OnFocusedViewEnterKey instead!")] + [EditorBrowsable(EditorBrowsableState.Never)] + private void OnFocusedViewEnterKey2(IntPtr view) { - get + FocusedViewActivatedEventArgs e = new FocusedViewActivatedEventArgs(); + + e.View = Registry.GetManagedBaseHandleFromNativePtr(view) as View; + + if (_focusedViewEnterKeyEventHandler != null) { - return instance; + _focusedViewEnterKeyEventHandler(this, e); } } - /// - /// ICustomFocusAlgorithm is used to provide the custom keyboard focus algorithm for retrieving the next focusable view.
- /// The application can implement the interface and override the keyboard focus behavior.
- /// If the focus is changing within a layout container, then the layout container is queried first to provide the next focusable view.
- /// If this does not provide a valid view, then the Keyboard FocusManager will check focusable properties to determine the next focusable actor.
- /// If focusable properties are not set, then the keyboard FocusManager calls the GetNextFocusableView() method of this interface.
+ /// + /// Event arguments that passed via the PreFocusChange signal. /// /// 3 - public interface ICustomFocusAlgorithm + public class PreFocusChangeEventArgs : EventArgs { + private View _current; + private View _proposed; + private View.FocusDirection _direction; + /// - /// Get the next focus actor. + /// The current focus view. /// - /// The current focus view. - /// The proposed focus view - /// The focus move direction - /// The next focus actor. /// 3 - View GetNextFocusableView(View current, View proposed, View.FocusDirection direction); + public View CurrentView + { + get + { + return _current; + } + set + { + _current = value; + } + } + + /// + /// The proposed view. + /// + /// 3 + public View ProposedView + { + get + { + return _proposed; + } + set + { + _proposed = value; + } + } + + /// + /// The focus move direction. + /// + /// 3 + public View.FocusDirection Direction + { + get + { + return _direction; + } + set + { + _direction = value; + } + } } - private class CustomAlgorithmInterfaceWrapper : CustomAlgorithmInterface + /// + /// Event arguments that passed via the FocusChanged signal. + /// + /// 3 + public class FocusChangedEventArgs : EventArgs { - private FocusManager.ICustomFocusAlgorithm _customFocusAlgorithm; + private View _current; + private View _next; - public CustomAlgorithmInterfaceWrapper() + /// + /// The current focus view. + /// + /// 3 + public View CurrentView { + get + { + return _current; + } + set + { + _current = value; + } } + /// + /// The next focus view. + /// + /// 3 + public View NextView + { + get + { + return _next; + } + set + { + _next = value; + } + } + } - public void SetFocusAlgorithm(FocusManager.ICustomFocusAlgorithm customFocusAlgorithm) + /// + /// Event arguments that passed via the FocusGroupChanged signal. + /// + /// 3 + public class FocusGroupChangedEventArgs : EventArgs + { + private View _current; + private bool _forwardDirection; + + /// + /// The current focus view. + /// + /// 3 + public View CurrentView { - _customFocusAlgorithm = customFocusAlgorithm; + get + { + return _current; + } + set + { + _current = value; + } } - public override View GetNextFocusableView(View current, View proposed, View.FocusDirection direction) + /// + /// The forward direction. + /// + /// 3 + public bool ForwardDirection { - return _customFocusAlgorithm.GetNextFocusableView(current, proposed, direction); + get + { + return _forwardDirection; + } + set + { + _forwardDirection = value; + } } } - - /// - /// Please do not use! this will be deprecated + /// + /// Event arguments that passed via the FocusedViewEnterKey signal. /// /// 3 - /// Please do not use! this will be deprecated. - /// Instead please use FocusedViewActivatedEventArgs. - [Obsolete("Please do not use! This will be deprecated! Please use FocusedViewActivatedEventArgs instead! " + - "Like: " + - "FocusManager.Instance.FocusedViewActivated = OnFocusedViewActivated; " + - "private void OnFocusedViewActivated(object source, FocusManager.FocusedViewActivatedEventArgs arg)" + - "{...}")] - [EditorBrowsable(EditorBrowsableState.Never)] - public class FocusedViewEnterKeyEventArgs : EventArgs + public class FocusedViewActivatedEventArgs : EventArgs { private View _view; @@ -731,61 +738,58 @@ namespace Tizen.NUI } } - private EventHandler _focusedViewEnterKeyEventHandler2; - [UnmanagedFunctionPointer(CallingConvention.StdCall)] - private delegate void FocusedViewEnterKeyEventCallback2(IntPtr view); - private FocusedViewEnterKeyEventCallback2 _focusedViewEnterKeyEventCallback2; - /// - /// [Obsolete("Please do not use! this will be deprecated")] + /// Please do not use! this will be deprecated /// /// 3 - /// Please do not use! this will be deprecated! - /// Instead please use FocusedViewActivated. - [Obsolete("Please do not use! This will be deprecated! Please use FocusManager.FocusedViewActivated instead! " + + /// Please do not use! this will be deprecated. + /// Instead please use FocusedViewActivatedEventArgs. + [Obsolete("Please do not use! This will be deprecated! Please use FocusedViewActivatedEventArgs instead! " + "Like: " + "FocusManager.Instance.FocusedViewActivated = OnFocusedViewActivated; " + - "private void OnFocusedViewActivated(object source, FocusManager.FocusedViewActivatedEventArgs args) {...}")] + "private void OnFocusedViewActivated(object source, FocusManager.FocusedViewActivatedEventArgs arg)" + + "{...}")] [EditorBrowsable(EditorBrowsableState.Never)] - public event EventHandler FocusedViewEnterKeyPressed + public class FocusedViewEnterKeyEventArgs : EventArgs { - add + private View _view; + + /// + /// View. + /// + /// 3 + public View View { - if (_focusedViewEnterKeyEventCallback2 == null) + get { - _focusedViewEnterKeyEventCallback2 = OnFocusedViewEnterKey2; - FocusedViewEnterKeySignal().Connect(_focusedViewEnterKeyEventCallback2); + return _view; } - _focusedViewEnterKeyEventHandler2 += value; - } - remove - { - _focusedViewEnterKeyEventHandler2 -= value; - - if (_focusedViewEnterKeyEventCallback2 != null && FocusedViewEnterKeySignal().Empty() == false) + set { - FocusedViewEnterKeySignal().Disconnect(_focusedViewEnterKeyEventCallback2); + _view = value; } } } - /// - /// Please do not use! this will be deprecated! - /// - /// Please do not use! this will be deprecated! - /// Instead please use OnFocusedViewEnterKey. - [Obsolete("Please do not use! This will be deprecated! Please use FocusManager.OnFocusedViewEnterKey instead!")] - [EditorBrowsable(EditorBrowsableState.Never)] - private void OnFocusedViewEnterKey2(IntPtr view) + private class CustomAlgorithmInterfaceWrapper : CustomAlgorithmInterface { - FocusedViewActivatedEventArgs e = new FocusedViewActivatedEventArgs(); + private FocusManager.ICustomFocusAlgorithm _customFocusAlgorithm; - e.View = Registry.GetManagedBaseHandleFromNativePtr(view) as View; + public CustomAlgorithmInterfaceWrapper() + { + } - if (_focusedViewEnterKeyEventHandler != null) + public void SetFocusAlgorithm(FocusManager.ICustomFocusAlgorithm customFocusAlgorithm) { - _focusedViewEnterKeyEventHandler(this, e); + _customFocusAlgorithm = customFocusAlgorithm; + } + + public override View GetNextFocusableView(View current, View proposed, View.FocusDirection direction) + { + return _customFocusAlgorithm.GetNextFocusableView(current, proposed, direction); } } + + } } \ No newline at end of file diff --git a/src/Tizen.NUI/src/public/FontClient.cs b/src/Tizen.NUI/src/public/FontClient.cs index 9744511..9281f14 100755 --- a/src/Tizen.NUI/src/public/FontClient.cs +++ b/src/Tizen.NUI/src/public/FontClient.cs @@ -22,6 +22,8 @@ namespace Tizen.NUI /// 5 public class FontClient : BaseHandle { + + private static readonly FontClient instance = FontClient.Get(); private global::System.Runtime.InteropServices.HandleRef swigCPtr; internal FontClient(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicManualPINVOKE.FontClient_SWIGUpcast(cPtr), cMemoryOwn) @@ -29,9 +31,14 @@ namespace Tizen.NUI swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); } - internal static global::System.Runtime.InteropServices.HandleRef getCPtr(FontClient obj) + internal FontClient() : this(NDalicManualPINVOKE.new_FontClient__SWIG_0(), true) { - return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + internal FontClient(FontClient handle) : this(NDalicManualPINVOKE.new_FontClient__SWIG_1(FontClient.getCPtr(handle)), true) + { + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } internal static uint DefaultPointSize @@ -44,156 +51,6 @@ namespace Tizen.NUI } } - internal class GlyphBufferData : global::System.IDisposable - { - private global::System.Runtime.InteropServices.HandleRef swigCPtr; - protected bool swigCMemOwn; - - internal GlyphBufferData(global::System.IntPtr cPtr, bool cMemoryOwn) - { - swigCMemOwn = cMemoryOwn; - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); - } - - internal static global::System.Runtime.InteropServices.HandleRef getCPtr(GlyphBufferData obj) - { - return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; - } - - //A Flag to check who called Dispose(). (By User or DisposeQueue) - private bool isDisposeQueued = false; - /// - /// A Flat to check if it is already disposed. - /// - protected bool disposed = false; - - ~GlyphBufferData() - { - if (!isDisposeQueued) - { - isDisposeQueued = true; - DisposeQueue.Instance.Add(this); - } - } - - public void Dispose() - { - //Throw excpetion if Dispose() is called in separate thread. - if (!Window.IsInstalled()) - { - throw new System.InvalidOperationException("This API called from separate thread. This API must be called from MainThread."); - } - - if (isDisposeQueued) - { - Dispose(DisposeTypes.Implicit); - } - else - { - Dispose(DisposeTypes.Explicit); - System.GC.SuppressFinalize(this); - } - } - - protected virtual void Dispose(DisposeTypes type) - { - if (disposed) - { - return; - } - - if (type == DisposeTypes.Explicit) - { - //Called by User. - //Release your own managed resources here. - //You should release all of your own disposable objects here. - } - - //Release your own unmanaged resources here. - //You should not access any managed member here except static instance. - //Because the execution order of Finalizes is non-deterministic. - - if (swigCPtr.Handle != global::System.IntPtr.Zero) - { - if (swigCMemOwn) - { - swigCMemOwn = false; - NDalicManualPINVOKE.delete_FontClient_GlyphBufferData(swigCPtr); - } - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); - } - disposed = true; - } - - public GlyphBufferData() : this(NDalicManualPINVOKE.new_FontClient_GlyphBufferData(), true) - { - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - /*public byte[] Buffer - { - set - { - NDalicManualPINVOKE.FontClient_GlyphBufferData_buffer_set(swigCPtr, value); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - get - { - global::System.IntPtr cPtr = NDalicManualPINVOKE.FontClient_GlyphBufferData_buffer_get(swigCPtr); - SWIGTYPE_p_unsigned_char ret = (cPtr == global::System.IntPtr.Zero) ? null : new SWIGTYPE_p_unsigned_char(cPtr, false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - }*/ - - public uint Width - { - set - { - NDalicManualPINVOKE.FontClient_GlyphBufferData_width_set(swigCPtr, value); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - get - { - uint ret = NDalicManualPINVOKE.FontClient_GlyphBufferData_width_get(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - } - - public uint Height - { - set - { - NDalicManualPINVOKE.FontClient_GlyphBufferData_height_set(swigCPtr, value); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - get - { - uint ret = NDalicManualPINVOKE.FontClient_GlyphBufferData_height_get(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - } - - public PixelFormat Format - { - set - { - NDalicManualPINVOKE.FontClient_GlyphBufferData_format_set(swigCPtr, (int)value); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - get - { - PixelFormat ret = (PixelFormat)NDalicManualPINVOKE.FontClient_GlyphBufferData_format_get(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - } - - } - private static readonly FontClient instance = FontClient.Get(); - /// /// Gets the singleton pattern of the FontClient object. /// @@ -206,49 +63,6 @@ namespace Tizen.NUI } } - internal static FontClient Get() - { - FontClient ret = new FontClient(NDalicManualPINVOKE.FontClient_Get(), true); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - internal FontClient() : this(NDalicManualPINVOKE.new_FontClient__SWIG_0(), true) - { - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - internal FontClient(FontClient handle) : this(NDalicManualPINVOKE.new_FontClient__SWIG_1(FontClient.getCPtr(handle)), true) - { - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - internal FontClient Assign(FontClient handle) - { - FontClient ret = new FontClient(NDalicManualPINVOKE.FontClient_Assign(swigCPtr, FontClient.getCPtr(handle)), false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - internal void SetDpi(uint horizontalDpi, uint verticalDpi) - { - NDalicManualPINVOKE.FontClient_SetDpi(swigCPtr, horizontalDpi, verticalDpi); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - internal void GetDpi(SWIGTYPE_p_unsigned_int horizontalDpi, SWIGTYPE_p_unsigned_int verticalDpi) - { - NDalicManualPINVOKE.FontClient_GetDpi(swigCPtr, SWIGTYPE_p_unsigned_int.getCPtr(horizontalDpi), SWIGTYPE_p_unsigned_int.getCPtr(verticalDpi)); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - internal int GetDefaultFontSize() - { - int ret = NDalicManualPINVOKE.FontClient_GetDefaultFontSize(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - /// /// Called when the user changes the system defaults. /// @@ -259,30 +73,6 @@ namespace Tizen.NUI if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } - internal void GetDefaultFonts(SWIGTYPE_p_std__vectorT_Dali__TextAbstraction__FontDescription_t defaultFonts) - { - NDalicManualPINVOKE.FontClient_GetDefaultFonts(swigCPtr, SWIGTYPE_p_std__vectorT_Dali__TextAbstraction__FontDescription_t.getCPtr(defaultFonts)); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - internal void GetDefaultPlatformFontDescription(FontDescription fontDescription) - { - NDalicManualPINVOKE.FontClient_GetDefaultPlatformFontDescription(swigCPtr, FontDescription.getCPtr(fontDescription)); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - internal void GetSystemFonts(SWIGTYPE_p_std__vectorT_Dali__TextAbstraction__FontDescription_t systemFonts) - { - NDalicManualPINVOKE.FontClient_GetSystemFonts(swigCPtr, SWIGTYPE_p_std__vectorT_Dali__TextAbstraction__FontDescription_t.getCPtr(systemFonts)); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - internal void GetDescription(uint id, FontDescription fontDescription) - { - NDalicManualPINVOKE.FontClient_GetDescription(swigCPtr, id, FontDescription.getCPtr(fontDescription)); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - /// /// Retrieves the font point size of a given font id. /// @@ -352,27 +142,6 @@ namespace Tizen.NUI return ret; } - internal uint FindFallbackFont(uint charcode, FontDescription preferredFontDescription, uint requestedPointSize, bool preferColor) - { - uint ret = NDalicManualPINVOKE.FontClient_FindFallbackFont__SWIG_0(swigCPtr, charcode, FontDescription.getCPtr(preferredFontDescription), requestedPointSize, preferColor); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - internal uint FindFallbackFont(uint charcode, FontDescription preferredFontDescription, uint requestedPointSize) - { - uint ret = NDalicManualPINVOKE.FontClient_FindFallbackFont__SWIG_1(swigCPtr, charcode, FontDescription.getCPtr(preferredFontDescription), requestedPointSize); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - internal uint FindFallbackFont(uint charcode, FontDescription preferredFontDescription) - { - uint ret = NDalicManualPINVOKE.FontClient_FindFallbackFont__SWIG_2(swigCPtr, charcode, FontDescription.getCPtr(preferredFontDescription)); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - /// /// Retrieve the unique identifier for a font. /// @@ -415,36 +184,132 @@ namespace Tizen.NUI return ret; } - internal uint GetFontId(FontDescription preferredFontDescription, uint requestedPointSize, uint faceIndex) - { - uint ret = NDalicManualPINVOKE.FontClient_GetFontId__SWIG_3(swigCPtr, FontDescription.getCPtr(preferredFontDescription), requestedPointSize, faceIndex); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - internal uint GetFontId(FontDescription preferredFontDescription, uint requestedPointSize) + /// + /// Check to see if a font is scalable. + /// + /// The path where the font file is located. + /// True if scalable. + /// 5 + public bool IsScalable(string path) { - uint ret = NDalicManualPINVOKE.FontClient_GetFontId__SWIG_4(swigCPtr, FontDescription.getCPtr(preferredFontDescription), requestedPointSize); + bool ret = NDalicManualPINVOKE.FontClient_IsScalable__SWIG_0(swigCPtr, path); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } - internal uint GetFontId(FontDescription preferredFontDescription) + /// + /// Adds custom fonts directory. + /// + /// Path to the fonts directory. + /// True if the fonts can be added. + /// 5 + public bool AddCustomFontDirectory(string path) { - uint ret = NDalicManualPINVOKE.FontClient_GetFontId__SWIG_5(swigCPtr, FontDescription.getCPtr(preferredFontDescription)); + bool ret = NDalicManualPINVOKE.FontClient_AddCustomFontDirectory(swigCPtr, path); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } - /// - /// Check to see if a font is scalable. - /// - /// The path where the font file is located. - /// True if scalable. - /// 5 - public bool IsScalable(string path) + internal static global::System.Runtime.InteropServices.HandleRef getCPtr(FontClient obj) { - bool ret = NDalicManualPINVOKE.FontClient_IsScalable__SWIG_0(swigCPtr, path); + return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; + } + + internal static FontClient Get() + { + FontClient ret = new FontClient(NDalicManualPINVOKE.FontClient_Get(), true); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + internal FontClient Assign(FontClient handle) + { + FontClient ret = new FontClient(NDalicManualPINVOKE.FontClient_Assign(swigCPtr, FontClient.getCPtr(handle)), false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + internal void SetDpi(uint horizontalDpi, uint verticalDpi) + { + NDalicManualPINVOKE.FontClient_SetDpi(swigCPtr, horizontalDpi, verticalDpi); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + internal void GetDpi(SWIGTYPE_p_unsigned_int horizontalDpi, SWIGTYPE_p_unsigned_int verticalDpi) + { + NDalicManualPINVOKE.FontClient_GetDpi(swigCPtr, SWIGTYPE_p_unsigned_int.getCPtr(horizontalDpi), SWIGTYPE_p_unsigned_int.getCPtr(verticalDpi)); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + internal int GetDefaultFontSize() + { + int ret = NDalicManualPINVOKE.FontClient_GetDefaultFontSize(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + internal void GetDefaultFonts(SWIGTYPE_p_std__vectorT_Dali__TextAbstraction__FontDescription_t defaultFonts) + { + NDalicManualPINVOKE.FontClient_GetDefaultFonts(swigCPtr, SWIGTYPE_p_std__vectorT_Dali__TextAbstraction__FontDescription_t.getCPtr(defaultFonts)); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + internal void GetDefaultPlatformFontDescription(FontDescription fontDescription) + { + NDalicManualPINVOKE.FontClient_GetDefaultPlatformFontDescription(swigCPtr, FontDescription.getCPtr(fontDescription)); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + internal void GetSystemFonts(SWIGTYPE_p_std__vectorT_Dali__TextAbstraction__FontDescription_t systemFonts) + { + NDalicManualPINVOKE.FontClient_GetSystemFonts(swigCPtr, SWIGTYPE_p_std__vectorT_Dali__TextAbstraction__FontDescription_t.getCPtr(systemFonts)); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + internal void GetDescription(uint id, FontDescription fontDescription) + { + NDalicManualPINVOKE.FontClient_GetDescription(swigCPtr, id, FontDescription.getCPtr(fontDescription)); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + internal uint FindFallbackFont(uint charcode, FontDescription preferredFontDescription, uint requestedPointSize, bool preferColor) + { + uint ret = NDalicManualPINVOKE.FontClient_FindFallbackFont__SWIG_0(swigCPtr, charcode, FontDescription.getCPtr(preferredFontDescription), requestedPointSize, preferColor); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + internal uint FindFallbackFont(uint charcode, FontDescription preferredFontDescription, uint requestedPointSize) + { + uint ret = NDalicManualPINVOKE.FontClient_FindFallbackFont__SWIG_1(swigCPtr, charcode, FontDescription.getCPtr(preferredFontDescription), requestedPointSize); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + internal uint FindFallbackFont(uint charcode, FontDescription preferredFontDescription) + { + uint ret = NDalicManualPINVOKE.FontClient_FindFallbackFont__SWIG_2(swigCPtr, charcode, FontDescription.getCPtr(preferredFontDescription)); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + internal uint GetFontId(FontDescription preferredFontDescription, uint requestedPointSize, uint faceIndex) + { + uint ret = NDalicManualPINVOKE.FontClient_GetFontId__SWIG_3(swigCPtr, FontDescription.getCPtr(preferredFontDescription), requestedPointSize, faceIndex); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + internal uint GetFontId(FontDescription preferredFontDescription, uint requestedPointSize) + { + uint ret = NDalicManualPINVOKE.FontClient_GetFontId__SWIG_4(swigCPtr, FontDescription.getCPtr(preferredFontDescription), requestedPointSize); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + internal uint GetFontId(FontDescription preferredFontDescription) + { + uint ret = NDalicManualPINVOKE.FontClient_GetFontId__SWIG_5(swigCPtr, FontDescription.getCPtr(preferredFontDescription)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } @@ -528,17 +393,152 @@ namespace Tizen.NUI return ret; } - /// - /// Adds custom fonts directory. - /// - /// Path to the fonts directory. - /// True if the fonts can be added. - /// 5 - public bool AddCustomFontDirectory(string path) + internal class GlyphBufferData : global::System.IDisposable { - bool ret = NDalicManualPINVOKE.FontClient_AddCustomFontDirectory(swigCPtr, path); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; + protected bool swigCMemOwn; + /// + /// A Flat to check if it is already disposed. + /// + protected bool disposed = false; + + private global::System.Runtime.InteropServices.HandleRef swigCPtr; + //A Flag to check who called Dispose(). (By User or DisposeQueue) + private bool isDisposeQueued = false; + + public GlyphBufferData() : this(NDalicManualPINVOKE.new_FontClient_GlyphBufferData(), true) + { + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + internal GlyphBufferData(global::System.IntPtr cPtr, bool cMemoryOwn) + { + swigCMemOwn = cMemoryOwn; + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); + } + + ~GlyphBufferData() + { + if (!isDisposeQueued) + { + isDisposeQueued = true; + DisposeQueue.Instance.Add(this); + } + } + + /*public byte[] Buffer + { + set + { + NDalicManualPINVOKE.FontClient_GlyphBufferData_buffer_set(swigCPtr, value); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + get + { + global::System.IntPtr cPtr = NDalicManualPINVOKE.FontClient_GlyphBufferData_buffer_get(swigCPtr); + SWIGTYPE_p_unsigned_char ret = (cPtr == global::System.IntPtr.Zero) ? null : new SWIGTYPE_p_unsigned_char(cPtr, false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + }*/ + + public uint Width + { + set + { + NDalicManualPINVOKE.FontClient_GlyphBufferData_width_set(swigCPtr, value); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + get + { + uint ret = NDalicManualPINVOKE.FontClient_GlyphBufferData_width_get(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + } + + public uint Height + { + set + { + NDalicManualPINVOKE.FontClient_GlyphBufferData_height_set(swigCPtr, value); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + get + { + uint ret = NDalicManualPINVOKE.FontClient_GlyphBufferData_height_get(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + } + + public PixelFormat Format + { + set + { + NDalicManualPINVOKE.FontClient_GlyphBufferData_format_set(swigCPtr, (int)value); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + get + { + PixelFormat ret = (PixelFormat)NDalicManualPINVOKE.FontClient_GlyphBufferData_format_get(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + } + + public void Dispose() + { + //Throw excpetion if Dispose() is called in separate thread. + if (!Window.IsInstalled()) + { + throw new System.InvalidOperationException("This API called from separate thread. This API must be called from MainThread."); + } + + if (isDisposeQueued) + { + Dispose(DisposeTypes.Implicit); + } + else + { + Dispose(DisposeTypes.Explicit); + System.GC.SuppressFinalize(this); + } + } + + internal static global::System.Runtime.InteropServices.HandleRef getCPtr(GlyphBufferData obj) + { + return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; + } + + protected virtual void Dispose(DisposeTypes type) + { + if (disposed) + { + return; + } + + if (type == DisposeTypes.Explicit) + { + //Called by User. + //Release your own managed resources here. + //You should release all of your own disposable objects here. + } + + //Release your own unmanaged resources here. + //You should not access any managed member here except static instance. + //Because the execution order of Finalizes is non-deterministic. + + if (swigCPtr.Handle != global::System.IntPtr.Zero) + { + if (swigCMemOwn) + { + swigCMemOwn = false; + NDalicManualPINVOKE.delete_FontClient_GlyphBufferData(swigCPtr); + } + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); + } + disposed = true; + } } } } diff --git a/src/Tizen.NUI/src/public/Geometry.cs b/src/Tizen.NUI/src/public/Geometry.cs index 172d719..65358da 100755 --- a/src/Tizen.NUI/src/public/Geometry.cs +++ b/src/Tizen.NUI/src/public/Geometry.cs @@ -26,60 +26,63 @@ namespace Tizen.NUI { private global::System.Runtime.InteropServices.HandleRef swigCPtr; - internal Geometry(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.Geometry_SWIGUpcast(cPtr), cMemoryOwn) + /// + /// Create an instance of Geometry. + /// + /// 3 + public Geometry() : this(NDalicPINVOKE.Geometry_New(), true) { - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } - internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Geometry obj) + internal Geometry(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.Geometry_SWIGUpcast(cPtr), cMemoryOwn) { - return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); } /// - /// Dispose. + /// Enumeration for the description of the type of geometry, + /// used to determine how the coordinates will be used. /// + /// Type of primitives this geometry contains. /// 3 - protected override void Dispose(DisposeTypes type) + public enum Type { - if (disposed) - { - return; - } - - if (type == DisposeTypes.Explicit) - { - //Called by User - //Release your own managed resources here. - //You should release all of your own disposable objects here. + /// + /// Individual points. + /// + POINTS, - } + /// + /// Individual lines (made of 2 points each). + /// + LINES, - //Release your own unmanaged resources here. - //You should not access any managed member here except static instance. - //because the execution order of Finalizes is non-deterministic. + /// + /// A strip of lines (made of 1 point each) which also joins the first and last point. + /// + LINE_LOOP, - if (swigCPtr.Handle != global::System.IntPtr.Zero) - { - if (swigCMemOwn) - { - swigCMemOwn = false; - NDalicPINVOKE.delete_Geometry(swigCPtr); - } - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); - } + /// + /// A strip of lines (made of 1 point each). + /// + LINE_STRIP, - base.Dispose(type); - } + /// + /// Individual triangles (made of 3 points each). + /// + TRIANGLES, - /// - /// Create an instance of Geometry. - /// - /// 3 - public Geometry() : this(NDalicPINVOKE.Geometry_New(), true) - { - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + /// + /// A fan of triangles around a centre point (after the first triangle, following triangles need only 1 point). + /// + TRIANGLE_FAN, + /// + /// A strip of triangles (after the first triangle, following triangles need only 1 point). + /// + TRIANGLE_STRIP } /// @@ -154,50 +157,46 @@ namespace Tizen.NUI return ret; } + internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Geometry obj) + { + return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; + } + /// - /// Enumeration for the description of the type of geometry, - /// used to determine how the coordinates will be used. + /// Dispose. /// - /// Type of primitives this geometry contains. /// 3 - public enum Type + protected override void Dispose(DisposeTypes type) { - /// - /// Individual points. - /// - POINTS, - - /// - /// Individual lines (made of 2 points each). - /// - LINES, + if (disposed) + { + return; + } - /// - /// A strip of lines (made of 1 point each) which also joins the first and last point. - /// - LINE_LOOP, + if (type == DisposeTypes.Explicit) + { + //Called by User + //Release your own managed resources here. + //You should release all of your own disposable objects here. - /// - /// A strip of lines (made of 1 point each). - /// - LINE_STRIP, + } - /// - /// Individual triangles (made of 3 points each). - /// - TRIANGLES, + //Release your own unmanaged resources here. + //You should not access any managed member here except static instance. + //because the execution order of Finalizes is non-deterministic. - /// - /// A fan of triangles around a centre point (after the first triangle, following triangles need only 1 point). - /// - TRIANGLE_FAN, + if (swigCPtr.Handle != global::System.IntPtr.Zero) + { + if (swigCMemOwn) + { + swigCMemOwn = false; + NDalicPINVOKE.delete_Geometry(swigCPtr); + } + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); + } - /// - /// A strip of triangles (after the first triangle, following triangles need only 1 point). - /// - TRIANGLE_STRIP + base.Dispose(type); } } - } \ No newline at end of file diff --git a/src/Tizen.NUI/src/public/Gesture.cs b/src/Tizen.NUI/src/public/Gesture.cs index 1f57eed..37de914 100755 --- a/src/Tizen.NUI/src/public/Gesture.cs +++ b/src/Tizen.NUI/src/public/Gesture.cs @@ -26,31 +26,38 @@ namespace Tizen.NUI /// 3 public class Gesture : global::System.IDisposable { - private global::System.Runtime.InteropServices.HandleRef swigCPtr; /// /// swigCMemOwn. /// /// 3 protected bool swigCMemOwn; - internal Gesture(global::System.IntPtr cPtr, bool cMemoryOwn) - { - swigCMemOwn = cMemoryOwn; - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); - } + /// + /// A Flat to check if it is already disposed. + /// + /// 3 + protected bool disposed = false; - internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Gesture obj) - { - return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; - } + private global::System.Runtime.InteropServices.HandleRef swigCPtr; //A Flag to check who called Dispose(). (By User or DisposeQueue) private bool isDisposeQueued = false; + /// - /// A Flat to check if it is already disposed. + /// The Copy constructor. /// + /// A reference to the copied handle /// 3 - protected bool disposed = false; + public Gesture(Gesture rhs) : this(NDalicPINVOKE.new_Gesture(Gesture.getCPtr(rhs)), true) + { + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + internal Gesture(global::System.IntPtr cPtr, bool cMemoryOwn) + { + swigCMemOwn = cMemoryOwn; + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); + } /// /// Dispose. @@ -66,63 +73,71 @@ namespace Tizen.NUI } /// - /// Dispose. + /// Enumeration for type of gesture. /// /// 3 - public void Dispose() + public enum GestureType { - //Throw excpetion if Dispose() is called in separate thread. - if (!Window.IsInstalled()) - { - throw new System.InvalidOperationException("This API called from separate thread. This API must be called from MainThread."); - } - - if (isDisposeQueued) - { - Dispose(DisposeTypes.Implicit); - } - else - { - Dispose(DisposeTypes.Explicit); - System.GC.SuppressFinalize(this); - } + /// + /// When two touch points move away or towards each other. + /// + /// 3 + Pinch = 1 << 0, + /// + /// When the user drags their finger(s) in a particular direction. + /// + /// 3 + Pan = 1 << 1, + /// + /// When the user taps the screen. + /// + /// 3 + Tap = 1 << 2, + /// + /// When the user continues to touch the same area on the screen for the device configured time. + /// + /// 3 + LongPress = 1 << 3 } /// - /// Dispose. + /// Enumeration for state of the gesture. /// /// 3 - protected virtual void Dispose(DisposeTypes type) + public enum StateType { - if (disposed) - { - return; - } - - if(type == DisposeTypes.Explicit) - { - //Called by User - //Release your own managed resources here. - //You should release all of your own disposable objects here. - } - - //Release your own unmanaged resources here. - //You should not access any managed member here except static instance. - //because the execution order of Finalizes is non-deterministic. - - if (swigCPtr.Handle != global::System.IntPtr.Zero) - { - if (swigCMemOwn) - { - swigCMemOwn = false; - NDalicPINVOKE.delete_Gesture(swigCPtr); - } - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); - } - disposed = true; + /// + /// There is no state associated with this gesture. + /// + /// 3 + Clear, + /// + /// The touched points on the screen have moved enough to be considered a gesture. + /// + /// 3 + Started, + /// + /// The gesture is continuing. + /// + /// 3 + Continuing, + /// + /// The user has lifted a finger or touched an additional point on the screen. + /// + /// 3 + Finished, + /// + /// The gesture has been cancelled. + /// + /// 3 + Cancelled, + /// + /// A gesture is possible. + /// + /// 3 + Possible } - /// /// The gesture type. /// @@ -159,16 +174,6 @@ namespace Tizen.NUI } } - /// - /// The Copy constructor. - /// - /// A reference to the copied handle - /// 3 - public Gesture(Gesture rhs) : this(NDalicPINVOKE.new_Gesture(Gesture.getCPtr(rhs)), true) - { - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - private Gesture.GestureType type { set @@ -215,71 +220,65 @@ namespace Tizen.NUI } /// - /// Enumeration for type of gesture. + /// Dispose. /// /// 3 - public enum GestureType + public void Dispose() { - /// - /// When two touch points move away or towards each other. - /// - /// 3 - Pinch = 1 << 0, - /// - /// When the user drags their finger(s) in a particular direction. - /// - /// 3 - Pan = 1 << 1, - /// - /// When the user taps the screen. - /// - /// 3 - Tap = 1 << 2, - /// - /// When the user continues to touch the same area on the screen for the device configured time. - /// - /// 3 - LongPress = 1 << 3 + //Throw excpetion if Dispose() is called in separate thread. + if (!Window.IsInstalled()) + { + throw new System.InvalidOperationException("This API called from separate thread. This API must be called from MainThread."); + } + + if (isDisposeQueued) + { + Dispose(DisposeTypes.Implicit); + } + else + { + Dispose(DisposeTypes.Explicit); + System.GC.SuppressFinalize(this); + } + } + + internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Gesture obj) + { + return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; } /// - /// Enumeration for state of the gesture. + /// Dispose. /// /// 3 - public enum StateType + protected virtual void Dispose(DisposeTypes type) { - /// - /// There is no state associated with this gesture. - /// - /// 3 - Clear, - /// - /// The touched points on the screen have moved enough to be considered a gesture. - /// - /// 3 - Started, - /// - /// The gesture is continuing. - /// - /// 3 - Continuing, - /// - /// The user has lifted a finger or touched an additional point on the screen. - /// - /// 3 - Finished, - /// - /// The gesture has been cancelled. - /// - /// 3 - Cancelled, - /// - /// A gesture is possible. - /// - /// 3 - Possible - } + if (disposed) + { + return; + } - } + if (type == DisposeTypes.Explicit) + { + //Called by User + //Release your own managed resources here. + //You should release all of your own disposable objects here. + } + + //Release your own unmanaged resources here. + //You should not access any managed member here except static instance. + //because the execution order of Finalizes is non-deterministic. + if (swigCPtr.Handle != global::System.IntPtr.Zero) + { + if (swigCMemOwn) + { + swigCMemOwn = false; + NDalicPINVOKE.delete_Gesture(swigCPtr); + } + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); + } + disposed = true; + } + } } \ No newline at end of file diff --git a/src/Tizen.NUI/src/public/GestureDetector.cs b/src/Tizen.NUI/src/public/GestureDetector.cs index c46e4d7..d598942 100755 --- a/src/Tizen.NUI/src/public/GestureDetector.cs +++ b/src/Tizen.NUI/src/public/GestureDetector.cs @@ -31,54 +31,6 @@ namespace Tizen.NUI { private global::System.Runtime.InteropServices.HandleRef swigCPtr; - internal GestureDetector(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.GestureDetector_SWIGUpcast(cPtr), cMemoryOwn) - { - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); - } - - internal static global::System.Runtime.InteropServices.HandleRef getCPtr(GestureDetector obj) - { - return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; - } - - /// - /// Dispose. - /// - /// The dispose type - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - protected override void Dispose(DisposeTypes type) - { - if (disposed) - { - return; - } - - if (type == DisposeTypes.Explicit) - { - //Called by User - //Release your own managed resources here. - //You should release all of your own disposable objects here. - - } - - //Release your own unmanaged resources here. - //You should not access any managed member here except static instance. - //because the execution order of Finalizes is non-deterministic. - - if (swigCPtr.Handle != global::System.IntPtr.Zero) - { - if (swigCMemOwn) - { - swigCMemOwn = false; - NDalicPINVOKE.delete_GestureDetector(swigCPtr); - } - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); - } - - base.Dispose(type); - } - /// /// Constructor. Creates an uninitialized GestureDetector. /// @@ -89,13 +41,6 @@ namespace Tizen.NUI if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } - internal static GestureDetector DownCast(BaseHandle handle) - { - GestureDetector ret = Registry.GetManagedBaseHandleFromNativePtr(handle) as GestureDetector; - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - /// /// Constructor. /// @@ -107,11 +52,9 @@ namespace Tizen.NUI if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } - internal GestureDetector Assign(GestureDetector rhs) + internal GestureDetector(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.GestureDetector_SWIGUpcast(cPtr), cMemoryOwn) { - GestureDetector ret = new GestureDetector(NDalicPINVOKE.GestureDetector_Assign(swigCPtr, GestureDetector.getCPtr(rhs)), false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); } /// @@ -176,6 +119,61 @@ namespace Tizen.NUI return ret; } - } + internal GestureDetector Assign(GestureDetector rhs) + { + GestureDetector ret = new GestureDetector(NDalicPINVOKE.GestureDetector_Assign(swigCPtr, GestureDetector.getCPtr(rhs)), false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + internal static GestureDetector DownCast(BaseHandle handle) + { + GestureDetector ret = Registry.GetManagedBaseHandleFromNativePtr(handle) as GestureDetector; + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + internal static global::System.Runtime.InteropServices.HandleRef getCPtr(GestureDetector obj) + { + return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; + } + + /// + /// Dispose. + /// + /// The dispose type + /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + protected override void Dispose(DisposeTypes type) + { + if (disposed) + { + return; + } + if (type == DisposeTypes.Explicit) + { + //Called by User + //Release your own managed resources here. + //You should release all of your own disposable objects here. + + } + + //Release your own unmanaged resources here. + //You should not access any managed member here except static instance. + //because the execution order of Finalizes is non-deterministic. + + if (swigCPtr.Handle != global::System.IntPtr.Zero) + { + if (swigCMemOwn) + { + swigCMemOwn = false; + NDalicPINVOKE.delete_GestureDetector(swigCPtr); + } + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); + } + + base.Dispose(type); + } + } } diff --git a/src/Tizen.NUI/src/public/Hover.cs b/src/Tizen.NUI/src/public/Hover.cs index cd99841..03dec8a 100755 --- a/src/Tizen.NUI/src/public/Hover.cs +++ b/src/Tizen.NUI/src/public/Hover.cs @@ -15,9 +15,10 @@ * */ +using Tizen.NUI.BaseComponents; + namespace Tizen.NUI { - using Tizen.NUI.BaseComponents; /// /// Hover events are a collection of points at a specific moment in time.
/// When a multi-event occurs, each point represents the points that are currently being @@ -26,31 +27,46 @@ namespace Tizen.NUI /// 3 public class Hover : global::System.IDisposable { - private global::System.Runtime.InteropServices.HandleRef swigCPtr; /// /// swigCMemOwn /// /// 3 protected bool swigCMemOwn; - internal Hover(global::System.IntPtr cPtr, bool cMemoryOwn) - { - swigCMemOwn = cMemoryOwn; - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); - } + /// + /// A Flat to check if it is already disposed. + /// + /// 3 + protected bool disposed = false; - internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Hover obj) - { - return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; - } + private global::System.Runtime.InteropServices.HandleRef swigCPtr; //A Flag to check who called Dispose(). (By User or DisposeQueue) private bool isDisposeQueued = false; + /// - /// A Flat to check if it is already disposed. + /// The default constructor. /// /// 3 - protected bool disposed = false; + public Hover() : this(NDalicPINVOKE.new_Hover__SWIG_0(), true) + { + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + /// + /// The constructor. + /// + /// The time the event occurred. + internal Hover(uint time) : this(NDalicPINVOKE.new_Hover__SWIG_1(time), true) + { + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + internal Hover(global::System.IntPtr cPtr, bool cMemoryOwn) + { + swigCMemOwn = cMemoryOwn; + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); + } /// /// Dispose. @@ -66,79 +82,45 @@ namespace Tizen.NUI } /// - /// Dispose. + /// The time (in ms) that the hover event occurred. /// /// 3 - public void Dispose() + public uint Time { - //Throw excpetion if Dispose() is called in separate thread. - if (!Window.IsInstalled()) - { - throw new System.InvalidOperationException("This API called from separate thread. This API must be called from MainThread."); - } - - if (isDisposeQueued) - { - Dispose(DisposeTypes.Implicit); - } - else + get { - Dispose(DisposeTypes.Explicit); - System.GC.SuppressFinalize(this); + return time; } } - /// - /// Dispose. - /// - /// 3 - protected virtual void Dispose(DisposeTypes type) + private TouchPointContainer points { - if (disposed) - { - return; - } - - if(type == DisposeTypes.Explicit) + set { - //Called by User - //Release your own managed resources here. - //You should release all of your own disposable objects here. + NDalicPINVOKE.Hover_points_set(swigCPtr, TouchPointContainer.getCPtr(value)); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } - - //Release your own unmanaged resources here. - //You should not access any managed member here except static instance. - //because the execution order of Finalizes is non-deterministic. - - if (swigCPtr.Handle != global::System.IntPtr.Zero) + get { - if (swigCMemOwn) - { - swigCMemOwn = false; - NDalicPINVOKE.delete_Hover(swigCPtr); - } - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); + global::System.IntPtr cPtr = NDalicPINVOKE.Hover_points_get(swigCPtr); + TouchPointContainer ret = (cPtr == global::System.IntPtr.Zero) ? null : new TouchPointContainer(cPtr, false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; } - disposed = true; } - - internal static Hover GetHoverFromPtr(global::System.IntPtr cPtr) - { - Hover ret = new Hover(cPtr, false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - /// - /// The time (in ms) that the hover event occurred. - /// - /// 3 - public uint Time + private uint time { + set + { + NDalicPINVOKE.Hover_time_set(swigCPtr, value); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } get { - return time; + uint ret = NDalicPINVOKE.Hover_time_get(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; } } @@ -226,62 +208,48 @@ namespace Tizen.NUI } /// - /// The default constructor. + /// Returns the total number of points. /// + /// Total number of points. /// 3 - public Hover() : this(NDalicPINVOKE.new_Hover__SWIG_0(), true) + public uint GetPointCount() { + uint ret = NDalicPINVOKE.Hover_GetPointCount(swigCPtr); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; } /// - /// The constructor. + /// Dispose. /// - /// The time the event occurred. - internal Hover(uint time) : this(NDalicPINVOKE.new_Hover__SWIG_1(time), true) + /// 3 + public void Dispose() { - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } + //Throw excpetion if Dispose() is called in separate thread. + if (!Window.IsInstalled()) + { + throw new System.InvalidOperationException("This API called from separate thread. This API must be called from MainThread."); + } - private TouchPointContainer points - { - set + if (isDisposeQueued) { - NDalicPINVOKE.Hover_points_set(swigCPtr, TouchPointContainer.getCPtr(value)); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + Dispose(DisposeTypes.Implicit); } - get + else { - global::System.IntPtr cPtr = NDalicPINVOKE.Hover_points_get(swigCPtr); - TouchPointContainer ret = (cPtr == global::System.IntPtr.Zero) ? null : new TouchPointContainer(cPtr, false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; + Dispose(DisposeTypes.Explicit); + System.GC.SuppressFinalize(this); } } - private uint time + internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Hover obj) { - set - { - NDalicPINVOKE.Hover_time_set(swigCPtr, value); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - get - { - uint ret = NDalicPINVOKE.Hover_time_get(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } + return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; } - /// - /// Returns the total number of points. - /// - /// Total number of points. - /// 3 - public uint GetPointCount() + internal static Hover GetHoverFromPtr(global::System.IntPtr cPtr) { - uint ret = NDalicPINVOKE.Hover_GetPointCount(swigCPtr); + Hover ret = new Hover(cPtr, false); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } @@ -293,6 +261,38 @@ namespace Tizen.NUI return ret; } - } + /// + /// Dispose. + /// + /// 3 + protected virtual void Dispose(DisposeTypes type) + { + if (disposed) + { + return; + } + + if (type == DisposeTypes.Explicit) + { + //Called by User + //Release your own managed resources here. + //You should release all of your own disposable objects here. + } + + //Release your own unmanaged resources here. + //You should not access any managed member here except static instance. + //because the execution order of Finalizes is non-deterministic. + if (swigCPtr.Handle != global::System.IntPtr.Zero) + { + if (swigCMemOwn) + { + swigCMemOwn = false; + NDalicPINVOKE.delete_Hover(swigCPtr); + } + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); + } + disposed = true; + } + } } \ No newline at end of file diff --git a/src/Tizen.NUI/src/public/ImageLoading.cs b/src/Tizen.NUI/src/public/ImageLoading.cs index cc815e6..60d8506 100755 --- a/src/Tizen.NUI/src/public/ImageLoading.cs +++ b/src/Tizen.NUI/src/public/ImageLoading.cs @@ -299,31 +299,5 @@ namespace Tizen.NUI return ret; } - /// - /// Set the maximum texture size. Then size can be kwown by GL_MAX_TEXTURE_SIZE. - /// - /// The maximum texture size to set. - /// 5 - /// This will be released at Tizen.NET API Level 5. Therefore, currently this would be used as an in-house API. - [EditorBrowsable(EditorBrowsableState.Never)] - public static void SetMaxTextureSize(uint size) - { - NDalicPINVOKE.SetMaxTextureSize(size); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - /// - /// Get the maximum texture size. - /// - /// The maximum texture size. - /// 5 - /// This will be released at Tizen.NET API Level 5. Therefore, currently this would be used as an in-house API. - [EditorBrowsable(EditorBrowsableState.Never)] - public static uint GetMaxTextureSize() - { - uint ret = NDalicPINVOKE.GetMaxTextureSize(); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } } } diff --git a/src/Tizen.NUI/src/public/ImfManager.cs b/src/Tizen.NUI/src/public/ImfManager.cs index a2d3c5e..6aeee67 100755 --- a/src/Tizen.NUI/src/public/ImfManager.cs +++ b/src/Tizen.NUI/src/public/ImfManager.cs @@ -31,499 +31,330 @@ namespace Tizen.NUI { private global::System.Runtime.InteropServices.HandleRef swigCPtr; - internal ImfManager(IntPtr cPtr, bool cMemoryOwn) : base(NDalicManualPINVOKE.InputMethodContext_SWIGUpcast(cPtr), cMemoryOwn) + private ActivatedEventCallbackType _activatedEventCallback; + private EventReceivedEventCallbackType _eventReceivedEventCallback; + private StatusChangedEventCallbackType _statusChangedEventCallback; + private ResizedEventCallbackType _resizedEventCallback; + private LanguageChangedEventCallbackType _languageChangedEventCallback; + private KeyboardTypeChangedEventCallbackType _keyboardTypeChangedEventCallback; + + /// + /// Constructor.
+ ///
+ /// 5 + public ImfManager() : this(NDalicManualPINVOKE.InputMethodContext_New(), true) { - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } - internal static global::System.Runtime.InteropServices.HandleRef getCPtr(ImfManager obj) + internal ImfManager(ImfManager imfManager) : this(NDalicManualPINVOKE.new_InputMethodContext__SWIG_1(ImfManager.getCPtr(imfManager)), true) { - return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, IntPtr.Zero) : obj.swigCPtr; + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } - /// - /// Gets the singleton of the ImfManager object. - /// - /// 5 - public static ImfManager Instance + internal ImfManager(IntPtr cPtr, bool cMemoryOwn) : base(NDalicManualPINVOKE.InputMethodContext_SWIGUpcast(cPtr), cMemoryOwn) { - get - { - return new ImfManager(); - } + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); } + [UnmanagedFunctionPointer(CallingConvention.StdCall)] + private delegate void ActivatedEventCallbackType(IntPtr data); + private delegate IntPtr EventReceivedEventCallbackType(IntPtr imfManager, IntPtr imfEventData); + private delegate void StatusChangedEventCallbackType(bool statusChanged); + private delegate void ResizedEventCallbackType(int resized); + private delegate void LanguageChangedEventCallbackType(int languageChanged); + private delegate void KeyboardTypeChangedEventCallbackType(KeyboardType type); + /// - /// Dispose. + /// ImfManager activated. /// - /// Dispose Type - /// 3 - /// Please DO NOT use! This will be deprecated! - /// Dispose() method in Singletone classes (ex: FocusManager, StyleManager, VisualFactory, ImfManager, TtsPlayer, Window) is not required. - [EditorBrowsable(EditorBrowsableState.Never)] - protected override void Dispose(DisposeTypes type) + /// 4 + public event EventHandler Activated { - if (disposed) + add { - return; - } + if (_activatedEventHandler == null) + { + _activatedEventCallback = OnActivated; + ActivatedSignal().Connect(_activatedEventCallback); + } - if (type == DisposeTypes.Explicit) + _activatedEventHandler += value; + } + remove { - //Called by User - //Release your own managed resources here. - //You should release all of your own disposable objects here. + _activatedEventHandler -= value; + if (_activatedEventHandler == null && _activatedEventCallback != null) + { + ActivatedSignal().Disconnect(_activatedEventCallback); + } } + } - //Release your own unmanaged resources here. - //You should not access any managed member here except static instance. - //because the execution order of Finalizes is non-deterministic. - - if (_keyboardTypeChangedEventCallback != null) + /// + /// ImfManager event received. + /// + /// 4 + public event EventHandlerWithReturnType EventReceived + { + add { - KeyboardTypeChangedSignal().Disconnect(_keyboardTypeChangedEventCallback); - } + if (_eventReceivedEventHandler == null) + { + _eventReceivedEventCallback = OnEventReceived; + EventReceivedSignal().Connect(_eventReceivedEventCallback); + } - if (swigCPtr.Handle != global::System.IntPtr.Zero) + _eventReceivedEventHandler += value; + } + remove { - if (swigCMemOwn) + _eventReceivedEventHandler -= value; + + if (_eventReceivedEventHandler == null && _eventReceivedEventCallback != null) { - swigCMemOwn = false; - NDalicManualPINVOKE.delete_InputMethodContext(swigCPtr); + EventReceivedSignal().Disconnect(_eventReceivedEventCallback); } - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, IntPtr.Zero); } - - base.Dispose(type); } /// - /// This structure is used to pass on data from the IMF regarding predictive text. + /// ImfManager status changed. /// - /// 3 - public class ImfEventData : global::System.IDisposable + /// 4 + public event EventHandler StatusChanged { - private global::System.Runtime.InteropServices.HandleRef swigCPtr; - /// - /// swigCMemOwn - /// - /// 3 - protected bool swigCMemOwn; - - internal ImfEventData(IntPtr cPtr, bool cMemoryOwn) + add { - swigCMemOwn = cMemoryOwn; - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); - } + if (_statusChangedEventHandler == null) + { + _statusChangedEventCallback = OnStatusChanged; + StatusChangedSignal().Connect(_statusChangedEventCallback); + } - internal static global::System.Runtime.InteropServices.HandleRef getCPtr(ImfEventData obj) - { - return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, IntPtr.Zero) : obj.swigCPtr; + _statusChangedEventHandler += value; } - - //A Flag to check who called Dispose(). (By User or DisposeQueue) - private bool isDisposeQueued = false; - /// - /// A Flat to check if it is already disposed. - /// - /// 3 - protected bool disposed = false; - - /// - /// Dispose. - /// - /// 3 - ~ImfEventData() + remove { - if (!isDisposeQueued) + _statusChangedEventHandler -= value; + + if (_statusChangedEventHandler == null && _statusChangedEventCallback != null) { - isDisposeQueued = true; - DisposeQueue.Instance.Add(this); + StatusChangedSignal().Disconnect(_statusChangedEventCallback); } } + } - /// - /// The dispose pattern. - /// - /// 3 - public void Dispose() + /// + /// ImfManager resized. + /// + /// 4 + public event EventHandler Resized + { + add { - //Throw excpetion if Dispose() is called in separate thread. - if (!Window.IsInstalled()) + if (_resizedEventHandler == null) { - throw new System.InvalidOperationException("This API called from separate thread. This API must be called from MainThread."); + _resizedEventCallback = OnResized; + ResizedSignal().Connect(_resizedEventCallback); } - if (isDisposeQueued) - { - Dispose(DisposeTypes.Implicit); - } - else + _resizedEventHandler += value; + } + remove + { + _resizedEventHandler -= value; + + if (_resizedEventHandler == null && _resizedEventCallback != null) { - Dispose(DisposeTypes.Explicit); - System.GC.SuppressFinalize(this); + ResizedSignal().Disconnect(_resizedEventCallback); } } + } - /// - /// Dispose. - /// - /// 3 - protected virtual void Dispose(DisposeTypes type) + /// + /// ImfManager language changed. + /// + /// 4 + public event EventHandler LanguageChanged + { + add { - if (disposed) + if (_languageChangedEventHandler == null) { - return; + _languageChangedEventCallback = OnLanguageChanged; + LanguageChangedSignal().Connect(_languageChangedEventCallback); } - if (type == DisposeTypes.Explicit) - { - //Called by User - //Release your own managed resources here. - //You should release all of your own disposable objects here. + _languageChangedEventHandler += value; + } + remove + { + _languageChangedEventHandler -= value; + if (_languageChangedEventHandler == null && _languageChangedEventCallback != null) + { + LanguageChangedSignal().Disconnect(_languageChangedEventCallback); } + } + } - //Release your own unmanaged resources here. - //You should not access any managed member here except static instance. - //because the execution order of Finalizes is non-deterministic. - - if (swigCPtr.Handle != IntPtr.Zero) + /// + /// ImfManager keyboard type changed. + /// + /// 4 + public event EventHandler KeyboardTypeChanged + { + add + { + if (_keyboardTypeChangedEventHandler == null) { - if (swigCMemOwn) - { - swigCMemOwn = false; - NDalicManualPINVOKE.delete_InputMethodContext_EventData(swigCPtr); - } - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, IntPtr.Zero); + _keyboardTypeChangedEventCallback = OnKeyboardTypeChanged; + KeyboardTypeChangedSignal().Connect(_keyboardTypeChangedEventCallback); } - disposed = true; + _keyboardTypeChangedEventHandler += value; } - - internal static ImfEventData GetImfEventDataFromPtr(IntPtr cPtr) + remove { - ImfEventData ret = new ImfEventData(cPtr, false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; + _keyboardTypeChangedEventHandler -= value; + + if (_keyboardTypeChangedEventHandler == null && _keyboardTypeChangedEventCallback != null) + { + KeyboardTypeChangedSignal().Disconnect(_keyboardTypeChangedEventCallback); + } } + } - /// - /// The default constructor. - /// - /// 3 - public ImfEventData() : this(NDalicManualPINVOKE.new_InputMethodContext_EventData__SWIG_0(), true) - { - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - /// - /// The constructor. - /// - /// The name of the event from the IMF. - /// The pre-edit or the commit string. - /// Start the position from the current cursor position to start deleting characters. - /// The number of characters to delete from the cursorOffset. - /// 3 - public ImfEventData(ImfManager.ImfEvent aEventName, string aPredictiveString, int aCursorOffset, int aNumberOfChars) : this(NDalicManualPINVOKE.new_InputMethodContext_EventData__SWIG_1((int)aEventName, aPredictiveString, aCursorOffset, aNumberOfChars), true) - { - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - /// - /// The pre-edit or the commit string. - /// - /// 4 - public string PredictiveString - { - set - { - NDalicManualPINVOKE.InputMethodContext_EventData_predictiveString_set(swigCPtr, value); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - get - { - string ret = NDalicManualPINVOKE.InputMethodContext_EventData_predictiveString_get(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - } - - /// - /// The name of the event from the IMF. - /// - /// 4 - public ImfManager.ImfEvent EventName - { - set - { - NDalicManualPINVOKE.InputMethodContext_EventData_eventName_set(swigCPtr, (int)value); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - get - { - ImfManager.ImfEvent ret = (ImfManager.ImfEvent)NDalicManualPINVOKE.InputMethodContext_EventData_eventName_get(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - } + private event EventHandler _activatedEventHandler; + private event EventHandlerWithReturnType _eventReceivedEventHandler; + private event EventHandler _statusChangedEventHandler; + private event EventHandler _resizedEventHandler; + private event EventHandler _languageChangedEventHandler; + private event EventHandler _keyboardTypeChangedEventHandler; + /// + /// The direction of the text. + /// + /// 3 + public enum TextDirection + { /// - /// The start position from the current cursor position to start deleting characters. + /// Left to right. /// - /// 4 - public int CursorOffset - { - set - { - NDalicManualPINVOKE.InputMethodContext_EventData_cursorOffset_set(swigCPtr, value); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - get - { - int ret = NDalicManualPINVOKE.InputMethodContext_EventData_cursorOffset_get(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - } - + LeftToRight, /// - /// The number of characters to delete from the cursorOffset. + /// Right to left. /// - /// 4 - public int NumberOfChars - { - set - { - NDalicManualPINVOKE.InputMethodContext_EventData_numberOfChars_set(swigCPtr, value); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - get - { - int ret = NDalicManualPINVOKE.InputMethodContext_EventData_numberOfChars_get(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - } - + RightToLeft } /// - /// Data required by the IMF from the callback. + /// Events that are generated by the IMF. /// /// 3 - public class ImfCallbackData : global::System.IDisposable + public enum ImfEvent { - private global::System.Runtime.InteropServices.HandleRef swigCPtr; /// - /// swigCMemOwn + /// No event. /// - /// 3 - protected bool swigCMemOwn; - - internal IntPtr GetImfCallbackDataPtr() - { - return (IntPtr)swigCPtr; - } - - internal ImfCallbackData(IntPtr cPtr, bool cMemoryOwn) - { - swigCMemOwn = cMemoryOwn; - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); - } - - internal static global::System.Runtime.InteropServices.HandleRef getCPtr(ImfCallbackData obj) - { - return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, IntPtr.Zero) : obj.swigCPtr; - } - - //A Flag to check who called Dispose(). (By User or DisposeQueue) - private bool isDisposeQueued = false; + /// 4 + Void, /// - /// A Flat to check if it is already disposed. + /// Pre-Edit changed. /// - /// 3 - protected bool disposed = false; - - + /// 4 + Preedit, /// - /// Dispose. + /// Commit received. /// - /// 3 - ~ImfCallbackData() - { - if (!isDisposeQueued) - { - isDisposeQueued = true; - DisposeQueue.Instance.Add(this); - } - } - + /// 4 + Commit, /// - /// The dispose pattern. + /// An event to delete a range of characters from the string. /// - /// 3 - public void Dispose() - { - //Throw excpetion if Dispose() is called in separate thread. - if (!Window.IsInstalled()) - { - throw new System.InvalidOperationException("This API called from separate thread. This API must be called from MainThread."); - } - - if (isDisposeQueued) - { - Dispose(DisposeTypes.Implicit); - } - else - { - Dispose(DisposeTypes.Explicit); - System.GC.SuppressFinalize(this); - } - } - + /// 4 + DeleteSurrounding, /// - /// Dispose. + /// An event to query string and the cursor position. /// - /// 3 - protected virtual void Dispose(DisposeTypes type) - { - if (disposed) - { - return; - } - - if (type == DisposeTypes.Explicit) - { - //Called by User - //Release your own managed resources here. - //You should release all of your own disposable objects here. - - } - - //Release your own unmanaged resources here. - //You should not access any managed member here except static instance. - //because the execution order of Finalizes is non-deterministic. - - if (swigCPtr.Handle != IntPtr.Zero) - { - if (swigCMemOwn) - { - swigCMemOwn = false; - NDalicManualPINVOKE.delete_InputMethodContext_CallbackData(swigCPtr); - } - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, IntPtr.Zero); - } - - disposed = true; - } - - internal static ImfCallbackData GetImfCallbackDataFromPtr(IntPtr cPtr) - { - ImfCallbackData ret = new ImfCallbackData(cPtr, false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - + /// 4 + GetSurrounding, /// - /// The default constructor. + /// Private command sent from the input panel. /// - /// 3 - public ImfCallbackData() : this(NDalicManualPINVOKE.new_InputMethodContext_CallbackData__SWIG_0(), true) - { - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } + /// 4 + PrivateCommand + } + /// + /// Enumeration for the state of the input panel. + /// + /// 3 + public enum State + { /// - /// The constructor. + /// Unknown state. /// - /// True if the cursor position needs to be updated. - /// The new position of the cursor. - /// The current text string. - /// Flag if preedit reset is required. - /// 3 - public ImfCallbackData(bool aUpdate, int aCursorPosition, string aCurrentText, bool aPreeditResetRequired) : this(NDalicManualPINVOKE.new_InputMethodContext_CallbackData__SWIG_1(aUpdate, aCursorPosition, aCurrentText, aPreeditResetRequired), true) - { - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - + /// 4 + Default = 0, /// - /// The current text string. + /// Input panel is shown. /// /// 4 - public string CurrentText - { - set - { - NDalicManualPINVOKE.InputMethodContext_CallbackData_currentText_set(swigCPtr, value); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - get - { - string ret = NDalicManualPINVOKE.InputMethodContext_CallbackData_currentText_get(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - } - + Show, /// - /// The current text string. + /// Input panel is hidden. /// /// 4 - public int CursorPosition - { - set - { - NDalicManualPINVOKE.InputMethodContext_CallbackData_cursorPosition_set(swigCPtr, value); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - get - { - int ret = NDalicManualPINVOKE.InputMethodContext_CallbackData_cursorPosition_get(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - } - + Hide, /// - /// If the cursor position needs to be updated. + /// Input panel in process of being shown. /// /// 4 - public bool Update - { - set - { - NDalicManualPINVOKE.InputMethodContext_CallbackData_update_set(swigCPtr, value); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - get - { - bool ret = NDalicManualPINVOKE.InputMethodContext_CallbackData_update_get(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - } + WillShow + } + /// + /// Enumeration for the types of keyboard. + /// + /// 4 + public enum KeyboardType + { /// - /// Flags if preedit reset is required. + /// Software keyboard (virtual keyboard) is default. /// /// 4 - public bool PreeditResetRequired + SoftwareKeyboard, + /// + /// Hardware keyboard. + /// + /// 4 + HardwareKeyboard + } + + /// + /// Gets the singleton of the ImfManager object. + /// + /// 5 + public static ImfManager Instance + { + get { - set - { - NDalicManualPINVOKE.InputMethodContext_CallbackData_preeditResetRequired_set(swigCPtr, value); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - get - { - bool ret = NDalicManualPINVOKE.InputMethodContext_CallbackData_preeditResetRequired_get(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } + return new ImfManager(); } + } + /// + /// Retrieves a handle to the instance of the ImfManager. + /// + /// A handle to the ImfManager. + /// 3 + public static ImfManager Get() + { + return new ImfManager(); } /// @@ -541,49 +372,14 @@ namespace Tizen.NUI /// /// 4 /// Please do not use! This will be deprecated, instead please USE Tizen.NUI.ImfManager.Instance.DestroyContext()! - #pragma warning disable 0465 +#pragma warning disable 0465 [Obsolete("Please do not use! This will be deprecated! Please use ImfManager.Instance.DestroyContext() instead!")] [EditorBrowsable(EditorBrowsableState.Never)] public void Finalize() { DestroyContext(); } - #pragma warning restore 0465 - - /// - /// Retrieves a handle to the instance of the ImfManager. - /// - /// A handle to the ImfManager. - /// 3 - public static ImfManager Get() - { - return new ImfManager(); - } - - /// - /// Constructor.
- ///
- /// 5 - public ImfManager () : this (NDalicManualPINVOKE.InputMethodContext_New(), true) { - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - - } - - internal ImfManager(ImfManager imfManager) : this(NDalicManualPINVOKE.new_InputMethodContext__SWIG_1(ImfManager.getCPtr(imfManager)), true) { - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - internal ImfManager Assign(ImfManager imfManager) { - ImfManager ret = new ImfManager(NDalicManualPINVOKE.InputMethodContext_Assign(swigCPtr, ImfManager.getCPtr(imfManager)), false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - internal static ImfManager DownCast(BaseHandle handle) { - ImfManager ret = new ImfManager(NDalicManualPINVOKE.InputMethodContext_DownCast(BaseHandle.getCPtr(handle)), true); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } +#pragma warning restore 0465 /// /// Activates the IMF.
@@ -737,12 +533,6 @@ namespace Tizen.NUI return ret; } - internal void ApplyOptions(InputMethodOptions options) - { - NDalicManualPINVOKE.InputMethodContext_ApplyOptions(swigCPtr, InputMethodOptions.getCPtr(options)); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - /// /// Sets up the input-panel specific data. /// @@ -833,548 +623,760 @@ namespace Tizen.NUI return ret; } - /// - /// Gets the current language locale of the input panel.
- /// For example, en_US, en_GB, en_PH, fr_FR, ... - ///
- /// The current language locale of the input panel. - /// 4 - public string GetInputPanelLocale() + /// + /// Gets the current language locale of the input panel.
+ /// For example, en_US, en_GB, en_PH, fr_FR, ... + ///
+ /// The current language locale of the input panel. + /// 4 + public string GetInputPanelLocale() + { + string ret = NDalicManualPINVOKE.InputMethodContext_GetInputPanelLocale(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + internal ImfManager Assign(ImfManager imfManager) + { + ImfManager ret = new ImfManager(NDalicManualPINVOKE.InputMethodContext_Assign(swigCPtr, ImfManager.getCPtr(imfManager)), false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + internal static ImfManager DownCast(BaseHandle handle) + { + ImfManager ret = new ImfManager(NDalicManualPINVOKE.InputMethodContext_DownCast(BaseHandle.getCPtr(handle)), true); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + internal void ApplyOptions(InputMethodOptions options) + { + NDalicManualPINVOKE.InputMethodContext_ApplyOptions(swigCPtr, InputMethodOptions.getCPtr(options)); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + internal static global::System.Runtime.InteropServices.HandleRef getCPtr(ImfManager obj) + { + return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, IntPtr.Zero) : obj.swigCPtr; + } + + internal ActivatedSignalType ActivatedSignal() + { + ActivatedSignalType ret = new ActivatedSignalType(NDalicManualPINVOKE.InputMethodContext_ActivatedSignal(swigCPtr), false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + internal KeyboardEventSignalType EventReceivedSignal() + { + KeyboardEventSignalType ret = new KeyboardEventSignalType(NDalicManualPINVOKE.InputMethodContext_EventReceivedSignal(swigCPtr), false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + internal StatusSignalType StatusChangedSignal() + { + StatusSignalType ret = new StatusSignalType(NDalicManualPINVOKE.InputMethodContext_StatusChangedSignal(swigCPtr), false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + internal KeyboardResizedSignalType ResizedSignal() + { + KeyboardResizedSignalType ret = new KeyboardResizedSignalType(NDalicManualPINVOKE.InputMethodContext_ResizedSignal(swigCPtr), false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + internal LanguageChangedSignalType LanguageChangedSignal() + { + LanguageChangedSignalType ret = new LanguageChangedSignalType(NDalicManualPINVOKE.InputMethodContext_LanguageChangedSignal(swigCPtr), false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + internal KeyboardTypeSignalType KeyboardTypeChangedSignal() + { + KeyboardTypeSignalType ret = new KeyboardTypeSignalType(NDalicManualPINVOKE.InputMethodContext_KeyboardTypeChangedSignal(swigCPtr), false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + /// + /// Dispose. + /// + /// Dispose Type + /// 3 + /// Please DO NOT use! This will be deprecated! + /// Dispose() method in Singletone classes (ex: FocusManager, StyleManager, VisualFactory, ImfManager, TtsPlayer, Window) is not required. + [EditorBrowsable(EditorBrowsableState.Never)] + protected override void Dispose(DisposeTypes type) + { + if (disposed) + { + return; + } + + if (type == DisposeTypes.Explicit) + { + //Called by User + //Release your own managed resources here. + //You should release all of your own disposable objects here. + + } + + //Release your own unmanaged resources here. + //You should not access any managed member here except static instance. + //because the execution order of Finalizes is non-deterministic. + + if (_keyboardTypeChangedEventCallback != null) + { + KeyboardTypeChangedSignal().Disconnect(_keyboardTypeChangedEventCallback); + } + + if (swigCPtr.Handle != global::System.IntPtr.Zero) + { + if (swigCMemOwn) + { + swigCMemOwn = false; + NDalicManualPINVOKE.delete_InputMethodContext(swigCPtr); + } + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, IntPtr.Zero); + } + + base.Dispose(type); + } + + private void OnActivated(IntPtr data) + { + ActivatedEventArgs e = new ActivatedEventArgs(); + + if (data != null) + { + e.ImfManager = Registry.GetManagedBaseHandleFromNativePtr(data) as ImfManager; + } + + if (_activatedEventHandler != null) + { + _activatedEventHandler(this, e); + } + } + + private IntPtr OnEventReceived(IntPtr imfManager, IntPtr imfEventData) + { + ImfCallbackData imfCallbackData = null; + + EventReceivedEventArgs e = new EventReceivedEventArgs(); + + if (imfManager != null) + { + e.ImfManager = Registry.GetManagedBaseHandleFromNativePtr(imfManager) as ImfManager; + } + if (imfEventData != null) + { + e.ImfEventData = ImfEventData.GetImfEventDataFromPtr(imfEventData); + } + + if (_eventReceivedEventHandler != null) + { + imfCallbackData = _eventReceivedEventHandler(this, e); + } + if (imfCallbackData != null) + { + return imfCallbackData.GetImfCallbackDataPtr(); + } + else + { + return new ImfCallbackData().GetImfCallbackDataPtr(); + } + } + + private void OnStatusChanged(bool statusChanged) + { + StatusChangedEventArgs e = new StatusChangedEventArgs(); + + e.StatusChanged = statusChanged; + + if (_statusChangedEventHandler != null) + { + _statusChangedEventHandler(this, e); + } + } + + private void OnResized(int resized) + { + ResizedEventArgs e = new ResizedEventArgs(); + e.Resized = resized; + + if (_resizedEventHandler != null) + { + _resizedEventHandler(this, e); + } + } + + private void OnLanguageChanged(int languageChanged) + { + LanguageChangedEventArgs e = new LanguageChangedEventArgs(); + e.LanguageChanged = languageChanged; + + if (_languageChangedEventHandler != null) + { + _languageChangedEventHandler(this, e); + } + } + + private void OnKeyboardTypeChanged(KeyboardType type) { - string ret = NDalicManualPINVOKE.InputMethodContext_GetInputPanelLocale(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; + KeyboardTypeChangedEventArgs e = new KeyboardTypeChangedEventArgs(); + + e.KeyboardType = type; + + if (_keyboardTypeChangedEventHandler != null) + { + _keyboardTypeChangedEventHandler(this, e); + } } /// - /// ImfManager activated event arguments. + /// This structure is used to pass on data from the IMF regarding predictive text. /// - /// 4 - public class ActivatedEventArgs : EventArgs + /// 3 + public class ImfEventData : global::System.IDisposable { /// - /// ImfManager + /// swigCMemOwn /// - /// 4 - public ImfManager ImfManager - { - get; - set; - } - } + /// 3 + protected bool swigCMemOwn; - [UnmanagedFunctionPointer(CallingConvention.StdCall)] - private delegate void ActivatedEventCallbackType(IntPtr data); - private ActivatedEventCallbackType _activatedEventCallback; - private event EventHandler _activatedEventHandler; + /// + /// A Flat to check if it is already disposed. + /// + /// 3 + protected bool disposed = false; - /// - /// ImfManager activated. - /// - /// 4 - public event EventHandler Activated - { - add + private global::System.Runtime.InteropServices.HandleRef swigCPtr; + + //A Flag to check who called Dispose(). (By User or DisposeQueue) + private bool isDisposeQueued = false; + + /// + /// The default constructor. + /// + /// 3 + public ImfEventData() : this(NDalicManualPINVOKE.new_InputMethodContext_EventData__SWIG_0(), true) { - if (_activatedEventHandler == null) - { - _activatedEventCallback = OnActivated; - ActivatedSignal().Connect(_activatedEventCallback); - } + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } - _activatedEventHandler += value; + /// + /// The constructor. + /// + /// The name of the event from the IMF. + /// The pre-edit or the commit string. + /// Start the position from the current cursor position to start deleting characters. + /// The number of characters to delete from the cursorOffset. + /// 3 + public ImfEventData(ImfManager.ImfEvent aEventName, string aPredictiveString, int aCursorOffset, int aNumberOfChars) : this(NDalicManualPINVOKE.new_InputMethodContext_EventData__SWIG_1((int)aEventName, aPredictiveString, aCursorOffset, aNumberOfChars), true) + { + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } - remove + + internal ImfEventData(IntPtr cPtr, bool cMemoryOwn) { - _activatedEventHandler -= value; + swigCMemOwn = cMemoryOwn; + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); + } - if (_activatedEventHandler == null && _activatedEventCallback != null) + /// + /// Dispose. + /// + /// 3 + ~ImfEventData() + { + if (!isDisposeQueued) { - ActivatedSignal().Disconnect(_activatedEventCallback); + isDisposeQueued = true; + DisposeQueue.Instance.Add(this); } } - } - - private void OnActivated(IntPtr data) - { - ActivatedEventArgs e = new ActivatedEventArgs(); - if (data != null) + /// + /// The pre-edit or the commit string. + /// + /// 4 + public string PredictiveString { - e.ImfManager = Registry.GetManagedBaseHandleFromNativePtr(data) as ImfManager; + set + { + NDalicManualPINVOKE.InputMethodContext_EventData_predictiveString_set(swigCPtr, value); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + get + { + string ret = NDalicManualPINVOKE.InputMethodContext_EventData_predictiveString_get(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } } - if (_activatedEventHandler != null) + /// + /// The name of the event from the IMF. + /// + /// 4 + public ImfManager.ImfEvent EventName { - _activatedEventHandler(this, e); + set + { + NDalicManualPINVOKE.InputMethodContext_EventData_eventName_set(swigCPtr, (int)value); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + get + { + ImfManager.ImfEvent ret = (ImfManager.ImfEvent)NDalicManualPINVOKE.InputMethodContext_EventData_eventName_get(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } } - } - internal ActivatedSignalType ActivatedSignal() - { - ActivatedSignalType ret = new ActivatedSignalType(NDalicManualPINVOKE.InputMethodContext_ActivatedSignal(swigCPtr), false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - /// - /// ImfManager event received event arguments. - /// - /// 4 - public class EventReceivedEventArgs : EventArgs - { /// - /// ImfManager + /// The start position from the current cursor position to start deleting characters. /// /// 4 - public ImfManager ImfManager + public int CursorOffset { - get; - set; + set + { + NDalicManualPINVOKE.InputMethodContext_EventData_cursorOffset_set(swigCPtr, value); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + get + { + int ret = NDalicManualPINVOKE.InputMethodContext_EventData_cursorOffset_get(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } } /// - /// ImfEventData + /// The number of characters to delete from the cursorOffset. /// /// 4 - public ImfEventData ImfEventData + public int NumberOfChars { - get; - set; + set + { + NDalicManualPINVOKE.InputMethodContext_EventData_numberOfChars_set(swigCPtr, value); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + get + { + int ret = NDalicManualPINVOKE.InputMethodContext_EventData_numberOfChars_get(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } } - } - private delegate IntPtr EventReceivedEventCallbackType(IntPtr imfManager, IntPtr imfEventData); - private EventReceivedEventCallbackType _eventReceivedEventCallback; - private event EventHandlerWithReturnType _eventReceivedEventHandler; - - /// - /// ImfManager event received. - /// - /// 4 - public event EventHandlerWithReturnType EventReceived - { - add + /// + /// The dispose pattern. + /// + /// 3 + public void Dispose() { - if (_eventReceivedEventHandler == null) + //Throw excpetion if Dispose() is called in separate thread. + if (!Window.IsInstalled()) { - _eventReceivedEventCallback = OnEventReceived; - EventReceivedSignal().Connect(_eventReceivedEventCallback); + throw new System.InvalidOperationException("This API called from separate thread. This API must be called from MainThread."); } - _eventReceivedEventHandler += value; + if (isDisposeQueued) + { + Dispose(DisposeTypes.Implicit); + } + else + { + Dispose(DisposeTypes.Explicit); + System.GC.SuppressFinalize(this); + } } - remove + + internal static ImfEventData GetImfEventDataFromPtr(IntPtr cPtr) { - _eventReceivedEventHandler -= value; + ImfEventData ret = new ImfEventData(cPtr, false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + internal static global::System.Runtime.InteropServices.HandleRef getCPtr(ImfEventData obj) + { + return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, IntPtr.Zero) : obj.swigCPtr; + } + + /// + /// Dispose. + /// + /// 3 + protected virtual void Dispose(DisposeTypes type) + { + if (disposed) + { + return; + } + + if (type == DisposeTypes.Explicit) + { + //Called by User + //Release your own managed resources here. + //You should release all of your own disposable objects here. + + } - if (_eventReceivedEventHandler == null && _eventReceivedEventCallback != null) + //Release your own unmanaged resources here. + //You should not access any managed member here except static instance. + //because the execution order of Finalizes is non-deterministic. + + if (swigCPtr.Handle != IntPtr.Zero) { - EventReceivedSignal().Disconnect(_eventReceivedEventCallback); + if (swigCMemOwn) + { + swigCMemOwn = false; + NDalicManualPINVOKE.delete_InputMethodContext_EventData(swigCPtr); + } + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, IntPtr.Zero); } + + disposed = true; } } - private IntPtr OnEventReceived(IntPtr imfManager, IntPtr imfEventData) + /// + /// Data required by the IMF from the callback. + /// + /// 3 + public class ImfCallbackData : global::System.IDisposable { - ImfCallbackData imfCallbackData = null; + /// + /// swigCMemOwn + /// + /// 3 + protected bool swigCMemOwn; - EventReceivedEventArgs e = new EventReceivedEventArgs(); + /// + /// A Flat to check if it is already disposed. + /// + /// 3 + protected bool disposed = false; - if (imfManager != null) - { - e.ImfManager = Registry.GetManagedBaseHandleFromNativePtr(imfManager) as ImfManager; - } - if (imfEventData != null) + private global::System.Runtime.InteropServices.HandleRef swigCPtr; + + //A Flag to check who called Dispose(). (By User or DisposeQueue) + private bool isDisposeQueued = false; + + /// + /// The default constructor. + /// + /// 3 + public ImfCallbackData() : this(NDalicManualPINVOKE.new_InputMethodContext_CallbackData__SWIG_0(), true) { - e.ImfEventData = ImfEventData.GetImfEventDataFromPtr(imfEventData); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } - if (_eventReceivedEventHandler != null) + /// + /// The constructor. + /// + /// True if the cursor position needs to be updated. + /// The new position of the cursor. + /// The current text string. + /// Flag if preedit reset is required. + /// 3 + public ImfCallbackData(bool aUpdate, int aCursorPosition, string aCurrentText, bool aPreeditResetRequired) : this(NDalicManualPINVOKE.new_InputMethodContext_CallbackData__SWIG_1(aUpdate, aCursorPosition, aCurrentText, aPreeditResetRequired), true) { - imfCallbackData = _eventReceivedEventHandler(this, e); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } - if (imfCallbackData != null) + + internal ImfCallbackData(IntPtr cPtr, bool cMemoryOwn) { - return imfCallbackData.GetImfCallbackDataPtr(); + swigCMemOwn = cMemoryOwn; + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); } - else + + /// + /// Dispose. + /// + /// 3 + ~ImfCallbackData() { - return new ImfCallbackData().GetImfCallbackDataPtr(); + if (!isDisposeQueued) + { + isDisposeQueued = true; + DisposeQueue.Instance.Add(this); + } } - } - - internal KeyboardEventSignalType EventReceivedSignal() - { - KeyboardEventSignalType ret = new KeyboardEventSignalType(NDalicManualPINVOKE.InputMethodContext_EventReceivedSignal(swigCPtr), false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - /// - /// ImfManager status changed event arguments. - /// - /// 4 - public class StatusChangedEventArgs : EventArgs - { /// - /// ImfManager status + /// The current text string. /// /// 4 - public bool StatusChanged + public string CurrentText { - get; - set; + set + { + NDalicManualPINVOKE.InputMethodContext_CallbackData_currentText_set(swigCPtr, value); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + get + { + string ret = NDalicManualPINVOKE.InputMethodContext_CallbackData_currentText_get(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } } - } - - private delegate void StatusChangedEventCallbackType(bool statusChanged); - private StatusChangedEventCallbackType _statusChangedEventCallback; - private event EventHandler _statusChangedEventHandler; - /// - /// ImfManager status changed. - /// - /// 4 - public event EventHandler StatusChanged - { - add + /// + /// The current text string. + /// + /// 4 + public int CursorPosition { - if (_statusChangedEventHandler == null) + set { - _statusChangedEventCallback = OnStatusChanged; - StatusChangedSignal().Connect(_statusChangedEventCallback); + NDalicManualPINVOKE.InputMethodContext_CallbackData_cursorPosition_set(swigCPtr, value); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } - - _statusChangedEventHandler += value; - } - remove - { - _statusChangedEventHandler -= value; - - if (_statusChangedEventHandler == null && _statusChangedEventCallback != null) + get { - StatusChangedSignal().Disconnect(_statusChangedEventCallback); + int ret = NDalicManualPINVOKE.InputMethodContext_CallbackData_cursorPosition_get(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; } } - } - - private void OnStatusChanged(bool statusChanged) - { - StatusChangedEventArgs e = new StatusChangedEventArgs(); - - e.StatusChanged = statusChanged; - if (_statusChangedEventHandler != null) + /// + /// If the cursor position needs to be updated. + /// + /// 4 + public bool Update { - _statusChangedEventHandler(this, e); + set + { + NDalicManualPINVOKE.InputMethodContext_CallbackData_update_set(swigCPtr, value); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + get + { + bool ret = NDalicManualPINVOKE.InputMethodContext_CallbackData_update_get(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } } - } - - internal StatusSignalType StatusChangedSignal() - { - StatusSignalType ret = new StatusSignalType(NDalicManualPINVOKE.InputMethodContext_StatusChangedSignal(swigCPtr), false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - /// - /// ImfManager resized event. - /// - /// 4 - public class ResizedEventArgs : EventArgs - { /// - /// resized. + /// Flags if preedit reset is required. /// /// 4 - public int Resized + public bool PreeditResetRequired { - get; - set; + set + { + NDalicManualPINVOKE.InputMethodContext_CallbackData_preeditResetRequired_set(swigCPtr, value); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + get + { + bool ret = NDalicManualPINVOKE.InputMethodContext_CallbackData_preeditResetRequired_get(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } } - } - - private delegate void ResizedEventCallbackType(int resized); - private ResizedEventCallbackType _resizedEventCallback; - private event EventHandler _resizedEventHandler; - /// - /// ImfManager resized. - /// - /// 4 - public event EventHandler Resized - { - add + /// + /// The dispose pattern. + /// + /// 3 + public void Dispose() { - if (_resizedEventHandler == null) + //Throw excpetion if Dispose() is called in separate thread. + if (!Window.IsInstalled()) { - _resizedEventCallback = OnResized; - ResizedSignal().Connect(_resizedEventCallback); + throw new System.InvalidOperationException("This API called from separate thread. This API must be called from MainThread."); } - _resizedEventHandler += value; - } - remove - { - _resizedEventHandler -= value; - - if (_resizedEventHandler == null && _resizedEventCallback != null) + if (isDisposeQueued) { - ResizedSignal().Disconnect(_resizedEventCallback); + Dispose(DisposeTypes.Implicit); + } + else + { + Dispose(DisposeTypes.Explicit); + System.GC.SuppressFinalize(this); } } - } - private void OnResized(int resized) - { - ResizedEventArgs e = new ResizedEventArgs(); - e.Resized = resized; + internal IntPtr GetImfCallbackDataPtr() + { + return (IntPtr)swigCPtr; + } + + internal static global::System.Runtime.InteropServices.HandleRef getCPtr(ImfCallbackData obj) + { + return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, IntPtr.Zero) : obj.swigCPtr; + } - if (_resizedEventHandler != null) + internal static ImfCallbackData GetImfCallbackDataFromPtr(IntPtr cPtr) { - _resizedEventHandler(this, e); + ImfCallbackData ret = new ImfCallbackData(cPtr, false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; } - } - - internal KeyboardResizedSignalType ResizedSignal() - { - KeyboardResizedSignalType ret = new KeyboardResizedSignalType(NDalicManualPINVOKE.InputMethodContext_ResizedSignal(swigCPtr), false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - /// - /// ImfManager language changed event args. - /// - /// 4 - public class LanguageChangedEventArgs : EventArgs - { /// - /// language changed. + /// Dispose. /// - /// 4 - public int LanguageChanged + /// 3 + protected virtual void Dispose(DisposeTypes type) { - get; - set; - } - } - - private delegate void LanguageChangedEventCallbackType(int languageChanged); - private LanguageChangedEventCallbackType _languageChangedEventCallback; - private event EventHandler _languageChangedEventHandler; + if (disposed) + { + return; + } - /// - /// ImfManager language changed. - /// - /// 4 - public event EventHandler LanguageChanged - { - add - { - if (_languageChangedEventHandler == null) + if (type == DisposeTypes.Explicit) { - _languageChangedEventCallback = OnLanguageChanged; - LanguageChangedSignal().Connect(_languageChangedEventCallback); + //Called by User + //Release your own managed resources here. + //You should release all of your own disposable objects here. + } - _languageChangedEventHandler += value; - } - remove - { - _languageChangedEventHandler -= value; + //Release your own unmanaged resources here. + //You should not access any managed member here except static instance. + //because the execution order of Finalizes is non-deterministic. - if (_languageChangedEventHandler == null && _languageChangedEventCallback != null) + if (swigCPtr.Handle != IntPtr.Zero) { - LanguageChangedSignal().Disconnect(_languageChangedEventCallback); + if (swigCMemOwn) + { + swigCMemOwn = false; + NDalicManualPINVOKE.delete_InputMethodContext_CallbackData(swigCPtr); + } + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, IntPtr.Zero); } - } - } - - private void OnLanguageChanged(int languageChanged) - { - LanguageChangedEventArgs e = new LanguageChangedEventArgs(); - e.LanguageChanged = languageChanged; - if (_languageChangedEventHandler != null) - { - _languageChangedEventHandler(this, e); + disposed = true; } } - internal LanguageChangedSignalType LanguageChangedSignal() - { - LanguageChangedSignalType ret = new LanguageChangedSignalType(NDalicManualPINVOKE.InputMethodContext_LanguageChangedSignal(swigCPtr), false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - /// - /// ImfManager keyboard type changed event arguments. + /// ImfManager activated event arguments. /// /// 4 - public class KeyboardTypeChangedEventArgs : EventArgs + public class ActivatedEventArgs : EventArgs { /// - /// ImfManager keyboard type + /// ImfManager /// /// 4 - public KeyboardType KeyboardType + public ImfManager ImfManager { get; set; } } - private delegate void KeyboardTypeChangedEventCallbackType(KeyboardType type); - private KeyboardTypeChangedEventCallbackType _keyboardTypeChangedEventCallback; - private event EventHandler _keyboardTypeChangedEventHandler; - /// - /// ImfManager keyboard type changed. + /// ImfManager event received event arguments. /// /// 4 - public event EventHandler KeyboardTypeChanged + public class EventReceivedEventArgs : EventArgs { - add - { - if (_keyboardTypeChangedEventHandler == null) - { - _keyboardTypeChangedEventCallback = OnKeyboardTypeChanged; - KeyboardTypeChangedSignal().Connect(_keyboardTypeChangedEventCallback); - } - - _keyboardTypeChangedEventHandler += value; - } - remove + /// + /// ImfManager + /// + /// 4 + public ImfManager ImfManager { - _keyboardTypeChangedEventHandler -= value; - - if (_keyboardTypeChangedEventHandler == null && _keyboardTypeChangedEventCallback != null) - { - KeyboardTypeChangedSignal().Disconnect(_keyboardTypeChangedEventCallback); - } + get; + set; } - } - - private void OnKeyboardTypeChanged(KeyboardType type) - { - KeyboardTypeChangedEventArgs e = new KeyboardTypeChangedEventArgs(); - - e.KeyboardType = type; - if (_keyboardTypeChangedEventHandler != null) + /// + /// ImfEventData + /// + /// 4 + public ImfEventData ImfEventData { - _keyboardTypeChangedEventHandler(this, e); + get; + set; } } - internal KeyboardTypeSignalType KeyboardTypeChangedSignal() - { - KeyboardTypeSignalType ret = new KeyboardTypeSignalType(NDalicManualPINVOKE.InputMethodContext_KeyboardTypeChangedSignal(swigCPtr), false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - /// - /// The direction of the text. + /// ImfManager status changed event arguments. /// - /// 3 - public enum TextDirection + /// 4 + public class StatusChangedEventArgs : EventArgs { /// - /// Left to right. - /// - LeftToRight, - /// - /// Right to left. + /// ImfManager status /// - RightToLeft + /// 4 + public bool StatusChanged + { + get; + set; + } } /// - /// Events that are generated by the IMF. + /// ImfManager resized event. /// - /// 3 - public enum ImfEvent + /// 4 + public class ResizedEventArgs : EventArgs { /// - /// No event. - /// - /// 4 - Void, - /// - /// Pre-Edit changed. - /// - /// 4 - Preedit, - /// - /// Commit received. - /// - /// 4 - Commit, - /// - /// An event to delete a range of characters from the string. - /// - /// 4 - DeleteSurrounding, - /// - /// An event to query string and the cursor position. - /// - /// 4 - GetSurrounding, - /// - /// Private command sent from the input panel. + /// resized. /// /// 4 - PrivateCommand + public int Resized + { + get; + set; + } } /// - /// Enumeration for the state of the input panel. + /// ImfManager language changed event args. /// - /// 3 - public enum State + /// 4 + public class LanguageChangedEventArgs : EventArgs { /// - /// Unknown state. - /// - /// 4 - Default = 0, - /// - /// Input panel is shown. - /// - /// 4 - Show, - /// - /// Input panel is hidden. - /// - /// 4 - Hide, - /// - /// Input panel in process of being shown. + /// language changed. /// /// 4 - WillShow + public int LanguageChanged + { + get; + set; + } } /// - /// Enumeration for the types of keyboard. + /// ImfManager keyboard type changed event arguments. /// /// 4 - public enum KeyboardType + public class KeyboardTypeChangedEventArgs : EventArgs { /// - /// Software keyboard (virtual keyboard) is default. - /// - /// 4 - SoftwareKeyboard, - /// - /// Hardware keyboard. + /// ImfManager keyboard type /// /// 4 - HardwareKeyboard + public KeyboardType KeyboardType + { + get; + set; + } } } } diff --git a/src/Tizen.NUI/src/public/InputMethod.cs b/src/Tizen.NUI/src/public/InputMethod.cs index 499b73c..f376c65 100755 --- a/src/Tizen.NUI/src/public/InputMethod.cs +++ b/src/Tizen.NUI/src/public/InputMethod.cs @@ -36,140 +36,6 @@ namespace Tizen.NUI } /// - /// Gets or sets the panel layout. - /// - /// 3 - public PanelLayoutType PanelLayout - { - get - { - return _panelLayout ?? PanelLayoutType.Normal; - } - set - { - _panelLayout = value; - } - } - - /// - /// Gets or sets the action button. - /// - /// 3 - public ActionButtonTitleType ActionButton - { - get - { - return _actionButton ?? ActionButtonTitleType.Default; - } - set - { - _actionButton = value; - } - } - - /// - /// Gets or sets the auto capital. - /// - /// 3 - public AutoCapitalType AutoCapital - { - get - { - return _autoCapital ?? AutoCapitalType.None; - } - set - { - _autoCapital = value; - } - } - - /// - /// Gets or sets the variation. - /// - /// 3 - public int Variation - { - get - { - return _variation ?? 0; - } - set - { - _variation = value; - } - } - - /// - /// Gets or sets the variation for normal layout. - /// - /// 3 - public NormalLayoutType NormalVariation - { - get - { - return (NormalLayoutType) (_variation ?? 0); - } - set - { - _variation = (int)value; - } - } - - /// - /// Gets or sets the variation for the number only layout. - /// - /// 3 - public NumberOnlyLayoutType NumberOnlyVariation - { - get - { - return (NumberOnlyLayoutType) (_variation ?? 0); - } - set - { - _variation = (int)value; - } - } - - /// - /// Gets or sets the variation for the password layout. - /// - /// 3 - public PasswordLayoutType PasswordVariation - { - get - { - return (PasswordLayoutType) (_variation ?? 0); - } - set - { - _variation = (int)value; - } - } - - private PropertyMap ComposingInputMethodMap() - { - PropertyMap _outputMap = new PropertyMap(); - if (_panelLayout != null) { _outputMap.Add("PANEL_LAYOUT", new PropertyValue((int)_panelLayout)); } - if (_actionButton != null) { _outputMap.Add("BUTTON_ACTION", new PropertyValue((int)_actionButton)); } - if (_autoCapital != null) { _outputMap.Add("AUTO_CAPITALIZE", new PropertyValue((int)_autoCapital)); } - if (_variation != null) { _outputMap.Add("VARIATION", new PropertyValue((int)_variation)); } - return _outputMap; - } - - /// - /// Gets the input method map. - /// - /// 3 - public PropertyMap OutputMap - { - get - { - return ComposingInputMethodMap(); - } - } - - /// /// SetType that can be changed in the system input method. /// /// 3 @@ -393,5 +259,138 @@ namespace Tizen.NUI WithNumberOnly } + /// + /// Gets or sets the panel layout. + /// + /// 3 + public PanelLayoutType PanelLayout + { + get + { + return _panelLayout ?? PanelLayoutType.Normal; + } + set + { + _panelLayout = value; + } + } + + /// + /// Gets or sets the action button. + /// + /// 3 + public ActionButtonTitleType ActionButton + { + get + { + return _actionButton ?? ActionButtonTitleType.Default; + } + set + { + _actionButton = value; + } + } + + /// + /// Gets or sets the auto capital. + /// + /// 3 + public AutoCapitalType AutoCapital + { + get + { + return _autoCapital ?? AutoCapitalType.None; + } + set + { + _autoCapital = value; + } + } + + /// + /// Gets or sets the variation. + /// + /// 3 + public int Variation + { + get + { + return _variation ?? 0; + } + set + { + _variation = value; + } + } + + /// + /// Gets or sets the variation for normal layout. + /// + /// 3 + public NormalLayoutType NormalVariation + { + get + { + return (NormalLayoutType) (_variation ?? 0); + } + set + { + _variation = (int)value; + } + } + + /// + /// Gets or sets the variation for the number only layout. + /// + /// 3 + public NumberOnlyLayoutType NumberOnlyVariation + { + get + { + return (NumberOnlyLayoutType) (_variation ?? 0); + } + set + { + _variation = (int)value; + } + } + + /// + /// Gets or sets the variation for the password layout. + /// + /// 3 + public PasswordLayoutType PasswordVariation + { + get + { + return (PasswordLayoutType) (_variation ?? 0); + } + set + { + _variation = (int)value; + } + } + + /// + /// Gets the input method map. + /// + /// 3 + public PropertyMap OutputMap + { + get + { + return ComposingInputMethodMap(); + } + } + + private PropertyMap ComposingInputMethodMap() + { + PropertyMap _outputMap = new PropertyMap(); + if (_panelLayout != null) { _outputMap.Add("PANEL_LAYOUT", new PropertyValue((int)_panelLayout)); } + if (_actionButton != null) { _outputMap.Add("BUTTON_ACTION", new PropertyValue((int)_actionButton)); } + if (_autoCapital != null) { _outputMap.Add("AUTO_CAPITALIZE", new PropertyValue((int)_autoCapital)); } + if (_variation != null) { _outputMap.Add("VARIATION", new PropertyValue((int)_variation)); } + return _outputMap; + } } } \ No newline at end of file diff --git a/src/Tizen.NUI/src/public/InputMethodContext.cs b/src/Tizen.NUI/src/public/InputMethodContext.cs index 89e6ec0..368231a 100755 --- a/src/Tizen.NUI/src/public/InputMethodContext.cs +++ b/src/Tizen.NUI/src/public/InputMethodContext.cs @@ -29,487 +29,320 @@ namespace Tizen.NUI { private global::System.Runtime.InteropServices.HandleRef swigCPtr; - internal InputMethodContext(IntPtr cPtr, bool cMemoryOwn) : base(NDalicManualPINVOKE.InputMethodContext_SWIGUpcast(cPtr), cMemoryOwn) + private ActivatedEventCallbackType _activatedEventCallback; + private EventReceivedEventCallbackType _eventReceivedEventCallback; + private StatusChangedEventCallbackType _statusChangedEventCallback; + private ResizedEventCallbackType _resizedEventCallback; + private LanguageChangedEventCallbackType _languageChangedEventCallback; + private KeyboardTypeChangedEventCallbackType _keyboardTypeChangedEventCallback; + + /// + /// Constructor.
+ ///
+ /// 5 + public InputMethodContext() : this(NDalicManualPINVOKE.InputMethodContext_New(), true) { - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } - internal static global::System.Runtime.InteropServices.HandleRef getCPtr(InputMethodContext obj) + internal InputMethodContext(IntPtr cPtr, bool cMemoryOwn) : base(NDalicManualPINVOKE.InputMethodContext_SWIGUpcast(cPtr), cMemoryOwn) { - return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, IntPtr.Zero) : obj.swigCPtr; + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); } + [UnmanagedFunctionPointer(CallingConvention.StdCall)] + private delegate void ActivatedEventCallbackType(IntPtr data); + private delegate IntPtr EventReceivedEventCallbackType(IntPtr inputMethodContext, IntPtr eventData); + private delegate void StatusChangedEventCallbackType(bool statusChanged); + private delegate void ResizedEventCallbackType(int resized); + private delegate void LanguageChangedEventCallbackType(int languageChanged); + private delegate void KeyboardTypeChangedEventCallbackType(KeyboardType type); + + private event EventHandler _activatedEventHandler; + private event EventHandlerWithReturnType _eventReceivedEventHandler; + private event EventHandler _statusChangedEventHandler; + private event EventHandler _resizedEventHandler; + private event EventHandler _languageChangedEventHandler; + private event EventHandler _keyboardTypeChangedEventHandler; /// - /// Dispose + /// InputMethodContext activated. /// - /// Dispose Type /// 5 - /// Please DO NOT use! This will be deprecated! - /// Dispose() method in Singletone classes (ex: FocusManager, StyleManager, VisualFactory, InputMethodContext, TtsPlayer, Window) is not required. - [EditorBrowsable(EditorBrowsableState.Never)] - protected override void Dispose(DisposeTypes type) + public event EventHandler Activated { - if (disposed) + add { - return; - } + if (_activatedEventHandler == null) + { + _activatedEventCallback = OnActivated; + ActivatedSignal().Connect(_activatedEventCallback); + } - if (type == DisposeTypes.Explicit) + _activatedEventHandler += value; + } + remove { - //Called by User. - //Release your own managed resources here. - //You should release all of your own disposable objects here. + _activatedEventHandler -= value; + if (_activatedEventHandler == null && _activatedEventCallback != null) + { + ActivatedSignal().Disconnect(_activatedEventCallback); + } } + } - //Release your own unmanaged resources here. - //You should not access any managed member here except static instance. - //Because the execution order of Finalizes is non-deterministic. - - if (_keyboardTypeChangedEventCallback != null) + /// + /// InputMethodContext event received. + /// + /// 5 + public event EventHandlerWithReturnType EventReceived + { + add { - KeyboardTypeChangedSignal().Disconnect(_keyboardTypeChangedEventCallback); - } + if (_eventReceivedEventHandler == null) + { + _eventReceivedEventCallback = OnEventReceived; + EventReceivedSignal().Connect(_eventReceivedEventCallback); + } - if (swigCPtr.Handle != global::System.IntPtr.Zero) + _eventReceivedEventHandler += value; + } + remove { - if (swigCMemOwn) + _eventReceivedEventHandler -= value; + + if (_eventReceivedEventHandler == null && _eventReceivedEventCallback != null) { - swigCMemOwn = false; - NDalicManualPINVOKE.delete_InputMethodContext(swigCPtr); + EventReceivedSignal().Disconnect(_eventReceivedEventCallback); } - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, IntPtr.Zero); } - - base.Dispose(type); } /// - /// This structure is used to pass on data from the IMF regarding predictive text. + /// InputMethodContext status changed. /// /// 5 - public class EventData : global::System.IDisposable + public event EventHandler StatusChanged { - private global::System.Runtime.InteropServices.HandleRef swigCPtr; - /// - /// swigCMemOwn - /// - /// 5 - protected bool swigCMemOwn; - - internal EventData(IntPtr cPtr, bool cMemoryOwn) + add { - swigCMemOwn = cMemoryOwn; - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); - } + if (_statusChangedEventHandler == null) + { + _statusChangedEventCallback = OnStatusChanged; + StatusChangedSignal().Connect(_statusChangedEventCallback); + } - internal static global::System.Runtime.InteropServices.HandleRef getCPtr(EventData obj) - { - return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, IntPtr.Zero) : obj.swigCPtr; + _statusChangedEventHandler += value; } - - //A flag to check who called Dispose(). (By User or DisposeQueue) - private bool isDisposeQueued = false; - /// - /// A flag to check if it is already disposed. - /// - /// 5 - protected bool disposed = false; - - /// - /// Dispose. - /// - /// 5 - ~EventData() + remove { - if (!isDisposeQueued) + _statusChangedEventHandler -= value; + + if (_statusChangedEventHandler == null && _statusChangedEventCallback != null) { - isDisposeQueued = true; - DisposeQueue.Instance.Add(this); + StatusChangedSignal().Disconnect(_statusChangedEventCallback); } } + } - /// - /// The dispose pattern. - /// - /// 5 - public void Dispose() + /// + /// InputMethodContext resized. + /// + /// 5 + public event EventHandler Resized + { + add { - //Throw excpetion if Dispose() is called in separate thread. - if (!Window.IsInstalled()) + if (_resizedEventHandler == null) { - throw new System.InvalidOperationException("This API called from separate thread. This API must be called from MainThread."); + _resizedEventCallback = OnResized; + ResizedSignal().Connect(_resizedEventCallback); } - if (isDisposeQueued) - { - Dispose(DisposeTypes.Implicit); - } - else + _resizedEventHandler += value; + } + remove + { + _resizedEventHandler -= value; + + if (_resizedEventHandler == null && _resizedEventCallback != null) { - Dispose(DisposeTypes.Explicit); - System.GC.SuppressFinalize(this); + ResizedSignal().Disconnect(_resizedEventCallback); } } + } - /// - /// Dispose. - /// - /// 5 - protected virtual void Dispose(DisposeTypes type) + /// + /// InputMethodContext language changed. + /// + /// 5 + public event EventHandler LanguageChanged + { + add { - if (disposed) + if (_languageChangedEventHandler == null) { - return; + _languageChangedEventCallback = OnLanguageChanged; + LanguageChangedSignal().Connect(_languageChangedEventCallback); } - if (type == DisposeTypes.Explicit) - { - //Called by User. - //Release your own managed resources here. - //You should release all of your own disposable objects here. + _languageChangedEventHandler += value; + } + remove + { + _languageChangedEventHandler -= value; + if (_languageChangedEventHandler == null && _languageChangedEventCallback != null) + { + LanguageChangedSignal().Disconnect(_languageChangedEventCallback); } + } + } - //Release your own unmanaged resources here. - //You should not access any managed member here except static instance. - //because the execution order of Finalizes is non-deterministic. - - if (swigCPtr.Handle != IntPtr.Zero) + /// + /// InputMethodContext keyboard type changed. + /// + /// 5 + public event EventHandler KeyboardTypeChanged + { + add + { + if (_keyboardTypeChangedEventHandler == null) { - if (swigCMemOwn) - { - swigCMemOwn = false; - NDalicManualPINVOKE.delete_InputMethodContext_EventData(swigCPtr); - } - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, IntPtr.Zero); + _keyboardTypeChangedEventCallback = OnKeyboardTypeChanged; + KeyboardTypeChangedSignal().Connect(_keyboardTypeChangedEventCallback); } - disposed = true; + _keyboardTypeChangedEventHandler += value; } - - internal static EventData GetEventDataFromPtr(IntPtr cPtr) + remove { - EventData ret = new EventData(cPtr, false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; + _keyboardTypeChangedEventHandler -= value; + + if (_keyboardTypeChangedEventHandler == null && _keyboardTypeChangedEventCallback != null) + { + KeyboardTypeChangedSignal().Disconnect(_keyboardTypeChangedEventCallback); + } } + } + /// + /// The direction of the text. + /// + /// 5 + public enum TextDirection + { /// - /// The default constructor. + /// Left to right. /// - /// 5 - public EventData() : this(NDalicManualPINVOKE.new_InputMethodContext_EventData__SWIG_0(), true) - { - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - /// - /// The constructor. - /// - /// The name of the event from the IMF. - /// The pre-edit or the commit string. - /// Start the position from the current cursor position to start deleting characters. - /// The number of characters to delete from the cursorOffset. - /// 5 - public EventData(InputMethodContext.EventType aEventName, string aPredictiveString, int aCursorOffset, int aNumberOfChars) : this(NDalicManualPINVOKE.new_InputMethodContext_EventData__SWIG_1((int)aEventName, aPredictiveString, aCursorOffset, aNumberOfChars), true) - { - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - /// - /// The pre-edit or the commit string. - /// - /// 5 - public string PredictiveString - { - set - { - NDalicManualPINVOKE.InputMethodContext_EventData_predictiveString_set(swigCPtr, value); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - get - { - string ret = NDalicManualPINVOKE.InputMethodContext_EventData_predictiveString_get(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - } - - /// - /// The name of the event from the IMF. - /// - /// 5 - public InputMethodContext.EventType EventName - { - set - { - NDalicManualPINVOKE.InputMethodContext_EventData_eventName_set(swigCPtr, (int)value); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - get - { - InputMethodContext.EventType ret = (InputMethodContext.EventType)NDalicManualPINVOKE.InputMethodContext_EventData_eventName_get(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - } - - /// - /// The start position from the current cursor position to start deleting characters. - /// - /// 5 - public int CursorOffset - { - set - { - NDalicManualPINVOKE.InputMethodContext_EventData_cursorOffset_set(swigCPtr, value); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - get - { - int ret = NDalicManualPINVOKE.InputMethodContext_EventData_cursorOffset_get(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - } - + LeftToRight, /// - /// The number of characters to delete from the cursorOffset. + /// Right to left. /// - /// 5 - public int NumberOfChars - { - set - { - NDalicManualPINVOKE.InputMethodContext_EventData_numberOfChars_set(swigCPtr, value); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - get - { - int ret = NDalicManualPINVOKE.InputMethodContext_EventData_numberOfChars_get(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - } + RightToLeft } /// - /// Data required by the IMF from the callback. + /// Events that are generated by the IMF. /// /// 5 - public class CallbackData : global::System.IDisposable + public enum EventType { - private global::System.Runtime.InteropServices.HandleRef swigCPtr; /// - /// swigCMemOwn + /// No event. /// /// 5 - protected bool swigCMemOwn; - - internal IntPtr GetCallbackDataPtr() - { - return (IntPtr)swigCPtr; - } - - internal CallbackData(IntPtr cPtr, bool cMemoryOwn) - { - swigCMemOwn = cMemoryOwn; - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); - } - - internal static global::System.Runtime.InteropServices.HandleRef getCPtr(CallbackData obj) - { - return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, IntPtr.Zero) : obj.swigCPtr; - } - - //A Flag to check who called Dispose(). (By User or DisposeQueue) - private bool isDisposeQueued = false; + Void, /// - /// A Flag to check if it is already disposed. + /// Pre-edit changed. /// /// 5 - protected bool disposed = false; - - + Preedit, /// - /// Dispose. + /// Commit received. /// /// 5 - ~CallbackData() - { - if (!isDisposeQueued) - { - isDisposeQueued = true; - DisposeQueue.Instance.Add(this); - } - } - + Commit, /// - /// The dispose pattern. + /// An event to delete a range of characters from the string. /// /// 5 - public void Dispose() - { - //Throw excpetion if Dispose() is called in separate thread. - if (!Window.IsInstalled()) - { - throw new System.InvalidOperationException("This API called from separate thread. This API must be called from MainThread."); - } - - if (isDisposeQueued) - { - Dispose(DisposeTypes.Implicit); - } - else - { - Dispose(DisposeTypes.Explicit); - System.GC.SuppressFinalize(this); - } - } - + DeleteSurrounding, /// - /// Dispose. + /// An event to query string and the cursor position. /// /// 5 - protected virtual void Dispose(DisposeTypes type) - { - if (disposed) - { - return; - } - - if (type == DisposeTypes.Explicit) - { - //Called by User. - //Release your own managed resources here. - //You should release all of your own disposable objects here. - - } - - //Release your own unmanaged resources here. - //You should not access any managed member here except static instance. - //Because the execution order of Finalizes is non-deterministic. - - if (swigCPtr.Handle != IntPtr.Zero) - { - if (swigCMemOwn) - { - swigCMemOwn = false; - NDalicManualPINVOKE.delete_InputMethodContext_CallbackData(swigCPtr); - } - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, IntPtr.Zero); - } - - disposed = true; - } - - internal static CallbackData GetCallbackDataFromPtr(IntPtr cPtr) - { - CallbackData ret = new CallbackData(cPtr, false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - + GetSurrounding, /// - /// The default constructor. + /// Private command sent from the input panel. /// /// 5 - public CallbackData() : this(NDalicManualPINVOKE.new_InputMethodContext_CallbackData__SWIG_0(), true) - { - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } + PrivateCommand + } + /// + /// Enumeration for the state of the input panel. + /// + /// 5 + public enum State + { /// - /// The constructor. + /// Unknown state. /// - /// True if the cursor position needs to be updated. - /// The new position of the cursor. - /// The current text string. - /// Flag if preedit reset is required. /// 5 - public CallbackData(bool aUpdate, int aCursorPosition, string aCurrentText, bool aPreeditResetRequired) : this(NDalicManualPINVOKE.new_InputMethodContext_CallbackData__SWIG_1(aUpdate, aCursorPosition, aCurrentText, aPreeditResetRequired), true) - { - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - + Default = 0, /// - /// The current text string. + /// Input panel is shown. /// /// 5 - public string CurrentText - { - set - { - NDalicManualPINVOKE.InputMethodContext_CallbackData_currentText_set(swigCPtr, value); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - get - { - string ret = NDalicManualPINVOKE.InputMethodContext_CallbackData_currentText_get(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - } - + Show, /// - /// The current cursor position. + /// Input panel is hidden. /// /// 5 - public int CursorPosition - { - set - { - NDalicManualPINVOKE.InputMethodContext_CallbackData_cursorPosition_set(swigCPtr, value); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - get - { - int ret = NDalicManualPINVOKE.InputMethodContext_CallbackData_cursorPosition_get(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - } - + Hide, /// - /// If the cursor position needs to be updated. + /// Input panel in process of being shown. /// /// 5 - public bool Update - { - set - { - NDalicManualPINVOKE.InputMethodContext_CallbackData_update_set(swigCPtr, value); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - get - { - bool ret = NDalicManualPINVOKE.InputMethodContext_CallbackData_update_get(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - } + WillShow + } + /// + /// Enumeration for the types of keyboard. + /// + /// 5 + public enum KeyboardType + { /// - /// Flags if the pre-edit reset is required. + /// Software keyboard (virtual keyboard) is default. /// /// 5 - public bool PreeditResetRequired + SoftwareKeyboard, + /// + /// Hardware keyboard. + /// + /// 5 + HardwareKeyboard + } + + /// + /// Gets or sets whether the IM context allows to use the text prediction. + /// + /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + public bool TextPrediction + { + get { - set - { - NDalicManualPINVOKE.InputMethodContext_CallbackData_preeditResetRequired_set(swigCPtr, value); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - get - { - bool ret = NDalicManualPINVOKE.InputMethodContext_CallbackData_preeditResetRequired_get(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } + return IsTextPredictionAllowed(); + } + set + { + AllowTextPrediction(value); } - } /// @@ -523,31 +356,6 @@ namespace Tizen.NUI } /// - /// Constructor.
- ///
- /// 5 - public InputMethodContext () : this (NDalicManualPINVOKE.InputMethodContext_New(), true) { - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - - } - - internal InputMethodContext(InputMethodContext inputMethodContext) : this(NDalicManualPINVOKE.new_InputMethodContext__SWIG_1(InputMethodContext.getCPtr(inputMethodContext)), true) { - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - internal InputMethodContext Assign(InputMethodContext inputMethodContext) { - InputMethodContext ret = new InputMethodContext(NDalicManualPINVOKE.InputMethodContext_Assign(swigCPtr, InputMethodContext.getCPtr(inputMethodContext)), false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - internal static InputMethodContext DownCast(BaseHandle handle) { - InputMethodContext ret = new InputMethodContext(NDalicManualPINVOKE.InputMethodContext_DownCast(BaseHandle.getCPtr(handle)), true); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - /// /// Activates the IMF.
/// It means that the text editing has started.
/// If the hardware keyboard is not connected, then it shows the virtual keyboard. @@ -699,12 +507,6 @@ namespace Tizen.NUI return ret; } - internal void ApplyOptions(InputMethodOptions options) - { - NDalicManualPINVOKE.InputMethodContext_ApplyOptions(swigCPtr, InputMethodOptions.getCPtr(options)); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - /// /// Sets up the input panel specific data. /// @@ -808,565 +610,765 @@ namespace Tizen.NUI return ret; } + internal static global::System.Runtime.InteropServices.HandleRef getCPtr(InputMethodContext obj) + { + return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, IntPtr.Zero) : obj.swigCPtr; + } + + internal InputMethodContext(InputMethodContext inputMethodContext) : this(NDalicManualPINVOKE.new_InputMethodContext__SWIG_1(InputMethodContext.getCPtr(inputMethodContext)), true) + { + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + internal InputMethodContext Assign(InputMethodContext inputMethodContext) + { + InputMethodContext ret = new InputMethodContext(NDalicManualPINVOKE.InputMethodContext_Assign(swigCPtr, InputMethodContext.getCPtr(inputMethodContext)), false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + internal static InputMethodContext DownCast(BaseHandle handle) + { + InputMethodContext ret = new InputMethodContext(NDalicManualPINVOKE.InputMethodContext_DownCast(BaseHandle.getCPtr(handle)), true); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + internal void ApplyOptions(InputMethodOptions options) + { + NDalicManualPINVOKE.InputMethodContext_ApplyOptions(swigCPtr, InputMethodOptions.getCPtr(options)); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + internal void AllowTextPrediction(bool prediction) { NDalicManualPINVOKE.InputMethodContext_AllowTextPrediction(swigCPtr, prediction); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } - internal bool IsTextPredictionAllowed() + internal bool IsTextPredictionAllowed() + { + bool ret = NDalicManualPINVOKE.InputMethodContext_IsTextPredictionAllowed(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + internal ActivatedSignalType ActivatedSignal() + { + ActivatedSignalType ret = new ActivatedSignalType(NDalicManualPINVOKE.InputMethodContext_ActivatedSignal(swigCPtr), false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + internal KeyboardEventSignalType EventReceivedSignal() + { + KeyboardEventSignalType ret = new KeyboardEventSignalType(NDalicManualPINVOKE.InputMethodContext_EventReceivedSignal(swigCPtr), false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + internal StatusSignalType StatusChangedSignal() + { + StatusSignalType ret = new StatusSignalType(NDalicManualPINVOKE.InputMethodContext_StatusChangedSignal(swigCPtr), false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + internal KeyboardResizedSignalType ResizedSignal() + { + KeyboardResizedSignalType ret = new KeyboardResizedSignalType(NDalicManualPINVOKE.InputMethodContext_ResizedSignal(swigCPtr), false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + internal LanguageChangedSignalType LanguageChangedSignal() + { + LanguageChangedSignalType ret = new LanguageChangedSignalType(NDalicManualPINVOKE.InputMethodContext_LanguageChangedSignal(swigCPtr), false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + internal KeyboardTypeSignalType KeyboardTypeChangedSignal() + { + KeyboardTypeSignalType ret = new KeyboardTypeSignalType(NDalicManualPINVOKE.InputMethodContext_KeyboardTypeChangedSignal(swigCPtr), false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + /// + /// Dispose + /// + /// Dispose Type + /// 5 + /// Please DO NOT use! This will be deprecated! + /// Dispose() method in Singletone classes (ex: FocusManager, StyleManager, VisualFactory, InputMethodContext, TtsPlayer, Window) is not required. + [EditorBrowsable(EditorBrowsableState.Never)] + protected override void Dispose(DisposeTypes type) + { + if (disposed) + { + return; + } + + if (type == DisposeTypes.Explicit) + { + //Called by User. + //Release your own managed resources here. + //You should release all of your own disposable objects here. + + } + + //Release your own unmanaged resources here. + //You should not access any managed member here except static instance. + //Because the execution order of Finalizes is non-deterministic. + + if (_keyboardTypeChangedEventCallback != null) + { + KeyboardTypeChangedSignal().Disconnect(_keyboardTypeChangedEventCallback); + } + + if (swigCPtr.Handle != global::System.IntPtr.Zero) + { + if (swigCMemOwn) + { + swigCMemOwn = false; + NDalicManualPINVOKE.delete_InputMethodContext(swigCPtr); + } + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, IntPtr.Zero); + } + + base.Dispose(type); + } + + private void OnActivated(IntPtr data) + { + ActivatedEventArgs e = new ActivatedEventArgs(); + + if (data != null) + { + e.InputMethodContext = Registry.GetManagedBaseHandleFromNativePtr(data) as InputMethodContext; + } + + if (_activatedEventHandler != null) + { + _activatedEventHandler(this, e); + } + } + + private IntPtr OnEventReceived(IntPtr inputMethodContext, IntPtr eventData) + { + CallbackData callbackData = null; + + EventReceivedEventArgs e = new EventReceivedEventArgs(); + + if (inputMethodContext != null) + { + e.InputMethodContext = Registry.GetManagedBaseHandleFromNativePtr(inputMethodContext) as InputMethodContext; + } + if (eventData != null) + { + e.EventData = EventData.GetEventDataFromPtr(eventData); + } + + if (_eventReceivedEventHandler != null) + { + callbackData = _eventReceivedEventHandler(this, e); + } + if (callbackData != null) + { + return callbackData.GetCallbackDataPtr(); + } + else + { + return new CallbackData().GetCallbackDataPtr(); + } + } + + private void OnStatusChanged(bool statusChanged) + { + StatusChangedEventArgs e = new StatusChangedEventArgs(); + + e.StatusChanged = statusChanged; + + if (_statusChangedEventHandler != null) + { + _statusChangedEventHandler(this, e); + } + } + + private void OnResized(int resized) + { + ResizedEventArgs e = new ResizedEventArgs(); + e.Resized = resized; + + if (_resizedEventHandler != null) + { + _resizedEventHandler(this, e); + } + } + + private void OnLanguageChanged(int languageChanged) { - bool ret = NDalicManualPINVOKE.InputMethodContext_IsTextPredictionAllowed(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } + LanguageChangedEventArgs e = new LanguageChangedEventArgs(); + e.LanguageChanged = languageChanged; - /// - /// Gets or sets whether the IM context allows to use the text prediction. - /// - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - public bool TextPrediction - { - get + if (_languageChangedEventHandler != null) { - return IsTextPredictionAllowed(); + _languageChangedEventHandler(this, e); } - set + } + + private void OnKeyboardTypeChanged(KeyboardType type) + { + KeyboardTypeChangedEventArgs e = new KeyboardTypeChangedEventArgs(); + + e.KeyboardType = type; + + if (_keyboardTypeChangedEventHandler != null) { - AllowTextPrediction(value); + _keyboardTypeChangedEventHandler(this, e); } } /// - /// InputMethodContext activated event arguments. + /// This structure is used to pass on data from the IMF regarding predictive text. /// /// 5 - public class ActivatedEventArgs : EventArgs + public class EventData : global::System.IDisposable { /// - /// InputMethodContext + /// swigCMemOwn /// /// 5 - public InputMethodContext InputMethodContext + protected bool swigCMemOwn; + + /// + /// A flag to check if it is already disposed. + /// + /// 5 + protected bool disposed = false; + + private global::System.Runtime.InteropServices.HandleRef swigCPtr; + + //A flag to check who called Dispose(). (By User or DisposeQueue) + private bool isDisposeQueued = false; + + /// + /// The default constructor. + /// + /// 5 + public EventData() : this(NDalicManualPINVOKE.new_InputMethodContext_EventData__SWIG_0(), true) { - get; - set; + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } - } - [UnmanagedFunctionPointer(CallingConvention.StdCall)] - private delegate void ActivatedEventCallbackType(IntPtr data); - private ActivatedEventCallbackType _activatedEventCallback; - private event EventHandler _activatedEventHandler; + /// + /// The constructor. + /// + /// The name of the event from the IMF. + /// The pre-edit or the commit string. + /// Start the position from the current cursor position to start deleting characters. + /// The number of characters to delete from the cursorOffset. + /// 5 + public EventData(InputMethodContext.EventType aEventName, string aPredictiveString, int aCursorOffset, int aNumberOfChars) : this(NDalicManualPINVOKE.new_InputMethodContext_EventData__SWIG_1((int)aEventName, aPredictiveString, aCursorOffset, aNumberOfChars), true) + { + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } - /// - /// InputMethodContext activated. - /// - /// 5 - public event EventHandler Activated - { - add + internal EventData(IntPtr cPtr, bool cMemoryOwn) { - if (_activatedEventHandler == null) + swigCMemOwn = cMemoryOwn; + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); + } + + /// + /// Dispose. + /// + /// 5 + ~EventData() + { + if (!isDisposeQueued) { - _activatedEventCallback = OnActivated; - ActivatedSignal().Connect(_activatedEventCallback); + isDisposeQueued = true; + DisposeQueue.Instance.Add(this); } - - _activatedEventHandler += value; } - remove - { - _activatedEventHandler -= value; - if (_activatedEventHandler == null && _activatedEventCallback != null) + /// + /// The pre-edit or the commit string. + /// + /// 5 + public string PredictiveString + { + set { - ActivatedSignal().Disconnect(_activatedEventCallback); + NDalicManualPINVOKE.InputMethodContext_EventData_predictiveString_set(swigCPtr, value); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + get + { + string ret = NDalicManualPINVOKE.InputMethodContext_EventData_predictiveString_get(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; } } - } - - private void OnActivated(IntPtr data) - { - ActivatedEventArgs e = new ActivatedEventArgs(); - if (data != null) + /// + /// The name of the event from the IMF. + /// + /// 5 + public InputMethodContext.EventType EventName { - e.InputMethodContext = Registry.GetManagedBaseHandleFromNativePtr(data) as InputMethodContext; + set + { + NDalicManualPINVOKE.InputMethodContext_EventData_eventName_set(swigCPtr, (int)value); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + get + { + InputMethodContext.EventType ret = (InputMethodContext.EventType)NDalicManualPINVOKE.InputMethodContext_EventData_eventName_get(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } } - if (_activatedEventHandler != null) + /// + /// The start position from the current cursor position to start deleting characters. + /// + /// 5 + public int CursorOffset { - _activatedEventHandler(this, e); + set + { + NDalicManualPINVOKE.InputMethodContext_EventData_cursorOffset_set(swigCPtr, value); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + get + { + int ret = NDalicManualPINVOKE.InputMethodContext_EventData_cursorOffset_get(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } } - } - - internal ActivatedSignalType ActivatedSignal() - { - ActivatedSignalType ret = new ActivatedSignalType(NDalicManualPINVOKE.InputMethodContext_ActivatedSignal(swigCPtr), false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - /// - /// InputMethodContext event receives event arguments. - /// - /// 5 - public class EventReceivedEventArgs : EventArgs - { /// - /// InputMethodContext + /// The number of characters to delete from the cursorOffset. /// /// 5 - public InputMethodContext InputMethodContext + public int NumberOfChars { - get; - set; + set + { + NDalicManualPINVOKE.InputMethodContext_EventData_numberOfChars_set(swigCPtr, value); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + get + { + int ret = NDalicManualPINVOKE.InputMethodContext_EventData_numberOfChars_get(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } } /// - /// EventData. + /// The dispose pattern. /// /// 5 - public EventData EventData + public void Dispose() { - get; - set; + //Throw excpetion if Dispose() is called in separate thread. + if (!Window.IsInstalled()) + { + throw new System.InvalidOperationException("This API called from separate thread. This API must be called from MainThread."); + } + + if (isDisposeQueued) + { + Dispose(DisposeTypes.Implicit); + } + else + { + Dispose(DisposeTypes.Explicit); + System.GC.SuppressFinalize(this); + } } - } - private delegate IntPtr EventReceivedEventCallbackType(IntPtr inputMethodContext, IntPtr eventData); - private EventReceivedEventCallbackType _eventReceivedEventCallback; - private event EventHandlerWithReturnType _eventReceivedEventHandler; + internal static global::System.Runtime.InteropServices.HandleRef getCPtr(EventData obj) + { + return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, IntPtr.Zero) : obj.swigCPtr; + } - /// - /// InputMethodContext event received. - /// - /// 5 - public event EventHandlerWithReturnType EventReceived - { - add + internal static EventData GetEventDataFromPtr(IntPtr cPtr) { - if (_eventReceivedEventHandler == null) + EventData ret = new EventData(cPtr, false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + /// + /// Dispose. + /// + /// 5 + protected virtual void Dispose(DisposeTypes type) + { + if (disposed) { - _eventReceivedEventCallback = OnEventReceived; - EventReceivedSignal().Connect(_eventReceivedEventCallback); + return; + } + + if (type == DisposeTypes.Explicit) + { + //Called by User. + //Release your own managed resources here. + //You should release all of your own disposable objects here. + } - _eventReceivedEventHandler += value; - } - remove - { - _eventReceivedEventHandler -= value; + //Release your own unmanaged resources here. + //You should not access any managed member here except static instance. + //because the execution order of Finalizes is non-deterministic. - if (_eventReceivedEventHandler == null && _eventReceivedEventCallback != null) + if (swigCPtr.Handle != IntPtr.Zero) { - EventReceivedSignal().Disconnect(_eventReceivedEventCallback); + if (swigCMemOwn) + { + swigCMemOwn = false; + NDalicManualPINVOKE.delete_InputMethodContext_EventData(swigCPtr); + } + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, IntPtr.Zero); } + + disposed = true; } } - private IntPtr OnEventReceived(IntPtr inputMethodContext, IntPtr eventData) + /// + /// Data required by the IMF from the callback. + /// + /// 5 + public class CallbackData : global::System.IDisposable { - CallbackData callbackData = null; + /// + /// swigCMemOwn + /// + /// 5 + protected bool swigCMemOwn; - EventReceivedEventArgs e = new EventReceivedEventArgs(); + /// + /// A Flag to check if it is already disposed. + /// + /// 5 + protected bool disposed = false; - if (inputMethodContext != null) - { - e.InputMethodContext = Registry.GetManagedBaseHandleFromNativePtr(inputMethodContext) as InputMethodContext; - } - if (eventData != null) - { - e.EventData = EventData.GetEventDataFromPtr(eventData); - } + private global::System.Runtime.InteropServices.HandleRef swigCPtr; - if (_eventReceivedEventHandler != null) - { - callbackData = _eventReceivedEventHandler(this, e); - } - if (callbackData != null) - { - return callbackData.GetCallbackDataPtr(); - } - else + //A Flag to check who called Dispose(). (By User or DisposeQueue) + private bool isDisposeQueued = false; + + /// + /// The default constructor. + /// + /// 5 + public CallbackData() : this(NDalicManualPINVOKE.new_InputMethodContext_CallbackData__SWIG_0(), true) { - return new CallbackData().GetCallbackDataPtr(); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } - } - - internal KeyboardEventSignalType EventReceivedSignal() - { - KeyboardEventSignalType ret = new KeyboardEventSignalType(NDalicManualPINVOKE.InputMethodContext_EventReceivedSignal(swigCPtr), false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - /// - /// InputMethodContext status changed event arguments. - /// - /// 5 - public class StatusChangedEventArgs : EventArgs - { /// - /// InputMethodContext status. + /// The constructor. /// + /// True if the cursor position needs to be updated. + /// The new position of the cursor. + /// The current text string. + /// Flag if preedit reset is required. /// 5 - public bool StatusChanged + public CallbackData(bool aUpdate, int aCursorPosition, string aCurrentText, bool aPreeditResetRequired) : this(NDalicManualPINVOKE.new_InputMethodContext_CallbackData__SWIG_1(aUpdate, aCursorPosition, aCurrentText, aPreeditResetRequired), true) { - get; - set; + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } - } - - private delegate void StatusChangedEventCallbackType(bool statusChanged); - private StatusChangedEventCallbackType _statusChangedEventCallback; - private event EventHandler _statusChangedEventHandler; - /// - /// InputMethodContext status changed. - /// - /// 5 - public event EventHandler StatusChanged - { - add + /// + /// Dispose. + /// + /// 5 + ~CallbackData() { - if (_statusChangedEventHandler == null) + if (!isDisposeQueued) { - _statusChangedEventCallback = OnStatusChanged; - StatusChangedSignal().Connect(_statusChangedEventCallback); + isDisposeQueued = true; + DisposeQueue.Instance.Add(this); } - - _statusChangedEventHandler += value; } - remove - { - _statusChangedEventHandler -= value; - if (_statusChangedEventHandler == null && _statusChangedEventCallback != null) + /// + /// The current text string. + /// + /// 5 + public string CurrentText + { + set { - StatusChangedSignal().Disconnect(_statusChangedEventCallback); + NDalicManualPINVOKE.InputMethodContext_CallbackData_currentText_set(swigCPtr, value); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + get + { + string ret = NDalicManualPINVOKE.InputMethodContext_CallbackData_currentText_get(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; } } - } - - private void OnStatusChanged(bool statusChanged) - { - StatusChangedEventArgs e = new StatusChangedEventArgs(); - - e.StatusChanged = statusChanged; - if (_statusChangedEventHandler != null) + /// + /// The current cursor position. + /// + /// 5 + public int CursorPosition { - _statusChangedEventHandler(this, e); + set + { + NDalicManualPINVOKE.InputMethodContext_CallbackData_cursorPosition_set(swigCPtr, value); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + get + { + int ret = NDalicManualPINVOKE.InputMethodContext_CallbackData_cursorPosition_get(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } } - } - - internal StatusSignalType StatusChangedSignal() - { - StatusSignalType ret = new StatusSignalType(NDalicManualPINVOKE.InputMethodContext_StatusChangedSignal(swigCPtr), false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - /// - /// InputMethodContext resized event arguments. - /// - /// 5 - public class ResizedEventArgs : EventArgs - { /// - /// resized. + /// If the cursor position needs to be updated. /// /// 5 - public int Resized + public bool Update { - get; - set; + set + { + NDalicManualPINVOKE.InputMethodContext_CallbackData_update_set(swigCPtr, value); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + get + { + bool ret = NDalicManualPINVOKE.InputMethodContext_CallbackData_update_get(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } } - } - - private delegate void ResizedEventCallbackType(int resized); - private ResizedEventCallbackType _resizedEventCallback; - private event EventHandler _resizedEventHandler; - /// - /// InputMethodContext resized. - /// - /// 5 - public event EventHandler Resized - { - add + /// + /// Flags if the pre-edit reset is required. + /// + /// 5 + public bool PreeditResetRequired { - if (_resizedEventHandler == null) + set { - _resizedEventCallback = OnResized; - ResizedSignal().Connect(_resizedEventCallback); + NDalicManualPINVOKE.InputMethodContext_CallbackData_preeditResetRequired_set(swigCPtr, value); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + get + { + bool ret = NDalicManualPINVOKE.InputMethodContext_CallbackData_preeditResetRequired_get(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; } - - _resizedEventHandler += value; } - remove + + /// + /// The dispose pattern. + /// + /// 5 + public void Dispose() { - _resizedEventHandler -= value; + //Throw excpetion if Dispose() is called in separate thread. + if (!Window.IsInstalled()) + { + throw new System.InvalidOperationException("This API called from separate thread. This API must be called from MainThread."); + } - if (_resizedEventHandler == null && _resizedEventCallback != null) + if (isDisposeQueued) { - ResizedSignal().Disconnect(_resizedEventCallback); + Dispose(DisposeTypes.Implicit); + } + else + { + Dispose(DisposeTypes.Explicit); + System.GC.SuppressFinalize(this); } } - } - private void OnResized(int resized) - { - ResizedEventArgs e = new ResizedEventArgs(); - e.Resized = resized; + internal IntPtr GetCallbackDataPtr() + { + return (IntPtr)swigCPtr; + } + + internal CallbackData(IntPtr cPtr, bool cMemoryOwn) + { + swigCMemOwn = cMemoryOwn; + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); + } - if (_resizedEventHandler != null) + internal static global::System.Runtime.InteropServices.HandleRef getCPtr(CallbackData obj) { - _resizedEventHandler(this, e); + return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, IntPtr.Zero) : obj.swigCPtr; } - } - internal KeyboardResizedSignalType ResizedSignal() - { - KeyboardResizedSignalType ret = new KeyboardResizedSignalType(NDalicManualPINVOKE.InputMethodContext_ResizedSignal(swigCPtr), false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } + internal static CallbackData GetCallbackDataFromPtr(IntPtr cPtr) + { + CallbackData ret = new CallbackData(cPtr, false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } - /// - /// InputMethodContext language changed event arguments. - /// - /// 5 - public class LanguageChangedEventArgs : EventArgs - { /// - /// Language changed. + /// Dispose. /// /// 5 - public int LanguageChanged + protected virtual void Dispose(DisposeTypes type) { - get; - set; - } - } - - private delegate void LanguageChangedEventCallbackType(int languageChanged); - private LanguageChangedEventCallbackType _languageChangedEventCallback; - private event EventHandler _languageChangedEventHandler; + if (disposed) + { + return; + } - /// - /// InputMethodContext language changed. - /// - /// 5 - public event EventHandler LanguageChanged - { - add - { - if (_languageChangedEventHandler == null) + if (type == DisposeTypes.Explicit) { - _languageChangedEventCallback = OnLanguageChanged; - LanguageChangedSignal().Connect(_languageChangedEventCallback); + //Called by User. + //Release your own managed resources here. + //You should release all of your own disposable objects here. + } - _languageChangedEventHandler += value; - } - remove - { - _languageChangedEventHandler -= value; + //Release your own unmanaged resources here. + //You should not access any managed member here except static instance. + //Because the execution order of Finalizes is non-deterministic. - if (_languageChangedEventHandler == null && _languageChangedEventCallback != null) + if (swigCPtr.Handle != IntPtr.Zero) { - LanguageChangedSignal().Disconnect(_languageChangedEventCallback); + if (swigCMemOwn) + { + swigCMemOwn = false; + NDalicManualPINVOKE.delete_InputMethodContext_CallbackData(swigCPtr); + } + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, IntPtr.Zero); } - } - } - - private void OnLanguageChanged(int languageChanged) - { - LanguageChangedEventArgs e = new LanguageChangedEventArgs(); - e.LanguageChanged = languageChanged; - if (_languageChangedEventHandler != null) - { - _languageChangedEventHandler(this, e); + disposed = true; } } - internal LanguageChangedSignalType LanguageChangedSignal() - { - LanguageChangedSignalType ret = new LanguageChangedSignalType(NDalicManualPINVOKE.InputMethodContext_LanguageChangedSignal(swigCPtr), false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - /// - /// InputMethodContext keyboard type changed event arguments. + /// InputMethodContext activated event arguments. /// /// 5 - public class KeyboardTypeChangedEventArgs : EventArgs + public class ActivatedEventArgs : EventArgs { /// - /// InputMethodContext keyboard type. + /// InputMethodContext /// /// 5 - public KeyboardType KeyboardType + public InputMethodContext InputMethodContext { get; set; } } - private delegate void KeyboardTypeChangedEventCallbackType(KeyboardType type); - private KeyboardTypeChangedEventCallbackType _keyboardTypeChangedEventCallback; - private event EventHandler _keyboardTypeChangedEventHandler; - /// - /// InputMethodContext keyboard type changed. + /// InputMethodContext event receives event arguments. /// /// 5 - public event EventHandler KeyboardTypeChanged + public class EventReceivedEventArgs : EventArgs { - add - { - if (_keyboardTypeChangedEventHandler == null) - { - _keyboardTypeChangedEventCallback = OnKeyboardTypeChanged; - KeyboardTypeChangedSignal().Connect(_keyboardTypeChangedEventCallback); - } - - _keyboardTypeChangedEventHandler += value; - } - remove + /// + /// InputMethodContext + /// + /// 5 + public InputMethodContext InputMethodContext { - _keyboardTypeChangedEventHandler -= value; - - if (_keyboardTypeChangedEventHandler == null && _keyboardTypeChangedEventCallback != null) - { - KeyboardTypeChangedSignal().Disconnect(_keyboardTypeChangedEventCallback); - } + get; + set; } - } - private void OnKeyboardTypeChanged(KeyboardType type) - { - KeyboardTypeChangedEventArgs e = new KeyboardTypeChangedEventArgs(); - - e.KeyboardType = type; - - if (_keyboardTypeChangedEventHandler != null) + /// + /// EventData. + /// + /// 5 + public EventData EventData { - _keyboardTypeChangedEventHandler(this, e); + get; + set; } } - internal KeyboardTypeSignalType KeyboardTypeChangedSignal() - { - KeyboardTypeSignalType ret = new KeyboardTypeSignalType(NDalicManualPINVOKE.InputMethodContext_KeyboardTypeChangedSignal(swigCPtr), false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - /// - /// The direction of the text. + /// InputMethodContext status changed event arguments. /// /// 5 - public enum TextDirection + public class StatusChangedEventArgs : EventArgs { /// - /// Left to right. - /// - LeftToRight, - /// - /// Right to left. + /// InputMethodContext status. /// - RightToLeft + /// 5 + public bool StatusChanged + { + get; + set; + } } /// - /// Events that are generated by the IMF. + /// InputMethodContext resized event arguments. /// /// 5 - public enum EventType + public class ResizedEventArgs : EventArgs { /// - /// No event. - /// - /// 5 - Void, - /// - /// Pre-edit changed. - /// - /// 5 - Preedit, - /// - /// Commit received. - /// - /// 5 - Commit, - /// - /// An event to delete a range of characters from the string. - /// - /// 5 - DeleteSurrounding, - /// - /// An event to query string and the cursor position. - /// - /// 5 - GetSurrounding, - /// - /// Private command sent from the input panel. + /// resized. /// /// 5 - PrivateCommand + public int Resized + { + get; + set; + } } /// - /// Enumeration for the state of the input panel. + /// InputMethodContext language changed event arguments. /// /// 5 - public enum State + public class LanguageChangedEventArgs : EventArgs { /// - /// Unknown state. - /// - /// 5 - Default = 0, - /// - /// Input panel is shown. - /// - /// 5 - Show, - /// - /// Input panel is hidden. - /// - /// 5 - Hide, - /// - /// Input panel in process of being shown. + /// Language changed. /// /// 5 - WillShow + public int LanguageChanged + { + get; + set; + } } /// - /// Enumeration for the types of keyboard. + /// InputMethodContext keyboard type changed event arguments. /// /// 5 - public enum KeyboardType + public class KeyboardTypeChangedEventArgs : EventArgs { /// - /// Software keyboard (virtual keyboard) is default. - /// - /// 5 - SoftwareKeyboard, - /// - /// Hardware keyboard. + /// InputMethodContext keyboard type. /// /// 5 - HardwareKeyboard + public KeyboardType KeyboardType + { + get; + set; + } } } } diff --git a/src/Tizen.NUI/src/public/Key.cs b/src/Tizen.NUI/src/public/Key.cs index de26fd4..b41a662 100755 --- a/src/Tizen.NUI/src/public/Key.cs +++ b/src/Tizen.NUI/src/public/Key.cs @@ -24,109 +24,86 @@ namespace Tizen.NUI /// 3 public class Key : global::System.IDisposable { - private global::System.Runtime.InteropServices.HandleRef swigCPtr; /// /// swigCMemOwn /// /// 3 protected bool swigCMemOwn; - internal Key(global::System.IntPtr cPtr, bool cMemoryOwn) - { - swigCMemOwn = cMemoryOwn; - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); - } - - internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Key obj) - { - return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; - } - - //A Flag to check who called Dispose(). (By User or DisposeQueue) - private bool isDisposeQueued = false; /// /// A Flat to check if it is already disposed. /// /// 3 protected bool disposed = false; + private global::System.Runtime.InteropServices.HandleRef swigCPtr; + + //A Flag to check who called Dispose(). (By User or DisposeQueue) + private bool isDisposeQueued = false; + /// - /// Dispose. + /// The default constructor. /// /// 3 - ~Key() + public Key() : this(NDalicPINVOKE.new_Key__SWIG_0(), true) { - if(!isDisposeQueued) - { - isDisposeQueued = true; - DisposeQueue.Instance.Add(this); - } + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } /// - /// Dispose. + /// The constructor. /// - /// 3 - public void Dispose() + /// The name of the key pressed or command from the IMF, if later, then the following parameters will be needed. + /// A string of input characters or key pressed. + /// The unique key code for the key pressed. + /// The key modifier for special keys like Shift and Alt. + /// The time (in ms) that the key event occurred. + /// The state of the key event. + internal Key(string keyName, string keyString, int keyCode, int keyModifier, uint timeStamp, Key.StateType keyState) : this(NDalicPINVOKE.new_Key__SWIG_1(keyName, keyString, keyCode, keyModifier, timeStamp, (int)keyState), true) { - //Throw excpetion if Dispose() is called in separate thread. - if (!Window.IsInstalled()) - { - throw new System.InvalidOperationException("This API called from separate thread. This API must be called from MainThread."); - } + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } - if (isDisposeQueued) - { - Dispose(DisposeTypes.Implicit); - } - else - { - Dispose(DisposeTypes.Explicit); - System.GC.SuppressFinalize(this); - } + internal Key(global::System.IntPtr cPtr, bool cMemoryOwn) + { + swigCMemOwn = cMemoryOwn; + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); } /// /// Dispose. /// - /// The dispose type. /// 3 - protected virtual void Dispose(DisposeTypes type) + ~Key() { - if (disposed) - { - return; - } - - if(type == DisposeTypes.Explicit) - { - //Called by User - //Release your own managed resources here. - //You should release all of your own disposable objects here. - } - - //Release your own unmanaged resources here. - //You should not access any managed member here except static instance. - //because the execution order of Finalizes is non-deterministic. - - if (swigCPtr.Handle != global::System.IntPtr.Zero) + if (!isDisposeQueued) { - if (swigCMemOwn) - { - swigCMemOwn = false; - NDalicPINVOKE.delete_Key(swigCPtr); - } - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); + isDisposeQueued = true; + DisposeQueue.Instance.Add(this); } - disposed = true; } - - internal static Key GetKeyFromPtr(global::System.IntPtr cPtr) + /// + /// Enumeration for specifying the state of the key event. + /// + /// 3 + public enum StateType { - Key ret = new Key(cPtr, false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; + /// + /// Key Down. + /// + /// 3 + Down, + /// + /// Key Up. + /// + /// 3 + Up, + /// + /// Key Last. + /// + /// 3 + Last } /// @@ -261,65 +238,6 @@ namespace Tizen.NUI } } - /// - /// The default constructor. - /// - /// 3 - public Key() : this(NDalicPINVOKE.new_Key__SWIG_0(), true) - { - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - /// - /// The constructor. - /// - /// The name of the key pressed or command from the IMF, if later, then the following parameters will be needed. - /// A string of input characters or key pressed. - /// The unique key code for the key pressed. - /// The key modifier for special keys like Shift and Alt. - /// The time (in ms) that the key event occurred. - /// The state of the key event. - internal Key(string keyName, string keyString, int keyCode, int keyModifier, uint timeStamp, Key.StateType keyState) : this(NDalicPINVOKE.new_Key__SWIG_1(keyName, keyString, keyCode, keyModifier, timeStamp, (int)keyState), true) - { - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - /// - /// Checks to see if the Shift key modifier has been supplied. - /// - /// True if Shift modifier. - /// 3 - public bool IsShiftModifier() - { - bool ret = NDalicPINVOKE.Key_IsShiftModifier(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - /// - /// Checks to see if Ctrl (control) key modifier has been supplied. - /// - /// True if Ctrl modifier. - /// 3 - public bool IsCtrlModifier() - { - bool ret = NDalicPINVOKE.Key_IsCtrlModifier(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - /// - /// Checks to see if Alt key modifier has been supplied. - /// - /// True if Alt modifier. - /// 3 - public bool IsAltModifier() - { - bool ret = NDalicPINVOKE.Key_IsAltModifier(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - private string keyPressedName { set @@ -411,27 +329,109 @@ namespace Tizen.NUI } /// - /// Enumeration for specifying the state of the key event. + /// Dispose. /// /// 3 - public enum StateType + public void Dispose() { - /// - /// Key Down. - /// - /// 3 - Down, - /// - /// Key Up. - /// - /// 3 - Up, - /// - /// Key Last. - /// - /// 3 - Last + //Throw excpetion if Dispose() is called in separate thread. + if (!Window.IsInstalled()) + { + throw new System.InvalidOperationException("This API called from separate thread. This API must be called from MainThread."); + } + + if (isDisposeQueued) + { + Dispose(DisposeTypes.Implicit); + } + else + { + Dispose(DisposeTypes.Explicit); + System.GC.SuppressFinalize(this); + } + } + + /// + /// Checks to see if the Shift key modifier has been supplied. + /// + /// True if Shift modifier. + /// 3 + public bool IsShiftModifier() + { + bool ret = NDalicPINVOKE.Key_IsShiftModifier(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + /// + /// Checks to see if Ctrl (control) key modifier has been supplied. + /// + /// True if Ctrl modifier. + /// 3 + public bool IsCtrlModifier() + { + bool ret = NDalicPINVOKE.Key_IsCtrlModifier(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + /// + /// Checks to see if Alt key modifier has been supplied. + /// + /// True if Alt modifier. + /// 3 + public bool IsAltModifier() + { + bool ret = NDalicPINVOKE.Key_IsAltModifier(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Key obj) + { + return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; + } + + internal static Key GetKeyFromPtr(global::System.IntPtr cPtr) + { + Key ret = new Key(cPtr, false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; } + /// + /// Dispose. + /// + /// The dispose type. + /// 3 + protected virtual void Dispose(DisposeTypes type) + { + if (disposed) + { + return; + } + + if(type == DisposeTypes.Explicit) + { + //Called by User + //Release your own managed resources here. + //You should release all of your own disposable objects here. + } + + //Release your own unmanaged resources here. + //You should not access any managed member here except static instance. + //because the execution order of Finalizes is non-deterministic. + + if (swigCPtr.Handle != global::System.IntPtr.Zero) + { + if (swigCMemOwn) + { + swigCMemOwn = false; + NDalicPINVOKE.delete_Key(swigCPtr); + } + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); + } + disposed = true; + } } } \ No newline at end of file diff --git a/src/Tizen.NUI/src/public/KeyFrames.cs b/src/Tizen.NUI/src/public/KeyFrames.cs index de74b50..664e91b 100755 --- a/src/Tizen.NUI/src/public/KeyFrames.cs +++ b/src/Tizen.NUI/src/public/KeyFrames.cs @@ -30,52 +30,20 @@ namespace Tizen.NUI { private global::System.Runtime.InteropServices.HandleRef swigCPtr; - internal KeyFrames(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.KeyFrames_SWIGUpcast(cPtr), cMemoryOwn) - { - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); - } - - internal static global::System.Runtime.InteropServices.HandleRef getCPtr(KeyFrames obj) - { - return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; - } - /// - /// Dispose. + /// Creates an initialized KeyFrames handle. /// /// 3 - protected override void Dispose(DisposeTypes type) + public KeyFrames() : this(NDalicPINVOKE.KeyFrames_New(), true) { - if(disposed) - { - return; - } - - if(type == DisposeTypes.Explicit) - { - //Called by User - //Release your own managed resources here. - //You should release all of your own disposable objects here. - } - - //Release your own unmanaged resources here. - //You should not access any managed member here except static instance. - //because the execution order of Finalizes is non-deterministic. - - if (swigCPtr.Handle != global::System.IntPtr.Zero) - { - if (swigCMemOwn) - { - swigCMemOwn = false; - NDalicPINVOKE.delete_KeyFrames(swigCPtr); - } - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); - } + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - base.Dispose(type); } - + internal KeyFrames(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.KeyFrames_SWIGUpcast(cPtr), cMemoryOwn) + { + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); + } /// /// Adds a key frame. @@ -103,16 +71,6 @@ namespace Tizen.NUI } /// - /// Creates an initialized KeyFrames handle. - /// - /// 3 - public KeyFrames() : this(NDalicPINVOKE.KeyFrames_New(), true) - { - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - - } - - /// /// Gets the type of the key frame. /// /// The key frame property type @@ -149,6 +107,44 @@ namespace Tizen.NUI if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } - } + internal static global::System.Runtime.InteropServices.HandleRef getCPtr(KeyFrames obj) + { + return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; + } + + /// + /// Dispose. + /// + /// 3 + protected override void Dispose(DisposeTypes type) + { + if (disposed) + { + return; + } + if (type == DisposeTypes.Explicit) + { + //Called by User + //Release your own managed resources here. + //You should release all of your own disposable objects here. + } + + //Release your own unmanaged resources here. + //You should not access any managed member here except static instance. + //because the execution order of Finalizes is non-deterministic. + + if (swigCPtr.Handle != global::System.IntPtr.Zero) + { + if (swigCMemOwn) + { + swigCMemOwn = false; + NDalicPINVOKE.delete_KeyFrames(swigCPtr); + } + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); + } + + base.Dispose(type); + } + } } \ No newline at end of file diff --git a/src/Tizen.NUI/src/public/Layer.cs b/src/Tizen.NUI/src/public/Layer.cs index 62c0152..df7a7ef 100755 --- a/src/Tizen.NUI/src/public/Layer.cs +++ b/src/Tizen.NUI/src/public/Layer.cs @@ -32,6 +32,20 @@ namespace Tizen.NUI private global::System.IntPtr rootLayoutIntPtr; private global::System.Runtime.InteropServices.HandleRef rootLayoutCPtr; + /// + /// Creates a Layer object. + /// + /// 3 + public Layer() : this(NDalicPINVOKE.Layer_New(), true) + { + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + if (Window.Instance != null) + { + this.SetAnchorPoint(Tizen.NUI.PivotPoint.TopLeft); + this.SetResizePolicy(ResizePolicyType.FillToParent, DimensionType.AllDimensions); + } + } + internal Layer(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.Layer_SWIGUpcast(cPtr), cMemoryOwn) { swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); @@ -44,9 +58,200 @@ namespace Tizen.NUI NDalicPINVOKE.Actor_Add( swigCPtr, rootLayoutCPtr ); } - internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Layer obj) + /// + /// Enumeration for the behavior of the layer. + /// + /// 3 + public enum LayerBehavior { - return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; + /// + /// UI control rendering mode. + /// + /// 3 + [Obsolete("Please do not use! This will be deprecated! Please use LayerUI property instead!")] + [EditorBrowsable(EditorBrowsableState.Never)] + Layer2D, + /// + /// UI control rendering mode (default mode). + /// This mode is designed for UI controls that can overlap. In this + /// mode renderer order will be respective to the tree hierarchy of + /// Actors.
+ /// The rendering order is depth first, so for the following actor tree, + /// A will be drawn first, then B, D, E, then C, F. This ensures that + /// overlapping actors are drawn as expected (whereas, with breadth first + /// traversal, the actors would interleave).
+ ///
+ /// 3 + LayerUI = Layer2D, + /// + /// Layer will use depth test. + /// This mode is designed for a 3 dimensional scene where actors in front + /// of other actors will obscure them, i.e. the actors are sorted by the + /// distance from the camera.
+ /// When using this mode, a depth test will be used. A depth clear will + /// happen for each layer, which means actors in a layer "above" other + /// layers will be rendered in front of actors in those layers regardless + /// of their Z positions (see Layer::Raise() and Layer::Lower()).
+ /// Opaque renderers are drawn first and write to the depth buffer. Then + /// transparent renderers are drawn with depth test enabled but depth + /// write switched off. Transparent renderers are drawn based on their + /// distance from the camera. A renderer's DEPTH_INDEX property is used to + /// offset the distance to the camera when ordering transparent renderers. + /// This is useful if you want to define the draw order of two or more + /// transparent renderers that are equal distance from the camera. Unlike + /// LAYER_UI, parent-child relationship does not affect rendering order at + /// all. + ///
+ /// 3 + Layer3D + } + + internal enum TreeDepthMultiplier + { + TREE_DEPTH_MULTIPLIER = 10000 + } + + /// + /// Layer behavior, type String (Layer.LayerBehavior). + /// + /// 3 + public Layer.LayerBehavior Behavior + { + get + { + return GetBehavior(); + } + set + { + SetBehavior(value); + } + } + + /// + /// Sets the viewport (in window coordinates), type rectangle. + /// The contents of the layer will not be visible outside this box, when ViewportEnabled is true. + /// + /// 4 + public Rectangle Viewport + { + get + { + if (ClippingEnabled) + { + Rectangle ret = new Rectangle(NDalicPINVOKE.Layer_GetClippingBox(swigCPtr), true); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + else + { + // Clipping not enabled so return the window size + Size2D windowSize = Window.Instance.Size; + Rectangle ret = new Rectangle(0, 0, windowSize.Width, windowSize.Height); + return ret; + } + } + set + { + NDalicPINVOKE.Layer_SetClippingBox__SWIG_1(swigCPtr, Rectangle.getCPtr(value)); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + ClippingEnabled = true; + } + } + + /// + /// Retrieves and sets the layer's opacity.
+ ///
+ /// 3 + public float Opacity + { + get + { + float temp = 0.0f; + GetProperty(View.Property.OPACITY).Get(out temp); + return temp; + } + set + { + SetProperty(View.Property.OPACITY, new Tizen.NUI.PropertyValue(value)); + } + } + + /// + /// Retrieves and sets the layer's visibility. + /// + /// 3 + public bool Visibility + { + get + { + bool temp = false; + GetProperty(View.Property.VISIBLE).Get(out temp); + return temp; + } + set + { + SetProperty(View.Property.VISIBLE, new Tizen.NUI.PropertyValue(value)); + } + } + + /// + /// Get the number of children held by the layer. + /// + /// 3 + public new uint ChildCount + { + get + { + return Convert.ToUInt32(Children.Count); + } + } + + /// + /// Gets or sets the layer's name. + /// + /// 3 + public string Name + { + get + { + return GetName(); + } + set + { + SetName(value); + } + } + + /// + /// Queries the depth of the layer.
+ /// 0 is the bottommost layer, higher number is on the top.
+ ///
+ /// 3 + public uint Depth + { + get + { + return GetDepth(); + } + } + + /// + /// Internal only property to enable or disable clipping, type boolean. + /// By default, this is false, i.e., the viewport of the layer is the entire window. + /// + internal bool ClippingEnabled + { + get + { + bool ret = NDalicPINVOKE.Layer_IsClipping(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + set + { + NDalicPINVOKE.Layer_SetClipping(swigCPtr, value); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } } /// From the Container base class. @@ -141,97 +346,29 @@ namespace Tizen.NUI } /// - /// Dispose. + /// Downcasts a handle to layer handle. /// /// 3 - protected override void Dispose(DisposeTypes type) - { - if(disposed) - { - return; - } - - if(type == DisposeTypes.Explicit) - { - //Called by User - //Release your own managed resources here. - //You should release all of your own disposable objects here. - } - - //Release your own unmanaged resources here. - //You should not access any managed member here except static instance. - //because the execution order of Finalizes is non-deterministic. - - if (swigCPtr.Handle != global::System.IntPtr.Zero) - { - if (swigCMemOwn) - { - swigCMemOwn = false; - NDalicPINVOKE.delete_Layer(swigCPtr); - } - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); - } - - base.Dispose(type); - - } - - - internal class Property + /// Please do not use! this will be deprecated! + /// Instead please use as keyword. + [Obsolete("Please do not use! This will be deprecated! Please use as keyword instead!")] + [EditorBrowsable(EditorBrowsableState.Never)] + public static Layer DownCast(BaseHandle handle) { - internal static readonly int BEHAVIOR = NDalicPINVOKE.Layer_Property_BEHAVIOR_get(); + Layer ret = Registry.GetManagedBaseHandleFromNativePtr(handle) as Layer; + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; } /// - /// Creates a Layer object. + /// Search through this layer's hierarchy for a view with the given unique ID. /// + ///
This layer (the parent) has been initialized.
+ /// The actor itself is also considered in the search. + /// The id of the child to find + /// A handle to the view if found, or an empty handle if not. /// 3 - public Layer() : this(NDalicPINVOKE.Layer_New(), true) - { - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - if(Window.Instance != null) - { - this.SetAnchorPoint(Tizen.NUI.PivotPoint.TopLeft); - this.SetResizePolicy(ResizePolicyType.FillToParent, DimensionType.AllDimensions); - } - } - internal void SetAnchorPoint(Vector3 anchorPoint) - { - NDalicPINVOKE.Actor_SetAnchorPoint(swigCPtr, Vector3.getCPtr(anchorPoint)); - if (NDalicPINVOKE.SWIGPendingException.Pending) - throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - internal void SetResizePolicy(ResizePolicyType policy, DimensionType dimension) - { - NDalicPINVOKE.Actor_SetResizePolicy(swigCPtr, (int)policy, (int)dimension); - if (NDalicPINVOKE.SWIGPendingException.Pending) - throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - /// - /// Downcasts a handle to layer handle. - /// - /// 3 - /// Please do not use! this will be deprecated! - /// Instead please use as keyword. - [Obsolete("Please do not use! This will be deprecated! Please use as keyword instead!")] - [EditorBrowsable(EditorBrowsableState.Never)] - public static Layer DownCast(BaseHandle handle) - { - Layer ret = Registry.GetManagedBaseHandleFromNativePtr(handle) as Layer; - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - /// - /// Search through this layer's hierarchy for a view with the given unique ID. - /// - ///
This layer (the parent) has been initialized.
- /// The actor itself is also considered in the search. - /// The id of the child to find - /// A handle to the view if found, or an empty handle if not. - /// 3 - public View FindChildById(uint id) + public View FindChildById(uint id) { //to fix memory leak issue, match the handle count with native side. IntPtr cPtr = NDalicPINVOKE.Actor_FindChildById(swigCPtr, id); @@ -246,33 +383,6 @@ namespace Tizen.NUI } /// - /// Queries the depth of the layer.
- /// 0 is the bottommost layer, higher number is on the top.
- ///
- /// 3 - public uint Depth - { - get - { - return GetDepth(); - } - } - - internal uint GetDepth() - { - var parentChildren = Window.Instance.LayersChildren; - if(parentChildren != null) - { - int idx = parentChildren.IndexOf(this); - if (idx >= 0) - { - return Convert.ToUInt32(idx); ; - } - } - return 0u; - } - - /// /// Increments the depth of the layer. /// /// 3 @@ -310,62 +420,6 @@ namespace Tizen.NUI } } - internal void RaiseAbove(Layer target) - { - var parentChildren = Window.Instance.LayersChildren; - if (parentChildren != null) - { - int currentIndex = parentChildren.IndexOf(this); - int targetIndex = parentChildren.IndexOf(target); - - if(currentIndex < 0 || targetIndex < 0 || - currentIndex >= parentChildren.Count || targetIndex >= parentChildren.Count) - { - NUILog.Error("index should be bigger than 0 and less than children of layer count"); - return; - } - - // If the currentIndex is less than the target index and the target has the same parent. - if (currentIndex < targetIndex) - { - parentChildren.Remove(this); - parentChildren.Insert(targetIndex, this); - - NDalicPINVOKE.Layer_MoveAbove(swigCPtr, Layer.getCPtr(target)); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - } - } - - internal void LowerBelow(Layer target) - { - var parentChildren = Window.Instance.LayersChildren; - - if (parentChildren != null) - { - int currentIndex = parentChildren.IndexOf(this); - int targetIndex = parentChildren.IndexOf(target); - - if(currentIndex < 0 || targetIndex < 0 || - currentIndex >= parentChildren.Count || targetIndex >= parentChildren.Count) - { - NUILog.Error("index should be bigger than 0 and less than children of layer count"); - return; - } - - // If the currentIndex is not already the 0th index and the target has the same parent. - if ((currentIndex != 0) && (targetIndex != -1) && - (currentIndex > targetIndex)) - { - parentChildren.Remove(this); - parentChildren.Insert(targetIndex, this); - - NDalicPINVOKE.Layer_MoveBelow(swigCPtr, Layer.getCPtr(target)); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - } - } - /// /// Raises the layer to the top. /// @@ -427,17 +481,92 @@ namespace Tizen.NUI if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } - private void SetBehavior(LayerBehavior behavior) + internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Layer obj) { - NDalicPINVOKE.Layer_SetBehavior(swigCPtr, (int)behavior); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; } - private LayerBehavior GetBehavior() + internal void SetAnchorPoint(Vector3 anchorPoint) { - Layer.LayerBehavior ret = (Layer.LayerBehavior)NDalicPINVOKE.Layer_GetBehavior(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; + NDalicPINVOKE.Actor_SetAnchorPoint(swigCPtr, Vector3.getCPtr(anchorPoint)); + if (NDalicPINVOKE.SWIGPendingException.Pending) + throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + internal void SetResizePolicy(ResizePolicyType policy, DimensionType dimension) + { + NDalicPINVOKE.Actor_SetResizePolicy(swigCPtr, (int)policy, (int)dimension); + if (NDalicPINVOKE.SWIGPendingException.Pending) + throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + internal uint GetDepth() + { + var parentChildren = Window.Instance.LayersChildren; + if (parentChildren != null) + { + int idx = parentChildren.IndexOf(this); + if (idx >= 0) + { + return Convert.ToUInt32(idx); ; + } + } + return 0u; + } + internal void RaiseAbove(Layer target) + { + var parentChildren = Window.Instance.LayersChildren; + if (parentChildren != null) + { + int currentIndex = parentChildren.IndexOf(this); + int targetIndex = parentChildren.IndexOf(target); + + if (currentIndex < 0 || targetIndex < 0 || + currentIndex >= parentChildren.Count || targetIndex >= parentChildren.Count) + { + NUILog.Error("index should be bigger than 0 and less than children of layer count"); + return; + } + + // If the currentIndex is less than the target index and the target has the same parent. + if (currentIndex < targetIndex) + { + parentChildren.Remove(this); + parentChildren.Insert(targetIndex, this); + + NDalicPINVOKE.Layer_MoveAbove(swigCPtr, Layer.getCPtr(target)); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + } + } + + internal void LowerBelow(Layer target) + { + var parentChildren = Window.Instance.LayersChildren; + + if (parentChildren != null) + { + int currentIndex = parentChildren.IndexOf(this); + int targetIndex = parentChildren.IndexOf(target); + + if (currentIndex < 0 || targetIndex < 0 || + currentIndex >= parentChildren.Count || targetIndex >= parentChildren.Count) + { + NUILog.Error("index should be bigger than 0 and less than children of layer count"); + return; + } + + // If the currentIndex is not already the 0th index and the target has the same parent. + if ((currentIndex != 0) && (targetIndex != -1) && + (currentIndex > targetIndex)) + { + parentChildren.Remove(this); + parentChildren.Insert(targetIndex, this); + + NDalicPINVOKE.Layer_MoveBelow(swigCPtr, Layer.getCPtr(target)); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + } } internal void SetSortFunction(SWIGTYPE_p_f_r_q_const__Dali__Vector3__float function) @@ -472,211 +601,83 @@ namespace Tizen.NUI return ret; } - internal void AddViewToLayerList( View view ) + internal void AddViewToLayerList(View view) { Children.Add(view); } - internal void RemoveViewFromLayerList( View view ) + internal void RemoveViewFromLayerList(View view) { Children.Remove(view); } - /// - /// Enumeration for the behavior of the layer. - /// - /// 3 - public enum LayerBehavior + internal string GetName() { - /// - /// UI control rendering mode. - /// - /// 3 - Layer2D, - /// - /// UI control rendering mode (default mode). - /// This mode is designed for UI controls that can overlap. In this - /// mode renderer order will be respective to the tree hierarchy of - /// Actors.
- /// The rendering order is depth first, so for the following actor tree, - /// A will be drawn first, then B, D, E, then C, F. This ensures that - /// overlapping actors are drawn as expected (whereas, with breadth first - /// traversal, the actors would interleave).
- ///
- /// 3 - LayerUI = Layer2D, - /// - /// Layer will use depth test. - /// This mode is designed for a 3 dimensional scene where actors in front - /// of other actors will obscure them, i.e. the actors are sorted by the - /// distance from the camera.
- /// When using this mode, a depth test will be used. A depth clear will - /// happen for each layer, which means actors in a layer "above" other - /// layers will be rendered in front of actors in those layers regardless - /// of their Z positions (see Layer::Raise() and Layer::Lower()).
- /// Opaque renderers are drawn first and write to the depth buffer. Then - /// transparent renderers are drawn with depth test enabled but depth - /// write switched off. Transparent renderers are drawn based on their - /// distance from the camera. A renderer's DEPTH_INDEX property is used to - /// offset the distance to the camera when ordering transparent renderers. - /// This is useful if you want to define the draw order of two or more - /// transparent renderers that are equal distance from the camera. Unlike - /// LAYER_UI, parent-child relationship does not affect rendering order at - /// all. - ///
- /// 3 - Layer3D + string ret = NDalicPINVOKE.Actor_GetName(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) + throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; } - internal enum TreeDepthMultiplier + internal void SetName(string name) { - TREE_DEPTH_MULTIPLIER = 10000 + NDalicPINVOKE.Actor_SetName(swigCPtr, name); + if (NDalicPINVOKE.SWIGPendingException.Pending) + throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } /// - /// Layer behavior, type String (Layer.LayerBehavior). + /// Dispose. /// /// 3 - public Layer.LayerBehavior Behavior + protected override void Dispose(DisposeTypes type) { - get - { - return GetBehavior(); - } - set + if (disposed) { - SetBehavior(value); + return; } - } - /// - /// Internal only property to enable or disable clipping, type boolean. - /// By default, this is false, i.e., the viewport of the layer is the entire window. - /// - internal bool ClippingEnabled - { - get - { - bool ret = NDalicPINVOKE.Layer_IsClipping(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - set + if (type == DisposeTypes.Explicit) { - NDalicPINVOKE.Layer_SetClipping(swigCPtr, value); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + //Called by User + //Release your own managed resources here. + //You should release all of your own disposable objects here. } - } - /// - /// Sets the viewport (in window coordinates), type rectangle. - /// The contents of the layer will not be visible outside this box, when ViewportEnabled is true. - /// - /// 4 - public Rectangle Viewport - { - get + //Release your own unmanaged resources here. + //You should not access any managed member here except static instance. + //because the execution order of Finalizes is non-deterministic. + + if (swigCPtr.Handle != global::System.IntPtr.Zero) { - if( ClippingEnabled ) - { - Rectangle ret = new Rectangle(NDalicPINVOKE.Layer_GetClippingBox(swigCPtr), true); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - else + if (swigCMemOwn) { - // Clipping not enabled so return the window size - Size2D windowSize = Window.Instance.Size; - Rectangle ret = new Rectangle(0, 0, windowSize.Width, windowSize.Height); - return ret; + swigCMemOwn = false; + NDalicPINVOKE.delete_Layer(swigCPtr); } + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); } - set - { - NDalicPINVOKE.Layer_SetClippingBox__SWIG_1(swigCPtr, Rectangle.getCPtr(value)); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - ClippingEnabled = true; - } - } - - /// - /// Retrieves and sets the layer's opacity.
- ///
- /// 3 - public float Opacity - { - get - { - float temp = 0.0f; - GetProperty(View.Property.OPACITY).Get(out temp); - return temp; - } - set - { - SetProperty(View.Property.OPACITY, new Tizen.NUI.PropertyValue(value)); - } - } - /// - /// Retrieves and sets the layer's visibility. - /// - /// 3 - public bool Visibility - { - get - { - bool temp = false; - GetProperty(View.Property.VISIBLE).Get(out temp); - return temp; - } - set - { - SetProperty(View.Property.VISIBLE, new Tizen.NUI.PropertyValue(value)); - } - } + base.Dispose(type); - /// - /// Get the number of children held by the layer. - /// - /// 3 - public new uint ChildCount - { - get - { - return Convert.ToUInt32(Children.Count); - } } - /// - /// Gets or sets the layer's name. - /// - /// 3 - public string Name + private void SetBehavior(LayerBehavior behavior) { - get - { - return GetName(); - } - set - { - SetName(value); - } + NDalicPINVOKE.Layer_SetBehavior(swigCPtr, (int)behavior); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } - internal string GetName() + private LayerBehavior GetBehavior() { - string ret = NDalicPINVOKE.Actor_GetName(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) - throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + Layer.LayerBehavior ret = (Layer.LayerBehavior)NDalicPINVOKE.Layer_GetBehavior(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } - internal void SetName(string name) + internal class Property { - NDalicPINVOKE.Actor_SetName(swigCPtr, name); - if (NDalicPINVOKE.SWIGPendingException.Pending) - throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + internal static readonly int BEHAVIOR = NDalicPINVOKE.Layer_Property_BEHAVIOR_get(); } - } } \ No newline at end of file diff --git a/src/Tizen.NUI/src/public/LongPressGesture.cs b/src/Tizen.NUI/src/public/LongPressGesture.cs index 0ac3912..0f59c87 100755 --- a/src/Tizen.NUI/src/public/LongPressGesture.cs +++ b/src/Tizen.NUI/src/public/LongPressGesture.cs @@ -27,57 +27,19 @@ namespace Tizen.NUI { private global::System.Runtime.InteropServices.HandleRef swigCPtr; - internal LongPressGesture(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.LongPressGesture_SWIGUpcast(cPtr), cMemoryOwn) - { - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); - } - - internal static global::System.Runtime.InteropServices.HandleRef getCPtr(LongPressGesture obj) - { - return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; - } - /// - /// Dispose. + /// The constructor. /// + /// The state of the gesture /// 3 - protected override void Dispose(DisposeTypes type) + public LongPressGesture(Gesture.StateType state) : this(NDalicPINVOKE.new_LongPressGesture__SWIG_0((int)state), true) { - if(disposed) - { - return; - } - - if(type == DisposeTypes.Explicit) - { - //Called by User - //Release your own managed resources here. - //You should release all of your own disposable objects here. - } - - //Release your own unmanaged resources here. - //You should not access any managed member here except static instance. - //because the execution order of Finalizes is non-deterministic. - - if (swigCPtr.Handle != global::System.IntPtr.Zero) - { - if (swigCMemOwn) - { - swigCMemOwn = false; - NDalicPINVOKE.delete_LongPressGesture(swigCPtr); - } - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); - } - - base.Dispose(type); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } - - internal static LongPressGesture GetLongPressGestureFromPtr(global::System.IntPtr cPtr) + internal LongPressGesture(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.LongPressGesture_SWIGUpcast(cPtr), cMemoryOwn) { - LongPressGesture ret = new LongPressGesture(cPtr, false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); } /// @@ -119,16 +81,6 @@ namespace Tizen.NUI } } - /// - /// The constructor. - /// - /// The state of the gesture - /// 3 - public LongPressGesture(Gesture.StateType state) : this(NDalicPINVOKE.new_LongPressGesture__SWIG_0((int)state), true) - { - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - private uint numberOfTouches { @@ -177,6 +129,51 @@ namespace Tizen.NUI } } - } + internal static global::System.Runtime.InteropServices.HandleRef getCPtr(LongPressGesture obj) + { + return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; + } + internal static LongPressGesture GetLongPressGestureFromPtr(global::System.IntPtr cPtr) + { + LongPressGesture ret = new LongPressGesture(cPtr, false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + /// + /// Dispose. + /// + /// 3 + protected override void Dispose(DisposeTypes type) + { + if(disposed) + { + return; + } + + if(type == DisposeTypes.Explicit) + { + //Called by User + //Release your own managed resources here. + //You should release all of your own disposable objects here. + } + + //Release your own unmanaged resources here. + //You should not access any managed member here except static instance. + //because the execution order of Finalizes is non-deterministic. + + if (swigCPtr.Handle != global::System.IntPtr.Zero) + { + if (swigCMemOwn) + { + swigCMemOwn = false; + NDalicPINVOKE.delete_LongPressGesture(swigCPtr); + } + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); + } + + base.Dispose(type); + } + } } \ No newline at end of file diff --git a/src/Tizen.NUI/src/public/LongPressGestureDetector.cs b/src/Tizen.NUI/src/public/LongPressGestureDetector.cs index 255ecca..79d1067 100755 --- a/src/Tizen.NUI/src/public/LongPressGestureDetector.cs +++ b/src/Tizen.NUI/src/public/LongPressGestureDetector.cs @@ -33,106 +33,62 @@ namespace Tizen.NUI { private global::System.Runtime.InteropServices.HandleRef swigCPtr; - internal LongPressGestureDetector(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.LongPressGestureDetector_SWIGUpcast(cPtr), cMemoryOwn) + private DaliEventHandler _longPressGestureEventHandler; + private DetectedCallbackDelegate _longPressGestureCallbackDelegate; + + /// + /// Constructor. + /// + /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + public LongPressGestureDetector() : this(NDalicPINVOKE.LongPressGestureDetector_New__SWIG_0(), true) { - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } - internal static global::System.Runtime.InteropServices.HandleRef getCPtr(LongPressGestureDetector obj) + /// + /// Creates an initialized LongPressGestureDetector with the number of touches required.
+ /// A long press gesture will be emitted from this detector if the number of fingers touching the screen is equal to the touches required.
+ ///
+ /// The number of touches required. + /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + public LongPressGestureDetector(uint touchesRequired) : this(NDalicPINVOKE.LongPressGestureDetector_New__SWIG_1(touchesRequired), true) { - return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } /// - /// Dispose. + /// Creates an initialized LongPressGestureDetector with the minimum and maximum number of touches required.
+ /// A long press gesture will be emitted from this detector if the number of fingers touching the screen falls between the minimum and maximum touches set.
///
- /// The dispose type + /// The minimum number of touches required. + /// The maximum number of touches required. /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] - protected override void Dispose(DisposeTypes type) + public LongPressGestureDetector(uint minTouches, uint maxTouches) : this(NDalicPINVOKE.LongPressGestureDetector_New__SWIG_2(minTouches, maxTouches), true) { - if (disposed) - { - return; - } - - if (type == DisposeTypes.Explicit) - { - //Called by User - //Release your own managed resources here. - //You should release all of your own disposable objects here. - - } - - //Release your own unmanaged resources here. - //You should not access any managed member here except static instance. - //because the execution order of Finalizes is non-deterministic. - - if (swigCPtr.Handle != global::System.IntPtr.Zero) - { - if (swigCMemOwn) - { - swigCMemOwn = false; - NDalicPINVOKE.delete_LongPressGestureDetector(swigCPtr); - } - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); - } - - base.Dispose(type); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } /// - /// Event arguments that passed via the LongPressGestureEvent signal. + /// The copy constructor. /// - /// 5 + /// A reference to the copied handle /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] - public class DetectedEventArgs : EventArgs + public LongPressGestureDetector(LongPressGestureDetector handle) : this(NDalicPINVOKE.new_LongPressGestureDetector__SWIG_1(LongPressGestureDetector.getCPtr(handle)), true) { - private View _view; - private LongPressGesture _longPressGesture; - - /// - /// View the attached view. - /// - /// 5 - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - public View View - { - get - { - return _view; - } - set - { - _view = value; - } - } + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } - /// - /// The LongPressGesture. - /// - /// 5 - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - public LongPressGesture LongPressGesture - { - get - { - return _longPressGesture; - } - set - { - _longPressGesture = value; - } - } + internal LongPressGestureDetector(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.LongPressGestureDetector_SWIGUpcast(cPtr), cMemoryOwn) + { + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); } [UnmanagedFunctionPointer(CallingConvention.StdCall)] private delegate void DetectedCallbackDelegate(IntPtr actor, IntPtr longPressGesture); - private DaliEventHandler _longPressGestureEventHandler; - private DetectedCallbackDelegate _longPressGestureCallbackDelegate; /// /// This signal is emitted when the specified long press is detected on the attached view. @@ -170,83 +126,70 @@ namespace Tizen.NUI } } - private void OnLongPressGestureDetected(IntPtr actor, IntPtr longPressGesture) - { - DetectedEventArgs e = new DetectedEventArgs(); - - // Populate all members of "e" (LongPressGestureEventArgs) with real data. - e.View = Registry.GetManagedBaseHandleFromNativePtr(actor) as View; - e.LongPressGesture = Tizen.NUI.LongPressGesture.GetLongPressGestureFromPtr(longPressGesture); - - if (_longPressGestureEventHandler != null) - { - //Here we send all data to user event handlers. - _longPressGestureEventHandler(this, e); - } - - } - - internal static LongPressGestureDetector GetLongPressGestureDetectorFromPtr(global::System.IntPtr cPtr) + /// + /// Sets the number of touches required.
+ /// The number of touches corresponds to the number of fingers a user has on the screen. The default is 1.
+ ///
+ /// Touches required + /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + public void SetTouchesRequired(uint touches) { - LongPressGestureDetector ret = new LongPressGestureDetector(cPtr, false); + NDalicPINVOKE.LongPressGestureDetector_SetTouchesRequired__SWIG_0(swigCPtr, touches); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; } /// - /// Constructor. + /// Sets the minimum and maximum touches required. /// + /// Minimum touches required. + /// Maximum touches required. /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] - public LongPressGestureDetector() : this(NDalicPINVOKE.LongPressGestureDetector_New__SWIG_0(), true) + public void SetTouchesRequired(uint minTouches, uint maxTouches) { + NDalicPINVOKE.LongPressGestureDetector_SetTouchesRequired__SWIG_1(swigCPtr, minTouches, maxTouches); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } /// - /// Creates an initialized LongPressGestureDetector with the number of touches required.
- /// A long press gesture will be emitted from this detector if the number of fingers touching the screen is equal to the touches required.
+ /// Retrieves the minimum number of touches required. ///
- /// The number of touches required. + /// The minimum number of touches required. /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] - public LongPressGestureDetector(uint touchesRequired) : this(NDalicPINVOKE.LongPressGestureDetector_New__SWIG_1(touchesRequired), true) + public uint GetMinimumTouchesRequired() { + uint ret = NDalicPINVOKE.LongPressGestureDetector_GetMinimumTouchesRequired(swigCPtr); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - + return ret; } /// - /// Creates an initialized LongPressGestureDetector with the minimum and maximum number of touches required.
- /// A long press gesture will be emitted from this detector if the number of fingers touching the screen falls between the minimum and maximum touches set.
+ /// Retrieves the maximum number of touches required. ///
- /// The minimum number of touches required. - /// The maximum number of touches required. + /// The maximum number of touches required. /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] - public LongPressGestureDetector(uint minTouches, uint maxTouches) : this(NDalicPINVOKE.LongPressGestureDetector_New__SWIG_2(minTouches, maxTouches), true) + public uint GetMaximumTouchesRequired() { + uint ret = NDalicPINVOKE.LongPressGestureDetector_GetMaximumTouchesRequired(swigCPtr); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - + return ret; } - internal new static LongPressGestureDetector DownCast(BaseHandle handle) + internal static LongPressGestureDetector GetLongPressGestureDetectorFromPtr(global::System.IntPtr cPtr) { - LongPressGestureDetector ret = Registry.GetManagedBaseHandleFromNativePtr(handle) as LongPressGestureDetector; + LongPressGestureDetector ret = new LongPressGestureDetector(cPtr, false); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } - /// - /// The copy constructor. - /// - /// A reference to the copied handle - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - public LongPressGestureDetector(LongPressGestureDetector handle) : this(NDalicPINVOKE.new_LongPressGestureDetector__SWIG_1(LongPressGestureDetector.getCPtr(handle)), true) + internal new static LongPressGestureDetector DownCast(BaseHandle handle) { + LongPressGestureDetector ret = Registry.GetManagedBaseHandleFromNativePtr(handle) as LongPressGestureDetector; if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; } internal LongPressGestureDetector Assign(LongPressGestureDetector rhs) @@ -256,65 +199,117 @@ namespace Tizen.NUI return ret; } - /// - /// Sets the number of touches required.
- /// The number of touches corresponds to the number of fingers a user has on the screen. The default is 1.
- ///
- /// Touches required - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - public void SetTouchesRequired(uint touches) + internal LongPressGestureDetectedSignal DetectedSignal() { - NDalicPINVOKE.LongPressGestureDetector_SetTouchesRequired__SWIG_0(swigCPtr, touches); + LongPressGestureDetectedSignal ret = new LongPressGestureDetectedSignal(NDalicPINVOKE.LongPressGestureDetector_DetectedSignal(swigCPtr), false); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; } - /// - /// Sets the minimum and maximum touches required. - /// - /// Minimum touches required. - /// Maximum touches required. - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - public void SetTouchesRequired(uint minTouches, uint maxTouches) + internal static global::System.Runtime.InteropServices.HandleRef getCPtr(LongPressGestureDetector obj) { - NDalicPINVOKE.LongPressGestureDetector_SetTouchesRequired__SWIG_1(swigCPtr, minTouches, maxTouches); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; } /// - /// Retrieves the minimum number of touches required. + /// Dispose. /// - /// The minimum number of touches required. + /// The dispose type /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] - public uint GetMinimumTouchesRequired() + protected override void Dispose(DisposeTypes type) { - uint ret = NDalicPINVOKE.LongPressGestureDetector_GetMinimumTouchesRequired(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; + if (disposed) + { + return; + } + + if (type == DisposeTypes.Explicit) + { + //Called by User + //Release your own managed resources here. + //You should release all of your own disposable objects here. + + } + + //Release your own unmanaged resources here. + //You should not access any managed member here except static instance. + //because the execution order of Finalizes is non-deterministic. + + if (swigCPtr.Handle != global::System.IntPtr.Zero) + { + if (swigCMemOwn) + { + swigCMemOwn = false; + NDalicPINVOKE.delete_LongPressGestureDetector(swigCPtr); + } + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); + } + + base.Dispose(type); + } + + private void OnLongPressGestureDetected(IntPtr actor, IntPtr longPressGesture) + { + DetectedEventArgs e = new DetectedEventArgs(); + + // Populate all members of "e" (LongPressGestureEventArgs) with real data. + e.View = Registry.GetManagedBaseHandleFromNativePtr(actor) as View; + e.LongPressGesture = Tizen.NUI.LongPressGesture.GetLongPressGestureFromPtr(longPressGesture); + + if (_longPressGestureEventHandler != null) + { + //Here we send all data to user event handlers. + _longPressGestureEventHandler(this, e); + } } /// - /// Retrieves the maximum number of touches required. + /// Event arguments that passed via the LongPressGestureEvent signal. /// - /// The maximum number of touches required. + /// 5 /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] - public uint GetMaximumTouchesRequired() + public class DetectedEventArgs : EventArgs { - uint ret = NDalicPINVOKE.LongPressGestureDetector_GetMaximumTouchesRequired(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } + private View _view; + private LongPressGesture _longPressGesture; - internal LongPressGestureDetectedSignal DetectedSignal() - { - LongPressGestureDetectedSignal ret = new LongPressGestureDetectedSignal(NDalicPINVOKE.LongPressGestureDetector_DetectedSignal(swigCPtr), false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } + /// + /// View the attached view. + /// + /// 5 + /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + public View View + { + get + { + return _view; + } + set + { + _view = value; + } + } + /// + /// The LongPressGesture. + /// + /// 5 + /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + public LongPressGesture LongPressGesture + { + get + { + return _longPressGesture; + } + set + { + _longPressGesture = value; + } + } + } } - } diff --git a/src/Tizen.NUI/src/public/NUIApplication.cs b/src/Tizen.NUI/src/public/NUIApplication.cs index f5a273a..9d4fabd 100755 --- a/src/Tizen.NUI/src/public/NUIApplication.cs +++ b/src/Tizen.NUI/src/public/NUIApplication.cs @@ -34,21 +34,11 @@ namespace Tizen.NUI public class NUIApplication : CoreApplication { /// - /// Occurs whenever the application is resumed. - /// - /// 4 - public event EventHandler Resumed; - - /// - /// Occurs whenever the application is paused. - /// - /// 4 - public event EventHandler Paused; - - /// /// The instance of ResourceManager. /// private static System.Resources.ResourceManager resourceManager = null; + private Size2D _windowSize2D = null; + private Position2D _windowPosition2D = null; /// /// The default constructor. @@ -59,8 +49,6 @@ namespace Tizen.NUI Registry.Instance.SavedApplicationThread = Thread.CurrentThread; } - private Size2D _windowSize2D = null; - private Position2D _windowPosition2D = null; /// /// The constructor with window size and position. /// @@ -147,6 +135,124 @@ namespace Tizen.NUI if (windowSize != null) { _windowSize2D = windowSize; } if (windowPosition != null) { _windowPosition2D = windowPosition; } Registry.Instance.SavedApplicationThread = Thread.CurrentThread; + + //Workaround for Vulkan. should be removed. + if (Graphics.Backend == Graphics.BackendType.Vulkan) + { + Tizen.Log.Error("NUI", "[NOT ERROR] NUIApplication Constructor! Vulkan backend!"); + Tizen.NUI.Version.PrintDaliNativeVersion(); + NDalicPINVOKE.SetAgainExceptionHelperAndStringHelper(); + } + } + + /// + /// Occurs whenever the application is resumed. + /// + /// 4 + public event EventHandler Resumed; + + /// + /// Occurs whenever the application is paused. + /// + /// 4 + public event EventHandler Paused; + + /// + /// Enumeration for deciding whether a NUI application window is opaque or transparent. + /// + /// 3 + public enum WindowMode + { + /// + /// Opaque + /// + /// 3 + Opaque = 0, + /// + /// Transparent + /// + /// 3 + Transparent = 1 + } + + /// + /// ResourceManager to handle multilingual. + /// + /// 4 + public static System.Resources.ResourceManager MultilingualResourceManager + { + get + { + return resourceManager; + } + set + { + resourceManager = value; + } + } + + /// + /// Gets the window instance. + /// + /// 3 + [Obsolete("Please do not use! This will be deprecated!")] + [EditorBrowsable(EditorBrowsableState.Never)] + public Window Window + { + get + { + return Window.Instance; + } + } + + internal Application ApplicationHandle + { + get + { + return ((NUICoreBackend)this.Backend).ApplicationHandle; + } + } + + /// + /// Register the assembly to XAML. + /// + /// 5 + public static void RegisterAssembly(Assembly assembly) + { + XamlParser.s_assemblies.Add(assembly); + } + + /// + /// Runs the NUIApplication. + /// + /// Arguments from commandline. + /// 4 + public override void Run(string[] args) + { + Backend.AddEventHandler(EventType.PreCreated, OnPreCreate); + Backend.AddEventHandler(EventType.Resumed, OnResume); + Backend.AddEventHandler(EventType.Paused, OnPause); + base.Run(args); + } + + /// + /// Exits the NUIApplication. + /// + /// 4 + public override void Exit() + { + base.Exit(); + } + + /// + /// Ensures that the function passed in is called from the main loop when it is idle. + /// + /// The function to call + /// true if added successfully, false otherwise + /// 4 + public bool AddIdle(System.Delegate func) + { + return ((NUICoreBackend)this.Backend).AddIdle(func); } /// @@ -251,105 +357,6 @@ namespace Tizen.NUI base.OnCreate(); Device.PlatformServices = new TizenPlatformServices(); } - - /// - /// Runs the NUIApplication. - /// - /// Arguments from commandline. - /// 4 - public override void Run(string[] args) - { - Backend.AddEventHandler(EventType.PreCreated, OnPreCreate); - Backend.AddEventHandler(EventType.Resumed, OnResume); - Backend.AddEventHandler(EventType.Paused, OnPause); - base.Run(args); - } - - /// - /// Exits the NUIApplication. - /// - /// 4 - public override void Exit() - { - base.Exit(); - } - - /// - /// Ensures that the function passed in is called from the main loop when it is idle. - /// - /// The function to call - /// true if added successfully, false otherwise - /// 4 - public bool AddIdle(System.Delegate func) - { - return ((NUICoreBackend)this.Backend).AddIdle(func); - } - - /// - /// Enumeration for deciding whether a NUI application window is opaque or transparent. - /// - /// 3 - public enum WindowMode - { - /// - /// Opaque - /// - /// 3 - Opaque = 0, - /// - /// Transparent - /// - /// 3 - Transparent = 1 - } - - - internal Application ApplicationHandle - { - get - { - return ((NUICoreBackend)this.Backend).ApplicationHandle; - } - } - - /// - /// ResourceManager to handle multilingual. - /// - /// 4 - public static System.Resources.ResourceManager MultilingualResourceManager - { - get - { - return resourceManager; - } - set - { - resourceManager = value; - } - } - - /// - /// Register the assembly to XAML. - /// - /// 5 - public static void RegisterAssembly(Assembly assembly) - { - XamlParser.s_assemblies.Add(assembly); - } - - /// - /// Gets the window instance. - /// - /// 3 - [Obsolete("Please do not use! This will be deprecated!")] - [EditorBrowsable(EditorBrowsableState.Never)] - public Window Window - { - get - { - return Window.Instance; - } - } } /// @@ -360,6 +367,13 @@ namespace Tizen.NUI public class Graphics { /// + /// Active backend + /// + public static BackendType Backend = BackendType.Gles; + internal const string GlesCSharpBinder = "libdali-csharp-binder.so"; + internal const string VulkanCSharpBinder = "libdali-csharp-binder-vk.so"; + + /// /// Enumeration for Rendering backend /// public enum BackendType @@ -373,13 +387,5 @@ namespace Tizen.NUI /// Vulkan } - - /// - /// Active backend - /// - public static BackendType Backend = BackendType.Gles; - internal const string GlesCSharpBinder = "libdali-csharp-binder.so"; - internal const string VulkanCSharpBinder = "libdali-csharp-binder-vk.so"; } - } diff --git a/src/Tizen.NUI/src/public/NUIConstants.cs b/src/Tizen.NUI/src/public/NUIConstants.cs index d7d042c..7cbd025 100755 --- a/src/Tizen.NUI/src/public/NUIConstants.cs +++ b/src/Tizen.NUI/src/public/NUIConstants.cs @@ -120,6 +120,8 @@ namespace Tizen.NUI /// /// Will be replaced by separate ClippingMode enum. Draw the actor and its children into the stencil buffer. /// + [Obsolete("Please do not use! This will be deprecated!")] + [EditorBrowsable(EditorBrowsableState.Never)] Stencil = 3 } @@ -688,7 +690,6 @@ namespace Tizen.NUI Attached } - /// /// The type of coordinate system for certain attributes of the points in a gradient. /// @@ -914,931 +915,1130 @@ namespace Tizen.NUI } /// - /// This specifies visual types. + /// The type for HiddenInput mode. /// /// 3 - public struct Visual + public enum HiddenInputModeType { /// - /// The index for the visual type. + /// Don't hide text. /// - /// 3 - public enum Type - { - /// - /// Renders a solid color as an internal border to the control's quad. - /// - Border, - /// - /// Renders a solid color to the control's quad. - /// - Color, - /// - /// Renders a smooth transition of colors to the control's quad. - /// - Gradient, - /// - /// Renders an image into the control's quad. - /// - Image, - /// - /// Renders a mesh using an "obj" file, optionally with textures provided by an "mtl" file. - /// - Mesh, - /// - /// Renders a simple 3D shape, such as a cube or a sphere. - /// - Primitive, - /// - /// Renders a simple wire-frame outlining a quad. - /// - Wireframe, - /// - /// Renders text. - /// - Text, - /// - /// Renders an NPatch image. - /// - NPatch, - /// - /// Renders an SVG image. - /// - SVG, - /// - /// Renders a animated image (animated GIF). - /// - AnimatedImage - } - + HideNone, /// - /// This specifies visual properties. + /// Hide all the input text. /// - /// 3 - public struct Property - { - /// - /// Type. - /// - /// 3 - public static readonly int Type = NDalic.VISUAL_PROPERTY_TYPE; - /// - /// Shader. - /// - /// 3 - public static readonly int Shader = NDalic.VISUAL_PROPERTY_SHADER; - /// - /// Transform. - /// - /// 3 - public static readonly int Transform = NDalic.VISUAL_PROPERTY_TRANSFORM; - /// - /// PremultipliedAlpha. - /// - /// 3 - public static readonly int PremultipliedAlpha = NDalic.VISUAL_PROPERTY_PREMULTIPLIED_ALPHA; - /// - /// MixColor. - /// - /// 3 - public static readonly int MixColor = NDalic.VISUAL_PROPERTY_MIX_COLOR; - /// - /// Opacity. - /// - /// 3 - public static readonly int Opacity = NDalic.VISUAL_PROPERTY_MIX_COLOR + 1; - /// - /// The fitting mode of the visual. - /// - /// 5 - public static readonly int VisualFittingMode = NDalic.VISUAL_PROPERTY_MIX_COLOR + 2; - } - + HideAll, /// - /// This specifies shader properties. + /// Hide n characters from start. /// - /// 3 - public struct ShaderProperty - { - /// - /// Vertex shader code - /// - /// 3 - public static readonly int VertexShader = NDalic.VISUAL_SHADER_VERTEX; - /// - /// Fragment shader code - /// - /// 3 - public static readonly int FragmentShader = NDalic.VISUAL_SHADER_FRAGMENT; - /// - /// How to subdivide the grid along X - /// - /// 3 - public static readonly int ShaderSubdivideGridX = NDalic.VISUAL_SHADER_SUBDIVIDE_GRID_X; - /// - /// How to subdivide the grid along Y - /// - /// 3 - public static readonly int ShaderSubdivideGridY = NDalic.VISUAL_SHADER_SUBDIVIDE_GRID_Y; - /// - /// Bitmask of hints - /// - /// 3 - public static readonly int ShaderHints = NDalic.VISUAL_SHADER_HINTS; - } - + HideCount, /// - /// This specifies visaul align types. + /// Show n characters from start. /// - /// 3 - public enum AlignType - { - /// - /// TopBegin - /// - /// 3 - TopBegin = 0, - /// - /// TopCenter - /// - /// 3 - TopCenter, - /// - /// TopEnd - /// - /// 3 - TopEnd, - /// - /// CenterBegin - /// - /// 3 - CenterBegin, - /// - /// Center - /// - /// 3 - Center, - /// - /// CenterEnd - /// - /// 3 - CenterEnd, - /// - /// BottomBegin - /// - /// 3 - BottomBegin, - /// - /// BottomCenter - /// - /// 3 - BottomCenter, - /// - /// BottomEnd - /// - /// 3 - BottomEnd - } + ShowCount, + /// + /// Show last character for the duration(use ShowLastCharacterDuration property to modify duration). + /// + ShowLastCharacter } /// - /// This specifies properties of the BorderVisual. + /// Auto scrolling stop behavior. /// /// 3 - public struct BorderVisualProperty + public enum AutoScrollStopMode { /// - /// The color of the border. - /// - /// 3 - public static readonly int Color = NDalic.BORDER_VISUAL_COLOR; - /// - /// The width of the border (in pixels). + /// Stop animation after current loop finished. /// - /// 3 - public static readonly int Size = NDalic.BORDER_VISUAL_SIZE; + FinishLoop, /// - /// Whether anti-aliasing of the border is required. + /// Stop animation immediately and reset position. /// - /// 3 - public static readonly int AntiAliasing = NDalic.BORDER_VISUAL_ANTI_ALIASING; + Immediate } /// - /// This specifies properties of the ColorVisual. + /// An enum of screen mode. /// - /// 3 - public struct ColorVisualProperty + /// 4 + public enum ScreenOffMode { /// - /// The solid color required. + /// The mode which turns the screen off after a timeout. /// - /// 3 - public static readonly int MixColor = NDalic.COLOR_VISUAL_MIX_COLOR; + Timout, /// - /// Whether to render if the MixColor is transparent. + /// The mode which keeps the screen turned on. /// - /// 5 - public static readonly int RenderIfTransparent = NDalic.COLOR_VISUAL_MIX_COLOR + 1; + Never } /// - /// This specifies properties of the GradientVisual. + /// An enum of notification window's priority level. /// /// 3 - public struct GradientVisualProperty + public enum NotificationLevel { /// - /// The start position of a linear gradient. + /// No notification level.
+ /// Default level.
+ /// This value makes the notification window place in the layer of the normal window. ///
- /// 3 - public static readonly int StartPosition = NDalic.GRADIENT_VISUAL_START_POSITION; + None = -1, /// - /// The end position of a linear gradient. + /// The base nofitication level. /// - /// 3 - public static readonly int EndPosition = NDalic.GRADIENT_VISUAL_END_POSITION; + Base = 10, /// - /// The center point of a radial gradient. + /// The medium notification level than base. /// - /// 3 - public static readonly int Center = NDalic.GRADIENT_VISUAL_CENTER; + Medium = 20, /// - /// The size of the radius of a radial gradient. + /// The higher notification level than medium. /// - /// 3 - public static readonly int Radius = NDalic.GRADIENT_VISUAL_RADIUS; + High = 30, /// - /// All the stop offsets. + /// The highest notification level. /// - /// 3 - public static readonly int StopOffset = NDalic.GRADIENT_VISUAL_STOP_OFFSET; - /// - /// The color at the stop offsets. - /// - /// 3 - public static readonly int StopColor = NDalic.GRADIENT_VISUAL_STOP_COLOR; - /// - /// Defines the coordinate system for certain attributes of the points in a gradient. - /// - /// 3 - public static readonly int Units = NDalic.GRADIENT_VISUAL_UNITS; - /// - /// Indicates what happens if the gradient starts or ends inside the bounds of the target rectangle. - /// - /// 3 - public static readonly int SpreadMethod = NDalic.GRADIENT_VISUAL_SPREAD_METHOD; + Top = 40 } /// - /// This specifies properties of the ImageVisual. + /// An enum of window types. /// /// 3 - public struct ImageVisualProperty + public enum WindowType { /// - /// The URL of the image. - /// - /// 3 - public static readonly int URL = NDalic.IMAGE_VISUAL_URL; - /// - /// The URL of the alpha mask image. - /// - /// 3 - public static readonly int AlphaMaskURL = NDalic.IMAGE_VISUAL_ALPHA_MASK_URL; - /// - /// Fitting options, used when resizing images to fit desired dimensions. - /// - /// 3 - public static readonly int FittingMode = NDalic.IMAGE_VISUAL_FITTING_MODE; - /// - /// Filtering options, used when resizing images to sample original pixels. - /// - /// 3 - public static readonly int SamplingMode = NDalic.IMAGE_VISUAL_SAMPLING_MODE; - /// - /// The desired image width. + /// A default window type.
+ /// Indicates a normal or top-level window. + /// Almost every window will be created with this type. ///
- /// 3 - public static readonly int DesiredWidth = NDalic.IMAGE_VISUAL_DESIRED_WIDTH; + Normal, /// - /// The desired image height. + /// A notification window, like a warning about battery life or a new email received. /// - /// 3 - public static readonly int DesiredHeight = NDalic.IMAGE_VISUAL_DESIRED_HEIGHT; + Notification, /// - /// Whether to load the image synchronously. + /// A persistent utility window, like a toolbox or a palette. /// - /// 3 - public static readonly int SynchronousLoading = NDalic.IMAGE_VISUAL_SYNCHRONOUS_LOADING; + Utility, /// - /// If true, only draws the borders. + /// Used for simple dialog windows. /// - /// 3 - public static readonly int BorderOnly = NDalic.IMAGE_VISUAL_BORDER_ONLY; + Dialog + } + + /// 3 + public enum DisposeTypes + { /// - /// The image area to be displayed. + /// Called By User /// /// 3 - public static readonly int PixelArea = NDalic.IMAGE_VISUAL_PIXEL_AREA; + Explicit, /// - /// The wrap mode for u coordinate. + /// Called by DisposeQueue /// /// 3 - public static readonly int WrapModeU = NDalic.IMAGE_VISUAL_WRAP_MODE_U; + Implicit, + } + + /// + /// An enum of the scroll state of the text eidtor. + /// + /// 3 + public enum ScrollState + { /// - /// The wrap mode for v coordinate. + /// Scrolling is started. /// - /// 3 - public static readonly int WrapModeV = NDalic.IMAGE_VISUAL_WRAP_MODE_V; + Started, + /// - /// The border of the image. + /// Scrolling is finished. /// - /// 3 - public static readonly int Border = NDalic.IMAGE_VISUAL_BORDER; + Finished + } + + /// + /// An enum of the line wrap mode of text controls. + /// + /// 4 + public enum LineWrapMode + { /// - /// Whether to use the texture atlas. + /// The word mode will move a word to the next line. /// - /// 5 - public static readonly int Atlasing = NDalic.IMAGE_VISUAL_BORDER + 1; + /// 4 + Word, + /// - /// The scale factor to apply to the content image before masking. + /// character will move character by character to the next line. /// /// 4 - public static readonly int MaskContentScale = NDalic.IMAGE_VISUAL_MASK_CONTENT_SCALE; + Character + } + + /// + /// An enum of text directions. + /// + /// 5 + public enum TextDirection + { /// - /// Whether to crop image to mask or scale mask to fit image + /// Text direction is from left to right. /// - /// 4 - public static readonly int CropToMask = NDalic.IMAGE_VISUAL_CROP_TO_MASK; + /// 5 + LeftToRight, + /// - /// Defines the batch size for pre-loading images in the AnimatedImageVisual + /// Text direction is from right to left. /// - /// 4 - public static readonly int BatchSize = NDalic.IMAGE_VISUAL_BATCH_SIZE; + /// 5 + RightToLeft + } + + /// + /// An enum of vertical line alignments. + /// + /// 5 + public enum VerticalLineAlignment + { /// - /// Defines the cache size for loading images in the AnimatedImageVisual + /// vertical line alignment is from top. /// - /// 4 - public static readonly int CacheSize = NDalic.IMAGE_VISUAL_CACHE_SIZE; + /// 5 + Top, + /// - /// The number of milliseconds between each frame in the AnimatedImageVisual + /// vertical line alignment is from center. /// - /// 4 - public static readonly int FrameDelay = NDalic.IMAGE_VISUAL_FRAME_DELAY; + /// 5 + Center, + /// - /// The number of times the AnimatedImageVisual will be looped. - /// The default is -1. If the value is less than 0, loop unlimited. Otherwise, loop loopCount times. + /// vertical line alignment is from bottom. /// /// 5 - public static readonly int LoopCount = NDalic.IMAGE_VISUAL_LOOP_COUNT; + Bottom + } + + /// + /// Enumeration type for the font's slant. + /// + /// 5 + public enum FontSlantType + { /// - /// The policy to determine when an image should no longer be cached. + /// None. /// /// 5 - public static readonly int ReleasePolicy = NDalic.IMAGE_VISUAL_RELEASE_POLICY; + None, /// - /// The policy to determine when an image should be loaded. + /// Normal. /// /// 5 - public static readonly int LoadPolicy = NDalic.IMAGE_VISUAL_LOAD_POLICY; + Normal, /// - /// Determines if image orientation should be corrected so that the image displays as it was intended. + /// Roman. /// /// 5 - public static readonly int OrientationCorrection = NDalic.IMAGE_VISUAL_ORIENTATION_CORRECTION; + Roman = Normal, /// - /// Overlays the auxiliary image on top of an NPatch image. + /// Italic. /// /// 5 - public static readonly int AuxiliaryImageURL = NDalic.IMAGE_VISUAL_AUXILIARY_IMAGE_URL; + Italic, /// - /// Alpha value for the auxiliary image, without affecting the underlying NPatch image + /// Oblique. /// /// 5 - public static readonly int AuxiliaryImageAlpha = NDalic.IMAGE_VISUAL_AUXILIARY_IMAGE_ALPHA; + Oblique } /// - /// This specifies properties of the MeshVisual. + /// Enumeration type for the font's weight. /// - /// 3 - public struct MeshVisualProperty + /// 5 + public enum FontWeightType { /// - /// The location of the ".obj" file. + /// None. /// - /// 3 - public static readonly int ObjectURL = NDalic.MESH_VISUAL_OBJECT_URL; + /// 5 + None, /// - /// The location of the ".mtl" file. + /// Thin. /// - /// 3 - public static readonly int MaterialtURL = NDalic.MESH_VISUAL_MATERIAL_URL; + /// 5 + Thin, /// - /// Path to the directory the textures (including gloss and normal) are stored in. + /// UltraLight. /// - /// 3 - public static readonly int TexturesPath = NDalic.MESH_VISUAL_TEXTURES_PATH; + /// 5 + UltraLight, /// - /// Sets the type of shading mode that the mesh will use. + /// ExtraLight. /// - /// 3 - public static readonly int ShadingMode = NDalic.MESH_VISUAL_SHADING_MODE; + /// 5 + ExtraLight = UltraLight, /// - /// Whether to use mipmaps for textures or not. + /// Light. /// - /// 3 - public static readonly int UseMipmapping = NDalic.MESH_VISUAL_USE_MIPMAPPING; + /// 5 + Light, /// - /// Whether to average normals at each point to smooth textures or not. + /// DemiLight. /// - /// 3 - public static readonly int UseSoftNormals = NDalic.MESH_VISUAL_USE_SOFT_NORMALS; + /// 5 + DemiLight, /// - /// The position, in stage space, of the point light that applies lighting to the model. + /// SemiLight. /// - /// 3 - public static readonly int LightPosition = NDalic.MESH_VISUAL_LIGHT_POSITION; - } - - /// - /// This specifies properties of the PrimitiveVisual. - /// - /// 3 - public struct PrimitiveVisualProperty - { + /// 5 + SemiLight = DemiLight, /// - /// The specific shape to render. + /// Book. /// - /// 3 - public static readonly int Shape = NDalic.PRIMITIVE_VISUAL_SHAPE; + /// 5 + Book, /// - /// The color of the shape. + /// Normal. /// - /// 3 - public static readonly int MixColor = NDalic.PRIMITIVE_VISUAL_MIX_COLOR; + /// 5 + Normal, /// - /// The number of slices as you go around the shape. + /// Regular. /// - /// 3 - public static readonly int Slices = NDalic.PRIMITIVE_VISUAL_SLICES; - /// - /// The number of stacks as you go down the shape. - /// - /// 3 - public static readonly int Stacks = NDalic.PRIMITIVE_VISUAL_STACKS; - /// - /// The scale of the radius of the top circle of a conical frustrum. - /// - /// 3 - public static readonly int ScaleTopRadius = NDalic.PRIMITIVE_VISUAL_SCALE_TOP_RADIUS; - /// - /// The scale of the radius of the bottom circle of a conical frustrum. - /// - /// 3 - public static readonly int ScaleBottomRadius = NDalic.PRIMITIVE_VISUAL_SCALE_BOTTOM_RADIUS; - /// - /// The scale of the height of a conic. - /// - /// 3 - public static readonly int ScaleHeight = NDalic.PRIMITIVE_VISUAL_SCALE_HEIGHT; - /// - /// The scale of the radius of a cylinder. - /// - /// 3 - public static readonly int ScaleRadius = NDalic.PRIMITIVE_VISUAL_SCALE_RADIUS; - /// - /// The dimensions of a cuboid. Scales in the same fashion as a 9-patch image. - /// - /// 3 - public static readonly int ScaleDimensions = NDalic.PRIMITIVE_VISUAL_SCALE_DIMENSIONS; - /// - /// Determines how bevelled the cuboid should be, based off the smallest dimension. - /// - /// 3 - public static readonly int BevelPercentage = NDalic.PRIMITIVE_VISUAL_BEVEL_PERCENTAGE; - /// - /// Defines how smooth the bevelled edges should be. - /// - /// 3 - public static readonly int BevelSmoothness = NDalic.PRIMITIVE_VISUAL_BEVEL_SMOOTHNESS; - /// - /// The position, in stage space, of the point light that applies lighting to the model. - /// - /// 3 - public static readonly int LightPosition = NDalic.PRIMITIVE_VISUAL_LIGHT_POSITION; - } - - /// - /// This specifies properties of the TextVisual. - /// - /// 3 - public struct TextVisualProperty - { - /// - /// The text to display in UTF-8 format. - /// - /// 3 - public static readonly int Text = NDalic.TEXT_VISUAL_TEXT; - /// - /// The requested font family to use. - /// - /// 3 - public static readonly int FontFamily = NDalic.TEXT_VISUAL_FONT_FAMILY; - /// - /// The requested font style to use. - /// - /// 3 - public static readonly int FontStyle = NDalic.TEXT_VISUAL_FONT_STYLE; - /// - /// The size of font in points. - /// - /// 3 - public static readonly int PointSize = NDalic.TEXT_VISUAL_POINT_SIZE; + /// 5 + Regular = Normal, /// - /// The single-line or multi-line layout option. + /// Medium. /// - /// 3 - public static readonly int MultiLine = NDalic.TEXT_VISUAL_MULTI_LINE; + /// 5 + Medium, /// - /// The line horizontal alignment. + /// DemiBold. /// - /// 3 - public static readonly int HorizontalAlignment = NDalic.TEXT_VISUAL_HORIZONTAL_ALIGNMENT; + /// 5 + DemiBold, /// - /// The line vertical alignment. + /// SemiBold. /// - /// 3 - public static readonly int VerticalAlignment = NDalic.TEXT_VISUAL_VERTICAL_ALIGNMENT; + /// 5 + SemiBold = DemiBold, /// - /// The color of the text. + /// Bold. /// - /// 3 - public static readonly int TextColor = NDalic.TEXT_VISUAL_TEXT_COLOR; + /// 5 + Bold, /// - /// Whether the mark-up processing is enabled. + /// UltraBold. /// - /// 3 - public static readonly int EnableMarkup = NDalic.TEXT_VISUAL_ENABLE_MARKUP; + /// 5 + UltraBold, /// - /// The shadow parameters. + /// ExtraBold. /// /// 5 - public static readonly int Shadow = NDalic.TEXT_VISUAL_ENABLE_MARKUP + 1; + ExtraBold = UltraBold, /// - /// The default underline parameters. + /// Black. /// /// 5 - public static readonly int Underline = NDalic.TEXT_VISUAL_ENABLE_MARKUP + 2; + Black, /// - /// The default outline parameters. + /// Heavy. /// /// 5 - public static readonly int Outline = NDalic.TEXT_VISUAL_ENABLE_MARKUP + 3; + Heavy = Black, /// - /// The default text background parameters. + /// ExtraBlack. /// /// 5 - public static readonly int Background = NDalic.TEXT_VISUAL_ENABLE_MARKUP + 4; + ExtraBlack = Black } /// - /// This specifies properties of the NpatchImageVisual. + /// Enumeration type for the font's width. /// - /// 3 - public struct NpatchImageVisualProperty + /// 5 + public enum FontWidthType { /// - /// The URL of the image. - /// - /// 3 - public static readonly int URL = NDalic.IMAGE_VISUAL_URL; - /// - /// Fitting options, used when resizing images to fit desired dimensions. + /// None. /// - /// 3 - public static readonly int FittingMode = NDalic.IMAGE_VISUAL_FITTING_MODE; + /// 5 + None, /// - /// Filtering options, used when resizing images to sample original pixels. + /// UltraCondensed. /// - /// 3 - public static readonly int SamplingMode = NDalic.IMAGE_VISUAL_SAMPLING_MODE; + /// 5 + UltraCondensed, /// - /// The desired image width. + /// ExtraCondensed. /// - /// 3 - public static readonly int DesiredWidth = NDalic.IMAGE_VISUAL_DESIRED_WIDTH; + /// 5 + ExtraCondensed, /// - /// The desired image height. + /// Condensed. /// - /// 3 - public static readonly int DesiredHeight = NDalic.IMAGE_VISUAL_DESIRED_HEIGHT; + /// 5 + Condensed, /// - /// Whether to load the image synchronously. + /// SemiCondensed. /// - /// 3 - public static readonly int SynchronousLoading = NDalic.IMAGE_VISUAL_SYNCHRONOUS_LOADING; + /// 5 + SemiCondensed, /// - /// If true, only draws the borders. + /// Normal. /// - /// 3 - public static readonly int BorderOnly = NDalic.IMAGE_VISUAL_BORDER_ONLY; + /// 5 + Normal, /// - /// The image area to be displayed. + /// SemiExpanded. /// - /// 3 - public static readonly int PixelArea = NDalic.IMAGE_VISUAL_PIXEL_AREA; + /// 5 + SemiExpanded, /// - /// The wrap mode for u coordinate. + /// Expanded. /// - /// 3 - public static readonly int WrapModeU = NDalic.IMAGE_VISUAL_WRAP_MODE_U; + /// 5 + Expanded, /// - /// The wrap mode for v coordinate. + /// ExtraExpanded. /// - /// 3 - public static readonly int WrapModeV = NDalic.IMAGE_VISUAL_WRAP_MODE_V; + /// 5 + ExtraExpanded, /// - /// The border of the image. + /// UltraExpanded. /// - /// 3 - public static readonly int Border = NDalic.IMAGE_VISUAL_WRAP_MODE_V + 1; + /// 5 + UltraExpanded } /// - /// The HiddenInput property. + /// Enumeration type for the glyph type. /// - /// 3 - public struct HiddenInputProperty + /// 5 + public enum GlyphType { /// - /// The mode for input text display. - /// - /// 3 - public static readonly int Mode = NDalicManualPINVOKE.HIDDENINPUT_PROPERTY_MODE_get(); - /// - /// All input characters are substituted by this character. - /// - /// 3 - public static readonly int SubstituteCharacter = NDalicManualPINVOKE.HIDDENINPUT_PROPERTY_SUBSTITUTE_CHARACTER_get(); - /// - /// Length of text to show or hide, available when HIDE_COUNT/SHOW_COUNT mode is used. + /// Glyph stored as pixels. /// - /// 3 - public static readonly int SubstituteCount = NDalicManualPINVOKE.HIDDENINPUT_PROPERTY_SUBSTITUTE_COUNT_get(); + /// 5 + BitmapGlyph, /// - /// Hide last character after this duration, available when SHOW_LAST_CHARACTER mode. + /// Glyph stored as vectors (scalable). This feature requires highp shader support and is not available on all platforms. /// - /// 4 - public static readonly int ShowLastCharacterDuration = NDalicManualPINVOKE.HIDDENINPUT_PROPERTY_SHOW_LAST_CHARACTER_DURATION_get(); + /// 5 + VectorGlyph } /// - /// The type for HiddenInput mode. + /// Enumeration for Setting the rendering behavior of a Window. /// - /// 3 - public enum HiddenInputModeType + /// 5 + public enum RenderingBehaviorType { /// - /// Don't hide text. - /// - HideNone, - /// - /// Hide all the input text. - /// - HideAll, - /// - /// Hide n characters from start. - /// - HideCount, - /// - /// Show n characters from start. + /// Default. Only renders if required. /// - ShowCount, + IfRequired, /// - /// Show last character for the duration(use ShowLastCharacterDuration property to modify duration). + /// Renders continuously. /// - ShowLastCharacter + Continuously } /// - /// ParentOrigin constants. + /// This specifies visual types. /// /// 3 - public struct ParentOrigin + public struct Visual { /// - /// Top + /// The index for the visual type. /// /// 3 - public static float Top + public enum Type { - get - { - float ret = NDalicPINVOKE.ParentOriginTop_get(); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } + /// + /// Renders a solid color as an internal border to the control's quad. + /// + Border, + /// + /// Renders a solid color to the control's quad. + /// + Color, + /// + /// Renders a smooth transition of colors to the control's quad. + /// + Gradient, + /// + /// Renders an image into the control's quad. + /// + Image, + /// + /// Renders a mesh using an "obj" file, optionally with textures provided by an "mtl" file. + /// + Mesh, + /// + /// Renders a simple 3D shape, such as a cube or a sphere. + /// + Primitive, + /// + /// Renders a simple wire-frame outlining a quad. + /// + Wireframe, + /// + /// Renders text. + /// + Text, + /// + /// Renders an NPatch image. + /// + NPatch, + /// + /// Renders an SVG image. + /// + SVG, + /// + /// Renders a animated image (animated GIF). + /// + AnimatedImage + } + + /// + /// This specifies visual properties. + /// + /// 3 + public struct Property + { + /// + /// Type. + /// + /// 3 + public static readonly int Type = NDalic.VISUAL_PROPERTY_TYPE; + /// + /// Shader. + /// + /// 3 + public static readonly int Shader = NDalic.VISUAL_PROPERTY_SHADER; + /// + /// Transform. + /// + /// 3 + public static readonly int Transform = NDalic.VISUAL_PROPERTY_TRANSFORM; + /// + /// PremultipliedAlpha. + /// + /// 3 + public static readonly int PremultipliedAlpha = NDalic.VISUAL_PROPERTY_PREMULTIPLIED_ALPHA; + /// + /// MixColor. + /// + /// 3 + public static readonly int MixColor = NDalic.VISUAL_PROPERTY_MIX_COLOR; + /// + /// Opacity. + /// + /// 3 + public static readonly int Opacity = NDalic.VISUAL_PROPERTY_MIX_COLOR + 1; + /// + /// The fitting mode of the visual. + /// + /// 5 + public static readonly int VisualFittingMode = NDalic.VISUAL_PROPERTY_MIX_COLOR + 2; + } + + /// + /// This specifies shader properties. + /// + /// 3 + public struct ShaderProperty + { + /// + /// Vertex shader code + /// + /// 3 + public static readonly int VertexShader = NDalic.VISUAL_SHADER_VERTEX; + /// + /// Fragment shader code + /// + /// 3 + public static readonly int FragmentShader = NDalic.VISUAL_SHADER_FRAGMENT; + /// + /// How to subdivide the grid along X + /// + /// 3 + public static readonly int ShaderSubdivideGridX = NDalic.VISUAL_SHADER_SUBDIVIDE_GRID_X; + /// + /// How to subdivide the grid along Y + /// + /// 3 + public static readonly int ShaderSubdivideGridY = NDalic.VISUAL_SHADER_SUBDIVIDE_GRID_Y; + /// + /// Bitmask of hints + /// + /// 3 + public static readonly int ShaderHints = NDalic.VISUAL_SHADER_HINTS; + } + + /// + /// This specifies visaul align types. + /// + /// 3 + public enum AlignType + { + /// + /// TopBegin + /// + /// 3 + TopBegin = 0, + /// + /// TopCenter + /// + /// 3 + TopCenter, + /// + /// TopEnd + /// + /// 3 + TopEnd, + /// + /// CenterBegin + /// + /// 3 + CenterBegin, + /// + /// Center + /// + /// 3 + Center, + /// + /// CenterEnd + /// + /// 3 + CenterEnd, + /// + /// BottomBegin + /// + /// 3 + BottomBegin, + /// + /// BottomCenter + /// + /// 3 + BottomCenter, + /// + /// BottomEnd + /// + /// 3 + BottomEnd } + } + + /// + /// This specifies properties of the BorderVisual. + /// + /// 3 + public struct BorderVisualProperty + { + /// + /// The color of the border. + /// + /// 3 + public static readonly int Color = NDalic.BORDER_VISUAL_COLOR; + /// + /// The width of the border (in pixels). + /// + /// 3 + public static readonly int Size = NDalic.BORDER_VISUAL_SIZE; + /// + /// Whether anti-aliasing of the border is required. + /// + /// 3 + public static readonly int AntiAliasing = NDalic.BORDER_VISUAL_ANTI_ALIASING; + } + + /// + /// This specifies properties of the ColorVisual. + /// + /// 3 + public struct ColorVisualProperty + { + /// + /// The solid color required. + /// + /// 3 + public static readonly int MixColor = NDalic.COLOR_VISUAL_MIX_COLOR; + /// + /// Whether to render if the MixColor is transparent. + /// + /// 5 + public static readonly int RenderIfTransparent = NDalic.COLOR_VISUAL_MIX_COLOR + 1; + } + + /// + /// This specifies properties of the GradientVisual. + /// + /// 3 + public struct GradientVisualProperty + { + /// + /// The start position of a linear gradient. + /// + /// 3 + public static readonly int StartPosition = NDalic.GRADIENT_VISUAL_START_POSITION; + /// + /// The end position of a linear gradient. + /// + /// 3 + public static readonly int EndPosition = NDalic.GRADIENT_VISUAL_END_POSITION; + /// + /// The center point of a radial gradient. + /// + /// 3 + public static readonly int Center = NDalic.GRADIENT_VISUAL_CENTER; + /// + /// The size of the radius of a radial gradient. + /// + /// 3 + public static readonly int Radius = NDalic.GRADIENT_VISUAL_RADIUS; + /// + /// All the stop offsets. + /// + /// 3 + public static readonly int StopOffset = NDalic.GRADIENT_VISUAL_STOP_OFFSET; + /// + /// The color at the stop offsets. + /// + /// 3 + public static readonly int StopColor = NDalic.GRADIENT_VISUAL_STOP_COLOR; + /// + /// Defines the coordinate system for certain attributes of the points in a gradient. + /// + /// 3 + public static readonly int Units = NDalic.GRADIENT_VISUAL_UNITS; + /// + /// Indicates what happens if the gradient starts or ends inside the bounds of the target rectangle. + /// + /// 3 + public static readonly int SpreadMethod = NDalic.GRADIENT_VISUAL_SPREAD_METHOD; + } + + /// + /// This specifies properties of the ImageVisual. + /// + /// 3 + public struct ImageVisualProperty + { + /// + /// The URL of the image. + /// + /// 3 + public static readonly int URL = NDalic.IMAGE_VISUAL_URL; + /// + /// The URL of the alpha mask image. + /// + /// 3 + public static readonly int AlphaMaskURL = NDalic.IMAGE_VISUAL_ALPHA_MASK_URL; + /// + /// Fitting options, used when resizing images to fit desired dimensions. + /// + /// 3 + public static readonly int FittingMode = NDalic.IMAGE_VISUAL_FITTING_MODE; + /// + /// Filtering options, used when resizing images to sample original pixels. + /// + /// 3 + public static readonly int SamplingMode = NDalic.IMAGE_VISUAL_SAMPLING_MODE; + /// + /// The desired image width. + /// + /// 3 + public static readonly int DesiredWidth = NDalic.IMAGE_VISUAL_DESIRED_WIDTH; + /// + /// The desired image height. + /// + /// 3 + public static readonly int DesiredHeight = NDalic.IMAGE_VISUAL_DESIRED_HEIGHT; + /// + /// Whether to load the image synchronously. + /// + /// 3 + public static readonly int SynchronousLoading = NDalic.IMAGE_VISUAL_SYNCHRONOUS_LOADING; + /// + /// If true, only draws the borders. + /// + /// 3 + public static readonly int BorderOnly = NDalic.IMAGE_VISUAL_BORDER_ONLY; + /// + /// The image area to be displayed. + /// + /// 3 + public static readonly int PixelArea = NDalic.IMAGE_VISUAL_PIXEL_AREA; + /// + /// The wrap mode for u coordinate. + /// + /// 3 + public static readonly int WrapModeU = NDalic.IMAGE_VISUAL_WRAP_MODE_U; + /// + /// The wrap mode for v coordinate. + /// + /// 3 + public static readonly int WrapModeV = NDalic.IMAGE_VISUAL_WRAP_MODE_V; + /// + /// The border of the image. + /// + /// 3 + public static readonly int Border = NDalic.IMAGE_VISUAL_BORDER; + /// + /// Whether to use the texture atlas. + /// + /// 5 + public static readonly int Atlasing = NDalic.IMAGE_VISUAL_BORDER + 1; + /// + /// The scale factor to apply to the content image before masking. + /// + /// 4 + public static readonly int MaskContentScale = NDalic.IMAGE_VISUAL_MASK_CONTENT_SCALE; + /// + /// Whether to crop image to mask or scale mask to fit image + /// + /// 4 + public static readonly int CropToMask = NDalic.IMAGE_VISUAL_CROP_TO_MASK; + /// + /// Defines the batch size for pre-loading images in the AnimatedImageVisual + /// + /// 4 + public static readonly int BatchSize = NDalic.IMAGE_VISUAL_BATCH_SIZE; + /// + /// Defines the cache size for loading images in the AnimatedImageVisual + /// + /// 4 + public static readonly int CacheSize = NDalic.IMAGE_VISUAL_CACHE_SIZE; + /// + /// The number of milliseconds between each frame in the AnimatedImageVisual + /// + /// 4 + public static readonly int FrameDelay = NDalic.IMAGE_VISUAL_FRAME_DELAY; + /// + /// The number of times the AnimatedImageVisual will be looped. + /// The default is -1. If the value is less than 0, loop unlimited. Otherwise, loop loopCount times. + /// + /// 5 + public static readonly int LoopCount = NDalic.IMAGE_VISUAL_LOOP_COUNT; + /// + /// The policy to determine when an image should no longer be cached. + /// + /// 5 + public static readonly int ReleasePolicy = NDalic.IMAGE_VISUAL_RELEASE_POLICY; + /// + /// The policy to determine when an image should be loaded. + /// + /// 5 + public static readonly int LoadPolicy = NDalic.IMAGE_VISUAL_LOAD_POLICY; + /// + /// Determines if image orientation should be corrected so that the image displays as it was intended. + /// + /// 5 + public static readonly int OrientationCorrection = NDalic.IMAGE_VISUAL_ORIENTATION_CORRECTION; + /// + /// Overlays the auxiliary image on top of an NPatch image. + /// + /// 5 + public static readonly int AuxiliaryImageURL = NDalic.IMAGE_VISUAL_AUXILIARY_IMAGE_URL; + /// + /// Alpha value for the auxiliary image, without affecting the underlying NPatch image + /// + /// 5 + public static readonly int AuxiliaryImageAlpha = NDalic.IMAGE_VISUAL_AUXILIARY_IMAGE_ALPHA; + } + + /// + /// This specifies properties of the MeshVisual. + /// + /// 3 + public struct MeshVisualProperty + { + /// + /// The location of the ".obj" file. + /// + /// 3 + public static readonly int ObjectURL = NDalic.MESH_VISUAL_OBJECT_URL; + /// + /// The location of the ".mtl" file. + /// + /// 3 + public static readonly int MaterialtURL = NDalic.MESH_VISUAL_MATERIAL_URL; + /// + /// Path to the directory the textures (including gloss and normal) are stored in. + /// + /// 3 + public static readonly int TexturesPath = NDalic.MESH_VISUAL_TEXTURES_PATH; + /// + /// Sets the type of shading mode that the mesh will use. + /// + /// 3 + public static readonly int ShadingMode = NDalic.MESH_VISUAL_SHADING_MODE; + /// + /// Whether to use mipmaps for textures or not. + /// + /// 3 + public static readonly int UseMipmapping = NDalic.MESH_VISUAL_USE_MIPMAPPING; + /// + /// Whether to average normals at each point to smooth textures or not. + /// + /// 3 + public static readonly int UseSoftNormals = NDalic.MESH_VISUAL_USE_SOFT_NORMALS; + /// + /// The position, in stage space, of the point light that applies lighting to the model. + /// + /// 3 + public static readonly int LightPosition = NDalic.MESH_VISUAL_LIGHT_POSITION; + } + + /// + /// This specifies properties of the PrimitiveVisual. + /// + /// 3 + public struct PrimitiveVisualProperty + { + /// + /// The specific shape to render. + /// + /// 3 + public static readonly int Shape = NDalic.PRIMITIVE_VISUAL_SHAPE; + /// + /// The color of the shape. + /// + /// 3 + public static readonly int MixColor = NDalic.PRIMITIVE_VISUAL_MIX_COLOR; + /// + /// The number of slices as you go around the shape. + /// + /// 3 + public static readonly int Slices = NDalic.PRIMITIVE_VISUAL_SLICES; + /// + /// The number of stacks as you go down the shape. + /// + /// 3 + public static readonly int Stacks = NDalic.PRIMITIVE_VISUAL_STACKS; + /// + /// The scale of the radius of the top circle of a conical frustrum. + /// + /// 3 + public static readonly int ScaleTopRadius = NDalic.PRIMITIVE_VISUAL_SCALE_TOP_RADIUS; + /// + /// The scale of the radius of the bottom circle of a conical frustrum. + /// + /// 3 + public static readonly int ScaleBottomRadius = NDalic.PRIMITIVE_VISUAL_SCALE_BOTTOM_RADIUS; + /// + /// The scale of the height of a conic. + /// + /// 3 + public static readonly int ScaleHeight = NDalic.PRIMITIVE_VISUAL_SCALE_HEIGHT; + /// + /// The scale of the radius of a cylinder. + /// + /// 3 + public static readonly int ScaleRadius = NDalic.PRIMITIVE_VISUAL_SCALE_RADIUS; + /// + /// The dimensions of a cuboid. Scales in the same fashion as a 9-patch image. + /// + /// 3 + public static readonly int ScaleDimensions = NDalic.PRIMITIVE_VISUAL_SCALE_DIMENSIONS; + /// + /// Determines how bevelled the cuboid should be, based off the smallest dimension. + /// + /// 3 + public static readonly int BevelPercentage = NDalic.PRIMITIVE_VISUAL_BEVEL_PERCENTAGE; + /// + /// Defines how smooth the bevelled edges should be. + /// + /// 3 + public static readonly int BevelSmoothness = NDalic.PRIMITIVE_VISUAL_BEVEL_SMOOTHNESS; + /// + /// The position, in stage space, of the point light that applies lighting to the model. + /// + /// 3 + public static readonly int LightPosition = NDalic.PRIMITIVE_VISUAL_LIGHT_POSITION; + } + /// + /// This specifies properties of the TextVisual. + /// + /// 3 + public struct TextVisualProperty + { /// - /// Bottom + /// The text to display in UTF-8 format. /// /// 3 - public static float Bottom - { - get - { - float ret = NDalicPINVOKE.ParentOriginBottom_get(); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - } - + public static readonly int Text = NDalic.TEXT_VISUAL_TEXT; /// - /// Left + /// The requested font family to use. /// /// 3 - public static float Left - { - get - { - float ret = NDalicPINVOKE.ParentOriginLeft_get(); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - } - + public static readonly int FontFamily = NDalic.TEXT_VISUAL_FONT_FAMILY; /// - /// Right + /// The requested font style to use. /// /// 3 - public static float Right - { - get - { - float ret = NDalicPINVOKE.ParentOriginRight_get(); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - } - + public static readonly int FontStyle = NDalic.TEXT_VISUAL_FONT_STYLE; /// - /// Middle + /// The size of font in points. /// /// 3 - public static float Middle - { - get - { - float ret = NDalicPINVOKE.ParentOriginMiddle_get(); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - } - + public static readonly int PointSize = NDalic.TEXT_VISUAL_POINT_SIZE; /// - /// TopLeft + /// The single-line or multi-line layout option. /// /// 3 - public static Position TopLeft - { - get - { - global::System.IntPtr cPtr = NDalicPINVOKE.ParentOriginTopLeft_get(); - Position ret = (cPtr == global::System.IntPtr.Zero) ? null : new Position(cPtr, false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - } - + public static readonly int MultiLine = NDalic.TEXT_VISUAL_MULTI_LINE; /// - /// TopCenter + /// The line horizontal alignment. /// /// 3 - public static Position TopCenter - { - get - { - global::System.IntPtr cPtr = NDalicPINVOKE.ParentOriginTopCenter_get(); - Position ret = (cPtr == global::System.IntPtr.Zero) ? null : new Position(cPtr, false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - } - + public static readonly int HorizontalAlignment = NDalic.TEXT_VISUAL_HORIZONTAL_ALIGNMENT; /// - /// TopRight + /// The line vertical alignment. /// /// 3 - public static Position TopRight - { - get - { - global::System.IntPtr cPtr = NDalicPINVOKE.ParentOriginTopRight_get(); - Position ret = (cPtr == global::System.IntPtr.Zero) ? null : new Position(cPtr, false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - } - + public static readonly int VerticalAlignment = NDalic.TEXT_VISUAL_VERTICAL_ALIGNMENT; /// - /// CenterLeft + /// The color of the text. /// /// 3 - public static Position CenterLeft - { - get - { - global::System.IntPtr cPtr = NDalicPINVOKE.ParentOriginCenterLeft_get(); - Position ret = (cPtr == global::System.IntPtr.Zero) ? null : new Position(cPtr, false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - } - + public static readonly int TextColor = NDalic.TEXT_VISUAL_TEXT_COLOR; /// - /// Center + /// Whether the mark-up processing is enabled. /// /// 3 - public static Position Center - { - get - { - global::System.IntPtr cPtr = NDalicPINVOKE.ParentOriginCenter_get(); - Position ret = (cPtr == global::System.IntPtr.Zero) ? null : new Position(cPtr, false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - } + public static readonly int EnableMarkup = NDalic.TEXT_VISUAL_ENABLE_MARKUP; + /// + /// The shadow parameters. + /// + /// 5 + public static readonly int Shadow = NDalic.TEXT_VISUAL_ENABLE_MARKUP + 1; + /// + /// The default underline parameters. + /// + /// 5 + public static readonly int Underline = NDalic.TEXT_VISUAL_ENABLE_MARKUP + 2; + /// + /// The default outline parameters. + /// + /// 5 + public static readonly int Outline = NDalic.TEXT_VISUAL_ENABLE_MARKUP + 3; + /// + /// The default text background parameters. + /// + /// 5 + public static readonly int Background = NDalic.TEXT_VISUAL_ENABLE_MARKUP + 4; + } + /// + /// This specifies properties of the NpatchImageVisual. + /// + /// 3 + public struct NpatchImageVisualProperty + { /// - /// CenterRight + /// The URL of the image. /// /// 3 - public static Position CenterRight - { - get - { - global::System.IntPtr cPtr = NDalicPINVOKE.ParentOriginCenterRight_get(); - Position ret = (cPtr == global::System.IntPtr.Zero) ? null : new Position(cPtr, false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - } - + public static readonly int URL = NDalic.IMAGE_VISUAL_URL; /// - /// BottomLeft + /// Fitting options, used when resizing images to fit desired dimensions. /// /// 3 - public static Position BottomLeft - { - get - { - global::System.IntPtr cPtr = NDalicPINVOKE.ParentOriginBottomLeft_get(); - Position ret = (cPtr == global::System.IntPtr.Zero) ? null : new Position(cPtr, false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - } - + public static readonly int FittingMode = NDalic.IMAGE_VISUAL_FITTING_MODE; /// - /// BottomCenter + /// Filtering options, used when resizing images to sample original pixels. /// /// 3 - public static Position BottomCenter - { - get - { - global::System.IntPtr cPtr = NDalicPINVOKE.ParentOriginBottomCenter_get(); - Position ret = (cPtr == global::System.IntPtr.Zero) ? null : new Position(cPtr, false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - } + public static readonly int SamplingMode = NDalic.IMAGE_VISUAL_SAMPLING_MODE; + /// + /// The desired image width. + /// + /// 3 + public static readonly int DesiredWidth = NDalic.IMAGE_VISUAL_DESIRED_WIDTH; + /// + /// The desired image height. + /// + /// 3 + public static readonly int DesiredHeight = NDalic.IMAGE_VISUAL_DESIRED_HEIGHT; + /// + /// Whether to load the image synchronously. + /// + /// 3 + public static readonly int SynchronousLoading = NDalic.IMAGE_VISUAL_SYNCHRONOUS_LOADING; + /// + /// If true, only draws the borders. + /// + /// 3 + public static readonly int BorderOnly = NDalic.IMAGE_VISUAL_BORDER_ONLY; + /// + /// The image area to be displayed. + /// + /// 3 + public static readonly int PixelArea = NDalic.IMAGE_VISUAL_PIXEL_AREA; + /// + /// The wrap mode for u coordinate. + /// + /// 3 + public static readonly int WrapModeU = NDalic.IMAGE_VISUAL_WRAP_MODE_U; + /// + /// The wrap mode for v coordinate. + /// + /// 3 + public static readonly int WrapModeV = NDalic.IMAGE_VISUAL_WRAP_MODE_V; + /// + /// The border of the image. + /// + /// 3 + public static readonly int Border = NDalic.IMAGE_VISUAL_WRAP_MODE_V + 1; + } + /// + /// The HiddenInput property. + /// + /// 3 + public struct HiddenInputProperty + { + /// + /// The mode for input text display. + /// + /// 3 + public static readonly int Mode = NDalicManualPINVOKE.HIDDENINPUT_PROPERTY_MODE_get(); + /// + /// All input characters are substituted by this character. + /// + /// 3 + public static readonly int SubstituteCharacter = NDalicManualPINVOKE.HIDDENINPUT_PROPERTY_SUBSTITUTE_CHARACTER_get(); /// - /// BottomRight + /// Length of text to show or hide, available when HIDE_COUNT/SHOW_COUNT mode is used. /// /// 3 - public static Position BottomRight - { - get - { - global::System.IntPtr cPtr = NDalicPINVOKE.ParentOriginBottomRight_get(); - Position ret = (cPtr == global::System.IntPtr.Zero) ? null : new Position(cPtr, false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - } + public static readonly int SubstituteCount = NDalicManualPINVOKE.HIDDENINPUT_PROPERTY_SUBSTITUTE_COUNT_get(); + /// + /// Hide last character after this duration, available when SHOW_LAST_CHARACTER mode. + /// + /// 4 + public static readonly int ShowLastCharacterDuration = NDalicManualPINVOKE.HIDDENINPUT_PROPERTY_SHOW_LAST_CHARACTER_DURATION_get(); } /// - /// PivotPoint constants. + /// ParentOrigin constants. /// /// 3 - public struct PivotPoint + public struct ParentOrigin { /// /// Top @@ -1848,11 +2048,12 @@ namespace Tizen.NUI { get { - float ret = NDalicPINVOKE.AnchorPointTop_get(); + float ret = NDalicPINVOKE.ParentOriginTop_get(); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } } + /// /// Bottom /// @@ -1861,11 +2062,12 @@ namespace Tizen.NUI { get { - float ret = NDalicPINVOKE.AnchorPointBottom_get(); + float ret = NDalicPINVOKE.ParentOriginBottom_get(); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } } + /// /// Left /// @@ -1874,11 +2076,12 @@ namespace Tizen.NUI { get { - float ret = NDalicPINVOKE.AnchorPointLeft_get(); + float ret = NDalicPINVOKE.ParentOriginLeft_get(); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } } + /// /// Right /// @@ -1887,11 +2090,12 @@ namespace Tizen.NUI { get { - float ret = NDalicPINVOKE.AnchorPointRight_get(); + float ret = NDalicPINVOKE.ParentOriginRight_get(); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } } + /// /// Middle /// @@ -1900,11 +2104,12 @@ namespace Tizen.NUI { get { - float ret = NDalicPINVOKE.AnchorPointMiddle_get(); + float ret = NDalicPINVOKE.ParentOriginMiddle_get(); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } } + /// /// TopLeft /// @@ -1913,12 +2118,13 @@ namespace Tizen.NUI { get { - global::System.IntPtr cPtr = NDalicPINVOKE.AnchorPointTopLeft_get(); + global::System.IntPtr cPtr = NDalicPINVOKE.ParentOriginTopLeft_get(); Position ret = (cPtr == global::System.IntPtr.Zero) ? null : new Position(cPtr, false); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } } + /// /// TopCenter /// @@ -1927,12 +2133,13 @@ namespace Tizen.NUI { get { - global::System.IntPtr cPtr = NDalicPINVOKE.AnchorPointTopCenter_get(); + global::System.IntPtr cPtr = NDalicPINVOKE.ParentOriginTopCenter_get(); Position ret = (cPtr == global::System.IntPtr.Zero) ? null : new Position(cPtr, false); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } } + /// /// TopRight /// @@ -1941,12 +2148,13 @@ namespace Tizen.NUI { get { - global::System.IntPtr cPtr = NDalicPINVOKE.AnchorPointTopRight_get(); + global::System.IntPtr cPtr = NDalicPINVOKE.ParentOriginTopRight_get(); Position ret = (cPtr == global::System.IntPtr.Zero) ? null : new Position(cPtr, false); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } } + /// /// CenterLeft /// @@ -1955,12 +2163,13 @@ namespace Tizen.NUI { get { - global::System.IntPtr cPtr = NDalicPINVOKE.AnchorPointCenterLeft_get(); + global::System.IntPtr cPtr = NDalicPINVOKE.ParentOriginCenterLeft_get(); Position ret = (cPtr == global::System.IntPtr.Zero) ? null : new Position(cPtr, false); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } } + /// /// Center /// @@ -1969,12 +2178,13 @@ namespace Tizen.NUI { get { - global::System.IntPtr cPtr = NDalicPINVOKE.AnchorPointCenter_get(); + global::System.IntPtr cPtr = NDalicPINVOKE.ParentOriginCenter_get(); Position ret = (cPtr == global::System.IntPtr.Zero) ? null : new Position(cPtr, false); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } } + /// /// CenterRight /// @@ -1983,12 +2193,13 @@ namespace Tizen.NUI { get { - global::System.IntPtr cPtr = NDalicPINVOKE.AnchorPointCenterRight_get(); + global::System.IntPtr cPtr = NDalicPINVOKE.ParentOriginCenterRight_get(); Position ret = (cPtr == global::System.IntPtr.Zero) ? null : new Position(cPtr, false); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } } + /// /// BottomLeft /// @@ -1997,12 +2208,13 @@ namespace Tizen.NUI { get { - global::System.IntPtr cPtr = NDalicPINVOKE.AnchorPointBottomLeft_get(); + global::System.IntPtr cPtr = NDalicPINVOKE.ParentOriginBottomLeft_get(); Position ret = (cPtr == global::System.IntPtr.Zero) ? null : new Position(cPtr, false); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } } + /// /// BottomCenter /// @@ -2011,12 +2223,13 @@ namespace Tizen.NUI { get { - global::System.IntPtr cPtr = NDalicPINVOKE.AnchorPointBottomCenter_get(); + global::System.IntPtr cPtr = NDalicPINVOKE.ParentOriginBottomCenter_get(); Position ret = (cPtr == global::System.IntPtr.Zero) ? null : new Position(cPtr, false); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } } + /// /// BottomRight /// @@ -2025,214 +2238,19 @@ namespace Tizen.NUI { get { - global::System.IntPtr cPtr = NDalicPINVOKE.AnchorPointBottomRight_get(); - Position ret = (cPtr == global::System.IntPtr.Zero) ? null : new Position(cPtr, false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - } - } - /// - /// PositionAxis constants. - /// - /// 3 - public struct PositionAxis - { - /// - /// The X axis - /// - /// 3 - public static Position X - { - get - { - global::System.IntPtr cPtr = NDalicPINVOKE.Vector3_XAXIS_get(); - Position ret = (cPtr == global::System.IntPtr.Zero) ? null : new Position(cPtr, false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - } - /// - /// The Y axis - /// - /// 3 - public static Position Y - { - get - { - global::System.IntPtr cPtr = NDalicPINVOKE.Vector3_YAXIS_get(); - Position ret = (cPtr == global::System.IntPtr.Zero) ? null : new Position(cPtr, false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - } - /// - /// The Z axis - /// - /// 3 - public static Position Z - { - get - { - global::System.IntPtr cPtr = NDalicPINVOKE.Vector3_ZAXIS_get(); - Position ret = (cPtr == global::System.IntPtr.Zero) ? null : new Position(cPtr, false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - } - /// - /// The Negative X axis - /// - /// 3 - public static Position NegativeX - { - get - { - global::System.IntPtr cPtr = NDalicPINVOKE.Vector3_NEGATIVE_XAXIS_get(); - Position ret = (cPtr == global::System.IntPtr.Zero) ? null : new Position(cPtr, false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - } - /// - /// The Negative Y axis - /// - /// 3 - public static Position NegativeY - { - get - { - global::System.IntPtr cPtr = NDalicPINVOKE.Vector3_NEGATIVE_YAXIS_get(); - Position ret = (cPtr == global::System.IntPtr.Zero) ? null : new Position(cPtr, false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - } - /// - /// The Negative Z axis - /// - /// 3 - public static Position NegativeZ - { - get - { - global::System.IntPtr cPtr = NDalicPINVOKE.Vector3_NEGATIVE_ZAXIS_get(); - Position ret = (cPtr == global::System.IntPtr.Zero) ? null : new Position(cPtr, false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - } - } - - /// - /// Auto scrolling stop behavior. - /// - /// 3 - public enum AutoScrollStopMode - { - /// - /// Stop animation after current loop finished. - /// - FinishLoop, - /// - /// Stop animation immediately and reset position. - /// - Immediate - } - - /// - /// An enum of screen mode. - /// - /// 4 - public enum ScreenOffMode { - /// - /// The mode which turns the screen off after a timeout. - /// - Timout, - /// - /// The mode which keeps the screen turned on. - /// - Never - } - - /// - /// An enum of notification window's priority level. - /// - /// 3 - public enum NotificationLevel { - /// - /// No notification level.
- /// Default level.
- /// This value makes the notification window place in the layer of the normal window. - ///
- None = -1, - /// - /// The base nofitication level. - /// - Base = 10, - /// - /// The medium notification level than base. - /// - Medium = 20, - /// - /// The higher notification level than medium. - /// - High = 30, - /// - /// The highest notification level. - /// - Top = 40 - } - - /// - /// An enum of window types. - /// - /// 3 - public enum WindowType { - /// - /// A default window type.
- /// Indicates a normal or top-level window. - /// Almost every window will be created with this type. - ///
- Normal, - /// - /// A notification window, like a warning about battery life or a new email received. - /// - Notification, - /// - /// A persistent utility window, like a toolbox or a palette. - /// - Utility, - /// - /// Used for simple dialog windows. - /// - Dialog - } - - /// 3 - public enum DisposeTypes - { - /// - /// Called By User - /// - /// 3 - Explicit, - /// - /// Called by DisposeQueue - /// - /// 3 - Implicit, + global::System.IntPtr cPtr = NDalicPINVOKE.ParentOriginBottomRight_get(); + Position ret = (cPtr == global::System.IntPtr.Zero) ? null : new Position(cPtr, false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + } } - - /// - /// [Obsolete("Please do not use! this will be deprecated")] + /// PivotPoint constants. /// /// 3 - [Obsolete("Please do not use! This will be deprecated! Please use PivotPoint instead!")] - [EditorBrowsable(EditorBrowsableState.Never)] - public struct AnchorPoint + public struct PivotPoint { /// /// Top @@ -2426,313 +2444,296 @@ namespace Tizen.NUI } } } - /// - /// An enum of the scroll state of the text eidtor. + /// PositionAxis constants. /// /// 3 - public enum ScrollState - { - /// - /// Scrolling is started. - /// - Started, - - /// - /// Scrolling is finished. - /// - Finished - } - - /// - /// An enum of the line wrap mode of text controls. - /// - /// 4 - public enum LineWrapMode - { - /// - /// The word mode will move a word to the next line. - /// - /// 4 - Word, - - /// - /// character will move character by character to the next line. - /// - /// 4 - Character - } - - /// - /// An enum of text directions. - /// - /// 5 - public enum TextDirection - { - /// - /// Text direction is from left to right. - /// - /// 5 - LeftToRight, - - /// - /// Text direction is from right to left. - /// - /// 5 - RightToLeft - } - - /// - /// An enum of vertical line alignments. - /// - /// 5 - public enum VerticalLineAlignment - { - /// - /// vertical line alignment is from top. - /// - /// 5 - Top, - - /// - /// vertical line alignment is from center. - /// - /// 5 - Center, - - /// - /// vertical line alignment is from bottom. - /// - /// 5 - Bottom - } - - /// - /// Enumeration type for the font's slant. - /// - /// 5 - public enum FontSlantType - { - /// - /// None. - /// - /// 5 - None, - /// - /// Normal. - /// - /// 5 - Normal, - /// - /// Roman. - /// - /// 5 - Roman = Normal, - /// - /// Italic. - /// - /// 5 - Italic, - /// - /// Oblique. - /// - /// 5 - Oblique - } - - /// - /// Enumeration type for the font's weight. - /// - /// 5 - public enum FontWeightType + public struct PositionAxis { /// - /// None. - /// - /// 5 - None, - /// - /// Thin. - /// - /// 5 - Thin, - /// - /// UltraLight. - /// - /// 5 - UltraLight, - /// - /// ExtraLight. - /// - /// 5 - ExtraLight = UltraLight, - /// - /// Light. - /// - /// 5 - Light, - /// - /// DemiLight. - /// - /// 5 - DemiLight, - /// - /// SemiLight. - /// - /// 5 - SemiLight = DemiLight, - /// - /// Book. - /// - /// 5 - Book, - /// - /// Normal. - /// - /// 5 - Normal, - /// - /// Regular. - /// - /// 5 - Regular = Normal, - /// - /// Medium. - /// - /// 5 - Medium, - /// - /// DemiBold. - /// - /// 5 - DemiBold, - /// - /// SemiBold. - /// - /// 5 - SemiBold = DemiBold, - /// - /// Bold. + /// The X axis /// - /// 5 - Bold, + /// 3 + public static Position X + { + get + { + global::System.IntPtr cPtr = NDalicPINVOKE.Vector3_XAXIS_get(); + Position ret = (cPtr == global::System.IntPtr.Zero) ? null : new Position(cPtr, false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + } /// - /// UltraBold. + /// The Y axis /// - /// 5 - UltraBold, + /// 3 + public static Position Y + { + get + { + global::System.IntPtr cPtr = NDalicPINVOKE.Vector3_YAXIS_get(); + Position ret = (cPtr == global::System.IntPtr.Zero) ? null : new Position(cPtr, false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + } /// - /// ExtraBold. + /// The Z axis /// - /// 5 - ExtraBold = UltraBold, + /// 3 + public static Position Z + { + get + { + global::System.IntPtr cPtr = NDalicPINVOKE.Vector3_ZAXIS_get(); + Position ret = (cPtr == global::System.IntPtr.Zero) ? null : new Position(cPtr, false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + } /// - /// Black. + /// The Negative X axis /// - /// 5 - Black, + /// 3 + public static Position NegativeX + { + get + { + global::System.IntPtr cPtr = NDalicPINVOKE.Vector3_NEGATIVE_XAXIS_get(); + Position ret = (cPtr == global::System.IntPtr.Zero) ? null : new Position(cPtr, false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + } /// - /// Heavy. + /// The Negative Y axis /// - /// 5 - Heavy = Black, + /// 3 + public static Position NegativeY + { + get + { + global::System.IntPtr cPtr = NDalicPINVOKE.Vector3_NEGATIVE_YAXIS_get(); + Position ret = (cPtr == global::System.IntPtr.Zero) ? null : new Position(cPtr, false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + } /// - /// ExtraBlack. + /// The Negative Z axis /// - /// 5 - ExtraBlack = Black + /// 3 + public static Position NegativeZ + { + get + { + global::System.IntPtr cPtr = NDalicPINVOKE.Vector3_NEGATIVE_ZAXIS_get(); + Position ret = (cPtr == global::System.IntPtr.Zero) ? null : new Position(cPtr, false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + } } /// - /// Enumeration type for the font's width. + /// [Obsolete("Please do not use! this will be deprecated")] /// - /// 5 - public enum FontWidthType + /// 3 + [Obsolete("Please do not use! This will be deprecated! Please use PivotPoint instead!")] + [EditorBrowsable(EditorBrowsableState.Never)] + public struct AnchorPoint { /// - /// None. + /// Top /// - /// 5 - None, + /// 3 + public static float Top + { + get + { + float ret = NDalicPINVOKE.AnchorPointTop_get(); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + } /// - /// UltraCondensed. + /// Bottom /// - /// 5 - UltraCondensed, + /// 3 + public static float Bottom + { + get + { + float ret = NDalicPINVOKE.AnchorPointBottom_get(); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + } /// - /// ExtraCondensed. + /// Left /// - /// 5 - ExtraCondensed, + /// 3 + public static float Left + { + get + { + float ret = NDalicPINVOKE.AnchorPointLeft_get(); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + } /// - /// Condensed. + /// Right /// - /// 5 - Condensed, + /// 3 + public static float Right + { + get + { + float ret = NDalicPINVOKE.AnchorPointRight_get(); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + } /// - /// SemiCondensed. + /// Middle /// - /// 5 - SemiCondensed, + /// 3 + public static float Middle + { + get + { + float ret = NDalicPINVOKE.AnchorPointMiddle_get(); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + } /// - /// Normal. + /// TopLeft /// - /// 5 - Normal, + /// 3 + public static Position TopLeft + { + get + { + global::System.IntPtr cPtr = NDalicPINVOKE.AnchorPointTopLeft_get(); + Position ret = (cPtr == global::System.IntPtr.Zero) ? null : new Position(cPtr, false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + } /// - /// SemiExpanded. + /// TopCenter /// - /// 5 - SemiExpanded, + /// 3 + public static Position TopCenter + { + get + { + global::System.IntPtr cPtr = NDalicPINVOKE.AnchorPointTopCenter_get(); + Position ret = (cPtr == global::System.IntPtr.Zero) ? null : new Position(cPtr, false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + } /// - /// Expanded. + /// TopRight /// - /// 5 - Expanded, + /// 3 + public static Position TopRight + { + get + { + global::System.IntPtr cPtr = NDalicPINVOKE.AnchorPointTopRight_get(); + Position ret = (cPtr == global::System.IntPtr.Zero) ? null : new Position(cPtr, false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + } /// - /// ExtraExpanded. + /// CenterLeft /// - /// 5 - ExtraExpanded, + /// 3 + public static Position CenterLeft + { + get + { + global::System.IntPtr cPtr = NDalicPINVOKE.AnchorPointCenterLeft_get(); + Position ret = (cPtr == global::System.IntPtr.Zero) ? null : new Position(cPtr, false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + } /// - /// UltraExpanded. + /// Center /// - /// 5 - UltraExpanded - } - - /// - /// Enumeration type for the glyph type. - /// - /// 5 - public enum GlyphType - { + /// 3 + public static Position Center + { + get + { + global::System.IntPtr cPtr = NDalicPINVOKE.AnchorPointCenter_get(); + Position ret = (cPtr == global::System.IntPtr.Zero) ? null : new Position(cPtr, false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + } /// - /// Glyph stored as pixels. + /// CenterRight /// - /// 5 - BitmapGlyph, + /// 3 + public static Position CenterRight + { + get + { + global::System.IntPtr cPtr = NDalicPINVOKE.AnchorPointCenterRight_get(); + Position ret = (cPtr == global::System.IntPtr.Zero) ? null : new Position(cPtr, false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + } /// - /// Glyph stored as vectors (scalable). This feature requires highp shader support and is not available on all platforms. + /// BottomLeft /// - /// 5 - VectorGlyph - } - - /// - /// Enumeration for Setting the rendering behavior of a Window. - /// - /// 5 - public enum RenderingBehaviorType - { + /// 3 + public static Position BottomLeft + { + get + { + global::System.IntPtr cPtr = NDalicPINVOKE.AnchorPointBottomLeft_get(); + Position ret = (cPtr == global::System.IntPtr.Zero) ? null : new Position(cPtr, false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + } /// - /// Default. Only renders if required. + /// BottomCenter /// - IfRequired, + /// 3 + public static Position BottomCenter + { + get + { + global::System.IntPtr cPtr = NDalicPINVOKE.AnchorPointBottomCenter_get(); + Position ret = (cPtr == global::System.IntPtr.Zero) ? null : new Position(cPtr, false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + } /// - /// Renders continuously. + /// BottomRight /// - Continuously + /// 3 + public static Position BottomRight + { + get + { + global::System.IntPtr cPtr = NDalicPINVOKE.AnchorPointBottomRight_get(); + Position ret = (cPtr == global::System.IntPtr.Zero) ? null : new Position(cPtr, false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + } } - } diff --git a/src/Tizen.NUI/src/public/NUIWidgetApplication.cs b/src/Tizen.NUI/src/public/NUIWidgetApplication.cs index 70c52fd..87e1d8b 100755 --- a/src/Tizen.NUI/src/public/NUIWidgetApplication.cs +++ b/src/Tizen.NUI/src/public/NUIWidgetApplication.cs @@ -20,7 +20,6 @@ using System.Collections.Generic; namespace Tizen.NUI { - /// /// Represents an application that have UI screen. The NUIWidgetApplication class has a default stage. /// @@ -51,6 +50,35 @@ namespace Tizen.NUI core?.RegisterWidgetInfo(new Dictionary { { widgetType, ApplicationInfo.ApplicationId } }); } + internal WidgetApplication ApplicationHandle + { + get + { + return ((NUIWidgetCoreBackend)this.Backend).WidgetApplicationHandle; + } + } + + /// + /// Run NUIWidgetApplication. + /// + /// Arguments from commandline. + /// 4 + public override void Run(string[] args) + { + Backend.AddEventHandler(EventType.PreCreated, OnPreCreate); + base.Run(args); + } + + /// + /// Exit NUIWidgetApplication. + /// + /// 4 + public override void Exit() + { + Tizen.Log.Fatal("NUI", "### NUIWidgetApplication Exit called"); + base.Exit(); + } + /// /// Overrides this method if want to handle OnLocaleChanged behavior. /// @@ -122,34 +150,5 @@ namespace Tizen.NUI Log.Fatal("NUI","OnCreate() is called!"); base.OnCreate(); } - - /// - /// Run NUIWidgetApplication. - /// - /// Arguments from commandline. - /// 4 - public override void Run(string[] args) - { - Backend.AddEventHandler(EventType.PreCreated, OnPreCreate); - base.Run(args); - } - - /// - /// Exit NUIWidgetApplication. - /// - /// 4 - public override void Exit() - { - Tizen.Log.Fatal("NUI", "### NUIWidgetApplication Exit called"); - base.Exit(); - } - - internal WidgetApplication ApplicationHandle - { - get - { - return ((NUIWidgetCoreBackend)this.Backend).WidgetApplicationHandle; - } - } } } \ No newline at end of file diff --git a/src/Tizen.NUI/src/public/PaddingType.cs b/src/Tizen.NUI/src/public/PaddingType.cs index 5e21aa7..cd038e3 100755 --- a/src/Tizen.NUI/src/public/PaddingType.cs +++ b/src/Tizen.NUI/src/public/PaddingType.cs @@ -26,178 +26,61 @@ namespace Tizen.NUI /// 3 public class PaddingType : global::System.IDisposable { - private global::System.Runtime.InteropServices.HandleRef swigCPtr; /// /// swigCMemOwn /// /// 3 protected bool swigCMemOwn; - internal PaddingType(global::System.IntPtr cPtr, bool cMemoryOwn) - { - swigCMemOwn = cMemoryOwn; - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); - } - - internal static global::System.Runtime.InteropServices.HandleRef getCPtr(PaddingType obj) - { - return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; - } - - //A Flag to check who called Dispose(). (By User or DisposeQueue) - private bool isDisposeQueued = false; /// /// A Flat to check if it is already disposed. /// /// 3 protected bool disposed = false; - /// - /// Dispose. - /// - /// 3 - ~PaddingType() - { - if (!isDisposeQueued) - { - isDisposeQueued = true; - DisposeQueue.Instance.Add(this); - } - } + //A Flag to check who called Dispose(). (By User or DisposeQueue) + private bool isDisposeQueued = false; + private global::System.Runtime.InteropServices.HandleRef swigCPtr; /// - /// Dispose. + /// Creates an uninitialized PaddingType. /// /// 3 - public void Dispose() + public PaddingType() : this(NDalicPINVOKE.new_PaddingType__SWIG_0(), true) { - //Throw excpetion if Dispose() is called in separate thread. - if (!Window.IsInstalled()) - { - throw new System.InvalidOperationException("This API called from separate thread. This API must be called from MainThread."); - } - - if (isDisposeQueued) - { - Dispose(DisposeTypes.Implicit); - } - else - { - Dispose(DisposeTypes.Explicit); - System.GC.SuppressFinalize(this); - } + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } /// - /// Dispose. + /// PaddingType Constructor. /// + /// Start padding or X coordinate + /// End padding or Y coordinate + /// Top padding or Height + /// Bottom padding or Width /// 3 - protected virtual void Dispose(DisposeTypes type) + public PaddingType(float start, float end, float top, float bottom) : this(NDalicPINVOKE.new_PaddingType__SWIG_1(start, end, top, bottom), true) { - if (disposed) - { - return; - } - - if (type == DisposeTypes.Explicit) - { - //Called by User - //Release your own managed resources here. - //You should release all of your own disposable objects here. - - } - - //Release your own unmanaged resources here. - //You should not access any managed member here except static instance. - //because the execution order of Finalizes is non-deterministic. - - if (swigCPtr.Handle != global::System.IntPtr.Zero) - { - if (swigCMemOwn) - { - swigCMemOwn = false; - NDalicPINVOKE.delete_PaddingType(swigCPtr); - } - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); - } - - disposed = true; + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } - /// - /// Equality operator. - /// - /// First operand - /// Second operand - /// True if the values are identical - /// 3 - public static bool operator ==(PaddingType a, PaddingType b) + internal PaddingType(global::System.IntPtr cPtr, bool cMemoryOwn) { - // If both are null, or both are same instance, return true. - if (System.Object.ReferenceEquals(a, b)) - { - return true; - } - - // If one is null, but not both, return false. - if (((object)a == null) || ((object)b == null)) - { - return false; - } - - // Return true if the fields match: - return (System.Math.Abs(a.Start- b.Start) < NDalic.GetRangedEpsilon(a.Start, b.Start)) && - (System.Math.Abs(a.End - b.End) < NDalic.GetRangedEpsilon(a.End, b.End)) && - (System.Math.Abs(a.Bottom - b.Bottom) < NDalic.GetRangedEpsilon(a.Bottom, b.Bottom)) && - (System.Math.Abs(a.Top - b.Top) < NDalic.GetRangedEpsilon(a.Top, b.Top)); + swigCMemOwn = cMemoryOwn; + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); } /// - /// Inequality operator. + /// Dispose. /// - /// First operand - /// Second operand - /// True if the values are not identical /// 3 - public static bool operator !=(PaddingType a, PaddingType b) - { - return !(a == b); - } - - - /// - /// Equals - /// - /// The object should be compared. - /// True if equal. - /// 4 - public override bool Equals(object o) + ~PaddingType() { - if(o == null) - { - return false; - } - if(!(o is PaddingType)) + if (!isDisposeQueued) { - return false; + isDisposeQueued = true; + DisposeQueue.Instance.Add(this); } - PaddingType p = (PaddingType)o; - - // Return true if the fields match: - return (System.Math.Abs(Start- p.Start) < NDalic.GetRangedEpsilon(Start, p.Start)) && - (System.Math.Abs(End - p.End) < NDalic.GetRangedEpsilon(End, p.End)) && - (System.Math.Abs(Bottom - p.Bottom) < NDalic.GetRangedEpsilon(Bottom, p.Bottom)) && - (System.Math.Abs(Top - p.Top) < NDalic.GetRangedEpsilon(Top, p.Top)); - } - - /// - /// Gets the the hash code of this baseHandle. - /// - /// The Hash Code. - /// 4 - public override int GetHashCode() - { - return base.GetHashCode(); } /// @@ -264,42 +147,6 @@ namespace Tizen.NUI } } - /// - /// Creates an uninitialized PaddingType. - /// - /// 3 - public PaddingType() : this(NDalicPINVOKE.new_PaddingType__SWIG_0(), true) - { - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - /// - /// PaddingType Constructor. - /// - /// Start padding or X coordinate - /// End padding or Y coordinate - /// Top padding or Height - /// Bottom padding or Width - /// 3 - public PaddingType(float start, float end, float top, float bottom) : this(NDalicPINVOKE.new_PaddingType__SWIG_1(start, end, top, bottom), true) - { - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - /// - /// Assignment from individual values. - /// - /// Start padding or X coordinate - /// End padding or Y coordinate - /// Top padding or Height - /// Bottom padding or Width - /// 3 - public void Set(float newStart, float newEnd, float newTop, float newBottom) - { - NDalicPINVOKE.PaddingType_Set(swigCPtr, newStart, newEnd, newTop, newBottom); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - private float left { set @@ -389,6 +236,160 @@ namespace Tizen.NUI return ret; } } + + /// + /// Equality operator. + /// + /// First operand + /// Second operand + /// True if the values are identical + /// 3 + public static bool operator ==(PaddingType a, PaddingType b) + { + // If both are null, or both are same instance, return true. + if (System.Object.ReferenceEquals(a, b)) + { + return true; + } + + // If one is null, but not both, return false. + if (((object)a == null) || ((object)b == null)) + { + return false; + } + + // Return true if the fields match: + return (System.Math.Abs(a.Start - b.Start) < NDalic.GetRangedEpsilon(a.Start, b.Start)) && + (System.Math.Abs(a.End - b.End) < NDalic.GetRangedEpsilon(a.End, b.End)) && + (System.Math.Abs(a.Bottom - b.Bottom) < NDalic.GetRangedEpsilon(a.Bottom, b.Bottom)) && + (System.Math.Abs(a.Top - b.Top) < NDalic.GetRangedEpsilon(a.Top, b.Top)); + } + + /// + /// Inequality operator. + /// + /// First operand + /// Second operand + /// True if the values are not identical + /// 3 + public static bool operator !=(PaddingType a, PaddingType b) + { + return !(a == b); + } + + /// + /// Dispose. + /// + /// 3 + public void Dispose() + { + //Throw excpetion if Dispose() is called in separate thread. + if (!Window.IsInstalled()) + { + throw new System.InvalidOperationException("This API called from separate thread. This API must be called from MainThread."); + } + + if (isDisposeQueued) + { + Dispose(DisposeTypes.Implicit); + } + else + { + Dispose(DisposeTypes.Explicit); + System.GC.SuppressFinalize(this); + } + } + + + /// + /// Equals + /// + /// The object should be compared. + /// True if equal. + /// 4 + public override bool Equals(object o) + { + if(o == null) + { + return false; + } + if(!(o is PaddingType)) + { + return false; + } + PaddingType p = (PaddingType)o; + + // Return true if the fields match: + return (System.Math.Abs(Start- p.Start) < NDalic.GetRangedEpsilon(Start, p.Start)) && + (System.Math.Abs(End - p.End) < NDalic.GetRangedEpsilon(End, p.End)) && + (System.Math.Abs(Bottom - p.Bottom) < NDalic.GetRangedEpsilon(Bottom, p.Bottom)) && + (System.Math.Abs(Top - p.Top) < NDalic.GetRangedEpsilon(Top, p.Top)); + } + + /// + /// Gets the the hash code of this baseHandle. + /// + /// The Hash Code. + /// 4 + public override int GetHashCode() + { + return base.GetHashCode(); + } + + /// + /// Assignment from individual values. + /// + /// Start padding or X coordinate + /// End padding or Y coordinate + /// Top padding or Height + /// Bottom padding or Width + /// 3 + public void Set(float newStart, float newEnd, float newTop, float newBottom) + { + NDalicPINVOKE.PaddingType_Set(swigCPtr, newStart, newEnd, newTop, newBottom); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + internal static global::System.Runtime.InteropServices.HandleRef getCPtr(PaddingType obj) + { + return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; + } + + /// + /// Dispose. + /// + /// 3 + protected virtual void Dispose(DisposeTypes type) + { + if (disposed) + { + return; + } + + if (type == DisposeTypes.Explicit) + { + //Called by User + //Release your own managed resources here. + //You should release all of your own disposable objects here. + + } + + //Release your own unmanaged resources here. + //You should not access any managed member here except static instance. + //because the execution order of Finalizes is non-deterministic. + + if (swigCPtr.Handle != global::System.IntPtr.Zero) + { + if (swigCMemOwn) + { + swigCMemOwn = false; + NDalicPINVOKE.delete_PaddingType(swigCPtr); + } + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); + } + + disposed = true; + } } } \ No newline at end of file diff --git a/src/Tizen.NUI/src/public/PanGesture.cs b/src/Tizen.NUI/src/public/PanGesture.cs index f590dec..206efbe 100755 --- a/src/Tizen.NUI/src/public/PanGesture.cs +++ b/src/Tizen.NUI/src/public/PanGesture.cs @@ -32,57 +32,27 @@ namespace Tizen.NUI { private global::System.Runtime.InteropServices.HandleRef swigCPtr; - internal PanGesture(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.PanGesture_SWIGUpcast(cPtr), cMemoryOwn) - { - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); - } - - internal static global::System.Runtime.InteropServices.HandleRef getCPtr(PanGesture obj) + /// + /// The default constructor. + /// + /// 3 + public PanGesture() : this(NDalicPINVOKE.new_PanGesture__SWIG_0(), true) { - return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } /// - /// Dispose. + /// The constructor. /// - /// 3 - protected override void Dispose(DisposeTypes type) + /// The state of the gesture + internal PanGesture(Gesture.StateType state) : this(NDalicPINVOKE.new_PanGesture__SWIG_1((int)state), true) { - if(disposed) - { - return; - } - - if(type == DisposeTypes.Explicit) - { - //Called by User - //Release your own managed resources here. - //You should release all of your own disposable objects here. - } - - //Release your own unmanaged resources here. - //You should not access any managed member here except static instance. - //because the execution order of Finalizes is non-deterministic. - - if (swigCPtr.Handle != global::System.IntPtr.Zero) - { - if (swigCMemOwn) - { - swigCMemOwn = false; - NDalicPINVOKE.delete_PanGesture(swigCPtr); - } - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); - } - - base.Dispose(type); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } - - internal static PanGesture GetPanGestureFromPtr(global::System.IntPtr cPtr) + internal PanGesture(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.PanGesture_SWIGUpcast(cPtr), cMemoryOwn) { - PanGesture ret = new PanGesture(cPtr, false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); } /// @@ -183,24 +153,6 @@ namespace Tizen.NUI } } - /// - /// The default constructor. - /// - /// 3 - public PanGesture() : this(NDalicPINVOKE.new_PanGesture__SWIG_0(), true) - { - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - /// - /// The constructor. - /// - /// The state of the gesture - internal PanGesture(Gesture.StateType state) : this(NDalicPINVOKE.new_PanGesture__SWIG_1((int)state), true) - { - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - private Vector2 velocity { @@ -313,6 +265,7 @@ namespace Tizen.NUI } } + /// /// Returns the speed at which the user is moving their fingers.
/// This is the pixel movement per millisecond.
@@ -368,6 +321,53 @@ namespace Tizen.NUI return ret; } + internal static global::System.Runtime.InteropServices.HandleRef getCPtr(PanGesture obj) + { + return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; + } + + internal static PanGesture GetPanGestureFromPtr(global::System.IntPtr cPtr) + { + PanGesture ret = new PanGesture(cPtr, false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + /// + /// Dispose. + /// + /// 3 + protected override void Dispose(DisposeTypes type) + { + if (disposed) + { + return; + } + + if (type == DisposeTypes.Explicit) + { + //Called by User + //Release your own managed resources here. + //You should release all of your own disposable objects here. + } + + //Release your own unmanaged resources here. + //You should not access any managed member here except static instance. + //because the execution order of Finalizes is non-deterministic. + + if (swigCPtr.Handle != global::System.IntPtr.Zero) + { + if (swigCMemOwn) + { + swigCMemOwn = false; + NDalicPINVOKE.delete_PanGesture(swigCPtr); + } + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); + } + + base.Dispose(type); + } + } } \ No newline at end of file diff --git a/src/Tizen.NUI/src/public/PanGestureDetector.cs b/src/Tizen.NUI/src/public/PanGestureDetector.cs index ffb8d77..b80f885 100755 --- a/src/Tizen.NUI/src/public/PanGestureDetector.cs +++ b/src/Tizen.NUI/src/public/PanGestureDetector.cs @@ -31,107 +31,39 @@ namespace Tizen.NUI { private global::System.Runtime.InteropServices.HandleRef swigCPtr; - internal PanGestureDetector(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.PanGestureDetector_SWIGUpcast(cPtr), cMemoryOwn) - { - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); - } - - internal static global::System.Runtime.InteropServices.HandleRef getCPtr(PanGestureDetector obj) - { - return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; - } + private DaliEventHandler _panGestureEventHandler; + private DetectedCallbackDelegate _panGestureCallbackDelegate; /// - /// Dispose. + /// Creates an initialized PanGestureDetector. /// - /// The dispose type /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] - protected override void Dispose(DisposeTypes type) + public PanGestureDetector() : this(NDalicPINVOKE.PanGestureDetector_New(), true) { - if (disposed) - { - return; - } - - if (type == DisposeTypes.Explicit) - { - //Called by User - //Release your own managed resources here. - //You should release all of your own disposable objects here. - - } - - //Release your own unmanaged resources here. - //You should not access any managed member here except static instance. - //because the execution order of Finalizes is non-deterministic. - - if (swigCPtr.Handle != global::System.IntPtr.Zero) - { - if (swigCMemOwn) - { - swigCMemOwn = false; - NDalicPINVOKE.delete_PanGestureDetector(swigCPtr); - } - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); - } + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - base.Dispose(type); } - /// - /// Event arguments that are passed via the PanGestureEvent signal. + /// The copy constructor. /// - /// 5 + /// A reference to the copied handle /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] - public class DetectedEventArgs : EventArgs + public PanGestureDetector(PanGestureDetector handle) : this(NDalicPINVOKE.new_PanGestureDetector__SWIG_1(PanGestureDetector.getCPtr(handle)), true) { - private View _view; - private PanGesture _panGesture; - - /// - /// The attached view. - /// - /// 5 - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - public View View - { - get - { - return _view; - } - set - { - _view = value; - } - } + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } - /// - /// The PanGesture. - /// - /// 5 - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - public PanGesture PanGesture - { - get - { - return _panGesture; - } - set - { - _panGesture = value; - } - } + internal PanGestureDetector(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.PanGestureDetector_SWIGUpcast(cPtr), cMemoryOwn) + { + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); } + [UnmanagedFunctionPointer(CallingConvention.StdCall)] private delegate void DetectedCallbackDelegate(IntPtr actor, IntPtr panGesture); - private DaliEventHandler _panGestureEventHandler; - private DetectedCallbackDelegate _panGestureCallbackDelegate; /// /// This signal is emitted when the specified pan is detected on the attached view. @@ -169,138 +101,6 @@ namespace Tizen.NUI } } - private void OnPanGestureDetected(IntPtr actor, IntPtr panGesture) - { - DetectedEventArgs e = new DetectedEventArgs(); - - // Populate all members of "e" (PanGestureEventArgs) with real data - e.View = Registry.GetManagedBaseHandleFromNativePtr(actor) as View; - e.PanGesture = Tizen.NUI.PanGesture.GetPanGestureFromPtr(panGesture); - - if (_panGestureEventHandler != null) - { - //here we send all data to user event handlers - _panGestureEventHandler(this, e); - } - - } - - internal static PanGestureDetector GetPanGestureDetectorFromPtr(global::System.IntPtr cPtr) - { - PanGestureDetector ret = new PanGestureDetector(cPtr, false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - internal class Property : global::System.IDisposable - { - private global::System.Runtime.InteropServices.HandleRef swigCPtr; - - protected bool swigCMemOwn; - - internal Property(global::System.IntPtr cPtr, bool cMemoryOwn) - { - swigCMemOwn = cMemoryOwn; - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); - } - - internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Property obj) - { - return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; - } - - //A Flag to check who called Dispose(). (By User or DisposeQueue) - private bool isDisposeQueued = false; - //A Flat to check if it is already disposed. - - protected bool disposed = false; - - - ~Property() - { - if (!isDisposeQueued) - { - isDisposeQueued = true; - DisposeQueue.Instance.Add(this); - } - } - - - public void Dispose() - { - //Throw excpetion if Dispose() is called in separate thread. - if (!Window.IsInstalled()) - { - throw new System.InvalidOperationException("This API called from separate thread. This API must be called from MainThread."); - } - - if (isDisposeQueued) - { - Dispose(DisposeTypes.Implicit); - } - else - { - Dispose(DisposeTypes.Explicit); - System.GC.SuppressFinalize(this); - } - } - - - protected virtual void Dispose(DisposeTypes type) - { - if (disposed) - { - return; - } - - if (type == DisposeTypes.Explicit) - { - //Called by User - //Release your own managed resources here. - //You should release all of your own disposable objects here. - - } - - //Release your own unmanaged resources here. - //You should not access any managed member here except static instance. - //because the execution order of Finalizes is non-deterministic. - - if (swigCPtr.Handle != global::System.IntPtr.Zero) - { - if (swigCMemOwn) - { - swigCMemOwn = false; - NDalicPINVOKE.delete_PanGestureDetector_Property(swigCPtr); - } - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); - } - - disposed = true; - } - - - public Property() : this(NDalicPINVOKE.new_PanGestureDetector_Property(), true) - { - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - - public static readonly int SCREEN_POSITION = NDalicPINVOKE.PanGestureDetector_Property_SCREEN_POSITION_get(); - - public static readonly int SCREEN_DISPLACEMENT = NDalicPINVOKE.PanGestureDetector_Property_SCREEN_DISPLACEMENT_get(); - - public static readonly int SCREEN_VELOCITY = NDalicPINVOKE.PanGestureDetector_Property_SCREEN_VELOCITY_get(); - - public static readonly int LOCAL_POSITION = NDalicPINVOKE.PanGestureDetector_Property_LOCAL_POSITION_get(); - - public static readonly int LOCAL_DISPLACEMENT = NDalicPINVOKE.PanGestureDetector_Property_LOCAL_DISPLACEMENT_get(); - - public static readonly int LOCAL_VELOCITY = NDalicPINVOKE.PanGestureDetector_Property_LOCAL_VELOCITY_get(); - - public static readonly int PANNING = NDalicPINVOKE.PanGestureDetector_Property_PANNING_get(); - - } - /// /// For a left pan (-PI Radians). /// @@ -414,39 +214,108 @@ namespace Tizen.NUI } /// - /// Creates an initialized PanGestureDetector. + /// Retrieves the screen position. /// /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] - public PanGestureDetector() : this(NDalicPINVOKE.PanGestureDetector_New(), true) - { - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - - } - - internal new static PanGestureDetector DownCast(BaseHandle handle) + public Vector2 ScreenPosition { - PanGestureDetector ret = Registry.GetManagedBaseHandleFromNativePtr(handle) as PanGestureDetector; - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; + get + { + Vector2 temp = new Vector2(0.0f, 0.0f); + Tizen.NUI.Object.GetProperty(swigCPtr, PanGestureDetector.Property.SCREEN_POSITION).Get(temp); + return temp; + } } /// - /// The copy constructor. + /// Retrieves the screen displacement. /// - /// A reference to the copied handle /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] - public PanGestureDetector(PanGestureDetector handle) : this(NDalicPINVOKE.new_PanGestureDetector__SWIG_1(PanGestureDetector.getCPtr(handle)), true) - { - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - internal PanGestureDetector Assign(PanGestureDetector rhs) + public Vector2 ScreenDisplacement { - PanGestureDetector ret = new PanGestureDetector(NDalicPINVOKE.PanGestureDetector_Assign(swigCPtr, PanGestureDetector.getCPtr(rhs)), false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; + get + { + Vector2 temp = new Vector2(0.0f, 0.0f); + Tizen.NUI.Object.GetProperty(swigCPtr, PanGestureDetector.Property.SCREEN_DISPLACEMENT).Get(temp); + return temp; + } + } + + /// + /// Retrieves the screen velocity. + /// + /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + public Vector2 ScreenVelocity + { + get + { + Vector2 temp = new Vector2(0.0f, 0.0f); + Tizen.NUI.Object.GetProperty(swigCPtr, PanGestureDetector.Property.SCREEN_VELOCITY).Get(temp); + return temp; + } + } + + /// + /// Retrieves the local position. + /// + /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + public Vector2 LocalPosition + { + get + { + Vector2 temp = new Vector2(0.0f, 0.0f); + Tizen.NUI.Object.GetProperty(swigCPtr, PanGestureDetector.Property.LOCAL_POSITION).Get(temp); + return temp; + } + } + + /// + /// Retrieves the local displacement + /// + /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + public Vector2 LocalDisplacement + { + get + { + Vector2 temp = new Vector2(0.0f, 0.0f); + Tizen.NUI.Object.GetProperty(swigCPtr, PanGestureDetector.Property.LOCAL_DISPLACEMENT).Get(temp); + return temp; + } + } + + /// + /// Retrieves the local velocity. + /// + /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + public Vector2 LocalVelocity + { + get + { + Vector2 temp = new Vector2(0.0f, 0.0f); + Tizen.NUI.Object.GetProperty(swigCPtr, PanGestureDetector.Property.LOCAL_VELOCITY).Get(temp); + return temp; + } + } + + /// + /// Retrieves the panning flag. + /// + /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + public bool Panning + { + get + { + bool temp = false; + Tizen.NUI.Object.GetProperty(swigCPtr, PanGestureDetector.Property.PANNING).Get(out temp); + return temp; + } } /// @@ -570,13 +439,6 @@ namespace Tizen.NUI return ret; } - internal AngleThresholdPair GetAngle(uint index) - { - AngleThresholdPair ret = new AngleThresholdPair(NDalicPINVOKE.PanGestureDetector_GetAngle(swigCPtr, index), true); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - /// /// Clears any directional angles that are used by the gesture detector. /// @@ -612,13 +474,6 @@ namespace Tizen.NUI if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } - internal PanGestureDetectedSignal DetectedSignal() - { - PanGestureDetectedSignal ret = new PanGestureDetectedSignal(NDalicPINVOKE.PanGestureDetector_DetectedSignal(swigCPtr), false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - /// /// Allows setting of the pan properties that are returned in constraints. /// @@ -631,109 +486,250 @@ namespace Tizen.NUI if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } - /// - /// Retrieves the screen position. - /// - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - public Vector2 ScreenPosition + internal static PanGestureDetector GetPanGestureDetectorFromPtr(global::System.IntPtr cPtr) { - get - { - Vector2 temp = new Vector2(0.0f, 0.0f); - Tizen.NUI.Object.GetProperty(swigCPtr, PanGestureDetector.Property.SCREEN_POSITION).Get(temp); - return temp; - } + PanGestureDetector ret = new PanGestureDetector(cPtr, false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; } - /// - /// Retrieves the screen displacement. - /// - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - public Vector2 ScreenDisplacement + internal static global::System.Runtime.InteropServices.HandleRef getCPtr(PanGestureDetector obj) { - get - { - Vector2 temp = new Vector2(0.0f, 0.0f); - Tizen.NUI.Object.GetProperty(swigCPtr, PanGestureDetector.Property.SCREEN_DISPLACEMENT).Get(temp); - return temp; - } + return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; } - /// - /// Retrieves the screen velocity. - /// - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - public Vector2 ScreenVelocity + internal new static PanGestureDetector DownCast(BaseHandle handle) { - get - { - Vector2 temp = new Vector2(0.0f, 0.0f); - Tizen.NUI.Object.GetProperty(swigCPtr, PanGestureDetector.Property.SCREEN_VELOCITY).Get(temp); - return temp; - } + PanGestureDetector ret = Registry.GetManagedBaseHandleFromNativePtr(handle) as PanGestureDetector; + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + internal AngleThresholdPair GetAngle(uint index) + { + AngleThresholdPair ret = new AngleThresholdPair(NDalicPINVOKE.PanGestureDetector_GetAngle(swigCPtr, index), true); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + internal PanGestureDetector Assign(PanGestureDetector rhs) + { + PanGestureDetector ret = new PanGestureDetector(NDalicPINVOKE.PanGestureDetector_Assign(swigCPtr, PanGestureDetector.getCPtr(rhs)), false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + internal PanGestureDetectedSignal DetectedSignal() + { + PanGestureDetectedSignal ret = new PanGestureDetectedSignal(NDalicPINVOKE.PanGestureDetector_DetectedSignal(swigCPtr), false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; } /// - /// Retrieves the local position. + /// Dispose. /// + /// The dispose type /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] - public Vector2 LocalPosition + protected override void Dispose(DisposeTypes type) { - get + if (disposed) { - Vector2 temp = new Vector2(0.0f, 0.0f); - Tizen.NUI.Object.GetProperty(swigCPtr, PanGestureDetector.Property.LOCAL_POSITION).Get(temp); - return temp; + return; + } + + if (type == DisposeTypes.Explicit) + { + //Called by User + //Release your own managed resources here. + //You should release all of your own disposable objects here. + + } + + //Release your own unmanaged resources here. + //You should not access any managed member here except static instance. + //because the execution order of Finalizes is non-deterministic. + + if (swigCPtr.Handle != global::System.IntPtr.Zero) + { + if (swigCMemOwn) + { + swigCMemOwn = false; + NDalicPINVOKE.delete_PanGestureDetector(swigCPtr); + } + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); } + + base.Dispose(type); } - /// - /// Retrieves the local displacement - /// - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - public Vector2 LocalDisplacement + private void OnPanGestureDetected(IntPtr actor, IntPtr panGesture) { - get + DetectedEventArgs e = new DetectedEventArgs(); + + // Populate all members of "e" (PanGestureEventArgs) with real data + e.View = Registry.GetManagedBaseHandleFromNativePtr(actor) as View; + e.PanGesture = Tizen.NUI.PanGesture.GetPanGestureFromPtr(panGesture); + + if (_panGestureEventHandler != null) { - Vector2 temp = new Vector2(0.0f, 0.0f); - Tizen.NUI.Object.GetProperty(swigCPtr, PanGestureDetector.Property.LOCAL_DISPLACEMENT).Get(temp); - return temp; + //here we send all data to user event handlers + _panGestureEventHandler(this, e); } + } /// - /// Retrieves the local velocity. + /// Event arguments that are passed via the PanGestureEvent signal. /// + /// 5 /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] - public Vector2 LocalVelocity + public class DetectedEventArgs : EventArgs { - get + private View _view; + private PanGesture _panGesture; + + /// + /// The attached view. + /// + /// 5 + /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + public View View { - Vector2 temp = new Vector2(0.0f, 0.0f); - Tizen.NUI.Object.GetProperty(swigCPtr, PanGestureDetector.Property.LOCAL_VELOCITY).Get(temp); - return temp; + get + { + return _view; + } + set + { + _view = value; + } + } + + /// + /// The PanGesture. + /// + /// 5 + /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + public PanGesture PanGesture + { + get + { + return _panGesture; + } + set + { + _panGesture = value; + } } } - /// - /// Retrieves the panning flag. - /// - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - public bool Panning + internal class Property : global::System.IDisposable { - get + public static readonly int SCREEN_POSITION = NDalicPINVOKE.PanGestureDetector_Property_SCREEN_POSITION_get(); + + public static readonly int SCREEN_DISPLACEMENT = NDalicPINVOKE.PanGestureDetector_Property_SCREEN_DISPLACEMENT_get(); + + public static readonly int SCREEN_VELOCITY = NDalicPINVOKE.PanGestureDetector_Property_SCREEN_VELOCITY_get(); + + public static readonly int LOCAL_POSITION = NDalicPINVOKE.PanGestureDetector_Property_LOCAL_POSITION_get(); + + public static readonly int LOCAL_DISPLACEMENT = NDalicPINVOKE.PanGestureDetector_Property_LOCAL_DISPLACEMENT_get(); + + public static readonly int LOCAL_VELOCITY = NDalicPINVOKE.PanGestureDetector_Property_LOCAL_VELOCITY_get(); + + public static readonly int PANNING = NDalicPINVOKE.PanGestureDetector_Property_PANNING_get(); + + protected bool swigCMemOwn; + //A Flat to check if it is already disposed. + protected bool disposed = false; + + private global::System.Runtime.InteropServices.HandleRef swigCPtr; + //A Flag to check who called Dispose(). (By User or DisposeQueue) + private bool isDisposeQueued = false; + + public Property() : this(NDalicPINVOKE.new_PanGestureDetector_Property(), true) { - bool temp = false; - Tizen.NUI.Object.GetProperty(swigCPtr, PanGestureDetector.Property.PANNING).Get(out temp); - return temp; + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } + + internal Property(global::System.IntPtr cPtr, bool cMemoryOwn) + { + swigCMemOwn = cMemoryOwn; + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); + } + + ~Property() + { + if (!isDisposeQueued) + { + isDisposeQueued = true; + DisposeQueue.Instance.Add(this); + } + } + + + public void Dispose() + { + //Throw excpetion if Dispose() is called in separate thread. + if (!Window.IsInstalled()) + { + throw new System.InvalidOperationException("This API called from separate thread. This API must be called from MainThread."); + } + + if (isDisposeQueued) + { + Dispose(DisposeTypes.Implicit); + } + else + { + Dispose(DisposeTypes.Explicit); + System.GC.SuppressFinalize(this); + } + } + + internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Property obj) + { + return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; + } + + protected virtual void Dispose(DisposeTypes type) + { + if (disposed) + { + return; + } + + if (type == DisposeTypes.Explicit) + { + //Called by User + //Release your own managed resources here. + //You should release all of your own disposable objects here. + + } + + //Release your own unmanaged resources here. + //You should not access any managed member here except static instance. + //because the execution order of Finalizes is non-deterministic. + + if (swigCPtr.Handle != global::System.IntPtr.Zero) + { + if (swigCMemOwn) + { + swigCMemOwn = false; + NDalicPINVOKE.delete_PanGestureDetector_Property(swigCPtr); + } + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); + } + + disposed = true; + } + + } } diff --git a/src/Tizen.NUI/src/public/Path.cs b/src/Tizen.NUI/src/public/Path.cs index 6dd06d7..b72cc51 100755 --- a/src/Tizen.NUI/src/public/Path.cs +++ b/src/Tizen.NUI/src/public/Path.cs @@ -30,67 +30,56 @@ namespace Tizen.NUI { private global::System.Runtime.InteropServices.HandleRef swigCPtr; - internal Path(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.Path_SWIGUpcast(cPtr), cMemoryOwn) + /// + /// Creates an initialized path handle. + /// + /// 3 + public Path() : this(NDalicPINVOKE.Path_New(), true) { - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } - internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Path obj) + internal Path(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.Path_SWIGUpcast(cPtr), cMemoryOwn) { - return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); } + /// - /// Dispose + /// Enumeration for the Points. /// - /// The dispoase type /// 3 - protected override void Dispose(DisposeTypes type) + public PropertyArray Points { - if(disposed) - { - return; - } - - if(type == DisposeTypes.Explicit) + get { - //Called by User - //Release your own managed resources here. - //You should release all of your own disposable objects here. + Tizen.NUI.PropertyArray temp = new Tizen.NUI.PropertyArray(); + Tizen.NUI.Object.GetProperty(swigCPtr, Path.Property.POINTS).Get(temp); + return temp; } - - //Release your own unmanaged resources here. - //You should not access any managed member here except static instance. - //because the execution order of Finalizes is non-deterministic. - - if (swigCPtr.Handle != global::System.IntPtr.Zero) + set { - if (swigCMemOwn) - { - swigCMemOwn = false; - NDalicPINVOKE.delete_Path(swigCPtr); - } - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); + Tizen.NUI.Object.SetProperty(swigCPtr, Path.Property.POINTS, new Tizen.NUI.PropertyValue(value)); } - - base.Dispose(type); - } - - - internal class Property - { - internal static readonly int POINTS = NDalicPINVOKE.Path_Property_POINTS_get(); - internal static readonly int CONTROL_POINTS = NDalicPINVOKE.Path_Property_CONTROL_POINTS_get(); } /// - /// Creates an initialized path handle. + /// Enumeration for the ControlPoints. /// /// 3 - public Path() : this(NDalicPINVOKE.Path_New(), true) + public PropertyArray ControlPoints { - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - + get + { + Tizen.NUI.PropertyArray temp = new Tizen.NUI.PropertyArray(); + Tizen.NUI.Object.GetProperty(swigCPtr, Path.Property.CONTROL_POINTS).Get(temp); + return temp; + } + set + { + Tizen.NUI.Object.SetProperty(swigCPtr, Path.Property.CONTROL_POINTS, new Tizen.NUI.PropertyValue(value)); + } } /// @@ -180,40 +169,51 @@ namespace Tizen.NUI return ret; } - /// - /// Enumeration for the Points. - /// - /// 3 - public PropertyArray Points + internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Path obj) { - get - { - Tizen.NUI.PropertyArray temp = new Tizen.NUI.PropertyArray(); - Tizen.NUI.Object.GetProperty(swigCPtr, Path.Property.POINTS).Get(temp); - return temp; - } - set - { - Tizen.NUI.Object.SetProperty(swigCPtr, Path.Property.POINTS, new Tizen.NUI.PropertyValue(value)); - } + return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; } /// - /// Enumeration for the ControlPoints. + /// Dispose /// + /// The dispoase type /// 3 - public PropertyArray ControlPoints + protected override void Dispose(DisposeTypes type) { - get + if (disposed) { - Tizen.NUI.PropertyArray temp = new Tizen.NUI.PropertyArray(); - Tizen.NUI.Object.GetProperty(swigCPtr, Path.Property.CONTROL_POINTS).Get(temp); - return temp; + return; } - set + + if (type == DisposeTypes.Explicit) { - Tizen.NUI.Object.SetProperty(swigCPtr, Path.Property.CONTROL_POINTS, new Tizen.NUI.PropertyValue(value)); + //Called by User + //Release your own managed resources here. + //You should release all of your own disposable objects here. } + + //Release your own unmanaged resources here. + //You should not access any managed member here except static instance. + //because the execution order of Finalizes is non-deterministic. + + if (swigCPtr.Handle != global::System.IntPtr.Zero) + { + if (swigCMemOwn) + { + swigCMemOwn = false; + NDalicPINVOKE.delete_Path(swigCPtr); + } + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); + } + + base.Dispose(type); + } + + internal class Property + { + internal static readonly int POINTS = NDalicPINVOKE.Path_Property_POINTS_get(); + internal static readonly int CONTROL_POINTS = NDalicPINVOKE.Path_Property_CONTROL_POINTS_get(); } } diff --git a/src/Tizen.NUI/src/public/PinchGesture.cs b/src/Tizen.NUI/src/public/PinchGesture.cs index f1b122a..f1a7f4f 100755 --- a/src/Tizen.NUI/src/public/PinchGesture.cs +++ b/src/Tizen.NUI/src/public/PinchGesture.cs @@ -33,53 +33,6 @@ namespace Tizen.NUI swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); } - internal static global::System.Runtime.InteropServices.HandleRef getCPtr(PinchGesture obj) - { - return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; - } - - /// - /// Dispose. - /// - /// 3 - protected override void Dispose(DisposeTypes type) - { - if(disposed) - { - return; - } - - if(type == DisposeTypes.Explicit) - { - //Called by User - //Release your own managed resources here. - //You should release all of your own disposable objects here. - } - - //Release your own unmanaged resources here. - //You should not access any managed member here except static instance. - //because the execution order of Finalizes is non-deterministic. - - if (swigCPtr.Handle != global::System.IntPtr.Zero) - { - if (swigCMemOwn) - { - swigCMemOwn = false; - NDalicPINVOKE.delete_PinchGesture(swigCPtr); - } - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); - } - - base.Dispose(type); - } - - - internal static PinchGesture GetPinchGestureFromPtr(global::System.IntPtr cPtr) - { - PinchGesture ret = new PinchGesture(cPtr, false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } /// /// The scale factor from the start of the pinch gesture till the latest pinch gesture.
@@ -206,6 +159,53 @@ namespace Tizen.NUI } } + internal static global::System.Runtime.InteropServices.HandleRef getCPtr(PinchGesture obj) + { + return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; + } + + internal static PinchGesture GetPinchGestureFromPtr(global::System.IntPtr cPtr) + { + PinchGesture ret = new PinchGesture(cPtr, false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + /// + /// Dispose. + /// + /// 3 + protected override void Dispose(DisposeTypes type) + { + if (disposed) + { + return; + } + + if (type == DisposeTypes.Explicit) + { + //Called by User + //Release your own managed resources here. + //You should release all of your own disposable objects here. + } + + //Release your own unmanaged resources here. + //You should not access any managed member here except static instance. + //because the execution order of Finalizes is non-deterministic. + + if (swigCPtr.Handle != global::System.IntPtr.Zero) + { + if (swigCMemOwn) + { + swigCMemOwn = false; + NDalicPINVOKE.delete_PinchGesture(swigCPtr); + } + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); + } + + base.Dispose(type); + } + } } \ No newline at end of file diff --git a/src/Tizen.NUI/src/public/PinchGestureDetector.cs b/src/Tizen.NUI/src/public/PinchGestureDetector.cs index 133164f..2566212 100755 --- a/src/Tizen.NUI/src/public/PinchGestureDetector.cs +++ b/src/Tizen.NUI/src/public/PinchGestureDetector.cs @@ -30,16 +30,110 @@ namespace Tizen.NUI { private global::System.Runtime.InteropServices.HandleRef swigCPtr; + private DaliEventHandler _pinchGestureEventHandler; + private DetectedCallbackDelegate _pinchGestureCallbackDelegate; + + + /// + /// Creates an initialized PinchGestureDetector. + /// + /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + public PinchGestureDetector() : this(NDalicPINVOKE.PinchGestureDetector_New(), true) + { + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + + } + + /// + /// The copy constructor. + /// + /// A reference to the copied handle + /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + public PinchGestureDetector(PinchGestureDetector handle) : this(NDalicPINVOKE.new_PinchGestureDetector__SWIG_1(PinchGestureDetector.getCPtr(handle)), true) + { + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + internal PinchGestureDetector(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.PinchGestureDetector_SWIGUpcast(cPtr), cMemoryOwn) { swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); } + [UnmanagedFunctionPointer(CallingConvention.StdCall)] + private delegate void DetectedCallbackDelegate(IntPtr actor, IntPtr pinchGesture); + + /// + /// This signal is emitted when the specified pinch is detected on the attached view. + /// + /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + public event DaliEventHandler Detected + { + add + { + lock (this) + { + // Restricted to only one listener + if (_pinchGestureEventHandler == null) + { + _pinchGestureEventHandler += value; + + _pinchGestureCallbackDelegate = new DetectedCallbackDelegate(OnPinchGestureDetected); + this.DetectedSignal().Connect(_pinchGestureCallbackDelegate); + } + } + } + + remove + { + lock (this) + { + if (_pinchGestureEventHandler != null) + { + this.DetectedSignal().Disconnect(_pinchGestureCallbackDelegate); + } + + _pinchGestureEventHandler -= value; + } + } + } + + + internal static PinchGestureDetector GetPinchGestureDetectorFromPtr(global::System.IntPtr cPtr) + { + PinchGestureDetector ret = new PinchGestureDetector(cPtr, false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + internal new static PinchGestureDetector DownCast(BaseHandle handle) + { + PinchGestureDetector ret = Registry.GetManagedBaseHandleFromNativePtr(handle) as PinchGestureDetector; + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + internal static global::System.Runtime.InteropServices.HandleRef getCPtr(PinchGestureDetector obj) { return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; } + internal PinchGestureDetector Assign(PinchGestureDetector rhs) + { + PinchGestureDetector ret = new PinchGestureDetector(NDalicPINVOKE.PinchGestureDetector_Assign(swigCPtr, PinchGestureDetector.getCPtr(rhs)), false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + internal PinchGestureDetectedSignal DetectedSignal() + { + PinchGestureDetectedSignal ret = new PinchGestureDetectedSignal(NDalicPINVOKE.PinchGestureDetector_DetectedSignal(swigCPtr), false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + /// /// Dispose. /// @@ -79,6 +173,22 @@ namespace Tizen.NUI base.Dispose(type); } + private void OnPinchGestureDetected(IntPtr actor, IntPtr pinchGesture) + { + DetectedEventArgs e = new DetectedEventArgs(); + + // Populate all members of "e" (DetectedEventArgs) with real data. + e.View = Registry.GetManagedBaseHandleFromNativePtr(actor) as View; + e.PinchGesture = Tizen.NUI.PinchGesture.GetPinchGestureFromPtr(pinchGesture); + + if (_pinchGestureEventHandler != null) + { + //Here we send all data to user event handlers. + _pinchGestureEventHandler(this, e); + } + + } + /// /// Event arguments that passed via the PinchGestureEvent signal. /// @@ -127,114 +237,6 @@ namespace Tizen.NUI } } - [UnmanagedFunctionPointer(CallingConvention.StdCall)] - private delegate void DetectedCallbackDelegate(IntPtr actor, IntPtr pinchGesture); - private DaliEventHandler _pinchGestureEventHandler; - private DetectedCallbackDelegate _pinchGestureCallbackDelegate; - - /// - /// This signal is emitted when the specified pinch is detected on the attached view. - /// - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - public event DaliEventHandler Detected - { - add - { - lock (this) - { - // Restricted to only one listener - if (_pinchGestureEventHandler == null) - { - _pinchGestureEventHandler += value; - - _pinchGestureCallbackDelegate = new DetectedCallbackDelegate(OnPinchGestureDetected); - this.DetectedSignal().Connect(_pinchGestureCallbackDelegate); - } - } - } - - remove - { - lock (this) - { - if (_pinchGestureEventHandler != null) - { - this.DetectedSignal().Disconnect(_pinchGestureCallbackDelegate); - } - - _pinchGestureEventHandler -= value; - } - } - } - - private void OnPinchGestureDetected(IntPtr actor, IntPtr pinchGesture) - { - DetectedEventArgs e = new DetectedEventArgs(); - - // Populate all members of "e" (DetectedEventArgs) with real data. - e.View = Registry.GetManagedBaseHandleFromNativePtr(actor) as View; - e.PinchGesture = Tizen.NUI.PinchGesture.GetPinchGestureFromPtr(pinchGesture); - - if (_pinchGestureEventHandler != null) - { - //Here we send all data to user event handlers. - _pinchGestureEventHandler(this, e); - } - - } - - - internal static PinchGestureDetector GetPinchGestureDetectorFromPtr(global::System.IntPtr cPtr) - { - PinchGestureDetector ret = new PinchGestureDetector(cPtr, false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - /// - /// Creates an initialized PinchGestureDetector. - /// - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - public PinchGestureDetector() : this(NDalicPINVOKE.PinchGestureDetector_New(), true) - { - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - - } - - internal new static PinchGestureDetector DownCast(BaseHandle handle) - { - PinchGestureDetector ret = Registry.GetManagedBaseHandleFromNativePtr(handle) as PinchGestureDetector; - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - /// - /// The copy constructor. - /// - /// A reference to the copied handle - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - public PinchGestureDetector(PinchGestureDetector handle) : this(NDalicPINVOKE.new_PinchGestureDetector__SWIG_1(PinchGestureDetector.getCPtr(handle)), true) - { - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - internal PinchGestureDetector Assign(PinchGestureDetector rhs) - { - PinchGestureDetector ret = new PinchGestureDetector(NDalicPINVOKE.PinchGestureDetector_Assign(swigCPtr, PinchGestureDetector.getCPtr(rhs)), false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - internal PinchGestureDetectedSignal DetectedSignal() - { - PinchGestureDetectedSignal ret = new PinchGestureDetectedSignal(NDalicPINVOKE.PinchGestureDetector_DetectedSignal(swigCPtr), false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - } } diff --git a/src/Tizen.NUI/src/public/PixelBuffer.cs b/src/Tizen.NUI/src/public/PixelBuffer.cs index 79d977a..6392333 100755 --- a/src/Tizen.NUI/src/public/PixelBuffer.cs +++ b/src/Tizen.NUI/src/public/PixelBuffer.cs @@ -38,51 +38,6 @@ namespace Tizen.NUI { private global::System.Runtime.InteropServices.HandleRef swigCPtr; - internal PixelBuffer(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.PixelBuffer_SWIGUpcast(cPtr), cMemoryOwn) - { - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); - } - - internal static global::System.Runtime.InteropServices.HandleRef getCPtr(PixelBuffer obj) - { - return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; - } - - /// - /// Dispose. - /// - /// 5 - protected override void Dispose(DisposeTypes type) - { - if (disposed) - { - return; - } - - if (type == DisposeTypes.Explicit) - { - //Called by User. - //Release your own managed resources here. - //You should release all of your own disposable objects here. - - } - - //Release your own unmanaged resources here. - //You should not access any managed member here except static instance. - //Because the execution order of Finalizes is non-deterministic. - if (swigCPtr.Handle != global::System.IntPtr.Zero) - { - if (swigCMemOwn) - { - swigCMemOwn = false; - NDalicPINVOKE.delete_PixelBuffer(swigCPtr); - } - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); - } - - base.Dispose(type); - } - /// /// Create a PixelBuffer with its own data buffer. /// @@ -102,11 +57,9 @@ namespace Tizen.NUI if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } - internal PixelBuffer Assign(PixelBuffer rhs) + internal PixelBuffer(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.PixelBuffer_SWIGUpcast(cPtr), cMemoryOwn) { - PixelBuffer ret = new PixelBuffer(NDalicPINVOKE.PixelBuffer_Assign(swigCPtr, PixelBuffer.getCPtr(rhs)), false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); } /// @@ -142,14 +95,6 @@ namespace Tizen.NUI return ret; } - internal SWIGTYPE_p_unsigned_char GetBuffer() - { - global::System.IntPtr cPtr = NDalicPINVOKE.PixelBuffer_GetBuffer(swigCPtr); - SWIGTYPE_p_unsigned_char ret = (cPtr == global::System.IntPtr.Zero) ? null : new SWIGTYPE_p_unsigned_char(cPtr, false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - /// /// Gets the width of the buffer in pixels. /// @@ -302,6 +247,61 @@ namespace Tizen.NUI if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } + internal static global::System.Runtime.InteropServices.HandleRef getCPtr(PixelBuffer obj) + { + return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; + } + + internal PixelBuffer Assign(PixelBuffer rhs) + { + PixelBuffer ret = new PixelBuffer(NDalicPINVOKE.PixelBuffer_Assign(swigCPtr, PixelBuffer.getCPtr(rhs)), false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + internal SWIGTYPE_p_unsigned_char GetBuffer() + { + global::System.IntPtr cPtr = NDalicPINVOKE.PixelBuffer_GetBuffer(swigCPtr); + SWIGTYPE_p_unsigned_char ret = (cPtr == global::System.IntPtr.Zero) ? null : new SWIGTYPE_p_unsigned_char(cPtr, false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + /// + /// Dispose. + /// + /// 5 + protected override void Dispose(DisposeTypes type) + { + if (disposed) + { + return; + } + + if (type == DisposeTypes.Explicit) + { + //Called by User. + //Release your own managed resources here. + //You should release all of your own disposable objects here. + + } + + //Release your own unmanaged resources here. + //You should not access any managed member here except static instance. + //Because the execution order of Finalizes is non-deterministic. + if (swigCPtr.Handle != global::System.IntPtr.Zero) + { + if (swigCMemOwn) + { + swigCMemOwn = false; + NDalicPINVOKE.delete_PixelBuffer(swigCPtr); + } + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); + } + + base.Dispose(type); + } + } } diff --git a/src/Tizen.NUI/src/public/PixelData.cs b/src/Tizen.NUI/src/public/PixelData.cs index b5c776e..386907e 100755 --- a/src/Tizen.NUI/src/public/PixelData.cs +++ b/src/Tizen.NUI/src/public/PixelData.cs @@ -36,53 +36,6 @@ namespace Tizen.NUI { private global::System.Runtime.InteropServices.HandleRef swigCPtr; - internal PixelData(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.PixelData_SWIGUpcast(cPtr), cMemoryOwn) - { - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); - } - - internal static global::System.Runtime.InteropServices.HandleRef getCPtr(PixelData obj) - { - return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; - } - - /// - /// Dispose. - /// - /// 5 - protected override void Dispose(DisposeTypes type) - { - if (disposed) - { - return; - } - - if (type == DisposeTypes.Explicit) - { - //Called by User. - //Release your own managed resources here. - //You should release all of your own disposable objects here. - - } - - //Release your own unmanaged resources here. - //You should not access any managed member here except static instance. - //Because the execution order of Finalizes is non-deterministic. - - - if (swigCPtr.Handle != global::System.IntPtr.Zero) - { - if (swigCMemOwn) - { - swigCMemOwn = false; - NDalicPINVOKE.delete_PixelData(swigCPtr); - } - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); - } - - base.Dispose(type); - } - /// /// Creates a PixelData object. /// @@ -101,6 +54,30 @@ namespace Tizen.NUI } + internal PixelData(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.PixelData_SWIGUpcast(cPtr), cMemoryOwn) + { + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); + } + + /// + /// Enumeration for function to release the pixel buffer. + /// + /// 5 + /// This will be released at Tizen.NET API Level 5, so currently this would be used as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + public enum ReleaseFunction + { + /// + /// Use free function to release the pixel buffer. + /// + Free, + + /// + /// Use delete[] operator to release the pixel buffer. + /// + DeleteArray + } + /// /// Gets the width of the buffer in pixels. /// @@ -143,23 +120,46 @@ namespace Tizen.NUI return ret; } + internal static global::System.Runtime.InteropServices.HandleRef getCPtr(PixelData obj) + { + return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; + } + /// - /// Enumeration for function to release the pixel buffer. + /// Dispose. /// /// 5 - /// This will be released at Tizen.NET API Level 5, so currently this would be used as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - public enum ReleaseFunction + protected override void Dispose(DisposeTypes type) { - /// - /// Use free function to release the pixel buffer. - /// - Free, + if (disposed) + { + return; + } - /// - /// Use delete[] operator to release the pixel buffer. - /// - DeleteArray + if (type == DisposeTypes.Explicit) + { + //Called by User. + //Release your own managed resources here. + //You should release all of your own disposable objects here. + + } + + //Release your own unmanaged resources here. + //You should not access any managed member here except static instance. + //Because the execution order of Finalizes is non-deterministic. + + + if (swigCPtr.Handle != global::System.IntPtr.Zero) + { + if (swigCMemOwn) + { + swigCMemOwn = false; + NDalicPINVOKE.delete_PixelData(swigCPtr); + } + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); + } + + base.Dispose(type); } } } \ No newline at end of file diff --git a/src/Tizen.NUI/src/public/Position.cs b/src/Tizen.NUI/src/public/Position.cs index 28d80f5..acd93a7 100755 --- a/src/Tizen.NUI/src/public/Position.cs +++ b/src/Tizen.NUI/src/public/Position.cs @@ -29,31 +29,58 @@ namespace Tizen.NUI [Tizen.NUI.Binding.TypeConverter(typeof(PositionTypeConverter))] public class Position : global::System.IDisposable { - private global::System.Runtime.InteropServices.HandleRef swigCPtr; /// /// swigCMemOwn /// /// 3 protected bool swigCMemOwn; + /// + /// A Flat to check if it is already disposed. + /// + /// 3 + protected bool disposed = false; - internal Position(global::System.IntPtr cPtr, bool cMemoryOwn) + private global::System.Runtime.InteropServices.HandleRef swigCPtr; + //A Flag to check who called Dispose(). (By User or DisposeQueue) + private bool isDisposeQueued = false; + + /// + /// The constructor. + /// + /// 3 + public Position() : this(NDalicPINVOKE.new_Vector3__SWIG_0(), true) { - swigCMemOwn = cMemoryOwn; - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } - internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Position obj) + /// + /// The constructor. + /// + /// The x component. + /// The y component. + /// The z component. + /// 3 + public Position(float x, float y, float z) : this(NDalicPINVOKE.new_Vector3__SWIG_1(x, y, z), true) { - return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } - //A Flag to check who called Dispose(). (By User or DisposeQueue) - private bool isDisposeQueued = false; /// - /// A Flat to check if it is already disposed. + /// The constructor. /// + /// Position2D to create this vector from. /// 3 - protected bool disposed = false; + public Position(Position2D position2d) : this(NDalicPINVOKE.new_Vector3__SWIG_3(Position2D.getCPtr(position2d)), true) + { + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + internal Position(global::System.IntPtr cPtr, bool cMemoryOwn) + { + swigCMemOwn = cMemoryOwn; + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); + } + /// /// Dispose. @@ -69,447 +96,319 @@ namespace Tizen.NUI } /// - /// Dispose. + /// ParentOrigin constants. It's 0.0. /// /// 3 - public void Dispose() + public static float ParentOriginTop { - //Throw excpetion if Dispose() is called in separate thread. - if (!Window.IsInstalled()) - { - throw new System.InvalidOperationException("This API called from separate thread. This API must be called from MainThread."); - } - - if (isDisposeQueued) - { - Dispose(DisposeTypes.Implicit); - } - else + get { - Dispose(DisposeTypes.Explicit); - System.GC.SuppressFinalize(this); + float ret = NDalicPINVOKE.ParentOriginTop_get(); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; } } /// - /// Dispose. + /// ParentOrigin constants. It's 1.0. /// /// 3 - protected virtual void Dispose(DisposeTypes type) + public static float ParentOriginBottom { - if (disposed) - { - return; - } - - if(type == DisposeTypes.Explicit) - { - //Called by User - //Release your own managed resources here. - //You should release all of your own disposable objects here. - } - - //Release your own unmanaged resources here. - //You should not access any managed member here except static instance. - //because the execution order of Finalizes is non-deterministic. - - if (swigCPtr.Handle != global::System.IntPtr.Zero) + get { - if (swigCMemOwn) - { - swigCMemOwn = false; - NDalicPINVOKE.delete_Vector3(swigCPtr); - } - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); + float ret = NDalicPINVOKE.ParentOriginBottom_get(); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; } - disposed = true; } - /// - /// An addition operator. + /// ParentOrigin constants. It's 0.0. /// - /// The vector to add. - /// The vector to add. - /// The vector containing the result of the addition. /// 3 - public static Position operator +(Position arg1, Position arg2) + public static float ParentOriginLeft { - return arg1.Add(arg2); + get + { + float ret = NDalicPINVOKE.ParentOriginLeft_get(); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } } /// - /// The subtraction operator. + /// ParentOrigin constants. It's 1.0. /// - /// The vector to subtract. - /// The vector to subtract. - /// The vector containing the result of the subtraction. /// 3 - public static Position operator -(Position arg1, Position arg2) + public static float ParentOriginRight { - return arg1.Subtract(arg2); + get + { + float ret = NDalicPINVOKE.ParentOriginRight_get(); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } } /// - /// The unary negation operator. + /// ParentOrigin constants. It's 0.5. /// - /// The vector to negate. - /// The vector containg the negation. /// 3 - public static Position operator -(Position arg1) + public static float ParentOriginMiddle { - return arg1.Subtract(); + get + { + float ret = NDalicPINVOKE.ParentOriginMiddle_get(); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } } /// - /// The multiplication operator. + /// ParentOrigin constants: 0.0, 0.0, 0.5. /// - /// The vector to multiply. - /// The vector to multiply. - /// The vector containing the result of the multiplication. /// 3 - public static Position operator *(Position arg1, Position arg2) + public static Position ParentOriginTopLeft { - return arg1.Multiply(arg2); + get + { + global::System.IntPtr cPtr = NDalicPINVOKE.ParentOriginTopLeft_get(); + Position ret = (cPtr == global::System.IntPtr.Zero) ? null : new Position(cPtr, false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } } /// - /// The multiplication operator. + /// ParentOrigin constants: 0.5, 0.0, 0.5. /// - /// The vector to multiply - /// The float value to scale the vector. - /// The vector containing the result of scaling. /// 3 - public static Position operator *(Position arg1, float arg2) + public static Position ParentOriginTopCenter { - return arg1.Multiply(arg2); + get + { + global::System.IntPtr cPtr = NDalicPINVOKE.ParentOriginTopCenter_get(); + Position ret = (cPtr == global::System.IntPtr.Zero) ? null : new Position(cPtr, false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } } /// - /// The division operator. + /// ParentOrigin constants: 1.0, 0.0, 0.5. /// - /// The vector to divide. - /// The vector to divide. - /// The vector containing the result of the division. /// 3 - public static Position operator /(Position arg1, Position arg2) + public static Position ParentOriginTopRight { - return arg1.Divide(arg2); + get + { + global::System.IntPtr cPtr = NDalicPINVOKE.ParentOriginTopRight_get(); + Position ret = (cPtr == global::System.IntPtr.Zero) ? null : new Position(cPtr, false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } } /// - /// The division operator. + /// ParentOrigin constants: 0.0, 0.5, 0.5. /// - /// The vector to divide. - /// The float value to scale the vector by. - /// The vector containing the result of scaling. /// 3 - public static Position operator /(Position arg1, float arg2) + public static Position ParentOriginCenterLeft { - return arg1.Divide(arg2); + get + { + global::System.IntPtr cPtr = NDalicPINVOKE.ParentOriginCenterLeft_get(); + Position ret = (cPtr == global::System.IntPtr.Zero) ? null : new Position(cPtr, false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } } - /// - /// The const array subscript operator overload. Should be 0, 1, or 2. + /// ParentOrigin constants: 0.0, 0.5, 0.5 /// - /// The subscript index. - /// The float at the given index. /// 3 - public float this[uint index] + public static Position ParentOriginCenter { get { - return ValueOfIndex(index); + global::System.IntPtr cPtr = NDalicPINVOKE.ParentOriginCenter_get(); + Position ret = (cPtr == global::System.IntPtr.Zero) ? null : new Position(cPtr, false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; } } - internal static Position GetPositionFromPtr(global::System.IntPtr cPtr) - { - Position ret = new Position(cPtr, false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - /// - /// The constructor. + /// ParentOrigin constants: 1.0, 0.5, 0.5. /// /// 3 - public Position() : this(NDalicPINVOKE.new_Vector3__SWIG_0(), true) + public static Position ParentOriginCenterRight { - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + get + { + global::System.IntPtr cPtr = NDalicPINVOKE.ParentOriginCenterRight_get(); + Position ret = (cPtr == global::System.IntPtr.Zero) ? null : new Position(cPtr, false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } } /// - /// The constructor. + /// ParentOrigin constants: 0.0f, 1.0f, 0.5f. /// - /// The x component. - /// The y component. - /// The z component. /// 3 - public Position(float x, float y, float z) : this(NDalicPINVOKE.new_Vector3__SWIG_1(x, y, z), true) + public static Position ParentOriginBottomLeft { - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + get + { + global::System.IntPtr cPtr = NDalicPINVOKE.ParentOriginBottomLeft_get(); + Position ret = (cPtr == global::System.IntPtr.Zero) ? null : new Position(cPtr, false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } } /// - /// The constructor. + /// ParentOrigin constants: 0.5, 1.0, 0.5. /// - /// Position2D to create this vector from. /// 3 - public Position(Position2D position2d) : this(NDalicPINVOKE.new_Vector3__SWIG_3(Position2D.getCPtr(position2d)), true) + public static Position ParentOriginBottomCenter { - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - - - private Position Add(Position rhs) - { - Position ret = new Position(NDalicPINVOKE.Vector3_Add(swigCPtr, Position.getCPtr(rhs)), true); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - private Position Subtract(Position rhs) - { - Position ret = new Position(NDalicPINVOKE.Vector3_Subtract__SWIG_0(swigCPtr, Position.getCPtr(rhs)), true); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - private Position Multiply(Position rhs) - { - Position ret = new Position(NDalicPINVOKE.Vector3_Multiply__SWIG_0(swigCPtr, Position.getCPtr(rhs)), true); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - private Position Multiply(float rhs) - { - Position ret = new Position(NDalicPINVOKE.Vector3_Multiply__SWIG_1(swigCPtr, rhs), true); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - private Position Divide(Position rhs) - { - Position ret = new Position(NDalicPINVOKE.Vector3_Divide__SWIG_0(swigCPtr, Position.getCPtr(rhs)), true); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - private Position Divide(float rhs) - { - Position ret = new Position(NDalicPINVOKE.Vector3_Divide__SWIG_1(swigCPtr, rhs), true); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - private Position Subtract() - { - Position ret = new Position(NDalicPINVOKE.Vector3_Subtract__SWIG_1(swigCPtr), true); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - private float ValueOfIndex(uint index) - { - float ret = NDalicPINVOKE.Vector3_ValueOfIndex__SWIG_0(swigCPtr, index); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - /// - /// Determines whether the specified object is equal to the current object. - /// - /// The object to compare with the current object. - /// true if the specified object is equal to the current object; otherwise, false. - public override bool Equals(System.Object obj) - { - Position position = obj as Position; - bool equal = false; - if (X == position?.X && Y == position?.Y && Z == position?.Z) + get { - equal = true; + global::System.IntPtr cPtr = NDalicPINVOKE.ParentOriginBottomCenter_get(); + Position ret = (cPtr == global::System.IntPtr.Zero) ? null : new Position(cPtr, false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; } - return equal; - } - - /// - /// Gets the the hash code of this Position. - /// - /// The Hash Code. - /// 5 - public override int GetHashCode() - { - return X.GetHashCode(); - } - - /// - /// Compares if rhs is equal to. - /// - /// The vector to compare. - /// Returns true if the two vectors are equal, otherwise false. - /// 3 - public bool EqualTo(Position rhs) - { - bool ret = NDalicPINVOKE.Vector3_EqualTo(swigCPtr, Position.getCPtr(rhs)); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - /// - /// Compares if rhs is not equal to. - /// - /// The vector to compare. - /// Returns true if the two vectors are not equal, otherwise false. - /// 3 - public bool NotEqualTo(Position rhs) - { - bool ret = NDalicPINVOKE.Vector3_NotEqualTo(swigCPtr, Position.getCPtr(rhs)); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; } - /// - /// The x component. + /// ParentOrigin constants: 1.0, 1.0, 0.5. /// /// 3 - public float X + public static Position ParentOriginBottomRight { - set - { - NDalicPINVOKE.Vector3_X_set(swigCPtr, value); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } get { - float ret = NDalicPINVOKE.Vector3_X_get(swigCPtr); + global::System.IntPtr cPtr = NDalicPINVOKE.ParentOriginBottomRight_get(); + Position ret = (cPtr == global::System.IntPtr.Zero) ? null : new Position(cPtr, false); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } } /// - /// The y component. + /// PivotPoint constants: 0.0. /// /// 3 - public float Y + public static float PivotPointTop { - set - { - NDalicPINVOKE.Vector3_Y_set(swigCPtr, value); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } get { - float ret = NDalicPINVOKE.Vector3_Y_get(swigCPtr); + float ret = NDalicPINVOKE.AnchorPointTop_get(); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } } /// - /// The z component. + /// PivotPoint constants: 1.0. /// /// 3 - public float Z + public static float PivotPointBottom { - set - { - NDalicPINVOKE.Vector3_Z_set(swigCPtr, value); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } get { - float ret = NDalicPINVOKE.Vector3_Z_get(swigCPtr); + float ret = NDalicPINVOKE.AnchorPointBottom_get(); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } } /// - /// ParentOrigin constants. It's 0.0. + /// PivotPoint constants: 0.0. /// /// 3 - public static float ParentOriginTop + public static float PivotPointLeft { get { - float ret = NDalicPINVOKE.ParentOriginTop_get(); + float ret = NDalicPINVOKE.AnchorPointLeft_get(); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } } /// - /// ParentOrigin constants. It's 1.0. + /// PivotPoint constants: 1.0. /// /// 3 - public static float ParentOriginBottom + public static float PivotPointRight { get { - float ret = NDalicPINVOKE.ParentOriginBottom_get(); + float ret = NDalicPINVOKE.AnchorPointRight_get(); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } } /// - /// ParentOrigin constants. It's 0.0. + /// PivotPoint constants: 0.0. /// /// 3 - public static float ParentOriginLeft + public static float PivotPointMiddle { get { - float ret = NDalicPINVOKE.ParentOriginLeft_get(); + float ret = NDalicPINVOKE.AnchorPointMiddle_get(); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } } /// - /// ParentOrigin constants. It's 1.0. + /// PivotPoint constants: 0.0, 0.0, 0.5. /// /// 3 - public static float ParentOriginRight + public static Position PivotPointTopLeft { get { - float ret = NDalicPINVOKE.ParentOriginRight_get(); + global::System.IntPtr cPtr = NDalicPINVOKE.AnchorPointTopLeft_get(); + Position ret = (cPtr == global::System.IntPtr.Zero) ? null : new Position(cPtr, false); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } } /// - /// ParentOrigin constants. It's 0.5. + /// PivotPoint constants: 0.5, 0.0, 0.5. /// /// 3 - public static float ParentOriginMiddle + public static Position PivotPointTopCenter { get { - float ret = NDalicPINVOKE.ParentOriginMiddle_get(); + global::System.IntPtr cPtr = NDalicPINVOKE.AnchorPointTopCenter_get(); + Position ret = (cPtr == global::System.IntPtr.Zero) ? null : new Position(cPtr, false); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } } /// - /// ParentOrigin constants: 0.0, 0.0, 0.5. + /// PivotPoint constants: 1.0, 0.0, 0.5. /// /// 3 - public static Position ParentOriginTopLeft + public static Position PivotPointTopRight { get { - global::System.IntPtr cPtr = NDalicPINVOKE.ParentOriginTopLeft_get(); + global::System.IntPtr cPtr = NDalicPINVOKE.AnchorPointTopRight_get(); Position ret = (cPtr == global::System.IntPtr.Zero) ? null : new Position(cPtr, false); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; @@ -517,14 +416,14 @@ namespace Tizen.NUI } /// - /// ParentOrigin constants: 0.5, 0.0, 0.5. + /// PivotPoint constants: 0.0, 0.5, 0.5. /// /// 3 - public static Position ParentOriginTopCenter + public static Position PivotPointCenterLeft { get { - global::System.IntPtr cPtr = NDalicPINVOKE.ParentOriginTopCenter_get(); + global::System.IntPtr cPtr = NDalicPINVOKE.AnchorPointCenterLeft_get(); Position ret = (cPtr == global::System.IntPtr.Zero) ? null : new Position(cPtr, false); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; @@ -532,14 +431,14 @@ namespace Tizen.NUI } /// - /// ParentOrigin constants: 1.0, 0.0, 0.5. + /// PivotPoint constants: 0.5, 0.5, 0.5. /// /// 3 - public static Position ParentOriginTopRight + public static Position PivotPointCenter { get { - global::System.IntPtr cPtr = NDalicPINVOKE.ParentOriginTopRight_get(); + global::System.IntPtr cPtr = NDalicPINVOKE.AnchorPointCenter_get(); Position ret = (cPtr == global::System.IntPtr.Zero) ? null : new Position(cPtr, false); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; @@ -547,14 +446,14 @@ namespace Tizen.NUI } /// - /// ParentOrigin constants: 0.0, 0.5, 0.5. + /// PivotPoint constants: 1.0, 0.5, 0.5. /// /// 3 - public static Position ParentOriginCenterLeft + public static Position PivotPointCenterRight { get { - global::System.IntPtr cPtr = NDalicPINVOKE.ParentOriginCenterLeft_get(); + global::System.IntPtr cPtr = NDalicPINVOKE.AnchorPointCenterRight_get(); Position ret = (cPtr == global::System.IntPtr.Zero) ? null : new Position(cPtr, false); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; @@ -562,14 +461,14 @@ namespace Tizen.NUI } /// - /// ParentOrigin constants: 0.0, 0.5, 0.5 + /// PivotPoint constants: 0.0, 1.0, 0.5. /// /// 3 - public static Position ParentOriginCenter + public static Position PivotPointBottomLeft { get { - global::System.IntPtr cPtr = NDalicPINVOKE.ParentOriginCenter_get(); + global::System.IntPtr cPtr = NDalicPINVOKE.AnchorPointBottomLeft_get(); Position ret = (cPtr == global::System.IntPtr.Zero) ? null : new Position(cPtr, false); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; @@ -577,14 +476,14 @@ namespace Tizen.NUI } /// - /// ParentOrigin constants: 1.0, 0.5, 0.5. + /// PivotPoint constants: 0.5, 1.0, 0.5 /// /// 3 - public static Position ParentOriginCenterRight + public static Position PivotPointBottomCenter { get { - global::System.IntPtr cPtr = NDalicPINVOKE.ParentOriginCenterRight_get(); + global::System.IntPtr cPtr = NDalicPINVOKE.AnchorPointBottomCenter_get(); Position ret = (cPtr == global::System.IntPtr.Zero) ? null : new Position(cPtr, false); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; @@ -592,14 +491,14 @@ namespace Tizen.NUI } /// - /// ParentOrigin constants: 0.0f, 1.0f, 0.5f. + /// PivotPoint constants: 1.0, 1.0, 0.5. /// /// 3 - public static Position ParentOriginBottomLeft + public static Position PivotPointBottomRight { get { - global::System.IntPtr cPtr = NDalicPINVOKE.ParentOriginBottomLeft_get(); + global::System.IntPtr cPtr = NDalicPINVOKE.AnchorPointBottomRight_get(); Position ret = (cPtr == global::System.IntPtr.Zero) ? null : new Position(cPtr, false); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; @@ -607,14 +506,14 @@ namespace Tizen.NUI } /// - /// ParentOrigin constants: 0.5, 1.0, 0.5. + /// Constant ( 1.0f, 1.0f, 1.0f ). /// /// 3 - public static Position ParentOriginBottomCenter + public static Position One { get { - global::System.IntPtr cPtr = NDalicPINVOKE.ParentOriginBottomCenter_get(); + global::System.IntPtr cPtr = NDalicPINVOKE.Vector3_ONE_get(); Position ret = (cPtr == global::System.IntPtr.Zero) ? null : new Position(cPtr, false); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; @@ -622,14 +521,14 @@ namespace Tizen.NUI } /// - /// ParentOrigin constants: 1.0, 1.0, 0.5. + /// Constant ( 0.0f, 0.0f, 0.0f ). /// /// 3 - public static Position ParentOriginBottomRight + public static Position Zero { get { - global::System.IntPtr cPtr = NDalicPINVOKE.ParentOriginBottomRight_get(); + global::System.IntPtr cPtr = NDalicPINVOKE.Vector3_ZERO_get(); Position ret = (cPtr == global::System.IntPtr.Zero) ? null : new Position(cPtr, false); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; @@ -637,129 +536,122 @@ namespace Tizen.NUI } /// - /// PivotPoint constants: 0.0. + /// The x component. /// /// 3 - public static float PivotPointTop + public float X { + set + { + NDalicPINVOKE.Vector3_X_set(swigCPtr, value); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } get { - float ret = NDalicPINVOKE.AnchorPointTop_get(); + float ret = NDalicPINVOKE.Vector3_X_get(swigCPtr); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } } /// - /// PivotPoint constants: 1.0. + /// The y component. /// /// 3 - public static float PivotPointBottom + public float Y { + set + { + NDalicPINVOKE.Vector3_Y_set(swigCPtr, value); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } get { - float ret = NDalicPINVOKE.AnchorPointBottom_get(); + float ret = NDalicPINVOKE.Vector3_Y_get(swigCPtr); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } } /// - /// PivotPoint constants: 0.0. + /// The z component. /// /// 3 - public static float PivotPointLeft + public float Z { + set + { + NDalicPINVOKE.Vector3_Z_set(swigCPtr, value); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } get { - float ret = NDalicPINVOKE.AnchorPointLeft_get(); + float ret = NDalicPINVOKE.Vector3_Z_get(swigCPtr); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } } - /// - /// PivotPoint constants: 1.0. - /// - /// 3 - public static float PivotPointRight + internal static Position XAxis { get { - float ret = NDalicPINVOKE.AnchorPointRight_get(); + global::System.IntPtr cPtr = NDalicPINVOKE.Vector3_XAXIS_get(); + Position ret = (cPtr == global::System.IntPtr.Zero) ? null : new Position(cPtr, false); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } } - /// - /// PivotPoint constants: 0.0. - /// - /// 3 - public static float PivotPointMiddle + internal static Position YAxis { get { - float ret = NDalicPINVOKE.AnchorPointMiddle_get(); + global::System.IntPtr cPtr = NDalicPINVOKE.Vector3_YAXIS_get(); + Position ret = (cPtr == global::System.IntPtr.Zero) ? null : new Position(cPtr, false); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } } - /// - /// PivotPoint constants: 0.0, 0.0, 0.5. - /// - /// 3 - public static Position PivotPointTopLeft + internal static Position ZAxis { get { - global::System.IntPtr cPtr = NDalicPINVOKE.AnchorPointTopLeft_get(); + global::System.IntPtr cPtr = NDalicPINVOKE.Vector3_ZAXIS_get(); Position ret = (cPtr == global::System.IntPtr.Zero) ? null : new Position(cPtr, false); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } } - /// - /// PivotPoint constants: 0.5, 0.0, 0.5. - /// - /// 3 - public static Position PivotPointTopCenter + internal static Position NegativeXAxis { get { - global::System.IntPtr cPtr = NDalicPINVOKE.AnchorPointTopCenter_get(); + global::System.IntPtr cPtr = NDalicPINVOKE.Vector3_NEGATIVE_XAXIS_get(); Position ret = (cPtr == global::System.IntPtr.Zero) ? null : new Position(cPtr, false); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } } - /// - /// PivotPoint constants: 1.0, 0.0, 0.5. - /// - /// 3 - public static Position PivotPointTopRight + internal static Position NegativeYAxis { get { - global::System.IntPtr cPtr = NDalicPINVOKE.AnchorPointTopRight_get(); + global::System.IntPtr cPtr = NDalicPINVOKE.Vector3_NEGATIVE_YAXIS_get(); Position ret = (cPtr == global::System.IntPtr.Zero) ? null : new Position(cPtr, false); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } } - /// - /// PivotPoint constants: 0.0, 0.5, 0.5. - /// - /// 3 - public static Position PivotPointCenterLeft + internal static Position NegativeZAxis { get { - global::System.IntPtr cPtr = NDalicPINVOKE.AnchorPointCenterLeft_get(); + global::System.IntPtr cPtr = NDalicPINVOKE.Vector3_NEGATIVE_ZAXIS_get(); Position ret = (cPtr == global::System.IntPtr.Zero) ? null : new Position(cPtr, false); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; @@ -767,192 +659,297 @@ namespace Tizen.NUI } /// - /// PivotPoint constants: 0.5, 0.5, 0.5. + /// The const array subscript operator overload. Should be 0, 1, or 2. /// + /// The subscript index. + /// The float at the given index. /// 3 - public static Position PivotPointCenter + public float this[uint index] { get { - global::System.IntPtr cPtr = NDalicPINVOKE.AnchorPointCenter_get(); - Position ret = (cPtr == global::System.IntPtr.Zero) ? null : new Position(cPtr, false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; + return ValueOfIndex(index); } } + /// - /// PivotPoint constants: 1.0, 0.5, 0.5. + /// An addition operator. /// + /// The vector to add. + /// The vector to add. + /// The vector containing the result of the addition. /// 3 - public static Position PivotPointCenterRight + public static Position operator +(Position arg1, Position arg2) { - get - { - global::System.IntPtr cPtr = NDalicPINVOKE.AnchorPointCenterRight_get(); - Position ret = (cPtr == global::System.IntPtr.Zero) ? null : new Position(cPtr, false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } + return arg1.Add(arg2); } /// - /// PivotPoint constants: 0.0, 1.0, 0.5. + /// The subtraction operator. /// + /// The vector to subtract. + /// The vector to subtract. + /// The vector containing the result of the subtraction. /// 3 - public static Position PivotPointBottomLeft + public static Position operator -(Position arg1, Position arg2) { - get - { - global::System.IntPtr cPtr = NDalicPINVOKE.AnchorPointBottomLeft_get(); - Position ret = (cPtr == global::System.IntPtr.Zero) ? null : new Position(cPtr, false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } + return arg1.Subtract(arg2); } /// - /// PivotPoint constants: 0.5, 1.0, 0.5 + /// The unary negation operator. /// + /// The vector to negate. + /// The vector containg the negation. /// 3 - public static Position PivotPointBottomCenter + public static Position operator -(Position arg1) { - get - { - global::System.IntPtr cPtr = NDalicPINVOKE.AnchorPointBottomCenter_get(); - Position ret = (cPtr == global::System.IntPtr.Zero) ? null : new Position(cPtr, false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } + return arg1.Subtract(); } /// - /// PivotPoint constants: 1.0, 1.0, 0.5. + /// The multiplication operator. /// + /// The vector to multiply. + /// The vector to multiply. + /// The vector containing the result of the multiplication. /// 3 - public static Position PivotPointBottomRight + public static Position operator *(Position arg1, Position arg2) { - get - { - global::System.IntPtr cPtr = NDalicPINVOKE.AnchorPointBottomRight_get(); - Position ret = (cPtr == global::System.IntPtr.Zero) ? null : new Position(cPtr, false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } + return arg1.Multiply(arg2); } /// - /// Constant ( 1.0f, 1.0f, 1.0f ). + /// The multiplication operator. /// + /// The vector to multiply + /// The float value to scale the vector. + /// The vector containing the result of scaling. /// 3 - public static Position One + public static Position operator *(Position arg1, float arg2) { - get - { - global::System.IntPtr cPtr = NDalicPINVOKE.Vector3_ONE_get(); - Position ret = (cPtr == global::System.IntPtr.Zero) ? null : new Position(cPtr, false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } + return arg1.Multiply(arg2); } - internal static Position XAxis + /// + /// The division operator. + /// + /// The vector to divide. + /// The vector to divide. + /// The vector containing the result of the division. + /// 3 + public static Position operator /(Position arg1, Position arg2) { - get - { - global::System.IntPtr cPtr = NDalicPINVOKE.Vector3_XAXIS_get(); - Position ret = (cPtr == global::System.IntPtr.Zero) ? null : new Position(cPtr, false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } + return arg1.Divide(arg2); } - internal static Position YAxis + /// + /// The division operator. + /// + /// The vector to divide. + /// The float value to scale the vector by. + /// The vector containing the result of scaling. + /// 3 + public static Position operator /(Position arg1, float arg2) { - get - { - global::System.IntPtr cPtr = NDalicPINVOKE.Vector3_YAXIS_get(); - Position ret = (cPtr == global::System.IntPtr.Zero) ? null : new Position(cPtr, false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } + return arg1.Divide(arg2); } - internal static Position ZAxis + /// + /// Converts a position instance to a Vector3 instance. + /// + /// 3 + public static implicit operator Vector3(Position Position) { - get - { - global::System.IntPtr cPtr = NDalicPINVOKE.Vector3_ZAXIS_get(); - Position ret = (cPtr == global::System.IntPtr.Zero) ? null : new Position(cPtr, false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } + return new Vector3(Position.X, Position.Y, Position.Z); } - internal static Position NegativeXAxis + /// + /// Converts a Vector3 instance to a position instance. + /// + /// 3 + public static implicit operator Position(Vector3 vec) { - get - { - global::System.IntPtr cPtr = NDalicPINVOKE.Vector3_NEGATIVE_XAXIS_get(); - Position ret = (cPtr == global::System.IntPtr.Zero) ? null : new Position(cPtr, false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } + return new Position(vec.X, vec.Y, vec.Z); } - internal static Position NegativeYAxis + /// + /// Determines whether the specified object is equal to the current object. + /// + /// The object to compare with the current object. + /// true if the specified object is equal to the current object; otherwise, false. + public override bool Equals(System.Object obj) { - get + Position position = obj as Position; + bool equal = false; + if (X == position?.X && Y == position?.Y && Z == position?.Z) { - global::System.IntPtr cPtr = NDalicPINVOKE.Vector3_NEGATIVE_YAXIS_get(); - Position ret = (cPtr == global::System.IntPtr.Zero) ? null : new Position(cPtr, false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; + equal = true; } + return equal; } - internal static Position NegativeZAxis + /// + /// Gets the the hash code of this Position. + /// + /// The Hash Code. + /// 5 + public override int GetHashCode() { - get - { - global::System.IntPtr cPtr = NDalicPINVOKE.Vector3_NEGATIVE_ZAXIS_get(); - Position ret = (cPtr == global::System.IntPtr.Zero) ? null : new Position(cPtr, false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } + return X.GetHashCode(); } /// - /// Constant ( 0.0f, 0.0f, 0.0f ). + /// Dispose. /// /// 3 - public static Position Zero + public void Dispose() { - get + //Throw excpetion if Dispose() is called in separate thread. + if (!Window.IsInstalled()) { - global::System.IntPtr cPtr = NDalicPINVOKE.Vector3_ZERO_get(); - Position ret = (cPtr == global::System.IntPtr.Zero) ? null : new Position(cPtr, false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; + throw new System.InvalidOperationException("This API called from separate thread. This API must be called from MainThread."); + } + + if (isDisposeQueued) + { + Dispose(DisposeTypes.Implicit); + } + else + { + Dispose(DisposeTypes.Explicit); + System.GC.SuppressFinalize(this); } } /// - /// Converts a position instance to a Vector3 instance. + /// Compares if rhs is equal to. /// + /// The vector to compare. + /// Returns true if the two vectors are equal, otherwise false. /// 3 - public static implicit operator Vector3(Position Position) + public bool EqualTo(Position rhs) { - return new Vector3(Position.X, Position.Y, Position.Z); + bool ret = NDalicPINVOKE.Vector3_EqualTo(swigCPtr, Position.getCPtr(rhs)); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; } /// - /// Converts a Vector3 instance to a position instance. + /// Compares if rhs is not equal to. /// + /// The vector to compare. + /// Returns true if the two vectors are not equal, otherwise false. /// 3 - public static implicit operator Position(Vector3 vec) + public bool NotEqualTo(Position rhs) { - return new Position(vec.X, vec.Y, vec.Z); + bool ret = NDalicPINVOKE.Vector3_NotEqualTo(swigCPtr, Position.getCPtr(rhs)); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Position obj) + { + return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; + } + + internal static Position GetPositionFromPtr(global::System.IntPtr cPtr) + { + Position ret = new Position(cPtr, false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + /// + /// Dispose. + /// + /// 3 + protected virtual void Dispose(DisposeTypes type) + { + if (disposed) + { + return; + } + + if (type == DisposeTypes.Explicit) + { + //Called by User + //Release your own managed resources here. + //You should release all of your own disposable objects here. + } + + //Release your own unmanaged resources here. + //You should not access any managed member here except static instance. + //because the execution order of Finalizes is non-deterministic. + + if (swigCPtr.Handle != global::System.IntPtr.Zero) + { + if (swigCMemOwn) + { + swigCMemOwn = false; + NDalicPINVOKE.delete_Vector3(swigCPtr); + } + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); + } + disposed = true; + } + + + private Position Add(Position rhs) + { + Position ret = new Position(NDalicPINVOKE.Vector3_Add(swigCPtr, Position.getCPtr(rhs)), true); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + private Position Subtract(Position rhs) + { + Position ret = new Position(NDalicPINVOKE.Vector3_Subtract__SWIG_0(swigCPtr, Position.getCPtr(rhs)), true); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + private Position Multiply(Position rhs) + { + Position ret = new Position(NDalicPINVOKE.Vector3_Multiply__SWIG_0(swigCPtr, Position.getCPtr(rhs)), true); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + private Position Multiply(float rhs) + { + Position ret = new Position(NDalicPINVOKE.Vector3_Multiply__SWIG_1(swigCPtr, rhs), true); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + private Position Divide(Position rhs) + { + Position ret = new Position(NDalicPINVOKE.Vector3_Divide__SWIG_0(swigCPtr, Position.getCPtr(rhs)), true); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + private Position Divide(float rhs) + { + Position ret = new Position(NDalicPINVOKE.Vector3_Divide__SWIG_1(swigCPtr, rhs), true); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + private Position Subtract() + { + Position ret = new Position(NDalicPINVOKE.Vector3_Subtract__SWIG_1(swigCPtr), true); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + private float ValueOfIndex(uint index) + { + float ret = NDalicPINVOKE.Vector3_ValueOfIndex__SWIG_0(swigCPtr, index); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; } } diff --git a/src/Tizen.NUI/src/public/Position2D.cs b/src/Tizen.NUI/src/public/Position2D.cs index bfd7b3e..e45b84a 100755 --- a/src/Tizen.NUI/src/public/Position2D.cs +++ b/src/Tizen.NUI/src/public/Position2D.cs @@ -29,38 +29,51 @@ namespace Tizen.NUI public class Position2D : global::System.IDisposable { /// - /// Convert a string to Position2D. + /// swigCMemOwn /// - /// The string to convert. - /// The converted value. - static public Position2D ConvertFromString(System.String value) - { - if (value != null) - { - string[] parts = value.Split(','); - if (parts.Length == 2) - { - return new Position2D(int.Parse(parts[0].Trim(), CultureInfo.InvariantCulture), int.Parse(parts[1].Trim(), CultureInfo.InvariantCulture)); - } - } + /// 3 + protected bool swigCMemOwn; + /// + /// A Flat to check if it is already disposed. + /// + /// 3 + protected bool disposed = false; - throw new InvalidOperationException($"Cannot convert \"{value}\" into {typeof(Position2D)}"); + private global::System.Runtime.InteropServices.HandleRef swigCPtr; + //A Flag to check who called Dispose(). (By User or DisposeQueue) + private bool isDisposeQueued = false; + + private Position2DChangedCallback callback = null; + + /// + /// The constructor. + /// + /// 3 + public Position2D() : this(NDalicPINVOKE.new_Vector2__SWIG_0(), true) + { + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } /// - /// Constructor a Position2D from a stirng. + /// The constructor. /// - public static implicit operator Position2D(System.String value) + /// Position to create this vector from + /// 3 + public Position2D(Position position) : this(NDalicPINVOKE.new_Vector2__SWIG_3(Position.getCPtr(position)), true) { - return ConvertFromString(value); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } - private global::System.Runtime.InteropServices.HandleRef swigCPtr; /// - /// swigCMemOwn + /// The constructor. /// + /// x component + /// y component /// 3 - protected bool swigCMemOwn; + public Position2D(int x, int y) : this(NDalicPINVOKE.new_Vector2__SWIG_1((float)x, (float)y), true) + { + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } internal Position2D(global::System.IntPtr cPtr, bool cMemoryOwn) { @@ -68,19 +81,12 @@ namespace Tizen.NUI swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); } - internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Position2D obj) + internal Position2D(Position2DChangedCallback cb, int x, int y) : this(NDalicPINVOKE.new_Vector2__SWIG_1((float)x, (float)y), true) { - return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; + callback = cb; + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } - //A Flag to check who called Dispose(). (By User or DisposeQueue) - private bool isDisposeQueued = false; - /// - /// A Flat to check if it is already disposed. - /// - /// 3 - protected bool disposed = false; - /// /// Dispose. /// @@ -94,62 +100,112 @@ namespace Tizen.NUI } } + internal delegate void Position2DChangedCallback(int x, int y); + /// - /// Dispose. + /// The x component. /// /// 3 - public void Dispose() + public int X { - //Throw excpetion if Dispose() is called in separate thread. - if (!Window.IsInstalled()) + set { - throw new System.InvalidOperationException("This API called from separate thread. This API must be called from MainThread."); + NDalicPINVOKE.Vector2_X_set(swigCPtr, (float)value); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + + callback?.Invoke(X, Y); } + get + { + float ret = NDalicPINVOKE.Vector2_X_get(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return (int)ret; + } + } - if (isDisposeQueued) + /// + /// The y component. + /// + /// 3 + public int Y + { + set { - Dispose(DisposeTypes.Implicit); + NDalicPINVOKE.Vector2_Y_set(swigCPtr, (float)value); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + + callback?.Invoke(X, Y); } - else + get { - Dispose(DisposeTypes.Explicit); - System.GC.SuppressFinalize(this); + float ret = NDalicPINVOKE.Vector2_Y_get(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return (int)ret; } } /// - /// Dispose. + /// The const array subscript operator overload. Should be 0, or 1. /// - /// The dispose type. + /// The subscript index. + /// The float at the given index. /// 3 - protected virtual void Dispose(DisposeTypes type) + public float this[uint index] { - if (disposed) + get { - return; + return ValueOfIndex(index); } + } - if (type == DisposeTypes.Explicit) + /// + /// Convert a string to Position2D. + /// + /// The string to convert. + /// The converted value. + static public Position2D ConvertFromString(System.String value) + { + if (value != null) { - //Called by User - //Release your own managed resources here. - //You should release all of your own disposable objects here. + string[] parts = value.Split(','); + if (parts.Length == 2) + { + return new Position2D(int.Parse(parts[0].Trim()), int.Parse(parts[1].Trim())); + } } - //Release your own unmanaged resources here. - //You should not access any managed member here except static instance. - //because the execution order of Finalizes is non-deterministic. + throw new InvalidOperationException($"Cannot convert \"{value}\" into {typeof(Position2D)}"); + } - if (swigCPtr.Handle != global::System.IntPtr.Zero) + /// + /// Constructor a Position2D from a stirng. + /// + public static implicit operator Position2D(System.String value) + { + return ConvertFromString(value); + } + + /// + /// Dispose. + /// + /// 3 + public void Dispose() + { + //Throw excpetion if Dispose() is called in separate thread. + if (!Window.IsInstalled()) { - if (swigCMemOwn) - { - swigCMemOwn = false; - NDalicPINVOKE.delete_Vector2(swigCPtr); - } - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); + throw new System.InvalidOperationException("This API called from separate thread. This API must be called from MainThread."); + } + + if (isDisposeQueued) + { + Dispose(DisposeTypes.Implicit); + } + else + { + Dispose(DisposeTypes.Explicit); + System.GC.SuppressFinalize(this); } - disposed = true; } /// @@ -236,62 +292,124 @@ namespace Tizen.NUI } /// - /// The const array subscript operator overload. Should be 0, or 1. + /// Determines whether the specified object is equal to the current object. /// - /// The subscript index. - /// The float at the given index. - /// 3 - public float this[uint index] + /// The object to compare with the current object. + /// true if the specified object is equal to the current object; otherwise, false. + public override bool Equals(System.Object obj) { - get + Position2D position2D = obj as Position2D; + bool equal = false; + if (X == position2D?.X && Y == position2D?.Y) { - return ValueOfIndex(index); + equal = true; } + return equal; } - internal static Position2D GetPosition2DFromPtr(global::System.IntPtr cPtr) + /// + /// Gets the the hash code of this Position2D. + /// + /// The Hash Code. + /// 5 + public override int GetHashCode() { - Position2D ret = new Position2D(cPtr, false); + return X.GetHashCode(); + } + + /// + /// Compares if the rhs is equal to. + /// + /// The vector to compare + /// Returns true if the two vectors are equal, otherwise false + /// 3 + public bool EqualTo(Position2D rhs) + { + bool ret = NDalicPINVOKE.Vector2_EqualTo(swigCPtr, Position2D.getCPtr(rhs)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } /// - /// The constructor. + /// Compares if the rhs is not equal to. /// + /// The vector to compare. + /// Returns true if the two vectors are not equal, otherwise false. /// 3 - public Position2D() : this(NDalicPINVOKE.new_Vector2__SWIG_0(), true) + public bool NotEqualTo(Position2D rhs) { + bool ret = NDalicPINVOKE.Vector2_NotEqualTo(swigCPtr, Position2D.getCPtr(rhs)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; } /// - /// The constructor. + /// Converts a Position2D instance to a Vector2 instance. /// - /// x component - /// y component + /// An object of the Position2D type. + /// return an object of the Vector2 type /// 3 - public Position2D(int x, int y) : this(NDalicPINVOKE.new_Vector2__SWIG_1((float)x, (float)y), true) + public static implicit operator Vector2(Position2D position2d) { - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return new Vector2((float)position2d.X, (float)position2d.Y); } - internal delegate void Position2DChangedCallback(int x, int y); - private Position2DChangedCallback callback = null; - internal Position2D(Position2DChangedCallback cb, int x, int y) : this(NDalicPINVOKE.new_Vector2__SWIG_1((float)x, (float)y), true) + /// + /// Converts a Vector2 instance to a Position2D instance. + /// + /// An object of the Vector2 type. + /// return an object of the Position2D type + /// 3 + public static implicit operator Position2D(Vector2 vec) { - callback = cb; + return new Position2D((int)vec.X, (int)vec.Y); + } + + internal static Position2D GetPosition2DFromPtr(global::System.IntPtr cPtr) + { + Position2D ret = new Position2D(cPtr, false); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Position2D obj) + { + return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; } /// - /// The constructor. + /// Dispose. /// - /// Position to create this vector from + /// The dispose type. /// 3 - public Position2D(Position position) : this(NDalicPINVOKE.new_Vector2__SWIG_3(Position.getCPtr(position)), true) + protected virtual void Dispose(DisposeTypes type) { - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + if (disposed) + { + return; + } + + if (type == DisposeTypes.Explicit) + { + //Called by User + //Release your own managed resources here. + //You should release all of your own disposable objects here. + } + + //Release your own unmanaged resources here. + //You should not access any managed member here except static instance. + //because the execution order of Finalizes is non-deterministic. + + if (swigCPtr.Handle != global::System.IntPtr.Zero) + { + if (swigCMemOwn) + { + swigCMemOwn = false; + NDalicPINVOKE.delete_Vector2(swigCPtr); + } + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); + } + disposed = true; } private Position2D Add(Position2D rhs) @@ -345,58 +463,6 @@ namespace Tizen.NUI return ret; } - /// - /// Determines whether the specified object is equal to the current object. - /// - /// The object to compare with the current object. - /// true if the specified object is equal to the current object; otherwise, false. - public override bool Equals(System.Object obj) - { - Position2D position2D = obj as Position2D; - bool equal = false; - if (X == position2D?.X && Y == position2D?.Y) - { - equal = true; - } - return equal; - } - - /// - /// Gets the the hash code of this Position2D. - /// - /// The Hash Code. - /// 5 - public override int GetHashCode() - { - return X.GetHashCode(); - } - - /// - /// Compares if the rhs is equal to. - /// - /// The vector to compare - /// Returns true if the two vectors are equal, otherwise false - /// 3 - public bool EqualTo(Position2D rhs) - { - bool ret = NDalicPINVOKE.Vector2_EqualTo(swigCPtr, Position2D.getCPtr(rhs)); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - /// - /// Compares if the rhs is not equal to. - /// - /// The vector to compare. - /// Returns true if the two vectors are not equal, otherwise false. - /// 3 - public bool NotEqualTo(Position2D rhs) - { - bool ret = NDalicPINVOKE.Vector2_NotEqualTo(swigCPtr, Position2D.getCPtr(rhs)); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - private int ValueOfIndex(uint index) { int ret = (int)NDalicPINVOKE.Vector2_ValueOfIndex__SWIG_0(swigCPtr, index); @@ -404,70 +470,6 @@ namespace Tizen.NUI return ret; } - /// - /// The x component. - /// - /// 3 - public int X - { - set - { - NDalicPINVOKE.Vector2_X_set(swigCPtr, (float)value); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - - callback?.Invoke(X, Y); - } - get - { - float ret = NDalicPINVOKE.Vector2_X_get(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return (int)ret; - } - } - - /// - /// The y component. - /// - /// 3 - public int Y - { - set - { - NDalicPINVOKE.Vector2_Y_set(swigCPtr, (float)value); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - - callback?.Invoke(X, Y); - } - get - { - float ret = NDalicPINVOKE.Vector2_Y_get(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return (int)ret; - } - } - - /// - /// Converts a Position2D instance to a Vector2 instance. - /// - /// An object of the Position2D type. - /// return an object of the Vector2 type - /// 3 - public static implicit operator Vector2(Position2D position2d) - { - return new Vector2((float)position2d.X, (float)position2d.Y); - } - - /// - /// Converts a Vector2 instance to a Position2D instance. - /// - /// An object of the Vector2 type. - /// return an object of the Position2D type - /// 3 - public static implicit operator Position2D(Vector2 vec) - { - return new Position2D((int)vec.X, (int)vec.Y); - } - } } diff --git a/src/Tizen.NUI/src/public/Property.cs b/src/Tizen.NUI/src/public/Property.cs index dd9c2de..69cb8cb 100755 --- a/src/Tizen.NUI/src/public/Property.cs +++ b/src/Tizen.NUI/src/public/Property.cs @@ -22,259 +22,48 @@ using Tizen.NUI.Binding; namespace Tizen.NUI { - - internal class Property : global::System.IDisposable + /// + /// An array of property values. + /// + /// 3 + public class PropertyArray : global::System.IDisposable { - private global::System.Runtime.InteropServices.HandleRef swigCPtr; /// /// swigCMemOwn /// /// 3 protected bool swigCMemOwn; - - internal Property(global::System.IntPtr cPtr, bool cMemoryOwn) - { - swigCMemOwn = cMemoryOwn; - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); - } - - internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Property obj) - { - return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; - } - - //A Flag to check who called Dispose(). (By User or DisposeQueue) - private bool isDisposeQueued = false; /// - /// 3 /// A Flat to check if it is already disposed. /// + /// 3 protected bool disposed = false; - ~Property() - { - if(!isDisposeQueued) - { - isDisposeQueued = true; - DisposeQueue.Instance.Add(this); - } - } - - public void Dispose() - { - //Throw excpetion if Dispose() is called in separate thread. - if (!Window.IsInstalled()) - { - throw new System.InvalidOperationException("This API called from separate thread. This API must be called from MainThread."); - } - - if (isDisposeQueued) - { - Dispose(DisposeTypes.Implicit); - } - else - { - Dispose(DisposeTypes.Explicit); - System.GC.SuppressFinalize(this); - } - } - - protected virtual void Dispose(DisposeTypes type) - { - if (disposed) - { - return; - } - - if(type == DisposeTypes.Explicit) - { - //Called by User - //Release your own managed resources here. - //You should release all of your own disposable objects here. - } - - //Release your own unmanaged resources here. - //You should not access any managed member here except static instance. - //because the execution order of Finalizes is non-deterministic. - - if (swigCPtr.Handle != global::System.IntPtr.Zero) - { - if (swigCMemOwn) - { - swigCMemOwn = false; - NDalicPINVOKE.delete_Property(swigCPtr); - } - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); - } - disposed = true; - } - - - internal static int INVALID_INDEX - { - get - { - int ret = NDalicPINVOKE.Property_INVALID_INDEX_get(); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - } - - internal static int INVALID_KEY - { - get - { - int ret = NDalicPINVOKE.Property_INVALID_KEY_get(); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - } - - internal static int INVALID_COMPONENT_INDEX - { - get - { - int ret = NDalicPINVOKE.Property_INVALID_COMPONENT_INDEX_get(); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - } - - /// - /// This constructor creates a property instance. - /// - /// A valid handle to the target object. - /// The index of a property. - /// 3 - public Property(Animatable arg0, int propertyIndex) : this(NDalicPINVOKE.new_Property__SWIG_0(Animatable.getCPtr(arg0), propertyIndex), true) - { - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } + private global::System.Runtime.InteropServices.HandleRef swigCPtr; - /// - /// This constructor creates a property instance. - /// - /// A valid handle to the target object. - /// The index of a property. - /// Index to a sub component of a property, for use with Vector2, Vector3 and Vector4. -1 for the main property (default is -1). - /// 3 - public Property(Animatable arg0, int propertyIndex, int componentIndex) : this(NDalicPINVOKE.new_Property__SWIG_1(Animatable.getCPtr(arg0), propertyIndex, componentIndex), true) - { - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } + //A Flag to check who called Dispose(). (By User or DisposeQueue) + private bool isDisposeQueued = false; /// - /// This constructor creates a property instance.
- /// This performs a property index query and is therefore slower than constructing a property directly with the index.
+ /// The constructor. ///
- /// A valid handle to the target object. - /// The property name. /// 3 - public Property(Animatable arg0, string propertyName) : this(NDalicPINVOKE.new_Property__SWIG_2(Animatable.getCPtr(arg0), propertyName), true) + public PropertyArray() : this(NDalicPINVOKE.new_Property_Array__SWIG_0(), true) { if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } - /// - /// This constructor creates a property instance.
- /// This performs a property index query and is therefore slower than constructing a property directly with the index.
- ///
- /// A valid handle to the target object. - /// The property name. - /// Index to a sub component of a property, for use with Vector2, Vector3 and Vector4. -1 for main property (default is -1). - /// 3 - public Property(Animatable arg0, string propertyName, int componentIndex) : this(NDalicPINVOKE.new_Property__SWIG_3(Animatable.getCPtr(arg0), propertyName, componentIndex), true) + internal PropertyArray(PropertyArray other) : this(NDalicPINVOKE.new_Property_Array__SWIG_1(PropertyArray.getCPtr(other)), true) { if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } - internal Animatable _object - { - set - { - NDalicPINVOKE.Property__object_set(swigCPtr, Animatable.getCPtr(value)); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - get - { - Animatable ret = new Animatable(NDalicPINVOKE.Property__object_get(swigCPtr), false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - } - - /// - /// Gets or sets the index of the property. - /// - /// 3 - public int propertyIndex - { - set - { - NDalicPINVOKE.Property_propertyIndex_set(swigCPtr, value); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - get - { - int ret = NDalicPINVOKE.Property_propertyIndex_get(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - } - - /// - /// Gets or sets the component index of the property. - /// - /// 3 - public int componentIndex - { - set - { - NDalicPINVOKE.Property_componentIndex_set(swigCPtr, value); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - get - { - int ret = NDalicPINVOKE.Property_componentIndex_get(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - } - - } - - /// - /// An array of property values. - /// - /// 3 - public class PropertyArray : global::System.IDisposable - { - private global::System.Runtime.InteropServices.HandleRef swigCPtr; - /// - /// swigCMemOwn - /// - /// 3 - protected bool swigCMemOwn; - internal PropertyArray(global::System.IntPtr cPtr, bool cMemoryOwn) { swigCMemOwn = cMemoryOwn; swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); } - internal static global::System.Runtime.InteropServices.HandleRef getCPtr(PropertyArray obj) - { - return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; - } - - //A Flag to check who called Dispose(). (By User or DisposeQueue) - private bool isDisposeQueued = false; - /// - /// A Flat to check if it is already disposed. - /// - /// 3 - protected bool disposed = false; - /// /// Dispose. /// @@ -289,63 +78,6 @@ namespace Tizen.NUI } /// - /// Dispose. - /// - /// 3 - public void Dispose() - { - //Throw excpetion if Dispose() is called in separate thread. - if (!Window.IsInstalled()) - { - throw new System.InvalidOperationException("This API called from separate thread. This API must be called from MainThread."); - } - - if (isDisposeQueued) - { - Dispose(DisposeTypes.Implicit); - } - else - { - Dispose(DisposeTypes.Explicit); - System.GC.SuppressFinalize(this); - } - } - - /// - /// Dispose. - /// - /// 3 - protected virtual void Dispose(DisposeTypes type) - { - if (disposed) - { - return; - } - - if(type == DisposeTypes.Explicit) - { - //Called by User - //Release your own managed resources here. - //You should release all of your own disposable objects here. - } - - //Release your own unmanaged resources here. - //You should not access any managed member here except static instance. - //because the execution order of Finalizes is non-deterministic. - - if (swigCPtr.Handle != global::System.IntPtr.Zero) - { - if (swigCMemOwn) - { - swigCMemOwn = false; - NDalicPINVOKE.delete_Property_Array(swigCPtr); - } - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); - } - disposed = true; - } - - /// /// The operator to access an element. /// /// The element index to access. No bounds checking is performed. @@ -360,20 +92,6 @@ namespace Tizen.NUI } /// - /// The constructor. - /// - /// 3 - public PropertyArray() : this(NDalicPINVOKE.new_Property_Array__SWIG_0(), true) - { - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - internal PropertyArray(PropertyArray other) : this(NDalicPINVOKE.new_Property_Array__SWIG_1(PropertyArray.getCPtr(other)), true) - { - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - /// /// Retrieves the number of elements in the array. /// /// The number of elements in the array. @@ -502,64 +220,6 @@ namespace Tizen.NUI } /// - /// Retrieves the value of elements in the array. - /// - /// The element index to retrieve. - /// The reference to the element. - private PropertyValue ValueOfIndex(uint index) - { - PropertyValue ret = new PropertyValue(NDalicPINVOKE.Property_Array_ValueOfIndex__SWIG_0(swigCPtr, index), false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - } - - /// - /// A key type which can be either a std::string or a Property::Index. - /// - /// 3 - public class PropertyKey : global::System.IDisposable - { - private global::System.Runtime.InteropServices.HandleRef swigCPtr; - /// - /// swigCMemOwn - /// - /// 3 - protected bool swigCMemOwn; - - internal PropertyKey(global::System.IntPtr cPtr, bool cMemoryOwn) - { - swigCMemOwn = cMemoryOwn; - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); - } - - internal static global::System.Runtime.InteropServices.HandleRef getCPtr(PropertyKey obj) - { - return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; - } - - //A Flag to check who called Dispose(). (By User or DisposeQueue) - private bool isDisposeQueued = false; - /// - /// A Flat to check if it is already disposed. - /// - /// 3 - protected bool disposed = false; - - /// - /// Dispose. - /// - /// 3 - ~PropertyKey() - { - if(!isDisposeQueued) - { - isDisposeQueued = true; - DisposeQueue.Instance.Add(this); - } - } - - /// /// Dispose. /// /// 3 @@ -582,6 +242,11 @@ namespace Tizen.NUI } } + internal static global::System.Runtime.InteropServices.HandleRef getCPtr(PropertyArray obj) + { + return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; + } + /// /// Dispose. /// @@ -593,7 +258,7 @@ namespace Tizen.NUI return; } - if(type == DisposeTypes.Explicit) + if (type == DisposeTypes.Explicit) { //Called by User //Release your own managed resources here. @@ -609,7 +274,7 @@ namespace Tizen.NUI if (swigCMemOwn) { swigCMemOwn = false; - NDalicPINVOKE.delete_Property_Key(swigCPtr); + NDalicPINVOKE.delete_Property_Array(swigCPtr); } swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); } @@ -617,6 +282,98 @@ namespace Tizen.NUI } /// + /// Retrieves the value of elements in the array. + /// + /// The element index to retrieve. + /// The reference to the element. + private PropertyValue ValueOfIndex(uint index) + { + PropertyValue ret = new PropertyValue(NDalicPINVOKE.Property_Array_ValueOfIndex__SWIG_0(swigCPtr, index), false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + } + + /// + /// A key type which can be either a std::string or a Property::Index. + /// + /// 3 + public class PropertyKey : global::System.IDisposable + { + /// + /// swigCMemOwn + /// + /// 3 + protected bool swigCMemOwn; + /// + /// A Flat to check if it is already disposed. + /// + /// 3 + protected bool disposed = false; + + private global::System.Runtime.InteropServices.HandleRef swigCPtr; + + //A Flag to check who called Dispose(). (By User or DisposeQueue) + private bool isDisposeQueued = false; + + /// + /// The constructor. + /// + /// The string key. + /// 3 + public PropertyKey(string key) : this(NDalicPINVOKE.new_Property_Key__SWIG_0(key), true) + { + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + /// + /// The constructor. + /// + /// The index key. + /// 3 + public PropertyKey(int key) : this(NDalicPINVOKE.new_Property_Key__SWIG_1(key), true) + { + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + internal PropertyKey(global::System.IntPtr cPtr, bool cMemoryOwn) + { + swigCMemOwn = cMemoryOwn; + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); + } + + /// + /// Dispose. + /// + /// 3 + ~PropertyKey() + { + if(!isDisposeQueued) + { + isDisposeQueued = true; + DisposeQueue.Instance.Add(this); + } + } + + /// + /// The type of key. + /// + /// 3 + public enum KeyType + { + /// + /// The type of key is index. + /// + /// 3 + Index, + /// + /// The type of key is string. + /// + /// 3 + String + } + + /// /// The type of the key. /// /// 3 @@ -674,23 +431,26 @@ namespace Tizen.NUI } /// - /// The constructor. + /// Dispose. /// - /// The string key. /// 3 - public PropertyKey(string key) : this(NDalicPINVOKE.new_Property_Key__SWIG_0(key), true) + public void Dispose() { - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } + //Throw excpetion if Dispose() is called in separate thread. + if (!Window.IsInstalled()) + { + throw new System.InvalidOperationException("This API called from separate thread. This API must be called from MainThread."); + } - /// - /// The constructor. - /// - /// The index key. - /// 3 - public PropertyKey(int key) : this(NDalicPINVOKE.new_Property_Key__SWIG_1(key), true) - { - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + if (isDisposeQueued) + { + Dispose(DisposeTypes.Implicit); + } + else + { + Dispose(DisposeTypes.Explicit); + System.GC.SuppressFinalize(this); + } } /// @@ -771,24 +531,44 @@ namespace Tizen.NUI return ret; } + internal static global::System.Runtime.InteropServices.HandleRef getCPtr(PropertyKey obj) + { + return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; + } + /// - /// The type of key. + /// Dispose. /// /// 3 - public enum KeyType + protected virtual void Dispose(DisposeTypes type) { - /// - /// The type of key is index. - /// - /// 3 - Index, - /// - /// The type of key is string. - /// - /// 3 - String - } + if (disposed) + { + return; + } + + if (type == DisposeTypes.Explicit) + { + //Called by User + //Release your own managed resources here. + //You should release all of your own disposable objects here. + } + + //Release your own unmanaged resources here. + //You should not access any managed member here except static instance. + //because the execution order of Finalizes is non-deterministic. + if (swigCPtr.Handle != global::System.IntPtr.Zero) + { + if (swigCMemOwn) + { + swigCMemOwn = false; + NDalicPINVOKE.delete_Property_Key(swigCPtr); + } + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); + } + disposed = true; + } } /// @@ -797,100 +577,58 @@ namespace Tizen.NUI /// 3 public class PropertyMap : global::System.IDisposable { - private global::System.Runtime.InteropServices.HandleRef swigCPtr; /// /// swigCMemOwn /// /// 3 protected bool swigCMemOwn; - - internal PropertyMap(global::System.IntPtr cPtr, bool cMemoryOwn) - { - swigCMemOwn = cMemoryOwn; - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); - } - - internal static global::System.Runtime.InteropServices.HandleRef getCPtr(PropertyMap obj) - { - return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; - } - - //A Flag to check who called Dispose(). (By User or DisposeQueue) - private bool isDisposeQueued = false; /// /// A Flat to check if it is already disposed. /// /// 3 protected bool disposed = false; + private global::System.Runtime.InteropServices.HandleRef swigCPtr; + + //A Flag to check who called Dispose(). (By User or DisposeQueue) + private bool isDisposeQueued = false; + /// - /// Dispose. + /// The constructor. /// /// 3 - ~PropertyMap() + public PropertyMap() : this(NDalicPINVOKE.new_Property_Map__SWIG_0(), true) { - if(!isDisposeQueued) - { - isDisposeQueued = true; - DisposeQueue.Instance.Add(this); - } + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } /// - /// Dispose. + /// The copy constructor. /// + /// The map to copy from. /// 3 - public void Dispose() + public PropertyMap(PropertyMap other) : this(NDalicPINVOKE.new_Property_Map__SWIG_1(PropertyMap.getCPtr(other)), true) { - //Throw excpetion if Dispose() is called in separate thread. - if (!Window.IsInstalled()) - { - throw new System.InvalidOperationException("This API called from separate thread. This API must be called from MainThread."); - } + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } - if (isDisposeQueued) - { - Dispose(DisposeTypes.Implicit); - } - else - { - Dispose(DisposeTypes.Explicit); - System.GC.SuppressFinalize(this); - } + internal PropertyMap(global::System.IntPtr cPtr, bool cMemoryOwn) + { + swigCMemOwn = cMemoryOwn; + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); } /// /// Dispose. /// /// 3 - protected virtual void Dispose(DisposeTypes type) + ~PropertyMap() { - if (disposed) - { - return; - } - - if(type == DisposeTypes.Explicit) - { - //Called by User - //Release your own managed resources here. - //You should release all of your own disposable objects here. - } - - //Release your own unmanaged resources here. - //You should not access any managed member here except static instance. - //because the execution order of Finalizes is non-deterministic. - - if (swigCPtr.Handle != global::System.IntPtr.Zero) + if(!isDisposeQueued) { - if (swigCMemOwn) - { - swigCMemOwn = false; - NDalicPINVOKE.delete_Property_Map(swigCPtr); - } - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); + isDisposeQueued = true; + DisposeQueue.Instance.Add(this); } - disposed = true; } /// @@ -924,22 +662,26 @@ namespace Tizen.NUI } /// - /// The constructor. + /// Dispose. /// /// 3 - public PropertyMap() : this(NDalicPINVOKE.new_Property_Map__SWIG_0(), true) + public void Dispose() { - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } + //Throw excpetion if Dispose() is called in separate thread. + if (!Window.IsInstalled()) + { + throw new System.InvalidOperationException("This API called from separate thread. This API must be called from MainThread."); + } - /// - /// The copy constructor. - /// - /// The map to copy from. - /// 3 - public PropertyMap(PropertyMap other) : this(NDalicPINVOKE.new_Property_Map__SWIG_1(PropertyMap.getCPtr(other)), true) - { - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + if (isDisposeQueued) + { + Dispose(DisposeTypes.Implicit); + } + else + { + Dispose(DisposeTypes.Explicit); + System.GC.SuppressFinalize(this); + } } /// @@ -1134,84 +876,20 @@ namespace Tizen.NUI } /// - /// Retrieves the element with the specified index key. - /// - /// The key whose value to retrieve. - /// The value for the element with the specified key. - internal PropertyValue ValueOfIndex(int key) - { - PropertyValue ret = new PropertyValue(NDalicPINVOKE.Property_Map_ValueOfIndex__SWIG_2(swigCPtr, key), false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - } - - /// - /// A value-type representing a property value. - /// - /// 3 - public class PropertyValue : global::System.IDisposable - { - private global::System.Runtime.InteropServices.HandleRef swigCPtr; - /// - /// swigCMemOwn - /// - /// 3 - protected bool swigCMemOwn; - - internal PropertyValue(global::System.IntPtr cPtr, bool cMemoryOwn) - { - swigCMemOwn = cMemoryOwn; - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); - } - - internal static global::System.Runtime.InteropServices.HandleRef getCPtr(PropertyValue obj) - { - return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; - } - - //A Flag to check who called Dispose(). (By User or DisposeQueue) - private bool isDisposeQueued = false; - /// - /// A Flat to check if it is already disposed. - /// - /// 3 - protected bool disposed = false; - - /// - /// Dispose. - /// - /// 3 - ~PropertyValue() - { - if(!isDisposeQueued) - { - isDisposeQueued = true; - DisposeQueue.Instance.Add(this); - } - } - - /// - /// Dispose. + /// Retrieves the element with the specified index key. /// - /// 3 - public void Dispose() + /// The key whose value to retrieve. + /// The value for the element with the specified key. + internal PropertyValue ValueOfIndex(int key) { - //Throw excpetion if Dispose() is called in separate thread. - if (!Window.IsInstalled()) - { - throw new System.InvalidOperationException("This API called from separate thread. This API must be called from MainThread."); - } + PropertyValue ret = new PropertyValue(NDalicPINVOKE.Property_Map_ValueOfIndex__SWIG_2(swigCPtr, key), false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } - if (isDisposeQueued) - { - Dispose(DisposeTypes.Implicit); - } - else - { - Dispose(DisposeTypes.Explicit); - System.GC.SuppressFinalize(this); - } + internal static global::System.Runtime.InteropServices.HandleRef getCPtr(PropertyMap obj) + { + return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; } /// @@ -1225,7 +903,7 @@ namespace Tizen.NUI return; } - if(type == DisposeTypes.Explicit) + if (type == DisposeTypes.Explicit) { //Called by User //Release your own managed resources here. @@ -1241,109 +919,35 @@ namespace Tizen.NUI if (swigCMemOwn) { swigCMemOwn = false; - NDalicPINVOKE.delete_Property_Value(swigCPtr); + NDalicPINVOKE.delete_Property_Map(swigCPtr); } swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); } disposed = true; } + } - + /// + /// A value-type representing a property value. + /// + /// 3 + public class PropertyValue : global::System.IDisposable + { /// - /// An extension to the property value class that allows us to create a - /// Property value from a C# object, for example, integer, float, or string.
+ /// swigCMemOwn ///
- /// An object to create. - /// The created value. /// 3 - static public PropertyValue CreateFromObject(System.Object obj) - { - System.Type type = obj.GetType(); + protected bool swigCMemOwn; + /// + /// A Flat to check if it is already disposed. + /// + /// 3 + protected bool disposed = false; - PropertyValue value; - if (type.IsEnum) - { - value = new PropertyValue((int)obj);//Enum.Parse(type, str); - } - else if (type.Equals(typeof(int))) - { - value = new PropertyValue((int)obj); - } - else if (type.Equals(typeof(System.Int32))) - { - value = new PropertyValue((int)obj); - } - else if (type.Equals(typeof(bool))) - { - value = new PropertyValue((bool)obj); - } - else if (type.Equals(typeof(float))) - { - value = new PropertyValue((float)obj); - } - else if (type.Equals(typeof(string))) - { - value = new PropertyValue((string)obj); - } - else if (type.Equals(typeof(Vector2))) - { - value = new PropertyValue((Vector2)obj); - } - else if (type.Equals(typeof(Vector3))) - { - value = new PropertyValue((Vector3)obj); - } - else if (type.Equals(typeof(Vector4))) - { - value = new PropertyValue((Vector4)obj); - } - else if (type.Equals(typeof(Position))) - { - value = new PropertyValue((Position)obj); - } - else if (type.Equals(typeof(Position2D))) - { - value = new PropertyValue((Position2D)obj); - } - else if (type.Equals(typeof(Size))) - { - value = new PropertyValue((Size)obj); - } - else if (type.Equals(typeof(Size2D))) - { - value = new PropertyValue((Size2D)obj); - } - else if (type.Equals(typeof(Color))) - { - value = new PropertyValue((Color)obj); - } - else if (type.Equals(typeof(Rotation))) - { - value = new PropertyValue((Rotation)obj); - } - else if (type.Equals(typeof(RelativeVector2))) - { - value = new PropertyValue((RelativeVector2)obj); - } - else if (type.Equals(typeof(RelativeVector3))) - { - value = new PropertyValue((RelativeVector3)obj); - } - else if (type.Equals(typeof(RelativeVector4))) - { - value = new PropertyValue((RelativeVector4)obj); - } - else if(type.Equals(typeof(Extents))) - { - value = new PropertyValue((Extents)obj); - } - else - { - throw new global::System.InvalidOperationException("Unimplemented type for Property Value :" + type.Name); - } - //NUILog.Debug(" got an property value of =" + type.Name); - return value; - } + private global::System.Runtime.InteropServices.HandleRef swigCPtr; + + //A Flag to check who called Dispose(). (By User or DisposeQueue) + private bool isDisposeQueued = false; /// /// Creates a Size2D property value. @@ -1366,15 +970,6 @@ namespace Tizen.NUI } /// - /// Creates a Size property value. - /// - /// Size values. - internal PropertyValue(Size vectorValue) : this(NDalicPINVOKE.new_Property_Value__SWIG_5(Size.getCPtr(vectorValue)), true) - { - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - /// /// Creates a Position property value. /// /// Position values. @@ -1393,140 +988,170 @@ namespace Tizen.NUI { if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } - + /// + /// The default constructor. + /// + /// 3 + public PropertyValue() : this(NDalicPINVOKE.new_Property_Value__SWIG_0(), true) + { + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } /// - /// Retrieves a Size2D value. + /// Creates a boolean property value. /// - /// On return, a Size2D value. + /// A boolean value. /// 3 - public bool Get(Size2D vectorValue) + public PropertyValue(bool boolValue) : this(NDalicPINVOKE.new_Property_Value__SWIG_1(boolValue), true) { - bool ret = NDalicPINVOKE.Property_Value_Get__SWIG_5(swigCPtr, Size2D.getCPtr(vectorValue)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; } /// - /// Retrieves a Position2D value. + /// Creates an integer property value. /// - /// On return, a Position2D value. + /// An integer value. /// 3 - public bool Get(Position2D vectorValue) + public PropertyValue(int integerValue) : this(NDalicPINVOKE.new_Property_Value__SWIG_2(integerValue), true) { - bool ret = NDalicPINVOKE.Property_Value_Get__SWIG_5(swigCPtr, Position2D.getCPtr(vectorValue)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; } /// - /// Retrieves a Size value. + /// Creates a float property value. /// - /// On return, a size value. - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - public bool Get(Size vectorValue) + /// A floating-point value. + /// 3 + public PropertyValue(float floatValue) : this(NDalicPINVOKE.new_Property_Value__SWIG_3(floatValue), true) { - bool ret = NDalicPINVOKE.Property_Value_Get__SWIG_6(swigCPtr, Size.getCPtr(vectorValue)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; } /// - /// Retrieves a Position value. + /// Creates a Vector2 property value. /// - /// On return, a position value. + /// A vector of 2 floating-point values. /// 3 - public bool Get(Position vectorValue) + public PropertyValue(Vector2 vectorValue) : this(NDalicPINVOKE.new_Property_Value__SWIG_4(Vector2.getCPtr(vectorValue)), true) { - bool ret = NDalicPINVOKE.Property_Value_Get__SWIG_6(swigCPtr, Position.getCPtr(vectorValue)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; } /// - /// Retrieves a Color value. + /// Creates a Vector3 property value. /// - /// On return, a color value. + /// A vector of 3 floating-point values. /// 3 - public bool Get(Color vectorValue) + public PropertyValue(Vector3 vectorValue) : this(NDalicPINVOKE.new_Property_Value__SWIG_5(Vector3.getCPtr(vectorValue)), true) { - bool ret = NDalicPINVOKE.Property_Value_Get__SWIG_7(swigCPtr, Color.getCPtr(vectorValue)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; } + /// + /// Creates a Vector4 property value. + /// + /// A vector of 4 floating-point values. + /// 3 + public PropertyValue(Vector4 vectorValue) : this(NDalicPINVOKE.new_Property_Value__SWIG_6(Vector4.getCPtr(vectorValue)), true) + { + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + /// + /// Creates a Rectangle property value. + /// + /// Rectangle values. + /// 3 + public PropertyValue(Rectangle vectorValue) : this(NDalicPINVOKE.new_Property_Value__SWIG_9(Rectangle.getCPtr(vectorValue)), true) + { + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } /// - /// The default constructor. + /// Creates a Rotation property value. /// + /// Rotation values. /// 3 - public PropertyValue() : this(NDalicPINVOKE.new_Property_Value__SWIG_0(), true) + public PropertyValue(Rotation quaternion) : this(NDalicPINVOKE.new_Property_Value__SWIG_11(Rotation.getCPtr(quaternion)), true) { if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } /// - /// Creates a boolean property value. + /// Creates a string property value. /// - /// A boolean value. + /// A string. /// 3 - public PropertyValue(bool boolValue) : this(NDalicPINVOKE.new_Property_Value__SWIG_1(boolValue), true) + public PropertyValue(string stringValue) : this(NDalicPINVOKE.new_Property_Value__SWIG_12(stringValue), true) { if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } /// - /// Creates an integer property value. + /// Creates an array property value. /// - /// An integer value. + /// An array. /// 3 - public PropertyValue(int integerValue) : this(NDalicPINVOKE.new_Property_Value__SWIG_2(integerValue), true) + public PropertyValue(PropertyArray arrayValue) : this(NDalicPINVOKE.new_Property_Value__SWIG_14(PropertyArray.getCPtr(arrayValue)), true) { if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } /// - /// Creates a float property value. + /// Creates a map property value. /// - /// A floating-point value. + /// An array. /// 3 - public PropertyValue(float floatValue) : this(NDalicPINVOKE.new_Property_Value__SWIG_3(floatValue), true) + public PropertyValue(PropertyMap mapValue) : this(NDalicPINVOKE.new_Property_Value__SWIG_15(PropertyMap.getCPtr(mapValue)), true) { if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } /// - /// Creates a Vector2 property value. + /// Creates a Extents value. /// - /// A vector of 2 floating-point values. + /// A Extents value. + /// 4 + public PropertyValue(Extents extentsValue) : this(NDalicPINVOKE.new_Property_Value__SWIG_16(Extents.getCPtr(extentsValue)), true) + { + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + /// + /// Creates a PropertyType value. + /// + /// A PropertyType value. /// 3 - public PropertyValue(Vector2 vectorValue) : this(NDalicPINVOKE.new_Property_Value__SWIG_4(Vector2.getCPtr(vectorValue)), true) + public PropertyValue(PropertyType type) : this(NDalicPINVOKE.new_Property_Value__SWIG_17((int)type), true) { if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } /// - /// Creates a Vector3 property value. + /// Creates a PropertyValue value. /// - /// A vector of 3 floating-point values. + /// A PropertyValue value. /// 3 - public PropertyValue(Vector3 vectorValue) : this(NDalicPINVOKE.new_Property_Value__SWIG_5(Vector3.getCPtr(vectorValue)), true) + public PropertyValue(PropertyValue value) : this(NDalicPINVOKE.new_Property_Value__SWIG_18(PropertyValue.getCPtr(value)), true) { if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } /// - /// Creates a Vector4 property value. + /// Creates a Size property value. /// - /// A vector of 4 floating-point values. - /// 3 - public PropertyValue(Vector4 vectorValue) : this(NDalicPINVOKE.new_Property_Value__SWIG_6(Vector4.getCPtr(vectorValue)), true) + /// Size values. + internal PropertyValue(Size vectorValue) : this(NDalicPINVOKE.new_Property_Value__SWIG_5(Size.getCPtr(vectorValue)), true) { if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } + internal PropertyValue(global::System.IntPtr cPtr, bool cMemoryOwn) + { + swigCMemOwn = cMemoryOwn; + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); + } + internal PropertyValue(Matrix3 matrixValue) : this(NDalicPINVOKE.new_Property_Value__SWIG_7(Matrix3.getCPtr(matrixValue)), true) { if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); @@ -1537,89 +1162,202 @@ namespace Tizen.NUI if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } - /// - /// Creates a Rectangle property value. - /// - /// Rectangle values. - /// 3 - public PropertyValue(Rectangle vectorValue) : this(NDalicPINVOKE.new_Property_Value__SWIG_9(Rectangle.getCPtr(vectorValue)), true) + internal PropertyValue(AngleAxis angleAxis) : this(NDalicPINVOKE.new_Property_Value__SWIG_10(AngleAxis.getCPtr(angleAxis)), true) { if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } - internal PropertyValue(AngleAxis angleAxis) : this(NDalicPINVOKE.new_Property_Value__SWIG_10(AngleAxis.getCPtr(angleAxis)), true) + /// + /// Dispose. + /// + /// 3 + ~PropertyValue() { - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + if(!isDisposeQueued) + { + isDisposeQueued = true; + DisposeQueue.Instance.Add(this); + } } /// - /// Creates a Rotation property value. + /// An extension to the property value class that allows us to create a + /// Property value from a C# object, for example, integer, float, or string.
///
- /// Rotation values. + /// An object to create. + /// The created value. /// 3 - public PropertyValue(Rotation quaternion) : this(NDalicPINVOKE.new_Property_Value__SWIG_11(Rotation.getCPtr(quaternion)), true) + static public PropertyValue CreateFromObject(System.Object obj) { - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + System.Type type = obj.GetType(); + + PropertyValue value; + if (type.IsEnum) + { + value = new PropertyValue((int)obj);//Enum.Parse(type, str); + } + else if (type.Equals(typeof(int))) + { + value = new PropertyValue((int)obj); + } + else if (type.Equals(typeof(System.Int32))) + { + value = new PropertyValue((int)obj); + } + else if (type.Equals(typeof(bool))) + { + value = new PropertyValue((bool)obj); + } + else if (type.Equals(typeof(float))) + { + value = new PropertyValue((float)obj); + } + else if (type.Equals(typeof(string))) + { + value = new PropertyValue((string)obj); + } + else if (type.Equals(typeof(Vector2))) + { + value = new PropertyValue((Vector2)obj); + } + else if (type.Equals(typeof(Vector3))) + { + value = new PropertyValue((Vector3)obj); + } + else if (type.Equals(typeof(Vector4))) + { + value = new PropertyValue((Vector4)obj); + } + else if (type.Equals(typeof(Position))) + { + value = new PropertyValue((Position)obj); + } + else if (type.Equals(typeof(Position2D))) + { + value = new PropertyValue((Position2D)obj); + } + else if (type.Equals(typeof(Size))) + { + value = new PropertyValue((Size)obj); + } + else if (type.Equals(typeof(Size2D))) + { + value = new PropertyValue((Size2D)obj); + } + else if (type.Equals(typeof(Color))) + { + value = new PropertyValue((Color)obj); + } + else if (type.Equals(typeof(Rotation))) + { + value = new PropertyValue((Rotation)obj); + } + else if (type.Equals(typeof(RelativeVector2))) + { + value = new PropertyValue((RelativeVector2)obj); + } + else if (type.Equals(typeof(RelativeVector3))) + { + value = new PropertyValue((RelativeVector3)obj); + } + else if (type.Equals(typeof(RelativeVector4))) + { + value = new PropertyValue((RelativeVector4)obj); + } + else if(type.Equals(typeof(Extents))) + { + value = new PropertyValue((Extents)obj); + } + else + { + throw new global::System.InvalidOperationException("Unimplemented type for Property Value :" + type.Name); + } + //NUILog.Debug(" got an property value of =" + type.Name); + return value; } /// - /// Creates a string property value. + /// Dispose. /// - /// A string. /// 3 - public PropertyValue(string stringValue) : this(NDalicPINVOKE.new_Property_Value__SWIG_12(stringValue), true) + public void Dispose() { - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + //Throw excpetion if Dispose() is called in separate thread. + if (!Window.IsInstalled()) + { + throw new System.InvalidOperationException("This API called from separate thread. This API must be called from MainThread."); + } + + if (isDisposeQueued) + { + Dispose(DisposeTypes.Implicit); + } + else + { + Dispose(DisposeTypes.Explicit); + System.GC.SuppressFinalize(this); + } } /// - /// Creates an array property value. + /// Retrieves a Size2D value. /// - /// An array. + /// On return, a Size2D value. /// 3 - public PropertyValue(PropertyArray arrayValue) : this(NDalicPINVOKE.new_Property_Value__SWIG_14(PropertyArray.getCPtr(arrayValue)), true) + public bool Get(Size2D vectorValue) { + bool ret = NDalicPINVOKE.Property_Value_Get__SWIG_5(swigCPtr, Size2D.getCPtr(vectorValue)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; } /// - /// Creates a map property value. + /// Retrieves a Position2D value. /// - /// An array. + /// On return, a Position2D value. /// 3 - public PropertyValue(PropertyMap mapValue) : this(NDalicPINVOKE.new_Property_Value__SWIG_15(PropertyMap.getCPtr(mapValue)), true) + public bool Get(Position2D vectorValue) { + bool ret = NDalicPINVOKE.Property_Value_Get__SWIG_5(swigCPtr, Position2D.getCPtr(vectorValue)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; } /// - /// Creates a Extents value. + /// Retrieves a Size value. /// - /// A Extents value. - /// 4 - public PropertyValue(Extents extentsValue) : this(NDalicPINVOKE.new_Property_Value__SWIG_16(Extents.getCPtr(extentsValue)), true) + /// On return, a size value. + /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + public bool Get(Size vectorValue) { + bool ret = NDalicPINVOKE.Property_Value_Get__SWIG_6(swigCPtr, Size.getCPtr(vectorValue)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; } /// - /// Creates a PropertyType value. + /// Retrieves a Position value. /// - /// A PropertyType value. + /// On return, a position value. /// 3 - public PropertyValue(PropertyType type) : this(NDalicPINVOKE.new_Property_Value__SWIG_17((int)type), true) + public bool Get(Position vectorValue) { + bool ret = NDalicPINVOKE.Property_Value_Get__SWIG_6(swigCPtr, Position.getCPtr(vectorValue)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; } /// - /// Creates a PropertyValue value. + /// Retrieves a Color value. /// - /// A PropertyValue value. + /// On return, a color value. /// 3 - public PropertyValue(PropertyValue value) : this(NDalicPINVOKE.new_Property_Value__SWIG_18(PropertyValue.getCPtr(value)), true) + public bool Get(Color vectorValue) { + bool ret = NDalicPINVOKE.Property_Value_Get__SWIG_7(swigCPtr, Color.getCPtr(vectorValue)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; } /// @@ -1770,27 +1508,6 @@ namespace Tizen.NUI return ret; } - internal bool Get(Matrix3 matrixValue) - { - bool ret = NDalicPINVOKE.Property_Value_Get__SWIG_8(swigCPtr, Matrix3.getCPtr(matrixValue)); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - internal bool Get(Matrix matrixValue) - { - bool ret = NDalicPINVOKE.Property_Value_Get__SWIG_9(swigCPtr, Matrix.getCPtr(matrixValue)); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - internal bool Get(AngleAxis angleAxisValue) - { - bool ret = NDalicPINVOKE.Property_Value_Get__SWIG_10(swigCPtr, AngleAxis.getCPtr(angleAxisValue)); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - /// /// Retrieves a rotation value. /// @@ -1851,9 +1568,69 @@ namespace Tizen.NUI /// 4 public bool Get(Extents extentsValue) { - bool ret = NDalicPINVOKE.Property_Value_Get__SWIG_15(swigCPtr, Extents.getCPtr(extentsValue)); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; + bool ret = NDalicPINVOKE.Property_Value_Get__SWIG_15(swigCPtr, Extents.getCPtr(extentsValue)); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + internal static global::System.Runtime.InteropServices.HandleRef getCPtr(PropertyValue obj) + { + return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; + } + + internal bool Get(Matrix3 matrixValue) + { + bool ret = NDalicPINVOKE.Property_Value_Get__SWIG_8(swigCPtr, Matrix3.getCPtr(matrixValue)); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + internal bool Get(Matrix matrixValue) + { + bool ret = NDalicPINVOKE.Property_Value_Get__SWIG_9(swigCPtr, Matrix.getCPtr(matrixValue)); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + internal bool Get(AngleAxis angleAxisValue) + { + bool ret = NDalicPINVOKE.Property_Value_Get__SWIG_10(swigCPtr, AngleAxis.getCPtr(angleAxisValue)); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + /// + /// Dispose. + /// + /// 3 + protected virtual void Dispose(DisposeTypes type) + { + if (disposed) + { + return; + } + + if (type == DisposeTypes.Explicit) + { + //Called by User + //Release your own managed resources here. + //You should release all of your own disposable objects here. + } + + //Release your own unmanaged resources here. + //You should not access any managed member here except static instance. + //because the execution order of Finalizes is non-deterministic. + + if (swigCPtr.Handle != global::System.IntPtr.Zero) + { + if (swigCMemOwn) + { + swigCMemOwn = false; + NDalicPINVOKE.delete_Property_Value(swigCPtr); + } + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); + } + disposed = true; } } @@ -1862,10 +1639,6 @@ namespace Tizen.NUI /// public class KeyValue { - private string _key = null; - private object _originalValue = null; - private object _originalKey = null; - /// /// Int key. /// @@ -1881,6 +1654,10 @@ namespace Tizen.NUI ///
public PropertyValue TrueValue = null; + private string _key = null; + private object _originalValue = null; + private object _originalKey = null; + /// /// Default Constructor. /// @@ -2184,4 +1961,223 @@ namespace Tizen.NUI } } } + + internal class Property : global::System.IDisposable + { + /// + /// swigCMemOwn + /// + /// 3 + protected bool swigCMemOwn; + /// + /// 3 + /// A Flat to check if it is already disposed. + /// + protected bool disposed = false; + + private global::System.Runtime.InteropServices.HandleRef swigCPtr; + + //A Flag to check who called Dispose(). (By User or DisposeQueue) + private bool isDisposeQueued = false; + + /// + /// This constructor creates a property instance. + /// + /// A valid handle to the target object. + /// The index of a property. + /// 3 + public Property(Animatable arg0, int propertyIndex) : this(NDalicPINVOKE.new_Property__SWIG_0(Animatable.getCPtr(arg0), propertyIndex), true) + { + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + /// + /// This constructor creates a property instance. + /// + /// A valid handle to the target object. + /// The index of a property. + /// Index to a sub component of a property, for use with Vector2, Vector3 and Vector4. -1 for the main property (default is -1). + /// 3 + public Property(Animatable arg0, int propertyIndex, int componentIndex) : this(NDalicPINVOKE.new_Property__SWIG_1(Animatable.getCPtr(arg0), propertyIndex, componentIndex), true) + { + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + /// + /// This constructor creates a property instance.
+ /// This performs a property index query and is therefore slower than constructing a property directly with the index.
+ ///
+ /// A valid handle to the target object. + /// The property name. + /// 3 + public Property(Animatable arg0, string propertyName) : this(NDalicPINVOKE.new_Property__SWIG_2(Animatable.getCPtr(arg0), propertyName), true) + { + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + /// + /// This constructor creates a property instance.
+ /// This performs a property index query and is therefore slower than constructing a property directly with the index.
+ ///
+ /// A valid handle to the target object. + /// The property name. + /// Index to a sub component of a property, for use with Vector2, Vector3 and Vector4. -1 for main property (default is -1). + /// 3 + public Property(Animatable arg0, string propertyName, int componentIndex) : this(NDalicPINVOKE.new_Property__SWIG_3(Animatable.getCPtr(arg0), propertyName, componentIndex), true) + { + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + internal Property(global::System.IntPtr cPtr, bool cMemoryOwn) + { + swigCMemOwn = cMemoryOwn; + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); + } + + ~Property() + { + if(!isDisposeQueued) + { + isDisposeQueued = true; + DisposeQueue.Instance.Add(this); + } + } + + /// + /// Gets or sets the index of the property. + /// + /// 3 + public int propertyIndex + { + set + { + NDalicPINVOKE.Property_propertyIndex_set(swigCPtr, value); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + get + { + int ret = NDalicPINVOKE.Property_propertyIndex_get(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + } + + /// + /// Gets or sets the component index of the property. + /// + /// 3 + public int componentIndex + { + set + { + NDalicPINVOKE.Property_componentIndex_set(swigCPtr, value); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + get + { + int ret = NDalicPINVOKE.Property_componentIndex_get(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + } + + internal static int INVALID_INDEX + { + get + { + int ret = NDalicPINVOKE.Property_INVALID_INDEX_get(); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + } + + internal static int INVALID_KEY + { + get + { + int ret = NDalicPINVOKE.Property_INVALID_KEY_get(); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + } + + internal static int INVALID_COMPONENT_INDEX + { + get + { + int ret = NDalicPINVOKE.Property_INVALID_COMPONENT_INDEX_get(); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + } + + internal Animatable _object + { + set + { + NDalicPINVOKE.Property__object_set(swigCPtr, Animatable.getCPtr(value)); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + get + { + Animatable ret = new Animatable(NDalicPINVOKE.Property__object_get(swigCPtr), false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + } + + public void Dispose() + { + //Throw excpetion if Dispose() is called in separate thread. + if (!Window.IsInstalled()) + { + throw new System.InvalidOperationException("This API called from separate thread. This API must be called from MainThread."); + } + + if (isDisposeQueued) + { + Dispose(DisposeTypes.Implicit); + } + else + { + Dispose(DisposeTypes.Explicit); + System.GC.SuppressFinalize(this); + } + } + + internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Property obj) + { + return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; + } + + protected virtual void Dispose(DisposeTypes type) + { + if (disposed) + { + return; + } + + if(type == DisposeTypes.Explicit) + { + //Called by User + //Release your own managed resources here. + //You should release all of your own disposable objects here. + } + + //Release your own unmanaged resources here. + //You should not access any managed member here except static instance. + //because the execution order of Finalizes is non-deterministic. + + if (swigCPtr.Handle != global::System.IntPtr.Zero) + { + if (swigCMemOwn) + { + swigCMemOwn = false; + NDalicPINVOKE.delete_Property(swigCPtr); + } + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); + } + disposed = true; + } + } } \ No newline at end of file diff --git a/src/Tizen.NUI/src/public/PropertyBuffer.cs b/src/Tizen.NUI/src/public/PropertyBuffer.cs index 526fded..93a1d77 100755 --- a/src/Tizen.NUI/src/public/PropertyBuffer.cs +++ b/src/Tizen.NUI/src/public/PropertyBuffer.cs @@ -26,11 +26,49 @@ namespace Tizen.NUI { private global::System.Runtime.InteropServices.HandleRef swigCPtr; + /// + /// Creates a PropertyBuffer. + /// + /// The map of names and types that describes the components of the buffer. + /// 3 + public PropertyBuffer(PropertyMap bufferFormat) : this(NDalicPINVOKE.PropertyBuffer_New(PropertyMap.getCPtr(bufferFormat)), true) + { + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + + } + internal PropertyBuffer(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.PropertyBuffer_SWIGUpcast(cPtr), cMemoryOwn) { swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); } + /// + /// Updates the whole buffer information.
+ /// This function expects a pointer to an array of structures with the same + /// format that was given in the construction, and the number of elements to + /// be the same as the size of the buffer.
+ ///
+ /// A pointer to the data that will be copied to the buffer. + /// Number of elements to expand or contract the buffer. + /// 3 + public void SetData(System.IntPtr data, uint size) + { + NDalicPINVOKE.PropertyBuffer_SetData(swigCPtr, data, size); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + /// + /// Gets the number of elements in the buffer. + /// + /// Number of elements to expand or contract the buffer. + /// 3 + public uint GetSize() + { + uint ret = NDalicPINVOKE.PropertyBuffer_GetSize(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + internal static global::System.Runtime.InteropServices.HandleRef getCPtr(PropertyBuffer obj) { return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; @@ -72,43 +110,6 @@ namespace Tizen.NUI base.Dispose(type); } - /// - /// Creates a PropertyBuffer. - /// - /// The map of names and types that describes the components of the buffer. - /// 3 - public PropertyBuffer(PropertyMap bufferFormat) : this(NDalicPINVOKE.PropertyBuffer_New(PropertyMap.getCPtr(bufferFormat)), true) - { - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - - } - /// - /// Updates the whole buffer information.
- /// This function expects a pointer to an array of structures with the same - /// format that was given in the construction, and the number of elements to - /// be the same as the size of the buffer.
- ///
- /// A pointer to the data that will be copied to the buffer. - /// Number of elements to expand or contract the buffer. - /// 3 - public void SetData(System.IntPtr data, uint size) - { - NDalicPINVOKE.PropertyBuffer_SetData(swigCPtr, data, size); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - /// - /// Gets the number of elements in the buffer. - /// - /// Number of elements to expand or contract the buffer. - /// 3 - public uint GetSize() - { - uint ret = NDalicPINVOKE.PropertyBuffer_GetSize(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - } } \ No newline at end of file diff --git a/src/Tizen.NUI/src/public/PropertyCondition.cs b/src/Tizen.NUI/src/public/PropertyCondition.cs index 6c94216..bd225cc 100755 --- a/src/Tizen.NUI/src/public/PropertyCondition.cs +++ b/src/Tizen.NUI/src/public/PropertyCondition.cs @@ -25,52 +25,6 @@ namespace Tizen.NUI { private global::System.Runtime.InteropServices.HandleRef swigCPtr; - internal PropertyCondition(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.PropertyCondition_SWIGUpcast(cPtr), cMemoryOwn) - { - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); - } - - internal static global::System.Runtime.InteropServices.HandleRef getCPtr(PropertyCondition obj) - { - return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; - } - - /// - /// Dispose. - /// - /// 4 - protected override void Dispose(DisposeTypes type) - { - if (disposed) - { - return; - } - - if (type == DisposeTypes.Explicit) - { - //Called by User - //Release your own managed resources here. - //You should release all of your own disposable objects here. - - } - - //Release your own unmanaged resources here. - //You should not access any managed member here except static instance. - //because the execution order of Finalizes is non-deterministic. - - if (swigCPtr.Handle != global::System.IntPtr.Zero) - { - if (swigCMemOwn) - { - swigCMemOwn = false; - NDalicPINVOKE.delete_PropertyCondition(swigCPtr); - } - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); - } - - base.Dispose(type); - } - /// /// Create a property condition instance. /// @@ -80,6 +34,11 @@ namespace Tizen.NUI if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } + internal PropertyCondition(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.PropertyCondition_SWIGUpcast(cPtr), cMemoryOwn) + { + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); + } + /// /// Retrieves the arguments that this condition uses. /// @@ -185,6 +144,47 @@ namespace Tizen.NUI return ret; } + internal static global::System.Runtime.InteropServices.HandleRef getCPtr(PropertyCondition obj) + { + return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; + } + + /// + /// Dispose. + /// + /// 4 + protected override void Dispose(DisposeTypes type) + { + if (disposed) + { + return; + } + + if (type == DisposeTypes.Explicit) + { + //Called by User + //Release your own managed resources here. + //You should release all of your own disposable objects here. + + } + + //Release your own unmanaged resources here. + //You should not access any managed member here except static instance. + //because the execution order of Finalizes is non-deterministic. + + if (swigCPtr.Handle != global::System.IntPtr.Zero) + { + if (swigCMemOwn) + { + swigCMemOwn = false; + NDalicPINVOKE.delete_PropertyCondition(swigCPtr); + } + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); + } + + base.Dispose(type); + } + } } \ No newline at end of file diff --git a/src/Tizen.NUI/src/public/PropertyNotification.cs b/src/Tizen.NUI/src/public/PropertyNotification.cs index 86209bf..a8f2386 100755 --- a/src/Tizen.NUI/src/public/PropertyNotification.cs +++ b/src/Tizen.NUI/src/public/PropertyNotification.cs @@ -30,81 +30,34 @@ namespace Tizen.NUI { private global::System.Runtime.InteropServices.HandleRef swigCPtr; - internal PropertyNotification(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.PropertyNotification_SWIGUpcast(cPtr), cMemoryOwn) - { - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); - } + private DaliEventHandler _propertyNotificationNotifyEventHandler; + private NotifyEventCallbackDelegate _propertyNotificationNotifyEventCallbackDelegate; - internal static global::System.Runtime.InteropServices.HandleRef getCPtr(PropertyNotification obj) + /// + /// Create a instance of PropertyNotification. + /// + /// 4 + public PropertyNotification() : this(NDalicPINVOKE.new_PropertyNotification__SWIG_0(), true) { - return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } /// - /// Dispose. + /// Create a instance of PropertyNotification. /// /// 4 - protected override void Dispose(DisposeTypes type) + public PropertyNotification(PropertyNotification handle) : this(NDalicPINVOKE.new_PropertyNotification__SWIG_1(PropertyNotification.getCPtr(handle)), true) { - if (disposed) - { - return; - } - - if (type == DisposeTypes.Explicit) - { - //Called by User - //Release your own managed resources here. - //You should release all of your own disposable objects here. - - } - - //Release your own unmanaged resources here. - //You should not access any managed member here except static instance. - //because the execution order of Finalizes is non-deterministic. - - if (swigCPtr.Handle != global::System.IntPtr.Zero) - { - if (swigCMemOwn) - { - swigCMemOwn = false; - NDalicPINVOKE.delete_PropertyNotification(swigCPtr); - } - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); - } - - base.Dispose(type); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } - /// - /// Event arguments that passed via Notify signal - /// - /// 3 - public class NotifyEventArgs : EventArgs + internal PropertyNotification(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.PropertyNotification_SWIGUpcast(cPtr), cMemoryOwn) { - private PropertyNotification _propertyNotification; - - /// - /// PropertyNotification - is the PropertyNotification handle that has the notification properties. - /// - /// 3 - public PropertyNotification PropertyNotification - { - get - { - return _propertyNotification; - } - set - { - _propertyNotification = value; - } - } + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); } [UnmanagedFunctionPointer(CallingConvention.StdCall)] private delegate void NotifyEventCallbackDelegate(IntPtr propertyNotification); - private DaliEventHandler _propertyNotificationNotifyEventHandler; - private NotifyEventCallbackDelegate _propertyNotificationNotifyEventCallbackDelegate; /// /// Event for Notified signal which can be used to subscribe/unsubscribe the event handler @@ -142,17 +95,32 @@ namespace Tizen.NUI } } - // Callback for PropertyNotification NotifySignal - private void OnPropertyNotificationNotify(IntPtr propertyNotification) + /// + /// Enumeration for description of how to check condition. + /// + /// 3 + public enum NotifyMode { - NotifyEventArgs e = new NotifyEventArgs(); - e.PropertyNotification = GetPropertyNotificationFromPtr(propertyNotification); - - if (_propertyNotificationNotifyEventHandler != null) - { - //here we send all data to user event handlers - _propertyNotificationNotifyEventHandler(this, e); - } + /// + /// Don't notify, regardless of result of Condition + /// + /// 3 + Disabled, + /// + /// Notify whenever condition changes from false to true. + /// + /// 3 + NotifyOnTrue, + /// + /// Notify whenever condition changes from true to false. + /// + /// 3 + NotifyOnFalse, + /// + /// Notify whenever condition changes (false to true, and true to false) + /// + /// 3 + NotifyOnChanged } /// @@ -170,15 +138,6 @@ namespace Tizen.NUI } /// - /// Create a instance of PropertyNotification. - /// - /// 4 - public PropertyNotification() : this(NDalicPINVOKE.new_PropertyNotification__SWIG_0(), true) - { - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - /// /// Downcast a PropertyNotification instance. /// /// Handle to an object of BaseHandle type. @@ -192,15 +151,6 @@ namespace Tizen.NUI } /// - /// Create a instance of PropertyNotification. - /// - /// 4 - public PropertyNotification(PropertyNotification handle) : this(NDalicPINVOKE.new_PropertyNotification__SWIG_1(PropertyNotification.getCPtr(handle)), true) - { - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - /// /// Assign. /// /// A reference to the copied handle. @@ -295,32 +245,83 @@ namespace Tizen.NUI return ret; } + internal static global::System.Runtime.InteropServices.HandleRef getCPtr(PropertyNotification obj) + { + return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; + } + /// - /// Enumeration for description of how to check condition. + /// Dispose. /// + /// 4 + protected override void Dispose(DisposeTypes type) + { + if (disposed) + { + return; + } + + if (type == DisposeTypes.Explicit) + { + //Called by User + //Release your own managed resources here. + //You should release all of your own disposable objects here. + + } + + //Release your own unmanaged resources here. + //You should not access any managed member here except static instance. + //because the execution order of Finalizes is non-deterministic. + + if (swigCPtr.Handle != global::System.IntPtr.Zero) + { + if (swigCMemOwn) + { + swigCMemOwn = false; + NDalicPINVOKE.delete_PropertyNotification(swigCPtr); + } + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); + } + + base.Dispose(type); + } + + // Callback for PropertyNotification NotifySignal + private void OnPropertyNotificationNotify(IntPtr propertyNotification) + { + NotifyEventArgs e = new NotifyEventArgs(); + e.PropertyNotification = GetPropertyNotificationFromPtr(propertyNotification); + + if (_propertyNotificationNotifyEventHandler != null) + { + //here we send all data to user event handlers + _propertyNotificationNotifyEventHandler(this, e); + } + } + + /// + /// Event arguments that passed via Notify signal + /// /// 3 - public enum NotifyMode + public class NotifyEventArgs : EventArgs { - /// - /// Don't notify, regardless of result of Condition - /// - /// 3 - Disabled, - /// - /// Notify whenever condition changes from false to true. - /// - /// 3 - NotifyOnTrue, - /// - /// Notify whenever condition changes from true to false. - /// - /// 3 - NotifyOnFalse, - /// - /// Notify whenever condition changes (false to true, and true to false) - /// + private PropertyNotification _propertyNotification; + + /// + /// PropertyNotification - is the PropertyNotification handle that has the notification properties. + /// /// 3 - NotifyOnChanged + public PropertyNotification PropertyNotification + { + get + { + return _propertyNotification; + } + set + { + _propertyNotification = value; + } + } } } diff --git a/src/Tizen.NUI/src/public/PropertyNotifySignal.cs b/src/Tizen.NUI/src/public/PropertyNotifySignal.cs index 00ed3ce..ebecdf3 100755 --- a/src/Tizen.NUI/src/public/PropertyNotifySignal.cs +++ b/src/Tizen.NUI/src/public/PropertyNotifySignal.cs @@ -24,31 +24,36 @@ namespace Tizen.NUI /// 4 public class PropertyNotifySignal : global::System.IDisposable { - private global::System.Runtime.InteropServices.HandleRef swigCPtr; /// /// swigCMemOwn /// /// 4 protected bool swigCMemOwn; + /// + /// A Flat to check if it is already disposed. + /// + /// 4 + protected bool disposed = false; - internal PropertyNotifySignal(global::System.IntPtr cPtr, bool cMemoryOwn) - { - swigCMemOwn = cMemoryOwn; - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); - } - - internal static global::System.Runtime.InteropServices.HandleRef getCPtr(PropertyNotifySignal obj) - { - return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; - } + private global::System.Runtime.InteropServices.HandleRef swigCPtr; //A Flag to check who called Dispose(). (By User or DisposeQueue) private bool isDisposeQueued = false; + /// - /// A Flat to check if it is already disposed. + /// The constructor. /// /// 4 - protected bool disposed = false; + public PropertyNotifySignal() : this(NDalicPINVOKE.new_PropertyNotifySignal(), true) + { + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + internal PropertyNotifySignal(global::System.IntPtr cPtr, bool cMemoryOwn) + { + swigCMemOwn = cMemoryOwn; + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); + } /// /// Dispose @@ -87,43 +92,6 @@ namespace Tizen.NUI } /// - /// Dispose - /// - /// The dispose type. - /// 4 - protected virtual void Dispose(DisposeTypes type) - { - if (disposed) - { - return; - } - - if (type == DisposeTypes.Explicit) - { - //Called by User - //Release your own managed resources here. - //You should release all of your own disposable objects here. - - } - - //Release your own unmanaged resources here. - //You should not access any managed member here except static instance. - //because the execution order of Finalizes is non-deterministic. - - if (swigCPtr.Handle != global::System.IntPtr.Zero) - { - if (swigCMemOwn) - { - swigCMemOwn = false; - NDalicPINVOKE.delete_PropertyNotifySignal(swigCPtr); - } - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); - } - - disposed = true; - } - - /// /// Queries whether there are any connected slots. /// /// True if there are any slots connected to the signal. @@ -186,13 +154,46 @@ namespace Tizen.NUI if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } + internal static global::System.Runtime.InteropServices.HandleRef getCPtr(PropertyNotifySignal obj) + { + return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; + } + /// - /// The constructor. + /// Dispose /// + /// The dispose type. /// 4 - public PropertyNotifySignal() : this(NDalicPINVOKE.new_PropertyNotifySignal(), true) + protected virtual void Dispose(DisposeTypes type) { - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + if (disposed) + { + return; + } + + if (type == DisposeTypes.Explicit) + { + //Called by User + //Release your own managed resources here. + //You should release all of your own disposable objects here. + + } + + //Release your own unmanaged resources here. + //You should not access any managed member here except static instance. + //because the execution order of Finalizes is non-deterministic. + + if (swigCPtr.Handle != global::System.IntPtr.Zero) + { + if (swigCMemOwn) + { + swigCMemOwn = false; + NDalicPINVOKE.delete_PropertyNotifySignal(swigCPtr); + } + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); + } + + disposed = true; } } diff --git a/src/Tizen.NUI/src/public/Radian.cs b/src/Tizen.NUI/src/public/Radian.cs index 1e7ce2c..e24e3e1 100755 --- a/src/Tizen.NUI/src/public/Radian.cs +++ b/src/Tizen.NUI/src/public/Radian.cs @@ -17,38 +17,63 @@ namespace Tizen.NUI { - /// /// An angle in radians. /// /// 3 public class Radian : global::System.IDisposable { - private global::System.Runtime.InteropServices.HandleRef swigCPtr; /// /// swigCMemOwn /// /// 3 protected bool swigCMemOwn; - internal Radian(global::System.IntPtr cPtr, bool cMemoryOwn) + /// + /// A Flat to check if it is already disposed. + /// + /// 3 + protected bool disposed = false; + + private global::System.Runtime.InteropServices.HandleRef swigCPtr; + + //A Flag to check who called Dispose(). (By User or DisposeQueue) + private bool isDisposeQueued = false; + + /// + /// The default constructor, initializes to 0. + /// + /// 3 + public Radian() : this(NDalicPINVOKE.new_Radian__SWIG_0(), true) { - swigCMemOwn = cMemoryOwn; - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } - internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Radian obj) + /// + /// Creates an angle in radians. + /// + /// The initial value in radians. + /// 3 + public Radian(float value) : this(NDalicPINVOKE.new_Radian__SWIG_1(value), true) { - return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } - //A Flag to check who called Dispose(). (By User or DisposeQueue) - private bool isDisposeQueued = false; /// - /// A Flat to check if it is already disposed. + /// Creates an angle in radians from an angle in degrees. /// + /// The initial value in degrees. /// 3 - protected bool disposed = false; + public Radian(Degree degree) : this(NDalicPINVOKE.new_Radian__SWIG_2(Degree.getCPtr(degree)), true) + { + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + internal Radian(global::System.IntPtr cPtr, bool cMemoryOwn) + { + swigCMemOwn = cMemoryOwn; + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); + } /// /// Dispose. @@ -56,7 +81,7 @@ namespace Tizen.NUI /// 3 ~Radian() { - if(!isDisposeQueued) + if (!isDisposeQueued) { isDisposeQueued = true; DisposeQueue.Instance.Add(this); @@ -64,6 +89,25 @@ namespace Tizen.NUI } /// + /// The value in radians. + /// + /// 3 + public float Value + { + set + { + NDalicPINVOKE.Radian_radian_set(swigCPtr, value); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + get + { + float ret = NDalicPINVOKE.Radian_radian_get(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + } + + /// /// Dispose. /// /// 3 @@ -87,6 +131,23 @@ namespace Tizen.NUI } /// + /// Conversion to float. + /// + /// The float value of this radian. + /// 3 + public float ConvertToFloat() + { + float ret = NDalicPINVOKE.Radian_ConvertToFloat(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Radian obj) + { + return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; + } + + /// /// Dispose. /// /// 3 @@ -119,68 +180,5 @@ namespace Tizen.NUI } disposed = true; } - - - /// - /// The default constructor, initializes to 0. - /// - /// 3 - public Radian() : this(NDalicPINVOKE.new_Radian__SWIG_0(), true) - { - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - /// - /// Creates an angle in radians. - /// - /// The initial value in radians. - /// 3 - public Radian(float value) : this(NDalicPINVOKE.new_Radian__SWIG_1(value), true) - { - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - /// - /// Creates an angle in radians from an angle in degrees. - /// - /// The initial value in degrees. - /// 3 - public Radian(Degree degree) : this(NDalicPINVOKE.new_Radian__SWIG_2(Degree.getCPtr(degree)), true) - { - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - /// - /// Conversion to float. - /// - /// The float value of this radian. - /// 3 - public float ConvertToFloat() - { - float ret = NDalicPINVOKE.Radian_ConvertToFloat(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - /// - /// The value in radians. - /// - /// 3 - public float Value - { - set - { - NDalicPINVOKE.Radian_radian_set(swigCPtr, value); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - get - { - float ret = NDalicPINVOKE.Radian_radian_get(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - } - } - } \ No newline at end of file diff --git a/src/Tizen.NUI/src/public/Rectangle.cs b/src/Tizen.NUI/src/public/Rectangle.cs index d02a394..db2bc69 100755 --- a/src/Tizen.NUI/src/public/Rectangle.cs +++ b/src/Tizen.NUI/src/public/Rectangle.cs @@ -19,7 +19,6 @@ namespace Tizen.NUI { - /// /// The Rectangle class. /// @@ -27,31 +26,50 @@ namespace Tizen.NUI [TypeConverter(typeof(RectangleTypeConverter))] public class Rectangle : global::System.IDisposable { - private global::System.Runtime.InteropServices.HandleRef swigCPtr; /// /// swigCMemOwn /// /// 3 protected bool swigCMemOwn; - internal Rectangle(global::System.IntPtr cPtr, bool cMemoryOwn) - { - swigCMemOwn = cMemoryOwn; - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); - } + /// + /// A Flat to check if it is already disposed. + /// + /// 3 + protected bool disposed = false; - internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Rectangle obj) - { - return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; - } + private global::System.Runtime.InteropServices.HandleRef swigCPtr; //A Flag to check who called Dispose(). (By User or DisposeQueue) private bool isDisposeQueued = false; + /// - /// A Flat to check if it is already disposed. + /// The constructor. /// /// 3 - protected bool disposed = false; + public Rectangle() : this(NDalicPINVOKE.new_Rectangle__SWIG_0(), true) + { + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + /// + /// The constructor. + /// + /// The x coordinate (or left). + /// The y coordinate (or right). + /// The width (or bottom). + /// The height (or top). + /// 3 + public Rectangle(int x, int y, int width, int height) : this(NDalicPINVOKE.new_Rectangle__SWIG_1(x, y, width, height), true) + { + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + internal Rectangle(global::System.IntPtr cPtr, bool cMemoryOwn) + { + swigCMemOwn = cMemoryOwn; + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); + } /// /// Dispose. @@ -59,7 +77,7 @@ namespace Tizen.NUI /// 3 ~Rectangle() { - if(!isDisposeQueued) + if (!isDisposeQueued) { isDisposeQueued = true; DisposeQueue.Instance.Add(this); @@ -67,215 +85,279 @@ namespace Tizen.NUI } /// - /// Dispose. + /// The x position of the rectangle. /// /// 3 - public void Dispose() + public int X { - //Throw excpetion if Dispose() is called in separate thread. - if (!Window.IsInstalled()) - { - throw new System.InvalidOperationException("This API called from separate thread. This API must be called from MainThread."); - } - - if (isDisposeQueued) + set { - Dispose(DisposeTypes.Implicit); + x = (value); } - else + get { - Dispose(DisposeTypes.Explicit); - System.GC.SuppressFinalize(this); + return x; } } /// - /// Dispose. + /// The Y position of the rectangle. /// /// 3 - protected virtual void Dispose(DisposeTypes type) + public int Y { - if (disposed) + set { - return; + y = (value); } - - if(type == DisposeTypes.Explicit) + get { - //Called by User - //Release your own managed resources here. - //You should release all of your own disposable objects here. + return y; } + } - //Release your own unmanaged resources here. - //You should not access any managed member here except static instance. - //because the execution order of Finalizes is non-deterministic. - - if (swigCPtr.Handle != global::System.IntPtr.Zero) + /// + /// The width of the rectangle. + /// + /// 3 + public int Width + { + set { - if (swigCMemOwn) - { - swigCMemOwn = false; - NDalicPINVOKE.delete_Rectangle(swigCPtr); - } - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); + width = (value); + } + get + { + return width; } - disposed = true; } /// - /// THe Equality operator. + /// The height of the rectangle. /// - /// The first operand. - /// The second operand. - /// True if the boxes are exactly the same. /// 3 - public static bool operator ==(Rectangle a, Rectangle b) + public int Height { - // If both are null, or both are same instance, return true. - if (System.Object.ReferenceEquals(a, b)) + set { - return true; + height = (value); } - - // If one is null, but not both, return false. - if (((object)a == null) || ((object)b == null)) + get { - return false; + return height; } - - // Return true if the fields match: - return a.X == b.X && a.Y == b.Y && a.Width == b.Width && a.Height == b.Height; } - /// - /// Equality operator. - /// - /// The object to compare with the current object. - /// True if boxes are exactly same. - /// 4 - public override bool Equals(object o) + private int x { - if(o == null) + set { - return false; + NDalicPINVOKE.Rectangle_x_set(swigCPtr, value); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } - if(!(o is Rectangle)) + get { - return false; + int ret = NDalicPINVOKE.Rectangle_x_get(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; } - Rectangle r = (Rectangle)o; + } - // Return true if the fields match: - return X == r.X && Y == r.Y && Width == r.Width && Height == r.Height; + private int left + { + set + { + NDalicPINVOKE.Rectangle_left_set(swigCPtr, value); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + get + { + int ret = NDalicPINVOKE.Rectangle_left_get(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } } - /// - /// Serves as the default hash function. - /// - /// A hash code for the current object. - /// 4 - public override int GetHashCode() + private int y { - return base.GetHashCode(); + set + { + NDalicPINVOKE.Rectangle_y_set(swigCPtr, value); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + get + { + int ret = NDalicPINVOKE.Rectangle_y_get(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } } - /// - /// Inequality operator. - /// - /// The first rectangle. - /// The second rectangle. - /// True if the rectangles are not identical. - /// 3 - public static bool operator !=(Rectangle a, Rectangle b) + private int right { - return !(a == b); + set + { + NDalicPINVOKE.Rectangle_right_set(swigCPtr, value); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + get + { + int ret = NDalicPINVOKE.Rectangle_right_get(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } } - /// - /// The x position of the rectangle. - /// - /// 3 - public int X + private int width { set { - x = ( value ); + NDalicPINVOKE.Rectangle_width_set(swigCPtr, value); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } get { - return x; + int ret = NDalicPINVOKE.Rectangle_width_get(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + } + + private int bottom + { + set + { + NDalicPINVOKE.Rectangle_bottom_set(swigCPtr, value); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } + get + { + int ret = NDalicPINVOKE.Rectangle_bottom_get(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; } + } - /// - /// The Y position of the rectangle. - /// - /// 3 - public int Y + private int height { set { - y = ( value ); + NDalicPINVOKE.Rectangle_height_set(swigCPtr, value); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } get { - return y; + int ret = NDalicPINVOKE.Rectangle_height_get(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; } } - /// - /// The width of the rectangle. - /// - /// 3 - public int Width + private int top { set { - width = ( value ); + NDalicPINVOKE.Rectangle_top_set(swigCPtr, value); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } get { - return width; + int ret = NDalicPINVOKE.Rectangle_top_get(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; } } /// - /// The height of the rectangle. + /// THe Equality operator. /// + /// The first operand. + /// The second operand. + /// True if the boxes are exactly the same. /// 3 - public int Height + public static bool operator ==(Rectangle a, Rectangle b) { - set + // If both are null, or both are same instance, return true. + if (System.Object.ReferenceEquals(a, b)) { - height = ( value ); + return true; } - get + + // If one is null, but not both, return false. + if (((object)a == null) || ((object)b == null)) { - return height; + return false; } + + // Return true if the fields match: + return a.X == b.X && a.Y == b.Y && a.Width == b.Width && a.Height == b.Height; } /// - /// The constructor. + /// Inequality operator. /// + /// The first rectangle. + /// The second rectangle. + /// True if the rectangles are not identical. /// 3 - public Rectangle() : this(NDalicPINVOKE.new_Rectangle__SWIG_0(), true) + public static bool operator !=(Rectangle a, Rectangle b) { - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return !(a == b); } /// - /// The constructor. + /// Dispose. /// - /// The x coordinate (or left). - /// The y coordinate (or right). - /// The width (or bottom). - /// The height (or top). /// 3 - public Rectangle(int x, int y, int width, int height) : this(NDalicPINVOKE.new_Rectangle__SWIG_1(x, y, width, height), true) + public void Dispose() { - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + //Throw excpetion if Dispose() is called in separate thread. + if (!Window.IsInstalled()) + { + throw new System.InvalidOperationException("This API called from separate thread. This API must be called from MainThread."); + } + + if (isDisposeQueued) + { + Dispose(DisposeTypes.Implicit); + } + else + { + Dispose(DisposeTypes.Explicit); + System.GC.SuppressFinalize(this); + } + } + + /// + /// Equality operator. + /// + /// The object to compare with the current object. + /// True if boxes are exactly same. + /// 4 + public override bool Equals(object o) + { + if(o == null) + { + return false; + } + if(!(o is Rectangle)) + { + return false; + } + Rectangle r = (Rectangle)o; + + // Return true if the fields match: + return X == r.X && Y == r.Y && Width == r.Width && Height == r.Height; + } + + /// + /// Serves as the default hash function. + /// + /// A hash code for the current object. + /// 4 + public override int GetHashCode() + { + return base.GetHashCode(); } /// @@ -390,126 +472,43 @@ namespace Tizen.NUI return ret; } - private int x - { - set - { - NDalicPINVOKE.Rectangle_x_set(swigCPtr, value); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - get - { - int ret = NDalicPINVOKE.Rectangle_x_get(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - } - - private int left - { - set - { - NDalicPINVOKE.Rectangle_left_set(swigCPtr, value); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - get - { - int ret = NDalicPINVOKE.Rectangle_left_get(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - } - - private int y - { - set - { - NDalicPINVOKE.Rectangle_y_set(swigCPtr, value); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - get - { - int ret = NDalicPINVOKE.Rectangle_y_get(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - } - - private int right + internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Rectangle obj) { - set - { - NDalicPINVOKE.Rectangle_right_set(swigCPtr, value); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - get - { - int ret = NDalicPINVOKE.Rectangle_right_get(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } + return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; } - private int width + /// + /// Dispose. + /// + /// 3 + protected virtual void Dispose(DisposeTypes type) { - set - { - NDalicPINVOKE.Rectangle_width_set(swigCPtr, value); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - get + if (disposed) { - int ret = NDalicPINVOKE.Rectangle_width_get(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; + return; } - } - private int bottom - { - set + if (type == DisposeTypes.Explicit) { - NDalicPINVOKE.Rectangle_bottom_set(swigCPtr, value); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - get - { - int ret = NDalicPINVOKE.Rectangle_bottom_get(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; + //Called by User + //Release your own managed resources here. + //You should release all of your own disposable objects here. } - } - private int height - { - set - { - NDalicPINVOKE.Rectangle_height_set(swigCPtr, value); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - get - { - int ret = NDalicPINVOKE.Rectangle_height_get(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - } + //Release your own unmanaged resources here. + //You should not access any managed member here except static instance. + //because the execution order of Finalizes is non-deterministic. - private int top - { - set - { - NDalicPINVOKE.Rectangle_top_set(swigCPtr, value); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - get + if (swigCPtr.Handle != global::System.IntPtr.Zero) { - int ret = NDalicPINVOKE.Rectangle_top_get(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; + if (swigCMemOwn) + { + swigCMemOwn = false; + NDalicPINVOKE.delete_Rectangle(swigCPtr); + } + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); } + disposed = true; } - } - } \ No newline at end of file diff --git a/src/Tizen.NUI/src/public/RelativeVector2.cs b/src/Tizen.NUI/src/public/RelativeVector2.cs index e9a4984..94f2cb8 100755 --- a/src/Tizen.NUI/src/public/RelativeVector2.cs +++ b/src/Tizen.NUI/src/public/RelativeVector2.cs @@ -19,7 +19,6 @@ namespace Tizen.NUI { - /// /// RelativeVector2 is a two-dimensional vector. /// Both values (x and y) should be between [0, 1]. @@ -28,31 +27,68 @@ namespace Tizen.NUI [TypeConverter(typeof(RelativeVector2TypeConverter))] public class RelativeVector2 : global::System.IDisposable { - private global::System.Runtime.InteropServices.HandleRef swigCPtr; /// /// swigCMemOwn /// /// 3 protected bool swigCMemOwn; - internal RelativeVector2(global::System.IntPtr cPtr, bool cMemoryOwn) + /// + /// A Flat to check if it is already disposed. + /// + /// 3 + protected bool disposed = false; + + private global::System.Runtime.InteropServices.HandleRef swigCPtr; + + //A Flag to check who called Dispose(). (By User or DisposeQueue) + private bool isDisposeQueued = false; + + /// + /// The constructor. + /// + /// 3 + public RelativeVector2() : this(NDalicPINVOKE.new_Vector2__SWIG_0(), true) { - swigCMemOwn = cMemoryOwn; - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } - internal static global::System.Runtime.InteropServices.HandleRef getCPtr(RelativeVector2 obj) + /// + /// The constructor. + /// + /// The x component. + /// The y component. + /// 3 + public RelativeVector2(float x, float y) : this(NDalicPINVOKE.new_Vector2__SWIG_1(ValueCheck(x), ValueCheck(y)), true) { - return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } - //A Flag to check who called Dispose(). (By User or DisposeQueue) - private bool isDisposeQueued = false; /// - /// A Flat to check if it is already disposed. + /// The constructor. /// + /// The RelativeVector3 to create this vector from. /// 3 - protected bool disposed = false; + public RelativeVector2(RelativeVector3 relativeVector3) : this(NDalicPINVOKE.new_Vector2__SWIG_3(RelativeVector3.getCPtr(relativeVector3)), true) + { + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + /// + /// The constructor. + /// + /// The RelativeVector4 to create this vector from. + /// 3 + public RelativeVector2(RelativeVector4 relativeVector4) : this(NDalicPINVOKE.new_Vector2__SWIG_4(RelativeVector4.getCPtr(relativeVector4)), true) + { + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + internal RelativeVector2(global::System.IntPtr cPtr, bool cMemoryOwn) + { + swigCMemOwn = cMemoryOwn; + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); + } /// /// Dispose. @@ -60,7 +96,7 @@ namespace Tizen.NUI /// 3 ~RelativeVector2() { - if(!isDisposeQueued) + if (!isDisposeQueued) { isDisposeQueued = true; DisposeQueue.Instance.Add(this); @@ -68,62 +104,47 @@ namespace Tizen.NUI } /// - /// Dispose. + /// The x component. /// /// 3 - public void Dispose() + public float X { - //Throw excpetion if Dispose() is called in separate thread. - if (!Window.IsInstalled()) - { - throw new System.InvalidOperationException("This API called from separate thread. This API must be called from MainThread."); - } - - if (isDisposeQueued) + set { - Dispose(DisposeTypes.Implicit); + NDalicPINVOKE.Vector2_X_set(swigCPtr, ValueCheck(value)); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } - else + get { - Dispose(DisposeTypes.Explicit); - System.GC.SuppressFinalize(this); + float ret = NDalicPINVOKE.Vector2_X_get(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; } } /// - /// Dispose. + /// The y component. /// /// 3 - protected virtual void Dispose(DisposeTypes type) + public float Y { - if (disposed) - { - return; - } - - if(type == DisposeTypes.Explicit) + set { - //Called by User - //Release your own managed resources here. - //You should release all of your own disposable objects here. + NDalicPINVOKE.Vector2_Y_set(swigCPtr, ValueCheck(value)); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } - - //Release your own unmanaged resources here. - //You should not access any managed member here except static instance. - //because the execution order of Finalizes is non-deterministic. - - if (swigCPtr.Handle != global::System.IntPtr.Zero) + get { - if (swigCMemOwn) - { - swigCMemOwn = false; - NDalicPINVOKE.delete_Vector2(swigCPtr); - } - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); + float ret = NDalicPINVOKE.Vector2_Y_get(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; } - disposed = true; } + internal static global::System.Runtime.InteropServices.HandleRef getCPtr(RelativeVector2 obj) + { + return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; + } /// /// The addition operator. @@ -203,119 +224,57 @@ namespace Tizen.NUI return ValueCheck(result); } - /// - /// The const array subscript operator overload. Should be 0, 1. /// - /// The subscript index. - /// The float at the given index. /// 3 - public float this[uint index] - { - get - { - return ValueOfIndex(index); - } - } - - /// - /// - internal static RelativeVector2 GetRelativeVector2FromPtr(global::System.IntPtr cPtr) + public static implicit operator Vector2(RelativeVector2 relativeVector2) { - RelativeVector2 ret = new RelativeVector2(cPtr, false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; + return new Vector2(relativeVector2.X, relativeVector2.Y); } - /// - /// The constructor. /// /// 3 - public RelativeVector2() : this(NDalicPINVOKE.new_Vector2__SWIG_0(), true) + public static implicit operator RelativeVector2(Vector2 vec) { - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return new RelativeVector2(ValueCheck(vec.X), ValueCheck(vec.Y)); } /// - /// The constructor. + /// Dispose. /// - /// The x component. - /// The y component. /// 3 - public RelativeVector2(float x, float y) : this(NDalicPINVOKE.new_Vector2__SWIG_1(ValueCheck(x), ValueCheck(y)), true) + public void Dispose() { - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } + //Throw excpetion if Dispose() is called in separate thread. + if (!Window.IsInstalled()) + { + throw new System.InvalidOperationException("This API called from separate thread. This API must be called from MainThread."); + } - /// - /// The constructor. - /// - /// The RelativeVector3 to create this vector from. - /// 3 - public RelativeVector2(RelativeVector3 relativeVector3) : this(NDalicPINVOKE.new_Vector2__SWIG_3(RelativeVector3.getCPtr(relativeVector3)), true) - { - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + if (isDisposeQueued) + { + Dispose(DisposeTypes.Implicit); + } + else + { + Dispose(DisposeTypes.Explicit); + System.GC.SuppressFinalize(this); + } } /// - /// The constructor. + /// The const array subscript operator overload. Should be 0, 1. /// - /// The RelativeVector4 to create this vector from. + /// The subscript index. + /// The float at the given index. /// 3 - public RelativeVector2(RelativeVector4 relativeVector4) : this(NDalicPINVOKE.new_Vector2__SWIG_4(RelativeVector4.getCPtr(relativeVector4)), true) - { - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - - private RelativeVector2 Add(RelativeVector2 rhs) - { - RelativeVector2 ret = new RelativeVector2(NDalicPINVOKE.Vector2_Add(swigCPtr, RelativeVector2.getCPtr(rhs)), true); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - private RelativeVector2 Subtract(RelativeVector2 rhs) - { - RelativeVector2 ret = new RelativeVector2(NDalicPINVOKE.Vector2_Subtract__SWIG_0(swigCPtr, RelativeVector2.getCPtr(rhs)), true); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - private RelativeVector2 Multiply(RelativeVector2 rhs) - { - RelativeVector2 ret = new RelativeVector2(NDalicPINVOKE.Vector2_Multiply__SWIG_0(swigCPtr, RelativeVector2.getCPtr(rhs)), true); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - private RelativeVector2 Multiply(float rhs) - { - RelativeVector2 ret = new RelativeVector2(NDalicPINVOKE.Vector2_Multiply__SWIG_1(swigCPtr, rhs), true); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - private RelativeVector2 Divide(RelativeVector2 rhs) - { - RelativeVector2 ret = new RelativeVector2(NDalicPINVOKE.Vector2_Divide__SWIG_0(swigCPtr, RelativeVector2.getCPtr(rhs)), true); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - private RelativeVector2 Divide(float rhs) - { - RelativeVector2 ret = new RelativeVector2(NDalicPINVOKE.Vector2_Divide__SWIG_1(swigCPtr, rhs), true); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - private float ValueOfIndex(uint index) + public float this[uint index] { - float ret = NDalicPINVOKE.Vector2_ValueOfIndex__SWIG_0(swigCPtr, index); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; + get + { + return ValueOfIndex(index); + } } /// @@ -370,102 +329,138 @@ namespace Tizen.NUI return ret; } - - /// - /// The x component. - /// - /// 3 - public float X - { - set - { - NDalicPINVOKE.Vector2_X_set(swigCPtr, ValueCheck(value)); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - get - { - float ret = NDalicPINVOKE.Vector2_X_get(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - } - - /// - /// The y component. - /// - /// 3 - public float Y - { - set - { - NDalicPINVOKE.Vector2_Y_set(swigCPtr, ValueCheck(value)); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - get - { - float ret = NDalicPINVOKE.Vector2_Y_get(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - } - /// /// - /// 3 - public static implicit operator Vector2(RelativeVector2 relativeVector2) - { - return new Vector2(relativeVector2.X, relativeVector2.Y); - } - - /// - /// - /// 3 - public static implicit operator RelativeVector2(Vector2 vec) + internal static RelativeVector2 GetRelativeVector2FromPtr(global::System.IntPtr cPtr) { - return new RelativeVector2(ValueCheck(vec.X), ValueCheck(vec.Y)); + RelativeVector2 ret = new RelativeVector2(cPtr, false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; } internal static RelativeVector2 ValueCheck(RelativeVector2 relativeVector2) { - if(relativeVector2.X < 0.0f) + if (relativeVector2.X < 0.0f) { relativeVector2.X = 0.0f; - NUILog.Error( "The value of Result is invalid! Should be between [0, 1]."); + NUILog.Error("The value of Result is invalid! Should be between [0, 1]."); } - else if(relativeVector2.X > 1.0f) + else if (relativeVector2.X > 1.0f) { relativeVector2.X = 1.0f; - NUILog.Error( "The value of Result is invalid! Should be between [0, 1]."); + NUILog.Error("The value of Result is invalid! Should be between [0, 1]."); } - if(relativeVector2.Y < 0.0f) + if (relativeVector2.Y < 0.0f) { relativeVector2.Y = 0.0f; - NUILog.Error( "The value of Result is invalid! Should be between [0, 1]."); + NUILog.Error("The value of Result is invalid! Should be between [0, 1]."); } - else if(relativeVector2.Y > 1.0f) + else if (relativeVector2.Y > 1.0f) { relativeVector2.Y = 1.0f; - NUILog.Error( "The value of Result is invalid! Should be between [0, 1]."); + NUILog.Error("The value of Result is invalid! Should be between [0, 1]."); } return relativeVector2; } internal static float ValueCheck(float value) { - if(value < 0.0f) + if (value < 0.0f) { value = 0.0f; - NUILog.Error( "The value of Parameters is invalid! Should be between [0, 1]."); + NUILog.Error("The value of Parameters is invalid! Should be between [0, 1]."); } - else if(value > 1.0f) + else if (value > 1.0f) { value = 1.0f; - NUILog.Error( "The value of Parameters is invalid! Should be between [0, 1]."); + NUILog.Error("The value of Parameters is invalid! Should be between [0, 1]."); } return value; } - } + /// + /// Dispose. + /// + /// 3 + protected virtual void Dispose(DisposeTypes type) + { + if (disposed) + { + return; + } + + if (type == DisposeTypes.Explicit) + { + //Called by User + //Release your own managed resources here. + //You should release all of your own disposable objects here. + } + + //Release your own unmanaged resources here. + //You should not access any managed member here except static instance. + //because the execution order of Finalizes is non-deterministic. + + if (swigCPtr.Handle != global::System.IntPtr.Zero) + { + if (swigCMemOwn) + { + swigCMemOwn = false; + NDalicPINVOKE.delete_Vector2(swigCPtr); + } + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); + } + disposed = true; + } + + private RelativeVector2 Add(RelativeVector2 rhs) + { + RelativeVector2 ret = new RelativeVector2(NDalicPINVOKE.Vector2_Add(swigCPtr, RelativeVector2.getCPtr(rhs)), true); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + private RelativeVector2 Subtract(RelativeVector2 rhs) + { + RelativeVector2 ret = new RelativeVector2(NDalicPINVOKE.Vector2_Subtract__SWIG_0(swigCPtr, RelativeVector2.getCPtr(rhs)), true); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + private RelativeVector2 Multiply(RelativeVector2 rhs) + { + RelativeVector2 ret = new RelativeVector2(NDalicPINVOKE.Vector2_Multiply__SWIG_0(swigCPtr, RelativeVector2.getCPtr(rhs)), true); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + private RelativeVector2 Multiply(float rhs) + { + RelativeVector2 ret = new RelativeVector2(NDalicPINVOKE.Vector2_Multiply__SWIG_1(swigCPtr, rhs), true); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + private RelativeVector2 Divide(RelativeVector2 rhs) + { + RelativeVector2 ret = new RelativeVector2(NDalicPINVOKE.Vector2_Divide__SWIG_0(swigCPtr, RelativeVector2.getCPtr(rhs)), true); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + private RelativeVector2 Divide(float rhs) + { + RelativeVector2 ret = new RelativeVector2(NDalicPINVOKE.Vector2_Divide__SWIG_1(swigCPtr, rhs), true); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + private float ValueOfIndex(uint index) + { + float ret = NDalicPINVOKE.Vector2_ValueOfIndex__SWIG_0(swigCPtr, index); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + } } diff --git a/src/Tizen.NUI/src/public/RelativeVector3.cs b/src/Tizen.NUI/src/public/RelativeVector3.cs index 2920c0f..aff0c0b 100755 --- a/src/Tizen.NUI/src/public/RelativeVector3.cs +++ b/src/Tizen.NUI/src/public/RelativeVector3.cs @@ -20,7 +20,6 @@ using Tizen.NUI.Binding; namespace Tizen.NUI { - /// /// RelativeVector3 is a three-dimensional vector. /// All values (x, y, z and w) should be between [0, 1]. @@ -29,31 +28,63 @@ namespace Tizen.NUI [TypeConverter(typeof(RelativeVector3TypeConverter))] public class RelativeVector3 : global::System.IDisposable { - private global::System.Runtime.InteropServices.HandleRef swigCPtr; /// /// swigCMemOwn /// /// 3 protected bool swigCMemOwn; - internal RelativeVector3(global::System.IntPtr cPtr, bool cMemoryOwn) + /// + /// A Flat to check if it is already disposed. + /// + /// 3 + protected bool disposed = false; + + private global::System.Runtime.InteropServices.HandleRef swigCPtr; + + //A Flag to check who called Dispose(). (By User or DisposeQueue) + private bool isDisposeQueued = false; + + /// + /// The constructor. + /// + /// 3 + public RelativeVector3() : this(NDalicPINVOKE.new_Vector3__SWIG_0(), true) { - swigCMemOwn = cMemoryOwn; - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } - internal static global::System.Runtime.InteropServices.HandleRef getCPtr(RelativeVector3 obj) + /// + /// The constructor. + /// + /// The x component. + /// The y component. + /// The z component. + /// 3 + public RelativeVector3(float x, float y, float z) : this(NDalicPINVOKE.new_Vector3__SWIG_1(ValueCheck(x), ValueCheck(y), ValueCheck(z)), true) { - return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } - //A Flag to check who called Dispose(). (By User or DisposeQueue) - private bool isDisposeQueued = false; /// - /// A Flat to check if it is already disposed. + /// The constructor. /// + /// The RelativeVector2 to create this vector from. /// 3 - protected bool disposed = false; + public RelativeVector3(RelativeVector2 relativeVector2) : this(NDalicPINVOKE.new_Vector3__SWIG_3(RelativeVector2.getCPtr(relativeVector2)), true) + { + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + /// + /// The constructor. + /// + /// The RelativeVector4 to create this vector from. + /// 3 + public RelativeVector3(RelativeVector4 relativeVector4) : this(NDalicPINVOKE.new_Vector3__SWIG_4(RelativeVector4.getCPtr(relativeVector4)), true) + { + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } /// /// Dispose. @@ -61,7 +92,7 @@ namespace Tizen.NUI /// 3 ~RelativeVector3() { - if(!isDisposeQueued) + if (!isDisposeQueued) { isDisposeQueued = true; DisposeQueue.Instance.Add(this); @@ -69,63 +100,62 @@ namespace Tizen.NUI } /// - /// Dispose. + /// The x component. /// /// 3 - public void Dispose() + public float X { - //Throw excpetion if Dispose() is called in separate thread. - if (!Window.IsInstalled()) - { - throw new System.InvalidOperationException("This API called from separate thread. This API must be called from MainThread."); - } - - if (isDisposeQueued) + set { - Dispose(DisposeTypes.Implicit); + NDalicPINVOKE.Vector3_X_set(swigCPtr, ValueCheck(value)); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } - else + get { - Dispose(DisposeTypes.Explicit); - System.GC.SuppressFinalize(this); + float ret = NDalicPINVOKE.Vector3_X_get(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; } } /// - /// Dispose. + /// The y component. /// /// 3 - protected virtual void Dispose(DisposeTypes type) + public float Y { - if (disposed) + set { - return; + NDalicPINVOKE.Vector3_Y_set(swigCPtr, ValueCheck(value)); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } - - if(type == DisposeTypes.Explicit) + get { - //Called by User - //Release your own managed resources here. - //You should release all of your own disposable objects here. + float ret = NDalicPINVOKE.Vector3_Y_get(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; } + } - //Release your own unmanaged resources here. - //You should not access any managed member here except static instance. - //because the execution order of Finalizes is non-deterministic. - - if (swigCPtr.Handle != global::System.IntPtr.Zero) + /// + /// The z component. + /// + /// 3 + public float Z + { + set { - if (swigCMemOwn) - { - swigCMemOwn = false; - NDalicPINVOKE.delete_Vector3(swigCPtr); - } - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); + NDalicPINVOKE.Vector3_Z_set(swigCPtr, ValueCheck(value)); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + get + { + float ret = NDalicPINVOKE.Vector3_Z_get(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; } - disposed = true; } - /// /// The addition operator. /// @@ -204,120 +234,57 @@ namespace Tizen.NUI return ValueCheck(result); } - /// - /// The const array subscript operator overload. Should be 0, 1 or 2. /// - /// The subscript index. - /// The float at the given index. /// 3 - public float this[uint index] - { - get - { - return ValueOfIndex(index); - } - } - - /// - /// - internal static RelativeVector3 GetRelativeVector3FromPtr(global::System.IntPtr cPtr) + public static implicit operator Vector3(RelativeVector3 relativeVector3) { - RelativeVector3 ret = new RelativeVector3(cPtr, false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; + return new Vector3(relativeVector3.X, relativeVector3.Y, relativeVector3.Z); } - /// - /// The constructor. /// /// 3 - public RelativeVector3() : this(NDalicPINVOKE.new_Vector3__SWIG_0(), true) + public static implicit operator RelativeVector3(Vector3 vec) { - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return new RelativeVector3(ValueCheck(vec.X), ValueCheck(vec.Y), ValueCheck(vec.Z)); } /// - /// The constructor. + /// Dispose. /// - /// The x component. - /// The y component. - /// The z component. /// 3 - public RelativeVector3(float x, float y, float z) : this(NDalicPINVOKE.new_Vector3__SWIG_1(ValueCheck(x), ValueCheck(y), ValueCheck(z)), true) + public void Dispose() { - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } + //Throw excpetion if Dispose() is called in separate thread. + if (!Window.IsInstalled()) + { + throw new System.InvalidOperationException("This API called from separate thread. This API must be called from MainThread."); + } - /// - /// The constructor. - /// - /// The RelativeVector2 to create this vector from. - /// 3 - public RelativeVector3(RelativeVector2 relativeVector2) : this(NDalicPINVOKE.new_Vector3__SWIG_3(RelativeVector2.getCPtr(relativeVector2)), true) - { - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + if (isDisposeQueued) + { + Dispose(DisposeTypes.Implicit); + } + else + { + Dispose(DisposeTypes.Explicit); + System.GC.SuppressFinalize(this); + } } /// - /// The constructor. + /// The const array subscript operator overload. Should be 0, 1 or 2. /// - /// The RelativeVector4 to create this vector from. + /// The subscript index. + /// The float at the given index. /// 3 - public RelativeVector3(RelativeVector4 relativeVector4) : this(NDalicPINVOKE.new_Vector3__SWIG_4(RelativeVector4.getCPtr(relativeVector4)), true) - { - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - - private RelativeVector3 Add(RelativeVector3 rhs) - { - RelativeVector3 ret = new RelativeVector3(NDalicPINVOKE.Vector3_Add(swigCPtr, RelativeVector3.getCPtr(rhs)), true); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - private RelativeVector3 Subtract(RelativeVector3 rhs) - { - RelativeVector3 ret = new RelativeVector3(NDalicPINVOKE.Vector3_Subtract__SWIG_0(swigCPtr, RelativeVector3.getCPtr(rhs)), true); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - private RelativeVector3 Multiply(RelativeVector3 rhs) - { - RelativeVector3 ret = new RelativeVector3(NDalicPINVOKE.Vector3_Multiply__SWIG_0(swigCPtr, RelativeVector3.getCPtr(rhs)), true); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - private RelativeVector3 Multiply(float rhs) - { - RelativeVector3 ret = new RelativeVector3(NDalicPINVOKE.Vector3_Multiply__SWIG_1(swigCPtr, rhs), true); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - private RelativeVector3 Divide(RelativeVector3 rhs) - { - RelativeVector3 ret = new RelativeVector3(NDalicPINVOKE.Vector3_Divide__SWIG_0(swigCPtr, RelativeVector3.getCPtr(rhs)), true); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - private RelativeVector3 Divide(float rhs) - { - RelativeVector3 ret = new RelativeVector3(NDalicPINVOKE.Vector3_Divide__SWIG_1(swigCPtr, rhs), true); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - private float ValueOfIndex(uint index) + public float this[uint index] { - float ret = NDalicPINVOKE.Vector3_ValueOfIndex__SWIG_0(swigCPtr, index); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; + get + { + return ValueOfIndex(index); + } } /// @@ -372,128 +339,157 @@ namespace Tizen.NUI return ret; } - - /// - /// The x component. - /// - /// 3 - public float X + internal static RelativeVector3 ValueCheck(RelativeVector3 relativeVector3) { - set + if (relativeVector3.X < 0.0f) { - NDalicPINVOKE.Vector3_X_set(swigCPtr, ValueCheck(value)); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + relativeVector3.X = 0.0f; + NUILog.Error("The value of Result is invalid! Should be between [0, 1]."); } - get + else if (relativeVector3.X > 1.0f) { - float ret = NDalicPINVOKE.Vector3_X_get(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; + relativeVector3.X = 1.0f; + NUILog.Error("The value of Result is invalid! Should be between [0, 1]."); } - } - - /// - /// The y component. - /// - /// 3 - public float Y - { - set + if (relativeVector3.Y < 0.0f) { - NDalicPINVOKE.Vector3_Y_set(swigCPtr, ValueCheck(value)); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + relativeVector3.Y = 0.0f; + NUILog.Error("The value of Result is invalid! Should be between [0, 1]."); } - get + else if (relativeVector3.Y > 1.0f) { - float ret = NDalicPINVOKE.Vector3_Y_get(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; + relativeVector3.Y = 1.0f; + NUILog.Error("The value of Result is invalid! Should be between [0, 1]."); + } + if (relativeVector3.Z < 0.0f) + { + relativeVector3.Z = 0.0f; + NUILog.Error("The value of Result is invalid! Should be between [0, 1]."); } + else if (relativeVector3.Z > 1.0f) + { + relativeVector3.Z = 1.0f; + NUILog.Error("The value of Result is invalid! Should be between [0, 1]."); + } + return relativeVector3; } - /// - /// The z component. - /// - /// 3 - public float Z + internal static float ValueCheck(float value) { - set + if (value < 0.0f) { - NDalicPINVOKE.Vector3_Z_set(swigCPtr, ValueCheck(value)); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + value = 0.0f; + NUILog.Error("The value of Parameters is invalid! Should be between [0, 1]."); } - get + else if (value > 1.0f) { - float ret = NDalicPINVOKE.Vector3_Z_get(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; + value = 1.0f; + NUILog.Error("The value of Parameters is invalid! Should be between [0, 1]."); } + return value; } /// /// - /// 3 - public static implicit operator Vector3(RelativeVector3 relativeVector3) + internal static RelativeVector3 GetRelativeVector3FromPtr(global::System.IntPtr cPtr) { - return new Vector3(relativeVector3.X, relativeVector3.Y, relativeVector3.Z); + RelativeVector3 ret = new RelativeVector3(cPtr, false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; } - /// - /// - /// 3 - public static implicit operator RelativeVector3(Vector3 vec) + internal static global::System.Runtime.InteropServices.HandleRef getCPtr(RelativeVector3 obj) { - return new RelativeVector3(ValueCheck(vec.X), ValueCheck(vec.Y), ValueCheck(vec.Z)); + return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; } - internal static RelativeVector3 ValueCheck(RelativeVector3 relativeVector3) + internal RelativeVector3(global::System.IntPtr cPtr, bool cMemoryOwn) { - if(relativeVector3.X < 0.0f) - { - relativeVector3.X = 0.0f; - NUILog.Error( "The value of Result is invalid! Should be between [0, 1]."); - } - else if(relativeVector3.X > 1.0f) - { - relativeVector3.X = 1.0f; - NUILog.Error( "The value of Result is invalid! Should be between [0, 1]."); - } - if(relativeVector3.Y < 0.0f) - { - relativeVector3.Y = 0.0f; - NUILog.Error( "The value of Result is invalid! Should be between [0, 1]."); - } - else if(relativeVector3.Y > 1.0f) + swigCMemOwn = cMemoryOwn; + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); + } + + /// + /// Dispose. + /// + /// 3 + protected virtual void Dispose(DisposeTypes type) + { + if (disposed) { - relativeVector3.Y = 1.0f; - NUILog.Error( "The value of Result is invalid! Should be between [0, 1]."); + return; } - if(relativeVector3.Z < 0.0f) + + if(type == DisposeTypes.Explicit) { - relativeVector3.Z = 0.0f; - NUILog.Error( "The value of Result is invalid! Should be between [0, 1]."); + //Called by User + //Release your own managed resources here. + //You should release all of your own disposable objects here. } - else if(relativeVector3.Z > 1.0f) + + //Release your own unmanaged resources here. + //You should not access any managed member here except static instance. + //because the execution order of Finalizes is non-deterministic. + + if (swigCPtr.Handle != global::System.IntPtr.Zero) { - relativeVector3.Z = 1.0f; - NUILog.Error( "The value of Result is invalid! Should be between [0, 1]."); + if (swigCMemOwn) + { + swigCMemOwn = false; + NDalicPINVOKE.delete_Vector3(swigCPtr); + } + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); } - return relativeVector3; + disposed = true; } - internal static float ValueCheck(float value) + private RelativeVector3 Add(RelativeVector3 rhs) { - if(value < 0.0f) - { - value = 0.0f; - NUILog.Error( "The value of Parameters is invalid! Should be between [0, 1]."); - } - else if(value > 1.0f) - { - value = 1.0f; - NUILog.Error( "The value of Parameters is invalid! Should be between [0, 1]."); - } - return value; + RelativeVector3 ret = new RelativeVector3(NDalicPINVOKE.Vector3_Add(swigCPtr, RelativeVector3.getCPtr(rhs)), true); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + private RelativeVector3 Subtract(RelativeVector3 rhs) + { + RelativeVector3 ret = new RelativeVector3(NDalicPINVOKE.Vector3_Subtract__SWIG_0(swigCPtr, RelativeVector3.getCPtr(rhs)), true); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + private RelativeVector3 Multiply(RelativeVector3 rhs) + { + RelativeVector3 ret = new RelativeVector3(NDalicPINVOKE.Vector3_Multiply__SWIG_0(swigCPtr, RelativeVector3.getCPtr(rhs)), true); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + private RelativeVector3 Multiply(float rhs) + { + RelativeVector3 ret = new RelativeVector3(NDalicPINVOKE.Vector3_Multiply__SWIG_1(swigCPtr, rhs), true); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + private RelativeVector3 Divide(RelativeVector3 rhs) + { + RelativeVector3 ret = new RelativeVector3(NDalicPINVOKE.Vector3_Divide__SWIG_0(swigCPtr, RelativeVector3.getCPtr(rhs)), true); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + private RelativeVector3 Divide(float rhs) + { + RelativeVector3 ret = new RelativeVector3(NDalicPINVOKE.Vector3_Divide__SWIG_1(swigCPtr, rhs), true); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + private float ValueOfIndex(uint index) + { + float ret = NDalicPINVOKE.Vector3_ValueOfIndex__SWIG_0(swigCPtr, index); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; } } diff --git a/src/Tizen.NUI/src/public/RelativeVector4.cs b/src/Tizen.NUI/src/public/RelativeVector4.cs index 00a0855..ec0276f 100755 --- a/src/Tizen.NUI/src/public/RelativeVector4.cs +++ b/src/Tizen.NUI/src/public/RelativeVector4.cs @@ -19,7 +19,6 @@ namespace Tizen.NUI { - /// /// RelativeVector4 is a four-dimensional vector. /// All values (x, y, and z) should be between [0, 1]. @@ -28,31 +27,64 @@ namespace Tizen.NUI [TypeConverter(typeof(RelativeVector4TypeConverter))] public class RelativeVector4 : global::System.IDisposable { - private global::System.Runtime.InteropServices.HandleRef swigCPtr; /// /// swigCMemOwn /// /// 3 protected bool swigCMemOwn; - internal RelativeVector4(global::System.IntPtr cPtr, bool cMemoryOwn) + /// + /// A Flat to check if it is already disposed. + /// + /// 3 + protected bool disposed = false; + + private global::System.Runtime.InteropServices.HandleRef swigCPtr; + + //A Flag to check who called Dispose(). (By User or DisposeQueue) + private bool isDisposeQueued = false; + + /// + /// The constructor. + /// + /// 3 + public RelativeVector4() : this(NDalicPINVOKE.new_Vector4__SWIG_0(), true) { - swigCMemOwn = cMemoryOwn; - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } - internal static global::System.Runtime.InteropServices.HandleRef getCPtr(RelativeVector4 obj) + /// + /// The constructor. + /// + /// The x component. + /// The y component. + /// The z component. + /// The w component. + /// 3 + public RelativeVector4(float x, float y, float z, float w) : this(NDalicPINVOKE.new_Vector4__SWIG_1(ValueCheck(x), ValueCheck(y), ValueCheck(z), ValueCheck(w)), true) { - return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } - //A Flag to check who called Dispose(). (By User or DisposeQueue) - private bool isDisposeQueued = false; /// - /// A Flat to check if it is already disposed. + /// The constructor. /// + /// The RelativeVector2 to create this vector from. /// 3 - protected bool disposed = false; + public RelativeVector4(RelativeVector2 relativeVector2) : this(NDalicPINVOKE.new_Vector4__SWIG_3(RelativeVector2.getCPtr(relativeVector2)), true) + { + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + /// + /// The constructor. + /// + /// The RelativeVector3 to create this vector from. + /// 3 + public RelativeVector4(RelativeVector3 relativeVector3) : this(NDalicPINVOKE.new_Vector4__SWIG_4(RelativeVector3.getCPtr(relativeVector3)), true) + { + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } /// /// Dispose. @@ -68,63 +100,81 @@ namespace Tizen.NUI } /// - /// Dispose. + /// The x component. /// /// 3 - public void Dispose() + public float X { - //Throw excpetion if Dispose() is called in separate thread. - if (!Window.IsInstalled()) + set { - throw new System.InvalidOperationException("This API called from separate thread. This API must be called from MainThread."); + NDalicPINVOKE.Vector4_X_set(swigCPtr, ValueCheck(value)); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + get + { + float ret = NDalicPINVOKE.Vector4_X_get(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; } + } - if (isDisposeQueued) + /// + /// The y component. + /// + /// 3 + public float Y + { + set { - Dispose(DisposeTypes.Implicit); + NDalicPINVOKE.Vector4_Y_set(swigCPtr, ValueCheck(value)); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } - else + get { - Dispose(DisposeTypes.Explicit); - System.GC.SuppressFinalize(this); + float ret = NDalicPINVOKE.Vector4_Y_get(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; } } /// - /// Dispose. + /// The z component. /// /// 3 - protected virtual void Dispose(DisposeTypes type) + public float Z { - if (disposed) + set { - return; + NDalicPINVOKE.Vector4_Z_set(swigCPtr, ValueCheck(value)); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } - - if(type == DisposeTypes.Explicit) + get { - //Called by User - //Release your own managed resources here. - //You should release all of your own disposable objects here. + float ret = NDalicPINVOKE.Vector4_Z_get(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; } + } - //Release your own unmanaged resources here. - //You should not access any managed member here except static instance. - //because the execution order of Finalizes is non-deterministic. - - if (swigCPtr.Handle != global::System.IntPtr.Zero) + /// + /// The w component. + /// + /// 3 + public float W + { + set { - if (swigCMemOwn) - { - swigCMemOwn = false; - NDalicPINVOKE.delete_Vector4(swigCPtr); - } - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); + NDalicPINVOKE.Vector4_W_set(swigCPtr, ValueCheck(value)); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + get + { + float ret = NDalicPINVOKE.Vector4_W_get(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; } - disposed = true; } - /// /// The addition operator. /// @@ -203,120 +253,57 @@ namespace Tizen.NUI return ValueCheck(result); } - /// - /// The const array subscript operator overload. Should be 0, 1 3 or 3. /// - /// The subscript index. - /// The float at the given index. /// 3 - public float this[uint index] - { - get - { - return ValueOfIndex(index); - } - } - - /// - /// - internal static RelativeVector4 GetRelativeVector4FromPtr(global::System.IntPtr cPtr) + public static implicit operator Vector4(RelativeVector4 relativeVector4) { - RelativeVector4 ret = new RelativeVector4(cPtr, false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; + return new Vector4(relativeVector4.X, relativeVector4.Y, relativeVector4.Z, relativeVector4.W); } - /// - /// The constructor. /// /// 3 - public RelativeVector4() : this(NDalicPINVOKE.new_Vector4__SWIG_0(), true) + public static implicit operator RelativeVector4(Vector4 vec) { - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return new RelativeVector4(ValueCheck(vec.X), ValueCheck(vec.Y), ValueCheck(vec.Z), ValueCheck(vec.W)); } /// - /// The constructor. + /// Dispose. /// - /// The x component. - /// The y component. - /// The z component. - /// The w component. /// 3 - public RelativeVector4(float x, float y, float z, float w) : this(NDalicPINVOKE.new_Vector4__SWIG_1(ValueCheck(x), ValueCheck(y),ValueCheck(z), ValueCheck(w)), true) + public void Dispose() { - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } + //Throw excpetion if Dispose() is called in separate thread. + if (!Window.IsInstalled()) + { + throw new System.InvalidOperationException("This API called from separate thread. This API must be called from MainThread."); + } - /// - /// The constructor. - /// - /// The RelativeVector2 to create this vector from. - /// 3 - public RelativeVector4(RelativeVector2 relativeVector2) : this(NDalicPINVOKE.new_Vector4__SWIG_3(RelativeVector2.getCPtr(relativeVector2)), true) - { - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + if (isDisposeQueued) + { + Dispose(DisposeTypes.Implicit); + } + else + { + Dispose(DisposeTypes.Explicit); + System.GC.SuppressFinalize(this); + } } /// - /// The constructor. + /// The const array subscript operator overload. Should be 0, 1 3 or 3. /// - /// The RelativeVector3 to create this vector from. + /// The subscript index. + /// The float at the given index. /// 3 - public RelativeVector4(RelativeVector3 relativeVector3) : this(NDalicPINVOKE.new_Vector4__SWIG_4(RelativeVector3.getCPtr(relativeVector3)), true) - { - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - private RelativeVector4 Add(RelativeVector4 rhs) - { - RelativeVector4 ret = new RelativeVector4(NDalicPINVOKE.Vector4_Add(swigCPtr, RelativeVector4.getCPtr(rhs)), true); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - private RelativeVector4 Subtract(RelativeVector4 rhs) - { - RelativeVector4 ret = new RelativeVector4(NDalicPINVOKE.Vector4_Subtract__SWIG_0(swigCPtr, RelativeVector4.getCPtr(rhs)), true); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - private RelativeVector4 Multiply(RelativeVector4 rhs) - { - RelativeVector4 ret = new RelativeVector4(NDalicPINVOKE.Vector4_Multiply__SWIG_0(swigCPtr, RelativeVector4.getCPtr(rhs)), true); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - private RelativeVector4 Multiply(float rhs) - { - RelativeVector4 ret = new RelativeVector4(NDalicPINVOKE.Vector4_Multiply__SWIG_1(swigCPtr, rhs), true); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - private RelativeVector4 Divide(RelativeVector4 rhs) - { - RelativeVector4 ret = new RelativeVector4(NDalicPINVOKE.Vector4_Divide__SWIG_0(swigCPtr, RelativeVector4.getCPtr(rhs)), true); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - private RelativeVector4 Divide(float rhs) - { - RelativeVector4 ret = new RelativeVector4(NDalicPINVOKE.Vector4_Divide__SWIG_1(swigCPtr, rhs), true); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - private float ValueOfIndex(uint index) + public float this[uint index] { - float ret = NDalicPINVOKE.Vector4_ValueOfIndex__SWIG_0(swigCPtr, index); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; + get + { + return ValueOfIndex(index); + } } /// @@ -371,159 +358,168 @@ namespace Tizen.NUI return ret; } - - /// - /// The x component. - /// - /// 3 - public float X - { - set - { - NDalicPINVOKE.Vector4_X_set(swigCPtr, ValueCheck(value)); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - get - { - float ret = NDalicPINVOKE.Vector4_X_get(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - } - - /// - /// The y component. - /// - /// 3 - public float Y - { - set - { - NDalicPINVOKE.Vector4_Y_set(swigCPtr, ValueCheck(value)); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - get - { - float ret = NDalicPINVOKE.Vector4_Y_get(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - } - /// - /// The z component. /// - /// 3 - public float Z - { - set - { - NDalicPINVOKE.Vector4_Z_set(swigCPtr, ValueCheck(value)); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - get - { - float ret = NDalicPINVOKE.Vector4_Z_get(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - } - - /// - /// The w component. - /// - /// 3 - public float W - { - set - { - NDalicPINVOKE.Vector4_W_set(swigCPtr, ValueCheck(value)); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - get - { - float ret = NDalicPINVOKE.Vector4_W_get(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - } - - /// - /// - /// 3 - public static implicit operator Vector4(RelativeVector4 relativeVector4) - { - return new Vector4(relativeVector4.X, relativeVector4.Y, relativeVector4.Z, relativeVector4.W); - } - - /// - /// - /// 3 - public static implicit operator RelativeVector4(Vector4 vec) + internal static RelativeVector4 GetRelativeVector4FromPtr(global::System.IntPtr cPtr) { - return new RelativeVector4(ValueCheck(vec.X), ValueCheck(vec.Y), ValueCheck(vec.Z), ValueCheck(vec.W)); + RelativeVector4 ret = new RelativeVector4(cPtr, false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; } internal static RelativeVector4 ValueCheck(RelativeVector4 relativeVector4) { - if(relativeVector4.X < 0.0f) + if (relativeVector4.X < 0.0f) { relativeVector4.X = 0.0f; - NUILog.Error( "The value of Result is invalid! Should be between [0, 1]."); + NUILog.Error("The value of Result is invalid! Should be between [0, 1]."); } - else if(relativeVector4.X > 1.0f) + else if (relativeVector4.X > 1.0f) { relativeVector4.X = 1.0f; - NUILog.Error( "The value of Result is invalid! Should be between [0, 1]."); + NUILog.Error("The value of Result is invalid! Should be between [0, 1]."); } - if(relativeVector4.Y < 0.0f) + if (relativeVector4.Y < 0.0f) { relativeVector4.Y = 0.0f; - NUILog.Error( "The value of Result is invalid! Should be between [0, 1]."); + NUILog.Error("The value of Result is invalid! Should be between [0, 1]."); } - else if(relativeVector4.Y > 1.0f) + else if (relativeVector4.Y > 1.0f) { relativeVector4.Y = 1.0f; - NUILog.Error( "The value of Result is invalid! Should be between [0, 1]."); + NUILog.Error("The value of Result is invalid! Should be between [0, 1]."); } - if(relativeVector4.Z < 0.0f) + if (relativeVector4.Z < 0.0f) { relativeVector4.Z = 0.0f; - NUILog.Error( "The value of Result is invalid! Should be between [0, 1]."); + NUILog.Error("The value of Result is invalid! Should be between [0, 1]."); } - else if(relativeVector4.Z > 1.0f) + else if (relativeVector4.Z > 1.0f) { relativeVector4.Z = 1.0f; - NUILog.Error( "The value of Result is invalid! Should be between [0, 1]."); + NUILog.Error("The value of Result is invalid! Should be between [0, 1]."); } - if(relativeVector4.W < 0.0f) + if (relativeVector4.W < 0.0f) { relativeVector4.W = 0.0f; - NUILog.Error( "The value of Result is invalid! Should be between [0, 1]."); + NUILog.Error("The value of Result is invalid! Should be between [0, 1]."); } - else if(relativeVector4.W > 1.0f) + else if (relativeVector4.W > 1.0f) { relativeVector4.W = 1.0f; - NUILog.Error( "The value of Result is invalid! Should be between [0, 1]."); + NUILog.Error("The value of Result is invalid! Should be between [0, 1]."); } return relativeVector4; } internal static float ValueCheck(float value) { - if(value < 0.0f) + if (value < 0.0f) { value = 0.0f; - NUILog.Error( "The value of Parameters is invalid! Should be between [0, 1]."); + NUILog.Error("The value of Parameters is invalid! Should be between [0, 1]."); } - else if(value > 1.0f) + else if (value > 1.0f) { value = 1.0f; - NUILog.Error( "The value of Parameters is invalid! Should be between [0, 1]."); + NUILog.Error("The value of Parameters is invalid! Should be between [0, 1]."); } return value; } + internal static global::System.Runtime.InteropServices.HandleRef getCPtr(RelativeVector4 obj) + { + return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; + } + + internal RelativeVector4(global::System.IntPtr cPtr, bool cMemoryOwn) + { + swigCMemOwn = cMemoryOwn; + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); + } + + /// + /// Dispose. + /// + /// 3 + protected virtual void Dispose(DisposeTypes type) + { + if (disposed) + { + return; + } + + if(type == DisposeTypes.Explicit) + { + //Called by User + //Release your own managed resources here. + //You should release all of your own disposable objects here. + } + + //Release your own unmanaged resources here. + //You should not access any managed member here except static instance. + //because the execution order of Finalizes is non-deterministic. + + if (swigCPtr.Handle != global::System.IntPtr.Zero) + { + if (swigCMemOwn) + { + swigCMemOwn = false; + NDalicPINVOKE.delete_Vector4(swigCPtr); + } + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); + } + disposed = true; + } + + private RelativeVector4 Add(RelativeVector4 rhs) + { + RelativeVector4 ret = new RelativeVector4(NDalicPINVOKE.Vector4_Add(swigCPtr, RelativeVector4.getCPtr(rhs)), true); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + private RelativeVector4 Subtract(RelativeVector4 rhs) + { + RelativeVector4 ret = new RelativeVector4(NDalicPINVOKE.Vector4_Subtract__SWIG_0(swigCPtr, RelativeVector4.getCPtr(rhs)), true); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + private RelativeVector4 Multiply(RelativeVector4 rhs) + { + RelativeVector4 ret = new RelativeVector4(NDalicPINVOKE.Vector4_Multiply__SWIG_0(swigCPtr, RelativeVector4.getCPtr(rhs)), true); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + private RelativeVector4 Multiply(float rhs) + { + RelativeVector4 ret = new RelativeVector4(NDalicPINVOKE.Vector4_Multiply__SWIG_1(swigCPtr, rhs), true); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + private RelativeVector4 Divide(RelativeVector4 rhs) + { + RelativeVector4 ret = new RelativeVector4(NDalicPINVOKE.Vector4_Divide__SWIG_0(swigCPtr, RelativeVector4.getCPtr(rhs)), true); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + private RelativeVector4 Divide(float rhs) + { + RelativeVector4 ret = new RelativeVector4(NDalicPINVOKE.Vector4_Divide__SWIG_1(swigCPtr, rhs), true); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + private float ValueOfIndex(uint index) + { + float ret = NDalicPINVOKE.Vector4_ValueOfIndex__SWIG_0(swigCPtr, index); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } } } diff --git a/src/Tizen.NUI/src/public/RelayoutContainer.cs b/src/Tizen.NUI/src/public/RelayoutContainer.cs index ecdd30b..af788c0 100755 --- a/src/Tizen.NUI/src/public/RelayoutContainer.cs +++ b/src/Tizen.NUI/src/public/RelayoutContainer.cs @@ -25,39 +25,30 @@ namespace Tizen.NUI /// 3 public class RelayoutContainer : global::System.IDisposable { - private global::System.Runtime.InteropServices.HandleRef swigCPtr; /// /// swigCMemOwn /// /// 3 protected bool swigCMemOwn; - internal RelayoutContainer(global::System.IntPtr cPtr, bool cMemoryOwn) - { - swigCMemOwn = cMemoryOwn; - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); - } - - internal static global::System.Runtime.InteropServices.HandleRef getCPtr(RelayoutContainer obj) - { - return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; - } - - //A Flag to check who called Dispose(). (By User or DisposeQueue) - private bool isDisposeQueued = false; /// /// A Flat to check if it is already disposed. /// /// 3 protected bool disposed = false; + private global::System.Runtime.InteropServices.HandleRef swigCPtr; + + //A Flag to check who called Dispose(). (By User or DisposeQueue) + private bool isDisposeQueued = false; + /// /// Dispose. /// /// 3 ~RelayoutContainer() { - if(!isDisposeQueued) + if (!isDisposeQueued) { isDisposeQueued = true; DisposeQueue.Instance.Add(this); @@ -88,6 +79,29 @@ namespace Tizen.NUI } /// + /// Adds relayout information to the container if it doesn't already exist. + /// + /// The view to relayout. + /// The size to relayout. + /// 3 + public virtual void Add(View view, Size2D size) + { + NDalicPINVOKE.RelayoutContainer_Add(swigCPtr, View.getCPtr(view), Size2D.getCPtr(size)); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + internal static global::System.Runtime.InteropServices.HandleRef getCPtr(RelayoutContainer obj) + { + return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; + } + + internal RelayoutContainer(global::System.IntPtr cPtr, bool cMemoryOwn) + { + swigCMemOwn = cMemoryOwn; + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); + } + + /// /// Dispose. /// /// 3 @@ -120,19 +134,5 @@ namespace Tizen.NUI } disposed = true; } - - /// - /// Adds relayout information to the container if it doesn't already exist. - /// - /// The view to relayout. - /// The size to relayout. - /// 3 - public virtual void Add(View view, Size2D size) - { - NDalicPINVOKE.RelayoutContainer_Add(swigCPtr, View.getCPtr(view), Size2D.getCPtr(size)); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - } - } \ No newline at end of file diff --git a/src/Tizen.NUI/src/public/Renderer.cs b/src/Tizen.NUI/src/public/Renderer.cs index e345ddd..446553b 100755 --- a/src/Tizen.NUI/src/public/Renderer.cs +++ b/src/Tizen.NUI/src/public/Renderer.cs @@ -27,401 +27,126 @@ namespace Tizen.NUI { private global::System.Runtime.InteropServices.HandleRef swigCPtr; - internal Renderer(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.Renderer_SWIGUpcast(cPtr), cMemoryOwn) + /// + /// Create an instance of Renderer. + /// + /// 3 + public Renderer(Geometry geometry, Shader shader) : this(NDalicPINVOKE.Renderer_New(Geometry.getCPtr(geometry), Shader.getCPtr(shader)), true) { - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); - } + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Renderer obj) - { - return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; } /// - /// Dispose. + /// Gets and Sets DepthIndex property. /// /// 3 - protected override void Dispose(DisposeTypes type) + public int DepthIndex { - if (disposed) + get { - return; + int temp = 0; + Tizen.NUI.Object.GetProperty(swigCPtr, Renderer.Property.DEPTH_INDEX).Get(out temp); + return temp; } - - if (type == DisposeTypes.Explicit) + set { - //Called by User - //Release your own managed resources here. - //You should release all of your own disposable objects here. - + Tizen.NUI.Object.SetProperty(swigCPtr, Renderer.Property.DEPTH_INDEX, new Tizen.NUI.PropertyValue(value)); } + } - //Release your own unmanaged resources here. - //You should not access any managed member here except static instance. - //because the execution order of Finalizes is non-deterministic. - - - if (swigCPtr.Handle != global::System.IntPtr.Zero) + /// + /// Gets and Sets FaceCullingMode. + /// + /// 3 + public int FaceCullingMode + { + get { - if (swigCMemOwn) - { - swigCMemOwn = false; - NDalicPINVOKE.delete_Renderer(swigCPtr); - } - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); + int temp = 0; + Tizen.NUI.Object.GetProperty(swigCPtr, Renderer.Property.FACE_CULLING_MODE).Get(out temp); + return temp; + } + set + { + Tizen.NUI.Object.SetProperty(swigCPtr, Renderer.Property.FACE_CULLING_MODE, new Tizen.NUI.PropertyValue(value)); } - - base.Dispose(type); } /// - /// Enumeration for instances of properties belonging to the Renderer class. + /// Gets and Sets BlendMode. /// /// 3 - public class Property + public int BlendMode { - /// - /// This should be internal, please do not use. - /// - /// 3 - public static readonly int DEPTH_INDEX = NDalicPINVOKE.Renderer_Property_DEPTH_INDEX_get(); - /// - /// This should be internal, please do not use. - /// - /// 3 - public static readonly int FACE_CULLING_MODE = NDalicPINVOKE.Renderer_Property_FACE_CULLING_MODE_get(); - /// - /// This should be internal, please do not use. - /// - /// 3 - public static readonly int BLEND_MODE = NDalicPINVOKE.Renderer_Property_BLEND_MODE_get(); - /// - /// This should be internal, please do not use. - /// - /// 3 - public static readonly int BLEND_EQUATION_RGB = NDalicPINVOKE.Renderer_Property_BLEND_EQUATION_RGB_get(); - /// - /// This should be internal, please do not use. - /// - /// 3 - public static readonly int BLEND_EQUATION_ALPHA = NDalicPINVOKE.Renderer_Property_BLEND_EQUATION_ALPHA_get(); - /// - /// This should be internal, please do not use. - /// - /// 3 - public static readonly int BLEND_FACTOR_SRC_RGB = NDalicPINVOKE.Renderer_Property_BLEND_FACTOR_SRC_RGB_get(); - /// - /// This should be internal, please do not use. - /// - /// 3 - public static readonly int BLEND_FACTOR_DEST_RGB = NDalicPINVOKE.Renderer_Property_BLEND_FACTOR_DEST_RGB_get(); - /// - /// This should be internal, please do not use. - /// - /// 3 - public static readonly int BLEND_FACTOR_SRC_ALPHA = NDalicPINVOKE.Renderer_Property_BLEND_FACTOR_SRC_ALPHA_get(); - /// - /// This should be internal, please do not use. - /// - /// 3 - public static readonly int BLEND_FACTOR_DEST_ALPHA = NDalicPINVOKE.Renderer_Property_BLEND_FACTOR_DEST_ALPHA_get(); - /// - /// This should be internal, please do not use. - /// - /// 3 - public static readonly int BLEND_COLOR = NDalicPINVOKE.Renderer_Property_BLEND_COLOR_get(); - /// - /// This should be internal, please do not use. - /// - /// 3 - public static readonly int BLEND_PRE_MULTIPLIED_ALPHA = NDalicPINVOKE.Renderer_Property_BLEND_PRE_MULTIPLIED_ALPHA_get(); - /// - /// This should be internal, please do not use. - /// - /// 3 - public static readonly int INDEX_RANGE_FIRST = NDalicPINVOKE.Renderer_Property_INDEX_RANGE_FIRST_get(); - /// - /// This should be internal, please do not use. - /// - /// 3 - public static readonly int INDEX_RANGE_COUNT = NDalicPINVOKE.Renderer_Property_INDEX_RANGE_COUNT_get(); - /// - /// This should be internal, please do not use. - /// - /// 3 - public static readonly int DEPTH_WRITE_MODE = NDalicPINVOKE.Renderer_Property_DEPTH_WRITE_MODE_get(); - /// - /// This should be internal, please do not use. - /// - /// 3 - public static readonly int DEPTH_FUNCTION = NDalicPINVOKE.Renderer_Property_DEPTH_FUNCTION_get(); - /// - /// This should be internal, please do not use. - /// - /// 3 - public static readonly int DEPTH_TEST_MODE = NDalicPINVOKE.Renderer_Property_DEPTH_TEST_MODE_get(); - /// - /// This should be internal, please do not use. - /// - /// 3 - public static readonly int RENDER_MODE = NDalicPINVOKE.Renderer_Property_RENDER_MODE_get(); - /// - /// This should be internal, please do not use. - /// - /// 3 - public static readonly int STENCIL_FUNCTION = NDalicPINVOKE.Renderer_Property_STENCIL_FUNCTION_get(); - /// - /// This should be internal, please do not use. - /// - /// 3 - public static readonly int STENCIL_FUNCTION_MASK = NDalicPINVOKE.Renderer_Property_STENCIL_FUNCTION_MASK_get(); - /// - /// This should be internal, please do not use. - /// - /// 3 - public static readonly int STENCIL_FUNCTION_REFERENCE = NDalicPINVOKE.Renderer_Property_STENCIL_FUNCTION_REFERENCE_get(); - /// - /// This should be internal, please do not use. - /// - /// 3 - public static readonly int STENCIL_MASK = NDalicPINVOKE.Renderer_Property_STENCIL_MASK_get(); - /// - /// This should be internal, please do not use. - /// - /// 3 - public static readonly int STENCIL_OPERATION_ON_FAIL = NDalicPINVOKE.Renderer_Property_STENCIL_OPERATION_ON_FAIL_get(); - /// - /// This should be internal, please do not use. - /// - /// 3 - public static readonly int STENCIL_OPERATION_ON_Z_FAIL = NDalicPINVOKE.Renderer_Property_STENCIL_OPERATION_ON_Z_FAIL_get(); - /// - /// This should be internal, please do not use. - /// - /// 3 - public static readonly int STENCIL_OPERATION_ON_Z_PASS = NDalicPINVOKE.Renderer_Property_STENCIL_OPERATION_ON_Z_PASS_get(); - + get + { + int temp = 0; + Tizen.NUI.Object.GetProperty(swigCPtr, Renderer.Property.BLEND_MODE).Get(out temp); + return temp; + } + set + { + Tizen.NUI.Object.SetProperty(swigCPtr, Renderer.Property.BLEND_MODE, new Tizen.NUI.PropertyValue(value)); + } } /// - /// Create an instance of Renderer. + /// Gets and Sets BlendEquationRgb. /// /// 3 - public Renderer(Geometry geometry, Shader shader) : this(NDalicPINVOKE.Renderer_New(Geometry.getCPtr(geometry), Shader.getCPtr(shader)), true) + public int BlendEquationRgb { - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - + get + { + int temp = 0; + Tizen.NUI.Object.GetProperty(swigCPtr, Renderer.Property.BLEND_EQUATION_RGB).Get(out temp); + return temp; + } + set + { + Tizen.NUI.Object.SetProperty(swigCPtr, Renderer.Property.BLEND_EQUATION_RGB, new Tizen.NUI.PropertyValue(value)); + } } /// - /// Sets the geometry to be used by this renderer. + /// Gets and Sets BlendEquationAlpha. /// - /// The geometry to be used by this renderer. /// 3 - public void SetGeometry(Geometry geometry) + public int BlendEquationAlpha { - NDalicPINVOKE.Renderer_SetGeometry(swigCPtr, Geometry.getCPtr(geometry)); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + get + { + int temp = 0; + Tizen.NUI.Object.GetProperty(swigCPtr, Renderer.Property.BLEND_EQUATION_ALPHA).Get(out temp); + return temp; + } + set + { + Tizen.NUI.Object.SetProperty(swigCPtr, Renderer.Property.BLEND_EQUATION_ALPHA, new Tizen.NUI.PropertyValue(value)); + } } /// - /// Gets the geometry used by this renderer. + /// Gets and Sets BlendFactorSrcRgb. /// - /// The geometry used by the renderer. /// 3 - public Geometry GetGeometry() + public int BlendFactorSrcRgb { - //to fix memory leak issue, match the handle count with native side. - System.IntPtr cPtr = NDalicPINVOKE.Renderer_GetGeometry(swigCPtr); - HandleRef CPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); - Geometry ret = Registry.GetManagedBaseHandleFromNativePtr(CPtr.Handle) as Geometry; - NDalicPINVOKE.delete_BaseHandle(CPtr); - CPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); - - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; + get + { + int temp = 0; + Tizen.NUI.Object.GetProperty(swigCPtr, Renderer.Property.BLEND_FACTOR_SRC_RGB).Get(out temp); + return temp; + } + set + { + Tizen.NUI.Object.SetProperty(swigCPtr, Renderer.Property.BLEND_FACTOR_SRC_RGB, new Tizen.NUI.PropertyValue(value)); + } } /// - /// Sets effective range of indices to draw from bound index buffer. - /// - /// The First element to draw. - /// The number of elements to draw. - /// 3 - public void SetIndexRange(int firstElement, int elementsCount) - { - NDalicPINVOKE.Renderer_SetIndexRange(swigCPtr, firstElement, elementsCount); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - /// - /// Sets the texture set to be used by this renderer. - /// - /// The texture set to be used by this renderer. - /// 3 - public void SetTextures(TextureSet textureSet) - { - NDalicPINVOKE.Renderer_SetTextures(swigCPtr, TextureSet.getCPtr(textureSet)); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - /// - /// Gets the texture set used by this renderer. - /// - /// The texture set used by the renderer. - /// 3 - public TextureSet GetTextures() - { - //to fix memory leak issue, match the handle count with native side. - System.IntPtr cPtr = NDalicPINVOKE.Renderer_GetTextures(swigCPtr); - HandleRef CPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); - TextureSet ret = Registry.GetManagedBaseHandleFromNativePtr(CPtr.Handle) as TextureSet; - NDalicPINVOKE.delete_BaseHandle(CPtr); - CPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); - - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - /// - /// Sets the shader used by this renderer. - /// - /// The shader to be used by this renderer. - /// 3 - public void SetShader(Shader shader) - { - NDalicPINVOKE.Renderer_SetShader(swigCPtr, Shader.getCPtr(shader)); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - /// - /// Gets the shader used by this renderer. - /// - /// The shader used by the renderer. - /// 3 - public Shader GetShader() - { - //to fix memory leak issue, match the handle count with native side. - System.IntPtr cPtr = NDalicPINVOKE.Renderer_GetShader(swigCPtr); - HandleRef CPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); - Shader ret = Registry.GetManagedBaseHandleFromNativePtr(CPtr.Handle) as Shader; - NDalicPINVOKE.delete_BaseHandle(CPtr); - CPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); - - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - /// - /// Gets and Sets DepthIndex property. - /// - /// 3 - public int DepthIndex - { - get - { - int temp = 0; - Tizen.NUI.Object.GetProperty(swigCPtr, Renderer.Property.DEPTH_INDEX).Get(out temp); - return temp; - } - set - { - Tizen.NUI.Object.SetProperty(swigCPtr, Renderer.Property.DEPTH_INDEX, new Tizen.NUI.PropertyValue(value)); - } - } - - /// - /// Gets and Sets FaceCullingMode. - /// - /// 3 - public int FaceCullingMode - { - get - { - int temp = 0; - Tizen.NUI.Object.GetProperty(swigCPtr, Renderer.Property.FACE_CULLING_MODE).Get(out temp); - return temp; - } - set - { - Tizen.NUI.Object.SetProperty(swigCPtr, Renderer.Property.FACE_CULLING_MODE, new Tizen.NUI.PropertyValue(value)); - } - } - - /// - /// Gets and Sets BlendMode. - /// - /// 3 - public int BlendMode - { - get - { - int temp = 0; - Tizen.NUI.Object.GetProperty(swigCPtr, Renderer.Property.BLEND_MODE).Get(out temp); - return temp; - } - set - { - Tizen.NUI.Object.SetProperty(swigCPtr, Renderer.Property.BLEND_MODE, new Tizen.NUI.PropertyValue(value)); - } - } - - /// - /// Gets and Sets BlendEquationRgb. - /// - /// 3 - public int BlendEquationRgb - { - get - { - int temp = 0; - Tizen.NUI.Object.GetProperty(swigCPtr, Renderer.Property.BLEND_EQUATION_RGB).Get(out temp); - return temp; - } - set - { - Tizen.NUI.Object.SetProperty(swigCPtr, Renderer.Property.BLEND_EQUATION_RGB, new Tizen.NUI.PropertyValue(value)); - } - } - - /// - /// Gets and Sets BlendEquationAlpha. - /// - /// 3 - public int BlendEquationAlpha - { - get - { - int temp = 0; - Tizen.NUI.Object.GetProperty(swigCPtr, Renderer.Property.BLEND_EQUATION_ALPHA).Get(out temp); - return temp; - } - set - { - Tizen.NUI.Object.SetProperty(swigCPtr, Renderer.Property.BLEND_EQUATION_ALPHA, new Tizen.NUI.PropertyValue(value)); - } - } - - /// - /// Gets and Sets BlendFactorSrcRgb. - /// - /// 3 - public int BlendFactorSrcRgb - { - get - { - int temp = 0; - Tizen.NUI.Object.GetProperty(swigCPtr, Renderer.Property.BLEND_FACTOR_SRC_RGB).Get(out temp); - return temp; - } - set - { - Tizen.NUI.Object.SetProperty(swigCPtr, Renderer.Property.BLEND_FACTOR_SRC_RGB, new Tizen.NUI.PropertyValue(value)); - } - } - - /// - /// Gets and Sets BlendFactorDestRgb. + /// Gets and Sets BlendFactorDestRgb. /// /// 3 public int BlendFactorDestRgb @@ -744,6 +469,278 @@ namespace Tizen.NUI } } - } + /// + /// Sets the geometry to be used by this renderer. + /// + /// The geometry to be used by this renderer. + /// 3 + public void SetGeometry(Geometry geometry) + { + NDalicPINVOKE.Renderer_SetGeometry(swigCPtr, Geometry.getCPtr(geometry)); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + /// + /// Gets the geometry used by this renderer. + /// + /// The geometry used by the renderer. + /// 3 + public Geometry GetGeometry() + { + //to fix memory leak issue, match the handle count with native side. + System.IntPtr cPtr = NDalicPINVOKE.Renderer_GetGeometry(swigCPtr); + HandleRef CPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); + Geometry ret = Registry.GetManagedBaseHandleFromNativePtr(CPtr.Handle) as Geometry; + NDalicPINVOKE.delete_BaseHandle(CPtr); + CPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); + + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + /// + /// Sets effective range of indices to draw from bound index buffer. + /// + /// The First element to draw. + /// The number of elements to draw. + /// 3 + public void SetIndexRange(int firstElement, int elementsCount) + { + NDalicPINVOKE.Renderer_SetIndexRange(swigCPtr, firstElement, elementsCount); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + /// + /// Sets the texture set to be used by this renderer. + /// + /// The texture set to be used by this renderer. + /// 3 + public void SetTextures(TextureSet textureSet) + { + NDalicPINVOKE.Renderer_SetTextures(swigCPtr, TextureSet.getCPtr(textureSet)); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + /// + /// Gets the texture set used by this renderer. + /// + /// The texture set used by the renderer. + /// 3 + public TextureSet GetTextures() + { + //to fix memory leak issue, match the handle count with native side. + System.IntPtr cPtr = NDalicPINVOKE.Renderer_GetTextures(swigCPtr); + HandleRef CPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); + TextureSet ret = Registry.GetManagedBaseHandleFromNativePtr(CPtr.Handle) as TextureSet; + NDalicPINVOKE.delete_BaseHandle(CPtr); + CPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); + + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + /// + /// Sets the shader used by this renderer. + /// + /// The shader to be used by this renderer. + /// 3 + public void SetShader(Shader shader) + { + NDalicPINVOKE.Renderer_SetShader(swigCPtr, Shader.getCPtr(shader)); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + /// + /// Gets the shader used by this renderer. + /// + /// The shader used by the renderer. + /// 3 + public Shader GetShader() + { + //to fix memory leak issue, match the handle count with native side. + System.IntPtr cPtr = NDalicPINVOKE.Renderer_GetShader(swigCPtr); + HandleRef CPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); + Shader ret = Registry.GetManagedBaseHandleFromNativePtr(CPtr.Handle) as Shader; + NDalicPINVOKE.delete_BaseHandle(CPtr); + CPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); + + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Renderer obj) + { + return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; + } + + internal Renderer(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.Renderer_SWIGUpcast(cPtr), cMemoryOwn) + { + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); + } + + /// + /// Dispose. + /// + /// 3 + protected override void Dispose(DisposeTypes type) + { + if (disposed) + { + return; + } + + if (type == DisposeTypes.Explicit) + { + //Called by User + //Release your own managed resources here. + //You should release all of your own disposable objects here. + + } + + //Release your own unmanaged resources here. + //You should not access any managed member here except static instance. + //because the execution order of Finalizes is non-deterministic. + + + if (swigCPtr.Handle != global::System.IntPtr.Zero) + { + if (swigCMemOwn) + { + swigCMemOwn = false; + NDalicPINVOKE.delete_Renderer(swigCPtr); + } + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); + } + + base.Dispose(type); + } + + /// + /// Enumeration for instances of properties belonging to the Renderer class. + /// + /// 3 + public class Property + { + /// + /// This should be internal, please do not use. + /// + /// 3 + public static readonly int DEPTH_INDEX = NDalicPINVOKE.Renderer_Property_DEPTH_INDEX_get(); + /// + /// This should be internal, please do not use. + /// + /// 3 + public static readonly int FACE_CULLING_MODE = NDalicPINVOKE.Renderer_Property_FACE_CULLING_MODE_get(); + /// + /// This should be internal, please do not use. + /// + /// 3 + public static readonly int BLEND_MODE = NDalicPINVOKE.Renderer_Property_BLEND_MODE_get(); + /// + /// This should be internal, please do not use. + /// + /// 3 + public static readonly int BLEND_EQUATION_RGB = NDalicPINVOKE.Renderer_Property_BLEND_EQUATION_RGB_get(); + /// + /// This should be internal, please do not use. + /// + /// 3 + public static readonly int BLEND_EQUATION_ALPHA = NDalicPINVOKE.Renderer_Property_BLEND_EQUATION_ALPHA_get(); + /// + /// This should be internal, please do not use. + /// + /// 3 + public static readonly int BLEND_FACTOR_SRC_RGB = NDalicPINVOKE.Renderer_Property_BLEND_FACTOR_SRC_RGB_get(); + /// + /// This should be internal, please do not use. + /// + /// 3 + public static readonly int BLEND_FACTOR_DEST_RGB = NDalicPINVOKE.Renderer_Property_BLEND_FACTOR_DEST_RGB_get(); + /// + /// This should be internal, please do not use. + /// + /// 3 + public static readonly int BLEND_FACTOR_SRC_ALPHA = NDalicPINVOKE.Renderer_Property_BLEND_FACTOR_SRC_ALPHA_get(); + /// + /// This should be internal, please do not use. + /// + /// 3 + public static readonly int BLEND_FACTOR_DEST_ALPHA = NDalicPINVOKE.Renderer_Property_BLEND_FACTOR_DEST_ALPHA_get(); + /// + /// This should be internal, please do not use. + /// + /// 3 + public static readonly int BLEND_COLOR = NDalicPINVOKE.Renderer_Property_BLEND_COLOR_get(); + /// + /// This should be internal, please do not use. + /// + /// 3 + public static readonly int BLEND_PRE_MULTIPLIED_ALPHA = NDalicPINVOKE.Renderer_Property_BLEND_PRE_MULTIPLIED_ALPHA_get(); + /// + /// This should be internal, please do not use. + /// + /// 3 + public static readonly int INDEX_RANGE_FIRST = NDalicPINVOKE.Renderer_Property_INDEX_RANGE_FIRST_get(); + /// + /// This should be internal, please do not use. + /// + /// 3 + public static readonly int INDEX_RANGE_COUNT = NDalicPINVOKE.Renderer_Property_INDEX_RANGE_COUNT_get(); + /// + /// This should be internal, please do not use. + /// + /// 3 + public static readonly int DEPTH_WRITE_MODE = NDalicPINVOKE.Renderer_Property_DEPTH_WRITE_MODE_get(); + /// + /// This should be internal, please do not use. + /// + /// 3 + public static readonly int DEPTH_FUNCTION = NDalicPINVOKE.Renderer_Property_DEPTH_FUNCTION_get(); + /// + /// This should be internal, please do not use. + /// + /// 3 + public static readonly int DEPTH_TEST_MODE = NDalicPINVOKE.Renderer_Property_DEPTH_TEST_MODE_get(); + /// + /// This should be internal, please do not use. + /// + /// 3 + public static readonly int RENDER_MODE = NDalicPINVOKE.Renderer_Property_RENDER_MODE_get(); + /// + /// This should be internal, please do not use. + /// + /// 3 + public static readonly int STENCIL_FUNCTION = NDalicPINVOKE.Renderer_Property_STENCIL_FUNCTION_get(); + /// + /// This should be internal, please do not use. + /// + /// 3 + public static readonly int STENCIL_FUNCTION_MASK = NDalicPINVOKE.Renderer_Property_STENCIL_FUNCTION_MASK_get(); + /// + /// This should be internal, please do not use. + /// + /// 3 + public static readonly int STENCIL_FUNCTION_REFERENCE = NDalicPINVOKE.Renderer_Property_STENCIL_FUNCTION_REFERENCE_get(); + /// + /// This should be internal, please do not use. + /// + /// 3 + public static readonly int STENCIL_MASK = NDalicPINVOKE.Renderer_Property_STENCIL_MASK_get(); + /// + /// This should be internal, please do not use. + /// + /// 3 + public static readonly int STENCIL_OPERATION_ON_FAIL = NDalicPINVOKE.Renderer_Property_STENCIL_OPERATION_ON_FAIL_get(); + /// + /// This should be internal, please do not use. + /// + /// 3 + public static readonly int STENCIL_OPERATION_ON_Z_FAIL = NDalicPINVOKE.Renderer_Property_STENCIL_OPERATION_ON_Z_FAIL_get(); + /// + /// This should be internal, please do not use. + /// + /// 3 + public static readonly int STENCIL_OPERATION_ON_Z_PASS = NDalicPINVOKE.Renderer_Property_STENCIL_OPERATION_ON_Z_PASS_get(); + } + } } \ No newline at end of file diff --git a/src/Tizen.NUI/src/public/Rotation.cs b/src/Tizen.NUI/src/public/Rotation.cs index 50ec032..ac37b1a 100755 --- a/src/Tizen.NUI/src/public/Rotation.cs +++ b/src/Tizen.NUI/src/public/Rotation.cs @@ -19,7 +19,6 @@ namespace Tizen.NUI { - /// /// The Rotation class. /// @@ -27,100 +26,70 @@ namespace Tizen.NUI [TypeConverter(typeof(RotationTypeConverter))] public class Rotation : global::System.IDisposable { - private global::System.Runtime.InteropServices.HandleRef swigCPtr; /// /// swigCMemOwn /// /// 3 protected bool swigCMemOwn; - internal Rotation(global::System.IntPtr cPtr, bool cMemoryOwn) - { - swigCMemOwn = cMemoryOwn; - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); - } - - internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Rotation obj) - { - return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; - } - - //A Flag to check who called Dispose(). (By User or DisposeQueue) - private bool isDisposeQueued = false; /// /// A Flat to check if it is already disposed. /// /// 3 protected bool disposed = false; + private global::System.Runtime.InteropServices.HandleRef swigCPtr; + + //A Flag to check who called Dispose(). (By User or DisposeQueue) + private bool isDisposeQueued = false; + + /// - /// Dispose. + /// The default constructor. /// /// 3 - ~Rotation() + public Rotation() : this(NDalicPINVOKE.new_Rotation__SWIG_0(), true) { - if(!isDisposeQueued) - { - isDisposeQueued = true; - DisposeQueue.Instance.Add(this); - } + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } /// - /// To make the Rotation instance be disposed. + /// The constructor from an axis and angle. /// + /// The angle around the axis. + /// The vector of the axis. /// 3 - public void Dispose() + public Rotation(Radian angle, Vector3 axis) : this(NDalicPINVOKE.new_Rotation__SWIG_1(Radian.getCPtr(angle), Vector3.getCPtr(axis)), true) { - //Throw excpetion if Dispose() is called in separate thread. - if (!Window.IsInstalled()) - { - throw new System.InvalidOperationException("This API called from separate thread. This API must be called from MainThread."); - } - - if (isDisposeQueued) - { - Dispose(DisposeTypes.Implicit); - } - else - { - Dispose(DisposeTypes.Explicit); - System.GC.SuppressFinalize(this); - } + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } /// /// Dispose. /// /// 3 - protected virtual void Dispose(DisposeTypes type) + ~Rotation() { - if (disposed) - { - return; - } - - if(type == DisposeTypes.Explicit) + if(!isDisposeQueued) { - //Called by User - //Release your own managed resources here. - //You should release all of your own disposable objects here. + isDisposeQueued = true; + DisposeQueue.Instance.Add(this); } + } - //Release your own unmanaged resources here. - //You should not access any managed member here except static instance. - //because the execution order of Finalizes is non-deterministic. - - if (swigCPtr.Handle != global::System.IntPtr.Zero) + /// + /// (0.0f,0.0f,0.0f,1.0f). + /// + /// 3 + public static Rotation IDENTITY + { + get { - if (swigCMemOwn) - { - swigCMemOwn = false; - NDalicPINVOKE.delete_Rotation(swigCPtr); - } - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); + global::System.IntPtr cPtr = NDalicPINVOKE.Rotation_IDENTITY_get(); + Rotation ret = (cPtr == global::System.IntPtr.Zero) ? null : new Rotation(cPtr, false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; } - disposed = true; } /// @@ -219,167 +188,140 @@ namespace Tizen.NUI } /// - /// The default constructor. + /// Returns the dot product of two rotations. /// + /// The first rotation. + /// The second rotation. + /// The dot product of the two rotations. /// 3 - public Rotation() : this(NDalicPINVOKE.new_Rotation__SWIG_0(), true) + public static float Dot(Rotation q1, Rotation q2) { + float ret = NDalicPINVOKE.Rotation_Dot(Rotation.getCPtr(q1), Rotation.getCPtr(q2)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; } /// - /// The constructor from an axis and angle. + /// The linear iterpolation (using a straight line between the two rotations). /// - /// The angle around the axis. - /// The vector of the axis. + /// The start rotation. + /// The end rotation. + /// A progress value between 0 and 1. + /// The interpolated rotation. /// 3 - public Rotation(Radian angle, Vector3 axis) : this(NDalicPINVOKE.new_Rotation__SWIG_1(Radian.getCPtr(angle), Vector3.getCPtr(axis)), true) + public static Rotation Lerp(Rotation q1, Rotation q2, float t) { + Rotation ret = new Rotation(NDalicPINVOKE.Rotation_Lerp(Rotation.getCPtr(q1), Rotation.getCPtr(q2), t), true); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; } /// - /// (0.0f,0.0f,0.0f,1.0f). + /// The spherical linear interpolation (using the shortest arc of a great circle between the two rotations). /// + /// The start rotation. + /// The end rotation. + /// A progress value between 0 and 1. + /// The interpolated rotation. /// 3 - public static Rotation IDENTITY + public static Rotation Slerp(Rotation q1, Rotation q2, float progress) { - get - { - global::System.IntPtr cPtr = NDalicPINVOKE.Rotation_IDENTITY_get(); - Rotation ret = (cPtr == global::System.IntPtr.Zero) ? null : new Rotation(cPtr, false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } + Rotation ret = new Rotation(NDalicPINVOKE.Rotation_Slerp(Rotation.getCPtr(q1), Rotation.getCPtr(q2), progress), true); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; } /// - /// Helper to check if this is an identity quaternion. + /// This version of slerp, used by squad, does not check for theta > 90. /// - /// True if this is identity quaternion. + /// The start rotation. + /// The end rotation. + /// A progress value between 0 and 1. + /// The interpolated rotation. /// 3 - public bool IsIdentity() + public static Rotation SlerpNoInvert(Rotation q1, Rotation q2, float t) { - bool ret = NDalicPINVOKE.Rotation_IsIdentity(swigCPtr); + Rotation ret = new Rotation(NDalicPINVOKE.Rotation_SlerpNoInvert(Rotation.getCPtr(q1), Rotation.getCPtr(q2), t), true); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } /// - /// Converts the quaternion to an axis or angle pair. + /// The spherical cubic interpolation. /// - /// The result of an an axis. - /// The result of angle in radians. - /// True if converted correctly. + /// The start rotation. + /// The end rotation. + /// The control rotation for q1. + /// The control rotation for q2. + /// A progress value between 0 and 1. + /// The interpolated rotation. /// 3 - public bool GetAxisAngle(Vector3 axis, Radian angle) - { - bool ret = NDalicPINVOKE.Rotation_GetAxisAngle(swigCPtr, Vector3.getCPtr(axis), Radian.getCPtr(angle)); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - private Rotation Add(Rotation other) - { - Rotation ret = new Rotation(NDalicPINVOKE.Rotation_Add(swigCPtr, Rotation.getCPtr(other)), true); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - private Rotation Subtract(Rotation other) - { - Rotation ret = new Rotation(NDalicPINVOKE.Rotation_Subtract__SWIG_0(swigCPtr, Rotation.getCPtr(other)), true); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - private Rotation Multiply(Rotation other) - { - Rotation ret = new Rotation(NDalicPINVOKE.Rotation_Multiply__SWIG_0(swigCPtr, Rotation.getCPtr(other)), true); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - private Vector3 Multiply(Vector3 other) - { - Vector3 ret = new Vector3(NDalicPINVOKE.Rotation_Multiply__SWIG_1(swigCPtr, Vector3.getCPtr(other)), true); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - private Rotation Divide(Rotation other) - { - Rotation ret = new Rotation(NDalicPINVOKE.Rotation_Divide__SWIG_0(swigCPtr, Rotation.getCPtr(other)), true); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - private Rotation Multiply(float scale) - { - Rotation ret = new Rotation(NDalicPINVOKE.Rotation_Multiply__SWIG_2(swigCPtr, scale), true); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - private Rotation Divide(float scale) - { - Rotation ret = new Rotation(NDalicPINVOKE.Rotation_Divide__SWIG_1(swigCPtr, scale), true); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - private Rotation Subtract() - { - Rotation ret = new Rotation(NDalicPINVOKE.Rotation_Subtract__SWIG_1(swigCPtr), true); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - private Rotation AddAssign(Rotation other) - { - Rotation ret = new Rotation(NDalicPINVOKE.Rotation_AddAssign(swigCPtr, Rotation.getCPtr(other)), false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - private Rotation SubtractAssign(Rotation other) + public static Rotation Squad(Rotation start, Rotation end, Rotation ctrl1, Rotation ctrl2, float t) { - Rotation ret = new Rotation(NDalicPINVOKE.Rotation_SubtractAssign(swigCPtr, Rotation.getCPtr(other)), false); + Rotation ret = new Rotation(NDalicPINVOKE.Rotation_Squad(Rotation.getCPtr(start), Rotation.getCPtr(end), Rotation.getCPtr(ctrl1), Rotation.getCPtr(ctrl2), t), true); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } - private Rotation MultiplyAssign(Rotation other) + /// + /// Returns the shortest angle between two rotations in radians. + /// + /// The first rotation. + /// The second rotation. + /// The angle between the two rotation. + /// 3 + public static float AngleBetween(Rotation q1, Rotation q2) { - Rotation ret = new Rotation(NDalicPINVOKE.Rotation_MultiplyAssign__SWIG_0(swigCPtr, Rotation.getCPtr(other)), false); + float ret = NDalicPINVOKE.Rotation_AngleBetween(Rotation.getCPtr(q1), Rotation.getCPtr(q2)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } - private Rotation MultiplyAssign(float scale) + /// + /// To make the Rotation instance be disposed. + /// + /// 3 + public void Dispose() { - Rotation ret = new Rotation(NDalicPINVOKE.Rotation_MultiplyAssign__SWIG_1(swigCPtr, scale), false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } + //Throw excpetion if Dispose() is called in separate thread. + if (!Window.IsInstalled()) + { + throw new System.InvalidOperationException("This API called from separate thread. This API must be called from MainThread."); + } - private Rotation DivideAssign(float scale) - { - Rotation ret = new Rotation(NDalicPINVOKE.Rotation_DivideAssign(swigCPtr, scale), false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; + if (isDisposeQueued) + { + Dispose(DisposeTypes.Implicit); + } + else + { + Dispose(DisposeTypes.Explicit); + System.GC.SuppressFinalize(this); + } } - private bool EqualTo(Rotation rhs) + /// + /// Helper to check if this is an identity quaternion. + /// + /// True if this is identity quaternion. + /// 3 + public bool IsIdentity() { - bool ret = NDalicPINVOKE.Rotation_EqualTo(swigCPtr, Rotation.getCPtr(rhs)); + bool ret = NDalicPINVOKE.Rotation_IsIdentity(swigCPtr); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } - private bool NotEqualTo(Rotation rhs) + /// + /// Converts the quaternion to an axis or angle pair. + /// + /// The result of an an axis. + /// The result of angle in radians. + /// True if converted correctly. + /// 3 + public bool GetAxisAngle(Vector3 axis, Radian angle) { - bool ret = NDalicPINVOKE.Rotation_NotEqualTo(swigCPtr, Rotation.getCPtr(rhs)); + bool ret = NDalicPINVOKE.Rotation_GetAxisAngle(swigCPtr, Vector3.getCPtr(axis), Radian.getCPtr(angle)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } @@ -474,96 +416,154 @@ namespace Tizen.NUI return ret; } + internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Rotation obj) + { + return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; + } + + internal Rotation(global::System.IntPtr cPtr, bool cMemoryOwn) + { + swigCMemOwn = cMemoryOwn; + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); + } + /// - /// Returns the dot product of two rotations. + /// Dispose. /// - /// The first rotation. - /// The second rotation. - /// The dot product of the two rotations. /// 3 - public static float Dot(Rotation q1, Rotation q2) + protected virtual void Dispose(DisposeTypes type) { - float ret = NDalicPINVOKE.Rotation_Dot(Rotation.getCPtr(q1), Rotation.getCPtr(q2)); + if (disposed) + { + return; + } + + if(type == DisposeTypes.Explicit) + { + //Called by User + //Release your own managed resources here. + //You should release all of your own disposable objects here. + } + + //Release your own unmanaged resources here. + //You should not access any managed member here except static instance. + //because the execution order of Finalizes is non-deterministic. + + if (swigCPtr.Handle != global::System.IntPtr.Zero) + { + if (swigCMemOwn) + { + swigCMemOwn = false; + NDalicPINVOKE.delete_Rotation(swigCPtr); + } + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); + } + disposed = true; + } + + private Rotation Add(Rotation other) + { + Rotation ret = new Rotation(NDalicPINVOKE.Rotation_Add(swigCPtr, Rotation.getCPtr(other)), true); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } - /// - /// The linear iterpolation (using a straight line between the two rotations). - /// - /// The start rotation. - /// The end rotation. - /// A progress value between 0 and 1. - /// The interpolated rotation. - /// 3 - public static Rotation Lerp(Rotation q1, Rotation q2, float t) + private Rotation Subtract(Rotation other) { - Rotation ret = new Rotation(NDalicPINVOKE.Rotation_Lerp(Rotation.getCPtr(q1), Rotation.getCPtr(q2), t), true); + Rotation ret = new Rotation(NDalicPINVOKE.Rotation_Subtract__SWIG_0(swigCPtr, Rotation.getCPtr(other)), true); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } - /// - /// The spherical linear interpolation (using the shortest arc of a great circle between the two rotations). - /// - /// The start rotation. - /// The end rotation. - /// A progress value between 0 and 1. - /// The interpolated rotation. - /// 3 - public static Rotation Slerp(Rotation q1, Rotation q2, float progress) + private Rotation Multiply(Rotation other) { - Rotation ret = new Rotation(NDalicPINVOKE.Rotation_Slerp(Rotation.getCPtr(q1), Rotation.getCPtr(q2), progress), true); + Rotation ret = new Rotation(NDalicPINVOKE.Rotation_Multiply__SWIG_0(swigCPtr, Rotation.getCPtr(other)), true); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } - /// - /// This version of slerp, used by squad, does not check for theta > 90. - /// - /// The start rotation. - /// The end rotation. - /// A progress value between 0 and 1. - /// The interpolated rotation. - /// 3 - public static Rotation SlerpNoInvert(Rotation q1, Rotation q2, float t) + private Vector3 Multiply(Vector3 other) { - Rotation ret = new Rotation(NDalicPINVOKE.Rotation_SlerpNoInvert(Rotation.getCPtr(q1), Rotation.getCPtr(q2), t), true); + Vector3 ret = new Vector3(NDalicPINVOKE.Rotation_Multiply__SWIG_1(swigCPtr, Vector3.getCPtr(other)), true); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } - /// - /// The spherical cubic interpolation. - /// - /// The start rotation. - /// The end rotation. - /// The control rotation for q1. - /// The control rotation for q2. - /// A progress value between 0 and 1. - /// The interpolated rotation. - /// 3 - public static Rotation Squad(Rotation start, Rotation end, Rotation ctrl1, Rotation ctrl2, float t) + private Rotation Divide(Rotation other) { - Rotation ret = new Rotation(NDalicPINVOKE.Rotation_Squad(Rotation.getCPtr(start), Rotation.getCPtr(end), Rotation.getCPtr(ctrl1), Rotation.getCPtr(ctrl2), t), true); + Rotation ret = new Rotation(NDalicPINVOKE.Rotation_Divide__SWIG_0(swigCPtr, Rotation.getCPtr(other)), true); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } - /// - /// Returns the shortest angle between two rotations in radians. - /// - /// The first rotation. - /// The second rotation. - /// The angle between the two rotation. - /// 3 - public static float AngleBetween(Rotation q1, Rotation q2) + private Rotation Multiply(float scale) { - float ret = NDalicPINVOKE.Rotation_AngleBetween(Rotation.getCPtr(q1), Rotation.getCPtr(q2)); + Rotation ret = new Rotation(NDalicPINVOKE.Rotation_Multiply__SWIG_2(swigCPtr, scale), true); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } - } + private Rotation Divide(float scale) + { + Rotation ret = new Rotation(NDalicPINVOKE.Rotation_Divide__SWIG_1(swigCPtr, scale), true); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + private Rotation Subtract() + { + Rotation ret = new Rotation(NDalicPINVOKE.Rotation_Subtract__SWIG_1(swigCPtr), true); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + private Rotation AddAssign(Rotation other) + { + Rotation ret = new Rotation(NDalicPINVOKE.Rotation_AddAssign(swigCPtr, Rotation.getCPtr(other)), false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + private Rotation SubtractAssign(Rotation other) + { + Rotation ret = new Rotation(NDalicPINVOKE.Rotation_SubtractAssign(swigCPtr, Rotation.getCPtr(other)), false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + private Rotation MultiplyAssign(Rotation other) + { + Rotation ret = new Rotation(NDalicPINVOKE.Rotation_MultiplyAssign__SWIG_0(swigCPtr, Rotation.getCPtr(other)), false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + private Rotation MultiplyAssign(float scale) + { + Rotation ret = new Rotation(NDalicPINVOKE.Rotation_MultiplyAssign__SWIG_1(swigCPtr, scale), false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + private Rotation DivideAssign(float scale) + { + Rotation ret = new Rotation(NDalicPINVOKE.Rotation_DivideAssign(swigCPtr, scale), false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + private bool EqualTo(Rotation rhs) + { + bool ret = NDalicPINVOKE.Rotation_EqualTo(swigCPtr, Rotation.getCPtr(rhs)); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + private bool NotEqualTo(Rotation rhs) + { + bool ret = NDalicPINVOKE.Rotation_NotEqualTo(swigCPtr, Rotation.getCPtr(rhs)); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + } } \ No newline at end of file diff --git a/src/Tizen.NUI/src/public/Sampler.cs b/src/Tizen.NUI/src/public/Sampler.cs index f6e0d96..4b081c4 100755 --- a/src/Tizen.NUI/src/public/Sampler.cs +++ b/src/Tizen.NUI/src/public/Sampler.cs @@ -25,53 +25,6 @@ namespace Tizen.NUI { private global::System.Runtime.InteropServices.HandleRef swigCPtr; - internal Sampler(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.Sampler_SWIGUpcast(cPtr), cMemoryOwn) - { - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); - } - - internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Sampler obj) - { - return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; - } - - /// - /// Dispose. - /// - /// 3 - protected override void Dispose(DisposeTypes type) - { - if (disposed) - { - return; - } - - if (type == DisposeTypes.Explicit) - { - //Called by User - //Release your own managed resources here. - //You should release all of your own disposable objects here. - - } - - //Release your own unmanaged resources here. - //You should not access any managed member here except static instance. - //because the execution order of Finalizes is non-deterministic. - - - if (swigCPtr.Handle != global::System.IntPtr.Zero) - { - if (swigCMemOwn) - { - swigCMemOwn = false; - NDalicPINVOKE.delete_Sampler(swigCPtr); - } - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); - } - - base.Dispose(type); - } - /// /// Create an instance of Sampler. /// @@ -119,6 +72,51 @@ namespace Tizen.NUI if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } - } + internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Sampler obj) + { + return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; + } + + internal Sampler(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.Sampler_SWIGUpcast(cPtr), cMemoryOwn) + { + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); + } + + /// + /// Dispose. + /// + /// 3 + protected override void Dispose(DisposeTypes type) + { + if (disposed) + { + return; + } + if (type == DisposeTypes.Explicit) + { + //Called by User + //Release your own managed resources here. + //You should release all of your own disposable objects here. + + } + + //Release your own unmanaged resources here. + //You should not access any managed member here except static instance. + //because the execution order of Finalizes is non-deterministic. + + + if (swigCPtr.Handle != global::System.IntPtr.Zero) + { + if (swigCMemOwn) + { + swigCMemOwn = false; + NDalicPINVOKE.delete_Sampler(swigCPtr); + } + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); + } + + base.Dispose(type); + } + } } \ No newline at end of file diff --git a/src/Tizen.NUI/src/public/ScrollViewEffect.cs b/src/Tizen.NUI/src/public/ScrollViewEffect.cs index 225d071..708c655 100755 --- a/src/Tizen.NUI/src/public/ScrollViewEffect.cs +++ b/src/Tizen.NUI/src/public/ScrollViewEffect.cs @@ -26,9 +26,13 @@ namespace Tizen.NUI { private global::System.Runtime.InteropServices.HandleRef swigCPtr; - internal ScrollViewEffect(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.ScrollViewEffect_SWIGUpcast(cPtr), cMemoryOwn) + /// + /// The constructor. + /// + /// 3 + public ScrollViewEffect() : this(NDalicPINVOKE.new_ScrollViewEffect(), true) { - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } internal static global::System.Runtime.InteropServices.HandleRef getCPtr(ScrollViewEffect obj) @@ -36,6 +40,11 @@ namespace Tizen.NUI return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; } + internal ScrollViewEffect(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.ScrollViewEffect_SWIGUpcast(cPtr), cMemoryOwn) + { + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); + } + /// /// Dispose. /// @@ -71,16 +80,5 @@ namespace Tizen.NUI base.Dispose(type); } - - /// - /// The constructor. - /// - /// 3 - public ScrollViewEffect() : this(NDalicPINVOKE.new_ScrollViewEffect(), true) - { - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - } - } \ No newline at end of file diff --git a/src/Tizen.NUI/src/public/ScrollViewPagePathEffect.cs b/src/Tizen.NUI/src/public/ScrollViewPagePathEffect.cs index fdf9abf..3d4ba48 100755 --- a/src/Tizen.NUI/src/public/ScrollViewPagePathEffect.cs +++ b/src/Tizen.NUI/src/public/ScrollViewPagePathEffect.cs @@ -94,7 +94,7 @@ namespace Tizen.NUI internal static ScrollViewPagePathEffect DownCast(BaseHandle handle) { - ScrollViewPagePathEffect ret = Registry.GetManagedBaseHandleFromNativePtr(handle) as ScrollViewPagePathEffect; + ScrollViewPagePathEffect ret = Registry.GetManagedBaseHandleFromNativePtr(handle) as ScrollViewPagePathEffect; if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } @@ -111,7 +111,5 @@ namespace Tizen.NUI NDalicPINVOKE.ScrollViewPagePathEffect_ApplyToPage(swigCPtr, View.getCPtr(page), pageOrder); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } - } - } diff --git a/src/Tizen.NUI/src/public/Shader.cs b/src/Tizen.NUI/src/public/Shader.cs index f882082..b732226 100755 --- a/src/Tizen.NUI/src/public/Shader.cs +++ b/src/Tizen.NUI/src/public/Shader.cs @@ -25,9 +25,47 @@ namespace Tizen.NUI { private global::System.Runtime.InteropServices.HandleRef swigCPtr; - internal Shader(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.Shader_SWIGUpcast(cPtr), cMemoryOwn) + /// + /// Creates Shader object. + /// + /// The vertex shader code for the effect. + /// The fragment Shader code for the effect. + /// The hints to define the geometry of the rendered object. + /// 3 + public Shader(string vertexShader, string fragmentShader, Shader.Hint.Value hints) : this(NDalicPINVOKE.Shader_New__SWIG_0(vertexShader, fragmentShader, (int)hints), true) { - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + + } + + /// + /// Creates Shader object. + /// + /// The vertex shader code for the effect. + /// The fragment Shader code for the effect. + /// 3 + public Shader(string vertexShader, string fragmentShader) : this(NDalicPINVOKE.Shader_New__SWIG_1(vertexShader, fragmentShader), true) + { + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + + } + + /// + /// Gets and Sets the program property. + /// + /// 3 + public Tizen.NUI.PropertyMap Program + { + get + { + Tizen.NUI.PropertyMap temp = new Tizen.NUI.PropertyMap(); + Tizen.NUI.Object.GetProperty(swigCPtr, Shader.Property.PROGRAM).Get(temp); + return temp; + } + set + { + Tizen.NUI.Object.SetProperty(swigCPtr, Shader.Property.PROGRAM, new Tizen.NUI.PropertyValue(value)); + } } internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Shader obj) @@ -35,6 +73,11 @@ namespace Tizen.NUI return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; } + internal Shader(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.Shader_SWIGUpcast(cPtr), cMemoryOwn) + { + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); + } + /// /// Dispose. /// @@ -116,50 +159,5 @@ namespace Tizen.NUI /// 3 public static readonly int PROGRAM = NDalicPINVOKE.Shader_Property_PROGRAM_get(); } - - /// - /// Creates Shader object. - /// - /// The vertex shader code for the effect. - /// The fragment Shader code for the effect. - /// The hints to define the geometry of the rendered object. - /// 3 - public Shader(string vertexShader, string fragmentShader, Shader.Hint.Value hints) : this(NDalicPINVOKE.Shader_New__SWIG_0(vertexShader, fragmentShader, (int)hints), true) - { - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - - } - - /// - /// Creates Shader object. - /// - /// The vertex shader code for the effect. - /// The fragment Shader code for the effect. - /// 3 - public Shader(string vertexShader, string fragmentShader) : this(NDalicPINVOKE.Shader_New__SWIG_1(vertexShader, fragmentShader), true) - { - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - - } - - - /// - /// Gets and Sets the program property. - /// - /// 3 - public Tizen.NUI.PropertyMap Program - { - get - { - Tizen.NUI.PropertyMap temp = new Tizen.NUI.PropertyMap(); - Tizen.NUI.Object.GetProperty(swigCPtr, Shader.Property.PROGRAM).Get(temp); - return temp; - } - set - { - Tizen.NUI.Object.SetProperty(swigCPtr, Shader.Property.PROGRAM, new Tizen.NUI.PropertyValue(value)); - } - } } - } \ No newline at end of file diff --git a/src/Tizen.NUI/src/public/Size.cs b/src/Tizen.NUI/src/public/Size.cs index c675712..69d19b3 100755 --- a/src/Tizen.NUI/src/public/Size.cs +++ b/src/Tizen.NUI/src/public/Size.cs @@ -28,29 +28,51 @@ namespace Tizen.NUI [Tizen.NUI.Binding.TypeConverter(typeof(SizeTypeConverter))] public class Size : global::System.IDisposable { - private global::System.Runtime.InteropServices.HandleRef swigCPtr; /// swigCMemOwn. /// 5 protected bool swigCMemOwn; - internal Size(global::System.IntPtr cPtr, bool cMemoryOwn) + /// + /// A Flat to check if it is already disposed. + /// + /// 5 + protected bool disposed = false; + + private global::System.Runtime.InteropServices.HandleRef swigCPtr; + + //A Flag to check who called Dispose(). (By User or DisposeQueue) + private bool isDisposeQueued = false; + + /// + /// The constructor. + /// + /// 5 + public Size() : this(NDalicPINVOKE.new_Vector3__SWIG_0(), true) { - swigCMemOwn = cMemoryOwn; - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } - internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Size obj) + /// + /// The constructor. + /// + /// The x (or width) component. + /// The y (or height) component. + /// The z (or depth) component. + /// 5 + public Size(float x, float y, float z) : this(NDalicPINVOKE.new_Vector3__SWIG_1(x, y, z), true) { - return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } - //A Flag to check who called Dispose(). (By User or DisposeQueue) - private bool isDisposeQueued = false; /// - /// A Flat to check if it is already disposed. + /// The constructor. /// + /// Size2D with x (width) and y (height). /// 5 - protected bool disposed = false; + public Size(Size2D size2d) : this(NDalicPINVOKE.new_Vector3__SWIG_3(Size2D.getCPtr(size2d)), true) + { + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } /// /// Dispose. @@ -65,62 +87,75 @@ namespace Tizen.NUI } /// - /// Dispose. + /// The Zero constant, (0.0f, 0.0f, 0.0f). /// /// 5 - public void Dispose() + public static Size Zero { - //Throw excpetion if Dispose() is called in separate thread. - if (!Window.IsInstalled()) + get { - throw new System.InvalidOperationException("This API called from separate thread. This API must be called from MainThread."); + global::System.IntPtr cPtr = NDalicPINVOKE.Vector3_ZERO_get(); + Size ret = (cPtr == global::System.IntPtr.Zero) ? null : new Size(cPtr, false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; } + } - if (isDisposeQueued) + /// + /// The Width property for the width component of size + /// + /// 5 + public float Width + { + set { - Dispose(DisposeTypes.Implicit); + NDalicPINVOKE.Vector3_Width_set(swigCPtr, value); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } - else + get { - Dispose(DisposeTypes.Explicit); - System.GC.SuppressFinalize(this); + float ret = NDalicPINVOKE.Vector3_Width_get(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; } } /// - /// Dispose. + /// The Height property for the height component of size. /// /// 5 - protected virtual void Dispose(DisposeTypes type) + public float Height { - if (disposed) + set { - return; + NDalicPINVOKE.Vector3_Height_set(swigCPtr, value); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } - - if (type == DisposeTypes.Explicit) + get { - //Called by User - //Release your own managed resources here. - //You should release all of your own disposable objects here. - + float ret = NDalicPINVOKE.Vector3_Height_get(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; } + } - //Release your own unmanaged resources here. - //You should not access any managed member here except static instance. - //because the execution order of Finalizes is non-deterministic. - - if (swigCPtr.Handle != global::System.IntPtr.Zero) + /// + /// The Depth property for the depth component of size. + /// + /// 5 + public float Depth + { + set { - if (swigCMemOwn) - { - swigCMemOwn = false; - NDalicPINVOKE.delete_Vector3(swigCPtr); - } - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); + NDalicPINVOKE.Vector3_Depth_set(swigCPtr, value); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + get + { + float ret = NDalicPINVOKE.Vector3_Depth_get(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; } - - disposed = true; } /// @@ -220,113 +255,27 @@ namespace Tizen.NUI } } - internal static Size GetSizeFromPtr(global::System.IntPtr cPtr) - { - Size ret = new Size(cPtr, false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - /// - /// The constructor. - /// - /// 5 - public Size() : this(NDalicPINVOKE.new_Vector3__SWIG_0(), true) - { - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - /// - /// The constructor. - /// - /// The x (or width) component. - /// The y (or height) component. - /// The z (or depth) component. - /// 5 - public Size(float x, float y, float z) : this(NDalicPINVOKE.new_Vector3__SWIG_1(x, y, z), true) - { - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - /// - /// The constructor. - /// - /// Size2D with x (width) and y (height). - /// 5 - public Size(Size2D size2d) : this(NDalicPINVOKE.new_Vector3__SWIG_3(Size2D.getCPtr(size2d)), true) - { - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - /// - /// The Zero constant, (0.0f, 0.0f, 0.0f). + /// Dispose. /// /// 5 - public static Size Zero + public void Dispose() { - get + //Throw excpetion if Dispose() is called in separate thread. + if (!Window.IsInstalled()) { - global::System.IntPtr cPtr = NDalicPINVOKE.Vector3_ZERO_get(); - Size ret = (cPtr == global::System.IntPtr.Zero) ? null : new Size(cPtr, false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; + throw new System.InvalidOperationException("This API called from separate thread. This API must be called from MainThread."); } - } - - private Size Add(Size rhs) - { - Size ret = new Size(NDalicPINVOKE.Vector3_Add(swigCPtr, Size.getCPtr(rhs)), true); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - private Size Subtract(Size rhs) - { - Size ret = new Size(NDalicPINVOKE.Vector3_Subtract__SWIG_0(swigCPtr, Size.getCPtr(rhs)), true); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - private Size Multiply(Size rhs) - { - Size ret = new Size(NDalicPINVOKE.Vector3_Multiply__SWIG_0(swigCPtr, Size.getCPtr(rhs)), true); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - private Size Multiply(float rhs) - { - Size ret = new Size(NDalicPINVOKE.Vector3_Multiply__SWIG_1(swigCPtr, rhs), true); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - private Size Divide(Size rhs) - { - Size ret = new Size(NDalicPINVOKE.Vector3_Divide__SWIG_0(swigCPtr, Size.getCPtr(rhs)), true); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - private Size Divide(float rhs) - { - Size ret = new Size(NDalicPINVOKE.Vector3_Divide__SWIG_1(swigCPtr, rhs), true); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - private Size Subtract() - { - Size ret = new Size(NDalicPINVOKE.Vector3_Subtract__SWIG_1(swigCPtr), true); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - private float ValueOfIndex(uint index) - { - float ret = NDalicPINVOKE.Vector3_ValueOfIndex__SWIG_0(swigCPtr, index); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; + if (isDisposeQueued) + { + Dispose(DisposeTypes.Implicit); + } + else + { + Dispose(DisposeTypes.Explicit); + System.GC.SuppressFinalize(this); + } } /// @@ -383,84 +332,137 @@ namespace Tizen.NUI return ret; } + + /// - /// The Width property for the width component of size + /// The type cast operator, Size to Vector3. /// + /// The object of size type. /// 5 - public float Width + public static implicit operator Vector3(Size size) { - set - { - NDalicPINVOKE.Vector3_Width_set(swigCPtr, value); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - get - { - float ret = NDalicPINVOKE.Vector3_Width_get(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } + return new Vector3(size.Width, size.Height, size.Depth); } /// - /// The Height property for the height component of size. + /// The type cast operator, Vector3 to Size type. /// + /// The object of Vector3 type. /// 5 - public float Height + public static implicit operator Size(Vector3 vec) { - set - { - NDalicPINVOKE.Vector3_Height_set(swigCPtr, value); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - get - { - float ret = NDalicPINVOKE.Vector3_Height_get(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } + return new Size(vec.Width, vec.Height, vec.Depth); + } + + internal static Size GetSizeFromPtr(global::System.IntPtr cPtr) + { + Size ret = new Size(cPtr, false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Size obj) + { + return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; + } + + internal Size(global::System.IntPtr cPtr, bool cMemoryOwn) + { + swigCMemOwn = cMemoryOwn; + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); } /// - /// The Depth property for the depth component of size. + /// Dispose. /// /// 5 - public float Depth + protected virtual void Dispose(DisposeTypes type) { - set + if (disposed) { - NDalicPINVOKE.Vector3_Depth_set(swigCPtr, value); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return; } - get + + if (type == DisposeTypes.Explicit) { - float ret = NDalicPINVOKE.Vector3_Depth_get(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; + //Called by User + //Release your own managed resources here. + //You should release all of your own disposable objects here. + } + + //Release your own unmanaged resources here. + //You should not access any managed member here except static instance. + //because the execution order of Finalizes is non-deterministic. + + if (swigCPtr.Handle != global::System.IntPtr.Zero) + { + if (swigCMemOwn) + { + swigCMemOwn = false; + NDalicPINVOKE.delete_Vector3(swigCPtr); + } + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); + } + + disposed = true; } - /// - /// The type cast operator, Size to Vector3. - /// - /// The object of size type. - /// 5 - public static implicit operator Vector3(Size size) + private Size Add(Size rhs) { - return new Vector3(size.Width, size.Height, size.Depth); + Size ret = new Size(NDalicPINVOKE.Vector3_Add(swigCPtr, Size.getCPtr(rhs)), true); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; } - /// - /// The type cast operator, Vector3 to Size type. - /// - /// The object of Vector3 type. - /// 5 - public static implicit operator Size(Vector3 vec) + private Size Subtract(Size rhs) { - return new Size(vec.Width, vec.Height, vec.Depth); + Size ret = new Size(NDalicPINVOKE.Vector3_Subtract__SWIG_0(swigCPtr, Size.getCPtr(rhs)), true); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; } - } + private Size Multiply(Size rhs) + { + Size ret = new Size(NDalicPINVOKE.Vector3_Multiply__SWIG_0(swigCPtr, Size.getCPtr(rhs)), true); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + private Size Multiply(float rhs) + { + Size ret = new Size(NDalicPINVOKE.Vector3_Multiply__SWIG_1(swigCPtr, rhs), true); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + private Size Divide(Size rhs) + { + Size ret = new Size(NDalicPINVOKE.Vector3_Divide__SWIG_0(swigCPtr, Size.getCPtr(rhs)), true); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + private Size Divide(float rhs) + { + Size ret = new Size(NDalicPINVOKE.Vector3_Divide__SWIG_1(swigCPtr, rhs), true); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + private Size Subtract() + { + Size ret = new Size(NDalicPINVOKE.Vector3_Subtract__SWIG_1(swigCPtr), true); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + private float ValueOfIndex(uint index) + { + float ret = NDalicPINVOKE.Vector3_ValueOfIndex__SWIG_0(swigCPtr, index); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + } } diff --git a/src/Tizen.NUI/src/public/Size2D.cs b/src/Tizen.NUI/src/public/Size2D.cs index 3d6ee96..5df3635 100755 --- a/src/Tizen.NUI/src/public/Size2D.cs +++ b/src/Tizen.NUI/src/public/Size2D.cs @@ -19,7 +19,6 @@ using Tizen.NUI.Binding; namespace Tizen.NUI { - /// /// A two-dimensional size. /// @@ -27,31 +26,44 @@ namespace Tizen.NUI [Tizen.NUI.Binding.TypeConverter(typeof(Size2DTypeConverter))] public class Size2D : global::System.IDisposable { - private global::System.Runtime.InteropServices.HandleRef swigCPtr; /// /// swigCMemOwn /// /// 3 protected bool swigCMemOwn; - internal Size2D(global::System.IntPtr cPtr, bool cMemoryOwn) - { - swigCMemOwn = cMemoryOwn; - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); - } + /// + /// A Flat to check if it is already disposed. + /// + /// 3 + protected bool disposed = false; - internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Size2D obj) - { - return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; - } + private global::System.Runtime.InteropServices.HandleRef swigCPtr; //A Flag to check who called Dispose(). (By User or DisposeQueue) private bool isDisposeQueued = false; + + private Size2DChangedCallback callback = null; + /// - /// A Flat to check if it is already disposed. + /// The constructor. /// /// 3 - protected bool disposed = false; + public Size2D() : this(NDalicPINVOKE.new_Vector2__SWIG_0(), true) + { + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + /// + /// The constructor. + /// + /// The x (or width) component. + /// The y (or height) component. + /// 3 + public Size2D(int x, int y) : this(NDalicPINVOKE.new_Vector2__SWIG_1((float)x, (float)y), true) + { + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } /// /// Dispose. @@ -66,61 +78,48 @@ namespace Tizen.NUI } } + internal delegate void Size2DChangedCallback(int width, int height); + /// - /// Dispose. + /// The property for the width component of a size. /// /// 3 - public void Dispose() + public int Width { - //Throw excpetion if Dispose() is called in separate thread. - if (!Window.IsInstalled()) + set { - throw new System.InvalidOperationException("This API called from separate thread. This API must be called from MainThread."); - } + NDalicPINVOKE.Vector2_Width_set(swigCPtr, (float)value); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - if (isDisposeQueued) - { - Dispose(DisposeTypes.Implicit); + callback?.Invoke(Width, Height); } - else + get { - Dispose(DisposeTypes.Explicit); - System.GC.SuppressFinalize(this); + float ret = NDalicPINVOKE.Vector2_Width_get(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return (int)ret; } } /// - /// Dispose. + /// The property for the height component of a size. /// /// 3 - protected virtual void Dispose(DisposeTypes type) + public int Height { - if (disposed) + set { - return; - } + NDalicPINVOKE.Vector2_Height_set(swigCPtr, (float)value); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - if (type == DisposeTypes.Explicit) - { - //Called by User - //Release your own managed resources here. - //You should release all of your own disposable objects here. + callback?.Invoke(Width, Height); } - - //Release your own unmanaged resources here. - //You should not access any managed member here except static instance. - //because the execution order of Finalizes is non-deterministic. - - if (swigCPtr.Handle != global::System.IntPtr.Zero) + get { - if (swigCMemOwn) - { - swigCMemOwn = false; - NDalicPINVOKE.delete_Vector2(swigCPtr); - } - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); + float ret = NDalicPINVOKE.Vector2_Height_get(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return (int)ret; } - disposed = true; } /// @@ -208,108 +207,62 @@ namespace Tizen.NUI } /// - /// The array subscript operator. + /// The type cast operator, Size2D to Vector2. /// - /// The subscript index. - /// The float at the given index. + /// An object of the Size2D type. + /// return a Vector2 instance /// 3 - public float this[uint index] + public static implicit operator Vector2(Size2D size) { - get - { - return ValueOfIndex(index); - } + return new Vector2((float)size.Width, (float)size.Height); } /// - /// Gets the size from the pointer. + /// The type cast operator, Vector2 to Size2D type. /// - /// The pointer of the size. - /// Size - internal static Size2D GetSize2DFromPtr(global::System.IntPtr cPtr) + /// An object of the Vector2 type. + /// return a Size2D instance + /// 3 + public static implicit operator Size2D(Vector2 vector2) { - Size2D ret = new Size2D(cPtr, false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; + return new Size2D((int)vector2.X, (int)vector2.Y); } /// - /// The constructor. + /// The array subscript operator. /// + /// The subscript index. + /// The float at the given index. /// 3 - public Size2D() : this(NDalicPINVOKE.new_Vector2__SWIG_0(), true) + public float this[uint index] { - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + get + { + return ValueOfIndex(index); + } } /// - /// The constructor. + /// Dispose. /// - /// The x (or width) component. - /// The y (or height) component. /// 3 - public Size2D(int x, int y) : this(NDalicPINVOKE.new_Vector2__SWIG_1((float)x, (float)y), true) - { - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - internal delegate void Size2DChangedCallback(int width, int height); - private Size2DChangedCallback callback = null; - internal Size2D(Size2DChangedCallback cb, int x, int y) : this(NDalicPINVOKE.new_Vector2__SWIG_1((float)x, (float)y), true) - { - callback = cb; - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - private Size2D Add(Size2D rhs) - { - Size2D ret = new Size2D(NDalicPINVOKE.Vector2_Add(swigCPtr, Size2D.getCPtr(rhs)), true); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - private Size2D Subtract(Size2D rhs) - { - Size2D ret = new Size2D(NDalicPINVOKE.Vector2_Subtract__SWIG_0(swigCPtr, Size2D.getCPtr(rhs)), true); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - - private Size2D Multiply(Size2D rhs) - { - Size2D ret = new Size2D(NDalicPINVOKE.Vector2_Multiply__SWIG_0(swigCPtr, Size2D.getCPtr(rhs)), true); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - private Size2D Multiply(int rhs) - { - Size2D ret = new Size2D(NDalicPINVOKE.Vector2_Multiply__SWIG_1(swigCPtr, (float)rhs), true); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - - private Size2D Divide(Size2D rhs) - { - Size2D ret = new Size2D(NDalicPINVOKE.Vector2_Divide__SWIG_0(swigCPtr, Size2D.getCPtr(rhs)), true); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - private Size2D Divide(int rhs) + public void Dispose() { - Size2D ret = new Size2D(NDalicPINVOKE.Vector2_Divide__SWIG_1(swigCPtr, (float)rhs), true); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } + //Throw excpetion if Dispose() is called in separate thread. + if (!Window.IsInstalled()) + { + throw new System.InvalidOperationException("This API called from separate thread. This API must be called from MainThread."); + } - private Size2D Subtract() - { - Size2D ret = new Size2D(NDalicPINVOKE.Vector2_Subtract__SWIG_1(swigCPtr), true); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; + if (isDisposeQueued) + { + Dispose(DisposeTypes.Implicit); + } + else + { + Dispose(DisposeTypes.Explicit); + System.GC.SuppressFinalize(this); + } } /// @@ -366,76 +319,123 @@ namespace Tizen.NUI return ret; } - private int ValueOfIndex(uint index) + internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Size2D obj) { - int ret = (int)NDalicPINVOKE.Vector2_ValueOfIndex__SWIG_0(swigCPtr, index); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; + return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; } /// - /// The property for the width component of a size. + /// Gets the size from the pointer. /// - /// 3 - public int Width + /// The pointer of the size. + /// Size + internal static Size2D GetSize2DFromPtr(global::System.IntPtr cPtr) { - set - { - NDalicPINVOKE.Vector2_Width_set(swigCPtr, (float)value); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + Size2D ret = new Size2D(cPtr, false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } - callback?.Invoke(Width, Height); - } - get - { - float ret = NDalicPINVOKE.Vector2_Width_get(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return (int)ret; - } + internal Size2D(Size2DChangedCallback cb, int x, int y) : this(NDalicPINVOKE.new_Vector2__SWIG_1((float)x, (float)y), true) + { + callback = cb; + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + internal Size2D(global::System.IntPtr cPtr, bool cMemoryOwn) + { + swigCMemOwn = cMemoryOwn; + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); } /// - /// The property for the height component of a size. + /// Dispose. /// /// 3 - public int Height + protected virtual void Dispose(DisposeTypes type) { - set + if (disposed) { - NDalicPINVOKE.Vector2_Height_set(swigCPtr, (float)value); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return; + } - callback?.Invoke(Width, Height); + if (type == DisposeTypes.Explicit) + { + //Called by User + //Release your own managed resources here. + //You should release all of your own disposable objects here. } - get + + //Release your own unmanaged resources here. + //You should not access any managed member here except static instance. + //because the execution order of Finalizes is non-deterministic. + + if (swigCPtr.Handle != global::System.IntPtr.Zero) { - float ret = NDalicPINVOKE.Vector2_Height_get(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return (int)ret; + if (swigCMemOwn) + { + swigCMemOwn = false; + NDalicPINVOKE.delete_Vector2(swigCPtr); + } + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); } + disposed = true; } - /// - /// The type cast operator, Size2D to Vector2. - /// - /// An object of the Size2D type. - /// return a Vector2 instance - /// 3 - public static implicit operator Vector2(Size2D size) + private Size2D Add(Size2D rhs) { - return new Vector2((float)size.Width, (float)size.Height); + Size2D ret = new Size2D(NDalicPINVOKE.Vector2_Add(swigCPtr, Size2D.getCPtr(rhs)), true); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; } - /// - /// The type cast operator, Vector2 to Size2D type. - /// - /// An object of the Vector2 type. - /// return a Size2D instance - /// 3 - public static implicit operator Size2D(Vector2 vector2) + private Size2D Subtract(Size2D rhs) { - return new Size2D((int)vector2.X, (int)vector2.Y); + Size2D ret = new Size2D(NDalicPINVOKE.Vector2_Subtract__SWIG_0(swigCPtr, Size2D.getCPtr(rhs)), true); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + private Size2D Multiply(Size2D rhs) + { + Size2D ret = new Size2D(NDalicPINVOKE.Vector2_Multiply__SWIG_0(swigCPtr, Size2D.getCPtr(rhs)), true); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + private Size2D Multiply(int rhs) + { + Size2D ret = new Size2D(NDalicPINVOKE.Vector2_Multiply__SWIG_1(swigCPtr, (float)rhs), true); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + private Size2D Divide(Size2D rhs) + { + Size2D ret = new Size2D(NDalicPINVOKE.Vector2_Divide__SWIG_0(swigCPtr, Size2D.getCPtr(rhs)), true); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; } - } + private Size2D Divide(int rhs) + { + Size2D ret = new Size2D(NDalicPINVOKE.Vector2_Divide__SWIG_1(swigCPtr, (float)rhs), true); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + private Size2D Subtract() + { + Size2D ret = new Size2D(NDalicPINVOKE.Vector2_Subtract__SWIG_1(swigCPtr), true); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + private int ValueOfIndex(uint index) + { + int ret = (int)NDalicPINVOKE.Vector2_ValueOfIndex__SWIG_0(swigCPtr, index); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + } } diff --git a/src/Tizen.NUI/src/public/StyleManager.cs b/src/Tizen.NUI/src/public/StyleManager.cs old mode 100644 new mode 100755 index 49580b9..4dd2e95 --- a/src/Tizen.NUI/src/public/StyleManager.cs +++ b/src/Tizen.NUI/src/public/StyleManager.cs @@ -32,80 +32,23 @@ namespace Tizen.NUI /// 3 public class StyleManager : BaseHandle { - private global::System.Runtime.InteropServices.HandleRef swigCPtr; - - internal StyleManager(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.StyleManager_SWIGUpcast(cPtr), cMemoryOwn) - { - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); - } - - internal static global::System.Runtime.InteropServices.HandleRef getCPtr(StyleManager obj) - { - return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; - } - private static readonly StyleManager instance = StyleManager.Get(); + private global::System.Runtime.InteropServices.HandleRef swigCPtr; + private EventHandler _styleManagerStyleChangedEventHandler; + private StyleChangedCallbackDelegate _styleManagerStyleChangedCallbackDelegate; /// - /// Gets the singleton of the StyleManager object. - /// - /// 5 - public static StyleManager Instance - { - get - { - return instance; - } - } - - /// - /// Style changed event arguments. + /// Creates a StyleManager handle.
+ /// This can be initialized with StyleManager::Get().
///
/// 3 - public class StyleChangedEventArgs : EventArgs + public StyleManager() : this(NDalicPINVOKE.new_StyleManager(), true) { - private StyleManager _styleManager; - private StyleChangeType _styleChange; - - /// - /// StyleManager. - /// - /// 3 - public StyleManager StyleManager - { - get - { - return _styleManager; - } - set - { - _styleManager = value; - } - } - - /// - /// StyleChange - contains the style change information (default font changed or - /// default font size changed or theme has changed).
- ///
- /// 3 - public StyleChangeType StyleChange - { - get - { - return _styleChange; - } - set - { - _styleChange = value; - } - } - + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } [UnmanagedFunctionPointer(CallingConvention.StdCall)] private delegate void StyleChangedCallbackDelegate(IntPtr styleManager, Tizen.NUI.StyleChangeType styleChange); - private EventHandler _styleManagerStyleChangedEventHandler; - private StyleChangedCallbackDelegate _styleManagerStyleChangedCallbackDelegate; /// /// An event for the StyleChanged signal which can be used to subscribe or unsubscribe the @@ -135,30 +78,16 @@ namespace Tizen.NUI } } - // Callback for StyleManager StyleChangedsignal - private void OnStyleChanged(IntPtr styleManager, StyleChangeType styleChange) - { - StyleChangedEventArgs e = new StyleChangedEventArgs(); - - // Populate all members of "e" (StyleChangedEventArgs) with real data. - e.StyleManager = Registry.GetManagedBaseHandleFromNativePtr(styleManager) as StyleManager; - e.StyleChange = styleChange; - - if (_styleManagerStyleChangedEventHandler != null) - { - //Here we send all data to user event handlers. - _styleManagerStyleChangedEventHandler(this, e); - } - } - /// - /// Creates a StyleManager handle.
- /// This can be initialized with StyleManager::Get().
+ /// Gets the singleton of the StyleManager object. ///
- /// 3 - public StyleManager() : this(NDalicPINVOKE.new_StyleManager(), true) + /// 5 + public static StyleManager Instance { - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + get + { + return instance; + } } /// @@ -237,6 +166,16 @@ namespace Tizen.NUI if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } + internal static global::System.Runtime.InteropServices.HandleRef getCPtr(StyleManager obj) + { + return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; + } + + internal StyleManager(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.StyleManager_SWIGUpcast(cPtr), cMemoryOwn) + { + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); + } + internal StyleChangedSignal StyleChangedSignal() { StyleChangedSignal ret = new StyleChangedSignal(NDalicPINVOKE.StyleManager_StyleChangedSignal(swigCPtr), false); @@ -244,5 +183,63 @@ namespace Tizen.NUI return ret; } + // Callback for StyleManager StyleChangedsignal + private void OnStyleChanged(IntPtr styleManager, StyleChangeType styleChange) + { + StyleChangedEventArgs e = new StyleChangedEventArgs(); + + // Populate all members of "e" (StyleChangedEventArgs) with real data. + e.StyleManager = Registry.GetManagedBaseHandleFromNativePtr(styleManager) as StyleManager; + e.StyleChange = styleChange; + + if (_styleManagerStyleChangedEventHandler != null) + { + //Here we send all data to user event handlers. + _styleManagerStyleChangedEventHandler(this, e); + } + } + + /// + /// Style changed event arguments. + /// + /// 3 + public class StyleChangedEventArgs : EventArgs + { + private StyleManager _styleManager; + private StyleChangeType _styleChange; + + /// + /// StyleManager. + /// + /// 3 + public StyleManager StyleManager + { + get + { + return _styleManager; + } + set + { + _styleManager = value; + } + } + + /// + /// StyleChange - contains the style change information (default font changed or + /// default font size changed or theme has changed).
+ ///
+ /// 3 + public StyleChangeType StyleChange + { + get + { + return _styleChange; + } + set + { + _styleChange = value; + } + } + } } } diff --git a/src/Tizen.NUI/src/public/TTSPlayer.cs b/src/Tizen.NUI/src/public/TTSPlayer.cs old mode 100644 new mode 100755 index 52bfbea..32fe091 --- a/src/Tizen.NUI/src/public/TTSPlayer.cs +++ b/src/Tizen.NUI/src/public/TTSPlayer.cs @@ -27,19 +27,105 @@ namespace Tizen.NUI /// 3 public class TTSPlayer : BaseHandle { + private static readonly TTSPlayer instance = TTSPlayer.Get(); private global::System.Runtime.InteropServices.HandleRef swigCPtr; + private StateChangedEventCallbackType _stateChangedEventCallback; internal TTSPlayer(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicManualPINVOKE.TtsPlayer_SWIGUpcast(cPtr), cMemoryOwn) { swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); } - internal static global::System.Runtime.InteropServices.HandleRef getCPtr(TTSPlayer obj) + internal TTSPlayer() : this(NDalicManualPINVOKE.new_TtsPlayer__SWIG_0(), true) { - return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } - private static readonly TTSPlayer instance = TTSPlayer.Get(); + internal TTSPlayer(TTSPlayer handle) : this(NDalicManualPINVOKE.new_TtsPlayer__SWIG_1(TTSPlayer.getCPtr(handle)), true) + { + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + [UnmanagedFunctionPointer(CallingConvention.StdCall)] + private delegate void StateChangedEventCallbackType(TTSState prevState, TTSState nextState); + private event EventHandler _stateChangedEventHandler; + + /// + /// State changed event. + /// + /// 3 + public event EventHandler StateChanged + { + add + { + if (_stateChangedEventHandler == null) + { + _stateChangedEventCallback = OnStateChanged; + StateChangedSignal().Connect(_stateChangedEventCallback); + } + + _stateChangedEventHandler += value; + } + remove + { + _stateChangedEventHandler -= value; + + if (_stateChangedEventHandler == null && StateChangedSignal().Empty() == false && _stateChangedEventCallback != null) + { + StateChangedSignal().Disconnect(_stateChangedEventCallback); + } + } + } + + /// + /// Enumeration for the instance of TTS mode. + /// + /// 3 + public enum TTSMode + { + /// + /// Default mode for normal application. + /// + Default = 0, + /// + /// Notification mode, such as playing utterance is started or completed. + /// + Notification, + /// + /// Screen reader mode.
+ /// To help visually impaired users interact with their devices,
+ /// screen reader reads text or graphic elements on the screen using the TTS engine. + ///
+ ScreenReader, + /// + /// Number of mode. + /// + ModeNum + } + + /// + /// Enumeration for the instance of TTS state. + /// + /// 3 + public enum TTSState + { + /// + /// Player is not available. + /// + Unavailable = 0, + /// + /// Player is ready to play. + /// + Ready, + /// + /// Player is playing. + /// + Playing, + /// + /// Player is paused. + /// + Paused + } /// /// Gets the singleton of the TTSPlayer object. @@ -53,11 +139,6 @@ namespace Tizen.NUI } } - internal TTSPlayer() : this(NDalicManualPINVOKE.new_TtsPlayer__SWIG_0(), true) - { - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - /// /// Gets the singleton of the TTS player for the given mode. /// @@ -83,18 +164,6 @@ namespace Tizen.NUI return ret; } - internal TTSPlayer(TTSPlayer handle) : this(NDalicManualPINVOKE.new_TtsPlayer__SWIG_1(TTSPlayer.getCPtr(handle)), true) - { - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - internal TTSPlayer Assign(TTSPlayer rhs) - { - TTSPlayer ret = new TTSPlayer(NDalicManualPINVOKE.TtsPlayer_Assign(swigCPtr, TTSPlayer.getCPtr(rhs)), false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - /// /// Starts playing the audio data synthesized from the specified text. /// @@ -153,63 +222,23 @@ namespace Tizen.NUI return ret; } - /// - /// State changed argument. - /// - /// 3 - public class StateChangedEventArgs : EventArgs + internal static global::System.Runtime.InteropServices.HandleRef getCPtr(TTSPlayer obj) { - /// - /// PrevState. - /// - /// 3 - public TTSState PrevState - { - get; - set; - } - - /// - /// NextState. - /// - /// 3 - public TTSState NextState - { - get; - set; - } + return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; } - private StateChangedEventCallbackType _stateChangedEventCallback; - [UnmanagedFunctionPointer(CallingConvention.StdCall)] - private delegate void StateChangedEventCallbackType(TTSState prevState, TTSState nextState); - private event EventHandler _stateChangedEventHandler; - - /// - /// State changed event. - /// - /// 3 - public event EventHandler StateChanged + internal StateChangedSignalType StateChangedSignal() { - add - { - if (_stateChangedEventHandler == null) - { - _stateChangedEventCallback = OnStateChanged; - StateChangedSignal().Connect(_stateChangedEventCallback); - } - - _stateChangedEventHandler += value; - } - remove - { - _stateChangedEventHandler -= value; + StateChangedSignalType ret = new StateChangedSignalType(NDalicManualPINVOKE.TtsPlayer_StateChangedSignal(swigCPtr), false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } - if (_stateChangedEventHandler == null && StateChangedSignal().Empty() == false && _stateChangedEventCallback != null) - { - StateChangedSignal().Disconnect(_stateChangedEventCallback); - } - } + internal TTSPlayer Assign(TTSPlayer rhs) + { + TTSPlayer ret = new TTSPlayer(NDalicManualPINVOKE.TtsPlayer_Assign(swigCPtr, TTSPlayer.getCPtr(rhs)), false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; } private void OnStateChanged(TTSState prevState, TTSState nextState) @@ -225,63 +254,32 @@ namespace Tizen.NUI } } - internal StateChangedSignalType StateChangedSignal() - { - StateChangedSignalType ret = new StateChangedSignalType(NDalicManualPINVOKE.TtsPlayer_StateChangedSignal(swigCPtr), false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - /// - /// Enumeration for the instance of TTS mode. + /// State changed argument. /// /// 3 - public enum TTSMode + public class StateChangedEventArgs : EventArgs { /// - /// Default mode for normal application. - /// - Default = 0, - /// - /// Notification mode, such as playing utterance is started or completed. - /// - Notification, - /// - /// Screen reader mode.
- /// To help visually impaired users interact with their devices,
- /// screen reader reads text or graphic elements on the screen using the TTS engine. - ///
- ScreenReader, - /// - /// Number of mode. + /// PrevState. /// - ModeNum - } + /// 3 + public TTSState PrevState + { + get; + set; + } - /// - /// Enumeration for the instance of TTS state. - /// - /// 3 - public enum TTSState - { - /// - /// Player is not available. - /// - Unavailable = 0, - /// - /// Player is ready to play. - /// - Ready, /// - /// Player is playing. - /// - Playing, - /// - /// Player is paused. + /// NextState. /// - Paused + /// 3 + public TTSState NextState + { + get; + set; + } } - } } diff --git a/src/Tizen.NUI/src/public/TapGesture.cs b/src/Tizen.NUI/src/public/TapGesture.cs index 2ef9c7a..d5de499 100755 --- a/src/Tizen.NUI/src/public/TapGesture.cs +++ b/src/Tizen.NUI/src/public/TapGesture.cs @@ -26,62 +26,18 @@ namespace Tizen.NUI { private global::System.Runtime.InteropServices.HandleRef swigCPtr; - internal TapGesture(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.TapGesture_SWIGUpcast(cPtr), cMemoryOwn) - { - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); - } - - internal static global::System.Runtime.InteropServices.HandleRef getCPtr(TapGesture obj) - { - return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; - } - /// - /// Dispose. + /// Creates a TapGesture. /// /// 3 - protected override void Dispose(DisposeTypes type) + public TapGesture() : this(NDalicPINVOKE.new_TapGesture__SWIG_0(), true) { - if(disposed) - { - return; - } - - if(type == DisposeTypes.Explicit) - { - //Called by User - //Release your own managed resources here. - //You should release all of your own disposable objects here. - } - - //Release your own unmanaged resources here. - //You should not access any managed member here except static instance. - //because the execution order of Finalizes is non-deterministic. - - if (swigCPtr.Handle != global::System.IntPtr.Zero) - { - if (swigCMemOwn) - { - swigCMemOwn = false; - NDalicPINVOKE.delete_TapGesture(swigCPtr); - } - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); - } - - base.Dispose(type); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } - - /// - /// Gets the TapGesture from the pointer. - /// - /// The pointer to cast. - /// The TapGesture object. - internal static TapGesture GetTapGestureFromPtr(global::System.IntPtr cPtr) + internal TapGesture(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.TapGesture_SWIGUpcast(cPtr), cMemoryOwn) { - TapGesture ret = new TapGesture(cPtr, false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); } /// @@ -132,16 +88,6 @@ namespace Tizen.NUI } } - /// - /// Creates a TapGesture. - /// - /// 3 - public TapGesture() : this(NDalicPINVOKE.new_TapGesture__SWIG_0(), true) - { - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - private uint numberOfTaps { set @@ -204,6 +150,57 @@ namespace Tizen.NUI } } + internal static global::System.Runtime.InteropServices.HandleRef getCPtr(TapGesture obj) + { + return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; + } + + /// + /// Gets the TapGesture from the pointer. + /// + /// The pointer to cast. + /// The TapGesture object. + internal static TapGesture GetTapGestureFromPtr(global::System.IntPtr cPtr) + { + TapGesture ret = new TapGesture(cPtr, false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + /// + /// Dispose. + /// + /// 3 + protected override void Dispose(DisposeTypes type) + { + if (disposed) + { + return; + } + + if (type == DisposeTypes.Explicit) + { + //Called by User + //Release your own managed resources here. + //You should release all of your own disposable objects here. + } + + //Release your own unmanaged resources here. + //You should not access any managed member here except static instance. + //because the execution order of Finalizes is non-deterministic. + + if (swigCPtr.Handle != global::System.IntPtr.Zero) + { + if (swigCMemOwn) + { + swigCMemOwn = false; + NDalicPINVOKE.delete_TapGesture(swigCPtr); + } + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); + } + + base.Dispose(type); + } } } \ No newline at end of file diff --git a/src/Tizen.NUI/src/public/TapGestureDetector.cs b/src/Tizen.NUI/src/public/TapGestureDetector.cs index 9715dbf..7850859 100755 --- a/src/Tizen.NUI/src/public/TapGestureDetector.cs +++ b/src/Tizen.NUI/src/public/TapGestureDetector.cs @@ -31,107 +31,39 @@ namespace Tizen.NUI public class TapGestureDetector : GestureDetector { private global::System.Runtime.InteropServices.HandleRef swigCPtr; - - internal TapGestureDetector(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.TapGestureDetector_SWIGUpcast(cPtr), cMemoryOwn) - { - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); - } - - internal static global::System.Runtime.InteropServices.HandleRef getCPtr(TapGestureDetector obj) - { - return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; - } + private DaliEventHandler _tapGestureEventHandler; + private DetectedCallbackDelegate _tapGestureCallbackDelegate; /// - /// Dispose. + /// Creates an initialized TapGestureDetector. /// - /// The dispose type /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] - protected override void Dispose(DisposeTypes type) + public TapGestureDetector() : this(NDalicPINVOKE.TapGestureDetector_New__SWIG_0(), true) { - if (disposed) - { - return; - } - - if (type == DisposeTypes.Explicit) - { - //Called by User - //Release your own managed resources here. - //You should release all of your own disposable objects here. - - } - - //Release your own unmanaged resources here. - //You should not access any managed member here except static instance. - //because the execution order of Finalizes is non-deterministic. - - if (swigCPtr.Handle != global::System.IntPtr.Zero) - { - if (swigCMemOwn) - { - swigCMemOwn = false; - NDalicPINVOKE.delete_TapGestureDetector(swigCPtr); - } - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); - } + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - base.Dispose(type); } /// - /// Event arguments that are passed via the TapGestureEvent signal. + /// Creates an initialized TapGestureDetector with the specified parameters. /// - /// 5 + /// The minimum and maximum number of taps required /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] - public class DetectedEventArgs : EventArgs + public TapGestureDetector(uint tapsRequired) : this(NDalicPINVOKE.TapGestureDetector_New__SWIG_1(tapsRequired), true) { - private View _view; - private TapGesture _tapGesture; + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - /// - /// The attached view. - /// - /// 5 - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - public View View - { - get - { - return _view; - } - set - { - _view = value; - } - } + } - /// - /// The TapGesture. - /// - /// 5 - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - public TapGesture TapGesture - { - get - { - return _tapGesture; - } - set - { - _tapGesture = value; - } - } + internal TapGestureDetector(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.TapGestureDetector_SWIGUpcast(cPtr), cMemoryOwn) + { + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); } [UnmanagedFunctionPointer(CallingConvention.StdCall)] private delegate void DetectedCallbackDelegate(IntPtr actor, IntPtr TapGesture); - private DaliEventHandler _tapGestureEventHandler; - private DetectedCallbackDelegate _tapGestureCallbackDelegate; /// /// This signal is emitted when the specified tap is detected on the attached view. @@ -169,59 +101,6 @@ namespace Tizen.NUI } } - private void OnTapGestureDetected(IntPtr actor, IntPtr tapGesture) - { - DetectedEventArgs e = new DetectedEventArgs(); - - // Populate all members of "e" (DetectedEventArgs) with real data - e.View = Registry.GetManagedBaseHandleFromNativePtr(actor) as View; - e.TapGesture = Tizen.NUI.TapGesture.GetTapGestureFromPtr(tapGesture); - - if (_tapGestureEventHandler != null) - { - //here we send all data to user event handlers - _tapGestureEventHandler(this, e); - } - - } - - internal static TapGestureDetector GetTapGestureDetectorFromPtr(global::System.IntPtr cPtr) - { - TapGestureDetector ret = new TapGestureDetector(cPtr, false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - /// - /// Creates an initialized TapGestureDetector. - /// - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - public TapGestureDetector() : this(NDalicPINVOKE.TapGestureDetector_New__SWIG_0(), true) - { - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - - } - - /// - /// Creates an initialized TapGestureDetector with the specified parameters. - /// - /// The minimum and maximum number of taps required - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - public TapGestureDetector(uint tapsRequired) : this(NDalicPINVOKE.TapGestureDetector_New__SWIG_1(tapsRequired), true) - { - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - - } - - internal new static TapGestureDetector DownCast(BaseHandle handle) - { - TapGestureDetector ret = Registry.GetManagedBaseHandleFromNativePtr(handle) as TapGestureDetector; - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - /// /// The copy constructor. /// @@ -233,13 +112,6 @@ namespace Tizen.NUI if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } - internal TapGestureDetector Assign(TapGestureDetector rhs) - { - TapGestureDetector ret = new TapGestureDetector(NDalicPINVOKE.TapGestureDetector_Assign(swigCPtr, TapGestureDetector.getCPtr(rhs)), false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - /// /// Sets the minimum number of taps required. The tap count is the number of times a user should "tap" the screen.
/// The default is 1.
@@ -292,6 +164,25 @@ namespace Tizen.NUI return ret; } + internal new static TapGestureDetector DownCast(BaseHandle handle) + { + TapGestureDetector ret = Registry.GetManagedBaseHandleFromNativePtr(handle) as TapGestureDetector; + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + internal static global::System.Runtime.InteropServices.HandleRef getCPtr(TapGestureDetector obj) + { + return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; + } + + internal static TapGestureDetector GetTapGestureDetectorFromPtr(global::System.IntPtr cPtr) + { + TapGestureDetector ret = new TapGestureDetector(cPtr, false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + internal TapGestureDetectedSignal DetectedSignal() { TapGestureDetectedSignal ret = new TapGestureDetectedSignal(NDalicPINVOKE.TapGestureDetector_DetectedSignal(swigCPtr), false); @@ -299,6 +190,114 @@ namespace Tizen.NUI return ret; } + internal TapGestureDetector Assign(TapGestureDetector rhs) + { + TapGestureDetector ret = new TapGestureDetector(NDalicPINVOKE.TapGestureDetector_Assign(swigCPtr, TapGestureDetector.getCPtr(rhs)), false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + /// + /// Dispose. + /// + /// The dispose type + /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + protected override void Dispose(DisposeTypes type) + { + if (disposed) + { + return; + } + + if (type == DisposeTypes.Explicit) + { + //Called by User + //Release your own managed resources here. + //You should release all of your own disposable objects here. + + } + + //Release your own unmanaged resources here. + //You should not access any managed member here except static instance. + //because the execution order of Finalizes is non-deterministic. + + if (swigCPtr.Handle != global::System.IntPtr.Zero) + { + if (swigCMemOwn) + { + swigCMemOwn = false; + NDalicPINVOKE.delete_TapGestureDetector(swigCPtr); + } + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); + } + + base.Dispose(type); + } + + private void OnTapGestureDetected(IntPtr actor, IntPtr tapGesture) + { + DetectedEventArgs e = new DetectedEventArgs(); + + // Populate all members of "e" (DetectedEventArgs) with real data + e.View = Registry.GetManagedBaseHandleFromNativePtr(actor) as View; + e.TapGesture = Tizen.NUI.TapGesture.GetTapGestureFromPtr(tapGesture); + + if (_tapGestureEventHandler != null) + { + //here we send all data to user event handlers + _tapGestureEventHandler(this, e); + } + + } + + /// + /// Event arguments that are passed via the TapGestureEvent signal. + /// + /// 5 + /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + public class DetectedEventArgs : EventArgs + { + private View _view; + private TapGesture _tapGesture; + + /// + /// The attached view. + /// + /// 5 + /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + public View View + { + get + { + return _view; + } + set + { + _view = value; + } + } + + /// + /// The TapGesture. + /// + /// 5 + /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + public TapGesture TapGesture + { + get + { + return _tapGesture; + } + set + { + _tapGesture = value; + } + } + } } } diff --git a/src/Tizen.NUI/src/public/Texture.cs b/src/Tizen.NUI/src/public/Texture.cs index 89729b0..3aebbcc 100755 --- a/src/Tizen.NUI/src/public/Texture.cs +++ b/src/Tizen.NUI/src/public/Texture.cs @@ -25,52 +25,6 @@ namespace Tizen.NUI { private global::System.Runtime.InteropServices.HandleRef swigCPtr; - internal Texture(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.Texture_SWIGUpcast(cPtr), cMemoryOwn) - { - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); - } - - internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Texture obj) - { - return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; - } - - /// - /// Dispose. - /// - /// 3 - protected override void Dispose(DisposeTypes type) - { - if (disposed) - { - return; - } - - if (type == DisposeTypes.Explicit) - { - //Called by User - //Release your own managed resources here. - //You should release all of your own disposable objects here. - - } - - //Release your own unmanaged resources here. - //You should not access any managed member here except static instance. - //because the execution order of Finalizes is non-deterministic. - - if (swigCPtr.Handle != global::System.IntPtr.Zero) - { - if (swigCMemOwn) - { - swigCMemOwn = false; - NDalicPINVOKE.delete_Texture(swigCPtr); - } - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); - } - - base.Dispose(type); - } - /// /// Creates a new Texture object. /// @@ -90,6 +44,11 @@ namespace Tizen.NUI } + internal Texture(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.Texture_SWIGUpcast(cPtr), cMemoryOwn) + { + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); + } + /// /// Uploads data to the texture from a PixelData object. /// @@ -157,6 +116,47 @@ namespace Tizen.NUI return ret; } + internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Texture obj) + { + return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; + } + + /// + /// Dispose. + /// + /// 3 + protected override void Dispose(DisposeTypes type) + { + if (disposed) + { + return; + } + + if (type == DisposeTypes.Explicit) + { + //Called by User + //Release your own managed resources here. + //You should release all of your own disposable objects here. + + } + + //Release your own unmanaged resources here. + //You should not access any managed member here except static instance. + //because the execution order of Finalizes is non-deterministic. + + if (swigCPtr.Handle != global::System.IntPtr.Zero) + { + if (swigCMemOwn) + { + swigCMemOwn = false; + NDalicPINVOKE.delete_Texture(swigCPtr); + } + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); + } + + base.Dispose(type); + } + } } \ No newline at end of file diff --git a/src/Tizen.NUI/src/public/TextureSet.cs b/src/Tizen.NUI/src/public/TextureSet.cs index 949dece..4fdf1e7 100755 --- a/src/Tizen.NUI/src/public/TextureSet.cs +++ b/src/Tizen.NUI/src/public/TextureSet.cs @@ -28,52 +28,6 @@ namespace Tizen.NUI { private global::System.Runtime.InteropServices.HandleRef swigCPtr; - internal TextureSet(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.TextureSet_SWIGUpcast(cPtr), cMemoryOwn) - { - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); - } - - internal static global::System.Runtime.InteropServices.HandleRef getCPtr(TextureSet obj) - { - return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; - } - - /// - /// Dispose. - /// - /// 3 - protected override void Dispose(DisposeTypes type) - { - if (disposed) - { - return; - } - - if (type == DisposeTypes.Explicit) - { - //Called by User - //Release your own managed resources here. - //You should release all of your own disposable objects here. - - } - - //Release your own unmanaged resources here. - //You should not access any managed member here except static instance. - //because the execution order of Finalizes is non-deterministic. - - if (swigCPtr.Handle != global::System.IntPtr.Zero) - { - if (swigCMemOwn) - { - swigCMemOwn = false; - NDalicPINVOKE.delete_TextureSet(swigCPtr); - } - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); - } - - base.Dispose(type); - } - /// /// Create an instance of TextureSet. /// @@ -84,6 +38,11 @@ namespace Tizen.NUI } + internal TextureSet(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.TextureSet_SWIGUpcast(cPtr), cMemoryOwn) + { + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); + } + /// /// Sets the texture at position "index". /// @@ -158,6 +117,46 @@ namespace Tizen.NUI return ret; } + internal static global::System.Runtime.InteropServices.HandleRef getCPtr(TextureSet obj) + { + return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; + } + + /// + /// Dispose. + /// + /// 3 + protected override void Dispose(DisposeTypes type) + { + if (disposed) + { + return; + } + + if (type == DisposeTypes.Explicit) + { + //Called by User + //Release your own managed resources here. + //You should release all of your own disposable objects here. + + } + + //Release your own unmanaged resources here. + //You should not access any managed member here except static instance. + //because the execution order of Finalizes is non-deterministic. + + if (swigCPtr.Handle != global::System.IntPtr.Zero) + { + if (swigCMemOwn) + { + swigCMemOwn = false; + NDalicPINVOKE.delete_TextureSet(swigCPtr); + } + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); + } + + base.Dispose(type); + } } } \ No newline at end of file diff --git a/src/Tizen.NUI/src/public/Timer.cs b/src/Tizen.NUI/src/public/Timer.cs index daffa3e..f07f174 100755 --- a/src/Tizen.NUI/src/public/Timer.cs +++ b/src/Tizen.NUI/src/public/Timer.cs @@ -35,90 +35,49 @@ namespace Tizen.NUI public class Timer : BaseHandle { private global::System.Runtime.InteropServices.HandleRef swigCPtr; - private bool played = false; + private EventHandlerWithReturnType _timerTickEventHandler; + private TickCallbackDelegate _timerTickCallbackDelegate; - internal Timer(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.Timer_SWIGUpcast(cPtr), cMemoryOwn) - { - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); - - _timerTickCallbackDelegate = OnTick; - _timerTickCallbackOfNative = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(_timerTickCallbackDelegate); - - NUILog.Debug($"(0x{swigCPtr.Handle:X})Timer() contructor!"); - } + private System.IntPtr _timerTickCallbackOfNative; /// - /// Destructor. + /// Creates a tick timer that emits periodic signal. /// - ~Timer() + /// Interval in milliseconds. + /// A new timer. + /// 3 + public Timer(uint milliSec) : this(NDalicPINVOKE.Timer_New(milliSec), true) { - NUILog.Debug($"(0x{swigCPtr.Handle:X})Timer() distructor!, disposed={disposed}"); - } + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Timer obj) + NUILog.Debug($"(0x{swigCPtr.Handle:X}) Timer({milliSec}) Constructor!"); + } + internal Timer(Timer timer) : this(NDalicPINVOKE.new_Timer__SWIG_1(Timer.getCPtr(timer)), true) { - return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } - /// - /// Dispose. - /// - /// 3 - protected override void Dispose(DisposeTypes type) + internal Timer(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.Timer_SWIGUpcast(cPtr), cMemoryOwn) { - NUILog.Debug($"(0x{swigCPtr.Handle:X}) Timer.Dispose(type={type}, disposed={disposed})"); - - if (this != null && _timerTickCallbackDelegate != null) - { - TickSignal().Disconnect(_timerTickCallbackOfNative); - } - - if (disposed) - { - return; - } - - if (type == DisposeTypes.Explicit) - { - //Called by User - //Release your own managed resources here. - //You should release all of your own disposable objects here. - } - - //Release your own unmanaged resources here. - //You should not access any managed member here except static instance. - //because the execution order of Finalizes is non-deterministic. + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); - if (swigCPtr.Handle != global::System.IntPtr.Zero) - { - if (swigCMemOwn) - { - swigCMemOwn = false; - NDalicPINVOKE.delete_Timer(swigCPtr); - } - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); - } + _timerTickCallbackDelegate = OnTick; + _timerTickCallbackOfNative = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(_timerTickCallbackDelegate); - played = false; - base.Dispose(type); + NUILog.Debug($"(0x{swigCPtr.Handle:X})Timer() contructor!"); } - /// - /// Event arguments that passed via the tick event. + /// Destructor. /// - /// 3 - public class TickEventArgs : EventArgs + ~Timer() { + NUILog.Debug($"(0x{swigCPtr.Handle:X})Timer() distructor!, disposed={disposed}"); } [UnmanagedFunctionPointer(CallingConvention.StdCall)] private delegate bool TickCallbackDelegate(); - private EventHandlerWithReturnType _timerTickEventHandler; - private TickCallbackDelegate _timerTickCallbackDelegate; - - private System.IntPtr _timerTickCallbackOfNative; /// /// @brief Event for the ticked signal, which can be used to subscribe or unsubscribe the event handler @@ -145,39 +104,23 @@ namespace Tizen.NUI } } - private bool OnTick() + /// + /// Gets/Sets the interval of the timer. + /// + /// For setter, this sets a new interval on the timer and starts the timer.
+ /// Cancels the previous timer. + ///
+ /// 4 + public uint Interval { - TickEventArgs e = new TickEventArgs(); - - if (played == false) + get { - Tizen.Log.Fatal("NUI", $"(0x{swigCPtr.Handle:X}) OnTick() is called even played is false!"); - //throw new System.InvalidOperationException($"OnTick() excpetion!"); + return GetInterval(); } - - if (_timerTickEventHandler != null && played == true) + set { - //here we send all data to user event handlers - return _timerTickEventHandler(this, e); + SetInterval(value); } - return false; - } - - /// - /// Creates a tick timer that emits periodic signal. - /// - /// Interval in milliseconds. - /// A new timer. - /// 3 - public Timer(uint milliSec) : this(NDalicPINVOKE.Timer_New(milliSec), true) - { - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - - NUILog.Debug($"(0x{swigCPtr.Handle:X}) Timer({milliSec}) Constructor!"); - } - internal Timer(Timer timer) : this(NDalicPINVOKE.new_Timer__SWIG_1(Timer.getCPtr(timer)), true) - { - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } /// @@ -206,22 +149,20 @@ namespace Tizen.NUI } /// - /// Gets/Sets the interval of the timer. + /// Tells whether the timer is running. /// - /// For setter, this sets a new interval on the timer and starts the timer.
- /// Cancels the previous timer. - ///
- /// 4 - public uint Interval + /// Whether the timer is started or not. + /// 3 + public bool IsRunning() { - get - { - return GetInterval(); - } - set - { - SetInterval(value); - } + bool ret = NDalicPINVOKE.Timer_IsRunning(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Timer obj) + { + return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; } /// @@ -246,25 +187,81 @@ namespace Tizen.NUI return ret; } + internal TimerSignalType TickSignal() + { + TimerSignalType ret = new TimerSignalType(NDalicPINVOKE.Timer_TickSignal(swigCPtr), false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + /// - /// Tells whether the timer is running. + /// Dispose. /// - /// Whether the timer is started or not. /// 3 - public bool IsRunning() + protected override void Dispose(DisposeTypes type) { - bool ret = NDalicPINVOKE.Timer_IsRunning(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; + NUILog.Debug($"(0x{swigCPtr.Handle:X}) Timer.Dispose(type={type}, disposed={disposed})"); + + if (this != null && _timerTickCallbackDelegate != null) + { + TickSignal().Disconnect(_timerTickCallbackOfNative); + } + + if (disposed) + { + return; + } + + if (type == DisposeTypes.Explicit) + { + //Called by User + //Release your own managed resources here. + //You should release all of your own disposable objects here. + } + + //Release your own unmanaged resources here. + //You should not access any managed member here except static instance. + //because the execution order of Finalizes is non-deterministic. + + if (swigCPtr.Handle != global::System.IntPtr.Zero) + { + if (swigCMemOwn) + { + swigCMemOwn = false; + NDalicPINVOKE.delete_Timer(swigCPtr); + } + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); + } + + played = false; + base.Dispose(type); } - internal TimerSignalType TickSignal() + private bool OnTick() { - TimerSignalType ret = new TimerSignalType(NDalicPINVOKE.Timer_TickSignal(swigCPtr), false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; + TickEventArgs e = new TickEventArgs(); + + if (played == false) + { + Tizen.Log.Fatal("NUI", $"(0x{swigCPtr.Handle:X}) OnTick() is called even played is false!"); + //throw new System.InvalidOperationException($"OnTick() excpetion!"); + } + + if (_timerTickEventHandler != null && played == true) + { + //here we send all data to user event handlers + return _timerTickEventHandler(this, e); + } + return false; } + /// + /// Event arguments that passed via the tick event. + /// + /// 3 + public class TickEventArgs : EventArgs + { + } } } diff --git a/src/Tizen.NUI/src/public/Touch.cs b/src/Tizen.NUI/src/public/Touch.cs index 8944ea9..b5b6972 100755 --- a/src/Tizen.NUI/src/public/Touch.cs +++ b/src/Tizen.NUI/src/public/Touch.cs @@ -30,64 +30,6 @@ namespace Tizen.NUI { private global::System.Runtime.InteropServices.HandleRef swigCPtr; - internal Touch(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.Touch_SWIGUpcast(cPtr), cMemoryOwn) - { - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); - } - - internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Touch obj) - { - return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; - } - - /// - /// Dispose. - /// - /// 3 - protected override void Dispose(DisposeTypes type) - { - if (disposed) - { - return; - } - - if (type == DisposeTypes.Explicit) - { - //Called by User - //Release your own managed resources here. - //You should release all of your own disposable objects here. - } - - //Release your own unmanaged resources here. - //You should not access any managed member here except static instance. - //because the execution order of Finalizes is non-deterministic. - - if (swigCPtr.Handle != global::System.IntPtr.Zero) - { - if (swigCMemOwn) - { - swigCMemOwn = false; - NDalicPINVOKE.delete_Touch(swigCPtr); - } - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); - } - - base.Dispose(type); - } - - - internal static Touch GetTouchFromPtr(global::System.IntPtr cPtr) - { - Touch ret = Registry.GetManagedBaseHandleFromNativePtr(cPtr) as Touch; - if (ret == null) - { - ret = new Touch(cPtr, false); - } - - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - /// /// An uninitialized touch instance.
/// Calling member functions with an uninitialized touch handle is not allowed.
@@ -103,6 +45,11 @@ namespace Tizen.NUI if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } + internal Touch(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.Touch_SWIGUpcast(cPtr), cMemoryOwn) + { + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); + } + /// /// Returns the time (in ms) that the touch event occurred. /// @@ -255,13 +202,6 @@ namespace Tizen.NUI return ret; } - internal Degree GetAngle(uint point) - { - Degree ret = new Degree(NDalicPINVOKE.Touch_GetAngle(swigCPtr, point), true); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - /// /// Get mouse device's button value (for example, right or left button) /// @@ -277,6 +217,65 @@ namespace Tizen.NUI return (MouseButton)ret; } + internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Touch obj) + { + return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; + } + + internal static Touch GetTouchFromPtr(global::System.IntPtr cPtr) + { + Touch ret = Registry.GetManagedBaseHandleFromNativePtr(cPtr) as Touch; + if (ret == null) + { + ret = new Touch(cPtr, false); + } + + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + internal Degree GetAngle(uint point) + { + Degree ret = new Degree(NDalicPINVOKE.Touch_GetAngle(swigCPtr, point), true); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + /// + /// Dispose. + /// + /// 3 + protected override void Dispose(DisposeTypes type) + { + if (disposed) + { + return; + } + + if (type == DisposeTypes.Explicit) + { + //Called by User + //Release your own managed resources here. + //You should release all of your own disposable objects here. + } + + //Release your own unmanaged resources here. + //You should not access any managed member here except static instance. + //because the execution order of Finalizes is non-deterministic. + + if (swigCPtr.Handle != global::System.IntPtr.Zero) + { + if (swigCMemOwn) + { + swigCMemOwn = false; + NDalicPINVOKE.delete_Touch(swigCPtr); + } + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); + } + + base.Dispose(type); + } + } /// diff --git a/src/Tizen.NUI/src/public/TransitionData.cs b/src/Tizen.NUI/src/public/TransitionData.cs index e1ec255..6eaf34d 100755 --- a/src/Tizen.NUI/src/public/TransitionData.cs +++ b/src/Tizen.NUI/src/public/TransitionData.cs @@ -25,53 +25,6 @@ namespace Tizen.NUI { private global::System.Runtime.InteropServices.HandleRef swigCPtr; - internal TransitionData(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.TransitionData_SWIGUpcast(cPtr), cMemoryOwn) - { - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); - } - - internal static global::System.Runtime.InteropServices.HandleRef getCPtr(TransitionData obj) - { - return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; - } - - /// - /// Dispose. - /// - /// The dispose type - /// 3 - protected override void Dispose(DisposeTypes type) - { - if (disposed) - { - return; - } - - if (type == DisposeTypes.Explicit) - { - //Called by User - //Release your own managed resources here. - //You should release all of your own disposable objects here. - - } - - //Release your own unmanaged resources here. - //You should not access any managed member here except static instance. - //because the execution order of Finalizes is non-deterministic. - - if (swigCPtr.Handle != global::System.IntPtr.Zero) - { - if (swigCMemOwn) - { - swigCMemOwn = false; - NDalicPINVOKE.delete_TransitionData(swigCPtr); - } - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); - } - - base.Dispose(type); - } - /// /// Create an instance of TransitionData. /// @@ -104,6 +57,11 @@ namespace Tizen.NUI if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } + internal TransitionData(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.TransitionData_SWIGUpcast(cPtr), cMemoryOwn) + { + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); + } + /// /// returns the count of the individual property transitions stored within this handle. /// @@ -129,6 +87,48 @@ namespace Tizen.NUI return ret; } + internal static global::System.Runtime.InteropServices.HandleRef getCPtr(TransitionData obj) + { + return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; + } + + /// + /// Dispose. + /// + /// The dispose type + /// 3 + protected override void Dispose(DisposeTypes type) + { + if (disposed) + { + return; + } + + if (type == DisposeTypes.Explicit) + { + //Called by User + //Release your own managed resources here. + //You should release all of your own disposable objects here. + + } + + //Release your own unmanaged resources here. + //You should not access any managed member here except static instance. + //because the execution order of Finalizes is non-deterministic. + + if (swigCPtr.Handle != global::System.IntPtr.Zero) + { + if (swigCMemOwn) + { + swigCMemOwn = false; + NDalicPINVOKE.delete_TransitionData(swigCPtr); + } + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); + } + + base.Dispose(type); + } + } } \ No newline at end of file diff --git a/src/Tizen.NUI/src/public/TypeInfo.cs b/src/Tizen.NUI/src/public/TypeInfo.cs index ae47d52..0155c42 100755 --- a/src/Tizen.NUI/src/public/TypeInfo.cs +++ b/src/Tizen.NUI/src/public/TypeInfo.cs @@ -26,53 +26,6 @@ namespace Tizen.NUI { private global::System.Runtime.InteropServices.HandleRef swigCPtr; - internal TypeInfo(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.TypeInfo_SWIGUpcast(cPtr), cMemoryOwn) - { - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); - } - - internal static global::System.Runtime.InteropServices.HandleRef getCPtr(TypeInfo obj) - { - return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; - } - - /// - /// Dispose. - /// - /// The dispose type - /// 3 - protected override void Dispose(DisposeTypes type) - { - if (disposed) - { - return; - } - - if (type == DisposeTypes.Explicit) - { - //Called by User - //Release your own managed resources here. - //You should release all of your own disposable objects here. - - } - - //Release your own unmanaged resources here. - //You should not access any managed member here except static instance. - //because the execution order of Finalizes is non-deterministic. - - if (swigCPtr.Handle != global::System.IntPtr.Zero) - { - if (swigCMemOwn) - { - swigCMemOwn = false; - NDalicPINVOKE.delete_TypeInfo(swigCPtr); - } - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); - } - - base.Dispose(type); - } - /// /// Creates TypeInfo object. /// @@ -92,6 +45,11 @@ namespace Tizen.NUI if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } + internal TypeInfo(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.TypeInfo_SWIGUpcast(cPtr), cMemoryOwn) + { + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); + } + /// /// Retrieves the type name for this type. /// @@ -154,6 +112,48 @@ namespace Tizen.NUI return ret; } + internal static global::System.Runtime.InteropServices.HandleRef getCPtr(TypeInfo obj) + { + return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; + } + + /// + /// Dispose. + /// + /// The dispose type + /// 3 + protected override void Dispose(DisposeTypes type) + { + if (disposed) + { + return; + } + + if (type == DisposeTypes.Explicit) + { + //Called by User + //Release your own managed resources here. + //You should release all of your own disposable objects here. + + } + + //Release your own unmanaged resources here. + //You should not access any managed member here except static instance. + //because the execution order of Finalizes is non-deterministic. + + if (swigCPtr.Handle != global::System.IntPtr.Zero) + { + if (swigCMemOwn) + { + swigCMemOwn = false; + NDalicPINVOKE.delete_TypeInfo(swigCPtr); + } + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); + } + + base.Dispose(type); + } + } } \ No newline at end of file diff --git a/src/Tizen.NUI/src/public/TypeRegistry.cs b/src/Tizen.NUI/src/public/TypeRegistry.cs index 64f9f9a..ec00a4e 100755 --- a/src/Tizen.NUI/src/public/TypeRegistry.cs +++ b/src/Tizen.NUI/src/public/TypeRegistry.cs @@ -159,3 +159,4 @@ namespace Tizen.NUI } } + diff --git a/src/Tizen.NUI/src/public/UIComponents/Button.cs b/src/Tizen.NUI/src/public/UIComponents/Button.cs index c286f8a..012aac0 100755 --- a/src/Tizen.NUI/src/public/UIComponents/Button.cs +++ b/src/Tizen.NUI/src/public/UIComponents/Button.cs @@ -402,95 +402,38 @@ namespace Tizen.NUI.UIComponents }); private global::System.Runtime.InteropServices.HandleRef swigCPtr; - - internal Button(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.Button_SWIGUpcast(cPtr), cMemoryOwn) - { - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); - } - - internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Button obj) - { - return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; - } + private EventHandlerWithReturnType _clickedEventHandler; + private ClickedCallbackType _clickedCallback; + private EventHandlerWithReturnType _pressedEventHandler; + private PressedCallbackType _pressedCallback; + private EventHandlerWithReturnType _releasedEventHandler; + private ReleasedCallbackType _releasedCallback; + private EventHandlerWithReturnType _stateChangedEventHandler; + private StateChangedCallback _stateChangedCallback; /// - /// To dispose the button instance. + /// Creates an uninitialized button.
+ /// Only the derived versions can be instantiated.
///
/// 3 - protected override void Dispose(DisposeTypes type) + public Button() : this(NDalicPINVOKE.new_Button__SWIG_0(), true) { - if (disposed) - { - return; - } - - if (type == DisposeTypes.Explicit) - { - //Called by User - //Release your own managed resources here. - //You should release all of your own disposable objects here. - - } - - //Release your own unmanaged resources here. - //You should not access any managed member here except static instance. - //because the execution order of Finalizes is non-deterministic. - if (this != null) - { - DisConnectFromSignals(); - } - - if (swigCPtr.Handle != global::System.IntPtr.Zero) - { - if (swigCMemOwn) - { - swigCMemOwn = false; - NDalicPINVOKE.delete_Button(swigCPtr); - } - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); - } - - base.Dispose(type); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } - private void DisConnectFromSignals() + internal Button(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.Button_SWIGUpcast(cPtr), cMemoryOwn) { - // Save current CPtr. - global::System.Runtime.InteropServices.HandleRef currentCPtr = swigCPtr; - - // Use BaseHandle CPtr as current might have been deleted already in derived classes. - swigCPtr = GetBaseHandleCPtrHandleRef; - - if (_stateChangedCallback != null) - { - StateChangedSignal().Disconnect(_stateChangedCallback); - } - - if (_releasedCallback != null) - { - ReleasedSignal().Disconnect(_releasedCallback); - } - - if (_pressedCallback != null) - { - this.PressedSignal().Disconnect(_pressedCallback); - } - - if (_clickedCallback != null) - { - ClickedSignal().Disconnect(_clickedCallback); - } - - // BaseHandle CPtr is used in Registry and there is danger of deletion if we keep using it here. - // Restore current CPtr. - swigCPtr = currentCPtr; + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); } - - private EventHandlerWithReturnType _clickedEventHandler; [UnmanagedFunctionPointer(CallingConvention.StdCall)] private delegate bool ClickedCallbackType(global::System.IntPtr data); - private ClickedCallbackType _clickedCallback; + [UnmanagedFunctionPointer(CallingConvention.StdCall)] + private delegate bool PressedCallbackType(global::System.IntPtr data); + [UnmanagedFunctionPointer(CallingConvention.StdCall)] + private delegate bool ReleasedCallbackType(global::System.IntPtr data); + [UnmanagedFunctionPointer(CallingConvention.StdCall)] + private delegate bool StateChangedCallback(global::System.IntPtr data); /// /// The Clicked event will be triggered when the button is touched and the touch point doesn't leave the boundary of the button. @@ -520,23 +463,6 @@ namespace Tizen.NUI.UIComponents } } - - private bool OnClicked(IntPtr data) - { - if (_clickedEventHandler != null) - { - return _clickedEventHandler(this, null); - } - return false; - } - - - - private EventHandlerWithReturnType _pressedEventHandler; - [UnmanagedFunctionPointer(CallingConvention.StdCall)] - private delegate bool PressedCallbackType(global::System.IntPtr data); - private PressedCallbackType _pressedCallback; - /// /// The Pressed event will be triggered when the button is touched. /// @@ -565,22 +491,6 @@ namespace Tizen.NUI.UIComponents } } - private bool OnPressed(IntPtr data) - { - if (_pressedEventHandler != null) - { - return _pressedEventHandler(this, null); - } - return false; - } - - - - private EventHandlerWithReturnType _releasedEventHandler; - [UnmanagedFunctionPointer(CallingConvention.StdCall)] - private delegate bool ReleasedCallbackType(global::System.IntPtr data); - private ReleasedCallbackType _releasedCallback; - /// /// The Released event will be triggered when the button is touched and the touch point leaves the boundary of the button. /// @@ -609,21 +519,6 @@ namespace Tizen.NUI.UIComponents } } - private bool OnReleased(IntPtr data) - { - if (_releasedEventHandler != null) - { - return _releasedEventHandler(this, null); - } - return false; - } - - - private EventHandlerWithReturnType _stateChangedEventHandler; - [UnmanagedFunctionPointer(CallingConvention.StdCall)] - private delegate bool StateChangedCallback(global::System.IntPtr data); - private StateChangedCallback _stateChangedCallback; - /// /// The StateChanged event will be triggered when the button's state is changed. /// @@ -652,16 +547,30 @@ namespace Tizen.NUI.UIComponents } } - private bool OnStateChanged(IntPtr data) + /// + /// Enumeration for describing the position, the text label can be, in relation to the control (and foreground/icon). + /// + /// 3 + public enum Align { - if (_stateChangedEventHandler != null) - { - return _stateChangedEventHandler(this, null); - } - return false; + /// + /// At the start of the control before the foreground or icon. + /// + Begin, + /// + /// At the end of the control after the foreground or icon. + /// + End, + /// + /// At the top of the control above the foreground or icon. + /// + Top, + /// + /// At the bottom of the control below the foreground or icon. + /// + Bottom } - /// /// Gets or sets the unselected button foreground or icon visual. /// @@ -838,67 +747,6 @@ namespace Tizen.NUI.UIComponents } } - internal new class Property - { - internal static readonly int UNSELECTED_VISUAL = NDalicManualPINVOKE.Button_Property_UNSELECTED_VISUAL_get(); - internal static readonly int SELECTED_VISUAL = NDalicManualPINVOKE.Button_Property_SELECTED_VISUAL_get(); - internal static readonly int DISABLED_SELECTED_VISUAL = NDalicManualPINVOKE.Button_Property_DISABLED_SELECTED_VISUAL_get(); - internal static readonly int DISABLED_UNSELECTED_VISUAL = NDalicManualPINVOKE.Button_Property_DISABLED_UNSELECTED_VISUAL_get(); - internal static readonly int UNSELECTED_BACKGROUND_VISUAL = NDalicManualPINVOKE.Button_Property_UNSELECTED_BACKGROUND_VISUAL_get(); - internal static readonly int SELECTED_BACKGROUND_VISUAL = NDalicManualPINVOKE.Button_Property_SELECTED_BACKGROUND_VISUAL_get(); - internal static readonly int DISABLED_UNSELECTED_BACKGROUND_VISUAL = NDalicManualPINVOKE.Button_Property_DISABLED_UNSELECTED_BACKGROUND_VISUAL_get(); - internal static readonly int DISABLED_SELECTED_BACKGROUND_VISUAL = NDalicManualPINVOKE.Button_Property_DISABLED_SELECTED_BACKGROUND_VISUAL_get(); - internal static readonly int LABEL_RELATIVE_ALIGNMENT = NDalicManualPINVOKE.Button_Property_LABEL_RELATIVE_ALIGNMENT_get(); - internal static readonly int LABEL_PADDING = NDalicManualPINVOKE.Button_Property_LABEL_PADDING_get(); - internal static readonly int FOREGROUND_VISUAL_PADDING = NDalicManualPINVOKE.Button_Property_VISUAL_PADDING_get(); - internal static readonly int AUTO_REPEATING = NDalicPINVOKE.Button_Property_AUTO_REPEATING_get(); - internal static readonly int INITIAL_AUTO_REPEATING_DELAY = NDalicPINVOKE.Button_Property_INITIAL_AUTO_REPEATING_DELAY_get(); - internal static readonly int NEXT_AUTO_REPEATING_DELAY = NDalicPINVOKE.Button_Property_NEXT_AUTO_REPEATING_DELAY_get(); - internal static readonly int TOGGLABLE = NDalicPINVOKE.Button_Property_TOGGLABLE_get(); - internal static readonly int SELECTED = NDalicPINVOKE.Button_Property_SELECTED_get(); - internal static readonly int UNSELECTED_COLOR = NDalicPINVOKE.Button_Property_UNSELECTED_COLOR_get(); - internal static readonly int SELECTED_COLOR = NDalicPINVOKE.Button_Property_SELECTED_COLOR_get(); - internal static readonly int LABEL = NDalicPINVOKE.Button_Property_LABEL_get(); - } - - /// - /// Creates an uninitialized button.
- /// Only the derived versions can be instantiated.
- ///
- /// 3 - public Button() : this(NDalicPINVOKE.new_Button__SWIG_0(), true) - { - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - internal ButtonSignal PressedSignal() - { - ButtonSignal ret = new ButtonSignal(NDalicPINVOKE.Button_PressedSignal(swigCPtr), false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - internal ButtonSignal ReleasedSignal() - { - ButtonSignal ret = new ButtonSignal(NDalicPINVOKE.Button_ReleasedSignal(swigCPtr), false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - internal ButtonSignal ClickedSignal() - { - ButtonSignal ret = new ButtonSignal(NDalicPINVOKE.Button_ClickedSignal(swigCPtr), false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - internal ButtonSignal StateChangedSignal() - { - ButtonSignal ret = new ButtonSignal(NDalicPINVOKE.Button_StateChangedSignal(swigCPtr), false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - /// /// If the autorepeating property is set to true, then the togglable property is set to false. /// @@ -1043,30 +891,169 @@ namespace Tizen.NUI.UIComponents } } + internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Button obj) + { + return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; + } + + internal ButtonSignal PressedSignal() + { + ButtonSignal ret = new ButtonSignal(NDalicPINVOKE.Button_PressedSignal(swigCPtr), false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + internal ButtonSignal ReleasedSignal() + { + ButtonSignal ret = new ButtonSignal(NDalicPINVOKE.Button_ReleasedSignal(swigCPtr), false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + internal ButtonSignal ClickedSignal() + { + ButtonSignal ret = new ButtonSignal(NDalicPINVOKE.Button_ClickedSignal(swigCPtr), false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + internal ButtonSignal StateChangedSignal() + { + ButtonSignal ret = new ButtonSignal(NDalicPINVOKE.Button_StateChangedSignal(swigCPtr), false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + /// - /// Enumeration for describing the position, the text label can be, in relation to the control (and foreground/icon). + /// To dispose the button instance. /// /// 3 - public enum Align + protected override void Dispose(DisposeTypes type) { - /// - /// At the start of the control before the foreground or icon. - /// - Begin, - /// - /// At the end of the control after the foreground or icon. - /// - End, - /// - /// At the top of the control above the foreground or icon. - /// - Top, - /// - /// At the bottom of the control below the foreground or icon. - /// - Bottom + if (disposed) + { + return; + } + + if (type == DisposeTypes.Explicit) + { + //Called by User + //Release your own managed resources here. + //You should release all of your own disposable objects here. + + } + + //Release your own unmanaged resources here. + //You should not access any managed member here except static instance. + //because the execution order of Finalizes is non-deterministic. + if (this != null) + { + DisConnectFromSignals(); + } + + if (swigCPtr.Handle != global::System.IntPtr.Zero) + { + if (swigCMemOwn) + { + swigCMemOwn = false; + NDalicPINVOKE.delete_Button(swigCPtr); + } + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); + } + + base.Dispose(type); } - } + private void DisConnectFromSignals() + { + // Save current CPtr. + global::System.Runtime.InteropServices.HandleRef currentCPtr = swigCPtr; + + // Use BaseHandle CPtr as current might have been deleted already in derived classes. + swigCPtr = GetBaseHandleCPtrHandleRef; + + if (_stateChangedCallback != null) + { + StateChangedSignal().Disconnect(_stateChangedCallback); + } + + if (_releasedCallback != null) + { + ReleasedSignal().Disconnect(_releasedCallback); + } + + if (_pressedCallback != null) + { + this.PressedSignal().Disconnect(_pressedCallback); + } + + if (_clickedCallback != null) + { + ClickedSignal().Disconnect(_clickedCallback); + } + + // BaseHandle CPtr is used in Registry and there is danger of deletion if we keep using it here. + // Restore current CPtr. + swigCPtr = currentCPtr; + } + + private bool OnClicked(IntPtr data) + { + if (_clickedEventHandler != null) + { + return _clickedEventHandler(this, null); + } + return false; + } + + private bool OnPressed(IntPtr data) + { + if (_pressedEventHandler != null) + { + return _pressedEventHandler(this, null); + } + return false; + } + + private bool OnReleased(IntPtr data) + { + if (_releasedEventHandler != null) + { + return _releasedEventHandler(this, null); + } + return false; + } + private bool OnStateChanged(IntPtr data) + { + if (_stateChangedEventHandler != null) + { + return _stateChangedEventHandler(this, null); + } + return false; + } + + internal new class Property + { + internal static readonly int UNSELECTED_VISUAL = NDalicManualPINVOKE.Button_Property_UNSELECTED_VISUAL_get(); + internal static readonly int SELECTED_VISUAL = NDalicManualPINVOKE.Button_Property_SELECTED_VISUAL_get(); + internal static readonly int DISABLED_SELECTED_VISUAL = NDalicManualPINVOKE.Button_Property_DISABLED_SELECTED_VISUAL_get(); + internal static readonly int DISABLED_UNSELECTED_VISUAL = NDalicManualPINVOKE.Button_Property_DISABLED_UNSELECTED_VISUAL_get(); + internal static readonly int UNSELECTED_BACKGROUND_VISUAL = NDalicManualPINVOKE.Button_Property_UNSELECTED_BACKGROUND_VISUAL_get(); + internal static readonly int SELECTED_BACKGROUND_VISUAL = NDalicManualPINVOKE.Button_Property_SELECTED_BACKGROUND_VISUAL_get(); + internal static readonly int DISABLED_UNSELECTED_BACKGROUND_VISUAL = NDalicManualPINVOKE.Button_Property_DISABLED_UNSELECTED_BACKGROUND_VISUAL_get(); + internal static readonly int DISABLED_SELECTED_BACKGROUND_VISUAL = NDalicManualPINVOKE.Button_Property_DISABLED_SELECTED_BACKGROUND_VISUAL_get(); + internal static readonly int LABEL_RELATIVE_ALIGNMENT = NDalicManualPINVOKE.Button_Property_LABEL_RELATIVE_ALIGNMENT_get(); + internal static readonly int LABEL_PADDING = NDalicManualPINVOKE.Button_Property_LABEL_PADDING_get(); + internal static readonly int FOREGROUND_VISUAL_PADDING = NDalicManualPINVOKE.Button_Property_VISUAL_PADDING_get(); + internal static readonly int AUTO_REPEATING = NDalicPINVOKE.Button_Property_AUTO_REPEATING_get(); + internal static readonly int INITIAL_AUTO_REPEATING_DELAY = NDalicPINVOKE.Button_Property_INITIAL_AUTO_REPEATING_DELAY_get(); + internal static readonly int NEXT_AUTO_REPEATING_DELAY = NDalicPINVOKE.Button_Property_NEXT_AUTO_REPEATING_DELAY_get(); + internal static readonly int TOGGLABLE = NDalicPINVOKE.Button_Property_TOGGLABLE_get(); + internal static readonly int SELECTED = NDalicPINVOKE.Button_Property_SELECTED_get(); + internal static readonly int UNSELECTED_COLOR = NDalicPINVOKE.Button_Property_UNSELECTED_COLOR_get(); + internal static readonly int SELECTED_COLOR = NDalicPINVOKE.Button_Property_SELECTED_COLOR_get(); + internal static readonly int LABEL = NDalicPINVOKE.Button_Property_LABEL_get(); + } + } } diff --git a/src/Tizen.NUI/src/public/UIComponents/CheckBoxButton.cs b/src/Tizen.NUI/src/public/UIComponents/CheckBoxButton.cs index 996bedb..3bba491 100755 --- a/src/Tizen.NUI/src/public/UIComponents/CheckBoxButton.cs +++ b/src/Tizen.NUI/src/public/UIComponents/CheckBoxButton.cs @@ -17,7 +17,6 @@ namespace Tizen.NUI.UIComponents { - /// /// The CheckBoxButton provides a checkbox button which the user can check or uncheck.
/// By default, the CheckBoxButton emits a Button.Clicked event when the button changes its state to selected or unselected.
@@ -31,6 +30,15 @@ namespace Tizen.NUI.UIComponents { private global::System.Runtime.InteropServices.HandleRef swigCPtr; + /// + /// Creates an initialized CheckBoxButton. + /// + /// 3 + public CheckBoxButton() : this(NDalicPINVOKE.CheckBoxButton_New(), true) + { + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + internal CheckBoxButton(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.CheckBoxButton_SWIGUpcast(cPtr), cMemoryOwn) { swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); @@ -41,7 +49,6 @@ namespace Tizen.NUI.UIComponents return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; } - /// /// To dispose the CheckBoxButton instance. /// @@ -76,17 +83,5 @@ namespace Tizen.NUI.UIComponents base.Dispose(type); } - - /// - /// Creates an initialized CheckBoxButton. - /// - /// 3 - public CheckBoxButton() : this(NDalicPINVOKE.CheckBoxButton_New(), true) - { - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - - } - } - } \ No newline at end of file diff --git a/src/Tizen.NUI/src/public/UIComponents/Popup.cs b/src/Tizen.NUI/src/public/UIComponents/Popup.cs index 89b60fc..f0cbc69 100755 --- a/src/Tizen.NUI/src/public/UIComponents/Popup.cs +++ b/src/Tizen.NUI/src/public/UIComponents/Popup.cs @@ -202,35 +202,35 @@ namespace Tizen.NUI.UIComponents switch ((ContextualModeType)newValue) { case ContextualModeType.NonContextual: - { - valueToString = "NON_CONTEXTUAL"; - break; - } + { + valueToString = "NON_CONTEXTUAL"; + break; + } case ContextualModeType.Above: - { - valueToString = "ABOVE"; - break; - } + { + valueToString = "ABOVE"; + break; + } case ContextualModeType.Rright: - { - valueToString = "RIGHT"; - break; - } + { + valueToString = "RIGHT"; + break; + } case ContextualModeType.Below: - { - valueToString = "BELOW"; - break; - } + { + valueToString = "BELOW"; + break; + } case ContextualModeType.Left: - { - valueToString = "LEFT"; - break; - } + { + valueToString = "LEFT"; + break; + } default: - { - valueToString = "BELOW"; - break; - } + { + valueToString = "BELOW"; + break; + } } Tizen.NUI.Object.SetProperty(popup.swigCPtr, Popup.Property.CONTEXTUAL_MODE, new Tizen.NUI.PropertyValue(valueToString)); } @@ -287,30 +287,30 @@ namespace Tizen.NUI.UIComponents switch ((AnimationModeType)newValue) { case AnimationModeType.None: - { - valueToString = "NONE"; - break; - } + { + valueToString = "NONE"; + break; + } case AnimationModeType.Zoom: - { - valueToString = "ZOOM"; - break; - } + { + valueToString = "ZOOM"; + break; + } case AnimationModeType.Fade: - { - valueToString = "FADE"; - break; - } + { + valueToString = "FADE"; + break; + } case AnimationModeType.Custom: - { - valueToString = "CUSTOM"; - break; - } + { + valueToString = "CUSTOM"; + break; + } default: - { - valueToString = "FADE"; - break; - } + { + valueToString = "FADE"; + break; + } } Tizen.NUI.Object.SetProperty(popup.swigCPtr, Popup.Property.ANIMATION_MODE, new Tizen.NUI.PropertyValue(valueToString)); } @@ -526,148 +526,41 @@ namespace Tizen.NUI.UIComponents }); private global::System.Runtime.InteropServices.HandleRef swigCPtr; - - internal Popup(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.Popup_SWIGUpcast(cPtr), cMemoryOwn) - { - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); - } - - internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Popup obj) - { - return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; - } - - /// - /// Dispose. - /// - /// The dispose type - /// 3 - protected override void Dispose(DisposeTypes type) - { - if (disposed) - { - return; - } - - if (type == DisposeTypes.Explicit) - { - //Called by User - //Release your own managed resources here. - //You should release all of your own disposable objects here. - - } - - //Release your own unmanaged resources here. - //You should not access any managed member here except static instance. - //because the execution order of Finalizes is non-deterministic. - if (this != null) - { - if (_popUpHiddenEventCallbackDelegate != null) - { - HiddenSignal().Disconnect(_popUpHiddenEventCallbackDelegate); - } - - if (_popUpHidingEventCallbackDelegate != null) - { - HidingSignal().Disconnect(_popUpHidingEventCallbackDelegate); - } - } - - if (_popUpShownEventCallbackDelegate != null) - { - ShownSignal().Disconnect(_popUpShownEventCallbackDelegate); - } - - if (_popUpShowingEventCallbackDelegate != null) - { - ShowingSignal().Disconnect(_popUpShowingEventCallbackDelegate); - } - - if (_popUpOutsideTouchedEventCallbackDelegate != null) - { - this.OutsideTouchedSignal().Disconnect(_popUpOutsideTouchedEventCallbackDelegate); - } - - if (swigCPtr.Handle != global::System.IntPtr.Zero) - { - if (swigCMemOwn) - { - swigCMemOwn = false; - NDalicPINVOKE.delete_Popup(swigCPtr); - } - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); - } - - base.Dispose(type); - } - - - - - /// - /// Event arguments that passed via the OutsideTouchedEvent. - /// - /// 3 - public class TouchedOutsideEventArgs : EventArgs - { - } - - /// - /// Event arguments that passed via the ShowingEventArgs. - /// - /// 3 - public class ShowingEventArgs : EventArgs - { - } - - /// - /// Event arguments that passed via the ShownEventArgs. - /// - /// 3 - public class ShownEventArgs : EventArgs - { - } + private EventHandler _popUpOutsideTouchedEventHandler; + private OutsideTouchedEventCallbackDelegate _popUpOutsideTouchedEventCallbackDelegate; + private EventHandler _popUpShowingEventHandler; + private ShowingEventCallbackDelegate _popUpShowingEventCallbackDelegate; + private EventHandler _popUpShownEventHandler; + private ShownEventCallbackDelegate _popUpShownEventCallbackDelegate; + private EventHandler _popUpHidingEventHandler; + private HidingEventCallbackDelegate _popUpHidingEventCallbackDelegate; + private EventHandler _popUpHiddenEventHandler; + private HiddenEventCallbackDelegate _popUpHiddenEventCallbackDelegate; /// - /// Event arguments that passed via the HidingEventArgs. + /// Creates the popup. /// /// 3 - public class HidingEventArgs : EventArgs + public Popup() : this(NDalicPINVOKE.Popup_New(), true) { + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } - /// - /// Event arguments that passed via the HiddenEventArgs. - /// - /// 3 - public class HiddenEventArgs : EventArgs + internal Popup(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.Popup_SWIGUpcast(cPtr), cMemoryOwn) { + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); } [UnmanagedFunctionPointer(CallingConvention.StdCall)] private delegate void OutsideTouchedEventCallbackDelegate(); - private EventHandler _popUpOutsideTouchedEventHandler; - private OutsideTouchedEventCallbackDelegate _popUpOutsideTouchedEventCallbackDelegate; - [UnmanagedFunctionPointer(CallingConvention.StdCall)] private delegate void ShowingEventCallbackDelegate(); - private EventHandler _popUpShowingEventHandler; - private ShowingEventCallbackDelegate _popUpShowingEventCallbackDelegate; - [UnmanagedFunctionPointer(CallingConvention.StdCall)] private delegate void ShownEventCallbackDelegate(); - private EventHandler _popUpShownEventHandler; - private ShownEventCallbackDelegate _popUpShownEventCallbackDelegate; - [UnmanagedFunctionPointer(CallingConvention.StdCall)] private delegate void HidingEventCallbackDelegate(); - private EventHandler _popUpHidingEventHandler; - private HidingEventCallbackDelegate _popUpHidingEventCallbackDelegate; - [UnmanagedFunctionPointer(CallingConvention.StdCall)] private delegate void HiddenEventCallbackDelegate(); - private EventHandler _popUpHiddenEventHandler; - private HiddenEventCallbackDelegate _popUpHiddenEventCallbackDelegate; /// /// An event is sent when the user has touched outside the dialog. @@ -694,18 +587,6 @@ namespace Tizen.NUI.UIComponents } } - // Callback for Popup OutsideTouchedSignal - private void OnOutsideTouched() - { - TouchedOutsideEventArgs e = new TouchedOutsideEventArgs(); - - if (_popUpOutsideTouchedEventHandler != null) - { - //here we send all data to user event handlers - _popUpOutsideTouchedEventHandler(this, e); - } - } - /// /// An event is sent when the popup starts showing. /// @@ -731,19 +612,6 @@ namespace Tizen.NUI.UIComponents } } - // Callback for ShowingSignal - private void OnShowing() - { - ShowingEventArgs e = new ShowingEventArgs(); - - if (_popUpShowingEventHandler != null) - { - //here we send all data to user event handlers - _popUpShowingEventHandler(this, e); - } - } - - /// /// An event is sent when the popup has been fully displayed. /// @@ -769,18 +637,6 @@ namespace Tizen.NUI.UIComponents } } - // Callback for ShownSignal - private void OnShown() - { - ShownEventArgs e = new ShownEventArgs(); - - if (_popUpShownEventHandler != null) - { - //here we send all data to user event handlers - _popUpShownEventHandler(this, e); - } - } - /// /// An event is sent when the popup starts to hide. /// @@ -806,18 +662,6 @@ namespace Tizen.NUI.UIComponents } } - // Callback for HidingSignal - private void OnHiding() - { - HidingEventArgs e = new HidingEventArgs(); - - if (_popUpHidingEventHandler != null) - { - //here we send all data to user event handlers - _popUpHidingEventHandler(this, e); - } - } - /// /// An event is sent when the popup has been completely hidden. /// @@ -843,217 +687,32 @@ namespace Tizen.NUI.UIComponents } } - // Callback for HiddenSignal - private void OnHidden() + /// + /// The display states of the popup. + /// + /// 3 + public enum DisplayStateType { - HiddenEventArgs e = new HiddenEventArgs(); - - if (_popUpHiddenEventHandler != null) - { - //here we send all data to user event handlers - _popUpHiddenEventHandler(this, e); - } - } - - internal new class Property - { - internal static readonly int TITLE = NDalicPINVOKE.Popup_Property_TITLE_get(); - internal static readonly int CONTENT = NDalicPINVOKE.Popup_Property_CONTENT_get(); - internal static readonly int FOOTER = NDalicPINVOKE.Popup_Property_FOOTER_get(); - internal static readonly int DISPLAY_STATE = NDalicPINVOKE.Popup_Property_DISPLAY_STATE_get(); - internal static readonly int TOUCH_TRANSPARENT = NDalicPINVOKE.Popup_Property_TOUCH_TRANSPARENT_get(); - internal static readonly int TAIL_VISIBILITY = NDalicPINVOKE.Popup_Property_TAIL_VISIBILITY_get(); - internal static readonly int TAIL_POSITION = NDalicPINVOKE.Popup_Property_TAIL_POSITION_get(); - internal static readonly int CONTEXTUAL_MODE = NDalicPINVOKE.Popup_Property_CONTEXTUAL_MODE_get(); - internal static readonly int ANIMATION_DURATION = NDalicPINVOKE.Popup_Property_ANIMATION_DURATION_get(); - internal static readonly int ANIMATION_MODE = NDalicPINVOKE.Popup_Property_ANIMATION_MODE_get(); - internal static readonly int ENTRY_ANIMATION = NDalicPINVOKE.Popup_Property_ENTRY_ANIMATION_get(); - internal static readonly int EXIT_ANIMATION = NDalicPINVOKE.Popup_Property_EXIT_ANIMATION_get(); - internal static readonly int AUTO_HIDE_DELAY = NDalicPINVOKE.Popup_Property_AUTO_HIDE_DELAY_get(); - internal static readonly int BACKING_ENABLED = NDalicPINVOKE.Popup_Property_BACKING_ENABLED_get(); - internal static readonly int BACKING_COLOR = NDalicPINVOKE.Popup_Property_BACKING_COLOR_get(); - internal static readonly int POPUP_BACKGROUND_IMAGE = NDalicPINVOKE.Popup_Property_POPUP_BACKGROUND_IMAGE_get(); - internal static readonly int POPUP_BACKGROUND_BORDER = NDalicPINVOKE.Popup_Property_POPUP_BACKGROUND_BORDER_get(); - internal static readonly int TAIL_UP_IMAGE = NDalicPINVOKE.Popup_Property_TAIL_UP_IMAGE_get(); - internal static readonly int TAIL_DOWN_IMAGE = NDalicPINVOKE.Popup_Property_TAIL_DOWN_IMAGE_get(); - internal static readonly int TAIL_LEFT_IMAGE = NDalicPINVOKE.Popup_Property_TAIL_LEFT_IMAGE_get(); - internal static readonly int TAIL_RIGHT_IMAGE = NDalicPINVOKE.Popup_Property_TAIL_RIGHT_IMAGE_get(); - } - - /// - /// Creates the popup. - /// - /// 3 - public Popup() : this(NDalicPINVOKE.Popup_New(), true) - { - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - - } - - /// - /// Sets the title for this popup. - /// - /// The actor to set the title. - /// 3 - public void SetTitle(View titleView) - { - NDalicPINVOKE.Popup_SetTitle(swigCPtr, View.getCPtr(titleView)); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - internal View GetTitle() - { - //to fix memory leak issue, match the handle count with native side. - IntPtr cPtr = NDalicPINVOKE.Popup_GetTitle(swigCPtr); - HandleRef CPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); - View ret = Registry.GetManagedBaseHandleFromNativePtr(CPtr.Handle) as View; - NDalicPINVOKE.delete_BaseHandle(CPtr); - CPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); - - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - /// - /// Sets the content actor. - /// - /// The actor to use. - /// 3 - public void SetContent(View content) - { - NDalicPINVOKE.Popup_SetContent(swigCPtr, View.getCPtr(content)); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - internal View GetContent() - { - //to fix memory leak issue, match the handle count with native side. - IntPtr cPtr = NDalicPINVOKE.Popup_GetContent(swigCPtr); - HandleRef CPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); - View ret = Registry.GetManagedBaseHandleFromNativePtr(CPtr.Handle) as View; - NDalicPINVOKE.delete_BaseHandle(CPtr); - CPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); - - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - /// - /// Sets the actor to use for the footer in this popup. - /// - /// The footer actor to be added to this popup. - /// 3 - public void SetFooter(View footer) - { - NDalicPINVOKE.Popup_SetFooter(swigCPtr, View.getCPtr(footer)); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - internal View GetFooter() - { - //to fix memory leak issue, match the handle count with native side. - IntPtr cPtr = NDalicPINVOKE.Popup_GetFooter(swigCPtr); - HandleRef CPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); - View ret = Registry.GetManagedBaseHandleFromNativePtr(CPtr.Handle) as View; - NDalicPINVOKE.delete_BaseHandle(CPtr); - CPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); - - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - /// - /// Sets the display state of popup.
- /// There are 4 total display states.
- /// Only 2 can be set, but all four can be read for better inspection of the current popup state.
- ///
- /// The other two states are getable, but not setable, and are there for consistency.
- ///
- /// | Value | Setting the state | Getting the state |
- /// |----------|--------------------------------|--------------------------------|
- /// | SHOWN | Show the popup | The popup is fully shown |
- /// | HIDDEN | Hide the popup | The popup is fully hidden |
- /// | SHOWING | | The popup is transitioning in |
- /// | HIDING | | The popup is transitioning out |
- ///
- /// All 4 states changes cause notifications via 4 respective signals that can be connected to.
- ///
- /// The desired display state to change to. - /// 3 - public void SetDisplayState(Popup.DisplayStateType displayState) - { - NDalicPINVOKE.Popup_SetDisplayState(swigCPtr, (int)displayState); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - internal Popup.DisplayStateType GetDisplayState() - { - Popup.DisplayStateType ret = (Popup.DisplayStateType)NDalicPINVOKE.Popup_GetDisplayState(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - internal VoidSignal OutsideTouchedSignal() - { - VoidSignal ret = new VoidSignal(NDalicPINVOKE.Popup_OutsideTouchedSignal(swigCPtr), false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - internal VoidSignal ShowingSignal() - { - VoidSignal ret = new VoidSignal(NDalicPINVOKE.Popup_ShowingSignal(swigCPtr), false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - internal VoidSignal ShownSignal() - { - VoidSignal ret = new VoidSignal(NDalicPINVOKE.Popup_ShownSignal(swigCPtr), false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - internal VoidSignal HidingSignal() - { - VoidSignal ret = new VoidSignal(NDalicPINVOKE.Popup_HidingSignal(swigCPtr), false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - internal VoidSignal HiddenSignal() - { - VoidSignal ret = new VoidSignal(NDalicPINVOKE.Popup_HiddenSignal(swigCPtr), false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - /// - /// The display states of the popup. - /// - /// 3 - public enum DisplayStateType - { - /// - /// The popup is transitioning in - /// - /// 3 - Showing, - /// - /// The popup is fully shown - /// - /// 3 - Shown, - /// - /// The popup is transitioning out - /// - /// 3 - Hiding, - /// - /// The popup is fully hidden - /// - /// 3 - Hidden + /// + /// The popup is transitioning in + /// + /// 3 + Showing, + /// + /// The popup is fully shown + /// + /// 3 + Shown, + /// + /// The popup is transitioning out + /// + /// 3 + Hiding, + /// + /// The popup is fully hidden + /// + /// 3 + Hidden } /// @@ -1135,6 +794,7 @@ namespace Tizen.NUI.UIComponents SetValue(TitleProperty, value); } } + /// /// The popup content. /// @@ -1150,6 +810,7 @@ namespace Tizen.NUI.UIComponents SetValue(ContentProperty, value); } } + /// /// The popup footer. /// @@ -1165,6 +826,7 @@ namespace Tizen.NUI.UIComponents SetValue(FooterProperty, value); } } + /// /// The popup display state. /// @@ -1180,6 +842,7 @@ namespace Tizen.NUI.UIComponents SetValue(DisplayStateProperty, value); } } + /// /// The touch transparent. /// @@ -1195,6 +858,7 @@ namespace Tizen.NUI.UIComponents SetValue(TouchTransparentProperty, value); } } + /// /// The popup tail visibility. /// @@ -1210,6 +874,7 @@ namespace Tizen.NUI.UIComponents SetValue(TailVisibilityProperty, value); } } + /// /// The popup tail position. /// @@ -1225,6 +890,7 @@ namespace Tizen.NUI.UIComponents SetValue(TailPositionProperty, value); } } + /// /// The contextual mode. /// @@ -1240,6 +906,7 @@ namespace Tizen.NUI.UIComponents SetValue(ContextualModeProperty, value); } } + /// /// The animation duration. /// @@ -1255,6 +922,7 @@ namespace Tizen.NUI.UIComponents SetValue(AnimationDurationProperty, value); } } + /// /// The animation mode. /// @@ -1270,6 +938,7 @@ namespace Tizen.NUI.UIComponents SetValue(AnimationModeProperty, value); } } + /// /// The entry animation. /// @@ -1285,6 +954,7 @@ namespace Tizen.NUI.UIComponents SetValue(EntryAnimationProperty, value); } } + /// /// The exit animation. /// @@ -1300,6 +970,7 @@ namespace Tizen.NUI.UIComponents SetValue(ExitAnimationProperty, value); } } + /// /// The auto hide delay. /// @@ -1315,6 +986,7 @@ namespace Tizen.NUI.UIComponents SetValue(AutoHideDelayProperty, value); } } + /// /// The backing enabled. /// @@ -1330,6 +1002,7 @@ namespace Tizen.NUI.UIComponents SetValue(BackingEnabledProperty, value); } } + /// /// The backing color. /// @@ -1345,6 +1018,7 @@ namespace Tizen.NUI.UIComponents SetValue(BackingColorProperty, value); } } + /// /// The background image. /// @@ -1360,6 +1034,7 @@ namespace Tizen.NUI.UIComponents SetValue(PopupBackgroundImageProperty, value); } } + /// /// The background border. /// @@ -1375,6 +1050,7 @@ namespace Tizen.NUI.UIComponents SetValue(PopupBackgroundBorderProperty, value); } } + /// /// The tail up image. /// @@ -1390,6 +1066,7 @@ namespace Tizen.NUI.UIComponents SetValue(TailUpImageProperty, value); } } + /// /// The tail down image. /// @@ -1405,6 +1082,7 @@ namespace Tizen.NUI.UIComponents SetValue(TailDownImageProperty, value); } } + /// /// The tail left image. /// @@ -1420,6 +1098,7 @@ namespace Tizen.NUI.UIComponents SetValue(TailLeftImageProperty, value); } } + /// /// The tail right image. /// @@ -1436,6 +1115,336 @@ namespace Tizen.NUI.UIComponents } } - } + /// + /// Sets the title for this popup. + /// + /// The actor to set the title. + /// 3 + public void SetTitle(View titleView) + { + NDalicPINVOKE.Popup_SetTitle(swigCPtr, View.getCPtr(titleView)); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + /// + /// Sets the content actor. + /// + /// The actor to use. + /// 3 + public void SetContent(View content) + { + NDalicPINVOKE.Popup_SetContent(swigCPtr, View.getCPtr(content)); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + /// + /// Sets the actor to use for the footer in this popup. + /// + /// The footer actor to be added to this popup. + /// 3 + public void SetFooter(View footer) + { + NDalicPINVOKE.Popup_SetFooter(swigCPtr, View.getCPtr(footer)); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + /// + /// Sets the display state of popup.
+ /// There are 4 total display states.
+ /// Only 2 can be set, but all four can be read for better inspection of the current popup state.
+ ///
+ /// The other two states are getable, but not setable, and are there for consistency.
+ ///
+ /// | Value | Setting the state | Getting the state |
+ /// |----------|--------------------------------|--------------------------------|
+ /// | SHOWN | Show the popup | The popup is fully shown |
+ /// | HIDDEN | Hide the popup | The popup is fully hidden |
+ /// | SHOWING | | The popup is transitioning in |
+ /// | HIDING | | The popup is transitioning out |
+ ///
+ /// All 4 states changes cause notifications via 4 respective signals that can be connected to.
+ ///
+ /// The desired display state to change to. + /// 3 + public void SetDisplayState(Popup.DisplayStateType displayState) + { + NDalicPINVOKE.Popup_SetDisplayState(swigCPtr, (int)displayState); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Popup obj) + { + return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; + } + + internal View GetTitle() + { + //to fix memory leak issue, match the handle count with native side. + IntPtr cPtr = NDalicPINVOKE.Popup_GetTitle(swigCPtr); + HandleRef CPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); + View ret = Registry.GetManagedBaseHandleFromNativePtr(CPtr.Handle) as View; + NDalicPINVOKE.delete_BaseHandle(CPtr); + CPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); + + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + internal View GetContent() + { + //to fix memory leak issue, match the handle count with native side. + IntPtr cPtr = NDalicPINVOKE.Popup_GetContent(swigCPtr); + HandleRef CPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); + View ret = Registry.GetManagedBaseHandleFromNativePtr(CPtr.Handle) as View; + NDalicPINVOKE.delete_BaseHandle(CPtr); + CPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); + + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + internal View GetFooter() + { + //to fix memory leak issue, match the handle count with native side. + IntPtr cPtr = NDalicPINVOKE.Popup_GetFooter(swigCPtr); + HandleRef CPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); + View ret = Registry.GetManagedBaseHandleFromNativePtr(CPtr.Handle) as View; + NDalicPINVOKE.delete_BaseHandle(CPtr); + CPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); + + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + internal Popup.DisplayStateType GetDisplayState() + { + Popup.DisplayStateType ret = (Popup.DisplayStateType)NDalicPINVOKE.Popup_GetDisplayState(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + internal VoidSignal OutsideTouchedSignal() + { + VoidSignal ret = new VoidSignal(NDalicPINVOKE.Popup_OutsideTouchedSignal(swigCPtr), false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + internal VoidSignal ShowingSignal() + { + VoidSignal ret = new VoidSignal(NDalicPINVOKE.Popup_ShowingSignal(swigCPtr), false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + internal VoidSignal ShownSignal() + { + VoidSignal ret = new VoidSignal(NDalicPINVOKE.Popup_ShownSignal(swigCPtr), false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + internal VoidSignal HidingSignal() + { + VoidSignal ret = new VoidSignal(NDalicPINVOKE.Popup_HidingSignal(swigCPtr), false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + internal VoidSignal HiddenSignal() + { + VoidSignal ret = new VoidSignal(NDalicPINVOKE.Popup_HiddenSignal(swigCPtr), false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + /// + /// Dispose. + /// + /// The dispose type + /// 3 + protected override void Dispose(DisposeTypes type) + { + if (disposed) + { + return; + } + + if (type == DisposeTypes.Explicit) + { + //Called by User + //Release your own managed resources here. + //You should release all of your own disposable objects here. + + } + + //Release your own unmanaged resources here. + //You should not access any managed member here except static instance. + //because the execution order of Finalizes is non-deterministic. + if (this != null) + { + if (_popUpHiddenEventCallbackDelegate != null) + { + HiddenSignal().Disconnect(_popUpHiddenEventCallbackDelegate); + } + + if (_popUpHidingEventCallbackDelegate != null) + { + HidingSignal().Disconnect(_popUpHidingEventCallbackDelegate); + } + } + + if (_popUpShownEventCallbackDelegate != null) + { + ShownSignal().Disconnect(_popUpShownEventCallbackDelegate); + } + + if (_popUpShowingEventCallbackDelegate != null) + { + ShowingSignal().Disconnect(_popUpShowingEventCallbackDelegate); + } + + if (_popUpOutsideTouchedEventCallbackDelegate != null) + { + this.OutsideTouchedSignal().Disconnect(_popUpOutsideTouchedEventCallbackDelegate); + } + + if (swigCPtr.Handle != global::System.IntPtr.Zero) + { + if (swigCMemOwn) + { + swigCMemOwn = false; + NDalicPINVOKE.delete_Popup(swigCPtr); + } + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); + } + + base.Dispose(type); + } + + // Callback for Popup OutsideTouchedSignal + private void OnOutsideTouched() + { + TouchedOutsideEventArgs e = new TouchedOutsideEventArgs(); + + if (_popUpOutsideTouchedEventHandler != null) + { + //here we send all data to user event handlers + _popUpOutsideTouchedEventHandler(this, e); + } + } + + // Callback for ShowingSignal + private void OnShowing() + { + ShowingEventArgs e = new ShowingEventArgs(); + + if (_popUpShowingEventHandler != null) + { + //here we send all data to user event handlers + _popUpShowingEventHandler(this, e); + } + } + + // Callback for ShownSignal + private void OnShown() + { + ShownEventArgs e = new ShownEventArgs(); + + if (_popUpShownEventHandler != null) + { + //here we send all data to user event handlers + _popUpShownEventHandler(this, e); + } + } + + // Callback for HidingSignal + private void OnHiding() + { + HidingEventArgs e = new HidingEventArgs(); + + if (_popUpHidingEventHandler != null) + { + //here we send all data to user event handlers + _popUpHidingEventHandler(this, e); + } + } + + // Callback for HiddenSignal + private void OnHidden() + { + HiddenEventArgs e = new HiddenEventArgs(); + + if (_popUpHiddenEventHandler != null) + { + //here we send all data to user event handlers + _popUpHiddenEventHandler(this, e); + } + } + + /// + /// Event arguments that passed via the OutsideTouchedEvent. + /// + /// 3 + public class TouchedOutsideEventArgs : EventArgs + { + } + + /// + /// Event arguments that passed via the ShowingEventArgs. + /// + /// 3 + public class ShowingEventArgs : EventArgs + { + } + + /// + /// Event arguments that passed via the ShownEventArgs. + /// + /// 3 + public class ShownEventArgs : EventArgs + { + } + + /// + /// Event arguments that passed via the HidingEventArgs. + /// + /// 3 + public class HidingEventArgs : EventArgs + { + } + + /// + /// Event arguments that passed via the HiddenEventArgs. + /// + /// 3 + public class HiddenEventArgs : EventArgs + { + } + + internal new class Property + { + internal static readonly int TITLE = NDalicPINVOKE.Popup_Property_TITLE_get(); + internal static readonly int CONTENT = NDalicPINVOKE.Popup_Property_CONTENT_get(); + internal static readonly int FOOTER = NDalicPINVOKE.Popup_Property_FOOTER_get(); + internal static readonly int DISPLAY_STATE = NDalicPINVOKE.Popup_Property_DISPLAY_STATE_get(); + internal static readonly int TOUCH_TRANSPARENT = NDalicPINVOKE.Popup_Property_TOUCH_TRANSPARENT_get(); + internal static readonly int TAIL_VISIBILITY = NDalicPINVOKE.Popup_Property_TAIL_VISIBILITY_get(); + internal static readonly int TAIL_POSITION = NDalicPINVOKE.Popup_Property_TAIL_POSITION_get(); + internal static readonly int CONTEXTUAL_MODE = NDalicPINVOKE.Popup_Property_CONTEXTUAL_MODE_get(); + internal static readonly int ANIMATION_DURATION = NDalicPINVOKE.Popup_Property_ANIMATION_DURATION_get(); + internal static readonly int ANIMATION_MODE = NDalicPINVOKE.Popup_Property_ANIMATION_MODE_get(); + internal static readonly int ENTRY_ANIMATION = NDalicPINVOKE.Popup_Property_ENTRY_ANIMATION_get(); + internal static readonly int EXIT_ANIMATION = NDalicPINVOKE.Popup_Property_EXIT_ANIMATION_get(); + internal static readonly int AUTO_HIDE_DELAY = NDalicPINVOKE.Popup_Property_AUTO_HIDE_DELAY_get(); + internal static readonly int BACKING_ENABLED = NDalicPINVOKE.Popup_Property_BACKING_ENABLED_get(); + internal static readonly int BACKING_COLOR = NDalicPINVOKE.Popup_Property_BACKING_COLOR_get(); + internal static readonly int POPUP_BACKGROUND_IMAGE = NDalicPINVOKE.Popup_Property_POPUP_BACKGROUND_IMAGE_get(); + internal static readonly int POPUP_BACKGROUND_BORDER = NDalicPINVOKE.Popup_Property_POPUP_BACKGROUND_BORDER_get(); + internal static readonly int TAIL_UP_IMAGE = NDalicPINVOKE.Popup_Property_TAIL_UP_IMAGE_get(); + internal static readonly int TAIL_DOWN_IMAGE = NDalicPINVOKE.Popup_Property_TAIL_DOWN_IMAGE_get(); + internal static readonly int TAIL_LEFT_IMAGE = NDalicPINVOKE.Popup_Property_TAIL_LEFT_IMAGE_get(); + internal static readonly int TAIL_RIGHT_IMAGE = NDalicPINVOKE.Popup_Property_TAIL_RIGHT_IMAGE_get(); + } + } } diff --git a/src/Tizen.NUI/src/public/UIComponents/ProgressBar.cs b/src/Tizen.NUI/src/public/UIComponents/ProgressBar.cs index 1625532..ce0b213 100755 --- a/src/Tizen.NUI/src/public/UIComponents/ProgressBar.cs +++ b/src/Tizen.NUI/src/public/UIComponents/ProgressBar.cs @@ -38,7 +38,7 @@ namespace Tizen.NUI.UIComponents Tizen.NUI.Object.SetProperty(progressBar.swigCPtr, ProgressBar.Property.PROGRESS_VALUE, new Tizen.NUI.PropertyValue((float)newValue)); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var progressBar = (ProgressBar)bindable; float temp = 0.0f; @@ -55,7 +55,7 @@ namespace Tizen.NUI.UIComponents Tizen.NUI.Object.SetProperty(progressBar.swigCPtr, ProgressBar.Property.SECONDARY_PROGRESS_VALUE, new Tizen.NUI.PropertyValue((float)newValue)); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var progressBar = (ProgressBar)bindable; float temp = 0.0f; @@ -72,7 +72,7 @@ namespace Tizen.NUI.UIComponents Tizen.NUI.Object.SetProperty(progressBar.swigCPtr, ProgressBar.Property.INDETERMINATE, new Tizen.NUI.PropertyValue((bool)newValue)); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var progressBar = (ProgressBar)bindable; bool temp = false; @@ -89,7 +89,7 @@ namespace Tizen.NUI.UIComponents Tizen.NUI.Object.SetProperty(progressBar.swigCPtr, ProgressBar.Property.TRACK_VISUAL, new Tizen.NUI.PropertyValue((PropertyMap)newValue)); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var progressBar = (ProgressBar)bindable; Tizen.NUI.PropertyMap temp = new Tizen.NUI.PropertyMap(); @@ -106,7 +106,7 @@ namespace Tizen.NUI.UIComponents Tizen.NUI.Object.SetProperty(progressBar.swigCPtr, ProgressBar.Property.PROGRESS_VISUAL, new Tizen.NUI.PropertyValue((PropertyMap)newValue)); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var progressBar = (ProgressBar)bindable; Tizen.NUI.PropertyMap temp = new Tizen.NUI.PropertyMap(); @@ -123,7 +123,7 @@ namespace Tizen.NUI.UIComponents Tizen.NUI.Object.SetProperty(progressBar.swigCPtr, ProgressBar.Property.SECONDARY_PROGRESS_VISUAL, new Tizen.NUI.PropertyValue((PropertyMap)newValue)); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var progressBar = (ProgressBar)bindable; Tizen.NUI.PropertyMap temp = new Tizen.NUI.PropertyMap(); @@ -140,7 +140,7 @@ namespace Tizen.NUI.UIComponents Tizen.NUI.Object.SetProperty(progressBar.swigCPtr, ProgressBar.Property.INDETERMINATE_VISUAL, new Tizen.NUI.PropertyValue((PropertyMap)newValue)); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var progressBar = (ProgressBar)bindable; Tizen.NUI.PropertyMap temp = new Tizen.NUI.PropertyMap(); @@ -157,7 +157,7 @@ namespace Tizen.NUI.UIComponents Tizen.NUI.Object.SetProperty(progressBar.swigCPtr, ProgressBar.Property.INDETERMINATE_VISUAL_ANIMATION, new Tizen.NUI.PropertyValue((PropertyArray)newValue)); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var progressBar = (ProgressBar)bindable; Tizen.NUI.PropertyArray temp = new Tizen.NUI.PropertyArray(); @@ -174,7 +174,7 @@ namespace Tizen.NUI.UIComponents Tizen.NUI.Object.SetProperty(progressBar.swigCPtr, ProgressBar.Property.LABEL_VISUAL, new Tizen.NUI.PropertyValue((PropertyMap)newValue)); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var progressBar = (ProgressBar)bindable; Tizen.NUI.PropertyMap temp = new Tizen.NUI.PropertyMap(); @@ -182,125 +182,27 @@ namespace Tizen.NUI.UIComponents return temp; }); - private global::System.Runtime.InteropServices.HandleRef swigCPtr; - - internal ProgressBar(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.ProgressBar_SWIGUpcast(cPtr), cMemoryOwn) - { - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); - } - - internal static global::System.Runtime.InteropServices.HandleRef getCPtr(ProgressBar obj) - { - return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; - } + private EventHandler _progressBarValueChangedEventHandler; + private ValueChangedCallbackDelegate _progressBarValueChangedCallbackDelegate; /// - /// To dispose the ProgressBar instance. + /// Creates the ProgressBar. /// /// 3 - protected override void Dispose(DisposeTypes type) + public ProgressBar() : this(NDalicPINVOKE.ProgressBar_New(), true) { - if (disposed) - { - return; - } - - if (type == DisposeTypes.Explicit) - { - //Called by User - //Release your own managed resources here. - //You should release all of your own disposable objects here. - - } - - //Release your own unmanaged resources here. - //You should not access any managed member here except static instance. - //because the execution order of Finalizes is non-deterministic. - - if (this != null && _progressBarValueChangedCallbackDelegate != null) - { - ValueChangedSignal().Disconnect(_progressBarValueChangedCallbackDelegate); - } - - if (swigCPtr.Handle != global::System.IntPtr.Zero) - { - if (swigCMemOwn) - { - swigCMemOwn = false; - NDalicPINVOKE.delete_ProgressBar(swigCPtr); - } - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); - } + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - base.Dispose(type); } - - /// - /// Event arguments that passed via the ValueChangedEventArgs. - /// - /// 3 - public class ValueChangedEventArgs : EventArgs + internal ProgressBar(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.ProgressBar_SWIGUpcast(cPtr), cMemoryOwn) { - private ProgressBar _progressBar; - private float _progressValue; - private float _secondaryProgressValue; - - /// - /// ProgressBar - /// - /// 3 - public ProgressBar ProgressBar - { - get - { - return _progressBar; - } - set - { - _progressBar = value; - } - } - - /// - /// The progress value of the progress bar, the progress runs from 0 to 1. - /// - /// 3 - public float ProgressValue - { - get - { - return _progressValue; - } - set - { - _progressValue = value; - } - } - - /// - /// The secondary progress value of the progress bar, the secondary progress runs from 0 to 1. - /// - /// 3 - public float SecondaryProgressValue - { - get - { - return _secondaryProgressValue; - } - set - { - _secondaryProgressValue = value; - } - } - + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); } [UnmanagedFunctionPointer(CallingConvention.StdCall)] private delegate void ValueChangedCallbackDelegate(IntPtr progressBar, float progressValue, float secondaryProgressValue); - private EventHandler _progressBarValueChangedEventHandler; - private ValueChangedCallbackDelegate _progressBarValueChangedCallbackDelegate; /// /// The event is sent when the ProgressBar value changes. @@ -327,52 +229,6 @@ namespace Tizen.NUI.UIComponents } } - // Callback for ProgressBar ValueChanged signal - private void OnValueChanged(IntPtr progressBar, float progressValue, float secondaryProgressValue) - { - ValueChangedEventArgs e = new ValueChangedEventArgs(); - - // Populate all members of "e" (ValueChangedEventArgs) with real page - e.ProgressBar = Registry.GetManagedBaseHandleFromNativePtr(progressBar) as ProgressBar; - e.ProgressValue = progressValue; - e.SecondaryProgressValue = secondaryProgressValue; - - if (_progressBarValueChangedEventHandler != null) - { - _progressBarValueChangedEventHandler(this, e); - } - } - - internal new class Property - { - internal static readonly int PROGRESS_VALUE = NDalicPINVOKE.ProgressBar_Property_PROGRESS_VALUE_get(); - internal static readonly int SECONDARY_PROGRESS_VALUE = NDalicPINVOKE.ProgressBar_Property_SECONDARY_PROGRESS_VALUE_get(); - internal static readonly int INDETERMINATE = NDalicPINVOKE.ProgressBar_Property_INDETERMINATE_get(); - internal static readonly int TRACK_VISUAL = NDalicPINVOKE.ProgressBar_Property_TRACK_VISUAL_get(); - internal static readonly int PROGRESS_VISUAL = NDalicPINVOKE.ProgressBar_Property_PROGRESS_VISUAL_get(); - internal static readonly int SECONDARY_PROGRESS_VISUAL = NDalicPINVOKE.ProgressBar_Property_SECONDARY_PROGRESS_VISUAL_get(); - internal static readonly int INDETERMINATE_VISUAL = NDalicPINVOKE.ProgressBar_Property_INDETERMINATE_VISUAL_get(); - internal static readonly int INDETERMINATE_VISUAL_ANIMATION = NDalicPINVOKE.ProgressBar_Property_INDETERMINATE_VISUAL_ANIMATION_get(); - internal static readonly int LABEL_VISUAL = NDalicPINVOKE.ProgressBar_Property_LABEL_VISUAL_get(); - } - - /// - /// Creates the ProgressBar. - /// - /// 3 - public ProgressBar() : this(NDalicPINVOKE.ProgressBar_New(), true) - { - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - - } - - internal ProgressBarValueChangedSignal ValueChangedSignal() - { - ProgressBarValueChangedSignal ret = new ProgressBarValueChangedSignal(NDalicPINVOKE.ProgressBar_ValueChangedSignal(swigCPtr), false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - /// /// The progress value of the progress bar, the progress runs from 0 to 1.
/// If the value is set to 0, then the progress bar will be set to beginning.
@@ -529,6 +385,146 @@ namespace Tizen.NUI.UIComponents } } - } + internal static global::System.Runtime.InteropServices.HandleRef getCPtr(ProgressBar obj) + { + return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; + } + + internal ProgressBarValueChangedSignal ValueChangedSignal() + { + ProgressBarValueChangedSignal ret = new ProgressBarValueChangedSignal(NDalicPINVOKE.ProgressBar_ValueChangedSignal(swigCPtr), false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + /// + /// To dispose the ProgressBar instance. + /// + /// 3 + protected override void Dispose(DisposeTypes type) + { + if (disposed) + { + return; + } + + if (type == DisposeTypes.Explicit) + { + //Called by User + //Release your own managed resources here. + //You should release all of your own disposable objects here. + + } + + //Release your own unmanaged resources here. + //You should not access any managed member here except static instance. + //because the execution order of Finalizes is non-deterministic. + + if (this != null && _progressBarValueChangedCallbackDelegate != null) + { + ValueChangedSignal().Disconnect(_progressBarValueChangedCallbackDelegate); + } + + if (swigCPtr.Handle != global::System.IntPtr.Zero) + { + if (swigCMemOwn) + { + swigCMemOwn = false; + NDalicPINVOKE.delete_ProgressBar(swigCPtr); + } + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); + } + + base.Dispose(type); + } + + // Callback for ProgressBar ValueChanged signal + private void OnValueChanged(IntPtr progressBar, float progressValue, float secondaryProgressValue) + { + ValueChangedEventArgs e = new ValueChangedEventArgs(); + + // Populate all members of "e" (ValueChangedEventArgs) with real page + e.ProgressBar = Registry.GetManagedBaseHandleFromNativePtr(progressBar) as ProgressBar; + e.ProgressValue = progressValue; + e.SecondaryProgressValue = secondaryProgressValue; + + if (_progressBarValueChangedEventHandler != null) + { + _progressBarValueChangedEventHandler(this, e); + } + } + + /// + /// Event arguments that passed via the ValueChangedEventArgs. + /// + /// 3 + public class ValueChangedEventArgs : EventArgs + { + private ProgressBar _progressBar; + private float _progressValue; + private float _secondaryProgressValue; + + /// + /// ProgressBar + /// + /// 3 + public ProgressBar ProgressBar + { + get + { + return _progressBar; + } + set + { + _progressBar = value; + } + } + /// + /// The progress value of the progress bar, the progress runs from 0 to 1. + /// + /// 3 + public float ProgressValue + { + get + { + return _progressValue; + } + set + { + _progressValue = value; + } + } + + /// + /// The secondary progress value of the progress bar, the secondary progress runs from 0 to 1. + /// + /// 3 + public float SecondaryProgressValue + { + get + { + return _secondaryProgressValue; + } + set + { + _secondaryProgressValue = value; + } + } + + } + + internal new class Property + { + internal static readonly int PROGRESS_VALUE = NDalicPINVOKE.ProgressBar_Property_PROGRESS_VALUE_get(); + internal static readonly int SECONDARY_PROGRESS_VALUE = NDalicPINVOKE.ProgressBar_Property_SECONDARY_PROGRESS_VALUE_get(); + internal static readonly int INDETERMINATE = NDalicPINVOKE.ProgressBar_Property_INDETERMINATE_get(); + internal static readonly int TRACK_VISUAL = NDalicPINVOKE.ProgressBar_Property_TRACK_VISUAL_get(); + internal static readonly int PROGRESS_VISUAL = NDalicPINVOKE.ProgressBar_Property_PROGRESS_VISUAL_get(); + internal static readonly int SECONDARY_PROGRESS_VISUAL = NDalicPINVOKE.ProgressBar_Property_SECONDARY_PROGRESS_VISUAL_get(); + internal static readonly int INDETERMINATE_VISUAL = NDalicPINVOKE.ProgressBar_Property_INDETERMINATE_VISUAL_get(); + internal static readonly int INDETERMINATE_VISUAL_ANIMATION = NDalicPINVOKE.ProgressBar_Property_INDETERMINATE_VISUAL_ANIMATION_get(); + internal static readonly int LABEL_VISUAL = NDalicPINVOKE.ProgressBar_Property_LABEL_VISUAL_get(); + } + } } diff --git a/src/Tizen.NUI/src/public/UIComponents/PushButton.cs b/src/Tizen.NUI/src/public/UIComponents/PushButton.cs index 4c47db0..bff6d25 100755 --- a/src/Tizen.NUI/src/public/UIComponents/PushButton.cs +++ b/src/Tizen.NUI/src/public/UIComponents/PushButton.cs @@ -39,13 +39,76 @@ namespace Tizen.NUI.UIComponents public static readonly BindableProperty CommandParameterProperty = BindableProperty.Create("CommandParameter", typeof(object), typeof(PushButton), null, BindingMode.OneWay, null, null, null, null, null as BindableProperty.CreateDefaultValueDelegate); + private global::System.Runtime.InteropServices.HandleRef swigCPtr; + /// + /// Creates the PushButton. + /// + /// 3 + public PushButton() : this(NDalicPINVOKE.PushButton_New(), true) + { + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + internal PushButton(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.PushButton_SWIGUpcast(cPtr), cMemoryOwn) { swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); } + /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + public ICommand Command + { + get + { + return (ICommand)base.GetValue(PushButton.CommandProperty); + } + set + { + base.SetValue(PushButton.CommandProperty, value); + } + } + + /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + public object CommandParameter + { + get + { + return base.GetValue(PushButton.CommandParameterProperty); + } + set + { + base.SetValue(PushButton.CommandParameterProperty, value); + } + } + + internal override bool IsCreateByXaml + { + get + { + return base.IsCreateByXaml; + } + set + { + base.IsCreateByXaml = value; + + if (value == true) + { + this.Clicked += (sender, e) => + { + ICommand command = this.Command; + if (command != null) + { + command.Execute(this.CommandParameter); + } + return true; + }; + } + } + } + internal static global::System.Runtime.InteropServices.HandleRef getCPtr(PushButton obj) { return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; @@ -62,7 +125,7 @@ namespace Tizen.NUI.UIComponents return; } - if(type == DisposeTypes.Explicit) + if (type == DisposeTypes.Explicit) { //Called by User //Release your own managed resources here. @@ -86,7 +149,6 @@ namespace Tizen.NUI.UIComponents base.Dispose(type); } - internal new class Property { internal static readonly int UNSELECTED_ICON = NDalicPINVOKE.PushButton_Property_UNSELECTED_ICON_get(); @@ -95,67 +157,5 @@ namespace Tizen.NUI.UIComponents internal static readonly int LABEL_PADDING = NDalicPINVOKE.PushButton_Property_LABEL_PADDING_get(); internal static readonly int ICON_PADDING = NDalicPINVOKE.PushButton_Property_ICON_PADDING_get(); } - - /// - /// Creates the PushButton. - /// - /// 3 - public PushButton() : this(NDalicPINVOKE.PushButton_New(), true) - { - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - internal override bool IsCreateByXaml - { - get - { - return base.IsCreateByXaml; - } - set - { - base.IsCreateByXaml = value; - - if (value == true) - { - this.Clicked += (sender, e) => - { - ICommand command = this.Command; - if (command != null) - { - command.Execute(this.CommandParameter); - } - return true; - }; - } - } - } - - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - public ICommand Command - { - get - { - return (ICommand)base.GetValue(PushButton.CommandProperty); - } - set - { - base.SetValue(PushButton.CommandProperty, value); - } - } - - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - public object CommandParameter - { - get - { - return base.GetValue(PushButton.CommandParameterProperty); - } - set - { - base.SetValue(PushButton.CommandParameterProperty, value); - } - } } } diff --git a/src/Tizen.NUI/src/public/UIComponents/RadioButton.cs b/src/Tizen.NUI/src/public/UIComponents/RadioButton.cs index 1fa6e8e..bd57cec 100755 --- a/src/Tizen.NUI/src/public/UIComponents/RadioButton.cs +++ b/src/Tizen.NUI/src/public/UIComponents/RadioButton.cs @@ -17,7 +17,6 @@ namespace Tizen.NUI.UIComponents { - /// /// A RadioButton provides a radio button with two states, \e selected or \e unselected.
/// Radio buttons are designed to select one of the many options at the same time.
@@ -36,6 +35,25 @@ namespace Tizen.NUI.UIComponents { private global::System.Runtime.InteropServices.HandleRef swigCPtr; + /// + /// Creates an uninitialized RadioButton. + /// + /// 3 + public RadioButton() : this(NDalicPINVOKE.RadioButton_New__SWIG_0(), true) + { + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + /// + /// Creates an uninitialized RadioButton with the label. + /// + /// The label text. + /// 3 + public RadioButton(string label) : this(NDalicPINVOKE.RadioButton_New__SWIG_1(label), true) + { + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + internal RadioButton(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.RadioButton_SWIGUpcast(cPtr), cMemoryOwn) { swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); @@ -81,25 +99,5 @@ namespace Tizen.NUI.UIComponents base.Dispose(type); } - /// - /// Creates an uninitialized RadioButton. - /// - /// 3 - public RadioButton() : this(NDalicPINVOKE.RadioButton_New__SWIG_0(), true) - { - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - - } - - /// - /// Creates an uninitialized RadioButton with the label. - /// - /// The label text. - /// 3 - public RadioButton(string label) : this(NDalicPINVOKE.RadioButton_New__SWIG_1(label), true) - { - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - - } } } \ No newline at end of file diff --git a/src/Tizen.NUI/src/public/UIComponents/ScrollBar.cs b/src/Tizen.NUI/src/public/UIComponents/ScrollBar.cs index 3a15ed3..847196b 100755 --- a/src/Tizen.NUI/src/public/UIComponents/ScrollBar.cs +++ b/src/Tizen.NUI/src/public/UIComponents/ScrollBar.cs @@ -46,7 +46,7 @@ namespace Tizen.NUI.UIComponents Tizen.NUI.Object.SetProperty(scrollBar.swigCPtr, ScrollBar.Property.SCROLL_DIRECTION, new Tizen.NUI.PropertyValue(valueToString)); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var scrollBar = (ScrollBar)bindable; string temp; @@ -72,14 +72,14 @@ namespace Tizen.NUI.UIComponents { switch ((IndicatorHeightPolicyType)newValue) { - case IndicatorHeightPolicyType.Variable:{ valueToString = "Variable"; break; } + case IndicatorHeightPolicyType.Variable: { valueToString = "Variable"; break; } case IndicatorHeightPolicyType.Fixed: { valueToString = "Fixed"; break; } - default: { valueToString = "Variable"; break; } + default: { valueToString = "Variable"; break; } } Tizen.NUI.Object.SetProperty(scrollBar.swigCPtr, ScrollBar.Property.INDICATOR_HEIGHT_POLICY, new Tizen.NUI.PropertyValue(valueToString)); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var scrollBar = (ScrollBar)bindable; string temp; @@ -105,7 +105,7 @@ namespace Tizen.NUI.UIComponents Tizen.NUI.Object.SetProperty(scrollBar.swigCPtr, ScrollBar.Property.INDICATOR_FIXED_HEIGHT, new Tizen.NUI.PropertyValue((float)newValue)); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var scrollBar = (ScrollBar)bindable; float temp = 0.0f; @@ -122,7 +122,7 @@ namespace Tizen.NUI.UIComponents Tizen.NUI.Object.SetProperty(scrollBar.swigCPtr, ScrollBar.Property.INDICATOR_SHOW_DURATION, new Tizen.NUI.PropertyValue((float)newValue)); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var scrollBar = (ScrollBar)bindable; float temp = 0.0f; @@ -139,7 +139,7 @@ namespace Tizen.NUI.UIComponents Tizen.NUI.Object.SetProperty(scrollBar.swigCPtr, ScrollBar.Property.INDICATOR_HIDE_DURATION, new Tizen.NUI.PropertyValue((float)newValue)); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var scrollBar = (ScrollBar)bindable; float temp = 0.0f; @@ -156,7 +156,7 @@ namespace Tizen.NUI.UIComponents Tizen.NUI.Object.SetProperty(scrollBar.swigCPtr, ScrollBar.Property.SCROLL_POSITION_INTERVALS, new Tizen.NUI.PropertyValue((PropertyArray)newValue)); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var scrollBar = (ScrollBar)bindable; Tizen.NUI.PropertyArray temp = new Tizen.NUI.PropertyArray(); @@ -173,7 +173,7 @@ namespace Tizen.NUI.UIComponents Tizen.NUI.Object.SetProperty(scrollBar.swigCPtr, ScrollBar.Property.INDICATOR_MINIMUM_HEIGHT, new Tizen.NUI.PropertyValue((float)newValue)); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var scrollBar = (ScrollBar)bindable; float temp = 0.0f; @@ -190,7 +190,7 @@ namespace Tizen.NUI.UIComponents Tizen.NUI.Object.SetProperty(scrollBar.swigCPtr, ScrollBar.Property.INDICATOR_START_PADDING, new Tizen.NUI.PropertyValue((float)newValue)); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var scrollBar = (ScrollBar)bindable; float temp = 0.0f; @@ -207,7 +207,7 @@ namespace Tizen.NUI.UIComponents Tizen.NUI.Object.SetProperty(scrollBar.swigCPtr, ScrollBar.Property.INDICATOR_END_PADDING, new Tizen.NUI.PropertyValue((float)newValue)); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var scrollBar = (ScrollBar)bindable; float temp = 0.0f; @@ -217,105 +217,46 @@ namespace Tizen.NUI.UIComponents private global::System.Runtime.InteropServices.HandleRef swigCPtr; - internal ScrollBar(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.ScrollBar_SWIGUpcast(cPtr), cMemoryOwn) - { - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); - } + private EventHandler _scrollBarPanFinishedEventHandler; + private PanFinishedEventCallbackDelegate _scrollBarPanFinishedEventCallbackDelegate; - internal static global::System.Runtime.InteropServices.HandleRef getCPtr(ScrollBar obj) - { - return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; - } + private EventHandler _scrollBarScrollPositionIntervalReachedEventHandler; + private ScrollPositionIntervalReachedEventCallbackDelegate _scrollBarScrollPositionIntervalReachedEventCallbackDelegate; /// - /// To dispose the ScrollBar instance. + /// Creates an initialized scrollbar. /// + /// The direction of the scrollbar (either vertically or horizontally). /// 3 - protected override void Dispose(DisposeTypes type) + public ScrollBar(ScrollBar.Direction direction) : this(NDalicPINVOKE.ScrollBar_New__SWIG_0((int)direction), true) { - if (disposed) - { - return; - } - - if(type == DisposeTypes.Explicit) - { - //Called by User - //Release your own managed resources here. - //You should release all of your own disposable objects here. - } - - //Release your own unmanaged resources here. - //You should not access any managed member here except static instance. - //because the execution order of Finalizes is non-deterministic. - if (this != null) - { - if (_scrollBarScrollPositionIntervalReachedEventCallbackDelegate != null) - { - ScrollPositionIntervalReachedSignal().Disconnect(_scrollBarScrollPositionIntervalReachedEventCallbackDelegate); - } - - if (_scrollBarPanFinishedEventCallbackDelegate != null) - { - PanFinishedSignal().Disconnect(_scrollBarPanFinishedEventCallbackDelegate); - } - } - - if (swigCPtr.Handle != global::System.IntPtr.Zero) - { - if (swigCMemOwn) - { - swigCMemOwn = false; - NDalicPINVOKE.delete_ScrollBar(swigCPtr); - } - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); - } - - base.Dispose(type); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } /// - /// Event arguments that passed via the PanFinished event. + /// Creates an uninitialized scrollbar. /// /// 3 - public class PanFinishedEventArgs : EventArgs + public ScrollBar() : this(NDalicPINVOKE.ScrollBar_New__SWIG_1(), true) { + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } - /// - /// Event arguments that passed via the ScrollPositionIntervalReached event. - /// - /// 3 - public class ScrollIntervalEventArgs : EventArgs + internal ScrollBar(ScrollBar scrollBar) : this(NDalicPINVOKE.new_ScrollBar__SWIG_1(ScrollBar.getCPtr(scrollBar)), true) { - private float _currentScrollPosition; + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } - /// - /// The current scroll position of the scrollable content. - /// - /// 3 - public float CurrentScrollPosition - { - get - { - return _currentScrollPosition; - } - set - { - _currentScrollPosition = value; - } - } + internal ScrollBar(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.ScrollBar_SWIGUpcast(cPtr), cMemoryOwn) + { + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); } [UnmanagedFunctionPointer(CallingConvention.StdCall)] private delegate void PanFinishedEventCallbackDelegate(); - private EventHandler _scrollBarPanFinishedEventHandler; - private PanFinishedEventCallbackDelegate _scrollBarPanFinishedEventCallbackDelegate; [UnmanagedFunctionPointer(CallingConvention.StdCall)] private delegate void ScrollPositionIntervalReachedEventCallbackDelegate(float position); - private EventHandler _scrollBarScrollPositionIntervalReachedEventHandler; - private ScrollPositionIntervalReachedEventCallbackDelegate _scrollBarScrollPositionIntervalReachedEventCallbackDelegate; /// /// The event emitted when panning is finished on the scroll indicator. @@ -343,19 +284,6 @@ namespace Tizen.NUI.UIComponents } } - // Callback for ScrollBar PanFinishedSignal - private void OnScrollBarPanFinished() - { - PanFinishedEventArgs e = new PanFinishedEventArgs(); - - if (_scrollBarPanFinishedEventHandler != null) - { - //here we send all data to user event handlers - _scrollBarPanFinishedEventHandler(this, e); - } - } - - /// /// This is the event emitted when the current scroll position of the scrollable content goes above or below the values specified by ScrollPositionIntervals property. /// @@ -382,55 +310,185 @@ namespace Tizen.NUI.UIComponents } } - // Callback for ScrollBar ScrollPositionIntervalReachedSignal - private void OnScrollBarScrollPositionIntervalReached(float position) + /// + /// The direction of the scrollbar. + /// + /// 3 + public enum Direction { - ScrollIntervalEventArgs e = new ScrollIntervalEventArgs(); - e.CurrentScrollPosition = position; + /// + /// Scroll in the vertical direction + /// + /// 3 + Vertical = 0, + /// + /// Scroll in the horizontal direction + /// + /// 3 + Horizontal + } - if (_scrollBarScrollPositionIntervalReachedEventHandler != null) + /// + /// The indicator height policy. + /// + /// 3 + public enum IndicatorHeightPolicyType + { + /// + /// Variable height changed dynamically according to the length of scroll content + /// + /// 3 + Variable = 0, + /// + /// Fixed height regardless of the length of scroll content + /// + /// 3 + Fixed + } + + /// + /// The direction of the scrollbar. + /// + /// 3 + public Direction ScrollDirection + { + get { - //here we send all data to user event handlers - _scrollBarScrollPositionIntervalReachedEventHandler(this, e); + + return (Direction)GetValue(ScrollDirectionProperty); + } + set + { + SetValue(ScrollDirectionProperty, value); } } + /// + /// The indicator height policy. + /// + /// 3 + public IndicatorHeightPolicyType IndicatorHeightPolicy + { + get + { + return (IndicatorHeightPolicyType)GetValue(IndicatorHeightPolicyProperty); + } + set + { + SetValue(IndicatorHeightPolicyProperty, value); + } + } - internal new class Property + /// + /// The fixed height of the scroll indicator. + /// + /// 3 + public float IndicatorFixedHeight { - internal static readonly int SCROLL_DIRECTION = NDalicPINVOKE.ScrollBar_Property_SCROLL_DIRECTION_get(); - internal static readonly int INDICATOR_HEIGHT_POLICY = NDalicPINVOKE.ScrollBar_Property_INDICATOR_HEIGHT_POLICY_get(); - internal static readonly int INDICATOR_FIXED_HEIGHT = NDalicPINVOKE.ScrollBar_Property_INDICATOR_FIXED_HEIGHT_get(); - internal static readonly int INDICATOR_SHOW_DURATION = NDalicPINVOKE.ScrollBar_Property_INDICATOR_SHOW_DURATION_get(); - internal static readonly int INDICATOR_HIDE_DURATION = NDalicPINVOKE.ScrollBar_Property_INDICATOR_HIDE_DURATION_get(); - internal static readonly int SCROLL_POSITION_INTERVALS = NDalicPINVOKE.ScrollBar_Property_SCROLL_POSITION_INTERVALS_get(); - internal static readonly int INDICATOR_MINIMUM_HEIGHT = NDalicPINVOKE.ScrollBar_Property_INDICATOR_MINIMUM_HEIGHT_get(); - internal static readonly int INDICATOR_START_PADDING = NDalicPINVOKE.ScrollBar_Property_INDICATOR_START_PADDING_get(); - internal static readonly int INDICATOR_END_PADDING = NDalicPINVOKE.ScrollBar_Property_INDICATOR_END_PADDING_get(); + get + { + return (float)GetValue(IndicatorFixedHeightProperty); + } + set + { + SetValue(IndicatorFixedHeightProperty, value); + } } /// - /// Creates an initialized scrollbar. + /// The duration in seconds for the scroll indicator to become fully visible. /// - /// The direction of the scrollbar (either vertically or horizontally). /// 3 - public ScrollBar(ScrollBar.Direction direction) : this(NDalicPINVOKE.ScrollBar_New__SWIG_0((int)direction), true) + public float IndicatorShowDuration { - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + get + { + return (float)GetValue(IndicatorShowDurationProperty); + } + set + { + SetValue(IndicatorShowDurationProperty, value); + } } /// - /// Creates an uninitialized scrollbar. + /// The duration in seconds for the scroll indicator to become fully invisible. /// /// 3 - public ScrollBar() : this(NDalicPINVOKE.ScrollBar_New__SWIG_1(), true) + public float IndicatorHideDuration { - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + get + { + return (float)GetValue(IndicatorHideDurationProperty); + } + set + { + SetValue(IndicatorHideDurationProperty, value); + } + } + /// + /// The list of values to get the notification when the current scroll position of the scrollable object goes above or below any of these values. + /// + /// 3 + public Tizen.NUI.PropertyArray ScrollPositionIntervals + { + get + { + return (PropertyArray)GetValue(ScrollPositionIntervalsProperty); + } + set + { + SetValue(ScrollPositionIntervalsProperty, value); + } } - internal ScrollBar(ScrollBar scrollBar) : this(NDalicPINVOKE.new_ScrollBar__SWIG_1(ScrollBar.getCPtr(scrollBar)), true) + + /// + /// The minimum height for a variable size indicator. + /// + /// 3 + public float IndicatorMinimumHeight { - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + get + { + return (float)GetValue(IndicatorMinimumHeightProperty); + } + set + { + SetValue(IndicatorMinimumHeightProperty, value); + } + } + + /// + /// The padding at the start of the indicator. For example, the top if the scrollDirection is vertical. + /// + /// 3 + public float IndicatorStartPadding + { + get + { + return (float)GetValue(IndicatorStartPaddingProperty); + } + set + { + SetValue(IndicatorStartPaddingProperty, value); + } + } + + /// + /// The padding at the end of the indicator. For example, the bottom if the scrollDirection is vertical. + /// + /// 3 + public float IndicatorEndPadding + { + get + { + return (float)GetValue(IndicatorEndPaddingProperty); + } + set + { + SetValue(IndicatorEndPaddingProperty, value); + } } /// @@ -450,6 +508,11 @@ namespace Tizen.NUI.UIComponents if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } + internal static global::System.Runtime.InteropServices.HandleRef getCPtr(ScrollBar obj) + { + return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; + } + internal void SetScrollIndicator(View indicator) { NDalicPINVOKE.ScrollBar_SetScrollIndicator(swigCPtr, View.getCPtr(indicator)); @@ -555,186 +618,124 @@ namespace Tizen.NUI.UIComponents } /// - /// The direction of the scrollbar. - /// - /// 3 - public enum Direction - { - /// - /// Scroll in the vertical direction - /// - /// 3 - Vertical = 0, - /// - /// Scroll in the horizontal direction - /// - /// 3 - Horizontal - } - - /// - /// The indicator height policy. - /// - /// 3 - public enum IndicatorHeightPolicyType - { - /// - /// Variable height changed dynamically according to the length of scroll content - /// - /// 3 - Variable = 0, - /// - /// Fixed height regardless of the length of scroll content - /// - /// 3 - Fixed - } - - /// - /// The direction of the scrollbar. + /// To dispose the ScrollBar instance. /// /// 3 - public Direction ScrollDirection + protected override void Dispose(DisposeTypes type) { - get - { - - return (Direction)GetValue(ScrollDirectionProperty); - } - set + if (disposed) { - SetValue(ScrollDirectionProperty, value); + return; } - } - /// - /// The indicator height policy. - /// - /// 3 - public IndicatorHeightPolicyType IndicatorHeightPolicy - { - get + if (type == DisposeTypes.Explicit) { - return (IndicatorHeightPolicyType)GetValue(IndicatorHeightPolicyProperty); - } - set - { - SetValue(IndicatorHeightPolicyProperty, value); + //Called by User + //Release your own managed resources here. + //You should release all of your own disposable objects here. } - } - /// - /// The fixed height of the scroll indicator. - /// - /// 3 - public float IndicatorFixedHeight - { - get - { - return (float)GetValue(IndicatorFixedHeightProperty); - } - set + //Release your own unmanaged resources here. + //You should not access any managed member here except static instance. + //because the execution order of Finalizes is non-deterministic. + if (this != null) { - SetValue(IndicatorFixedHeightProperty, value); - } - } + if (_scrollBarScrollPositionIntervalReachedEventCallbackDelegate != null) + { + ScrollPositionIntervalReachedSignal().Disconnect(_scrollBarScrollPositionIntervalReachedEventCallbackDelegate); + } - /// - /// The duration in seconds for the scroll indicator to become fully visible. - /// - /// 3 - public float IndicatorShowDuration - { - get - { - return (float)GetValue(IndicatorShowDurationProperty); + if (_scrollBarPanFinishedEventCallbackDelegate != null) + { + PanFinishedSignal().Disconnect(_scrollBarPanFinishedEventCallbackDelegate); + } } - set + + if (swigCPtr.Handle != global::System.IntPtr.Zero) { - SetValue(IndicatorShowDurationProperty, value); + if (swigCMemOwn) + { + swigCMemOwn = false; + NDalicPINVOKE.delete_ScrollBar(swigCPtr); + } + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); } + + base.Dispose(type); } - /// - /// The duration in seconds for the scroll indicator to become fully invisible. - /// - /// 3 - public float IndicatorHideDuration + // Callback for ScrollBar PanFinishedSignal + private void OnScrollBarPanFinished() { - get - { - return (float)GetValue(IndicatorHideDurationProperty); - } - set + PanFinishedEventArgs e = new PanFinishedEventArgs(); + + if (_scrollBarPanFinishedEventHandler != null) { - SetValue(IndicatorHideDurationProperty, value); + //here we send all data to user event handlers + _scrollBarPanFinishedEventHandler(this, e); } } - /// - /// The list of values to get the notification when the current scroll position of the scrollable object goes above or below any of these values. - /// - /// 3 - public Tizen.NUI.PropertyArray ScrollPositionIntervals + + // Callback for ScrollBar ScrollPositionIntervalReachedSignal + private void OnScrollBarScrollPositionIntervalReached(float position) { - get - { - return (PropertyArray)GetValue(ScrollPositionIntervalsProperty); - } - set + ScrollIntervalEventArgs e = new ScrollIntervalEventArgs(); + e.CurrentScrollPosition = position; + + if (_scrollBarScrollPositionIntervalReachedEventHandler != null) { - SetValue(ScrollPositionIntervalsProperty, value); + //here we send all data to user event handlers + _scrollBarScrollPositionIntervalReachedEventHandler(this, e); } } + + /// - /// The minimum height for a variable size indicator. + /// Event arguments that passed via the PanFinished event. /// /// 3 - public float IndicatorMinimumHeight + public class PanFinishedEventArgs : EventArgs { - get - { - return (float)GetValue(IndicatorMinimumHeightProperty); - } - set - { - SetValue(IndicatorMinimumHeightProperty, value); - } } /// - /// The padding at the start of the indicator. For example, the top if the scrollDirection is vertical. + /// Event arguments that passed via the ScrollPositionIntervalReached event. /// /// 3 - public float IndicatorStartPadding + public class ScrollIntervalEventArgs : EventArgs { - get - { - return (float)GetValue(IndicatorStartPaddingProperty); - } - set + private float _currentScrollPosition; + + /// + /// The current scroll position of the scrollable content. + /// + /// 3 + public float CurrentScrollPosition { - SetValue(IndicatorStartPaddingProperty, value); + get + { + return _currentScrollPosition; + } + set + { + _currentScrollPosition = value; + } } } - /// - /// The padding at the end of the indicator. For example, the bottom if the scrollDirection is vertical. - /// - /// 3 - public float IndicatorEndPadding + internal new class Property { - get - { - return (float)GetValue(IndicatorEndPaddingProperty); - } - set - { - SetValue(IndicatorEndPaddingProperty, value); - } + internal static readonly int SCROLL_DIRECTION = NDalicPINVOKE.ScrollBar_Property_SCROLL_DIRECTION_get(); + internal static readonly int INDICATOR_HEIGHT_POLICY = NDalicPINVOKE.ScrollBar_Property_INDICATOR_HEIGHT_POLICY_get(); + internal static readonly int INDICATOR_FIXED_HEIGHT = NDalicPINVOKE.ScrollBar_Property_INDICATOR_FIXED_HEIGHT_get(); + internal static readonly int INDICATOR_SHOW_DURATION = NDalicPINVOKE.ScrollBar_Property_INDICATOR_SHOW_DURATION_get(); + internal static readonly int INDICATOR_HIDE_DURATION = NDalicPINVOKE.ScrollBar_Property_INDICATOR_HIDE_DURATION_get(); + internal static readonly int SCROLL_POSITION_INTERVALS = NDalicPINVOKE.ScrollBar_Property_SCROLL_POSITION_INTERVALS_get(); + internal static readonly int INDICATOR_MINIMUM_HEIGHT = NDalicPINVOKE.ScrollBar_Property_INDICATOR_MINIMUM_HEIGHT_get(); + internal static readonly int INDICATOR_START_PADDING = NDalicPINVOKE.ScrollBar_Property_INDICATOR_START_PADDING_get(); + internal static readonly int INDICATOR_END_PADDING = NDalicPINVOKE.ScrollBar_Property_INDICATOR_END_PADDING_get(); } - } - } diff --git a/src/Tizen.NUI/src/public/UIComponents/ScrollView.cs b/src/Tizen.NUI/src/public/UIComponents/ScrollView.cs index abd38df..ba70633 100755 --- a/src/Tizen.NUI/src/public/UIComponents/ScrollView.cs +++ b/src/Tizen.NUI/src/public/UIComponents/ScrollView.cs @@ -38,7 +38,7 @@ namespace Tizen.NUI Tizen.NUI.Object.SetProperty(scrollView.swigCPtr, ScrollView.Property.WRAP_ENABLED, new Tizen.NUI.PropertyValue((bool)newValue)); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var scrollView = (ScrollView)bindable; bool temp = false; @@ -55,7 +55,7 @@ namespace Tizen.NUI Tizen.NUI.Object.SetProperty(scrollView.swigCPtr, ScrollView.Property.PANNING_ENABLED, new Tizen.NUI.PropertyValue((bool)newValue)); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var scrollView = (ScrollView)bindable; bool temp = false; @@ -72,7 +72,7 @@ namespace Tizen.NUI Tizen.NUI.Object.SetProperty(scrollView.swigCPtr, ScrollView.Property.AXIS_AUTO_LOCK_ENABLED, new Tizen.NUI.PropertyValue((bool)newValue)); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var scrollView = (ScrollView)bindable; bool temp = false; @@ -89,7 +89,7 @@ namespace Tizen.NUI Tizen.NUI.Object.SetProperty(scrollView.swigCPtr, ScrollView.Property.WHEEL_SCROLL_DISTANCE_STEP, new Tizen.NUI.PropertyValue((Vector2)newValue)); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var scrollView = (ScrollView)bindable; Vector2 temp = new Vector2(0.0f, 0.0f); @@ -106,7 +106,7 @@ namespace Tizen.NUI Tizen.NUI.Object.SetProperty(scrollView.swigCPtr, ScrollView.Property.SCROLL_POSITION, new Tizen.NUI.PropertyValue((Vector2)newValue)); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var scrollView = (ScrollView)bindable; Vector2 temp = new Vector2(0.0f, 0.0f); @@ -123,7 +123,7 @@ namespace Tizen.NUI Tizen.NUI.Object.SetProperty(scrollView.swigCPtr, ScrollView.Property.SCROLL_PRE_POSITION, new Tizen.NUI.PropertyValue((Vector2)newValue)); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var scrollView = (ScrollView)bindable; Vector2 temp = new Vector2(0.0f, 0.0f); @@ -140,7 +140,7 @@ namespace Tizen.NUI Tizen.NUI.Object.SetProperty(scrollView.swigCPtr, ScrollView.Property.SCROLL_PRE_POSITION_MAX, new Tizen.NUI.PropertyValue((Vector2)newValue)); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var scrollView = (ScrollView)bindable; Vector2 temp = new Vector2(0.0f, 0.0f); @@ -157,7 +157,7 @@ namespace Tizen.NUI Tizen.NUI.Object.SetProperty(scrollView.swigCPtr, ScrollView.Property.OVERSHOOT_X, new Tizen.NUI.PropertyValue((float)newValue)); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var scrollView = (ScrollView)bindable; float temp = 0.0f; @@ -174,7 +174,7 @@ namespace Tizen.NUI Tizen.NUI.Object.SetProperty(scrollView.swigCPtr, ScrollView.Property.OVERSHOOT_Y, new Tizen.NUI.PropertyValue((float)newValue)); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var scrollView = (ScrollView)bindable; float temp = 0.0f; @@ -191,7 +191,7 @@ namespace Tizen.NUI Tizen.NUI.Object.SetProperty(scrollView.swigCPtr, ScrollView.Property.SCROLL_FINAL, new Tizen.NUI.PropertyValue((Vector2)newValue)); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var scrollView = (ScrollView)bindable; Vector2 temp = new Vector2(0.0f, 0.0f); @@ -208,7 +208,7 @@ namespace Tizen.NUI Tizen.NUI.Object.SetProperty(scrollView.swigCPtr, ScrollView.Property.WRAP, new Tizen.NUI.PropertyValue((bool)newValue)); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var scrollView = (ScrollView)bindable; bool temp = false; @@ -225,7 +225,7 @@ namespace Tizen.NUI Tizen.NUI.Object.SetProperty(scrollView.swigCPtr, ScrollView.Property.PANNING, new Tizen.NUI.PropertyValue((bool)newValue)); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var scrollView = (ScrollView)bindable; bool temp = false; @@ -242,7 +242,7 @@ namespace Tizen.NUI Tizen.NUI.Object.SetProperty(scrollView.swigCPtr, ScrollView.Property.SCROLLING, new Tizen.NUI.PropertyValue((bool)newValue)); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var scrollView = (ScrollView)bindable; bool temp = false; @@ -259,7 +259,7 @@ namespace Tizen.NUI Tizen.NUI.Object.SetProperty(scrollView.swigCPtr, ScrollView.Property.SCROLL_DOMAIN_SIZE, new Tizen.NUI.PropertyValue((Vector2)newValue)); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var scrollView = (ScrollView)bindable; Vector2 temp = new Vector2(0.0f, 0.0f); @@ -276,7 +276,7 @@ namespace Tizen.NUI Tizen.NUI.Object.SetProperty(scrollView.swigCPtr, ScrollView.Property.SCROLL_DOMAIN_OFFSET, new Tizen.NUI.PropertyValue((Vector2)newValue)); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var scrollView = (ScrollView)bindable; Vector2 temp = new Vector2(0.0f, 0.0f); @@ -293,7 +293,7 @@ namespace Tizen.NUI Tizen.NUI.Object.SetProperty(scrollView.swigCPtr, ScrollView.Property.SCROLL_POSITION_DELTA, new Tizen.NUI.PropertyValue((Vector2)newValue)); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var scrollView = (ScrollView)bindable; Vector2 temp = new Vector2(0.0f, 0.0f); @@ -310,7 +310,7 @@ namespace Tizen.NUI Tizen.NUI.Object.SetProperty(scrollView.swigCPtr, ScrollView.Property.START_PAGE_POSITION, new Tizen.NUI.PropertyValue((Vector3)newValue)); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var scrollView = (ScrollView)bindable; Vector3 temp = new Vector3(0.0f, 0.0f, 0.0f); @@ -327,98 +327,36 @@ namespace Tizen.NUI Tizen.NUI.Object.SetProperty(scrollView.swigCPtr, ScrollView.Property.SCROLL_MODE, new Tizen.NUI.PropertyValue((PropertyMap)newValue)); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var scrollView = (ScrollView)bindable; - PropertyValue value = Tizen.NUI.Object.GetProperty(scrollView.swigCPtr, ScrollView.Property.SCROLL_MODE ); + PropertyValue value = Tizen.NUI.Object.GetProperty(scrollView.swigCPtr, ScrollView.Property.SCROLL_MODE); PropertyMap map = new PropertyMap(); - value.Get( map ); + value.Get(map); return map; }); private global::System.Runtime.InteropServices.HandleRef swigCPtr; - internal ScrollView(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.ScrollView_SWIGUpcast(cPtr), cMemoryOwn) - { - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); - } - - internal static global::System.Runtime.InteropServices.HandleRef getCPtr(ScrollView obj) - { - return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; - } + private DaliEventHandler _scrollViewSnapStartedEventHandler; + private SnapStartedCallbackDelegate _scrollViewSnapStartedCallbackDelegate; /// - /// Dispose + /// Create an instance of ScrollView. /// - /// the dispose type /// 3 - protected override void Dispose(DisposeTypes type) + public ScrollView() : this(NDalicPINVOKE.ScrollView_New(), true) { - if (disposed) - { - return; - } - - if (type == DisposeTypes.Explicit) - { - //Called by User - //Release your own managed resources here. - //You should release all of your own disposable objects here. - - } - - //Release your own unmanaged resources here. - //You should not access any managed member here except static instance. - //because the execution order of Finalizes is non-deterministic. - - if (this != null && _scrollViewSnapStartedCallbackDelegate != null) - { - this.SnapStartedSignal().Disconnect(_scrollViewSnapStartedCallbackDelegate); - } - - if (swigCPtr.Handle != global::System.IntPtr.Zero) - { - if (swigCMemOwn) - { - swigCMemOwn = false; - NDalicPINVOKE.delete_ScrollView(swigCPtr); - } - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); - } - - base.Dispose(type); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } - /// - /// Event arguments that passed via the SnapStarted signal. - /// - /// 3 - public class SnapStartedEventArgs : EventArgs + internal ScrollView(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.ScrollView_SWIGUpcast(cPtr), cMemoryOwn) { - private Tizen.NUI.ScrollView.SnapEvent _snapEvent; - - /// - /// SnapEventInfo is the SnapEvent information like snap or flick (it tells the target position, scale, rotation for the snap or flick). - /// - /// 3 - public Tizen.NUI.ScrollView.SnapEvent SnapEventInfo - { - get - { - return _snapEvent; - } - set - { - _snapEvent = value; - } - } + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); } [UnmanagedFunctionPointer(CallingConvention.StdCall)] private delegate void SnapStartedCallbackDelegate(IntPtr data); - private DaliEventHandler _scrollViewSnapStartedEventHandler; - private SnapStartedCallbackDelegate _scrollViewSnapStartedCallbackDelegate; /// /// SnapStarted can be used to subscribe or unsubscribe the event handler @@ -457,398 +395,341 @@ namespace Tizen.NUI } } - // Callback for ScrollView SnapStarted signal - private void OnSnapStarted(IntPtr data) + /// + /// Sets and Gets WrapEnabled property. + /// + /// 3 + public bool WrapEnabled { - SnapStartedEventArgs e = new SnapStartedEventArgs(); - - // Populate all members of "e" (SnapStartedEventArgs) with real data - e.SnapEventInfo = SnapEvent.GetSnapEventFromPtr(data); - - if (_scrollViewSnapStartedEventHandler != null) + get { - //here we send all data to user event handlers - _scrollViewSnapStartedEventHandler(this, e); + return (bool)GetValue(WrapEnabledProperty); + } + set + { + SetValue(WrapEnabledProperty, value); } } /// - /// Snaps signal event's data. + /// Sets and Gets PanningEnabled property. /// /// 3 - public class SnapEvent : global::System.IDisposable + public bool PanningEnabled { - private global::System.Runtime.InteropServices.HandleRef swigCPtr; - /// - /// swigCMemOwn - /// - /// 3 - protected bool swigCMemOwn; - - internal SnapEvent(global::System.IntPtr cPtr, bool cMemoryOwn) + get { - swigCMemOwn = cMemoryOwn; - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); + return (bool)GetValue(PanningEnabledProperty); } - - internal static global::System.Runtime.InteropServices.HandleRef getCPtr(SnapEvent obj) + set { - return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; + SetValue(PanningEnabledProperty, value); } + } - //A Flag to check who called Dispose(). (By User or DisposeQueue) - private bool isDisposeQueued = false; - /// - /// A Flat to check if it is already disposed. - /// - /// swigCMemOwn - /// 3 - protected bool disposed = false; - - /// - /// Dispose - /// - /// 3 - ~SnapEvent() + /// + /// Sets and Gets AxisAutoLockEnabled property. + /// + /// 3 + public bool AxisAutoLockEnabled + { + get { - if (!isDisposeQueued) - { - isDisposeQueued = true; - DisposeQueue.Instance.Add(this); - } + return (bool)GetValue(AxisAutoLockEnabledProperty); } - - /// - /// Dispose. - /// - /// 3 - public void Dispose() + set { - //Throw excpetion if Dispose() is called in separate thread. - if (!Window.IsInstalled()) - { - throw new System.InvalidOperationException("This API called from separate thread. This API must be called from MainThread."); - } - - if (isDisposeQueued) - { - Dispose(DisposeTypes.Implicit); - } - else - { - Dispose(DisposeTypes.Explicit); - System.GC.SuppressFinalize(this); - } + SetValue(AxisAutoLockEnabledProperty, value); } + } - /// - /// Dispose - /// - /// the dispose type - /// 3 - protected virtual void Dispose(DisposeTypes type) + /// + /// Sets and Gets WheelScrollDistanceStep property. + /// + /// 3 + public Vector2 WheelScrollDistanceStep + { + get { - if (disposed) - { - return; - } - - if (type == DisposeTypes.Explicit) - { - //Called by User - //Release your own managed resources here. - //You should release all of your own disposable objects here. - - } - - //Release your own unmanaged resources here. - //You should not access any managed member here except static instance. - //because the execution order of Finalizes is non-deterministic. - - if (swigCPtr.Handle != global::System.IntPtr.Zero) - { - if (swigCMemOwn) - { - swigCMemOwn = false; - NDalicPINVOKE.delete_ScrollView_SnapEvent(swigCPtr); - } - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); - } - - disposed = true; + return (Vector2)GetValue(WheelScrollDistanceStepProperty); } - - /// - /// Get SnapEvent From Ptr - /// - /// 3 - public static SnapEvent GetSnapEventFromPtr(global::System.IntPtr cPtr) + set { - SnapEvent ret = new SnapEvent(cPtr, false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; + SetValue(WheelScrollDistanceStepProperty, value); } + } - internal SnapType type + /// + /// Sets and Gets ScrollPosition property. + /// + /// 3 + public Vector2 ScrollPosition + { + get { - set - { - NDalicPINVOKE.ScrollView_SnapEvent_type_set(swigCPtr, (int)value); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - get - { - SnapType ret = (SnapType)NDalicPINVOKE.ScrollView_SnapEvent_type_get(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } + return (Vector2)GetValue(ScrollPositionProperty); } - - /// - /// Scroll position. - /// - /// 3 - public Vector2 position + set { - set - { - NDalicPINVOKE.ScrollView_SnapEvent_position_set(swigCPtr, Vector2.getCPtr(value)); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - get - { - global::System.IntPtr cPtr = NDalicPINVOKE.ScrollView_SnapEvent_position_get(swigCPtr); - Vector2 ret = (cPtr == global::System.IntPtr.Zero) ? null : new Vector2(cPtr, false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } + SetValue(ScrollPositionProperty, value); } + } - /// - /// Scroll duration. - /// - /// 3 - public float duration + /// + /// Sets and Gets ScrollPrePosition property. + /// + /// 3 + public Vector2 ScrollPrePosition + { + get { - set - { - NDalicPINVOKE.ScrollView_SnapEvent_duration_set(swigCPtr, value); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - get - { - float ret = NDalicPINVOKE.ScrollView_SnapEvent_duration_get(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } + return (Vector2)GetValue(ScrollPrePositionProperty); } - - /// - /// Create an instance of SnapEvent. - /// - /// 3 - public SnapEvent() : this(NDalicPINVOKE.new_ScrollView_SnapEvent(), true) + set { - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + SetValue(ScrollPrePositionProperty, value); } - } /// - /// This should be internal, please do not use. + /// Sets and Gets ScrollPrePositionMax property. /// /// 3 - public new class Property + public Vector2 ScrollPrePositionMax { - /// - /// This should be internal, please do not use. - /// - /// 3 - public static readonly int WRAP_ENABLED = NDalicPINVOKE.ScrollView_Property_WRAP_ENABLED_get(); - /// - /// This should be internal, please do not use. - /// - /// 3 - public static readonly int PANNING_ENABLED = NDalicPINVOKE.ScrollView_Property_PANNING_ENABLED_get(); - /// - /// This should be internal, please do not use. - /// - /// 3 - public static readonly int AXIS_AUTO_LOCK_ENABLED = NDalicPINVOKE.ScrollView_Property_AXIS_AUTO_LOCK_ENABLED_get(); - /// - /// This should be internal, please do not use. - /// - /// 3 - public static readonly int WHEEL_SCROLL_DISTANCE_STEP = NDalicPINVOKE.ScrollView_Property_WHEEL_SCROLL_DISTANCE_STEP_get(); - /// - /// This should be internal, please do not use. - /// - /// 3 - public static readonly int SCROLL_MODE = NDalicPINVOKE.ScrollView_Property_SCROLL_MODE_get(); - /// - /// This should be internal, please do not use. - /// - /// 3 - public static readonly int SCROLL_POSITION = NDalicPINVOKE.ScrollView_Property_SCROLL_POSITION_get(); - /// - /// This should be internal, please do not use. - /// - /// 3 - public static readonly int SCROLL_PRE_POSITION = NDalicPINVOKE.ScrollView_Property_SCROLL_PRE_POSITION_get(); - /// - /// This should be internal, please do not use. - /// - /// 3 - public static readonly int SCROLL_PRE_POSITION_X = NDalicPINVOKE.ScrollView_Property_SCROLL_PRE_POSITION_X_get(); - /// - /// This should be internal, please do not use. - /// - /// 3 - public static readonly int SCROLL_PRE_POSITION_Y = NDalicPINVOKE.ScrollView_Property_SCROLL_PRE_POSITION_Y_get(); - /// - /// This should be internal, please do not use. - /// - /// 3 - public static readonly int SCROLL_PRE_POSITION_MAX = NDalicPINVOKE.ScrollView_Property_SCROLL_PRE_POSITION_MAX_get(); - /// - /// This should be internal, please do not use. - /// - /// 3 - public static readonly int SCROLL_PRE_POSITION_MAX_X = NDalicPINVOKE.ScrollView_Property_SCROLL_PRE_POSITION_MAX_X_get(); - /// - /// This should be internal, please do not use. - /// - /// 3 - public static readonly int SCROLL_PRE_POSITION_MAX_Y = NDalicPINVOKE.ScrollView_Property_SCROLL_PRE_POSITION_MAX_Y_get(); - /// - /// This should be internal, please do not use. - /// - /// 3 - public static readonly int OVERSHOOT_X = NDalicPINVOKE.ScrollView_Property_OVERSHOOT_X_get(); - /// - /// This should be internal, please do not use. - /// - /// 3 - public static readonly int OVERSHOOT_Y = NDalicPINVOKE.ScrollView_Property_OVERSHOOT_Y_get(); - /// - /// This should be internal, please do not use. - /// - /// 3 - public static readonly int SCROLL_FINAL = NDalicPINVOKE.ScrollView_Property_SCROLL_FINAL_get(); - /// - /// This should be internal, please do not use. - /// - /// 3 - public static readonly int SCROLL_FINAL_X = NDalicPINVOKE.ScrollView_Property_SCROLL_FINAL_X_get(); - /// - /// This should be internal, please do not use. - /// - /// 3 - public static readonly int SCROLL_FINAL_Y = NDalicPINVOKE.ScrollView_Property_SCROLL_FINAL_Y_get(); - /// - /// This should be internal, please do not use. - /// - /// 3 - public static readonly int WRAP = NDalicPINVOKE.ScrollView_Property_WRAP_get(); - /// - /// This should be internal, please do not use. - /// - /// 3 - public static readonly int PANNING = NDalicPINVOKE.ScrollView_Property_PANNING_get(); - /// - /// This should be internal, please do not use. - /// - /// 3 - public static readonly int SCROLLING = NDalicPINVOKE.ScrollView_Property_SCROLLING_get(); - /// - /// This should be internal, please do not use. - /// - /// 3 - public static readonly int SCROLL_DOMAIN_SIZE = NDalicPINVOKE.ScrollView_Property_SCROLL_DOMAIN_SIZE_get(); - /// - /// This should be internal, please do not use. - /// - /// 3 - public static readonly int SCROLL_DOMAIN_SIZE_X = NDalicPINVOKE.ScrollView_Property_SCROLL_DOMAIN_SIZE_X_get(); - /// - /// This should be internal, please do not use. - /// - /// 3 - public static readonly int SCROLL_DOMAIN_SIZE_Y = NDalicPINVOKE.ScrollView_Property_SCROLL_DOMAIN_SIZE_Y_get(); - /// - /// This should be internal, please do not use. - /// - /// 3 - public static readonly int SCROLL_DOMAIN_OFFSET = NDalicPINVOKE.ScrollView_Property_SCROLL_DOMAIN_OFFSET_get(); - /// - /// This should be internal, please do not use. - /// - /// 3 - public static readonly int SCROLL_POSITION_DELTA = NDalicPINVOKE.ScrollView_Property_SCROLL_POSITION_DELTA_get(); - /// - /// This should be internal, please do not use. - /// - /// 3 - public static readonly int START_PAGE_POSITION = NDalicPINVOKE.ScrollView_Property_START_PAGE_POSITION_get(); - + get + { + return (Vector2)GetValue(ScrollPrePositionMaxProperty); + } + set + { + SetValue(ScrollPrePositionMaxProperty, value); + } } /// - /// Create an instance of ScrollView. + /// Sets and Gets OvershootX property. /// /// 3 - public ScrollView() : this(NDalicPINVOKE.ScrollView_New(), true) + public float OvershootX { - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - + get + { + return (float)GetValue(OvershootXProperty); + } + set + { + SetValue(OvershootXProperty, value); + } } /// - /// Gets snap-animation's AlphaFunction. + /// Sets and Gets OvershootY property. /// - /// Current easing alpha function of the snap animation. /// 3 - public AlphaFunction GetScrollSnapAlphaFunction() + public float OvershootY { - AlphaFunction ret = new AlphaFunction(NDalicPINVOKE.ScrollView_GetScrollSnapAlphaFunction(swigCPtr), true); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; + get + { + return (float)GetValue(OvershootYProperty); + } + set + { + SetValue(OvershootYProperty, value); + } } /// - /// Sets snap-animation's AlphaFunction. + /// Sets and Gets ScrollFinal property. /// - /// Easing alpha function of the snap animation. /// 3 - public void SetScrollSnapAlphaFunction(AlphaFunction alpha) + public Vector2 ScrollFinal { - NDalicPINVOKE.ScrollView_SetScrollSnapAlphaFunction(swigCPtr, AlphaFunction.getCPtr(alpha)); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + get + { + return (Vector2)GetValue(ScrollFinalProperty); + } + set + { + SetValue(ScrollFinalProperty, value); + } } /// - /// Gets flick-animation's AlphaFunction. + /// Sets and Gets Wrap property. /// - /// Current easing alpha function of the flick animation. /// 3 - public AlphaFunction GetScrollFlickAlphaFunction() + public bool Wrap { - AlphaFunction ret = new AlphaFunction(NDalicPINVOKE.ScrollView_GetScrollFlickAlphaFunction(swigCPtr), true); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; + get + { + return (bool)GetValue(WrapProperty); + } + set + { + SetValue(WrapProperty, value); + } } /// - /// Sets flick-animation's AlphaFunction. + /// Sets and Gets Panning property. /// - /// Easing alpha function of the flick animation. /// 3 - public void SetScrollFlickAlphaFunction(AlphaFunction alpha) + public bool Panning { - NDalicPINVOKE.ScrollView_SetScrollFlickAlphaFunction(swigCPtr, AlphaFunction.getCPtr(alpha)); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - + get + { + return (bool)GetValue(PanningProperty); + } + set + { + SetValue(PanningProperty, value); + } + } + + /// + /// Sets and Gets Scrolling property. + /// + /// 3 + public bool Scrolling + { + get + { + return (bool)GetValue(ScrollingProperty); + } + set + { + SetValue(ScrollingProperty, value); + } + } + + /// + /// Sets and Gets ScrollDomainSize property. + /// + /// 3 + public Vector2 ScrollDomainSize + { + get + { + return (Vector2)GetValue(ScrollDomainSizeProperty); + } + set + { + SetValue(ScrollDomainSizeProperty, value); + } + } + + /// + /// Sets and Gets ScrollDomainOffset property. + /// + /// 3 + public Vector2 ScrollDomainOffset + { + get + { + return (Vector2)GetValue(ScrollDomainOffsetProperty); + } + set + { + SetValue(ScrollDomainOffsetProperty, value); + } + } + + /// + /// Sets and Gets ScrollPositionDelta property. + /// + /// 3 + public Vector2 ScrollPositionDelta + { + get + { + return (Vector2)GetValue(ScrollPositionDeltaProperty); + } + set + { + SetValue(ScrollPositionDeltaProperty, value); + } + } + + /// + /// Sets and Gets StartPagePosition property. + /// + /// 3 + public Vector3 StartPagePosition + { + get + { + return (Vector3)GetValue(StartPagePositionProperty); + } + set + { + SetValue(StartPagePositionProperty, value); + } + } + + + /// + /// Sets and Gets ScrollMode property. + /// + /// 3 + public PropertyMap ScrollMode + { + get + { + return (PropertyMap)GetValue(ScrollModeProperty); + } + set + { + SetValue(ScrollModeProperty, value); + } + } + + /// + /// Gets snap-animation's AlphaFunction. + /// + /// Current easing alpha function of the snap animation. + /// 3 + public AlphaFunction GetScrollSnapAlphaFunction() + { + AlphaFunction ret = new AlphaFunction(NDalicPINVOKE.ScrollView_GetScrollSnapAlphaFunction(swigCPtr), true); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + /// + /// Sets snap-animation's AlphaFunction. + /// + /// Easing alpha function of the snap animation. + /// 3 + public void SetScrollSnapAlphaFunction(AlphaFunction alpha) + { + NDalicPINVOKE.ScrollView_SetScrollSnapAlphaFunction(swigCPtr, AlphaFunction.getCPtr(alpha)); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + /// + /// Gets flick-animation's AlphaFunction. + /// + /// Current easing alpha function of the flick animation. + /// 3 + public AlphaFunction GetScrollFlickAlphaFunction() + { + AlphaFunction ret = new AlphaFunction(NDalicPINVOKE.ScrollView_GetScrollFlickAlphaFunction(swigCPtr), true); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + /// + /// Sets flick-animation's AlphaFunction. + /// + /// Easing alpha function of the flick animation. + /// 3 + public void SetScrollFlickAlphaFunction(AlphaFunction alpha) + { + NDalicPINVOKE.ScrollView_SetScrollFlickAlphaFunction(swigCPtr, AlphaFunction.getCPtr(alpha)); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + /// /// Gets the time for the scroll snap-animation. /// @@ -1347,12 +1228,6 @@ namespace Tizen.NUI return ret; } - internal void ApplyConstraintToChildren(SWIGTYPE_p_Dali__Constraint constraint) - { - NDalicPINVOKE.ScrollView_ApplyConstraintToChildren(swigCPtr, SWIGTYPE_p_Dali__Constraint.getCPtr(constraint)); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - /// /// Applies Effect to ScrollView. /// @@ -1443,6 +1318,17 @@ namespace Tizen.NUI if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } + internal static global::System.Runtime.InteropServices.HandleRef getCPtr(ScrollView obj) + { + return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; + } + + internal void ApplyConstraintToChildren(SWIGTYPE_p_Dali__Constraint constraint) + { + NDalicPINVOKE.ScrollView_ApplyConstraintToChildren(swigCPtr, SWIGTYPE_p_Dali__Constraint.getCPtr(constraint)); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + internal ScrollViewSnapStartedSignal SnapStartedSignal() { ScrollViewSnapStartedSignal ret = new ScrollViewSnapStartedSignal(NDalicPINVOKE.ScrollView_SnapStartedSignal(swigCPtr), false); @@ -1451,294 +1337,406 @@ namespace Tizen.NUI } /// - /// Sets and Gets WrapEnabled property. + /// Dispose /// + /// the dispose type /// 3 - public bool WrapEnabled + protected override void Dispose(DisposeTypes type) { - get - { - return (bool)GetValue(WrapEnabledProperty); - } - set + if (disposed) { - SetValue(WrapEnabledProperty, value); + return; } - } - /// - /// Sets and Gets PanningEnabled property. - /// - /// 3 - public bool PanningEnabled - { - get - { - return (bool)GetValue(PanningEnabledProperty); - } - set + if (type == DisposeTypes.Explicit) { - SetValue(PanningEnabledProperty, value); + //Called by User + //Release your own managed resources here. + //You should release all of your own disposable objects here. + } - } - /// - /// Sets and Gets AxisAutoLockEnabled property. - /// - /// 3 - public bool AxisAutoLockEnabled - { - get + //Release your own unmanaged resources here. + //You should not access any managed member here except static instance. + //because the execution order of Finalizes is non-deterministic. + + if (this != null && _scrollViewSnapStartedCallbackDelegate != null) { - return (bool)GetValue(AxisAutoLockEnabledProperty); + this.SnapStartedSignal().Disconnect(_scrollViewSnapStartedCallbackDelegate); } - set + + if (swigCPtr.Handle != global::System.IntPtr.Zero) { - SetValue(AxisAutoLockEnabledProperty, value); + if (swigCMemOwn) + { + swigCMemOwn = false; + NDalicPINVOKE.delete_ScrollView(swigCPtr); + } + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); } + + base.Dispose(type); } - /// - /// Sets and Gets WheelScrollDistanceStep property. - /// - /// 3 - public Vector2 WheelScrollDistanceStep + // Callback for ScrollView SnapStarted signal + private void OnSnapStarted(IntPtr data) { - get - { - return (Vector2)GetValue(WheelScrollDistanceStepProperty); - } - set + SnapStartedEventArgs e = new SnapStartedEventArgs(); + + // Populate all members of "e" (SnapStartedEventArgs) with real data + e.SnapEventInfo = SnapEvent.GetSnapEventFromPtr(data); + + if (_scrollViewSnapStartedEventHandler != null) { - SetValue(WheelScrollDistanceStepProperty, value); + //here we send all data to user event handlers + _scrollViewSnapStartedEventHandler(this, e); } } /// - /// Sets and Gets ScrollPosition property. + /// This should be internal, please do not use. /// /// 3 - public Vector2 ScrollPosition + public new class Property { - get - { - return (Vector2)GetValue(ScrollPositionProperty); - } - set - { - SetValue(ScrollPositionProperty, value); - } + /// + /// This should be internal, please do not use. + /// + /// 3 + public static readonly int WRAP_ENABLED = NDalicPINVOKE.ScrollView_Property_WRAP_ENABLED_get(); + /// + /// This should be internal, please do not use. + /// + /// 3 + public static readonly int PANNING_ENABLED = NDalicPINVOKE.ScrollView_Property_PANNING_ENABLED_get(); + /// + /// This should be internal, please do not use. + /// + /// 3 + public static readonly int AXIS_AUTO_LOCK_ENABLED = NDalicPINVOKE.ScrollView_Property_AXIS_AUTO_LOCK_ENABLED_get(); + /// + /// This should be internal, please do not use. + /// + /// 3 + public static readonly int WHEEL_SCROLL_DISTANCE_STEP = NDalicPINVOKE.ScrollView_Property_WHEEL_SCROLL_DISTANCE_STEP_get(); + /// + /// This should be internal, please do not use. + /// + /// 3 + public static readonly int SCROLL_MODE = NDalicPINVOKE.ScrollView_Property_SCROLL_MODE_get(); + /// + /// This should be internal, please do not use. + /// + /// 3 + public static readonly int SCROLL_POSITION = NDalicPINVOKE.ScrollView_Property_SCROLL_POSITION_get(); + /// + /// This should be internal, please do not use. + /// + /// 3 + public static readonly int SCROLL_PRE_POSITION = NDalicPINVOKE.ScrollView_Property_SCROLL_PRE_POSITION_get(); + /// + /// This should be internal, please do not use. + /// + /// 3 + public static readonly int SCROLL_PRE_POSITION_X = NDalicPINVOKE.ScrollView_Property_SCROLL_PRE_POSITION_X_get(); + /// + /// This should be internal, please do not use. + /// + /// 3 + public static readonly int SCROLL_PRE_POSITION_Y = NDalicPINVOKE.ScrollView_Property_SCROLL_PRE_POSITION_Y_get(); + /// + /// This should be internal, please do not use. + /// + /// 3 + public static readonly int SCROLL_PRE_POSITION_MAX = NDalicPINVOKE.ScrollView_Property_SCROLL_PRE_POSITION_MAX_get(); + /// + /// This should be internal, please do not use. + /// + /// 3 + public static readonly int SCROLL_PRE_POSITION_MAX_X = NDalicPINVOKE.ScrollView_Property_SCROLL_PRE_POSITION_MAX_X_get(); + /// + /// This should be internal, please do not use. + /// + /// 3 + public static readonly int SCROLL_PRE_POSITION_MAX_Y = NDalicPINVOKE.ScrollView_Property_SCROLL_PRE_POSITION_MAX_Y_get(); + /// + /// This should be internal, please do not use. + /// + /// 3 + public static readonly int OVERSHOOT_X = NDalicPINVOKE.ScrollView_Property_OVERSHOOT_X_get(); + /// + /// This should be internal, please do not use. + /// + /// 3 + public static readonly int OVERSHOOT_Y = NDalicPINVOKE.ScrollView_Property_OVERSHOOT_Y_get(); + /// + /// This should be internal, please do not use. + /// + /// 3 + public static readonly int SCROLL_FINAL = NDalicPINVOKE.ScrollView_Property_SCROLL_FINAL_get(); + /// + /// This should be internal, please do not use. + /// + /// 3 + public static readonly int SCROLL_FINAL_X = NDalicPINVOKE.ScrollView_Property_SCROLL_FINAL_X_get(); + /// + /// This should be internal, please do not use. + /// + /// 3 + public static readonly int SCROLL_FINAL_Y = NDalicPINVOKE.ScrollView_Property_SCROLL_FINAL_Y_get(); + /// + /// This should be internal, please do not use. + /// + /// 3 + public static readonly int WRAP = NDalicPINVOKE.ScrollView_Property_WRAP_get(); + /// + /// This should be internal, please do not use. + /// + /// 3 + public static readonly int PANNING = NDalicPINVOKE.ScrollView_Property_PANNING_get(); + /// + /// This should be internal, please do not use. + /// + /// 3 + public static readonly int SCROLLING = NDalicPINVOKE.ScrollView_Property_SCROLLING_get(); + /// + /// This should be internal, please do not use. + /// + /// 3 + public static readonly int SCROLL_DOMAIN_SIZE = NDalicPINVOKE.ScrollView_Property_SCROLL_DOMAIN_SIZE_get(); + /// + /// This should be internal, please do not use. + /// + /// 3 + public static readonly int SCROLL_DOMAIN_SIZE_X = NDalicPINVOKE.ScrollView_Property_SCROLL_DOMAIN_SIZE_X_get(); + /// + /// This should be internal, please do not use. + /// + /// 3 + public static readonly int SCROLL_DOMAIN_SIZE_Y = NDalicPINVOKE.ScrollView_Property_SCROLL_DOMAIN_SIZE_Y_get(); + /// + /// This should be internal, please do not use. + /// + /// 3 + public static readonly int SCROLL_DOMAIN_OFFSET = NDalicPINVOKE.ScrollView_Property_SCROLL_DOMAIN_OFFSET_get(); + /// + /// This should be internal, please do not use. + /// + /// 3 + public static readonly int SCROLL_POSITION_DELTA = NDalicPINVOKE.ScrollView_Property_SCROLL_POSITION_DELTA_get(); + /// + /// This should be internal, please do not use. + /// + /// 3 + public static readonly int START_PAGE_POSITION = NDalicPINVOKE.ScrollView_Property_START_PAGE_POSITION_get(); } /// - /// Sets and Gets ScrollPrePosition property. + /// Snaps signal event's data. /// /// 3 - public Vector2 ScrollPrePosition + public class SnapEvent : global::System.IDisposable { - get - { - return (Vector2)GetValue(ScrollPrePositionProperty); - } - set - { - SetValue(ScrollPrePositionProperty, value); - } - } + /// + /// swigCMemOwn + /// + /// 3 + protected bool swigCMemOwn; - /// - /// Sets and Gets ScrollPrePositionMax property. - /// - /// 3 - public Vector2 ScrollPrePositionMax - { - get - { - return (Vector2)GetValue(ScrollPrePositionMaxProperty); - } - set - { - SetValue(ScrollPrePositionMaxProperty, value); - } - } + /// + /// A Flat to check if it is already disposed. + /// + /// swigCMemOwn + /// 3 + protected bool disposed = false; - /// - /// Sets and Gets OvershootX property. - /// - /// 3 - public float OvershootX - { - get - { - return (float)GetValue(OvershootXProperty); - } - set - { - SetValue(OvershootXProperty, value); - } - } + private global::System.Runtime.InteropServices.HandleRef swigCPtr; - /// - /// Sets and Gets OvershootY property. - /// - /// 3 - public float OvershootY - { - get - { - return (float)GetValue(OvershootYProperty); - } - set - { - SetValue(OvershootYProperty, value); - } - } + //A Flag to check who called Dispose(). (By User or DisposeQueue) + private bool isDisposeQueued = false; - /// - /// Sets and Gets ScrollFinal property. - /// - /// 3 - public Vector2 ScrollFinal - { - get - { - return (Vector2)GetValue(ScrollFinalProperty); - } - set + /// + /// Create an instance of SnapEvent. + /// + /// 3 + public SnapEvent() : this(NDalicPINVOKE.new_ScrollView_SnapEvent(), true) { - SetValue(ScrollFinalProperty, value); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } - } - /// - /// Sets and Gets Wrap property. - /// - /// 3 - public bool Wrap - { - get - { - return (bool)GetValue(WrapProperty); - } - set + internal SnapEvent(global::System.IntPtr cPtr, bool cMemoryOwn) { - SetValue(WrapProperty, value); + swigCMemOwn = cMemoryOwn; + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); } - } - /// - /// Sets and Gets Panning property. - /// - /// 3 - public bool Panning - { - get - { - return (bool)GetValue(PanningProperty); - } - set + /// + /// Dispose + /// + /// 3 + ~SnapEvent() { - SetValue(PanningProperty, value); + if (!isDisposeQueued) + { + isDisposeQueued = true; + DisposeQueue.Instance.Add(this); + } } - } - /// - /// Sets and Gets Scrolling property. - /// - /// 3 - public bool Scrolling - { - get - { - return (bool)GetValue(ScrollingProperty); - } - set + /// + /// Scroll position. + /// + /// 3 + public Vector2 position { - SetValue(ScrollingProperty, value); + set + { + NDalicPINVOKE.ScrollView_SnapEvent_position_set(swigCPtr, Vector2.getCPtr(value)); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + get + { + global::System.IntPtr cPtr = NDalicPINVOKE.ScrollView_SnapEvent_position_get(swigCPtr); + Vector2 ret = (cPtr == global::System.IntPtr.Zero) ? null : new Vector2(cPtr, false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } } - } - /// - /// Sets and Gets ScrollDomainSize property. - /// - /// 3 - public Vector2 ScrollDomainSize - { - get - { - return (Vector2)GetValue(ScrollDomainSizeProperty); - } - set + /// + /// Scroll duration. + /// + /// 3 + public float duration { - SetValue(ScrollDomainSizeProperty, value); + set + { + NDalicPINVOKE.ScrollView_SnapEvent_duration_set(swigCPtr, value); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + get + { + float ret = NDalicPINVOKE.ScrollView_SnapEvent_duration_get(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } } - } - /// - /// Sets and Gets ScrollDomainOffset property. - /// - /// 3 - public Vector2 ScrollDomainOffset - { - get - { - return (Vector2)GetValue(ScrollDomainOffsetProperty); - } - set + internal SnapType type { - SetValue(ScrollDomainOffsetProperty, value); + set + { + NDalicPINVOKE.ScrollView_SnapEvent_type_set(swigCPtr, (int)value); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + get + { + SnapType ret = (SnapType)NDalicPINVOKE.ScrollView_SnapEvent_type_get(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } } - } - /// - /// Sets and Gets ScrollPositionDelta property. - /// - /// 3 - public Vector2 ScrollPositionDelta - { - get + /// + /// Get SnapEvent From Ptr + /// + /// 3 + public static SnapEvent GetSnapEventFromPtr(global::System.IntPtr cPtr) { - return (Vector2)GetValue(ScrollPositionDeltaProperty); + SnapEvent ret = new SnapEvent(cPtr, false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; } - set + + /// + /// Dispose. + /// + /// 3 + public void Dispose() { - SetValue(ScrollPositionDeltaProperty, value); + //Throw excpetion if Dispose() is called in separate thread. + if (!Window.IsInstalled()) + { + throw new System.InvalidOperationException("This API called from separate thread. This API must be called from MainThread."); + } + + if (isDisposeQueued) + { + Dispose(DisposeTypes.Implicit); + } + else + { + Dispose(DisposeTypes.Explicit); + System.GC.SuppressFinalize(this); + } } - } - /// - /// Sets and Gets StartPagePosition property. - /// - /// 3 - public Vector3 StartPagePosition - { - get + internal static global::System.Runtime.InteropServices.HandleRef getCPtr(SnapEvent obj) { - return (Vector3)GetValue(StartPagePositionProperty); + return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; } - set + + /// + /// Dispose + /// + /// the dispose type + /// 3 + protected virtual void Dispose(DisposeTypes type) { - SetValue(StartPagePositionProperty, value); - } - } + if (disposed) + { + return; + } + if (type == DisposeTypes.Explicit) + { + //Called by User + //Release your own managed resources here. + //You should release all of your own disposable objects here. + + } + + //Release your own unmanaged resources here. + //You should not access any managed member here except static instance. + //because the execution order of Finalizes is non-deterministic. + + if (swigCPtr.Handle != global::System.IntPtr.Zero) + { + if (swigCMemOwn) + { + swigCMemOwn = false; + NDalicPINVOKE.delete_ScrollView_SnapEvent(swigCPtr); + } + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); + } + + disposed = true; + } + } /// - /// Sets and Gets ScrollMode property. + /// Event arguments that passed via the SnapStarted signal. /// /// 3 - public PropertyMap ScrollMode + public class SnapStartedEventArgs : EventArgs { - get - { - return (PropertyMap)GetValue(ScrollModeProperty); - } - set + private Tizen.NUI.ScrollView.SnapEvent _snapEvent; + + /// + /// SnapEventInfo is the SnapEvent information like snap or flick (it tells the target position, scale, rotation for the snap or flick). + /// + /// 3 + public Tizen.NUI.ScrollView.SnapEvent SnapEventInfo { - SetValue(ScrollModeProperty, value); + get + { + return _snapEvent; + } + set + { + _snapEvent = value; + } } } - } - } diff --git a/src/Tizen.NUI/src/public/UIComponents/Slider.cs b/src/Tizen.NUI/src/public/UIComponents/Slider.cs index 73f0e3c..36acfff 100755 --- a/src/Tizen.NUI/src/public/UIComponents/Slider.cs +++ b/src/Tizen.NUI/src/public/UIComponents/Slider.cs @@ -286,211 +286,38 @@ namespace Tizen.NUI.UIComponents }); private global::System.Runtime.InteropServices.HandleRef swigCPtr; - - internal Slider(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.Slider_SWIGUpcast(cPtr), cMemoryOwn) - { - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); - } - - internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Slider obj) - { - return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; - } - - /// - /// Dispose. - /// - /// 3 - protected override void Dispose(DisposeTypes type) - { - if (disposed) - { - return; - } - - if (type == DisposeTypes.Explicit) - { - //Called by User - //Release your own managed resources here. - //You should release all of your own disposable objects here. - - } - - //Release your own unmanaged resources here. - //You should not access any managed member here except static instance. - //because the execution order of Finalizes is non-deterministic. - if (this != null) - { - if (_sliderValueChangedCallbackDelegate != null) - { - ValueChangedSignal().Disconnect(_sliderValueChangedCallbackDelegate); - } - - if (_sliderSlidingFinishedCallbackDelegate != null) - { - SlidingFinishedSignal().Disconnect(_sliderSlidingFinishedCallbackDelegate); - } - - if (_sliderMarkReachedCallbackDelegate != null) - { - MarkReachedSignal().Disconnect(_sliderMarkReachedCallbackDelegate); - } - } - - if (swigCPtr.Handle != global::System.IntPtr.Zero) - { - if (swigCMemOwn) - { - swigCMemOwn = false; - NDalicPINVOKE.delete_Slider(swigCPtr); - } - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); - } - - base.Dispose(type); - } + private EventHandlerWithReturnType _sliderValueChangedEventHandler; + private ValueChangedCallbackDelegate _sliderValueChangedCallbackDelegate; + private EventHandlerWithReturnType _sliderSlidingFinishedEventHandler; + private SlidingFinishedCallbackDelegate _sliderSlidingFinishedCallbackDelegate; + private EventHandlerWithReturnType _sliderMarkReachedEventHandler; + private MarkReachedCallbackDelegate _sliderMarkReachedCallbackDelegate; /// - /// The ValueChanged event arguments. + /// Creates the slider control. /// /// 3 - public class ValueChangedEventArgs : EventArgs + public Slider() : this(NDalicPINVOKE.Slider_New(), true) { - private Slider _slider; - private float _slideValue; - - /// - /// The slider. - /// - /// 3 - public Slider Slider - { - get - { - return _slider; - } - set - { - _slider = value; - } - } - - /// - /// The slider value. - /// - /// 3 - public float SlideValue - { - get - { - return _slideValue; - } - set - { - _slideValue = value; - } - } + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } - /// - /// The SlidingFinished event arguments. - /// - /// 3 - public class SlidingFinishedEventArgs : EventArgs + internal Slider(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.Slider_SWIGUpcast(cPtr), cMemoryOwn) { - private Slider _slider; - private float _slideValue; - - /// - /// The slider. - /// - /// 3 - public Slider Slider - { - get - { - return _slider; - } - set - { - _slider = value; - } - } - - /// - /// The slider value. - /// - /// 3 - public float SlideValue - { - get - { - return _slideValue; - } - set - { - _slideValue = value; - } - } + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); } - /// - /// The MarkReached event arguments. - /// - /// 3 - public class MarkReachedEventArgs : EventArgs + internal Slider(Slider handle) : this(NDalicPINVOKE.new_Slider__SWIG_1(Slider.getCPtr(handle)), true) { - private Slider _slider; - private int _slideValue; - - /// - /// The slider. - /// - /// 3 - public Slider Slider - { - get - { - return _slider; - } - set - { - _slider = value; - } - } - - /// - /// The slider value. - /// - /// 3 - public int SlideValue - { - get - { - return _slideValue; - } - set - { - _slideValue = value; - } - } + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } - [UnmanagedFunctionPointer(CallingConvention.StdCall)] private delegate bool ValueChangedCallbackDelegate(IntPtr slider, float slideValue); - private EventHandlerWithReturnType _sliderValueChangedEventHandler; - private ValueChangedCallbackDelegate _sliderValueChangedCallbackDelegate; - [UnmanagedFunctionPointer(CallingConvention.StdCall)] private delegate bool SlidingFinishedCallbackDelegate(IntPtr slider, float slideValue); - private EventHandlerWithReturnType _sliderSlidingFinishedEventHandler; - private SlidingFinishedCallbackDelegate _sliderSlidingFinishedCallbackDelegate; - [UnmanagedFunctionPointer(CallingConvention.StdCall)] private delegate bool MarkReachedCallbackDelegate(IntPtr slider, int slideValue); - private EventHandlerWithReturnType _sliderMarkReachedEventHandler; - private MarkReachedCallbackDelegate _sliderMarkReachedCallbackDelegate; /// /// An event emitted when the slider value changes. @@ -517,23 +344,6 @@ namespace Tizen.NUI.UIComponents } } - // Callback for Slider ValueChanged signal - private bool OnValueChanged(IntPtr slider, float slideValue) - { - ValueChangedEventArgs e = new ValueChangedEventArgs(); - - // Populate all members of "e" (ValueChangedEventArgs) with real page - e.Slider = Slider.GetSliderFromPtr(slider); - e.SlideValue = slideValue; - - if (_sliderValueChangedEventHandler != null) - { - //here we send all page to user event handlers - return _sliderValueChangedEventHandler(this, e); - } - return false; - } - /// /// An event emitted when the sliding is finished. /// @@ -559,23 +369,6 @@ namespace Tizen.NUI.UIComponents } } - // Callback for Slider SlidingFinished signal - private bool OnSlidingFinished(IntPtr slider, float slideValue) - { - SlidingFinishedEventArgs e = new SlidingFinishedEventArgs(); - - // Populate all members of "e" (SlidingFinishedEventArgs) with real page - e.Slider = Slider.GetSliderFromPtr(slider); - e.SlideValue = slideValue; - - if (_sliderSlidingFinishedEventHandler != null) - { - //here we send all page to user event handlers - return _sliderSlidingFinishedEventHandler(this, e); - } - return false; - } - /// /// An event emitted when the slider handle reaches a mark. /// @@ -601,230 +394,19 @@ namespace Tizen.NUI.UIComponents } } - // Callback for Slider MarkReached signal - private bool OnMarkReached(IntPtr slider, int slideValue) + /// + /// The lower bound property. + /// + /// 3 + public float LowerBound { - MarkReachedEventArgs e = new MarkReachedEventArgs(); - - // Populate all members of "e" (MarkReachedEventArgs) with real page - e.Slider = Slider.GetSliderFromPtr(slider); - e.SlideValue = slideValue; - - if (_sliderMarkReachedEventHandler != null) + get { - //here we send all page to user event handlers - return _sliderMarkReachedEventHandler(this, e); - } - return false; - } - - /// - /// Gets the slider from the pointer. - /// - /// The pointer of the slider. - /// The object of the slider type. - internal static Slider GetSliderFromPtr(global::System.IntPtr cPtr) - { - Slider ret = new Slider(cPtr, false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - internal new class Property : global::System.IDisposable - { - private global::System.Runtime.InteropServices.HandleRef swigCPtr; - protected bool swigCMemOwn; - - internal Property(global::System.IntPtr cPtr, bool cMemoryOwn) - { - swigCMemOwn = cMemoryOwn; - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); - } - - internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Property obj) - { - return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; - } - - //A Flag to check who called Dispose(). (By User or DisposeQueue) - private bool isDisposeQueued = false; - //A Flat to check if it is already disposed. - protected bool disposed = false; - - ~Property() - { - if (!isDisposeQueued) - { - isDisposeQueued = true; - DisposeQueue.Instance.Add(this); - } - } - - /// 3 - public void Dispose() - { - //Throw excpetion if Dispose() is called in separate thread. - if (!Window.IsInstalled()) - { - throw new System.InvalidOperationException("This API called from separate thread. This API must be called from MainThread."); - } - - if (isDisposeQueued) - { - Dispose(DisposeTypes.Implicit); - } - else - { - Dispose(DisposeTypes.Explicit); - System.GC.SuppressFinalize(this); - } - } - - protected virtual void Dispose(DisposeTypes type) - { - if (disposed) - { - return; - } - - if (type == DisposeTypes.Explicit) - { - //Called by User - //Release your own managed resources here. - //You should release all of your own disposable objects here. - - } - - //Release your own unmanaged resources here. - //You should not access any managed member here except static instance. - //because the execution order of Finalizes is non-deterministic. - - if (swigCPtr.Handle != global::System.IntPtr.Zero) - { - if (swigCMemOwn) - { - swigCMemOwn = false; - NDalicPINVOKE.delete_Slider_Property(swigCPtr); - } - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); - } - - disposed = true; - } - - internal Property() : this(NDalicPINVOKE.new_Slider_Property(), true) - { - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - internal static readonly int LOWER_BOUND = NDalicPINVOKE.Slider_Property_LOWER_BOUND_get(); - internal static readonly int UPPER_BOUND = NDalicPINVOKE.Slider_Property_UPPER_BOUND_get(); - internal static readonly int VALUE = NDalicPINVOKE.Slider_Property_VALUE_get(); - internal static readonly int TRACK_VISUAL = NDalicPINVOKE.Slider_Property_TRACK_VISUAL_get(); - internal static readonly int HANDLE_VISUAL = NDalicPINVOKE.Slider_Property_HANDLE_VISUAL_get(); - internal static readonly int PROGRESS_VISUAL = NDalicPINVOKE.Slider_Property_PROGRESS_VISUAL_get(); - internal static readonly int POPUP_VISUAL = NDalicPINVOKE.Slider_Property_POPUP_VISUAL_get(); - internal static readonly int POPUP_ARROW_VISUAL = NDalicPINVOKE.Slider_Property_POPUP_ARROW_VISUAL_get(); - internal static readonly int DISABLED_COLOR = NDalicPINVOKE.Slider_Property_DISABLED_COLOR_get(); - internal static readonly int VALUE_PRECISION = NDalicPINVOKE.Slider_Property_VALUE_PRECISION_get(); - internal static readonly int SHOW_POPUP = NDalicPINVOKE.Slider_Property_SHOW_POPUP_get(); - internal static readonly int SHOW_VALUE = NDalicPINVOKE.Slider_Property_SHOW_VALUE_get(); - internal static readonly int MARKS = NDalicPINVOKE.Slider_Property_MARKS_get(); - internal static readonly int SNAP_TO_MARKS = NDalicPINVOKE.Slider_Property_SNAP_TO_MARKS_get(); - internal static readonly int MARK_TOLERANCE = NDalicPINVOKE.Slider_Property_MARK_TOLERANCE_get(); - - } - - /// - /// Creates the slider control. - /// - /// 3 - public Slider() : this(NDalicPINVOKE.Slider_New(), true) - { - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - internal override bool IsCreateByXaml - { - get - { - return base.IsCreateByXaml; - } - set - { - base.IsCreateByXaml = value; - - if (value == true) - { - this.ValueChanged += (obj, e) => { - this.Value = e.SlideValue; - return true; - }; - } - } - } - - internal Slider(Slider handle) : this(NDalicPINVOKE.new_Slider__SWIG_1(Slider.getCPtr(handle)), true) - { - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - internal Slider Assign(Slider handle) - { - Slider ret = new Slider(NDalicPINVOKE.Slider_Assign(swigCPtr, Slider.getCPtr(handle)), false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - /// - /// Downcasts an object handle to the slider.
- /// If the handle points to a slider, then the downcast produces a valid handle.
- /// If not, then the returned handle is left uninitialized.
- ///
- /// The handle to an object. - /// The handle to a slider or an uninitialized handle. - /// 3 - public static Slider DownCast(BaseHandle handle) - { - Slider ret = Registry.GetManagedBaseHandleFromNativePtr(handle) as Slider; - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - internal SliderValueChangedSignal ValueChangedSignal() - { - SliderValueChangedSignal ret = new SliderValueChangedSignal(NDalicPINVOKE.Slider_ValueChangedSignal(swigCPtr), false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - internal SliderValueChangedSignal SlidingFinishedSignal() - { - SliderValueChangedSignal ret = new SliderValueChangedSignal(NDalicPINVOKE.Slider_SlidingFinishedSignal(swigCPtr), false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - internal SliderMarkReachedSignal MarkReachedSignal() - { - SliderMarkReachedSignal ret = new SliderMarkReachedSignal(NDalicPINVOKE.Slider_MarkReachedSignal(swigCPtr), false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - /// - /// The lower bound property. - /// - /// 3 - public float LowerBound - { - get - { - return (float)GetValue(LowerBoundProperty); - } - set - { - SetValue(LowerBoundProperty, value); + return (float)GetValue(LowerBoundProperty); + } + set + { + SetValue(LowerBoundProperty, value); } } @@ -1052,6 +634,333 @@ namespace Tizen.NUI.UIComponents } } - } + internal override bool IsCreateByXaml + { + get + { + return base.IsCreateByXaml; + } + set + { + base.IsCreateByXaml = value; + if (value == true) + { + this.ValueChanged += (obj, e) => { + this.Value = e.SlideValue; + return true; + }; + } + } + } + + /// + /// Downcasts an object handle to the slider.
+ /// If the handle points to a slider, then the downcast produces a valid handle.
+ /// If not, then the returned handle is left uninitialized.
+ ///
+ /// The handle to an object. + /// The handle to a slider or an uninitialized handle. + /// 3 + public static Slider DownCast(BaseHandle handle) + { + Slider ret = Registry.GetManagedBaseHandleFromNativePtr(handle) as Slider; + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Slider obj) + { + return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; + } + + /// + /// Gets the slider from the pointer. + /// + /// The pointer of the slider. + /// The object of the slider type. + internal static Slider GetSliderFromPtr(global::System.IntPtr cPtr) + { + Slider ret = new Slider(cPtr, false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + internal Slider Assign(Slider handle) + { + Slider ret = new Slider(NDalicPINVOKE.Slider_Assign(swigCPtr, Slider.getCPtr(handle)), false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + internal SliderValueChangedSignal ValueChangedSignal() + { + SliderValueChangedSignal ret = new SliderValueChangedSignal(NDalicPINVOKE.Slider_ValueChangedSignal(swigCPtr), false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + internal SliderValueChangedSignal SlidingFinishedSignal() + { + SliderValueChangedSignal ret = new SliderValueChangedSignal(NDalicPINVOKE.Slider_SlidingFinishedSignal(swigCPtr), false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + internal SliderMarkReachedSignal MarkReachedSignal() + { + SliderMarkReachedSignal ret = new SliderMarkReachedSignal(NDalicPINVOKE.Slider_MarkReachedSignal(swigCPtr), false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + /// + /// Dispose. + /// + /// 3 + protected override void Dispose(DisposeTypes type) + { + if (disposed) + { + return; + } + + if (type == DisposeTypes.Explicit) + { + //Called by User + //Release your own managed resources here. + //You should release all of your own disposable objects here. + + } + + //Release your own unmanaged resources here. + //You should not access any managed member here except static instance. + //because the execution order of Finalizes is non-deterministic. + if (this != null) + { + if (_sliderValueChangedCallbackDelegate != null) + { + ValueChangedSignal().Disconnect(_sliderValueChangedCallbackDelegate); + } + + if (_sliderSlidingFinishedCallbackDelegate != null) + { + SlidingFinishedSignal().Disconnect(_sliderSlidingFinishedCallbackDelegate); + } + + if (_sliderMarkReachedCallbackDelegate != null) + { + MarkReachedSignal().Disconnect(_sliderMarkReachedCallbackDelegate); + } + } + + if (swigCPtr.Handle != global::System.IntPtr.Zero) + { + if (swigCMemOwn) + { + swigCMemOwn = false; + NDalicPINVOKE.delete_Slider(swigCPtr); + } + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); + } + + base.Dispose(type); + } + + // Callback for Slider ValueChanged signal + private bool OnValueChanged(IntPtr slider, float slideValue) + { + ValueChangedEventArgs e = new ValueChangedEventArgs(); + + // Populate all members of "e" (ValueChangedEventArgs) with real page + e.Slider = Slider.GetSliderFromPtr(slider); + e.SlideValue = slideValue; + + if (_sliderValueChangedEventHandler != null) + { + //here we send all page to user event handlers + return _sliderValueChangedEventHandler(this, e); + } + return false; + } + + // Callback for Slider SlidingFinished signal + private bool OnSlidingFinished(IntPtr slider, float slideValue) + { + SlidingFinishedEventArgs e = new SlidingFinishedEventArgs(); + + // Populate all members of "e" (SlidingFinishedEventArgs) with real page + e.Slider = Slider.GetSliderFromPtr(slider); + e.SlideValue = slideValue; + + if (_sliderSlidingFinishedEventHandler != null) + { + //here we send all page to user event handlers + return _sliderSlidingFinishedEventHandler(this, e); + } + return false; + } + + // Callback for Slider MarkReached signal + private bool OnMarkReached(IntPtr slider, int slideValue) + { + MarkReachedEventArgs e = new MarkReachedEventArgs(); + + // Populate all members of "e" (MarkReachedEventArgs) with real page + e.Slider = Slider.GetSliderFromPtr(slider); + e.SlideValue = slideValue; + + if (_sliderMarkReachedEventHandler != null) + { + //here we send all page to user event handlers + return _sliderMarkReachedEventHandler(this, e); + } + return false; + } + + /// + /// The ValueChanged event arguments. + /// + /// 3 + public class ValueChangedEventArgs : EventArgs + { + private Slider _slider; + private float _slideValue; + + /// + /// The slider. + /// + /// 3 + public Slider Slider + { + get + { + return _slider; + } + set + { + _slider = value; + } + } + + /// + /// The slider value. + /// + /// 3 + public float SlideValue + { + get + { + return _slideValue; + } + set + { + _slideValue = value; + } + } + } + + /// + /// The SlidingFinished event arguments. + /// + /// 3 + public class SlidingFinishedEventArgs : EventArgs + { + private Slider _slider; + private float _slideValue; + + /// + /// The slider. + /// + /// 3 + public Slider Slider + { + get + { + return _slider; + } + set + { + _slider = value; + } + } + + /// + /// The slider value. + /// + /// 3 + public float SlideValue + { + get + { + return _slideValue; + } + set + { + _slideValue = value; + } + } + } + + /// + /// The MarkReached event arguments. + /// + /// 3 + public class MarkReachedEventArgs : EventArgs + { + private Slider _slider; + private int _slideValue; + + /// + /// The slider. + /// + /// 3 + public Slider Slider + { + get + { + return _slider; + } + set + { + _slider = value; + } + } + + /// + /// The slider value. + /// + /// 3 + public int SlideValue + { + get + { + return _slideValue; + } + set + { + _slideValue = value; + } + } + } + + internal new class Property + { + internal static readonly int LOWER_BOUND = NDalicPINVOKE.Slider_Property_LOWER_BOUND_get(); + internal static readonly int UPPER_BOUND = NDalicPINVOKE.Slider_Property_UPPER_BOUND_get(); + internal static readonly int VALUE = NDalicPINVOKE.Slider_Property_VALUE_get(); + internal static readonly int TRACK_VISUAL = NDalicPINVOKE.Slider_Property_TRACK_VISUAL_get(); + internal static readonly int HANDLE_VISUAL = NDalicPINVOKE.Slider_Property_HANDLE_VISUAL_get(); + internal static readonly int PROGRESS_VISUAL = NDalicPINVOKE.Slider_Property_PROGRESS_VISUAL_get(); + internal static readonly int POPUP_VISUAL = NDalicPINVOKE.Slider_Property_POPUP_VISUAL_get(); + internal static readonly int POPUP_ARROW_VISUAL = NDalicPINVOKE.Slider_Property_POPUP_ARROW_VISUAL_get(); + internal static readonly int DISABLED_COLOR = NDalicPINVOKE.Slider_Property_DISABLED_COLOR_get(); + internal static readonly int VALUE_PRECISION = NDalicPINVOKE.Slider_Property_VALUE_PRECISION_get(); + internal static readonly int SHOW_POPUP = NDalicPINVOKE.Slider_Property_SHOW_POPUP_get(); + internal static readonly int SHOW_VALUE = NDalicPINVOKE.Slider_Property_SHOW_VALUE_get(); + internal static readonly int MARKS = NDalicPINVOKE.Slider_Property_MARKS_get(); + internal static readonly int SNAP_TO_MARKS = NDalicPINVOKE.Slider_Property_SNAP_TO_MARKS_get(); + internal static readonly int MARK_TOLERANCE = NDalicPINVOKE.Slider_Property_MARK_TOLERANCE_get(); + } + } } diff --git a/src/Tizen.NUI/src/public/UIComponents/ToggleButton.cs b/src/Tizen.NUI/src/public/UIComponents/ToggleButton.cs index 29b5f82..83cd4c5 100755 --- a/src/Tizen.NUI/src/public/UIComponents/ToggleButton.cs +++ b/src/Tizen.NUI/src/public/UIComponents/ToggleButton.cs @@ -19,7 +19,6 @@ using Tizen.NUI.Binding; namespace Tizen.NUI { - /// /// A ToggleButton allows the user to change a setting between two or more states. /// @@ -36,7 +35,7 @@ namespace Tizen.NUI Tizen.NUI.Object.SetProperty(toggleButton.swigCPtr, ToggleButton.Property.STATE_VISUALS, new Tizen.NUI.PropertyValue((PropertyArray)newValue)); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var toggleButton = (ToggleButton)bindable; Tizen.NUI.PropertyArray temp = new Tizen.NUI.PropertyArray(); @@ -53,7 +52,7 @@ namespace Tizen.NUI Tizen.NUI.Object.SetProperty(toggleButton.swigCPtr, ToggleButton.Property.TOOLTIPS, new Tizen.NUI.PropertyValue((PropertyArray)newValue)); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var toggleButton = (ToggleButton)bindable; Tizen.NUI.PropertyArray temp = new Tizen.NUI.PropertyArray(); @@ -70,7 +69,7 @@ namespace Tizen.NUI Tizen.NUI.Object.SetProperty(toggleButton.swigCPtr, ToggleButton.Property.CURRENT_STATE_INDEX, new Tizen.NUI.PropertyValue((int)newValue)); } }, - defaultValueCreator:(bindable) => + defaultValueCreator: (bindable) => { var toggleButton = (ToggleButton)bindable; int temp = 0; @@ -80,11 +79,68 @@ namespace Tizen.NUI private global::System.Runtime.InteropServices.HandleRef swigCPtr; + /// + /// Create an instance for toggleButton. + /// + /// 3 + public ToggleButton() : this(NDalicPINVOKE.ToggleButton_New(), true) + { + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + internal ToggleButton(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.ToggleButton_SWIGUpcast(cPtr), cMemoryOwn) { swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); } + /// + /// Gets and Sets the state visual array of toggle button. + /// + /// 3 + public Tizen.NUI.PropertyArray StateVisuals + { + get + { + return (PropertyArray)GetValue(StateVisualsProperty); + } + set + { + SetValue(StateVisualsProperty, value); + } + } + + /// + /// Gets and Sets the tooltips of toggle button. + /// + /// 3 + public Tizen.NUI.PropertyArray Tooltips + { + get + { + return (PropertyArray)GetValue(TooltipsProperty); + } + set + { + SetValue(TooltipsProperty, value); + } + } + + /// + /// Gets and Sets the current state index of toggle button. + /// + /// 3 + public int CurrentStateIndex + { + get + { + return (int)GetValue(CurrentStateIndexProperty); + } + set + { + SetValue(CurrentStateIndexProperty, value); + } + } + internal static global::System.Runtime.InteropServices.HandleRef getCPtr(ToggleButton obj) { return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; @@ -149,65 +205,5 @@ namespace Tizen.NUI /// 3 public static readonly int CURRENT_STATE_INDEX = NDalicPINVOKE.ToggleButton_Property_CURRENT_STATE_INDEX_get(); } - - /// - /// Create an instance for toggleButton. - /// - /// 3 - public ToggleButton() : this(NDalicPINVOKE.ToggleButton_New(), true) - { - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - - } - - /// - /// Gets and Sets the state visual array of toggle button. - /// - /// 3 - public Tizen.NUI.PropertyArray StateVisuals - { - get - { - return (PropertyArray)GetValue(StateVisualsProperty); - } - set - { - SetValue(StateVisualsProperty, value); - } - } - - /// - /// Gets and Sets the tooltips of toggle button. - /// - /// 3 - public Tizen.NUI.PropertyArray Tooltips - { - get - { - return (PropertyArray)GetValue(TooltipsProperty); - } - set - { - SetValue(TooltipsProperty, value); - } - } - - /// - /// Gets and Sets the current state index of toggle button. - /// - /// 3 - public int CurrentStateIndex - { - get - { - return (int)GetValue(CurrentStateIndexProperty); - } - set - { - SetValue(CurrentStateIndexProperty, value); - } - } - } - } diff --git a/src/Tizen.NUI/src/public/Vector2.cs b/src/Tizen.NUI/src/public/Vector2.cs index a58fb03..6e7aef1 100755 --- a/src/Tizen.NUI/src/public/Vector2.cs +++ b/src/Tizen.NUI/src/public/Vector2.cs @@ -27,207 +27,20 @@ namespace Tizen.NUI [TypeConverter(typeof(Vector2TypeConverter))] public class Vector2 : global::System.IDisposable { - private global::System.Runtime.InteropServices.HandleRef swigCPtr; /// /// swigCMemOwn. /// /// 3 protected bool swigCMemOwn; - internal Vector2(global::System.IntPtr cPtr, bool cMemoryOwn) - { - swigCMemOwn = cMemoryOwn; - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); - } - - internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Vector2 obj) - { - return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; - } - - //A Flag to check who called Dispose(). (By User or DisposeQueue) - private bool isDisposeQueued = false; - /// /// A Flat to check if it is already disposed. /// /// 3 protected bool disposed = false; - - /// - /// Destructor. - /// - /// 3 - ~Vector2() - { - if(!isDisposeQueued) - { - isDisposeQueued = true; - DisposeQueue.Instance.Add(this); - } - } - - /// - /// Dispose. - /// - /// 3 - public void Dispose() - { - //Throw excpetion if Dispose() is called in separate thread. - if (!Window.IsInstalled()) - { - throw new System.InvalidOperationException("This API called from separate thread. This API must be called from MainThread."); - } - - if (isDisposeQueued) - { - Dispose(DisposeTypes.Implicit); - } - else - { - Dispose(DisposeTypes.Explicit); - System.GC.SuppressFinalize(this); - } - } - - /// - /// Dispose. - /// - /// The dispose type - /// 3 - protected virtual void Dispose(DisposeTypes type) - { - if (disposed) - { - return; - } - - if(type == DisposeTypes.Explicit) - { - //Called by User - //Release your own managed resources here. - //You should release all of your own disposable objects here. - } - - //Release your own unmanaged resources here. - //You should not access any managed member here except static instance. - //because the execution order of Finalizes is non-deterministic. - - if (swigCPtr.Handle != global::System.IntPtr.Zero) - { - if (swigCMemOwn) - { - swigCMemOwn = false; - NDalicPINVOKE.delete_Vector2(swigCPtr); - } - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); - } - disposed = true; - } - - /// - /// The addition operator. - /// - /// The first value. - /// The second value. - /// The vector containing the result of the addition. - /// 3 - public static Vector2 operator +(Vector2 arg1, Vector2 arg2) - { - return arg1.Add(arg2); - } - - /// - /// The subtraction operator. - /// - /// The first value. - /// The second value. - /// The vector containing the result of the subtraction. - /// 3 - public static Vector2 operator -(Vector2 arg1, Vector2 arg2) - { - return arg1.Subtract(arg2); - } - - /// - /// The unary negation operator. - /// - /// The target value. - /// The vector containing the negation. - /// 3 - public static Vector2 operator -(Vector2 arg1) - { - return arg1.Subtract(); - } - - /// - /// The multiplication operator. - /// - /// The first value. - /// The second value. - /// The vector containing the result of the multiplication. - /// 3 - public static Vector2 operator *(Vector2 arg1, Vector2 arg2) - { - return arg1.Multiply(arg2); - } - - /// - /// Th multiplication operator. - /// - /// The first value. - /// The float value to scale the vector. - /// The vector containing the result of the scaling. - /// 3 - public static Vector2 operator *(Vector2 arg1, float arg2) - { - return arg1.Multiply(arg2); - } - - /// - /// The division operator. - /// - /// The first value. - /// The second value. - /// The vector containing the result of the division. - /// 3 - public static Vector2 operator /(Vector2 arg1, Vector2 arg2) - { - return arg1.Divide(arg2); - } - - /// - /// Th division operator. - /// - /// The first value. - /// The float value to scale the vector by. - /// The vector containing the result of the scaling. - /// 3 - public static Vector2 operator /(Vector2 arg1, float arg2) - { - return arg1.Divide(arg2); - } - - /// - /// The array subscript operator overload. - /// - /// The subscript index. - /// The float at the given index. - /// 3 - public float this[uint index] - { - get - { - return ValueOfIndex(index); - } - } - - internal static Vector2 GetVector2FromPtr(global::System.IntPtr cPtr) - { - Vector2 ret = new Vector2(cPtr, false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } + private global::System.Runtime.InteropServices.HandleRef swigCPtr; + //A Flag to check who called Dispose(). (By User or DisposeQueue) + private bool isDisposeQueued = false; /// /// The default constructor initializes the vector to 0. @@ -279,6 +92,25 @@ namespace Tizen.NUI if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } + internal Vector2(global::System.IntPtr cPtr, bool cMemoryOwn) + { + swigCMemOwn = cMemoryOwn; + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); + } + + /// + /// Destructor. + /// + /// 3 + ~Vector2() + { + if(!isDisposeQueued) + { + isDisposeQueued = true; + DisposeQueue.Instance.Add(this); + } + } + /// /// (1.0f,1.0f). /// @@ -369,116 +201,177 @@ namespace Tizen.NUI } } - private Vector2 Add(Vector2 rhs) + /// + /// The x component. + /// + /// 3 + public float X { - Vector2 ret = new Vector2(NDalicPINVOKE.Vector2_Add(swigCPtr, Vector2.getCPtr(rhs)), true); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; + set + { + NDalicPINVOKE.Vector2_X_set(swigCPtr, value); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + get + { + float ret = NDalicPINVOKE.Vector2_X_get(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } } - private Vector2 AddAssign(Vector2 rhs) + /// + /// The width. + /// + /// 3 + public float Width { - Vector2 ret = new Vector2(NDalicPINVOKE.Vector2_AddAssign(swigCPtr, Vector2.getCPtr(rhs)), false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; + set + { + NDalicPINVOKE.Vector2_Width_set(swigCPtr, value); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + get + { + float ret = NDalicPINVOKE.Vector2_Width_get(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } } - private Vector2 Subtract(Vector2 rhs) - { - Vector2 ret = new Vector2(NDalicPINVOKE.Vector2_Subtract__SWIG_0(swigCPtr, Vector2.getCPtr(rhs)), true); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - private Vector2 SubtractAssign(Vector2 rhs) - { - Vector2 ret = new Vector2(NDalicPINVOKE.Vector2_SubtractAssign(swigCPtr, Vector2.getCPtr(rhs)), false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - private Vector2 Multiply(Vector2 rhs) - { - Vector2 ret = new Vector2(NDalicPINVOKE.Vector2_Multiply__SWIG_0(swigCPtr, Vector2.getCPtr(rhs)), true); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - private Vector2 Multiply(float rhs) - { - Vector2 ret = new Vector2(NDalicPINVOKE.Vector2_Multiply__SWIG_1(swigCPtr, rhs), true); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - private Vector2 MultiplyAssign(Vector2 rhs) + /// + /// The y component. + /// + /// 3 + public float Y { - Vector2 ret = new Vector2(NDalicPINVOKE.Vector2_MultiplyAssign__SWIG_0(swigCPtr, Vector2.getCPtr(rhs)), false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; + set + { + NDalicPINVOKE.Vector2_Y_set(swigCPtr, value); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + get + { + float ret = NDalicPINVOKE.Vector2_Y_get(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } } - private Vector2 MultiplyAssign(float rhs) + /// + /// The height. + /// + /// 3 + public float Height { - Vector2 ret = new Vector2(NDalicPINVOKE.Vector2_MultiplyAssign__SWIG_1(swigCPtr, rhs), false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; + set + { + NDalicPINVOKE.Vector2_Height_set(swigCPtr, value); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + get + { + float ret = NDalicPINVOKE.Vector2_Height_get(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } } - private Vector2 Divide(Vector2 rhs) + /// + /// The array subscript operator overload. + /// + /// The subscript index. + /// The float at the given index. + /// 3 + public float this[uint index] { - Vector2 ret = new Vector2(NDalicPINVOKE.Vector2_Divide__SWIG_0(swigCPtr, Vector2.getCPtr(rhs)), true); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; + get + { + return ValueOfIndex(index); + } } - private Vector2 Divide(float rhs) + /// + /// The addition operator. + /// + /// The first value. + /// The second value. + /// The vector containing the result of the addition. + /// 3 + public static Vector2 operator +(Vector2 arg1, Vector2 arg2) { - Vector2 ret = new Vector2(NDalicPINVOKE.Vector2_Divide__SWIG_1(swigCPtr, rhs), true); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; + return arg1.Add(arg2); } - private Vector2 DivideAssign(Vector2 rhs) + /// + /// The subtraction operator. + /// + /// The first value. + /// The second value. + /// The vector containing the result of the subtraction. + /// 3 + public static Vector2 operator -(Vector2 arg1, Vector2 arg2) { - Vector2 ret = new Vector2(NDalicPINVOKE.Vector2_DivideAssign__SWIG_0(swigCPtr, Vector2.getCPtr(rhs)), false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; + return arg1.Subtract(arg2); } - private Vector2 DivideAssign(float rhs) + /// + /// The unary negation operator. + /// + /// The target value. + /// The vector containing the negation. + /// 3 + public static Vector2 operator -(Vector2 arg1) { - Vector2 ret = new Vector2(NDalicPINVOKE.Vector2_DivideAssign__SWIG_1(swigCPtr, rhs), false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; + return arg1.Subtract(); } - private Vector2 Subtract() + /// + /// The multiplication operator. + /// + /// The first value. + /// The second value. + /// The vector containing the result of the multiplication. + /// 3 + public static Vector2 operator *(Vector2 arg1, Vector2 arg2) { - Vector2 ret = new Vector2(NDalicPINVOKE.Vector2_Subtract__SWIG_1(swigCPtr), true); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; + return arg1.Multiply(arg2); } - private bool EqualTo(Vector2 rhs) + /// + /// Th multiplication operator. + /// + /// The first value. + /// The float value to scale the vector. + /// The vector containing the result of the scaling. + /// 3 + public static Vector2 operator *(Vector2 arg1, float arg2) { - bool ret = NDalicPINVOKE.Vector2_EqualTo(swigCPtr, Vector2.getCPtr(rhs)); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; + return arg1.Multiply(arg2); } - private bool NotEqualTo(Vector2 rhs) + /// + /// The division operator. + /// + /// The first value. + /// The second value. + /// The vector containing the result of the division. + /// 3 + public static Vector2 operator /(Vector2 arg1, Vector2 arg2) { - bool ret = NDalicPINVOKE.Vector2_NotEqualTo(swigCPtr, Vector2.getCPtr(rhs)); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; + return arg1.Divide(arg2); } - private float ValueOfIndex(uint index) + /// + /// Th division operator. + /// + /// The first value. + /// The float value to scale the vector by. + /// The vector containing the result of the scaling. + /// 3 + public static Vector2 operator /(Vector2 arg1, float arg2) { - float ret = NDalicPINVOKE.Vector2_ValueOfIndex__SWIG_0(swigCPtr, index); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; + return arg1.Divide(arg2); } /// @@ -555,6 +448,41 @@ namespace Tizen.NUI if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } + /// + /// Dispose. + /// + /// 3 + public void Dispose() + { + //Throw excpetion if Dispose() is called in separate thread. + if (!Window.IsInstalled()) + { + throw new System.InvalidOperationException("This API called from separate thread. This API must be called from MainThread."); + } + + if (isDisposeQueued) + { + Dispose(DisposeTypes.Implicit); + } + else + { + Dispose(DisposeTypes.Explicit); + System.GC.SuppressFinalize(this); + } + } + + internal static Vector2 GetVector2FromPtr(global::System.IntPtr cPtr) + { + Vector2 ret = new Vector2(cPtr, false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Vector2 obj) + { + return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; + } + internal SWIGTYPE_p_float AsFloat() { global::System.IntPtr cPtr = NDalicPINVOKE.Vector2_AsFloat__SWIG_0(swigCPtr); @@ -564,79 +492,150 @@ namespace Tizen.NUI } /// - /// The x component. + /// Dispose. /// + /// The dispose type /// 3 - public float X + protected virtual void Dispose(DisposeTypes type) { - set - { - NDalicPINVOKE.Vector2_X_set(swigCPtr, value); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - get + if (disposed) { - float ret = NDalicPINVOKE.Vector2_X_get(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; + return; } - } - /// - /// The width. - /// - /// 3 - public float Width - { - set + if (type == DisposeTypes.Explicit) { - NDalicPINVOKE.Vector2_Width_set(swigCPtr, value); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + //Called by User + //Release your own managed resources here. + //You should release all of your own disposable objects here. } - get + + //Release your own unmanaged resources here. + //You should not access any managed member here except static instance. + //because the execution order of Finalizes is non-deterministic. + + if (swigCPtr.Handle != global::System.IntPtr.Zero) { - float ret = NDalicPINVOKE.Vector2_Width_get(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; + if (swigCMemOwn) + { + swigCMemOwn = false; + NDalicPINVOKE.delete_Vector2(swigCPtr); + } + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); } + disposed = true; } - /// - /// The y component. - /// - /// 3 - public float Y + private Vector2 Add(Vector2 rhs) { - set - { - NDalicPINVOKE.Vector2_Y_set(swigCPtr, value); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - get - { - float ret = NDalicPINVOKE.Vector2_Y_get(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } + Vector2 ret = new Vector2(NDalicPINVOKE.Vector2_Add(swigCPtr, Vector2.getCPtr(rhs)), true); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; } - /// - /// The height. - /// - /// 3 - public float Height + private Vector2 AddAssign(Vector2 rhs) { - set - { - NDalicPINVOKE.Vector2_Height_set(swigCPtr, value); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - get - { - float ret = NDalicPINVOKE.Vector2_Height_get(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } + Vector2 ret = new Vector2(NDalicPINVOKE.Vector2_AddAssign(swigCPtr, Vector2.getCPtr(rhs)), false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + private Vector2 Subtract(Vector2 rhs) + { + Vector2 ret = new Vector2(NDalicPINVOKE.Vector2_Subtract__SWIG_0(swigCPtr, Vector2.getCPtr(rhs)), true); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + private Vector2 SubtractAssign(Vector2 rhs) + { + Vector2 ret = new Vector2(NDalicPINVOKE.Vector2_SubtractAssign(swigCPtr, Vector2.getCPtr(rhs)), false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + private Vector2 Multiply(Vector2 rhs) + { + Vector2 ret = new Vector2(NDalicPINVOKE.Vector2_Multiply__SWIG_0(swigCPtr, Vector2.getCPtr(rhs)), true); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + private Vector2 Multiply(float rhs) + { + Vector2 ret = new Vector2(NDalicPINVOKE.Vector2_Multiply__SWIG_1(swigCPtr, rhs), true); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + private Vector2 MultiplyAssign(Vector2 rhs) + { + Vector2 ret = new Vector2(NDalicPINVOKE.Vector2_MultiplyAssign__SWIG_0(swigCPtr, Vector2.getCPtr(rhs)), false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + private Vector2 MultiplyAssign(float rhs) + { + Vector2 ret = new Vector2(NDalicPINVOKE.Vector2_MultiplyAssign__SWIG_1(swigCPtr, rhs), false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + private Vector2 Divide(Vector2 rhs) + { + Vector2 ret = new Vector2(NDalicPINVOKE.Vector2_Divide__SWIG_0(swigCPtr, Vector2.getCPtr(rhs)), true); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + private Vector2 Divide(float rhs) + { + Vector2 ret = new Vector2(NDalicPINVOKE.Vector2_Divide__SWIG_1(swigCPtr, rhs), true); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + private Vector2 DivideAssign(Vector2 rhs) + { + Vector2 ret = new Vector2(NDalicPINVOKE.Vector2_DivideAssign__SWIG_0(swigCPtr, Vector2.getCPtr(rhs)), false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + private Vector2 DivideAssign(float rhs) + { + Vector2 ret = new Vector2(NDalicPINVOKE.Vector2_DivideAssign__SWIG_1(swigCPtr, rhs), false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + private Vector2 Subtract() + { + Vector2 ret = new Vector2(NDalicPINVOKE.Vector2_Subtract__SWIG_1(swigCPtr), true); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + private bool EqualTo(Vector2 rhs) + { + bool ret = NDalicPINVOKE.Vector2_EqualTo(swigCPtr, Vector2.getCPtr(rhs)); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + private bool NotEqualTo(Vector2 rhs) + { + bool ret = NDalicPINVOKE.Vector2_NotEqualTo(swigCPtr, Vector2.getCPtr(rhs)); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + private float ValueOfIndex(uint index) + { + float ret = NDalicPINVOKE.Vector2_ValueOfIndex__SWIG_0(swigCPtr, index); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; } } diff --git a/src/Tizen.NUI/src/public/Vector3.cs b/src/Tizen.NUI/src/public/Vector3.cs index 614b657..a18f0c1 100755 --- a/src/Tizen.NUI/src/public/Vector3.cs +++ b/src/Tizen.NUI/src/public/Vector3.cs @@ -27,207 +27,19 @@ namespace Tizen.NUI [TypeConverter(typeof(Vector3TypeConverter))] public class Vector3 : global::System.IDisposable { - private global::System.Runtime.InteropServices.HandleRef swigCPtr; /// /// swigCMemOwn. /// /// 3 protected bool swigCMemOwn; - - internal Vector3(global::System.IntPtr cPtr, bool cMemoryOwn) - { - swigCMemOwn = cMemoryOwn; - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); - } - - internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Vector3 obj) - { - return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; - } - - //A Flag to check who called Dispose(). (By User or DisposeQueue) - private bool isDisposeQueued = false; - /// /// A Flat to check if it is already disposed. /// /// 3 protected bool disposed = false; - - /// - /// Destructor. - /// - /// 3 - ~Vector3() - { - if(!isDisposeQueued) - { - isDisposeQueued = true; - DisposeQueue.Instance.Add(this); - } - } - - /// - /// Dispose. - /// - /// 3 - public void Dispose() - { - //Throw excpetion if Dispose() is called in separate thread. - if (!Window.IsInstalled()) - { - throw new System.InvalidOperationException("This API called from separate thread. This API must be called from MainThread."); - } - - if (isDisposeQueued) - { - Dispose(DisposeTypes.Implicit); - } - else - { - Dispose(DisposeTypes.Explicit); - System.GC.SuppressFinalize(this); - } - } - - /// - /// Dispose. - /// - /// The dispose type - /// 3 - protected virtual void Dispose(DisposeTypes type) - { - if (disposed) - { - return; - } - - if(type == DisposeTypes.Explicit) - { - //Called by User - //Release your own managed resources here. - //You should release all of your own disposable objects here. - } - - //Release your own unmanaged resources here. - //You should not access any managed member here except static instance. - //because the execution order of Finalizes is non-deterministic. - - if (swigCPtr.Handle != global::System.IntPtr.Zero) - { - if (swigCMemOwn) - { - swigCMemOwn = false; - NDalicPINVOKE.delete_Vector3(swigCPtr); - } - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); - } - disposed = true; - } - - /// - /// The addition operator. - /// - /// The first value. - /// The second value. - /// The vector containing the result of the addition. - /// 3 - public static Vector3 operator +(Vector3 arg1, Vector3 arg2) - { - return arg1.Add(arg2); - } - - /// - /// The subtraction operator. - /// - /// The first value. - /// The second value. - /// The vector containing the result of the subtraction. - /// 3 - public static Vector3 operator -(Vector3 arg1, Vector3 arg2) - { - return arg1.Subtract(arg2); - } - - /// - /// The unary negation operator. - /// - /// The target value. - /// The vector containg the negation. - /// 3 - public static Vector3 operator -(Vector3 arg1) - { - return arg1.Subtract(); - } - - /// - /// The multiplication operator. - /// - /// The first value. - /// The second value. - /// The vector containing the result of the multiplication. - /// 3 - public static Vector3 operator *(Vector3 arg1, Vector3 arg2) - { - return arg1.Multiply(arg2); - } - - /// - /// The multiplication operator. - /// - /// The first value. - /// The float value to scale the vector. - /// The vector containing the result of the scaling. - /// 3 - public static Vector3 operator *(Vector3 arg1, float arg2) - { - return arg1.Multiply(arg2); - } - - /// - /// The division operator. - /// - /// The first value. - /// The second value. - /// The vector containing the result of the division. - /// 3 - public static Vector3 operator /(Vector3 arg1, Vector3 arg2) - { - return arg1.Divide(arg2); - } - - /// - /// The division operator. - /// - /// The first value. - /// The float value to scale the vector by. - /// The vector containing the result of the scaling. - /// 3 - public static Vector3 operator /(Vector3 arg1, float arg2) - { - return arg1.Divide(arg2); - } - - /// - /// An array subscript operator overload. - /// - /// The subscript index. - /// The float at the given index. - /// 3 - public float this[uint index] - { - get - { - return ValueOfIndex(index); - } - } - - internal static Vector3 GetVector3FromPtr(global::System.IntPtr cPtr) - { - Vector3 ret = new Vector3(cPtr, false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } + private global::System.Runtime.InteropServices.HandleRef swigCPtr; + //A Flag to check who called Dispose(). (By User or DisposeQueue) + private bool isDisposeQueued = false; /// /// The constructor. @@ -280,6 +92,25 @@ namespace Tizen.NUI if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } + internal Vector3(global::System.IntPtr cPtr, bool cMemoryOwn) + { + swigCMemOwn = cMemoryOwn; + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); + } + + /// + /// Destructor. + /// + /// 3 + ~Vector3() + { + if(!isDisposeQueued) + { + isDisposeQueued = true; + DisposeQueue.Instance.Add(this); + } + } + /// /// (1.0f,1.0f,1.0f). /// @@ -400,137 +231,272 @@ namespace Tizen.NUI } } - private Vector3 Add(Vector3 rhs) + /// + /// The x component. + /// + /// 3 + public float X { - Vector3 ret = new Vector3(NDalicPINVOKE.Vector3_Add(swigCPtr, Vector3.getCPtr(rhs)), true); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; + set + { + NDalicPINVOKE.Vector3_X_set(swigCPtr, value); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + get + { + float ret = NDalicPINVOKE.Vector3_X_get(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } } - private Vector3 AddAssign(Vector3 rhs) + /// + /// The width component. + /// + /// 3 + public float Width { - Vector3 ret = new Vector3(NDalicPINVOKE.Vector3_AddAssign(swigCPtr, Vector3.getCPtr(rhs)), false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; + set + { + NDalicPINVOKE.Vector3_Width_set(swigCPtr, value); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + get + { + float ret = NDalicPINVOKE.Vector3_Width_get(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } } - private Vector3 Subtract(Vector3 rhs) - { - Vector3 ret = new Vector3(NDalicPINVOKE.Vector3_Subtract__SWIG_0(swigCPtr, Vector3.getCPtr(rhs)), true); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - private Vector3 SubtractAssign(Vector3 rhs) - { - Vector3 ret = new Vector3(NDalicPINVOKE.Vector3_SubtractAssign(swigCPtr, Vector3.getCPtr(rhs)), false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - private Vector3 Multiply(Vector3 rhs) + /// + /// The red component. + /// + /// 3 + public float R { - Vector3 ret = new Vector3(NDalicPINVOKE.Vector3_Multiply__SWIG_0(swigCPtr, Vector3.getCPtr(rhs)), true); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; + set + { + NDalicPINVOKE.Vector3_r_set(swigCPtr, value); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + get + { + float ret = NDalicPINVOKE.Vector3_r_get(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } } - private Vector3 Multiply(float rhs) + /// + /// The y component. + /// + /// 3 + public float Y { - Vector3 ret = new Vector3(NDalicPINVOKE.Vector3_Multiply__SWIG_1(swigCPtr, rhs), true); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; + set + { + NDalicPINVOKE.Vector3_Y_set(swigCPtr, value); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + get + { + float ret = NDalicPINVOKE.Vector3_Y_get(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } } - private Vector3 MultiplyAssign(Vector3 rhs) + /// + /// The height component. + /// + /// 3 + public float Height { - Vector3 ret = new Vector3(NDalicPINVOKE.Vector3_MultiplyAssign__SWIG_0(swigCPtr, Vector3.getCPtr(rhs)), false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; + set + { + NDalicPINVOKE.Vector3_Height_set(swigCPtr, value); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + get + { + float ret = NDalicPINVOKE.Vector3_Height_get(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } } - private Vector3 MultiplyAssign(float rhs) + /// + /// The green component. + /// + /// 3 + public float G { - Vector3 ret = new Vector3(NDalicPINVOKE.Vector3_MultiplyAssign__SWIG_1(swigCPtr, rhs), false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; + set + { + NDalicPINVOKE.Vector3_g_set(swigCPtr, value); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + get + { + float ret = NDalicPINVOKE.Vector3_g_get(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } } - private Vector3 MultiplyAssign(Rotation rhs) + /// + /// The z component. + /// + /// 3 + public float Z { - Vector3 ret = new Vector3(NDalicPINVOKE.Vector3_MultiplyAssign__SWIG_2(swigCPtr, Rotation.getCPtr(rhs)), false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; + set + { + NDalicPINVOKE.Vector3_Z_set(swigCPtr, value); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + get + { + float ret = NDalicPINVOKE.Vector3_Z_get(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } } - private Vector3 Divide(Vector3 rhs) + /// + /// The depth component. + /// + /// 3 + public float Depth { - Vector3 ret = new Vector3(NDalicPINVOKE.Vector3_Divide__SWIG_0(swigCPtr, Vector3.getCPtr(rhs)), true); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; + set + { + NDalicPINVOKE.Vector3_Depth_set(swigCPtr, value); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + get + { + float ret = NDalicPINVOKE.Vector3_Depth_get(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } } - private Vector3 Divide(float rhs) + /// + /// The blue component. + /// + /// 3 + public float B { - Vector3 ret = new Vector3(NDalicPINVOKE.Vector3_Divide__SWIG_1(swigCPtr, rhs), true); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; + set + { + NDalicPINVOKE.Vector3_b_set(swigCPtr, value); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + get + { + float ret = NDalicPINVOKE.Vector3_b_get(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } } - private Vector3 DivideAssign(Vector3 rhs) + /// + /// An array subscript operator overload. + /// + /// The subscript index. + /// The float at the given index. + /// 3 + public float this[uint index] { - Vector3 ret = new Vector3(NDalicPINVOKE.Vector3_DivideAssign__SWIG_0(swigCPtr, Vector3.getCPtr(rhs)), false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; + get + { + return ValueOfIndex(index); + } } - private Vector3 DivideAssign(float rhs) + /// + /// The addition operator. + /// + /// The first value. + /// The second value. + /// The vector containing the result of the addition. + /// 3 + public static Vector3 operator +(Vector3 arg1, Vector3 arg2) { - Vector3 ret = new Vector3(NDalicPINVOKE.Vector3_DivideAssign__SWIG_1(swigCPtr, rhs), false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; + return arg1.Add(arg2); } - private Vector3 Subtract() + /// + /// The subtraction operator. + /// + /// The first value. + /// The second value. + /// The vector containing the result of the subtraction. + /// 3 + public static Vector3 operator -(Vector3 arg1, Vector3 arg2) { - Vector3 ret = new Vector3(NDalicPINVOKE.Vector3_Subtract__SWIG_1(swigCPtr), true); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; + return arg1.Subtract(arg2); } - private bool EqualTo(Vector3 rhs) + /// + /// The unary negation operator. + /// + /// The target value. + /// The vector containg the negation. + /// 3 + public static Vector3 operator -(Vector3 arg1) { - bool ret = NDalicPINVOKE.Vector3_EqualTo(swigCPtr, Vector3.getCPtr(rhs)); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; + return arg1.Subtract(); } - private bool NotEqualTo(Vector3 rhs) + /// + /// The multiplication operator. + /// + /// The first value. + /// The second value. + /// The vector containing the result of the multiplication. + /// 3 + public static Vector3 operator *(Vector3 arg1, Vector3 arg2) { - bool ret = NDalicPINVOKE.Vector3_NotEqualTo(swigCPtr, Vector3.getCPtr(rhs)); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; + return arg1.Multiply(arg2); } - private float ValueOfIndex(uint index) + /// + /// The multiplication operator. + /// + /// The first value. + /// The float value to scale the vector. + /// The vector containing the result of the scaling. + /// 3 + public static Vector3 operator *(Vector3 arg1, float arg2) { - float ret = NDalicPINVOKE.Vector3_ValueOfIndex__SWIG_0(swigCPtr, index); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; + return arg1.Multiply(arg2); } - internal float Dot(Vector3 other) + /// + /// The division operator. + /// + /// The first value. + /// The second value. + /// The vector containing the result of the division. + /// 3 + public static Vector3 operator /(Vector3 arg1, Vector3 arg2) { - float ret = NDalicPINVOKE.Vector3_Dot(swigCPtr, Vector3.getCPtr(other)); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; + return arg1.Divide(arg2); } - internal Vector3 Cross(Vector3 other) + /// + /// The division operator. + /// + /// The first value. + /// The float value to scale the vector by. + /// The vector containing the result of the scaling. + /// 3 + public static Vector3 operator /(Vector3 arg1, float arg2) { - Vector3 ret = new Vector3(NDalicPINVOKE.Vector3_Cross(swigCPtr, Vector3.getCPtr(other)), true); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; + return arg1.Divide(arg2); } /// @@ -607,14 +573,6 @@ namespace Tizen.NUI if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } - internal SWIGTYPE_p_float AsFloat() - { - global::System.IntPtr cPtr = NDalicPINVOKE.Vector3_AsFloat__SWIG_0(swigCPtr); - SWIGTYPE_p_float ret = (cPtr == global::System.IntPtr.Zero) ? null : new SWIGTYPE_p_float(cPtr, false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - /// /// Returns the x and y components (or width and height, or r and g) as a Vector2. /// @@ -640,174 +598,214 @@ namespace Tizen.NUI } /// - /// The x component. + /// Dispose. /// /// 3 - public float X + public void Dispose() { - set - { - NDalicPINVOKE.Vector3_X_set(swigCPtr, value); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - get + //Throw excpetion if Dispose() is called in separate thread. + if (!Window.IsInstalled()) { - float ret = NDalicPINVOKE.Vector3_X_get(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; + throw new System.InvalidOperationException("This API called from separate thread. This API must be called from MainThread."); } - } - /// - /// The width component. - /// - /// 3 - public float Width - { - set + if (isDisposeQueued) { - NDalicPINVOKE.Vector3_Width_set(swigCPtr, value); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + Dispose(DisposeTypes.Implicit); } - get + else { - float ret = NDalicPINVOKE.Vector3_Width_get(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; + Dispose(DisposeTypes.Explicit); + System.GC.SuppressFinalize(this); } } - /// - /// The red component. - /// - /// 3 - public float R + internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Vector3 obj) { - set - { - NDalicPINVOKE.Vector3_r_set(swigCPtr, value); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - get - { - float ret = NDalicPINVOKE.Vector3_r_get(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } + return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; } - /// - /// The y component. - /// - /// 3 - public float Y + internal static Vector3 GetVector3FromPtr(global::System.IntPtr cPtr) { - set - { - NDalicPINVOKE.Vector3_Y_set(swigCPtr, value); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - get - { - float ret = NDalicPINVOKE.Vector3_Y_get(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } + Vector3 ret = new Vector3(cPtr, false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; } - /// - /// The height component. - /// - /// 3 - public float Height + internal SWIGTYPE_p_float AsFloat() { - set - { - NDalicPINVOKE.Vector3_Height_set(swigCPtr, value); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - get - { - float ret = NDalicPINVOKE.Vector3_Height_get(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } + global::System.IntPtr cPtr = NDalicPINVOKE.Vector3_AsFloat__SWIG_0(swigCPtr); + SWIGTYPE_p_float ret = (cPtr == global::System.IntPtr.Zero) ? null : new SWIGTYPE_p_float(cPtr, false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; } /// - /// The green component. + /// Dispose. /// + /// The dispose type /// 3 - public float G + protected virtual void Dispose(DisposeTypes type) { - set - { - NDalicPINVOKE.Vector3_g_set(swigCPtr, value); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - get + if (disposed) { - float ret = NDalicPINVOKE.Vector3_g_get(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; + return; } - } - /// - /// The z component. - /// - /// 3 - public float Z - { - set + if (type == DisposeTypes.Explicit) { - NDalicPINVOKE.Vector3_Z_set(swigCPtr, value); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + //Called by User + //Release your own managed resources here. + //You should release all of your own disposable objects here. } - get + + //Release your own unmanaged resources here. + //You should not access any managed member here except static instance. + //because the execution order of Finalizes is non-deterministic. + + if (swigCPtr.Handle != global::System.IntPtr.Zero) { - float ret = NDalicPINVOKE.Vector3_Z_get(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; + if (swigCMemOwn) + { + swigCMemOwn = false; + NDalicPINVOKE.delete_Vector3(swigCPtr); + } + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); } + disposed = true; } - /// - /// The depth component. - /// - /// 3 - public float Depth + private Vector3 Add(Vector3 rhs) { - set - { - NDalicPINVOKE.Vector3_Depth_set(swigCPtr, value); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - get - { - float ret = NDalicPINVOKE.Vector3_Depth_get(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } + Vector3 ret = new Vector3(NDalicPINVOKE.Vector3_Add(swigCPtr, Vector3.getCPtr(rhs)), true); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; } - /// - /// The blue component. - /// - /// 3 - public float B + private Vector3 AddAssign(Vector3 rhs) { - set - { - NDalicPINVOKE.Vector3_b_set(swigCPtr, value); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - get - { - float ret = NDalicPINVOKE.Vector3_b_get(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } + Vector3 ret = new Vector3(NDalicPINVOKE.Vector3_AddAssign(swigCPtr, Vector3.getCPtr(rhs)), false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + private Vector3 Subtract(Vector3 rhs) + { + Vector3 ret = new Vector3(NDalicPINVOKE.Vector3_Subtract__SWIG_0(swigCPtr, Vector3.getCPtr(rhs)), true); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + private Vector3 SubtractAssign(Vector3 rhs) + { + Vector3 ret = new Vector3(NDalicPINVOKE.Vector3_SubtractAssign(swigCPtr, Vector3.getCPtr(rhs)), false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + private Vector3 Multiply(Vector3 rhs) + { + Vector3 ret = new Vector3(NDalicPINVOKE.Vector3_Multiply__SWIG_0(swigCPtr, Vector3.getCPtr(rhs)), true); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + private Vector3 Multiply(float rhs) + { + Vector3 ret = new Vector3(NDalicPINVOKE.Vector3_Multiply__SWIG_1(swigCPtr, rhs), true); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + private Vector3 MultiplyAssign(Vector3 rhs) + { + Vector3 ret = new Vector3(NDalicPINVOKE.Vector3_MultiplyAssign__SWIG_0(swigCPtr, Vector3.getCPtr(rhs)), false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + private Vector3 MultiplyAssign(float rhs) + { + Vector3 ret = new Vector3(NDalicPINVOKE.Vector3_MultiplyAssign__SWIG_1(swigCPtr, rhs), false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + private Vector3 MultiplyAssign(Rotation rhs) + { + Vector3 ret = new Vector3(NDalicPINVOKE.Vector3_MultiplyAssign__SWIG_2(swigCPtr, Rotation.getCPtr(rhs)), false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + private Vector3 Divide(Vector3 rhs) + { + Vector3 ret = new Vector3(NDalicPINVOKE.Vector3_Divide__SWIG_0(swigCPtr, Vector3.getCPtr(rhs)), true); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + private Vector3 Divide(float rhs) + { + Vector3 ret = new Vector3(NDalicPINVOKE.Vector3_Divide__SWIG_1(swigCPtr, rhs), true); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + private Vector3 DivideAssign(Vector3 rhs) + { + Vector3 ret = new Vector3(NDalicPINVOKE.Vector3_DivideAssign__SWIG_0(swigCPtr, Vector3.getCPtr(rhs)), false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + private Vector3 DivideAssign(float rhs) + { + Vector3 ret = new Vector3(NDalicPINVOKE.Vector3_DivideAssign__SWIG_1(swigCPtr, rhs), false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + private Vector3 Subtract() + { + Vector3 ret = new Vector3(NDalicPINVOKE.Vector3_Subtract__SWIG_1(swigCPtr), true); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + private bool EqualTo(Vector3 rhs) + { + bool ret = NDalicPINVOKE.Vector3_EqualTo(swigCPtr, Vector3.getCPtr(rhs)); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + private bool NotEqualTo(Vector3 rhs) + { + bool ret = NDalicPINVOKE.Vector3_NotEqualTo(swigCPtr, Vector3.getCPtr(rhs)); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + private float ValueOfIndex(uint index) + { + float ret = NDalicPINVOKE.Vector3_ValueOfIndex__SWIG_0(swigCPtr, index); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + internal float Dot(Vector3 other) + { + float ret = NDalicPINVOKE.Vector3_Dot(swigCPtr, Vector3.getCPtr(other)); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + internal Vector3 Cross(Vector3 other) + { + Vector3 ret = new Vector3(NDalicPINVOKE.Vector3_Cross(swigCPtr, Vector3.getCPtr(other)), true); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; } } diff --git a/src/Tizen.NUI/src/public/Vector4.cs b/src/Tizen.NUI/src/public/Vector4.cs index e0132de..b4402e7 100755 --- a/src/Tizen.NUI/src/public/Vector4.cs +++ b/src/Tizen.NUI/src/public/Vector4.cs @@ -27,207 +27,21 @@ namespace Tizen.NUI [TypeConverter(typeof(Vector4TypeConverter))] public class Vector4 : global::System.IDisposable { - private global::System.Runtime.InteropServices.HandleRef swigCPtr; /// /// swigCMemOwn. /// /// 3 protected bool swigCMemOwn; - internal Vector4(global::System.IntPtr cPtr, bool cMemoryOwn) - { - swigCMemOwn = cMemoryOwn; - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); - } - - internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Vector4 obj) - { - return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; - } - - //A Flag to check who called Dispose(). (By User or DisposeQueue) - private bool isDisposeQueued = false; - /// /// A Flat to check if it is already disposed. /// /// 3 protected bool disposed = false; - /// - /// Destructor. - /// - /// 3 - ~Vector4() - { - if(!isDisposeQueued) - { - isDisposeQueued = true; - DisposeQueue.Instance.Add(this); - } - } - - /// - /// Dispose. - /// - /// 3 - public void Dispose() - { - //Throw excpetion if Dispose() is called in separate thread. - if (!Window.IsInstalled()) - { - throw new System.InvalidOperationException("This API called from separate thread. This API must be called from MainThread."); - } - - if (isDisposeQueued) - { - Dispose(DisposeTypes.Implicit); - } - else - { - Dispose(DisposeTypes.Explicit); - System.GC.SuppressFinalize(this); - } - } - - /// - /// Dispose. - /// - /// The dispose type - /// 3 - protected virtual void Dispose(DisposeTypes type) - { - if (disposed) - { - return; - } - - if(type == DisposeTypes.Explicit) - { - //Called by User - //Release your own managed resources here. - //You should release all of your own disposable objects here. - } - - //Release your own unmanaged resources here. - //You should not access any managed member here except static instance. - //because the execution order of Finalizes is non-deterministic. - - if (swigCPtr.Handle != global::System.IntPtr.Zero) - { - if (swigCMemOwn) - { - swigCMemOwn = false; - NDalicPINVOKE.delete_Vector4(swigCPtr); - } - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); - } - disposed = true; - } - - /// - /// The addition operator. - /// - /// The first value. - /// The second value. - /// The vector containing the result of the addition. - /// 3 - public static Vector4 operator +(Vector4 arg1, Vector4 arg2) - { - return arg1.Add(arg2); - } - - /// - /// The subtraction operator. - /// - /// The first value. - /// The second value. - /// The vector containing the result of the subtraction. - /// 3 - public static Vector4 operator -(Vector4 arg1, Vector4 arg2) - { - return arg1.Subtract(arg2); - } - - /// - /// The unary negation operator. - /// - /// The target value. - /// The vector containing the negation. - /// 3 - public static Vector4 operator -(Vector4 arg1) - { - return arg1.Subtract(); - } - - /// - /// The multiplication operator. - /// - /// The first value. - /// The second value. - /// The vector containing the result of the multiplication. - /// 3 - public static Vector4 operator *(Vector4 arg1, Vector4 arg2) - { - return arg1.Multiply(arg2); - } - - /// - /// The multiplication operator. - /// - /// The first value. - /// The float value to scale the vector. - /// The vector containing the result of scaling. - /// 3 - public static Vector4 operator *(Vector4 arg1, float arg2) - { - return arg1.Multiply(arg2); - } - - /// - /// The division operator. - /// - /// The first value. - /// The second value. - /// The vector containing the result of the division. - /// 3 - public static Vector4 operator /(Vector4 arg1, Vector4 arg2) - { - return arg1.Divide(arg2); - } - - /// - /// The division operator. - /// - /// The first value. - /// The float value to scale the vector by. - /// The vector containing the result of scaling. - /// 3 - public static Vector4 operator /(Vector4 arg1, float arg2) - { - return arg1.Divide(arg2); - } - - /// - /// The array subscript operator overload. - /// - /// The subscript index. - /// The float at the given index. - /// 3 - public float this[uint index] - { - get - { - return ValueOfIndex(index); - } - } - - internal static Vector4 GetVector4FromPtr(global::System.IntPtr cPtr) - { - Vector4 ret = new Vector4(cPtr, false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } + private global::System.Runtime.InteropServices.HandleRef swigCPtr; + //A Flag to check who called Dispose(). (By User or DisposeQueue) + private bool isDisposeQueued = false; /// /// The default constructor initializes the vector to 0. @@ -281,6 +95,25 @@ namespace Tizen.NUI if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } + internal Vector4(global::System.IntPtr cPtr, bool cMemoryOwn) + { + swigCMemOwn = cMemoryOwn; + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); + } + + /// + /// Destructor. + /// + /// 3 + ~Vector4() + { + if(!isDisposeQueued) + { + isDisposeQueued = true; + DisposeQueue.Instance.Add(this); + } + } + /// /// (1.0f,1.0f,1.0f,1.0f). /// @@ -356,272 +189,49 @@ namespace Tizen.NUI } } - private Vector4 Add(Vector4 rhs) + /// + /// The x component. + /// + /// 3 + public float X { - Vector4 ret = new Vector4(NDalicPINVOKE.Vector4_Add(swigCPtr, Vector4.getCPtr(rhs)), true); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; + set + { + NDalicPINVOKE.Vector4_X_set(swigCPtr, value); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + get + { + float ret = NDalicPINVOKE.Vector4_X_get(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } } - private Vector4 AddAssign(Vector4 rhs) + /// + /// The red component. + /// + /// 3 + public float R { - Vector4 ret = new Vector4(NDalicPINVOKE.Vector4_AddAssign(swigCPtr, Vector4.getCPtr(rhs)), false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; + set + { + NDalicPINVOKE.Vector4_r_set(swigCPtr, value); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + get + { + float ret = NDalicPINVOKE.Vector4_r_get(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } } - private Vector4 Subtract(Vector4 rhs) - { - Vector4 ret = new Vector4(NDalicPINVOKE.Vector4_Subtract__SWIG_0(swigCPtr, Vector4.getCPtr(rhs)), true); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - private Vector4 SubtractAssign(Vector4 rhs) - { - Vector4 ret = new Vector4(NDalicPINVOKE.Vector4_SubtractAssign(swigCPtr, Vector4.getCPtr(rhs)), false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - private Vector4 Multiply(Vector4 rhs) - { - Vector4 ret = new Vector4(NDalicPINVOKE.Vector4_Multiply__SWIG_0(swigCPtr, Vector4.getCPtr(rhs)), true); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - private Vector4 Multiply(float rhs) - { - Vector4 ret = new Vector4(NDalicPINVOKE.Vector4_Multiply__SWIG_1(swigCPtr, rhs), true); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - private Vector4 MultiplyAssign(Vector4 rhs) - { - Vector4 ret = new Vector4(NDalicPINVOKE.Vector4_MultiplyAssign__SWIG_0(swigCPtr, Vector4.getCPtr(rhs)), false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - private Vector4 MultiplyAssign(float rhs) - { - Vector4 ret = new Vector4(NDalicPINVOKE.Vector4_MultiplyAssign__SWIG_1(swigCPtr, rhs), false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - private Vector4 Divide(Vector4 rhs) - { - Vector4 ret = new Vector4(NDalicPINVOKE.Vector4_Divide__SWIG_0(swigCPtr, Vector4.getCPtr(rhs)), true); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - private Vector4 Divide(float rhs) - { - Vector4 ret = new Vector4(NDalicPINVOKE.Vector4_Divide__SWIG_1(swigCPtr, rhs), true); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - private Vector4 DivideAssign(Vector4 rhs) - { - Vector4 ret = new Vector4(NDalicPINVOKE.Vector4_DivideAssign__SWIG_0(swigCPtr, Vector4.getCPtr(rhs)), false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - private Vector4 DivideAssign(float rhs) - { - Vector4 ret = new Vector4(NDalicPINVOKE.Vector4_DivideAssign__SWIG_1(swigCPtr, rhs), false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - private Vector4 Subtract() - { - Vector4 ret = new Vector4(NDalicPINVOKE.Vector4_Subtract__SWIG_1(swigCPtr), true); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - private bool EqualTo(Vector4 rhs) - { - bool ret = NDalicPINVOKE.Vector4_EqualTo(swigCPtr, Vector4.getCPtr(rhs)); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - private bool NotEqualTo(Vector4 rhs) - { - bool ret = NDalicPINVOKE.Vector4_NotEqualTo(swigCPtr, Vector4.getCPtr(rhs)); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - private float ValueOfIndex(uint index) - { - float ret = NDalicPINVOKE.Vector4_ValueOfIndex__SWIG_0(swigCPtr, index); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - internal float Dot(Vector3 other) - { - float ret = NDalicPINVOKE.Vector4_Dot__SWIG_0(swigCPtr, Vector3.getCPtr(other)); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - internal float Dot(Vector4 other) - { - float ret = NDalicPINVOKE.Vector4_Dot__SWIG_1(swigCPtr, Vector4.getCPtr(other)); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - internal float Dot4(Vector4 other) - { - float ret = NDalicPINVOKE.Vector4_Dot4(swigCPtr, Vector4.getCPtr(other)); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - internal Vector4 Cross(Vector4 other) - { - Vector4 ret = new Vector4(NDalicPINVOKE.Vector4_Cross(swigCPtr, Vector4.getCPtr(other)), true); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - /// - /// Determines whether the specified object is equal to the current object. - /// - /// The object to compare with the current object. - /// true if the specified object is equal to the current object; otherwise, false. - public override bool Equals(System.Object obj) - { - Vector4 vector4 = obj as Vector4; - bool equal = false; - if (X == vector4?.X && Y == vector4?.Y && Z == vector4?.Z && W == vector4?.W) - { - equal = true; - } - return equal; - } - - /// - /// Gets the the hash code of this Vector4. - /// - /// The Hash Code. - /// 5 - public override int GetHashCode() - { - return X.GetHashCode(); - } - - /// - /// Returns the length of the vector. - /// - /// The length. - /// 3 - public float Length() - { - float ret = NDalicPINVOKE.Vector4_Length(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - /// - /// Returns the length of the vector squared.
- /// This is faster than using Length() when performing - /// threshold checks as it avoids use of the square root.
- ///
- /// The length of the vector squared. - /// 3 - public float LengthSquared() - { - float ret = NDalicPINVOKE.Vector4_LengthSquared(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - /// - /// Normalizes the vector.
- /// Sets the vector to unit length whilst maintaining its direction.
- ///
- /// 3 - public void Normalize() - { - NDalicPINVOKE.Vector4_Normalize(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - /// - /// Clamps the vector between minimum and maximum vectors. - /// - /// The minimum vector. - /// The maximum vector. - /// 3 - public void Clamp(Vector4 min, Vector4 max) - { - NDalicPINVOKE.Vector4_Clamp(swigCPtr, Vector4.getCPtr(min), Vector4.getCPtr(max)); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - internal SWIGTYPE_p_float AsFloat() - { - global::System.IntPtr cPtr = NDalicPINVOKE.Vector4_AsFloat__SWIG_0(swigCPtr); - SWIGTYPE_p_float ret = (cPtr == global::System.IntPtr.Zero) ? null : new SWIGTYPE_p_float(cPtr, false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - /// - /// The x component. - /// - /// 3 - public float X - { - set - { - NDalicPINVOKE.Vector4_X_set(swigCPtr, value); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - get - { - float ret = NDalicPINVOKE.Vector4_X_get(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - } - - /// - /// The red component. - /// - /// 3 - public float R - { - set - { - NDalicPINVOKE.Vector4_r_set(swigCPtr, value); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - get - { - float ret = NDalicPINVOKE.Vector4_r_get(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - } - - /// - /// The s component. - /// - /// 3 - public float S + /// + /// The s component. + /// + /// 3 + public float S { set { @@ -807,6 +417,397 @@ namespace Tizen.NUI } } + /// + /// The array subscript operator overload. + /// + /// The subscript index. + /// The float at the given index. + /// 3 + public float this[uint index] + { + get + { + return ValueOfIndex(index); + } + } + + + /// + /// The addition operator. + /// + /// The first value. + /// The second value. + /// The vector containing the result of the addition. + /// 3 + public static Vector4 operator +(Vector4 arg1, Vector4 arg2) + { + return arg1.Add(arg2); + } + + /// + /// The subtraction operator. + /// + /// The first value. + /// The second value. + /// The vector containing the result of the subtraction. + /// 3 + public static Vector4 operator -(Vector4 arg1, Vector4 arg2) + { + return arg1.Subtract(arg2); + } + + /// + /// The unary negation operator. + /// + /// The target value. + /// The vector containing the negation. + /// 3 + public static Vector4 operator -(Vector4 arg1) + { + return arg1.Subtract(); + } + + /// + /// The multiplication operator. + /// + /// The first value. + /// The second value. + /// The vector containing the result of the multiplication. + /// 3 + public static Vector4 operator *(Vector4 arg1, Vector4 arg2) + { + return arg1.Multiply(arg2); + } + + /// + /// The multiplication operator. + /// + /// The first value. + /// The float value to scale the vector. + /// The vector containing the result of scaling. + /// 3 + public static Vector4 operator *(Vector4 arg1, float arg2) + { + return arg1.Multiply(arg2); + } + + /// + /// The division operator. + /// + /// The first value. + /// The second value. + /// The vector containing the result of the division. + /// 3 + public static Vector4 operator /(Vector4 arg1, Vector4 arg2) + { + return arg1.Divide(arg2); + } + + /// + /// The division operator. + /// + /// The first value. + /// The float value to scale the vector by. + /// The vector containing the result of scaling. + /// 3 + public static Vector4 operator /(Vector4 arg1, float arg2) + { + return arg1.Divide(arg2); + } + + /// + /// Determines whether the specified object is equal to the current object. + /// + /// The object to compare with the current object. + /// true if the specified object is equal to the current object; otherwise, false. + public override bool Equals(System.Object obj) + { + Vector4 vector4 = obj as Vector4; + bool equal = false; + if (X == vector4?.X && Y == vector4?.Y && Z == vector4?.Z && W == vector4?.W) + { + equal = true; + } + return equal; + } + + /// + /// Gets the the hash code of this Vector4. + /// + /// The Hash Code. + /// 5 + public override int GetHashCode() + { + return X.GetHashCode(); + } + + /// + /// Returns the length of the vector. + /// + /// The length. + /// 3 + public float Length() + { + float ret = NDalicPINVOKE.Vector4_Length(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + /// + /// Returns the length of the vector squared.
+ /// This is faster than using Length() when performing + /// threshold checks as it avoids use of the square root.
+ ///
+ /// The length of the vector squared. + /// 3 + public float LengthSquared() + { + float ret = NDalicPINVOKE.Vector4_LengthSquared(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + /// + /// Normalizes the vector.
+ /// Sets the vector to unit length whilst maintaining its direction.
+ ///
+ /// 3 + public void Normalize() + { + NDalicPINVOKE.Vector4_Normalize(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + /// + /// Clamps the vector between minimum and maximum vectors. + /// + /// The minimum vector. + /// The maximum vector. + /// 3 + public void Clamp(Vector4 min, Vector4 max) + { + NDalicPINVOKE.Vector4_Clamp(swigCPtr, Vector4.getCPtr(min), Vector4.getCPtr(max)); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + /// + /// Dispose. + /// + /// 3 + public void Dispose() + { + //Throw excpetion if Dispose() is called in separate thread. + if (!Window.IsInstalled()) + { + throw new System.InvalidOperationException("This API called from separate thread. This API must be called from MainThread."); + } + + if (isDisposeQueued) + { + Dispose(DisposeTypes.Implicit); + } + else + { + Dispose(DisposeTypes.Explicit); + System.GC.SuppressFinalize(this); + } + } + + internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Vector4 obj) + { + return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; + } + + internal static Vector4 GetVector4FromPtr(global::System.IntPtr cPtr) + { + Vector4 ret = new Vector4(cPtr, false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + internal SWIGTYPE_p_float AsFloat() + { + global::System.IntPtr cPtr = NDalicPINVOKE.Vector4_AsFloat__SWIG_0(swigCPtr); + SWIGTYPE_p_float ret = (cPtr == global::System.IntPtr.Zero) ? null : new SWIGTYPE_p_float(cPtr, false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + internal float Dot(Vector3 other) + { + float ret = NDalicPINVOKE.Vector4_Dot__SWIG_0(swigCPtr, Vector3.getCPtr(other)); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + internal float Dot(Vector4 other) + { + float ret = NDalicPINVOKE.Vector4_Dot__SWIG_1(swigCPtr, Vector4.getCPtr(other)); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + internal float Dot4(Vector4 other) + { + float ret = NDalicPINVOKE.Vector4_Dot4(swigCPtr, Vector4.getCPtr(other)); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + internal Vector4 Cross(Vector4 other) + { + Vector4 ret = new Vector4(NDalicPINVOKE.Vector4_Cross(swigCPtr, Vector4.getCPtr(other)), true); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + /// + /// Dispose. + /// + /// The dispose type + /// 3 + protected virtual void Dispose(DisposeTypes type) + { + if (disposed) + { + return; + } + + if (type == DisposeTypes.Explicit) + { + //Called by User + //Release your own managed resources here. + //You should release all of your own disposable objects here. + } + + //Release your own unmanaged resources here. + //You should not access any managed member here except static instance. + //because the execution order of Finalizes is non-deterministic. + + if (swigCPtr.Handle != global::System.IntPtr.Zero) + { + if (swigCMemOwn) + { + swigCMemOwn = false; + NDalicPINVOKE.delete_Vector4(swigCPtr); + } + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); + } + disposed = true; + } + + private Vector4 Add(Vector4 rhs) + { + Vector4 ret = new Vector4(NDalicPINVOKE.Vector4_Add(swigCPtr, Vector4.getCPtr(rhs)), true); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + private Vector4 AddAssign(Vector4 rhs) + { + Vector4 ret = new Vector4(NDalicPINVOKE.Vector4_AddAssign(swigCPtr, Vector4.getCPtr(rhs)), false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + private Vector4 Subtract(Vector4 rhs) + { + Vector4 ret = new Vector4(NDalicPINVOKE.Vector4_Subtract__SWIG_0(swigCPtr, Vector4.getCPtr(rhs)), true); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + private Vector4 SubtractAssign(Vector4 rhs) + { + Vector4 ret = new Vector4(NDalicPINVOKE.Vector4_SubtractAssign(swigCPtr, Vector4.getCPtr(rhs)), false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + private Vector4 Multiply(Vector4 rhs) + { + Vector4 ret = new Vector4(NDalicPINVOKE.Vector4_Multiply__SWIG_0(swigCPtr, Vector4.getCPtr(rhs)), true); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + private Vector4 Multiply(float rhs) + { + Vector4 ret = new Vector4(NDalicPINVOKE.Vector4_Multiply__SWIG_1(swigCPtr, rhs), true); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + private Vector4 MultiplyAssign(Vector4 rhs) + { + Vector4 ret = new Vector4(NDalicPINVOKE.Vector4_MultiplyAssign__SWIG_0(swigCPtr, Vector4.getCPtr(rhs)), false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + private Vector4 MultiplyAssign(float rhs) + { + Vector4 ret = new Vector4(NDalicPINVOKE.Vector4_MultiplyAssign__SWIG_1(swigCPtr, rhs), false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + private Vector4 Divide(Vector4 rhs) + { + Vector4 ret = new Vector4(NDalicPINVOKE.Vector4_Divide__SWIG_0(swigCPtr, Vector4.getCPtr(rhs)), true); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + private Vector4 Divide(float rhs) + { + Vector4 ret = new Vector4(NDalicPINVOKE.Vector4_Divide__SWIG_1(swigCPtr, rhs), true); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + private Vector4 DivideAssign(Vector4 rhs) + { + Vector4 ret = new Vector4(NDalicPINVOKE.Vector4_DivideAssign__SWIG_0(swigCPtr, Vector4.getCPtr(rhs)), false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + private Vector4 DivideAssign(float rhs) + { + Vector4 ret = new Vector4(NDalicPINVOKE.Vector4_DivideAssign__SWIG_1(swigCPtr, rhs), false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + private Vector4 Subtract() + { + Vector4 ret = new Vector4(NDalicPINVOKE.Vector4_Subtract__SWIG_1(swigCPtr), true); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + private bool EqualTo(Vector4 rhs) + { + bool ret = NDalicPINVOKE.Vector4_EqualTo(swigCPtr, Vector4.getCPtr(rhs)); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + private bool NotEqualTo(Vector4 rhs) + { + bool ret = NDalicPINVOKE.Vector4_NotEqualTo(swigCPtr, Vector4.getCPtr(rhs)); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + private float ValueOfIndex(uint index) + { + float ret = NDalicPINVOKE.Vector4_ValueOfIndex__SWIG_0(swigCPtr, index); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + } } \ No newline at end of file diff --git a/src/Tizen.NUI/src/public/ViewWrapper.cs b/src/Tizen.NUI/src/public/ViewWrapper.cs index af4dc6d..e404ce5 100755 --- a/src/Tizen.NUI/src/public/ViewWrapper.cs +++ b/src/Tizen.NUI/src/public/ViewWrapper.cs @@ -25,14 +25,20 @@ namespace Tizen.NUI /// 3 public class ViewWrapper : View { - private global::System.Runtime.InteropServices.HandleRef swigCPtr; internal ViewWrapperImpl viewWrapperImpl; + private global::System.Runtime.InteropServices.HandleRef swigCPtr; internal ViewWrapper(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicManualPINVOKE.ViewWrapper_SWIGUpcast(cPtr), cMemoryOwn) { swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); } + internal ViewWrapper(string typeName, ViewWrapperImpl implementation) : this(NDalicManualPINVOKE.ViewWrapper_New(typeName, ViewWrapperImpl.getCPtr(implementation)), true) + { + viewWrapperImpl = implementation; + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + internal static global::System.Runtime.InteropServices.HandleRef getCPtr(ViewWrapper obj) { return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; @@ -74,12 +80,5 @@ namespace Tizen.NUI base.Dispose(type); } - - - internal ViewWrapper(string typeName, ViewWrapperImpl implementation) : this(NDalicManualPINVOKE.ViewWrapper_New(typeName, ViewWrapperImpl.getCPtr(implementation)), true) - { - viewWrapperImpl = implementation; - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } } } \ No newline at end of file diff --git a/src/Tizen.NUI/src/public/VisualBase.cs b/src/Tizen.NUI/src/public/VisualBase.cs index ef701cc..f4a5a68 100755 --- a/src/Tizen.NUI/src/public/VisualBase.cs +++ b/src/Tizen.NUI/src/public/VisualBase.cs @@ -32,52 +32,6 @@ namespace Tizen.NUI { private global::System.Runtime.InteropServices.HandleRef swigCPtr; - internal VisualBase(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.VisualBase_SWIGUpcast(cPtr), cMemoryOwn) - { - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); - } - - internal static global::System.Runtime.InteropServices.HandleRef getCPtr(VisualBase obj) - { - return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; - } - - /// - /// Dispose. - /// - /// The dispose type - /// 3 - protected override void Dispose(DisposeTypes type) - { - if(disposed) - { - return; - } - - if(type == DisposeTypes.Explicit) - { - //Called by User - //Release your own managed resources here. - //You should release all of your own disposable objects here. - } - - //Release your own unmanaged resources here. - //You should not access any managed member here except static instance. - //because the execution order of Finalizes is non-deterministic. - - if (swigCPtr.Handle != global::System.IntPtr.Zero) - { - if (swigCMemOwn) - { - swigCMemOwn = false; - NDalicPINVOKE.delete_VisualBase(swigCPtr); - } - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); - } - - base.Dispose(type); - } - /// /// Creates an empty visual handle. /// @@ -91,6 +45,10 @@ namespace Tizen.NUI { if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } + internal VisualBase(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.VisualBase_SWIGUpcast(cPtr), cMemoryOwn) + { + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); + } /// /// The name of the visual. @@ -108,17 +66,34 @@ namespace Tizen.NUI } } - internal void SetName(string name) + /// + /// The depth index of this visual. + /// + /// 3 + public int DepthIndex { - NDalicPINVOKE.VisualBase_SetName(swigCPtr, name); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + set + { + SetDepthIndex(value); + } + get + { + return GetDepthIndex(); + } } - internal string GetName() + /// + /// Creates the property map representing this visual. + /// + /// 3 + public PropertyMap Creation { - string ret = NDalicPINVOKE.VisualBase_GetName(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; + get + { + PropertyMap map = new PropertyMap(); + CreatePropertyMap(map); + return map; + } } /// @@ -172,21 +147,24 @@ namespace Tizen.NUI if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } - /// - /// The depth index of this visual. - /// - /// 3 - public int DepthIndex + internal static global::System.Runtime.InteropServices.HandleRef getCPtr(VisualBase obj) { - set - { - SetDepthIndex(value); - } - get - { - return GetDepthIndex(); - } + return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; } + + internal void SetName(string name) + { + NDalicPINVOKE.VisualBase_SetName(swigCPtr, name); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + internal string GetName() + { + string ret = NDalicPINVOKE.VisualBase_GetName(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + internal void SetDepthIndex(int index) { NDalicPINVOKE.VisualBase_SetDepthIndex(swigCPtr, index); @@ -200,24 +178,46 @@ namespace Tizen.NUI return ret; } + internal void CreatePropertyMap(PropertyMap map) + { + NDalicPINVOKE.VisualBase_CreatePropertyMap(swigCPtr, PropertyMap.getCPtr(map)); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + /// - /// Creates the property map representing this visual. + /// Dispose. /// + /// The dispose type /// 3 - public PropertyMap Creation + protected override void Dispose(DisposeTypes type) { - get + if (disposed) { - PropertyMap map = new PropertyMap(); - CreatePropertyMap(map); - return map; + return; } - } - internal void CreatePropertyMap(PropertyMap map) - { - NDalicPINVOKE.VisualBase_CreatePropertyMap(swigCPtr, PropertyMap.getCPtr(map)); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + if (type == DisposeTypes.Explicit) + { + //Called by User + //Release your own managed resources here. + //You should release all of your own disposable objects here. + } + + //Release your own unmanaged resources here. + //You should not access any managed member here except static instance. + //because the execution order of Finalizes is non-deterministic. + + if (swigCPtr.Handle != global::System.IntPtr.Zero) + { + if (swigCMemOwn) + { + swigCMemOwn = false; + NDalicPINVOKE.delete_VisualBase(swigCPtr); + } + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); + } + + base.Dispose(type); } } diff --git a/src/Tizen.NUI/src/public/VisualFactory.cs b/src/Tizen.NUI/src/public/VisualFactory.cs index afad177..6a9cef1 100755 --- a/src/Tizen.NUI/src/public/VisualFactory.cs +++ b/src/Tizen.NUI/src/public/VisualFactory.cs @@ -27,21 +27,39 @@ namespace Tizen.NUI /// 3 public class VisualFactory : BaseHandle { - private global::System.Runtime.InteropServices.HandleRef swigCPtr; /// /// Instance of the VisualFactory singleton. /// private static VisualFactory instance; + private global::System.Runtime.InteropServices.HandleRef swigCPtr; internal VisualFactory(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.VisualFactory_SWIGUpcast(cPtr), cMemoryOwn) { swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); } - internal static global::System.Runtime.InteropServices.HandleRef getCPtr(VisualFactory obj) + internal VisualFactory() : this(NDalicPINVOKE.new_VisualFactory__SWIG_0(), true) { - return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + /// + /// Retrieves the VisualFactory singleton. + /// + /// 3 + public static VisualFactory Instance + { + get + { + if (!instance) + { + instance = new VisualFactory(NDalicPINVOKE.VisualFactory_Get(), true); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + return instance; + } } /// @@ -58,12 +76,6 @@ namespace Tizen.NUI return VisualFactory.Instance; } - internal VisualFactory() : this(NDalicPINVOKE.new_VisualFactory__SWIG_0(), true) - { - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - /// /// Request the visual. /// @@ -77,6 +89,11 @@ namespace Tizen.NUI return ret; } + internal static global::System.Runtime.InteropServices.HandleRef getCPtr(VisualFactory obj) + { + return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; + } + internal VisualBase CreateVisual(Image image) { VisualBase ret = new VisualBase(NDalicPINVOKE.VisualFactory_CreateVisual__SWIG_1(swigCPtr, Image.getCPtr(image)), true); @@ -84,24 +101,6 @@ namespace Tizen.NUI return ret; } - /// - /// Retrieves the VisualFactory singleton. - /// - /// 3 - public static VisualFactory Instance - { - get - { - if (!instance) - { - instance = new VisualFactory(NDalicPINVOKE.VisualFactory_Get(), true); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - return instance; - } - } - } } \ No newline at end of file diff --git a/src/Tizen.NUI/src/public/VisualMaps.cs b/src/Tizen.NUI/src/public/VisualMaps.cs index 9d788e7..36589c1 100755 --- a/src/Tizen.NUI/src/public/VisualMaps.cs +++ b/src/Tizen.NUI/src/public/VisualMaps.cs @@ -27,6 +27,49 @@ namespace Tizen.NUI /// 3 public class VisualMap { + /// + /// outputVisualMap. + /// + /// 3 + protected PropertyMap _outputVisualMap = null; + + /// + /// The shader of the visual. + /// + /// 3 + protected PropertyMap _shader = null; + //private PropertyMap _transform = null; + + /// + /// The premultipliedAlpha of the visual. + /// + /// 3 + protected bool? _premultipliedAlpha = null; + + /// + /// The mixColor of the Visual. + /// + /// 3 + protected Color _mixColor = null; + + /// + /// The opacity of the visual. + /// + /// 3 + protected float? _opacity = null; + + /// + /// The FittingMode of the visual. + /// + /// 5 + protected VisualFittingModeType? _visualFittingMode = null; + + /// + /// The map for visual. + /// + /// 3 + protected PropertyMap _commonlyUsedMap = null; + private Vector2 _visualSize = null; private Vector2 _visualOffset = null; private Vector2 _visualOffsetPolicy = null; @@ -39,30 +82,6 @@ namespace Tizen.NUI private int? _depthIndex = null; /// - /// outputVisualMap. - /// - /// 3 - protected PropertyMap _outputVisualMap = null; - - internal string Name - { - set; - get; - } - - internal int VisualIndex - { - set; - get; - } - - internal VisualView Parent - { - set; - get; - } - - /// /// Constructor. /// /// 3 @@ -447,17 +466,6 @@ namespace Tizen.NUI } } - private void ComposingTransformMap() - { - _visualTransformMap = new PropertyMap(); - if (_visualSize != null) { _visualTransformMap.Add((int)VisualTransformPropertyType.Size, new PropertyValue(_visualSize)); } - if (_visualOffset != null) { _visualTransformMap.Add((int)VisualTransformPropertyType.Offset, new PropertyValue(_visualOffset)); } - if (_visualOffsetPolicy != null) { _visualTransformMap.Add((int)VisualTransformPropertyType.OffsetPolicy, new PropertyValue(_visualOffsetPolicy)); } - if (_visualSizePolicy != null) { _visualTransformMap.Add((int)VisualTransformPropertyType.SizePolicy, new PropertyValue(_visualSizePolicy)); } - if (_visualOrigin != null) { _visualTransformMap.Add((int)VisualTransformPropertyType.Origin, new PropertyValue((int)_visualOrigin)); } - if (_visualAnchorPoint != null) { _visualTransformMap.Add((int)VisualTransformPropertyType.AnchorPoint, new PropertyValue((int)_visualAnchorPoint)); } - } - /// /// Gets the transform map used by the visual. /// @@ -472,15 +480,6 @@ namespace Tizen.NUI } /// - /// Compose the out visual map. - /// - /// 3 - protected virtual void ComposingPropertyMap() - { - _outputVisualMap = new PropertyMap(); - } - - /// /// Gets the property map to create the visual. /// /// 3 @@ -493,55 +492,6 @@ namespace Tizen.NUI } } - internal void UpdateVisual() - { - if (VisualIndex > 0) - { - NUILog.Debug("UpdateVisual()! VisualIndex=" + VisualIndex); - Parent.UpdateVisual(VisualIndex, Name, this); - } - else - { - NUILog.Debug("VisualIndex was not set"); - } - } - - /// - /// The shader of the visual. - /// - /// 3 - protected PropertyMap _shader = null; - //private PropertyMap _transform = null; - - /// - /// The premultipliedAlpha of the visual. - /// - /// 3 - protected bool? _premultipliedAlpha = null; - - /// - /// The mixColor of the Visual. - /// - /// 3 - protected Color _mixColor = null; - - /// - /// The opacity of the visual. - /// - /// 3 - protected float? _opacity = null; - - /// - /// The FittingMode of the visual. - /// - /// 5 - protected VisualFittingModeType? _visualFittingMode = null; - - /// - /// The map for visual. - /// - /// 3 - protected PropertyMap _commonlyUsedMap = null; /// /// The shader to use in the visual. @@ -646,6 +596,58 @@ namespace Tizen.NUI UpdateVisual(); } } + + internal string Name + { + set; + get; + } + + internal int VisualIndex + { + set; + get; + } + + internal VisualView Parent + { + set; + get; + } + + internal void UpdateVisual() + { + if (VisualIndex > 0) + { + NUILog.Debug("UpdateVisual()! VisualIndex=" + VisualIndex); + Parent.UpdateVisual(VisualIndex, Name, this); + } + else + { + NUILog.Debug("VisualIndex was not set"); + } + } + + /// + /// Compose the out visual map. + /// + /// 3 + protected virtual void ComposingPropertyMap() + { + _outputVisualMap = new PropertyMap(); + } + + private void ComposingTransformMap() + { + _visualTransformMap = new PropertyMap(); + if (_visualSize != null) { _visualTransformMap.Add((int)VisualTransformPropertyType.Size, new PropertyValue(_visualSize)); } + if (_visualOffset != null) { _visualTransformMap.Add((int)VisualTransformPropertyType.Offset, new PropertyValue(_visualOffset)); } + if (_visualOffsetPolicy != null) { _visualTransformMap.Add((int)VisualTransformPropertyType.OffsetPolicy, new PropertyValue(_visualOffsetPolicy)); } + if (_visualSizePolicy != null) { _visualTransformMap.Add((int)VisualTransformPropertyType.SizePolicy, new PropertyValue(_visualSizePolicy)); } + if (_visualOrigin != null) { _visualTransformMap.Add((int)VisualTransformPropertyType.Origin, new PropertyValue((int)_visualOrigin)); } + if (_visualAnchorPoint != null) { _visualTransformMap.Add((int)VisualTransformPropertyType.AnchorPoint, new PropertyValue((int)_visualAnchorPoint)); } + } + } /// @@ -654,14 +656,6 @@ namespace Tizen.NUI /// 3 public class ImageVisual : VisualMap { - /// - /// Constructor. - /// - /// 3 - public ImageVisual() : base() - { - } - private string _url = null; private string _alphaMaskUrl = null; private string _auxiliaryImageUrl = null; @@ -683,6 +677,14 @@ namespace Tizen.NUI private bool? _atlasing = false; /// + /// Constructor. + /// + /// 3 + public ImageVisual() : base() + { + } + + /// /// Gets or sets the URL of the image.
/// Mandatory. ///
@@ -1092,14 +1094,6 @@ namespace Tizen.NUI /// 3 public class TextVisual : VisualMap { - /// - /// Constructor. - /// - /// 3 - public TextVisual() : base() - { - } - private string _text = null; private string _fontFamily = null; private PropertyMap _fontStyle = null; @@ -1115,6 +1109,14 @@ namespace Tizen.NUI private PropertyMap _background = null; /// + /// Constructor. + /// + /// 3 + public TextVisual() : base() + { + } + + /// /// Gets or sets the text to display in the UTF-8 format.
/// Mandatory. ///
@@ -1449,6 +1451,10 @@ namespace Tizen.NUI /// 3 public class BorderVisual : VisualMap { + private Color _color = null; + private float? _size = null; + private bool? _antiAliasing = null; + /// /// Constructor. /// @@ -1457,10 +1463,6 @@ namespace Tizen.NUI { } - private Color _color = null; - private float? _size = null; - private bool? _antiAliasing = null; - /// /// Gets or sets the color of the border.
/// Mandatory. @@ -1544,6 +1546,9 @@ namespace Tizen.NUI /// 3 public class ColorVisual : VisualMap { + private Color _mixColorForColorVisual = null; + private bool? _renderIfTransparent = false; + /// /// Constructor. /// @@ -1552,9 +1557,6 @@ namespace Tizen.NUI { } - private Color _mixColorForColorVisual = null; - private bool? _renderIfTransparent = false; - /// /// Gets or sets the solid color required.
/// Mandatory. @@ -1617,14 +1619,6 @@ namespace Tizen.NUI /// 3 public class GradientVisual : VisualMap { - /// - /// Constructor. - /// - /// 3 - public GradientVisual() : base() - { - } - private Vector2 _startPosition = null; private Vector2 _endPosition = null; private Vector2 _center = null; @@ -1635,6 +1629,14 @@ namespace Tizen.NUI private GradientVisualSpreadMethodType? _spreadMethod = null; /// + /// Constructor. + /// + /// 3 + public GradientVisual() : base() + { + } + + /// /// Gets or sets the start position of a linear gradient.
/// Mandatory for linear.
///
@@ -1817,14 +1819,6 @@ namespace Tizen.NUI /// 3 public class MeshVisual : VisualMap { - /// - /// Constructor. - /// - /// 3 - public MeshVisual() : base() - { - } - private string _objectURL = null; private string _materialtURL = null; private string _texturesPath = null; @@ -1834,6 +1828,14 @@ namespace Tizen.NUI private Vector3 _lightPosition = null; /// + /// Constructor. + /// + /// 3 + public MeshVisual() : base() + { + } + + /// /// Gets or sets the location of the ".obj" file.
/// Mandatory. ///
@@ -1998,14 +2000,6 @@ namespace Tizen.NUI /// 3 public class PrimitiveVisual : VisualMap { - /// - /// Constructor. - /// - /// 3 - public PrimitiveVisual() : base() - { - } - private PrimitiveVisualShapeType? _shape = null; private Color _mixColorForPrimitiveVisual = null; private int? _slices = null; @@ -2020,6 +2014,14 @@ namespace Tizen.NUI private Vector3 _lightPosition = null; /// + /// Constructor. + /// + /// 3 + public PrimitiveVisual() : base() + { + } + + /// /// Gets or sets the specific shape to render.
/// If not specified, the default is PrimitiveVisualShapeType.Sphere.
/// Optional. @@ -2313,6 +2315,10 @@ namespace Tizen.NUI /// 3 public class NPatchVisual : VisualMap { + private string _url = null; + private bool? _borderOnly = null; + private Rectangle _border = null; + /// /// Constructor. /// @@ -2321,10 +2327,6 @@ namespace Tizen.NUI { } - private string _url = null; - private bool? _borderOnly = null; - private Rectangle _border = null; - /// /// Gets or sets the URL of the image.
/// Mandatory. @@ -2410,6 +2412,8 @@ namespace Tizen.NUI /// 3 public class SVGVisual : VisualMap { + private string _url = null; + /// /// Constructor. /// @@ -2418,8 +2422,6 @@ namespace Tizen.NUI { } - private string _url = null; - /// /// The url of the svg resource. /// @@ -2463,6 +2465,12 @@ namespace Tizen.NUI /// 3 public class AnimatedImageVisual : VisualMap { + private List _urls = null; + private int? _batchSize = null; + private int? _cacheSize = null; + private float? _frameDelay = null; + private float? _loopCount = null; + /// /// Constructor. /// @@ -2471,12 +2479,6 @@ namespace Tizen.NUI { } - private List _urls = null; - private int? _batchSize = null; - private int? _cacheSize = null; - private float? _frameDelay = null; - private float? _loopCount = null; - /// /// Gets and Sets the url in the AnimatedImageVisual. /// @@ -2639,6 +2641,13 @@ namespace Tizen.NUI /// 3 public class VisualAnimator : VisualMap { + private string _alphaFunction = null; + private int _startTime = 0; + private int _endTime = 0; + private string _target = null; + private string _propertyIndex = null; + private object _destinationValue = null; + /// /// Create VisualAnimator object. /// @@ -2647,13 +2656,6 @@ namespace Tizen.NUI { } - private string _alphaFunction = null; - private int _startTime = 0; - private int _endTime = 0; - private string _target = null; - private string _propertyIndex = null; - private object _destinationValue = null; - /// /// Sets and Gets the AlphaFunction of this transition. /// diff --git a/src/Tizen.NUI/src/public/WatchTime.cs b/src/Tizen.NUI/src/public/WatchTime.cs index 7c0f63d..ee5c316 100755 --- a/src/Tizen.NUI/src/public/WatchTime.cs +++ b/src/Tizen.NUI/src/public/WatchTime.cs @@ -26,120 +26,47 @@ namespace Tizen.NUI /// 4 public class WatchTime : global::System.IDisposable { - private global::System.Runtime.InteropServices.HandleRef swigCPtr; - /// /// swigCMemOwn. /// /// 4 protected bool swigCMemOwn; - internal WatchTime(global::System.IntPtr cPtr, bool cMemoryOwn) - { - swigCMemOwn = cMemoryOwn; - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); - } - - internal static global::System.Runtime.InteropServices.HandleRef getCPtr(WatchTime obj) - { - return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; - } - - //A Flag to check who called Dispose(). (By User or DisposeQueue) - private bool isDisposeQueued = false; - /// /// A Flat to check if it is already disposed. /// /// 4 protected bool disposed = false; - /// - /// Distructor. - /// - ~WatchTime() - { - if (!isDisposeQueued) - { - isDisposeQueued = true; - DisposeQueue.Instance.Add(this); - } - } - - /// - /// To make watch time instance be disposed. - /// - /// 4 - public void Dispose() - { - //Throw excpetion if Dispose() is called in separate thread. - if (!Window.IsInstalled()) - { - throw new System.InvalidOperationException("This API called from separate thread. This API must be called from MainThread."); - } - - if (isDisposeQueued) - { - Dispose(DisposeTypes.Implicit); - } - else - { - Dispose(DisposeTypes.Explicit); - System.GC.SuppressFinalize(this); - } - } + private global::System.Runtime.InteropServices.HandleRef swigCPtr; + //A Flag to check who called Dispose(). (By User or DisposeQueue) + private bool isDisposeQueued = false; /// - /// you can override it to clean-up your own resources. + /// Constructor. /// - /// DisposeTypes /// 4 - protected virtual void Dispose(DisposeTypes type) + public WatchTime() : this(NDalicManualPINVOKE.new_WatchTime(), true) { - if (disposed) - { - return; - } - - if (type == DisposeTypes.Explicit) - { - //Called by User - //Release your own managed resources here. - //You should release all of your own disposable objects here. - - } - - //Release your own unmanaged resources here. - //You should not access any managed member here except static instance. - //because the execution order of Finalizes is non-deterministic. - - if (swigCPtr.Handle != global::System.IntPtr.Zero) - { - if (swigCMemOwn) - { - swigCMemOwn = false; - NDalicManualPINVOKE.delete_WatchTime(swigCPtr); - } - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); - } - - disposed = true; + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } - internal static WatchTime GetWatchTimeFromPtr(global::System.IntPtr cPtr) + internal WatchTime(global::System.IntPtr cPtr, bool cMemoryOwn) { - WatchTime ret = new WatchTime(cPtr, false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; + swigCMemOwn = cMemoryOwn; + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); } /// - /// Constructor. + /// Distructor. /// - /// 4 - public WatchTime() : this(NDalicManualPINVOKE.new_WatchTime(), true) + ~WatchTime() { - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + if (!isDisposeQueued) + { + isDisposeQueued = true; + DisposeQueue.Instance.Add(this); + } } /// @@ -155,13 +82,6 @@ namespace Tizen.NUI } } - internal int GetHour() - { - int ret = NDalicManualPINVOKE.WatchTime_GetHour(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - /// /// Get the current hour24. /// @@ -175,13 +95,6 @@ namespace Tizen.NUI } } - internal int GetHour24() - { - int ret = NDalicManualPINVOKE.WatchTime_GetHour24(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - /// /// Get the current minute. /// @@ -195,13 +108,6 @@ namespace Tizen.NUI } } - internal int GetMinute() - { - int ret = NDalicManualPINVOKE.WatchTime_GetMinute(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - /// /// Get the current second. /// @@ -215,13 +121,6 @@ namespace Tizen.NUI } } - internal int GetSecond() - { - int ret = NDalicManualPINVOKE.WatchTime_GetSecond(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - /// /// Get the current millisecond. /// @@ -235,13 +134,6 @@ namespace Tizen.NUI } } - internal int GetMillisecond() - { - int ret = NDalicManualPINVOKE.WatchTime_GetMillisecond(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - /// /// Get the current year. /// @@ -255,13 +147,6 @@ namespace Tizen.NUI } } - internal int GetYear() - { - int ret = NDalicManualPINVOKE.WatchTime_GetYear(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - /// /// Get the current month. /// @@ -275,13 +160,6 @@ namespace Tizen.NUI } } - internal int GetMonth() - { - int ret = NDalicManualPINVOKE.WatchTime_GetMonth(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - /// /// Get the current day. /// @@ -295,13 +173,6 @@ namespace Tizen.NUI } } - internal int GetDay() - { - int ret = NDalicManualPINVOKE.WatchTime_GetDay(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - /// /// Get the current week. /// @@ -315,27 +186,6 @@ namespace Tizen.NUI } } - internal int GetDayOfWeek() - { - int ret = NDalicManualPINVOKE.WatchTime_GetDayOfWeek(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - internal SWIGTYPE_p_tm GetUtcTime() - { - SWIGTYPE_p_tm ret = new SWIGTYPE_p_tm(NDalicManualPINVOKE.WatchTime_GetUtcTime(swigCPtr), true); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - internal SWIGTYPE_p_time_t GetUtcTimeStamp() - { - SWIGTYPE_p_time_t ret = new SWIGTYPE_p_time_t(NDalicManualPINVOKE.WatchTime_GetUtcTimeStamp(swigCPtr), true); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - /// /// Get the ID of timezone. /// @@ -354,13 +204,6 @@ namespace Tizen.NUI } } - internal string GetTimeZone() - { - string ret = NDalicManualPINVOKE.WatchTime_GetTimeZone(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - /// /// Get the daylight saving time status. /// @@ -374,6 +217,69 @@ namespace Tizen.NUI } } + /// + /// To make watch time instance be disposed. + /// + /// 4 + public void Dispose() + { + //Throw excpetion if Dispose() is called in separate thread. + if (!Window.IsInstalled()) + { + throw new System.InvalidOperationException("This API called from separate thread. This API must be called from MainThread."); + } + + if (isDisposeQueued) + { + Dispose(DisposeTypes.Implicit); + } + else + { + Dispose(DisposeTypes.Explicit); + System.GC.SuppressFinalize(this); + } + } + + internal static global::System.Runtime.InteropServices.HandleRef getCPtr(WatchTime obj) + { + return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; + } + + internal static WatchTime GetWatchTimeFromPtr(global::System.IntPtr cPtr) + { + WatchTime ret = new WatchTime(cPtr, false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + internal int GetDayOfWeek() + { + int ret = NDalicManualPINVOKE.WatchTime_GetDayOfWeek(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + internal SWIGTYPE_p_tm GetUtcTime() + { + SWIGTYPE_p_tm ret = new SWIGTYPE_p_tm(NDalicManualPINVOKE.WatchTime_GetUtcTime(swigCPtr), true); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + internal SWIGTYPE_p_time_t GetUtcTimeStamp() + { + SWIGTYPE_p_time_t ret = new SWIGTYPE_p_time_t(NDalicManualPINVOKE.WatchTime_GetUtcTimeStamp(swigCPtr), true); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + internal string GetTimeZone() + { + string ret = NDalicManualPINVOKE.WatchTime_GetTimeZone(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + internal bool GetDaylightSavingTimeStatus() { bool ret = NDalicManualPINVOKE.WatchTime_GetDaylightSavingTimeStatus(swigCPtr); @@ -381,6 +287,99 @@ namespace Tizen.NUI return ret; } + internal int GetHour() + { + int ret = NDalicManualPINVOKE.WatchTime_GetHour(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + internal int GetHour24() + { + int ret = NDalicManualPINVOKE.WatchTime_GetHour24(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + internal int GetMinute() + { + int ret = NDalicManualPINVOKE.WatchTime_GetMinute(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + internal int GetSecond() + { + int ret = NDalicManualPINVOKE.WatchTime_GetSecond(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + internal int GetMillisecond() + { + int ret = NDalicManualPINVOKE.WatchTime_GetMillisecond(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + internal int GetYear() + { + int ret = NDalicManualPINVOKE.WatchTime_GetYear(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + internal int GetMonth() + { + int ret = NDalicManualPINVOKE.WatchTime_GetMonth(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + internal int GetDay() + { + int ret = NDalicManualPINVOKE.WatchTime_GetDay(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + /// + /// you can override it to clean-up your own resources. + /// + /// DisposeTypes + /// 4 + protected virtual void Dispose(DisposeTypes type) + { + if (disposed) + { + return; + } + + if (type == DisposeTypes.Explicit) + { + //Called by User + //Release your own managed resources here. + //You should release all of your own disposable objects here. + + } + + //Release your own unmanaged resources here. + //You should not access any managed member here except static instance. + //because the execution order of Finalizes is non-deterministic. + + if (swigCPtr.Handle != global::System.IntPtr.Zero) + { + if (swigCMemOwn) + { + swigCMemOwn = false; + NDalicManualPINVOKE.delete_WatchTime(swigCPtr); + } + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); + } + + disposed = true; + } + } } diff --git a/src/Tizen.NUI/src/public/Wheel.cs b/src/Tizen.NUI/src/public/Wheel.cs index 3898712..ae18c53 100755 --- a/src/Tizen.NUI/src/public/Wheel.cs +++ b/src/Tizen.NUI/src/public/Wheel.cs @@ -27,110 +27,83 @@ namespace Tizen.NUI /// 3 public class Wheel : global::System.IDisposable { - private global::System.Runtime.InteropServices.HandleRef swigCPtr; /// /// swigCMemOwn. /// /// 3 protected bool swigCMemOwn; - internal Wheel(global::System.IntPtr cPtr, bool cMemoryOwn) - { - swigCMemOwn = cMemoryOwn; - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); - } - - internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Wheel obj) - { - return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; - } - - //A Flag to check who called Dispose(). (By User or DisposeQueue) - private bool isDisposeQueued = false; - /// /// A Flat to check if it is already disposed. /// /// 3 protected bool disposed = false; + private global::System.Runtime.InteropServices.HandleRef swigCPtr; + + //A Flag to check who called Dispose(). (By User or DisposeQueue) + private bool isDisposeQueued = false; + /// - /// Destructor. + /// The default constructor. /// /// 3 - ~Wheel() + public Wheel() : this(NDalicPINVOKE.new_Wheel__SWIG_0(), true) { - if(!isDisposeQueued) - { - isDisposeQueued = true; - DisposeQueue.Instance.Add(this); - } + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } /// - /// Dispose. + /// The constructor. /// + /// The type of the wheel event. + /// The direction of wheel rolling (0 = default vertical wheel, 1 = horizontal wheel). + /// Modifier keys pressed during the event (such as Shift, Alt, and Ctrl). + /// The coordinates of the cursor relative to the top-left of the screen. + /// The offset of rolling (positive value means roll down or clockwise, and negative value means roll up or counter-clockwise). + /// The time the wheel is being rolled. /// 3 - public void Dispose() + public Wheel(Wheel.WheelType type, int direction, uint modifiers, Vector2 point, int z, uint timeStamp) : this(NDalicPINVOKE.new_Wheel__SWIG_1((int)type, direction, modifiers, Vector2.getCPtr(point), z, timeStamp), true) { - //Throw excpetion if Dispose() is called in separate thread. - if (!Window.IsInstalled()) - { - throw new System.InvalidOperationException("This API called from separate thread. This API must be called from MainThread."); - } + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } - if (isDisposeQueued) - { - Dispose(DisposeTypes.Implicit); - } - else - { - Dispose(DisposeTypes.Explicit); - System.GC.SuppressFinalize(this); - } + internal Wheel(global::System.IntPtr cPtr, bool cMemoryOwn) + { + swigCMemOwn = cMemoryOwn; + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); } /// - /// Dispose. + /// Destructor. /// - /// The type dispose, it could be from user, or called by DisposeQueue. /// 3 - protected virtual void Dispose(DisposeTypes type) + ~Wheel() { - if (disposed) - { - return; - } - - if(type == DisposeTypes.Explicit) - { - //Called by User - //Release your own managed resources here. - //You should release all of your own disposable objects here. - } - - //Release your own unmanaged resources here. - //You should not access any managed member here except static instance. - //because the execution order of Finalizes is non-deterministic. - - if (swigCPtr.Handle != global::System.IntPtr.Zero) + if(!isDisposeQueued) { - if (swigCMemOwn) - { - swigCMemOwn = false; - NDalicPINVOKE.delete_Wheel(swigCPtr); - } - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); + isDisposeQueued = true; + DisposeQueue.Instance.Add(this); } - disposed = true; } - - internal static Wheel GetWheelFromPtr(global::System.IntPtr cPtr) + /// + /// The type of the wheel event. + /// + /// 3 + public enum WheelType { - Wheel ret = new Wheel(cPtr, false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; + /// + /// Mouse wheel event. + /// + /// 3 + MouseWheel, + + /// + /// Custom wheel event. + /// + /// 3 + CustomWheel } /// @@ -205,66 +178,6 @@ namespace Tizen.NUI } } - /// - /// The default constructor. - /// - /// 3 - public Wheel() : this(NDalicPINVOKE.new_Wheel__SWIG_0(), true) - { - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - /// - /// The constructor. - /// - /// The type of the wheel event. - /// The direction of wheel rolling (0 = default vertical wheel, 1 = horizontal wheel). - /// Modifier keys pressed during the event (such as Shift, Alt, and Ctrl). - /// The coordinates of the cursor relative to the top-left of the screen. - /// The offset of rolling (positive value means roll down or clockwise, and negative value means roll up or counter-clockwise). - /// The time the wheel is being rolled. - /// 3 - public Wheel(Wheel.WheelType type, int direction, uint modifiers, Vector2 point, int z, uint timeStamp) : this(NDalicPINVOKE.new_Wheel__SWIG_1((int)type, direction, modifiers, Vector2.getCPtr(point), z, timeStamp), true) - { - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - /// - /// Checks to see if the Shift key modifier has been supplied. - /// - /// True if Shift modifier. - /// 3 - public bool IsShiftModifier() - { - bool ret = NDalicPINVOKE.Wheel_IsShiftModifier(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - /// - /// Checks to see if Ctrl (control) key modifier has been supplied. - /// - /// True if Ctrl modifier. - /// 3 - public bool IsCtrlModifier() - { - bool ret = NDalicPINVOKE.Wheel_IsCtrlModifier(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - /// - /// Checks to see if Alt key modifier has been supplied. - /// - /// True if Alt modifier. - /// 3 - public bool IsAltModifier() - { - bool ret = NDalicPINVOKE.Wheel_IsAltModifier(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - private Wheel.WheelType type { set @@ -356,23 +269,111 @@ namespace Tizen.NUI } } + /// - /// The type of the wheel event. + /// Checks to see if the Shift key modifier has been supplied. /// + /// True if Shift modifier. /// 3 - public enum WheelType + public bool IsShiftModifier() { - /// - /// Mouse wheel event. - /// - /// 3 - MouseWheel, + bool ret = NDalicPINVOKE.Wheel_IsShiftModifier(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } - /// - /// Custom wheel event. - /// - /// 3 - CustomWheel + /// + /// Checks to see if Ctrl (control) key modifier has been supplied. + /// + /// True if Ctrl modifier. + /// 3 + public bool IsCtrlModifier() + { + bool ret = NDalicPINVOKE.Wheel_IsCtrlModifier(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + /// + /// Checks to see if Alt key modifier has been supplied. + /// + /// True if Alt modifier. + /// 3 + public bool IsAltModifier() + { + bool ret = NDalicPINVOKE.Wheel_IsAltModifier(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + /// + /// Dispose. + /// + /// 3 + public void Dispose() + { + //Throw excpetion if Dispose() is called in separate thread. + if (!Window.IsInstalled()) + { + throw new System.InvalidOperationException("This API called from separate thread. This API must be called from MainThread."); + } + + if (isDisposeQueued) + { + Dispose(DisposeTypes.Implicit); + } + else + { + Dispose(DisposeTypes.Explicit); + System.GC.SuppressFinalize(this); + } + } + + internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Wheel obj) + { + return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; + } + + internal static Wheel GetWheelFromPtr(global::System.IntPtr cPtr) + { + Wheel ret = new Wheel(cPtr, false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + /// + /// Dispose. + /// + /// The type dispose, it could be from user, or called by DisposeQueue. + /// 3 + protected virtual void Dispose(DisposeTypes type) + { + if (disposed) + { + return; + } + + if (type == DisposeTypes.Explicit) + { + //Called by User + //Release your own managed resources here. + //You should release all of your own disposable objects here. + } + + //Release your own unmanaged resources here. + //You should not access any managed member here except static instance. + //because the execution order of Finalizes is non-deterministic. + + if (swigCPtr.Handle != global::System.IntPtr.Zero) + { + if (swigCMemOwn) + { + swigCMemOwn = false; + NDalicPINVOKE.delete_Wheel(swigCPtr); + } + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); + } + disposed = true; } } diff --git a/src/Tizen.NUI/src/public/Widget.cs b/src/Tizen.NUI/src/public/Widget.cs index cd4fc57..9ee703a 100755 --- a/src/Tizen.NUI/src/public/Widget.cs +++ b/src/Tizen.NUI/src/public/Widget.cs @@ -1,6 +1,6 @@ /* * Copyright (c) 2017 Samsung Electronics Co., Ltd. - *Z:\Desktop\shared\tizenfx\src\Tizen.NUI\src\public\BaseComponents\CustomView.cs + * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -25,8 +25,17 @@ namespace Tizen.NUI /// 4 public class Widget : BaseHandle { - private global::System.Runtime.InteropServices.HandleRef swigCPtr; internal WidgetImpl widgetImpl; + private global::System.Runtime.InteropServices.HandleRef swigCPtr; + + /// + /// Creates a Widget handle. + /// + /// 4 + public Widget() : this(new WidgetImpl(), true) + { + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } internal Widget(WidgetImpl widgetImpl, bool swigCMemOwn) : this(NDalicManualPINVOKE.Widget_New__SWIG_1(WidgetImpl.getCPtr(widgetImpl)), swigCMemOwn) { @@ -46,72 +55,6 @@ namespace Tizen.NUI swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); } - private void OnWidgetInstanceCreated(object sender, WidgetImpl.WIdgetInstanceOnCreateArgs e) - { - OnCreate(e.ContentInfo, e.Window); - } - - private void OnWidgetInstanceDestroyed(object sender, WidgetImpl.WIdgetInstanceOnDestroyArgs e) - { - OnTerminate(e.ContentInfo, e.TerminateType); - } - - private void OnWidgetInstancePaused(object sender, EventArgs e) - { - OnPause(); - } - - private void OnWidgetInstanceResumed(object sender, EventArgs e) - { - OnResume(); - } - - private void OnWidgetInstanceResized(object sender, WidgetImpl.WidgetInstanceOnResizeArgs e) - { - OnResize(e.Window); - } - - private void OnWidgetInstanceUpdated(object sender, WidgetImpl.WidgetInstanceOnUpdateArgs e) - { - OnUpdate(e.ContentInfo, e.Force); - } - - internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Widget obj) - { - return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; - } - - /// - /// Dispose. - /// - /// The dispose type - /// 4 - protected override void Dispose(DisposeTypes type) - { - if(disposed) - { - return; - } - - if(type == DisposeTypes.Explicit) - { - //Called by User - //Release your own managed resources here. - //You should release all of your own disposable objects here. - } - - if (swigCPtr.Handle != global::System.IntPtr.Zero) - { - if (swigCMemOwn) - { - swigCMemOwn = false; - NDalicManualPINVOKE.delete_Widget(swigCPtr); - } - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); - } - - base.Dispose(type); - } /// /// Enumeration for termination type of widget /// @@ -131,13 +74,24 @@ namespace Tizen.NUI } /// - /// Creates a Widget handle. + /// Set content info to WidgetView. /// + /// Content info is kind of context information which contains current status of widget. /// 4 - public Widget () : this (new WidgetImpl(), true) { - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } + public void SetContentInfo(string contentInfo) + { + widgetImpl.SetContentInfo(contentInfo); + } + internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Widget obj) + { + return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; + } + + internal System.IntPtr GetIntPtr() + { + return swigCPtr.Handle; + } internal Widget Assign(Widget widget) { Widget ret = new Widget(NDalicManualPINVOKE.Widget_Assign(swigCPtr, Widget.getCPtr(widget)), false); @@ -201,18 +155,65 @@ namespace Tizen.NUI } /// - /// Set content info to WidgetView. + /// Dispose. /// - /// Content info is kind of context information which contains current status of widget. + /// The dispose type /// 4 - public void SetContentInfo(string contentInfo) + protected override void Dispose(DisposeTypes type) { - widgetImpl.SetContentInfo(contentInfo); + if (disposed) + { + return; + } + + if (type == DisposeTypes.Explicit) + { + //Called by User + //Release your own managed resources here. + //You should release all of your own disposable objects here. + } + + if (swigCPtr.Handle != global::System.IntPtr.Zero) + { + if (swigCMemOwn) + { + swigCMemOwn = false; + NDalicManualPINVOKE.delete_Widget(swigCPtr); + } + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); + } + + base.Dispose(type); } - internal System.IntPtr GetIntPtr() + private void OnWidgetInstanceCreated(object sender, WidgetImpl.WIdgetInstanceOnCreateArgs e) { - return swigCPtr.Handle; + OnCreate(e.ContentInfo, e.Window); + } + + private void OnWidgetInstanceDestroyed(object sender, WidgetImpl.WIdgetInstanceOnDestroyArgs e) + { + OnTerminate(e.ContentInfo, e.TerminateType); + } + + private void OnWidgetInstancePaused(object sender, EventArgs e) + { + OnPause(); + } + + private void OnWidgetInstanceResumed(object sender, EventArgs e) + { + OnResume(); + } + + private void OnWidgetInstanceResized(object sender, WidgetImpl.WidgetInstanceOnResizeArgs e) + { + OnResize(e.Window); + } + + private void OnWidgetInstanceUpdated(object sender, WidgetImpl.WidgetInstanceOnUpdateArgs e) + { + OnUpdate(e.ContentInfo, e.Force); } } } diff --git a/src/Tizen.NUI/src/public/WidgetView.cs b/src/Tizen.NUI/src/public/WidgetView.cs index 10da2ef..4b7357f 100755 --- a/src/Tizen.NUI/src/public/WidgetView.cs +++ b/src/Tizen.NUI/src/public/WidgetView.cs @@ -39,97 +39,18 @@ namespace Tizen.NUI public class WidgetView : View { private global::System.Runtime.InteropServices.HandleRef swigCPtr; - - internal WidgetView(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicManualPINVOKE.WidgetView_SWIGUpcast(cPtr), cMemoryOwn) - { - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); - } - - internal static global::System.Runtime.InteropServices.HandleRef getCPtr(WidgetView obj) - { - return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; - } - - /// - /// To make the Button instance be disposed. - /// - /// 3 - protected override void Dispose(DisposeTypes type) - { - if (disposed) - { - return; - } - - if (type == DisposeTypes.Explicit) - { - //Called by User - //Release your own managed resources here. - //You should release all of your own disposable objects here. - - } - - //Release your own unmanaged resources here. - //You should not access any managed member here except static instance. - //because the execution order of Finalizes is non-deterministic. - - if (_widgetAddedEventCallback != null) - { - this.WidgetAddedSignal().Disconnect(_widgetAddedEventCallback); - } - - if (_widgetContentUpdatedEventCallback != null) - { - this.WidgetContentUpdatedSignal().Disconnect(_widgetContentUpdatedEventCallback); - } - - if (_widgetCreationAbortedEventCallback != null) - { - this.WidgetCreationAbortedSignal().Disconnect(_widgetCreationAbortedEventCallback); - } - - if (_widgetDeletedEventCallback != null) - { - this.WidgetDeletedSignal().Disconnect(_widgetDeletedEventCallback); - } - - if (_widgetFaultedEventCallback != null) - { - this.WidgetFaultedSignal().Disconnect(_widgetFaultedEventCallback); - } - - if (_widgetUpdatePeriodChangedEventCallback != null) - { - this.WidgetUpdatePeriodChangedSignal().Disconnect(_widgetUpdatePeriodChangedEventCallback); - } - - if (swigCPtr.Handle != global::System.IntPtr.Zero) - { - if (swigCMemOwn) - { - swigCMemOwn = false; - NDalicManualPINVOKE.delete_WidgetView(swigCPtr); - } - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); - } - base.Dispose(type); - } - - internal new class Property - { - internal static readonly int WIDGET_ID = NDalicManualPINVOKE.WidgetView_Property_WIDGET_ID_get(); - internal static readonly int INSTANCE_ID = NDalicManualPINVOKE.WidgetView_Property_INSTANCE_ID_get(); - internal static readonly int CONTENT_INFO = NDalicManualPINVOKE.WidgetView_Property_CONTENT_INFO_get(); - internal static readonly int TITLE = NDalicManualPINVOKE.WidgetView_Property_TITLE_get(); - internal static readonly int UPDATE_PERIOD = NDalicManualPINVOKE.WidgetView_Property_UPDATE_PERIOD_get(); - internal static readonly int PREVIEW = NDalicManualPINVOKE.WidgetView_Property_PREVIEW_get(); - internal static readonly int LOADING_TEXT = NDalicManualPINVOKE.WidgetView_Property_LOADING_TEXT_get(); - internal static readonly int WIDGET_STATE_FAULTED = NDalicManualPINVOKE.WidgetView_Property_WIDGET_STATE_FAULTED_get(); - internal static readonly int PERMANENT_DELETE = NDalicManualPINVOKE.WidgetView_Property_PERMANENT_DELETE_get(); - internal static readonly int RETRY_TEXT = NDalicManualPINVOKE.WidgetView_Property_RETRY_TEXT_get(); - internal static readonly int EFFECT = NDalicManualPINVOKE.WidgetView_Property_EFFECT_get(); - } - + private EventHandler _widgetAddedEventHandler; + private WidgetAddedEventCallbackType _widgetAddedEventCallback; + private EventHandler _widgetContentUpdatedEventHandler; + private WidgetContentUpdatedEventCallbackType _widgetContentUpdatedEventCallback; + private EventHandler _widgetDeletedEventHandler; + private WidgetDeletedEventCallbackType _widgetDeletedEventCallback; + private EventHandler _widgetCreationAbortedEventHandler; + private WidgetCreationAbortedEventCallbackType _widgetCreationAbortedEventCallback; + private EventHandler _widgetUpdatePeriodChangedEventHandler; + private WidgetUpdatePeriodChangedEventCallbackType _widgetUpdatePeriodChangedEventCallback; + private EventHandler _widgetFaultedEventHandler; + private WidgetFaultedEventCallbackType _widgetFaultedEventCallback; /// /// Creates a new WidgetView. /// @@ -140,61 +61,27 @@ namespace Tizen.NUI } - internal static WidgetView DownCast(BaseHandle handle) + internal WidgetView(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicManualPINVOKE.WidgetView_SWIGUpcast(cPtr), cMemoryOwn) { - WidgetView ret = new WidgetView(NDalicManualPINVOKE.WidgetView_DownCast(BaseHandle.getCPtr(handle)), true); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); } - internal WidgetView(WidgetView handle) : this(NDalicManualPINVOKE.new_WidgetView__SWIG_1(WidgetView.getCPtr(handle)), true) { if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } - internal WidgetView Assign(WidgetView handle) - { - WidgetView ret = new WidgetView(NDalicManualPINVOKE.WidgetView_Assign(swigCPtr, WidgetView.getCPtr(handle)), false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - internal static WidgetView GetWidgetViewFromPtr(global::System.IntPtr cPtr) - { - WidgetView ret = new WidgetView(cPtr, false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - /// - /// Event arguments of the widget view. - /// - /// 3 - public class WidgetViewEventArgs : EventArgs - { - private WidgetView _widgetView; - - /// - /// The widet view. - /// - /// 3 - public WidgetView WidgetView - { - get - { - return _widgetView; - } - set - { - _widgetView = value; - } - } - } - - private EventHandler _widgetAddedEventHandler; [UnmanagedFunctionPointer(CallingConvention.StdCall)] private delegate void WidgetAddedEventCallbackType(IntPtr data); - private WidgetAddedEventCallbackType _widgetAddedEventCallback; + [UnmanagedFunctionPointer(CallingConvention.StdCall)] + private delegate void WidgetContentUpdatedEventCallbackType(IntPtr data); + [UnmanagedFunctionPointer(CallingConvention.StdCall)] + private delegate void WidgetDeletedEventCallbackType(IntPtr data); + [UnmanagedFunctionPointer(CallingConvention.StdCall)] + private delegate void WidgetCreationAbortedEventCallbackType(IntPtr data); + [UnmanagedFunctionPointer(CallingConvention.StdCall)] + private delegate void WidgetUpdatePeriodChangedEventCallbackType(IntPtr data); + [UnmanagedFunctionPointer(CallingConvention.StdCall)] + private delegate void WidgetFaultedEventCallbackType(IntPtr data); /// /// An event for the ResourceReady signal which can be used to subscribe or unsubscribe the event handler.
@@ -226,26 +113,36 @@ namespace Tizen.NUI } } - // Callback for WidgetView WidgetAdded signal - private void OnWidgetAdded(IntPtr data) + /// + /// An event for the ResourceReady signal which can be used to subscribe or unsubscribe the event handler.
+ /// This signal is emitted after all resources required by a control are loaded and ready.
+ /// Most resources are only loaded when the control is placed on the stage.
+ ///
+ /// 3 + public event EventHandler WidgetContentUpdated { - WidgetViewEventArgs e = new WidgetViewEventArgs(); - if(data != null) + add { - e.WidgetView = WidgetView.GetWidgetViewFromPtr(data); + if (_widgetContentUpdatedEventHandler == null) + { + _widgetContentUpdatedEventCallback = OnWidgetContentUpdated; + WidgetContentUpdatedSignal().Connect(_widgetContentUpdatedEventCallback); + } + + _widgetContentUpdatedEventHandler += value; } - if (_widgetAddedEventHandler != null) + remove { - _widgetAddedEventHandler(this, e); + _widgetContentUpdatedEventHandler -= value; + + if (_widgetContentUpdatedEventHandler == null && WidgetContentUpdatedSignal().Empty() == false) + { + WidgetContentUpdatedSignal().Disconnect(_widgetContentUpdatedEventCallback); + } } } - private EventHandler _widgetDeletedEventHandler; - [UnmanagedFunctionPointer(CallingConvention.StdCall)] - private delegate void WidgetDeletedEventCallbackType(IntPtr data); - private WidgetDeletedEventCallbackType _widgetDeletedEventCallback; - /// /// An event for the ResourceReady signal which can be used to subscribe or unsubscribe the event handler.
/// This signal is emitted after all resources required by a control are loaded and ready.
@@ -276,26 +173,6 @@ namespace Tizen.NUI } } - // Callback for WidgetView WidgetDeleted signal - private void OnWidgetDeleted(IntPtr data) - { - WidgetViewEventArgs e = new WidgetViewEventArgs(); - if(data != null) - { - e.WidgetView = WidgetView.GetWidgetViewFromPtr(data); - } - - if (_widgetDeletedEventHandler != null) - { - _widgetDeletedEventHandler(this, e); - } - } - - private EventHandler _widgetCreationAbortedEventHandler; - [UnmanagedFunctionPointer(CallingConvention.StdCall)] - private delegate void WidgetCreationAbortedEventCallbackType(IntPtr data); - private WidgetCreationAbortedEventCallbackType _widgetCreationAbortedEventCallback; - /// /// An event for the ResourceReady signal which can be used to subscribe or unsubscribe the event handler.
/// This signal is emitted after all resources required by a control are loaded and ready.
@@ -326,168 +203,241 @@ namespace Tizen.NUI } } - // Callback for WidgetView WidgetCreationAborted signal - private void OnWidgetCreationAborted(IntPtr data) - { - WidgetViewEventArgs e = new WidgetViewEventArgs(); - if(data != null) - { - e.WidgetView = WidgetView.GetWidgetViewFromPtr(data); - } - - if (_widgetCreationAbortedEventHandler != null) - { - _widgetCreationAbortedEventHandler(this, e); - } - } - - private EventHandler _widgetContentUpdatedEventHandler; - [UnmanagedFunctionPointer(CallingConvention.StdCall)] - private delegate void WidgetContentUpdatedEventCallbackType(IntPtr data); - private WidgetContentUpdatedEventCallbackType _widgetContentUpdatedEventCallback; - /// /// An event for the ResourceReady signal which can be used to subscribe or unsubscribe the event handler.
/// This signal is emitted after all resources required by a control are loaded and ready.
/// Most resources are only loaded when the control is placed on the stage.
///
/// 3 - public event EventHandler WidgetContentUpdated + public event EventHandler WidgetUpdatePeriodChanged { add { - if (_widgetContentUpdatedEventHandler == null) + if (_widgetUpdatePeriodChangedEventHandler == null) { - _widgetContentUpdatedEventCallback = OnWidgetContentUpdated; - WidgetContentUpdatedSignal().Connect(_widgetContentUpdatedEventCallback); + _widgetUpdatePeriodChangedEventCallback = OnWidgetUpdatePeriodChanged; + WidgetUpdatePeriodChangedSignal().Connect(_widgetUpdatePeriodChangedEventCallback); } - _widgetContentUpdatedEventHandler += value; + _widgetUpdatePeriodChangedEventHandler += value; } remove { - _widgetContentUpdatedEventHandler -= value; + _widgetUpdatePeriodChangedEventHandler -= value; - if (_widgetContentUpdatedEventHandler == null && WidgetContentUpdatedSignal().Empty() == false) + if (_widgetUpdatePeriodChangedEventHandler == null && WidgetUpdatePeriodChangedSignal().Empty() == false) { - WidgetContentUpdatedSignal().Disconnect(_widgetContentUpdatedEventCallback); + WidgetUpdatePeriodChangedSignal().Disconnect(_widgetUpdatePeriodChangedEventCallback); } } } - // Callback for WidgetView WidgetContentUpdated signal - private void OnWidgetContentUpdated(IntPtr data) - { - WidgetViewEventArgs e = new WidgetViewEventArgs(); - if(data != null) - { - e.WidgetView = WidgetView.GetWidgetViewFromPtr(data); - } - - if (_widgetContentUpdatedEventHandler != null) - { - _widgetContentUpdatedEventHandler(this, e); - } - } - - private EventHandler _widgetUpdatePeriodChangedEventHandler; - [UnmanagedFunctionPointer(CallingConvention.StdCall)] - private delegate void WidgetUpdatePeriodChangedEventCallbackType(IntPtr data); - private WidgetUpdatePeriodChangedEventCallbackType _widgetUpdatePeriodChangedEventCallback; - /// /// An event for the ResourceReady signal which can be used to subscribe or unsubscribe the event handler.
/// This signal is emitted after all resources required by a control are loaded and ready.
/// Most resources are only loaded when the control is placed on the stage.
///
/// 3 - public event EventHandler WidgetUpdatePeriodChanged + public event EventHandler WidgetFaulted { add { - if (_widgetUpdatePeriodChangedEventHandler == null) + if (_widgetFaultedEventHandler == null) { - _widgetUpdatePeriodChangedEventCallback = OnWidgetUpdatePeriodChanged; - WidgetUpdatePeriodChangedSignal().Connect(_widgetUpdatePeriodChangedEventCallback); + _widgetFaultedEventCallback = OnWidgetFaulted; + WidgetFaultedSignal().Connect(_widgetFaultedEventCallback); } - _widgetUpdatePeriodChangedEventHandler += value; + _widgetFaultedEventHandler += value; } remove { - _widgetUpdatePeriodChangedEventHandler -= value; + _widgetFaultedEventHandler -= value; - if (_widgetUpdatePeriodChangedEventHandler == null && WidgetUpdatePeriodChangedSignal().Empty() == false) + if (_widgetFaultedEventHandler == null && WidgetFaultedSignal().Empty() == false) { - WidgetUpdatePeriodChangedSignal().Disconnect(_widgetUpdatePeriodChangedEventCallback); + WidgetFaultedSignal().Disconnect(_widgetFaultedEventCallback); } } } - // Callback for WidgetView WidgetUpdatePeriodChanged signal - private void OnWidgetUpdatePeriodChanged(IntPtr data) + /// + /// Gets the ID of the widget. + /// + /// 3 + public string WidgetID { - WidgetViewEventArgs e = new WidgetViewEventArgs(); - if(data != null) + get { - e.WidgetView = WidgetView.GetWidgetViewFromPtr(data); + string temp; + GetProperty(WidgetView.Property.WIDGET_ID).Get(out temp); + return temp; } + } - if (_widgetUpdatePeriodChangedEventHandler != null) + /// + /// Gets the ID of the instance. + /// + /// 3 + public string InstanceID + { + get { - _widgetUpdatePeriodChangedEventHandler(this, e); + string temp; + GetProperty(WidgetView.Property.INSTANCE_ID).Get(out temp); + return temp; } } - private EventHandler _widgetFaultedEventHandler; - [UnmanagedFunctionPointer(CallingConvention.StdCall)] - private delegate void WidgetFaultedEventCallbackType(IntPtr data); - private WidgetFaultedEventCallbackType _widgetFaultedEventCallback; + /// + /// Gets the content info. + /// + /// 3 + public string ContentInfo + { + get + { + string temp; + GetProperty(WidgetView.Property.CONTENT_INFO).Get(out temp); + return temp; + } + } /// - /// An event for the ResourceReady signal which can be used to subscribe or unsubscribe the event handler.
- /// This signal is emitted after all resources required by a control are loaded and ready.
- /// Most resources are only loaded when the control is placed on the stage.
+ /// Gets the title. ///
/// 3 - public event EventHandler WidgetFaulted + public string Title { - add + get { - if (_widgetFaultedEventHandler == null) - { - _widgetFaultedEventCallback = OnWidgetFaulted; - WidgetFaultedSignal().Connect(_widgetFaultedEventCallback); - } + string temp; + GetProperty(WidgetView.Property.TITLE).Get(out temp); + return temp; + } + } - _widgetFaultedEventHandler += value; + /// + /// Gets the update peroid. + /// + /// 3 + public float UpdatePeriod + { + get + { + float temp; + GetProperty(WidgetView.Property.UPDATE_PERIOD).Get(out temp); + return temp; } + } - remove + /// + /// Gets or sets the preview. + /// + /// 3 + public bool Preview + { + get { - _widgetFaultedEventHandler -= value; + bool temp; + GetProperty(WidgetView.Property.PREVIEW).Get(out temp); + return temp; + } + set + { + SetProperty(WidgetView.Property.PREVIEW, new Tizen.NUI.PropertyValue(value)); + } + } - if (_widgetFaultedEventHandler == null && WidgetFaultedSignal().Empty() == false) - { - WidgetFaultedSignal().Disconnect(_widgetFaultedEventCallback); - } + /// + /// Gets or sets the loading text. + /// + /// 3 + public bool LoadingText + { + get + { + bool temp; + GetProperty(WidgetView.Property.LOADING_TEXT).Get(out temp); + return temp; + } + set + { + SetProperty(WidgetView.Property.LOADING_TEXT, new Tizen.NUI.PropertyValue(value)); } } - // Callback for WidgetView WidgetFaulted signal - private void OnWidgetFaulted(IntPtr data) + /// + /// Gets or sets whether the widget state is faulted or not. + /// + /// 3 + public bool WidgetStateFaulted { - WidgetViewEventArgs e = new WidgetViewEventArgs(); - if(data != null) + get { - e.WidgetView = WidgetView.GetWidgetViewFromPtr(data); + bool temp; + GetProperty(WidgetView.Property.WIDGET_STATE_FAULTED).Get(out temp); + return temp; } + set + { + SetProperty(WidgetView.Property.WIDGET_STATE_FAULTED, new Tizen.NUI.PropertyValue(value)); + } + } - if (_widgetFaultedEventHandler != null) + /// + /// Gets or sets whether the widget is to delete permanently or not. + /// + /// 3 + public bool PermanentDelete + { + get { - _widgetFaultedEventHandler(this, e); + bool temp; + GetProperty(WidgetView.Property.PERMANENT_DELETE).Get(out temp); + return temp; + } + set + { + SetProperty(WidgetView.Property.PERMANENT_DELETE, new Tizen.NUI.PropertyValue(value)); + } + } + + /// + /// Gets or sets retry text. + /// + /// 4 + public PropertyMap RetryText + { + get + { + PropertyMap temp = new PropertyMap(); + GetProperty(WidgetView.Property.RETRY_TEXT).Get(temp); + return temp; + } + set + { + SetProperty(WidgetView.Property.RETRY_TEXT, new Tizen.NUI.PropertyValue(value)); + } + } + + /// + /// Gets or sets effect. + /// + /// 4 + public PropertyMap Effect + { + get + { + PropertyMap temp = new PropertyMap(); + GetProperty(WidgetView.Property.EFFECT).Get(temp); + return temp; + } + set + { + SetProperty(WidgetView.Property.EFFECT, new Tizen.NUI.PropertyValue(value)); } } @@ -518,7 +468,7 @@ namespace Tizen.NUI /// /// Cancels the touch event procedure. /// If you call this function after feed the touch down event, the widget will get ON_HOLD events. - /// If a widget gets ON_HOLD event, it will not do anything even if you feed touch up event. + /// If a widget gets ON_HOLD event, it will not do anything even if you feed touch up event. /// /// True on success, false otherwise. /// 3 @@ -552,6 +502,32 @@ namespace Tizen.NUI return ret; } + internal static WidgetView DownCast(BaseHandle handle) + { + WidgetView ret = new WidgetView(NDalicManualPINVOKE.WidgetView_DownCast(BaseHandle.getCPtr(handle)), true); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + internal static WidgetView GetWidgetViewFromPtr(global::System.IntPtr cPtr) + { + WidgetView ret = new WidgetView(cPtr, false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + internal static global::System.Runtime.InteropServices.HandleRef getCPtr(WidgetView obj) + { + return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; + } + + internal WidgetView Assign(WidgetView handle) + { + WidgetView ret = new WidgetView(NDalicManualPINVOKE.WidgetView_Assign(swigCPtr, WidgetView.getCPtr(handle)), false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + internal WidgetViewSignal WidgetAddedSignal() { WidgetViewSignal ret = new WidgetViewSignal(NDalicManualPINVOKE.WidgetView_WidgetAddedSignal(swigCPtr), false); @@ -595,183 +571,202 @@ namespace Tizen.NUI } /// - /// Gets the ID of the widget. + /// To make the Button instance be disposed. /// /// 3 - public string WidgetID + protected override void Dispose(DisposeTypes type) { - get + if (disposed) { - string temp; - GetProperty(WidgetView.Property.WIDGET_ID).Get(out temp); - return temp; + return; } - } - /// - /// Gets the ID of the instance. - /// - /// 3 - public string InstanceID - { - get + if (type == DisposeTypes.Explicit) { - string temp; - GetProperty(WidgetView.Property.INSTANCE_ID).Get(out temp); - return temp; + //Called by User + //Release your own managed resources here. + //You should release all of your own disposable objects here. + } - } - /// - /// Gets the content info. - /// - /// 3 - public string ContentInfo - { - get + //Release your own unmanaged resources here. + //You should not access any managed member here except static instance. + //because the execution order of Finalizes is non-deterministic. + + if (_widgetAddedEventCallback != null) { - string temp; - GetProperty(WidgetView.Property.CONTENT_INFO).Get(out temp); - return temp; + this.WidgetAddedSignal().Disconnect(_widgetAddedEventCallback); } - } - /// - /// Gets the title. - /// - /// 3 - public string Title - { - get + if (_widgetContentUpdatedEventCallback != null) { - string temp; - GetProperty(WidgetView.Property.TITLE).Get(out temp); - return temp; + this.WidgetContentUpdatedSignal().Disconnect(_widgetContentUpdatedEventCallback); } + + if (_widgetCreationAbortedEventCallback != null) + { + this.WidgetCreationAbortedSignal().Disconnect(_widgetCreationAbortedEventCallback); + } + + if (_widgetDeletedEventCallback != null) + { + this.WidgetDeletedSignal().Disconnect(_widgetDeletedEventCallback); + } + + if (_widgetFaultedEventCallback != null) + { + this.WidgetFaultedSignal().Disconnect(_widgetFaultedEventCallback); + } + + if (_widgetUpdatePeriodChangedEventCallback != null) + { + this.WidgetUpdatePeriodChangedSignal().Disconnect(_widgetUpdatePeriodChangedEventCallback); + } + + if (swigCPtr.Handle != global::System.IntPtr.Zero) + { + if (swigCMemOwn) + { + swigCMemOwn = false; + NDalicManualPINVOKE.delete_WidgetView(swigCPtr); + } + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); + } + base.Dispose(type); } - /// - /// Gets the update peroid. - /// - /// 3 - public float UpdatePeriod + + // Callback for WidgetView WidgetAdded signal + private void OnWidgetAdded(IntPtr data) { - get + WidgetViewEventArgs e = new WidgetViewEventArgs(); + if(data != null) { - float temp; - GetProperty(WidgetView.Property.UPDATE_PERIOD).Get(out temp); - return temp; + e.WidgetView = WidgetView.GetWidgetViewFromPtr(data); + } + + if (_widgetAddedEventHandler != null) + { + _widgetAddedEventHandler(this, e); } } - /// - /// Gets or sets the preview. - /// - /// 3 - public bool Preview + // Callback for WidgetView WidgetDeleted signal + private void OnWidgetDeleted(IntPtr data) { - get + WidgetViewEventArgs e = new WidgetViewEventArgs(); + if (data != null) { - bool temp; - GetProperty(WidgetView.Property.PREVIEW).Get(out temp); - return temp; + e.WidgetView = WidgetView.GetWidgetViewFromPtr(data); } - set + + if (_widgetDeletedEventHandler != null) { - SetProperty(WidgetView.Property.PREVIEW, new Tizen.NUI.PropertyValue(value)); + _widgetDeletedEventHandler(this, e); } } - /// - /// Gets or sets the loading text. - /// - /// 3 - public bool LoadingText + // Callback for WidgetView WidgetCreationAborted signal + private void OnWidgetCreationAborted(IntPtr data) { - get + WidgetViewEventArgs e = new WidgetViewEventArgs(); + if (data != null) { - bool temp; - GetProperty(WidgetView.Property.LOADING_TEXT).Get(out temp); - return temp; + e.WidgetView = WidgetView.GetWidgetViewFromPtr(data); } - set + + if (_widgetCreationAbortedEventHandler != null) { - SetProperty(WidgetView.Property.LOADING_TEXT, new Tizen.NUI.PropertyValue(value)); + _widgetCreationAbortedEventHandler(this, e); } } - /// - /// Gets or sets whether the widget state is faulted or not. - /// - /// 3 - public bool WidgetStateFaulted + + + // Callback for WidgetView WidgetContentUpdated signal + private void OnWidgetContentUpdated(IntPtr data) { - get + WidgetViewEventArgs e = new WidgetViewEventArgs(); + if (data != null) { - bool temp; - GetProperty(WidgetView.Property.WIDGET_STATE_FAULTED).Get(out temp); - return temp; + e.WidgetView = WidgetView.GetWidgetViewFromPtr(data); } - set + + if (_widgetContentUpdatedEventHandler != null) { - SetProperty(WidgetView.Property.WIDGET_STATE_FAULTED, new Tizen.NUI.PropertyValue(value)); + _widgetContentUpdatedEventHandler(this, e); } } - /// - /// Gets or sets whether the widget is to delete permanently or not. - /// - /// 3 - public bool PermanentDelete + // Callback for WidgetView WidgetUpdatePeriodChanged signal + private void OnWidgetUpdatePeriodChanged(IntPtr data) { - get + WidgetViewEventArgs e = new WidgetViewEventArgs(); + if (data != null) { - bool temp; - GetProperty(WidgetView.Property.PERMANENT_DELETE).Get(out temp); - return temp; + e.WidgetView = WidgetView.GetWidgetViewFromPtr(data); } - set + + if (_widgetUpdatePeriodChangedEventHandler != null) { - SetProperty(WidgetView.Property.PERMANENT_DELETE, new Tizen.NUI.PropertyValue(value)); + _widgetUpdatePeriodChangedEventHandler(this, e); } } - /// - /// Gets or sets retry text. - /// - /// 4 - public PropertyMap RetryText + // Callback for WidgetView WidgetFaulted signal + private void OnWidgetFaulted(IntPtr data) { - get + WidgetViewEventArgs e = new WidgetViewEventArgs(); + if(data != null) { - PropertyMap temp = new PropertyMap(); - GetProperty(WidgetView.Property.RETRY_TEXT).Get(temp); - return temp; + e.WidgetView = WidgetView.GetWidgetViewFromPtr(data); } - set + + if (_widgetFaultedEventHandler != null) { - SetProperty(WidgetView.Property.RETRY_TEXT, new Tizen.NUI.PropertyValue(value)); + _widgetFaultedEventHandler(this, e); } } /// - /// Gets or sets effect. + /// Event arguments of the widget view. /// - /// 4 - public PropertyMap Effect + /// 3 + public class WidgetViewEventArgs : EventArgs { - get - { - PropertyMap temp = new PropertyMap(); - GetProperty(WidgetView.Property.EFFECT).Get(temp); - return temp; - } - set + private WidgetView _widgetView; + + /// + /// The widet view. + /// + /// 3 + public WidgetView WidgetView { - SetProperty(WidgetView.Property.EFFECT, new Tizen.NUI.PropertyValue(value)); + get + { + return _widgetView; + } + set + { + _widgetView = value; + } } } + internal new class Property + { + internal static readonly int WIDGET_ID = NDalicManualPINVOKE.WidgetView_Property_WIDGET_ID_get(); + internal static readonly int INSTANCE_ID = NDalicManualPINVOKE.WidgetView_Property_INSTANCE_ID_get(); + internal static readonly int CONTENT_INFO = NDalicManualPINVOKE.WidgetView_Property_CONTENT_INFO_get(); + internal static readonly int TITLE = NDalicManualPINVOKE.WidgetView_Property_TITLE_get(); + internal static readonly int UPDATE_PERIOD = NDalicManualPINVOKE.WidgetView_Property_UPDATE_PERIOD_get(); + internal static readonly int PREVIEW = NDalicManualPINVOKE.WidgetView_Property_PREVIEW_get(); + internal static readonly int LOADING_TEXT = NDalicManualPINVOKE.WidgetView_Property_LOADING_TEXT_get(); + internal static readonly int WIDGET_STATE_FAULTED = NDalicManualPINVOKE.WidgetView_Property_WIDGET_STATE_FAULTED_get(); + internal static readonly int PERMANENT_DELETE = NDalicManualPINVOKE.WidgetView_Property_PERMANENT_DELETE_get(); + internal static readonly int RETRY_TEXT = NDalicManualPINVOKE.WidgetView_Property_RETRY_TEXT_get(); + internal static readonly int EFFECT = NDalicManualPINVOKE.WidgetView_Property_EFFECT_get(); + } } } diff --git a/src/Tizen.NUI/src/public/WidgetViewManager.cs b/src/Tizen.NUI/src/public/WidgetViewManager.cs index 85247d5..f7899eb 100755 --- a/src/Tizen.NUI/src/public/WidgetViewManager.cs +++ b/src/Tizen.NUI/src/public/WidgetViewManager.cs @@ -37,28 +37,72 @@ namespace Tizen.NUI { private global::System.Runtime.InteropServices.HandleRef swigCPtr; + /// + /// Creates a new widgetView manager object. + /// + /// 3 + public WidgetViewManager(NUIApplication nuiApplication, string appId) : this(NDalicManualPINVOKE.WidgetViewManager_New(Application.getCPtr(nuiApplication.ApplicationHandle), appId), true) + { + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } internal WidgetViewManager(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicManualPINVOKE.WidgetViewManager_SWIGUpcast(cPtr), cMemoryOwn) { swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); } + /// + /// Creates a new widget view object. + /// + /// The widget ID. + /// Contents that will be given to the widget instance. + /// The widget width. + /// The widget height. + /// The period of updating contents of the widget. + /// A handle to WidgetView. + /// 3 + public WidgetView AddWidget(string widgetId, string contentInfo, int width, int height, float updatePeriod) + { + WidgetView ret = new WidgetView(NDalicManualPINVOKE.WidgetViewManager_AddWidget(swigCPtr, widgetId, contentInfo, width, height, updatePeriod), true); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + internal static global::System.Runtime.InteropServices.HandleRef getCPtr(WidgetViewManager obj) { return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; } + internal static WidgetViewManager DownCast(BaseHandle handle) + { + WidgetViewManager ret = new WidgetViewManager(NDalicManualPINVOKE.WidgetViewManager_DownCast(BaseHandle.getCPtr(handle)), true); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + internal WidgetViewManager(WidgetViewManager handle) : this(NDalicManualPINVOKE.new_WidgetViewManager__SWIG_1(WidgetViewManager.getCPtr(handle)), true) + { + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + internal WidgetViewManager Assign(WidgetViewManager handle) + { + WidgetViewManager ret = new WidgetViewManager(NDalicManualPINVOKE.WidgetViewManager_Assign(swigCPtr, WidgetViewManager.getCPtr(handle)), false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + /// /// To make WidgetViewManager instance be disposed. /// /// 3 protected override void Dispose(DisposeTypes type) { - if(disposed) + if (disposed) { return; } - if(type == DisposeTypes.Explicit) + if (type == DisposeTypes.Explicit) { //Called by User //Release your own managed resources here. @@ -80,51 +124,6 @@ namespace Tizen.NUI base.Dispose(type); } - /// - /// Creates a new widgetView manager object. - /// - /// 3 - public WidgetViewManager(NUIApplication nuiApplication, string appId) : this(NDalicManualPINVOKE.WidgetViewManager_New(Application.getCPtr(nuiApplication.ApplicationHandle), appId), true) - { - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - internal static WidgetViewManager DownCast(BaseHandle handle) - { - WidgetViewManager ret = new WidgetViewManager(NDalicManualPINVOKE.WidgetViewManager_DownCast(BaseHandle.getCPtr(handle)), true); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - internal WidgetViewManager(WidgetViewManager handle) : this(NDalicManualPINVOKE.new_WidgetViewManager__SWIG_1(WidgetViewManager.getCPtr(handle)), true) - { - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - internal WidgetViewManager Assign(WidgetViewManager handle) - { - WidgetViewManager ret = new WidgetViewManager(NDalicManualPINVOKE.WidgetViewManager_Assign(swigCPtr, WidgetViewManager.getCPtr(handle)), false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - /// - /// Creates a new widget view object. - /// - /// The widget ID. - /// Contents that will be given to the widget instance. - /// The widget width. - /// The widget height. - /// The period of updating contents of the widget. - /// A handle to WidgetView. - /// 3 - public WidgetView AddWidget(string widgetId, string contentInfo, int width, int height, float updatePeriod) - { - WidgetView ret = new WidgetView(NDalicManualPINVOKE.WidgetViewManager_AddWidget(swigCPtr, widgetId, contentInfo, width, height, updatePeriod), true); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - } } \ No newline at end of file diff --git a/src/Tizen.NUI/src/public/Window.cs b/src/Tizen.NUI/src/public/Window.cs index 3a8a2b2..e87a41c 100755 --- a/src/Tizen.NUI/src/public/Window.cs +++ b/src/Tizen.NUI/src/public/Window.cs @@ -34,15 +34,24 @@ namespace Tizen.NUI private readonly global::System.Runtime.InteropServices.HandleRef rootLayoutCPtr; private Layer _rootLayer; private string _windowTitle; + private readonly LayoutItem rootLayoutItem; private List _childLayers = new List(); - internal List LayersChildren - { - get - { - return _childLayers; - } - } + private WindowFocusChangedEventCallbackType _windowFocusChangedEventCallback; + private RootLayerTouchDataCallbackType _rootLayerTouchDataCallback; + private WheelEventCallbackType _wheelEventCallback; + private EventCallbackDelegateType1 _stageKeyCallbackDelegate; + private EventCallbackDelegateType0 _stageEventProcessingFinishedEventCallbackDelegate; + private EventHandler _stageContextLostEventHandler; + private EventCallbackDelegateType0 _stageContextLostEventCallbackDelegate; + private EventHandler _stageContextRegainedEventHandler; + private EventCallbackDelegateType0 _stageContextRegainedEventCallbackDelegate; + private EventHandler _stageSceneCreatedEventHandler; + private EventCallbackDelegateType0 _stageSceneCreatedEventCallbackDelegate; + private WindowResizedEventCallbackType _windowResizedEventCallback; + private WindowFocusChangedEventCallbackType _windowFocusChangedEventCallback2; + + private static readonly Window instance = Application.Instance.GetWindow(); internal Window(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.Window_SWIGUpcast(cPtr), cMemoryOwn) { @@ -59,185 +68,388 @@ namespace Tizen.NUI Layer rootLayer = GetRootLayer(); // Add the root layout created above to the root layer. NDalicPINVOKE.Actor_Add( Layer.getCPtr(rootLayer), rootLayoutCPtr ); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + + global::System.IntPtr rootControlLayoutIntPtr = Tizen.NUI.NDalicManualPINVOKE.GetLayout__SWIG_1(rootLayoutCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + + rootLayoutItem = new LayoutItem(rootControlLayoutIntPtr, true); } } - internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Window obj) + internal Window(Rectangle windowPosition, string name, bool isTransparent) : this(NDalicPINVOKE.Window_New__SWIG_0(Rectangle.getCPtr(windowPosition), name, isTransparent), true) { - return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } - internal static Window GetCurrent() + internal Window(Rectangle windowPosition, string name) : this(NDalicPINVOKE.Window_New__SWIG_1(Rectangle.getCPtr(windowPosition), name), true) { - Window ret = new Window(NDalicPINVOKE.Stage_GetCurrent(), true); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; } - internal static bool IsInstalled() + internal Window(Rectangle windowPosition, string name, string className, bool isTransparent) : this(NDalicPINVOKE.Window_New__SWIG_2(Rectangle.getCPtr(windowPosition), name, className, isTransparent), true) { - bool ret = NDalicPINVOKE.Stage_IsInstalled(); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; } - /// - /// Sets whether the window accepts a focus or not. - /// - /// If a focus is accepted or not. The default is true. - /// 3 - public void SetAcceptFocus(bool accept) + internal Window(Rectangle windowPosition, string name, string className) : this(NDalicPINVOKE.Window_New__SWIG_3(Rectangle.getCPtr(windowPosition), name, className), true) { - NDalicPINVOKE.SetAcceptFocus(swigCPtr, accept); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } + [UnmanagedFunctionPointer(CallingConvention.StdCall)] + private delegate void WindowFocusChangedEventCallbackType(bool focusGained); + [UnmanagedFunctionPointer(CallingConvention.StdCall)] + private delegate bool RootLayerTouchDataCallbackType(IntPtr view, IntPtr touchData); + [UnmanagedFunctionPointer(CallingConvention.StdCall)] + private delegate bool WheelEventCallbackType(IntPtr view, IntPtr wheelEvent); + [UnmanagedFunctionPointer(CallingConvention.StdCall)] + private delegate void WindowResizedEventCallbackType(IntPtr windowSize); + [UnmanagedFunctionPointer(CallingConvention.StdCall)] + private delegate void WindowFocusChangedEventCallbackType2(bool focusGained); + /// - /// Returns whether the window accepts a focus or not. + /// FocusChanged event. /// - /// True if the window accepts a focus, false otherwise. /// 3 - public bool IsFocusAcceptable() + public event EventHandler FocusChanged { - bool ret = NDalicPINVOKE.IsFocusAcceptable(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + add + { + if (_windowFocusChangedEventHandler == null) + { + _windowFocusChangedEventCallback = OnWindowFocusedChanged; + WindowFocusChangedSignal().Connect(_windowFocusChangedEventCallback); + } - return ret; - } + _windowFocusChangedEventHandler += value; + } + remove + { + _windowFocusChangedEventHandler -= value; - /// - /// Shows the window if it is hidden. - /// - /// 3 - public void Show() - { - NDalicPINVOKE.Show(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + if (_windowFocusChangedEventHandler == null && WindowFocusChangedSignal().Empty() == false && _windowFocusChangedEventCallback != null) + { + WindowFocusChangedSignal().Disconnect(_windowFocusChangedEventCallback); + } + } } /// - /// Hides the window if it is showing. + /// This event is emitted when the screen is touched and when the touch ends.
+ /// If there are multiple touch points, then this will be emitted when the first touch occurs and + /// then when the last finger is lifted.
+ /// An interrupted event will also be emitted (if it occurs).
///
/// 3 - public void Hide() + public event EventHandler TouchEvent { - NDalicPINVOKE.Hide(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + add + { + if (_rootLayerTouchDataEventHandler == null) + { + _rootLayerTouchDataCallback = OnWindowTouch; + this.TouchDataSignal().Connect(_rootLayerTouchDataCallback); + } + _rootLayerTouchDataEventHandler += value; + } + remove + { + _rootLayerTouchDataEventHandler -= value; + if (_rootLayerTouchDataEventHandler == null && TouchSignal().Empty() == false) + { + this.TouchDataSignal().Disconnect(_rootLayerTouchDataCallback); + } + } } /// - /// Retrieves whether the window is visible or not. + /// This event is emitted when the wheel event is received. /// - /// True if the window is visible. /// 3 - public bool IsVisible() + public event EventHandler WheelEvent { - bool temp = NDalicPINVOKE.IsVisible(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return temp; + add + { + if (_stageWheelHandler == null) + { + _wheelEventCallback = OnStageWheel; + this.StageWheelEventSignal().Connect(_wheelEventCallback); + } + _stageWheelHandler += value; + } + remove + { + _stageWheelHandler -= value; + if (_stageWheelHandler == null && StageWheelEventSignal().Empty() == false) + { + this.StageWheelEventSignal().Disconnect(_wheelEventCallback); + } + } } /// - /// Gets the count of supported auxiliary hints of the window. + /// This event is emitted when the key event is received. /// - /// The number of supported auxiliary hints. /// 3 - public uint GetSupportedAuxiliaryHintCount() + public event EventHandler KeyEvent { - uint ret = NDalicPINVOKE.GetSupportedAuxiliaryHintCount(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; + add + { + if (_stageKeyHandler == null) + { + _stageKeyCallbackDelegate = OnStageKey; + KeyEventSignal().Connect(_stageKeyCallbackDelegate); + } + _stageKeyHandler += value; + } + remove + { + _stageKeyHandler -= value; + if (_stageKeyHandler == null && KeyEventSignal().Empty() == false) + { + KeyEventSignal().Disconnect(_stageKeyCallbackDelegate); + } + } } /// - /// Gets the supported auxiliary hint string of the window. + /// This event is emitted when the window resized. /// - /// The index of the supported auxiliary hint lists. - /// The auxiliary hint string of the index. /// 3 - public string GetSupportedAuxiliaryHint(uint index) + public event EventHandler Resized { - string ret = NDalicPINVOKE.GetSupportedAuxiliaryHint(swigCPtr, index); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } + add + { + if (_windowResizedEventHandler == null) + { + _windowResizedEventCallback = OnResized; + ResizedSignal().Connect(_windowResizedEventCallback); + } - /// - /// Creates an auxiliary hint of the window. - /// - /// The auxiliary hint string. - /// The value string. - /// The ID of created auxiliary hint, or 0 on failure. - /// 3 - public uint AddAuxiliaryHint(string hint, string value) - { - uint ret = NDalicPINVOKE.AddAuxiliaryHint(swigCPtr, hint, value); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } + _windowResizedEventHandler += value; + } + remove + { + _windowResizedEventHandler -= value; - /// - /// Removes an auxiliary hint of the window. - /// - /// The ID of the auxiliary hint. - /// True if no error occurred, false otherwise. - /// 3 - public bool RemoveAuxiliaryHint(uint id) - { - bool ret = NDalicPINVOKE.RemoveAuxiliaryHint(swigCPtr, id); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; + if (_windowResizedEventHandler == null && ResizedSignal().Empty() == false && _windowResizedEventCallback != null) + { + ResizedSignal().Disconnect(_windowResizedEventCallback); + } + } } /// - /// Changes a value of the auxiliary hint. + /// Please do not use! this will be deprecated. Please use 'FocusChanged' event instead. /// - /// The auxiliary hint ID. - /// The value string to be set. - /// True if no error occurred, false otherwise. /// 3 - public bool SetAuxiliaryHintValue(uint id, string value) + /// Please do not use! this will be deprecated! + /// Instead please use FocusChanged. + [Obsolete("Please do not use! This will be deprecated! Please use FocusChanged instead! " + + "Like: " + + "Window.Instance.FocusChanged = OnFocusChanged; " + + "private void OnFocusChanged(object source, Window.FocusChangedEventArgs args) {...}")] + [EditorBrowsable(EditorBrowsableState.Never)] + public event EventHandler WindowFocusChanged { - bool ret = NDalicPINVOKE.SetAuxiliaryHintValue(swigCPtr, id, value); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; + add + { + if (_windowFocusChangedEventHandler2 == null) + { + _windowFocusChangedEventCallback2 = OnWindowFocusedChanged2; + WindowFocusChangedSignal().Connect(_windowFocusChangedEventCallback2); + } + + _windowFocusChangedEventHandler2 += value; + } + remove + { + _windowFocusChangedEventHandler2 -= value; + + if (_windowFocusChangedEventHandler2 == null && WindowFocusChangedSignal().Empty() == false && _windowFocusChangedEventCallback2 != null) + { + WindowFocusChangedSignal().Disconnect(_windowFocusChangedEventCallback2); + } + } } - /// - /// Gets a value of the auxiliary hint. + internal event EventHandler EventProcessingFinished + { + add + { + if (_stageEventProcessingFinishedEventHandler == null) + { + _stageEventProcessingFinishedEventCallbackDelegate = OnEventProcessingFinished; + EventProcessingFinishedSignal().Connect(_stageEventProcessingFinishedEventCallbackDelegate); + } + _stageEventProcessingFinishedEventHandler += value; + + } + remove + { + _stageEventProcessingFinishedEventHandler -= value; + if (_stageEventProcessingFinishedEventHandler == null && EventProcessingFinishedSignal().Empty() == false) + { + EventProcessingFinishedSignal().Disconnect(_stageEventProcessingFinishedEventCallbackDelegate); + } + } + } + + internal event EventHandler ContextLost + { + add + { + if (_stageContextLostEventHandler == null) + { + _stageContextLostEventCallbackDelegate = OnContextLost; + ContextLostSignal().Connect(_stageContextLostEventCallbackDelegate); + } + _stageContextLostEventHandler += value; + } + remove + { + _stageContextLostEventHandler -= value; + if (_stageContextLostEventHandler == null && ContextLostSignal().Empty() == false) + { + ContextLostSignal().Disconnect(_stageContextLostEventCallbackDelegate); + } + } + } + + internal event EventHandler ContextRegained + { + add + { + if (_stageContextRegainedEventHandler == null) + { + _stageContextRegainedEventCallbackDelegate = OnContextRegained; + ContextRegainedSignal().Connect(_stageContextRegainedEventCallbackDelegate); + } + _stageContextRegainedEventHandler += value; + } + remove + { + _stageContextRegainedEventHandler -= value; + if (_stageContextRegainedEventHandler == null && ContextRegainedSignal().Empty() == false) + { + this.ContextRegainedSignal().Disconnect(_stageContextRegainedEventCallbackDelegate); + } + } + } + + internal event EventHandler SceneCreated + { + add + { + if (_stageSceneCreatedEventHandler == null) + { + _stageSceneCreatedEventCallbackDelegate = OnSceneCreated; + SceneCreatedSignal().Connect(_stageSceneCreatedEventCallbackDelegate); + } + _stageSceneCreatedEventHandler += value; + } + remove + { + _stageSceneCreatedEventHandler -= value; + if (_stageSceneCreatedEventHandler == null && SceneCreatedSignal().Empty() == false) + { + SceneCreatedSignal().Disconnect(_stageSceneCreatedEventCallbackDelegate); + } + } + } + + private event EventHandler _windowFocusChangedEventHandler; + private event EventHandler _rootLayerTouchDataEventHandler; + private event EventHandler _stageWheelHandler; + private event EventHandler _stageKeyHandler; + private event EventHandler _stageEventProcessingFinishedEventHandler; + private event EventHandler _windowResizedEventHandler; + private event EventHandler _windowFocusChangedEventHandler2; + + /// + /// Enumeration for orientation of the window is the way in which a rectangular page is oriented for normal viewing. /// - /// The auxiliary hint ID. - /// The string value of the auxiliary hint ID, or an empty string if none exists. /// 3 - public string GetAuxiliaryHintValue(uint id) + public enum WindowOrientation { - string ret = NDalicPINVOKE.GetAuxiliaryHintValue(swigCPtr, id); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; + /// + /// Portrait orientation. The height of the display area is greater than the width. + /// + /// 3 + Portrait = 0, + /// + /// Landscape orientation. A wide view area is needed. + /// + /// 3 + Landscape = 90, + /// + /// Portrait inverse orientation. + /// + /// 3 + PortraitInverse = 180, + /// + /// Landscape inverse orientation. + /// + /// 3 + LandscapeInverse = 270 } /// - /// Gets an ID of the auxiliary hint string. + /// Enumeration for the key grab mode for platform-level APIs. /// - /// The auxiliary hint string. - /// The ID of auxiliary hint string, or 0 on failure. /// 3 - public uint GetAuxiliaryHintId(string hint) + public enum KeyGrabMode { - uint ret = NDalicPINVOKE.GetAuxiliaryHintId(swigCPtr, hint); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; + /// + /// Grabs a key only when on the top of the grabbing-window stack mode. + /// + Topmost = 0, + /// + /// Grabs a key together with the other client window(s) mode. + /// + Shared, + /// + /// Grabs a key exclusively regardless of the grabbing-window's position on the window stack with the possibility of overriding the grab by the other client window mode. + /// + OverrideExclusive, + /// + /// Grabs a key exclusively regardless of the grabbing-window's position on the window stack mode. + /// + Exclusive + }; + + /// + /// Enumeration for opacity of the indicator. + /// + internal enum IndicatorBackgroundOpacity + { + Opaque = 100, + Translucent = 50, + Transparent = 0 } /// - /// Sets a region to accept input events. + /// Enumeration for visible mode of the indicator. + /// + internal enum IndicatorVisibleMode + { + Invisible = 0, + Visible = 1, + Auto = 2 + } + + /// + /// The stage instance property (read-only).
+ /// Gets the current window.
///
- /// The region to accept input events. /// 3 - public void SetInputRegion(Rectangle inputRegion) + public static Window Instance { - NDalicPINVOKE.SetInputRegion(swigCPtr, Rectangle.getCPtr(inputRegion)); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + get + { + return instance; + } } /// @@ -260,412 +472,505 @@ namespace Tizen.NUI } /// - /// Sets a priority level for the specified notification window. + /// Gets/Sets a window title. /// - /// The notification window level. - /// True if no error occurred, false otherwise. - /// 3 - public bool SetNotificationLevel(NotificationLevel level) + /// 4 + public string Title { - bool ret = NDalicPINVOKE.SetNotificationLevel(swigCPtr, (int)level); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; + get + { + return _windowTitle; + } + set + { + _windowTitle = value; + SetClass(_windowTitle, ""); + } } /// - /// Gets a priority level for the specified notification window. + /// The rendering behavior of a Window. /// - /// The notification window level. - /// 3 - public NotificationLevel GetNotificationLevel() + /// 5 + public RenderingBehaviorType RenderingBehavior { - NotificationLevel ret = (NotificationLevel)NDalicPINVOKE.GetNotificationLevel(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; + get + { + return GetRenderingBehavior(); + } + set + { + SetRenderingBehavior(value); + } } /// - /// Sets a transparent window's visual state to opaque.
- /// If a visual state of a transparent window is opaque,
- /// then the window manager could handle it as an opaque window when calculating visibility. + /// The window size property (read-only). ///
- /// Whether the window's visual state is opaque. - /// This will have no effect on an opaque window.
- /// It doesn't change transparent window to opaque window but lets the window manager know the visual state of the window. - ///
/// 3 - public void SetOpaqueState(bool opaque) + public Size2D Size { - NDalicPINVOKE.SetOpaqueState(swigCPtr, opaque); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + get + { + Size2D ret = GetSize(); + return ret; + } } /// - /// Returns whether a transparent window's visual state is opaque or not. + /// The background color property. /// - /// True if the window's visual state is opaque, false otherwise. - /// The return value has no meaning on an opaque window. /// 3 - public bool IsOpaqueState() + public Color BackgroundColor { - bool ret = NDalicPINVOKE.IsOpaqueState(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; + set + { + SetBackgroundColor(value); + } + get + { + Color ret = GetBackgroundColor(); + return ret; + } } /// - /// Sets a window's screen off mode. + /// The DPI property (read-only).
+ /// Retrieves the DPI of the display device to which the Window is connected.
///
- /// The screen mode. - /// True if no error occurred, false otherwise. - /// 4 - public bool SetScreenOffMode(ScreenOffMode screenOffMode) - { - bool ret = NDalicPINVOKE.SetScreenOffMode(swigCPtr, (int)screenOffMode); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - /// - /// Gets the screen mode of the window. - /// - /// The screen off mode. - /// 4 - public ScreenOffMode GetScreenOffMode() - { - ScreenOffMode ret = (ScreenOffMode)NDalicPINVOKE.GetScreenOffMode(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - /// - /// Sets preferred brightness of the window. - /// - /// The preferred brightness (0 to 100). - /// True if no error occurred, false otherwise. /// 3 - public bool SetBrightness(int brightness) + public Vector2 Dpi { - bool ret = NDalicPINVOKE.SetBrightness(swigCPtr, brightness); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; + get + { + return GetDpi(); + } } /// - /// Gets the preferred brightness of the window. + /// The layer count property (read-only).
+ /// Queries the number of on-Window layers.
///
- /// The preferred brightness. /// 3 - public int GetBrightness() + public uint LayerCount { - int ret = NDalicPINVOKE.GetBrightness(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; + get + { + return GetLayerCount(); + } } /// - /// The focus changed event argument. + /// Gets or sets a size of the window. /// - /// 3 - public class FocusChangedEventArgs : EventArgs + /// 4 + public Size2D WindowSize { - /// - /// FocusGained flag. - /// - /// 3 - public bool FocusGained + get { - get; - set; + return GetWindowSize(); + } + set + { + SetWindowSize(value); } } - private WindowFocusChangedEventCallbackType _windowFocusChangedEventCallback; - [UnmanagedFunctionPointer(CallingConvention.StdCall)] - private delegate void WindowFocusChangedEventCallbackType(bool focusGained); - private event EventHandler _windowFocusChangedEventHandler; - /// - /// FocusChanged event. + /// Gets or sets a position of the window. /// - /// 3 - public event EventHandler FocusChanged + /// 4 + public Position2D WindowPosition { - add + get { - if (_windowFocusChangedEventHandler == null) - { - _windowFocusChangedEventCallback = OnWindowFocusedChanged; - WindowFocusChangedSignal().Connect(_windowFocusChangedEventCallback); - } - - _windowFocusChangedEventHandler += value; + return GetPosition(); } - remove + set { - _windowFocusChangedEventHandler -= value; - - if (_windowFocusChangedEventHandler == null && WindowFocusChangedSignal().Empty() == false && _windowFocusChangedEventCallback != null) - { - WindowFocusChangedSignal().Disconnect(_windowFocusChangedEventCallback); - } + SetPosition(value); } } - - private void OnWindowFocusedChanged(bool focusGained) + internal static Vector4 DEFAULT_BACKGROUND_COLOR { - FocusChangedEventArgs e = new FocusChangedEventArgs(); - - e.FocusGained = focusGained; - - if (_windowFocusChangedEventHandler != null) + get { - _windowFocusChangedEventHandler(this, e); + global::System.IntPtr cPtr = NDalicPINVOKE.Stage_DEFAULT_BACKGROUND_COLOR_get(); + Vector4 ret = (cPtr == global::System.IntPtr.Zero) ? null : new Vector4(cPtr, false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; } } - /// - /// Gets/Sets a window title. - /// - /// 4 - public string Title + internal static Vector4 DEBUG_BACKGROUND_COLOR { get { - return _windowTitle; - } - set - { - _windowTitle = value; - SetClass(_windowTitle, ""); + global::System.IntPtr cPtr = NDalicPINVOKE.Stage_DEBUG_BACKGROUND_COLOR_get(); + Vector4 ret = (cPtr == global::System.IntPtr.Zero) ? null : new Vector4(cPtr, false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; } } - /// - /// The rendering behavior of a Window. - /// - /// 5 - public RenderingBehaviorType RenderingBehavior + internal List LayersChildren { get { - return GetRenderingBehavior(); - } - set - { - SetRenderingBehavior(value); + return _childLayers; } } - internal WindowFocusSignalType WindowFocusChangedSignal() + /// + /// Feed a key-event into the window. + /// + /// The key event to feed. + /// 4 + [Obsolete("Please do not use! This will be deprecated! Please use FeedKey(Key keyEvent) instead!")] + public static void FeedKeyEvent(Key keyEvent) { - WindowFocusSignalType ret = new WindowFocusSignalType(NDalicPINVOKE.FocusChangedSignal(swigCPtr), false); + NDalicManualPINVOKE.Window_FeedKeyEvent(Key.getCPtr(keyEvent)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; } - internal Window(Rectangle windowPosition, string name, bool isTransparent) : this(NDalicPINVOKE.Window_New__SWIG_0(Rectangle.getCPtr(windowPosition), name, isTransparent), true) + /// + /// Sets whether the window accepts a focus or not. + /// + /// If a focus is accepted or not. The default is true. + /// 3 + public void SetAcceptFocus(bool accept) { + NDalicPINVOKE.SetAcceptFocus(swigCPtr, accept); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } - internal Window(Rectangle windowPosition, string name) : this(NDalicPINVOKE.Window_New__SWIG_1(Rectangle.getCPtr(windowPosition), name), true) + /// + /// Returns whether the window accepts a focus or not. + /// + /// True if the window accepts a focus, false otherwise. + /// 3 + public bool IsFocusAcceptable() { + bool ret = NDalicPINVOKE.IsFocusAcceptable(swigCPtr); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + + return ret; } - internal Window(Rectangle windowPosition, string name, string className, bool isTransparent) : this(NDalicPINVOKE.Window_New__SWIG_2(Rectangle.getCPtr(windowPosition), name, className, isTransparent), true) + /// + /// Shows the window if it is hidden. + /// + /// 3 + public void Show() { + NDalicPINVOKE.Show(swigCPtr); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } - internal Window(Rectangle windowPosition, string name, string className) : this(NDalicPINVOKE.Window_New__SWIG_3(Rectangle.getCPtr(windowPosition), name, className), true) + /// + /// Hides the window if it is showing. + /// + /// 3 + public void Hide() { + NDalicPINVOKE.Hide(swigCPtr); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } - internal void ShowIndicator(Window.IndicatorVisibleMode visibleMode) + /// + /// Retrieves whether the window is visible or not. + /// + /// True if the window is visible. + /// 3 + public bool IsVisible() { - NDalicPINVOKE.Window_ShowIndicator(swigCPtr, (int)visibleMode); + bool temp = NDalicPINVOKE.IsVisible(swigCPtr); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return temp; } - internal void SetIndicatorBackgroundOpacity(Window.IndicatorBackgroundOpacity opacity) + /// + /// Gets the count of supported auxiliary hints of the window. + /// + /// The number of supported auxiliary hints. + /// 3 + public uint GetSupportedAuxiliaryHintCount() { - NDalicPINVOKE.Window_SetIndicatorBgOpacity(swigCPtr, (int)opacity); + uint ret = NDalicPINVOKE.GetSupportedAuxiliaryHintCount(swigCPtr); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; } - internal void RotateIndicator(Window.WindowOrientation orientation) + /// + /// Gets the supported auxiliary hint string of the window. + /// + /// The index of the supported auxiliary hint lists. + /// The auxiliary hint string of the index. + /// 3 + public string GetSupportedAuxiliaryHint(uint index) { - NDalicPINVOKE.Window_RotateIndicator(swigCPtr, (int)orientation); + string ret = NDalicPINVOKE.GetSupportedAuxiliaryHint(swigCPtr, index); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; } /// - /// Sets the window name and the class string. + /// Creates an auxiliary hint of the window. /// - /// The name of the window. - /// The class of the window. - /// 4 - public void SetClass(string name, string klass) + /// The auxiliary hint string. + /// The value string. + /// The ID of created auxiliary hint, or 0 on failure. + /// 3 + public uint AddAuxiliaryHint(string hint, string value) { - NDalicPINVOKE.Window_SetClass(swigCPtr, name, klass); + uint ret = NDalicPINVOKE.AddAuxiliaryHint(swigCPtr, hint, value); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; } /// - /// Raises the window to the top of the window stack. + /// Removes an auxiliary hint of the window. /// + /// The ID of the auxiliary hint. + /// True if no error occurred, false otherwise. /// 3 - public void Raise() + public bool RemoveAuxiliaryHint(uint id) { - NDalicPINVOKE.Window_Raise(swigCPtr); + bool ret = NDalicPINVOKE.RemoveAuxiliaryHint(swigCPtr, id); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; } /// - /// Lowers the window to the bottom of the window stack. + /// Changes a value of the auxiliary hint. /// + /// The auxiliary hint ID. + /// The value string to be set. + /// True if no error occurred, false otherwise. /// 3 - public void Lower() + public bool SetAuxiliaryHintValue(uint id, string value) { - NDalicPINVOKE.Window_Lower(swigCPtr); + bool ret = NDalicPINVOKE.SetAuxiliaryHintValue(swigCPtr, id, value); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; } /// - /// Activates the window to the top of the window stack even it is iconified. + /// Gets a value of the auxiliary hint. /// + /// The auxiliary hint ID. + /// The string value of the auxiliary hint ID, or an empty string if none exists. /// 3 - public void Activate() + public string GetAuxiliaryHintValue(uint id) { - NDalicPINVOKE.Window_Activate(swigCPtr); + string ret = NDalicPINVOKE.GetAuxiliaryHintValue(swigCPtr, id); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; } - internal void AddAvailableOrientation(Window.WindowOrientation orientation) + /// + /// Gets an ID of the auxiliary hint string. + /// + /// The auxiliary hint string. + /// The ID of auxiliary hint string, or 0 on failure. + /// 3 + public uint GetAuxiliaryHintId(string hint) { - NDalicPINVOKE.Window_AddAvailableOrientation(swigCPtr, (int)orientation); + uint ret = NDalicPINVOKE.GetAuxiliaryHintId(swigCPtr, hint); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; } - internal void RemoveAvailableOrientation(Window.WindowOrientation orientation) + /// + /// Sets a region to accept input events. + /// + /// The region to accept input events. + /// 3 + public void SetInputRegion(Rectangle inputRegion) { - NDalicPINVOKE.Window_RemoveAvailableOrientation(swigCPtr, (int)orientation); + NDalicPINVOKE.SetInputRegion(swigCPtr, Rectangle.getCPtr(inputRegion)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } - internal void SetPreferredOrientation(Window.WindowOrientation orientation) + /// + /// Sets a priority level for the specified notification window. + /// + /// The notification window level. + /// True if no error occurred, false otherwise. + /// 3 + public bool SetNotificationLevel(NotificationLevel level) { - NDalicPINVOKE.Window_SetPreferredOrientation(swigCPtr, (int)orientation); + bool ret = NDalicPINVOKE.SetNotificationLevel(swigCPtr, (int)level); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; } - internal Window.WindowOrientation GetPreferredOrientation() + /// + /// Gets a priority level for the specified notification window. + /// + /// The notification window level. + /// 3 + public NotificationLevel GetNotificationLevel() { - Window.WindowOrientation ret = (Window.WindowOrientation)NDalicPINVOKE.Window_GetPreferredOrientation(swigCPtr); + NotificationLevel ret = (NotificationLevel)NDalicPINVOKE.GetNotificationLevel(swigCPtr); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } - internal DragAndDropDetector GetDragAndDropDetector() + /// + /// Sets a transparent window's visual state to opaque.
+ /// If a visual state of a transparent window is opaque,
+ /// then the window manager could handle it as an opaque window when calculating visibility. + ///
+ /// Whether the window's visual state is opaque. + /// This will have no effect on an opaque window.
+ /// It doesn't change transparent window to opaque window but lets the window manager know the visual state of the window. + ///
+ /// 3 + public void SetOpaqueState(bool opaque) { - DragAndDropDetector ret = new DragAndDropDetector(NDalicPINVOKE.Window_GetDragAndDropDetector(swigCPtr), true); + NDalicPINVOKE.SetOpaqueState(swigCPtr, opaque); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + /// + /// Returns whether a transparent window's visual state is opaque or not. + /// + /// True if the window's visual state is opaque, false otherwise. + /// The return value has no meaning on an opaque window. + /// 3 + public bool IsOpaqueState() + { + bool ret = NDalicPINVOKE.IsOpaqueState(swigCPtr); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } - internal Any GetNativeHandle() + /// + /// Sets a window's screen off mode. + /// + /// The screen mode. + /// True if no error occurred, false otherwise. + /// 4 + public bool SetScreenOffMode(ScreenOffMode screenOffMode) { - Any ret = new Any(NDalicPINVOKE.Window_GetNativeHandle(swigCPtr), true); + bool ret = NDalicPINVOKE.SetScreenOffMode(swigCPtr, (int)screenOffMode); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } - internal WindowFocusSignalType FocusChangedSignal() + /// + /// Gets the screen mode of the window. + /// + /// The screen off mode. + /// 4 + public ScreenOffMode GetScreenOffMode() { - WindowFocusSignalType ret = new WindowFocusSignalType(NDalicPINVOKE.FocusChangedSignal(swigCPtr), false); + ScreenOffMode ret = (ScreenOffMode)NDalicPINVOKE.GetScreenOffMode(swigCPtr); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } /// - /// Gets the default ( root ) layer. + /// Sets preferred brightness of the window. /// - /// The root layer. + /// The preferred brightness (0 to 100). + /// True if no error occurred, false otherwise. /// 3 - public Layer GetDefaultLayer() + public bool SetBrightness(int brightness) { - return this.GetRootLayer(); + bool ret = NDalicPINVOKE.SetBrightness(swigCPtr, brightness); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; } - internal void Add(Layer layer) + /// + /// Gets the preferred brightness of the window. + /// + /// The preferred brightness. + /// 3 + public int GetBrightness() { - NDalicPINVOKE.Stage_Add(stageCPtr, Layer.getCPtr(layer)); + int ret = NDalicPINVOKE.GetBrightness(swigCPtr); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - - LayersChildren.Add(layer); + return ret; } - internal void Remove(Layer layer) + /// + /// Sets the window name and the class string. + /// + /// The name of the window. + /// The class of the window. + /// 4 + public void SetClass(string name, string klass) { - NDalicPINVOKE.Stage_Remove(stageCPtr, Layer.getCPtr(layer)); + NDalicPINVOKE.Window_SetClass(swigCPtr, name, klass); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - - LayersChildren.Remove(layer); } /// - /// Add a child view to window. + /// Raises the window to the top of the window stack. /// - /// the child should be added to the window. /// 3 - public void Add(View view) + public void Raise() { - NDalicPINVOKE.Actor_Add( rootLayoutCPtr, View.getCPtr(view) ); + NDalicPINVOKE.Window_Raise(swigCPtr); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - this.GetRootLayer().AddViewToLayerList(view); // Maintain the children list in the Layer - view.InternalParent = this.GetRootLayer(); } /// - /// Remove a child view from window. + /// Lowers the window to the bottom of the window stack. /// - /// the child to be removed. /// 3 - public void Remove(View view) + public void Lower() { - NDalicPINVOKE.Actor_Remove( rootLayoutCPtr, View.getCPtr(view) ); - this.GetRootLayer().RemoveViewFromLayerList(view); // Maintain the children list in the Layer - view.InternalParent = null; + NDalicPINVOKE.Window_Lower(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } - internal Vector2 GetSize() + /// + /// Activates the window to the top of the window stack even it is iconified. + /// + /// 3 + public void Activate() { - Vector2 ret = new Vector2(NDalicPINVOKE.Stage_GetSize(stageCPtr), true); + NDalicPINVOKE.Window_Activate(swigCPtr); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; } - internal RenderTaskList GetRenderTaskList() + /// + /// Gets the default ( root ) layer. + /// + /// The root layer. + /// 3 + public Layer GetDefaultLayer() { - RenderTaskList ret = new RenderTaskList(NDalicPINVOKE.Stage_GetRenderTaskList(stageCPtr), true); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; + return this.GetRootLayer(); } /// - /// Queries the number of on-window layers. + /// Add a child view to window. /// - /// The number of layers. - /// Note that a default layer is always provided (count >= 1). - internal uint GetLayerCount() + /// the child should be added to the window. + /// 3 + public void Add(View view) { - if (LayersChildren == null || LayersChildren.Count < 0) - return 0; + NDalicPINVOKE.Actor_Add(rootLayoutCPtr, View.getCPtr(view)); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + this.GetRootLayer().AddViewToLayerList(view); // Maintain the children list in the Layer + view.InternalParent = this.GetRootLayer(); + } - return (uint) LayersChildren.Count; + /// + /// Remove a child view from window. + /// + /// the child to be removed. + /// 3 + public void Remove(View view) + { + NDalicPINVOKE.Actor_Remove(rootLayoutCPtr, View.getCPtr(view)); + this.GetRootLayer().RemoveViewFromLayerList(view); // Maintain the children list in the Layer + view.InternalParent = null; } /// @@ -687,777 +992,396 @@ namespace Tizen.NUI } } - internal Layer GetRootLayer() - { - // Window.IsInstalled() is actually true only when called from event thread and - // Core has been initialized, not when Stage is ready. - if (_rootLayer == null && Window.IsInstalled()) - { - _rootLayer = new Layer(NDalicPINVOKE.Stage_GetRootLayer(stageCPtr), true); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - LayersChildren.Add(_rootLayer); - } - return _rootLayer; - } - - internal void SetBackgroundColor(Vector4 color) + /// + /// Keep rendering for at least the given amount of time. + /// + /// Time to keep rendering, 0 means render at least one more frame. + /// 3 + public void KeepRendering(float durationSeconds) { - NDalicPINVOKE.Stage_SetBackgroundColor(stageCPtr, Vector4.getCPtr(color)); + NDalicPINVOKE.Stage_KeepRendering(stageCPtr, durationSeconds); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } - internal Vector4 GetBackgroundColor() + /// + /// Grabs the key specified by a key for a window only when a window is the topmost window.
+ /// This function can be used for following example scenarios:
+ /// - Mobile - Using volume up or down as zoom up or down in camera apps.
+ ///
+ /// The key code to grab. + /// True if the grab succeeds. + /// 3 + public bool GrabKeyTopmost(int DaliKey) { - Vector4 ret = new Vector4(NDalicPINVOKE.Stage_GetBackgroundColor(stageCPtr), true); + bool ret = NDalicManualPINVOKE.GrabKeyTopmost(HandleRef.ToIntPtr(this.swigCPtr), DaliKey); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } - internal Vector2 GetDpi() + /// + /// Ungrabs the key specified by a key for the window.
+ /// Note: If this function is called between key down and up events of a grabbed key, an application doesn't receive the key up event.
+ ///
+ /// The key code to ungrab. + /// True if the ungrab succeeds. + /// 3 + public bool UngrabKeyTopmost(int DaliKey) { - Vector2 ret = new Vector2(NDalicPINVOKE.Stage_GetDpi(stageCPtr), true); + bool ret = NDalicManualPINVOKE.UngrabKeyTopmost(HandleRef.ToIntPtr(this.swigCPtr), DaliKey); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } - internal ObjectRegistry GetObjectRegistry() + /// + /// Grabs the key specified by a key for a window in a GrabMode.
+ /// Details: This function can be used for following example scenarios:
+ /// - TV - A user might want to change the volume or channel of the background TV contents while focusing on the foregrund app.
+ /// - Mobile - When a user presses the Home key, the homescreen appears regardless of the current foreground app.
+ /// - Mobile - Using the volume up or down as zoom up or down in camera apps.
+ ///
+ /// The key code to grab. + /// The grab mode for the key. + /// True if the grab succeeds. + /// 3 + public bool GrabKey(int DaliKey, KeyGrabMode GrabMode) { - ObjectRegistry ret = new ObjectRegistry(NDalicPINVOKE.Stage_GetObjectRegistry(stageCPtr), true); + bool ret = NDalicManualPINVOKE.GrabKey(HandleRef.ToIntPtr(this.swigCPtr), DaliKey, (int)GrabMode); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } /// - /// Keep rendering for at least the given amount of time. + /// Ungrabs the key specified by a key for a window.
+ /// Note: If this function is called between key down and up events of a grabbed key, an application doesn't receive the key up event.
///
- /// Time to keep rendering, 0 means render at least one more frame. + /// The key code to ungrab. + /// True if the ungrab succeeds. /// 3 - public void KeepRendering(float durationSeconds) + public bool UngrabKey(int DaliKey) { - NDalicPINVOKE.Stage_KeepRendering(stageCPtr, durationSeconds); + bool ret = NDalicManualPINVOKE.UngrabKey(HandleRef.ToIntPtr(this.swigCPtr), DaliKey); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; } - internal void SetRenderingBehavior(RenderingBehaviorType renderingBehavior) - { - NDalicPINVOKE.Stage_SetRenderingBehavior(stageCPtr, (int)renderingBehavior); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - internal RenderingBehaviorType GetRenderingBehavior() + /// + /// Sets the keyboard repeat information. + /// + /// The key repeat rate value in seconds. + /// The key repeat delay value in seconds. + /// True if setting the keyboard repeat succeeds. + /// 5 + public bool SetKeyboardRepeatInfo(float rate, float delay) { - RenderingBehaviorType ret = (RenderingBehaviorType)NDalicPINVOKE.Stage_GetRenderingBehavior(stageCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) - throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + bool ret = NDalicManualPINVOKE.SetKeyboardRepeatInfo(rate, delay); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } - internal KeyEventSignal KeyEventSignal() + /// + /// Gets the keyboard repeat information. + /// + /// The key repeat rate value in seconds. + /// The key repeat delay value in seconds. + /// True if setting the keyboard repeat succeeds. + /// 5 + public bool GetKeyboardRepeatInfo(out float rate, out float delay) { - KeyEventSignal ret = new KeyEventSignal(NDalicPINVOKE.Stage_KeyEventSignal(stageCPtr), false); + bool ret = NDalicManualPINVOKE.GetKeyboardRepeatInfo(out rate, out delay); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } - internal VoidSignal EventProcessingFinishedSignal() + /// + /// Adds a layer to the stage. + /// + /// Layer to add. + /// 3 + public void AddLayer(Layer layer) { - VoidSignal ret = new VoidSignal(NDalicPINVOKE.Stage_EventProcessingFinishedSignal(stageCPtr), false); + NDalicPINVOKE.Stage_Add(stageCPtr, Layer.getCPtr(layer)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; + + LayersChildren.Add(layer); } - internal TouchSignal TouchSignal() + /// + /// Removes a layer from the stage. + /// + /// Layer to remove. + /// 3 + public void RemoveLayer(Layer layer) { - TouchSignal ret = new TouchSignal(NDalicPINVOKE.Stage_TouchSignal(stageCPtr), false); + NDalicPINVOKE.Stage_Remove(stageCPtr, Layer.getCPtr(layer)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; + + LayersChildren.Remove(layer); } - internal TouchDataSignal TouchDataSignal() + /// + /// Feeds a key event into the window. + /// + /// The key event to feed. + /// 5 + public void FeedKey(Key keyEvent) { - TouchDataSignal ret = new TouchDataSignal(NDalicPINVOKE.Actor_TouchSignal(Layer.getCPtr(GetRootLayer())), false); - if (NDalicPINVOKE.SWIGPendingException.Pending) - throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; + NDalicManualPINVOKE.Window_FeedKeyEvent(Key.getCPtr(keyEvent)); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } - private StageWheelSignal WheelEventSignal() + /// + /// Allows at least one more render, even when paused. + /// The window should be shown, not minimised. + /// + /// 4 + public void RenderOnce() { - StageWheelSignal ret = new StageWheelSignal(NDalicPINVOKE.Stage_WheelEventSignal(stageCPtr), false); + NDalicManualPINVOKE.Window_RenderOnce(swigCPtr); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; } + internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Window obj) + { + return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; + } - private WheelSignal StageWheelEventSignal() + internal static Window GetCurrent() { - WheelSignal ret = new WheelSignal(NDalicPINVOKE.Actor_WheelEventSignal(Layer.getCPtr(this.GetRootLayer())), false); - if (NDalicPINVOKE.SWIGPendingException.Pending) - throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + Window ret = new Window(NDalicPINVOKE.Stage_GetCurrent(), true); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } - - internal VoidSignal ContextLostSignal() + internal static bool IsInstalled() { - VoidSignal ret = new VoidSignal(NDalicPINVOKE.Stage_ContextLostSignal(stageCPtr), false); + bool ret = NDalicPINVOKE.Stage_IsInstalled(); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } - internal VoidSignal ContextRegainedSignal() + internal WindowFocusSignalType WindowFocusChangedSignal() { - VoidSignal ret = new VoidSignal(NDalicPINVOKE.Stage_ContextRegainedSignal(stageCPtr), false); + WindowFocusSignalType ret = new WindowFocusSignalType(NDalicPINVOKE.FocusChangedSignal(swigCPtr), false); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } - internal VoidSignal SceneCreatedSignal() + internal void ShowIndicator(Window.IndicatorVisibleMode visibleMode) { - VoidSignal ret = new VoidSignal(NDalicPINVOKE.Stage_SceneCreatedSignal(stageCPtr), false); + NDalicPINVOKE.Window_ShowIndicator(swigCPtr, (int)visibleMode); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; } - internal ResizedSignal ResizedSignal() + internal void SetIndicatorBackgroundOpacity(Window.IndicatorBackgroundOpacity opacity) { - ResizedSignal ret = new ResizedSignal(NDalicManualPINVOKE.Window_ResizedSignal(swigCPtr), false); + NDalicPINVOKE.Window_SetIndicatorBgOpacity(swigCPtr, (int)opacity); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; } - internal static Vector4 DEFAULT_BACKGROUND_COLOR + internal void RotateIndicator(Window.WindowOrientation orientation) { - get - { - global::System.IntPtr cPtr = NDalicPINVOKE.Stage_DEFAULT_BACKGROUND_COLOR_get(); - Vector4 ret = (cPtr == global::System.IntPtr.Zero) ? null : new Vector4(cPtr, false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } + NDalicPINVOKE.Window_RotateIndicator(swigCPtr, (int)orientation); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } - internal static Vector4 DEBUG_BACKGROUND_COLOR + internal void AddAvailableOrientation(Window.WindowOrientation orientation) { - get - { - global::System.IntPtr cPtr = NDalicPINVOKE.Stage_DEBUG_BACKGROUND_COLOR_get(); - Vector4 ret = (cPtr == global::System.IntPtr.Zero) ? null : new Vector4(cPtr, false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } + NDalicPINVOKE.Window_AddAvailableOrientation(swigCPtr, (int)orientation); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } - private static readonly Window instance = Application.Instance.GetWindow(); + internal void RemoveAvailableOrientation(Window.WindowOrientation orientation) + { + NDalicPINVOKE.Window_RemoveAvailableOrientation(swigCPtr, (int)orientation); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } - /// - /// The stage instance property (read-only).
- /// Gets the current window.
- ///
- /// 3 - public static Window Instance + internal void SetPreferredOrientation(Window.WindowOrientation orientation) { - get - { - return instance; - } + NDalicPINVOKE.Window_SetPreferredOrientation(swigCPtr, (int)orientation); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } - /// - /// Grabs the key specified by a key for a window only when a window is the topmost window.
- /// This function can be used for following example scenarios:
- /// - Mobile - Using volume up or down as zoom up or down in camera apps.
- ///
- /// The key code to grab. - /// True if the grab succeeds. - /// 3 - public bool GrabKeyTopmost(int DaliKey) + internal Window.WindowOrientation GetPreferredOrientation() { - bool ret = NDalicManualPINVOKE.GrabKeyTopmost(HandleRef.ToIntPtr(this.swigCPtr), DaliKey); + Window.WindowOrientation ret = (Window.WindowOrientation)NDalicPINVOKE.Window_GetPreferredOrientation(swigCPtr); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } - /// - /// Ungrabs the key specified by a key for the window.
- /// Note: If this function is called between key down and up events of a grabbed key, an application doesn't receive the key up event.
- ///
- /// The key code to ungrab. - /// True if the ungrab succeeds. - /// 3 - public bool UngrabKeyTopmost(int DaliKey) + internal DragAndDropDetector GetDragAndDropDetector() { - bool ret = NDalicManualPINVOKE.UngrabKeyTopmost(HandleRef.ToIntPtr(this.swigCPtr), DaliKey); + DragAndDropDetector ret = new DragAndDropDetector(NDalicPINVOKE.Window_GetDragAndDropDetector(swigCPtr), true); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } - /// - /// Grabs the key specified by a key for a window in a GrabMode.
- /// Details: This function can be used for following example scenarios:
- /// - TV - A user might want to change the volume or channel of the background TV contents while focusing on the foregrund app.
- /// - Mobile - When a user presses the Home key, the homescreen appears regardless of the current foreground app.
- /// - Mobile - Using the volume up or down as zoom up or down in camera apps.
- ///
- /// The key code to grab. - /// The grab mode for the key. - /// True if the grab succeeds. - /// 3 - public bool GrabKey(int DaliKey, KeyGrabMode GrabMode) + internal Any GetNativeHandle() { - bool ret = NDalicManualPINVOKE.GrabKey(HandleRef.ToIntPtr(this.swigCPtr), DaliKey, (int)GrabMode); + Any ret = new Any(NDalicPINVOKE.Window_GetNativeHandle(swigCPtr), true); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } - /// - /// Ungrabs the key specified by a key for a window.
- /// Note: If this function is called between key down and up events of a grabbed key, an application doesn't receive the key up event.
- ///
- /// The key code to ungrab. - /// True if the ungrab succeeds. - /// 3 - public bool UngrabKey(int DaliKey) + internal WindowFocusSignalType FocusChangedSignal() { - bool ret = NDalicManualPINVOKE.UngrabKey(HandleRef.ToIntPtr(this.swigCPtr), DaliKey); + WindowFocusSignalType ret = new WindowFocusSignalType(NDalicPINVOKE.FocusChangedSignal(swigCPtr), false); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } - /// - /// Sets the keyboard repeat information. - /// - /// The key repeat rate value in seconds. - /// The key repeat delay value in seconds. - /// True if setting the keyboard repeat succeeds. - /// 5 - public bool SetKeyboardRepeatInfo(float rate, float delay) + internal void Add(Layer layer) { - bool ret = NDalicManualPINVOKE.SetKeyboardRepeatInfo(rate, delay); + NDalicPINVOKE.Stage_Add(stageCPtr, Layer.getCPtr(layer)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; + + LayersChildren.Add(layer); } - /// - /// Gets the keyboard repeat information. - /// - /// The key repeat rate value in seconds. - /// The key repeat delay value in seconds. - /// True if setting the keyboard repeat succeeds. - /// 5 - public bool GetKeyboardRepeatInfo(out float rate, out float delay) + internal void Remove(Layer layer) { - bool ret = NDalicManualPINVOKE.GetKeyboardRepeatInfo(out rate, out delay); + NDalicPINVOKE.Stage_Remove(stageCPtr, Layer.getCPtr(layer)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; + + LayersChildren.Remove(layer); } - internal System.IntPtr GetNativeWindowHandler() + internal Vector2 GetSize() { - System.IntPtr ret = NDalicManualPINVOKE.GetNativeWindowHandler(HandleRef.ToIntPtr(this.swigCPtr)); + Vector2 ret = new Vector2(NDalicPINVOKE.Stage_GetSize(stageCPtr), true); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } - /// - /// Enumeration for orientation of the window is the way in which a rectangular page is oriented for normal viewing. - /// - /// 3 - public enum WindowOrientation + internal RenderTaskList GetRenderTaskList() { - /// - /// Portrait orientation. The height of the display area is greater than the width. - /// - /// 3 - Portrait = 0, - /// - /// Landscape orientation. A wide view area is needed. - /// - /// 3 - Landscape = 90, - /// - /// Portrait inverse orientation. - /// - /// 3 - PortraitInverse = 180, - /// - /// Landscape inverse orientation. - /// - /// 3 - LandscapeInverse = 270 + RenderTaskList ret = new RenderTaskList(NDalicPINVOKE.Stage_GetRenderTaskList(stageCPtr), true); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; } /// - /// Enumeration for the key grab mode for platform-level APIs. + /// Queries the number of on-window layers. /// - /// 3 - public enum KeyGrabMode - { - /// - /// Grabs a key only when on the top of the grabbing-window stack mode. - /// - Topmost = 0, - /// - /// Grabs a key together with the other client window(s) mode. - /// - Shared, - /// - /// Grabs a key exclusively regardless of the grabbing-window's position on the window stack with the possibility of overriding the grab by the other client window mode. - /// - OverrideExclusive, - /// - /// Grabs a key exclusively regardless of the grabbing-window's position on the window stack mode. - /// - Exclusive - }; - - /// - /// Enumeration for opacity of the indicator. - /// - internal enum IndicatorBackgroundOpacity - { - Opaque = 100, - Translucent = 50, - Transparent = 0 - } - - /// - /// Enumeration for visible mode of the indicator. - /// - internal enum IndicatorVisibleMode - { - Invisible = 0, - Visible = 1, - Auto = 2 - } - - /// - /// The touch event argument. - /// - /// 3 - public class TouchEventArgs : EventArgs - { - private Touch _touch; - - /// - /// Touch. - /// - /// 3 - public Touch Touch - { - get - { - return _touch; - } - set - { - _touch = value; - } - } - } - - - private event EventHandler _rootLayerTouchDataEventHandler; - [UnmanagedFunctionPointer(CallingConvention.StdCall)] - private delegate bool RootLayerTouchDataCallbackType(IntPtr view, IntPtr touchData); - private RootLayerTouchDataCallbackType _rootLayerTouchDataCallback; - /// - /// This event is emitted when the screen is touched and when the touch ends.
- /// If there are multiple touch points, then this will be emitted when the first touch occurs and - /// then when the last finger is lifted.
- /// An interrupted event will also be emitted (if it occurs).
- ///
- /// 3 - public event EventHandler TouchEvent - { - add - { - if (_rootLayerTouchDataEventHandler == null) - { - _rootLayerTouchDataCallback = OnWindowTouch; - this.TouchDataSignal().Connect(_rootLayerTouchDataCallback); - } - _rootLayerTouchDataEventHandler += value; - } - remove - { - _rootLayerTouchDataEventHandler -= value; - if (_rootLayerTouchDataEventHandler == null && TouchSignal().Empty() == false) - { - this.TouchDataSignal().Disconnect(_rootLayerTouchDataCallback); - } - } - } - - private bool OnWindowTouch(IntPtr view, IntPtr touchData) - { - if (touchData == global::System.IntPtr.Zero) - { - NUILog.Error("touchData should not be null!"); - return false; - } - - TouchEventArgs e = new TouchEventArgs(); - - e.Touch = Tizen.NUI.Touch.GetTouchFromPtr(touchData); - - if (_rootLayerTouchDataEventHandler != null) - { - _rootLayerTouchDataEventHandler(this, e); - } - return false; - } - - /// - /// Wheel event arguments. - /// - /// 3 - public class WheelEventArgs : EventArgs + /// The number of layers. + /// Note that a default layer is always provided (count >= 1). + internal uint GetLayerCount() { - private Wheel _wheel; - - /// - /// Wheel. - /// - /// 3 - public Wheel Wheel - { - get - { - return _wheel; - } - set - { - _wheel = value; - } - } - } - - private event EventHandler _stageWheelHandler; - - [UnmanagedFunctionPointer(CallingConvention.StdCall)] - private delegate bool WheelEventCallbackType(IntPtr view, IntPtr wheelEvent); - private WheelEventCallbackType _wheelEventCallback; + if (LayersChildren == null || LayersChildren.Count < 0) + return 0; - /// - /// This event is emitted when the wheel event is received. - /// - /// 3 - public event EventHandler WheelEvent - { - add - { - if (_stageWheelHandler == null) - { - _wheelEventCallback = OnStageWheel; - this.StageWheelEventSignal().Connect(_wheelEventCallback); - } - _stageWheelHandler += value; - } - remove - { - _stageWheelHandler -= value; - if (_stageWheelHandler == null && StageWheelEventSignal().Empty() == false) - { - this.StageWheelEventSignal().Disconnect(_wheelEventCallback); - } - } + return (uint) LayersChildren.Count; } - private bool OnStageWheel(IntPtr rootLayer, IntPtr wheelEvent) - { - if (wheelEvent == global::System.IntPtr.Zero) + internal Layer GetRootLayer() { - NUILog.Error("wheelEvent should not be null!"); - return true; - } - - WheelEventArgs e = new WheelEventArgs(); - - e.Wheel = Tizen.NUI.Wheel.GetWheelFromPtr(wheelEvent); - - if (_stageWheelHandler != null) + // Window.IsInstalled() is actually true only when called from event thread and + // Core has been initialized, not when Stage is ready. + if (_rootLayer == null && Window.IsInstalled()) { - _stageWheelHandler(this, e); + _rootLayer = new Layer(NDalicPINVOKE.Stage_GetRootLayer(stageCPtr), true); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + LayersChildren.Add(_rootLayer); } - return true; + return _rootLayer; } - /// - /// Key event arguments. - /// - /// 3 - public class KeyEventArgs : EventArgs + internal void SetBackgroundColor(Vector4 color) { - private Key _key; - - /// - /// Key. - /// - /// 3 - public Key Key - { - get - { - return _key; - } - set - { - _key = value; - } - } + NDalicPINVOKE.Stage_SetBackgroundColor(stageCPtr, Vector4.getCPtr(color)); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } - private event EventHandler _stageKeyHandler; - private EventCallbackDelegateType1 _stageKeyCallbackDelegate; - - /// - /// This event is emitted when the key event is received. - /// - /// 3 - public event EventHandler KeyEvent + internal Vector4 GetBackgroundColor() { - add - { - if (_stageKeyHandler == null) - { - _stageKeyCallbackDelegate = OnStageKey; - KeyEventSignal().Connect(_stageKeyCallbackDelegate); - } - _stageKeyHandler += value; - } - remove - { - _stageKeyHandler -= value; - if (_stageKeyHandler == null && KeyEventSignal().Empty() == false) - { - KeyEventSignal().Disconnect(_stageKeyCallbackDelegate); - } - } + Vector4 ret = new Vector4(NDalicPINVOKE.Stage_GetBackgroundColor(stageCPtr), true); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; } - // Callback for Stage KeyEventsignal - private void OnStageKey(IntPtr data) + internal Vector2 GetDpi() { - KeyEventArgs e = new KeyEventArgs(); - - if (data != null) - { - e.Key = Tizen.NUI.Key.GetKeyFromPtr(data); - } - - if (_stageKeyHandler != null) - { - //here we send all data to user event handlers - _stageKeyHandler(this, e); - } + Vector2 ret = new Vector2(NDalicPINVOKE.Stage_GetDpi(stageCPtr), true); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; } - - private event EventHandler _stageEventProcessingFinishedEventHandler; - private EventCallbackDelegateType0 _stageEventProcessingFinishedEventCallbackDelegate; - - internal event EventHandler EventProcessingFinished + internal ObjectRegistry GetObjectRegistry() { - add - { - if (_stageEventProcessingFinishedEventHandler == null) - { - _stageEventProcessingFinishedEventCallbackDelegate = OnEventProcessingFinished; - EventProcessingFinishedSignal().Connect(_stageEventProcessingFinishedEventCallbackDelegate); - } - _stageEventProcessingFinishedEventHandler += value; - - } - remove - { - _stageEventProcessingFinishedEventHandler -= value; - if (_stageEventProcessingFinishedEventHandler == null && EventProcessingFinishedSignal().Empty() == false) - { - EventProcessingFinishedSignal().Disconnect(_stageEventProcessingFinishedEventCallbackDelegate); - } - } + ObjectRegistry ret = new ObjectRegistry(NDalicPINVOKE.Stage_GetObjectRegistry(stageCPtr), true); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; } - // Callback for Stage EventProcessingFinishedSignal - private void OnEventProcessingFinished() + internal void SetRenderingBehavior(RenderingBehaviorType renderingBehavior) { - if (_stageEventProcessingFinishedEventHandler != null) - { - _stageEventProcessingFinishedEventHandler(this, null); - } + NDalicPINVOKE.Stage_SetRenderingBehavior(stageCPtr, (int)renderingBehavior); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } - - private EventHandler _stageContextLostEventHandler; - private EventCallbackDelegateType0 _stageContextLostEventCallbackDelegate; - - internal event EventHandler ContextLost + internal RenderingBehaviorType GetRenderingBehavior() { - add - { - if (_stageContextLostEventHandler == null) - { - _stageContextLostEventCallbackDelegate = OnContextLost; - ContextLostSignal().Connect(_stageContextLostEventCallbackDelegate); - } - _stageContextLostEventHandler += value; - } - remove - { - _stageContextLostEventHandler -= value; - if (_stageContextLostEventHandler == null && ContextLostSignal().Empty() == false) - { - ContextLostSignal().Disconnect(_stageContextLostEventCallbackDelegate); - } - } + RenderingBehaviorType ret = (RenderingBehaviorType)NDalicPINVOKE.Stage_GetRenderingBehavior(stageCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) + throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; } - // Callback for Stage ContextLostSignal - private void OnContextLost() + internal KeyEventSignal KeyEventSignal() { - if (_stageContextLostEventHandler != null) - { - _stageContextLostEventHandler(this, null); - } + KeyEventSignal ret = new KeyEventSignal(NDalicPINVOKE.Stage_KeyEventSignal(stageCPtr), false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; } - - private EventHandler _stageContextRegainedEventHandler; - private EventCallbackDelegateType0 _stageContextRegainedEventCallbackDelegate; - - internal event EventHandler ContextRegained + internal VoidSignal EventProcessingFinishedSignal() { - add - { - if (_stageContextRegainedEventHandler == null) - { - _stageContextRegainedEventCallbackDelegate = OnContextRegained; - ContextRegainedSignal().Connect(_stageContextRegainedEventCallbackDelegate); - } - _stageContextRegainedEventHandler += value; - } - remove - { - _stageContextRegainedEventHandler -= value; - if (_stageContextRegainedEventHandler == null && ContextRegainedSignal().Empty() == false) - { - this.ContextRegainedSignal().Disconnect(_stageContextRegainedEventCallbackDelegate); - } - } + VoidSignal ret = new VoidSignal(NDalicPINVOKE.Stage_EventProcessingFinishedSignal(stageCPtr), false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; } - // Callback for Stage ContextRegainedSignal - private void OnContextRegained() + internal TouchSignal TouchSignal() { - if (_stageContextRegainedEventHandler != null) - { - _stageContextRegainedEventHandler(this, null); - } + TouchSignal ret = new TouchSignal(NDalicPINVOKE.Stage_TouchSignal(stageCPtr), false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; } - - private EventHandler _stageSceneCreatedEventHandler; - private EventCallbackDelegateType0 _stageSceneCreatedEventCallbackDelegate; - - internal event EventHandler SceneCreated + internal TouchDataSignal TouchDataSignal() { - add - { - if (_stageSceneCreatedEventHandler == null) - { - _stageSceneCreatedEventCallbackDelegate = OnSceneCreated; - SceneCreatedSignal().Connect(_stageSceneCreatedEventCallbackDelegate); - } - _stageSceneCreatedEventHandler += value; - } - remove - { - _stageSceneCreatedEventHandler -= value; - if (_stageSceneCreatedEventHandler == null && SceneCreatedSignal().Empty() == false) - { - SceneCreatedSignal().Disconnect(_stageSceneCreatedEventCallbackDelegate); - } - } + TouchDataSignal ret = new TouchDataSignal(NDalicPINVOKE.Actor_TouchSignal(Layer.getCPtr(GetRootLayer())), false); + if (NDalicPINVOKE.SWIGPendingException.Pending) + throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; } - // Callback for Stage SceneCreatedSignal - private void OnSceneCreated() + internal VoidSignal ContextLostSignal() { - if (_stageSceneCreatedEventHandler != null) - { - _stageSceneCreatedEventHandler(this, null); - } + VoidSignal ret = new VoidSignal(NDalicPINVOKE.Stage_ContextLostSignal(stageCPtr), false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; } - /// - /// This resized event arguments. - /// - /// 3 - public class ResizedEventArgs : EventArgs + internal VoidSignal ContextRegainedSignal() { - Size2D _windowSize; - - /// - /// This window size. - /// - /// 4 - public Size2D WindowSize - { - get - { - return _windowSize; - } - set - { - _windowSize = value; - } - } + VoidSignal ret = new VoidSignal(NDalicPINVOKE.Stage_ContextRegainedSignal(stageCPtr), false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; } - private WindowResizedEventCallbackType _windowResizedEventCallback; - [UnmanagedFunctionPointer(CallingConvention.StdCall)] - private delegate void WindowResizedEventCallbackType(IntPtr windowSize); - private event EventHandler _windowResizedEventHandler; - - /// - /// This event is emitted when the window resized. - /// - /// 3 - public event EventHandler Resized + internal VoidSignal SceneCreatedSignal() { - add - { - if (_windowResizedEventHandler == null) - { - _windowResizedEventCallback = OnResized; - ResizedSignal().Connect(_windowResizedEventCallback); - } - - _windowResizedEventHandler += value; - } - remove - { - _windowResizedEventHandler -= value; - - if (_windowResizedEventHandler == null && ResizedSignal().Empty() == false && _windowResizedEventCallback != null) - { - ResizedSignal().Disconnect(_windowResizedEventCallback); - } - } + VoidSignal ret = new VoidSignal(NDalicPINVOKE.Stage_SceneCreatedSignal(stageCPtr), false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; } - private void OnResized(IntPtr windowSize) + internal ResizedSignal ResizedSignal() { - ResizedEventArgs e = new ResizedEventArgs(); - var val = new Uint16Pair(windowSize, false); - e.WindowSize = new Size2D(val.GetWidth(), val.GetHeight()); - val.Dispose(); - - if (_windowResizedEventHandler != null) - { - _windowResizedEventHandler(this, e); - } + ResizedSignal ret = new ResizedSignal(NDalicManualPINVOKE.Window_ResizedSignal(swigCPtr), false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; } internal void SetWindowSize(Size2D size) @@ -1466,6 +1390,11 @@ namespace Tizen.NUI NDalicManualPINVOKE.SetSize(swigCPtr, Uint16Pair.getCPtr(val)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + + if(rootLayoutItem != null) + { + rootLayoutItem.RequestLayout(); + } } internal Size2D GetWindowSize() @@ -1483,6 +1412,11 @@ namespace Tizen.NUI NDalicManualPINVOKE.SetPosition(swigCPtr, Uint16Pair.getCPtr(val)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + + if(rootLayoutItem != null) + { + rootLayoutItem.RequestLayout(); + } } internal Position2D GetPosition() @@ -1494,6 +1428,18 @@ namespace Tizen.NUI return ret; } + internal void SetPositionSize(Rectangle positionSize) + { + NDalicPINVOKE.Window_SetPositionSize(swigCPtr, Rectangle.getCPtr(positionSize)); + + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + + if(rootLayoutItem != null) + { + rootLayoutItem.RequestLayout(); + } + } + /// /// Sets whether the window is transparent or not. /// @@ -1502,104 +1448,168 @@ namespace Tizen.NUI public void SetTransparency(bool transparent) { NDalicManualPINVOKE.SetTransparency(swigCPtr, transparent); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + + if(rootLayoutItem != null) + { + rootLayoutItem.RequestLayout(); + } } - /// - /// The window size property (read-only). - /// - /// 3 - public Size2D Size + internal System.IntPtr GetNativeWindowHandler() { - get + System.IntPtr ret = NDalicManualPINVOKE.GetNativeWindowHandler(HandleRef.ToIntPtr(this.swigCPtr)); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + private void OnWindowFocusedChanged(bool focusGained) + { + FocusChangedEventArgs e = new FocusChangedEventArgs(); + + e.FocusGained = focusGained; + + if (_windowFocusChangedEventHandler != null) { - Size2D ret = GetSize(); - return ret; + _windowFocusChangedEventHandler(this, e); } } - /// - /// The background color property. - /// - /// 3 - public Color BackgroundColor + private StageWheelSignal WheelEventSignal() { - set + StageWheelSignal ret = new StageWheelSignal(NDalicPINVOKE.Stage_WheelEventSignal(stageCPtr), false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + private WheelSignal StageWheelEventSignal() + { + WheelSignal ret = new WheelSignal(NDalicPINVOKE.Actor_WheelEventSignal(Layer.getCPtr(this.GetRootLayer())), false); + if (NDalicPINVOKE.SWIGPendingException.Pending) + throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + private bool OnWindowTouch(IntPtr view, IntPtr touchData) + { + if (touchData == global::System.IntPtr.Zero) { - SetBackgroundColor(value); + NUILog.Error("touchData should not be null!"); + return false; } - get + + TouchEventArgs e = new TouchEventArgs(); + + e.Touch = Tizen.NUI.Touch.GetTouchFromPtr(touchData); + + if (_rootLayerTouchDataEventHandler != null) { - Color ret = GetBackgroundColor(); - return ret; + _rootLayerTouchDataEventHandler(this, e); } + return false; } - /// - /// The DPI property (read-only).
- /// Retrieves the DPI of the display device to which the Window is connected.
- ///
- /// 3 - public Vector2 Dpi + private bool OnStageWheel(IntPtr rootLayer, IntPtr wheelEvent) + { + if (wheelEvent == global::System.IntPtr.Zero) + { + NUILog.Error("wheelEvent should not be null!"); + return true; + } + + WheelEventArgs e = new WheelEventArgs(); + + e.Wheel = Tizen.NUI.Wheel.GetWheelFromPtr(wheelEvent); + + if (_stageWheelHandler != null) + { + _stageWheelHandler(this, e); + } + return true; + } + + // Callback for Stage KeyEventsignal + private void OnStageKey(IntPtr data) + { + KeyEventArgs e = new KeyEventArgs(); + e.Key = Tizen.NUI.Key.GetKeyFromPtr(data); + + + if (_stageKeyHandler != null) + { + //here we send all data to user event handlers + _stageKeyHandler(this, e); + } + } + + // Callback for Stage EventProcessingFinishedSignal + private void OnEventProcessingFinished() + { + if (_stageEventProcessingFinishedEventHandler != null) + { + _stageEventProcessingFinishedEventHandler(this, null); + } + } + + // Callback for Stage ContextLostSignal + private void OnContextLost() + { + if (_stageContextLostEventHandler != null) + { + _stageContextLostEventHandler(this, null); + } + } + + // Callback for Stage ContextRegainedSignal + private void OnContextRegained() { - get + if (_stageContextRegainedEventHandler != null) { - return GetDpi(); + _stageContextRegainedEventHandler(this, null); } } - /// - /// The layer count property (read-only).
- /// Queries the number of on-Window layers.
- ///
- /// 3 - public uint LayerCount + // Callback for Stage SceneCreatedSignal + private void OnSceneCreated() { - get + if (_stageSceneCreatedEventHandler != null) { - return GetLayerCount(); + _stageSceneCreatedEventHandler(this, null); } } - - /// - /// Adds a layer to the stage. - /// - /// Layer to add. - /// 3 - public void AddLayer(Layer layer) + private void OnResized(IntPtr windowSize) { - NDalicPINVOKE.Stage_Add(stageCPtr, Layer.getCPtr(layer)); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + ResizedEventArgs e = new ResizedEventArgs(); + var val = new Uint16Pair(windowSize, false); + e.WindowSize = new Size2D(val.GetWidth(), val.GetHeight()); + val.Dispose(); - LayersChildren.Add(layer); + if (_windowResizedEventHandler != null) + { + _windowResizedEventHandler(this, e); + } } - /// - /// Removes a layer from the stage. - /// - /// Layer to remove. - /// 3 - public void RemoveLayer(Layer layer) + private void OnWindowFocusedChanged2(bool focusGained) { - NDalicPINVOKE.Stage_Remove(stageCPtr, Layer.getCPtr(layer)); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + FocusChangedEventArgs e = new FocusChangedEventArgs(); - LayersChildren.Remove(layer); + e.FocusGained = focusGained; + + if (_windowFocusChangedEventHandler2 != null) + { + _windowFocusChangedEventHandler2(this, e); + } } /// - /// Please do not use! this will be deprecated + /// The focus changed event argument. /// /// 3 - [Obsolete("Please do not use! This will be deprecated! Please use FocusChangedEventArgs instead! " + - "Like: " + - "Window.Instance.FocusChanged = OnFocusChanged; " + - "private void OnFocusChanged(object source, Window.FocusChangedEventArgs args) {...}")] - [EditorBrowsable(EditorBrowsableState.Never)] - public class WindowFocusChangedEventArgs : EventArgs + public class FocusChangedEventArgs : EventArgs { /// - /// Please do not use! this will be deprecated + /// FocusGained flag. /// /// 3 public bool FocusGained @@ -1609,121 +1619,147 @@ namespace Tizen.NUI } } - private WindowFocusChangedEventCallbackType _windowFocusChangedEventCallback2; - [UnmanagedFunctionPointer(CallingConvention.StdCall)] - private delegate void WindowFocusChangedEventCallbackType2(bool focusGained); - private event EventHandler _windowFocusChangedEventHandler2; - /// - /// Please do not use! this will be deprecated. Please use 'FocusChanged' event instead. + /// The touch event argument. /// /// 3 - /// Please do not use! this will be deprecated! - /// Instead please use FocusChanged. - [Obsolete("Please do not use! This will be deprecated! Please use FocusChanged instead! " + - "Like: " + - "Window.Instance.FocusChanged = OnFocusChanged; " + - "private void OnFocusChanged(object source, Window.FocusChangedEventArgs args) {...}")] - [EditorBrowsable(EditorBrowsableState.Never)] - public event EventHandler WindowFocusChanged + public class TouchEventArgs : EventArgs { - add + private Touch _touch; + + /// + /// Touch. + /// + /// 3 + public Touch Touch { - if (_windowFocusChangedEventHandler2 == null) + get { - _windowFocusChangedEventCallback2 = OnWindowFocusedChanged2; - WindowFocusChangedSignal().Connect(_windowFocusChangedEventCallback2); + return _touch; } - - _windowFocusChangedEventHandler2 += value; - } - remove - { - _windowFocusChangedEventHandler2 -= value; - - if (_windowFocusChangedEventHandler2 == null && WindowFocusChangedSignal().Empty() == false && _windowFocusChangedEventCallback2 != null) + set { - WindowFocusChangedSignal().Disconnect(_windowFocusChangedEventCallback2); + _touch = value; } } } - private void OnWindowFocusedChanged2(bool focusGained) + /// + /// Wheel event arguments. + /// + /// 3 + public class WheelEventArgs : EventArgs { - FocusChangedEventArgs e = new FocusChangedEventArgs(); - - e.FocusGained = focusGained; + private Wheel _wheel; - if (_windowFocusChangedEventHandler2 != null) + /// + /// Wheel. + /// + /// 3 + public Wheel Wheel { - _windowFocusChangedEventHandler2(this, e); + get + { + return _wheel; + } + set + { + _wheel = value; + } } } /// - /// Gets or sets a size of the window. + /// Key event arguments. /// - /// 4 - public Size2D WindowSize + /// 3 + public class KeyEventArgs : EventArgs { - get - { - return GetWindowSize(); - } - set + private Key _key; + + /// + /// Key. + /// + /// 3 + public Key Key { - SetWindowSize(value); + get + { + return _key; + } + set + { + _key = value; + } } } /// - /// Gets or sets a position of the window. + /// Sets position and size of the window. This API guarantees that + /// both moving and resizing of window will appear on the screen at once. /// - /// 4 - public Position2D WindowPosition + [EditorBrowsable(EditorBrowsableState.Never)] + public Rectangle WindowPositionSize { get { - return GetPosition(); + Position2D position = GetPosition(); + Size2D size = GetSize(); + Rectangle ret = new Rectangle(position.X, position.Y, size.Width, size.Height); + return ret; } set { - SetPosition(value); + SetPositionSize(value); } } /// /// Feeds a key event into the window. + /// This resized event arguments. /// - /// The key event to feed. - /// 5 - public void FeedKey(Key keyEvent) + /// 3 + public class ResizedEventArgs : EventArgs { - NDalicManualPINVOKE.Window_FeedKeyEvent(Key.getCPtr(keyEvent)); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } + Size2D _windowSize; - /// - /// Feed a key-event into the window. - /// - /// The key event to feed. - /// 4 - [Obsolete("Please do not use! This will be deprecated! Please use FeedKey(Key keyEvent) instead!")] - public static void FeedKeyEvent(Key keyEvent) - { - NDalicManualPINVOKE.Window_FeedKeyEvent(Key.getCPtr(keyEvent)); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + /// + /// This window size. + /// + /// 4 + public Size2D WindowSize + { + get + { + return _windowSize; + } + set + { + _windowSize = value; + } + } } /// - /// Allows at least one more render, even when paused. - /// The window should be shown, not minimised. + /// Please do not use! this will be deprecated /// - /// 4 - public void RenderOnce() + /// 3 + [Obsolete("Please do not use! This will be deprecated! Please use FocusChangedEventArgs instead! " + + "Like: " + + "Window.Instance.FocusChanged = OnFocusChanged; " + + "private void OnFocusChanged(object source, Window.FocusChangedEventArgs args) {...}")] + [EditorBrowsable(EditorBrowsableState.Never)] + public class WindowFocusChangedEventArgs : EventArgs { - NDalicManualPINVOKE.Window_RenderOnce(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + /// + /// Please do not use! this will be deprecated + /// + /// 3 + public bool FocusGained + { + get; + set; + } } /// @@ -1762,5 +1798,63 @@ namespace Tizen.NUI } } + /// + /// Disconnect all native signals + /// + /// 5 + internal void DisconnectNativeSignals() + { + if( _windowFocusChangedEventCallback != null ) + { + WindowFocusChangedSignal().Disconnect(_windowFocusChangedEventCallback); + } + + if( _rootLayerTouchDataCallback != null ) + { + TouchDataSignal().Disconnect(_rootLayerTouchDataCallback); + } + + if( _wheelEventCallback != null ) + { + StageWheelEventSignal().Disconnect(_wheelEventCallback); + } + + if( _stageKeyCallbackDelegate != null ) + { + KeyEventSignal().Disconnect(_stageKeyCallbackDelegate); + } + + if( _stageEventProcessingFinishedEventCallbackDelegate != null ) + { + EventProcessingFinishedSignal().Disconnect(_stageEventProcessingFinishedEventCallbackDelegate); + } + + if( _stageContextLostEventCallbackDelegate != null ) + { + ContextLostSignal().Disconnect(_stageContextLostEventCallbackDelegate); + } + + if( _stageContextRegainedEventCallbackDelegate != null ) + { + ContextRegainedSignal().Disconnect(_stageContextRegainedEventCallbackDelegate); + } + + if( _stageSceneCreatedEventCallbackDelegate != null ) + { + SceneCreatedSignal().Disconnect(_stageSceneCreatedEventCallbackDelegate); + } + + if( _windowResizedEventCallback != null ) + { + ResizedSignal().Disconnect(_windowResizedEventCallback); + } + + if( _windowFocusChangedEventCallback2 != null ) + { + WindowFocusChangedSignal().Disconnect(_windowFocusChangedEventCallback2); + } + + } + } } diff --git a/test/NUITestSample/NUITestSample/examples/text-test3.cs b/test/NUITestSample/NUITestSample/examples/text-test3.cs new file mode 100755 index 0000000..9eeb95b --- /dev/null +++ b/test/NUITestSample/NUITestSample/examples/text-test3.cs @@ -0,0 +1,121 @@ +/* +* Copyright (c) 2017 Samsung Electronics Co., Ltd. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +* +*/ + +using System; +using Tizen.NUI; +using Tizen.NUI.BaseComponents; +using Tizen.NUI.UIComponents; + +namespace Tizen.NUI.Examples +{ + public class TextPropertyTest : NUIApplication + { + TextLabel label1; + TextLabel label2; + TextField field1; + TextField field2; + TextEditor editor1; + TextEditor editor2; + Window window; + + protected override void OnCreate() + { + base.OnCreate(); + window = Window.Instance; + window.BackgroundColor = Color.White; + label1 = new TextLabel() + { + Size2D = new Size2D(300, 156), + Position2D = new Position2D(100, 300), + BackgroundColor = Color.Green, + PointSize = 28, + Focusable = true, + MultiLine = true, + HorizontalAlignment = HorizontalAlignment.End, + MatchSystemLanguageDirection = false, + Text = "Hello world \nﻡﺮﺤﺑﺍ." + }; + + label2 = new TextLabel() + { + Size2D = new Size2D(300, 156), + Position2D = new Position2D(100, 500), + BackgroundColor = Color.Green, + PointSize = 28, + Focusable = true, + MultiLine = true, + HorizontalAlignment = HorizontalAlignment.End, + MatchSystemLanguageDirection = true, + Text = "Hello world \nﻡﺮﺤﺑﺍ." + }; + field1 = new TextField() + { + Size2D = new Size2D(300, 156), + Position2D = new Position2D(500, 300), + BackgroundColor = Color.Yellow, + PointSize = 28, + Focusable = true, + HorizontalAlignment = HorizontalAlignment.End, + MatchSystemLanguageDirection = false, + Text = "ﻡﺮﺤﺑﺍ." + }; + + field2 = new TextField() + { + Size2D = new Size2D(300, 156), + Position2D = new Position2D(500, 500), + BackgroundColor = Color.Yellow, + PointSize = 28, + Focusable = true, + + HorizontalAlignment = HorizontalAlignment.End, + MatchSystemLanguageDirection = true, + Text = "ﻡﺮﺤﺑﺍ." + }; + editor1 = new TextEditor() + { + Size2D = new Size2D(300, 156), + Position2D = new Position2D(900, 300), + BackgroundColor = Color.Cyan, + PointSize = 28, + Focusable = true, + HorizontalAlignment = HorizontalAlignment.End, + MatchSystemLanguageDirection = false, + Text = "Hello world \nﻡﺮﺤﺑﺍ." + }; + + editor2 = new TextEditor() + { + Size2D = new Size2D(300, 156), + Position2D = new Position2D(900, 500), + BackgroundColor = Color.Cyan, + PointSize = 28, + Focusable = true, + HorizontalAlignment = HorizontalAlignment.End, + MatchSystemLanguageDirection = true, + Text = "Hello world \nﻡﺮﺤﺑﺍ." + }; + + window.Add(label1); + window.Add(label2); + window.Add(field1); + window.Add(field2); + window.Add(editor1); + window.Add(editor2); + } + } +}