From: dongsug.song Date: Sat, 14 Oct 2017 10:31:27 +0000 (+0900) Subject: [NUI] nui 60 version integration X-Git-Tag: preview1-00302^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F95%2F155595%2F2;p=platform%2Fcore%2Fcsapi%2Ftizenfx.git [NUI] nui 60 version integration merged patches : - [Tizen] fix Text low quality issue caused by Color value check - Add C# binding for web view lite. - [Tizen] Add start and end property in PaddingType - [Tizen] Add WatchApplication/WatchTime for nui - [Tizen] Fix crash caused by GetPropertyIndex not converting to DALi property format - [Tizen] Scene Graph support in NUI - [4.0] Fast bounding-box clipping feature: NUI Wrapper - Add Finalize api for ImfManager - [Tizen] Enhance Application device signals - [4.0] add TextField Ellipsis, Key Subclass - Dispose Children when Parent is being disposed. - Migration of devel api to public - Changes required after TextLabel Devel properties were made public - (TextField) Rename ShowDuration to ShowLastCharacterDuration - [4.0] fix build error for 60 ver. integration Change-Id: I22050544215771037f82b053d71df8d782de4a57 Signed-off-by: dongsug.song --- diff --git a/src/Tizen.NUI/src/internal/Application.cs b/src/Tizen.NUI/src/internal/Application.cs index d95964c..29f16b7 100755 --- a/src/Tizen.NUI/src/internal/Application.cs +++ b/src/Tizen.NUI/src/internal/Application.cs @@ -220,20 +220,20 @@ namespace Tizen.NUI */ internal class NUIApplicationBatteryLowEventArgs : EventArgs { - private Application _application; + private Application.BatteryStatus _status; /** * @brief Application - is the application that is being affected when the battery level of the device is low * */ - public Application Application + public Application.BatteryStatus BatteryStatus { get { - return _application; + return _status; } set { - _application = value; + _status = value; } } } @@ -244,20 +244,20 @@ namespace Tizen.NUI */ internal class NUIApplicationMemoryLowEventArgs : EventArgs { - private Application _application; + private Application.MemoryStatus _status; /** * @brief Application - is the application that is being affected when the memory level of the device is low * */ - public Application Application + public Application.MemoryStatus MemoryStatus { get { - return _application; + return _status; } set { - _application = value; + _status = value; } } } @@ -403,6 +403,20 @@ namespace Tizen.NUI base.Dispose(type); } + public enum BatteryStatus + { + Normal, + CriticalLow, + PowerOff + }; + + public enum MemoryStatus + { + Normal, + SoftWarning, + HardWarning + }; + [UnmanagedFunctionPointer(CallingConvention.StdCall)] private delegate void NUIApplicationInitEventCallbackDelegate(IntPtr application); private DaliEventHandler _applicationInitEventHandler; @@ -447,12 +461,12 @@ namespace Tizen.NUI private NUIApplicationRegionChangedEventCallbackDelegate _applicationRegionChangedEventCallbackDelegate; [UnmanagedFunctionPointer(CallingConvention.StdCall)] - private delegate void NUIApplicationBatteryLowEventCallbackDelegate(IntPtr application); + private delegate void NUIApplicationBatteryLowEventCallbackDelegate(BatteryStatus status); private DaliEventHandler _applicationBatteryLowEventHandler; private NUIApplicationBatteryLowEventCallbackDelegate _applicationBatteryLowEventCallbackDelegate; [UnmanagedFunctionPointer(CallingConvention.StdCall)] - private delegate void NUIApplicationMemoryLowEventCallbackDelegate(IntPtr application); + private delegate void NUIApplicationMemoryLowEventCallbackDelegate(MemoryStatus status); private DaliEventHandler _applicationMemoryLowEventHandler; private NUIApplicationMemoryLowEventCallbackDelegate _applicationMemoryLowEventCallbackDelegate; @@ -899,12 +913,12 @@ namespace Tizen.NUI } // Callback for Application BatteryLowSignal - private void OnNUIApplicationBatteryLow(IntPtr data) + private void OnNUIApplicationBatteryLow(BatteryStatus status) { NUIApplicationBatteryLowEventArgs e = new NUIApplicationBatteryLowEventArgs(); // Populate all members of "e" (NUIApplicationBatteryLowEventArgs) with real data - e.Application = Application.GetApplicationFromPtr(data); + e.BatteryStatus = status; if (_applicationBatteryLowEventHandler != null) { @@ -949,12 +963,12 @@ namespace Tizen.NUI } // Callback for Application MemoryLowSignal - private void OnNUIApplicationMemoryLow(IntPtr data) + private void OnNUIApplicationMemoryLow(MemoryStatus status) { NUIApplicationMemoryLowEventArgs e = new NUIApplicationMemoryLowEventArgs(); // Populate all members of "e" (NUIApplicationMemoryLowEventArgs) with real data - e.Application = Application.GetApplicationFromPtr(data); + e.MemoryStatus = status; if (_applicationMemoryLowEventHandler != null) { @@ -1236,6 +1250,21 @@ namespace Tizen.NUI return ret; } + public string GetLanguage() + { + string ret = NDalicPINVOKE.Application_GetLanguage(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + public string GetRegion() + { + string ret = NDalicPINVOKE.Application_GetRegion(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + internal ApplicationSignal InitSignal() { ApplicationSignal ret = new ApplicationSignal(NDalicPINVOKE.Application_InitSignal(swigCPtr), false); @@ -1299,16 +1328,16 @@ namespace Tizen.NUI return ret; } - internal ApplicationSignal BatteryLowSignal() + internal LowBatterySignalType BatteryLowSignal() { - ApplicationSignal ret = new ApplicationSignal(NDalicPINVOKE.Application_BatteryLowSignal(swigCPtr), false); + LowBatterySignalType ret = new LowBatterySignalType(NDalicPINVOKE.Application_BatteryLowSignal(swigCPtr), false); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } - internal ApplicationSignal MemoryLowSignal() + internal LowMemorySignalType MemoryLowSignal() { - ApplicationSignal ret = new ApplicationSignal(NDalicPINVOKE.Application_MemoryLowSignal(swigCPtr), false); + LowMemorySignalType ret = new LowMemorySignalType(NDalicPINVOKE.Application_MemoryLowSignal(swigCPtr), false); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } diff --git a/src/Tizen.NUI/src/internal/LowBatterySignalType.cs b/src/Tizen.NUI/src/internal/LowBatterySignalType.cs new file mode 100755 index 0000000..01281e2 --- /dev/null +++ b/src/Tizen.NUI/src/internal/LowBatterySignalType.cs @@ -0,0 +1,188 @@ +/* + * 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 +{ + + /// + /// LowBatterySignalType. + /// + internal class LowBatterySignalType : global::System.IDisposable + { + private global::System.Runtime.InteropServices.HandleRef swigCPtr; + + /// + /// swigCMemOwn. + /// + protected bool swigCMemOwn; + + internal LowBatterySignalType(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(LowBatterySignalType 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; + + + /// + /// Distructor. + /// + ~LowBatterySignalType() + { + if (!isDisposeQueued) + { + isDisposeQueued = true; + DisposeQueue.Instance.Add(this); + } + } + + /// + /// Dispose. + /// + 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); + } + } + + /// + /// you can override it to clean-up your own resources. + /// + /// 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_LowBatterySignalType(swigCPtr); + } + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); + } + disposed = true; + } + + /// + /// Empty + /// + /// true if there is no signal attached + public bool Empty() + { + bool ret = NDalicPINVOKE.LowBatterySignalType_Empty(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + /// + /// GetConnectionCount + /// + /// number of attached signals + public uint GetConnectionCount() + { + uint ret = NDalicPINVOKE.LowBatterySignalType_GetConnectionCount(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + /// + /// signal connect + /// + /// + public void Connect(System.Delegate func) + { + System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); + { + NDalicPINVOKE.LowBatterySignalType_Connect(swigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip)); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + } + + /// + /// signal disconnect + /// + /// + public void Disconnect(System.Delegate func) + { + System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); + { + NDalicPINVOKE.LowBatterySignalType_Disconnect(swigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip)); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + } + + internal void Emit(Application.BatteryStatus arg) + { + NDalicPINVOKE.LowBatterySignalType_Emit(swigCPtr, (int)arg); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + /// + /// LowBatterySignalType + /// + public LowBatterySignalType() : this(NDalicPINVOKE.new_LowBatterySignalType(), true) + { + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + } + +} + diff --git a/src/Tizen.NUI/src/internal/LowMemorySignalType.cs b/src/Tizen.NUI/src/internal/LowMemorySignalType.cs new file mode 100755 index 0000000..487c1e8 --- /dev/null +++ b/src/Tizen.NUI/src/internal/LowMemorySignalType.cs @@ -0,0 +1,146 @@ +/* + * 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 class LowMemorySignalType : global::System.IDisposable + { + private global::System.Runtime.InteropServices.HandleRef swigCPtr; + protected bool swigCMemOwn; + + internal LowMemorySignalType(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(LowMemorySignalType 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; + + ~LowMemorySignalType() + { + 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_LowMemorySignalType(swigCPtr); + } + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); + } + disposed = true; + } + + public bool Empty() + { + bool ret = NDalicPINVOKE.LowMemorySignalType_Empty(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + public uint GetConnectionCount() + { + uint ret = NDalicPINVOKE.LowMemorySignalType_GetConnectionCount(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + public void Connect(System.Delegate func) + { + System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); + { + NDalicPINVOKE.LowMemorySignalType_Connect(swigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip)); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + } + + public void Disconnect(System.Delegate func) + { + System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); + { + NDalicPINVOKE.LowMemorySignalType_Disconnect(swigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip)); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + } + + internal void Emit(Application.MemoryStatus arg) + { + NDalicPINVOKE.LowMemorySignalType_Emit(swigCPtr, (int)arg); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + public LowMemorySignalType() : this(NDalicPINVOKE.new_LowMemorySignalType(), true) + { + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + } + +} diff --git a/src/Tizen.NUI/src/internal/ManualPINVOKE.cs b/src/Tizen.NUI/src/internal/ManualPINVOKE.cs index 18432e3..28d7154 100755 --- a/src/Tizen.NUI/src/internal/ManualPINVOKE.cs +++ b/src/Tizen.NUI/src/internal/ManualPINVOKE.cs @@ -369,6 +369,9 @@ namespace Tizen.NUI [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_delete_ImfManager_ImfCallbackData")] public static extern void delete_ImfManager_ImfCallbackData(global::System.Runtime.InteropServices.HandleRef jarg1); + [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_ImfManager_Finalize")] + public static extern void ImfManager_Finalize(global::System.Runtime.InteropServices.HandleRef jarg1); + [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_ImfManager_Get")] public static extern global::System.IntPtr ImfManager_Get(); @@ -644,6 +647,9 @@ namespace Tizen.NUI [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_TextField_Property_PLACEHOLDER_get")] public static extern int TextField_Property_PLACEHOLDER_get(); + [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_TextField_Property_ELLIPSIS_get")] + public static extern int TextField_Property_ELLIPSIS_get(); + [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_TextLabel_Property_PIXEL_SIZE_get")] public static extern int TextLabel_Property_PIXEL_SIZE_get(); @@ -671,8 +677,9 @@ namespace Tizen.NUI [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint = "CSharp_HIDDENINPUT_PROPERTY_SUBSTITUTE_COUNT_get")] public static extern int HIDDENINPUT_PROPERTY_SUBSTITUTE_COUNT_get(); - [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint = "CSharp_HIDDENINPUT_PROPERTY_SHOW_DURATION_get")] - public static extern int HIDDENINPUT_PROPERTY_SHOW_DURATION_get(); + [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint = "CSharp_HIDDENINPUT_PROPERTY_SHOW_LAST_CHARACTER_DURATION_get")] + public static extern int HIDDENINPUT_PROPERTY_SHOW_LAST_CHARACTER_DURATION_get(); + [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_TtsPlayer_SWIGUpcast")] public static extern global::System.IntPtr TtsPlayer_SWIGUpcast(global::System.IntPtr jarg1); @@ -1329,5 +1336,123 @@ namespace Tizen.NUI [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_Adaptor_RenderOnce")] public static extern void Window_RenderOnce(global::System.Runtime.InteropServices.HandleRef jarg1); + //for watch + [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_new_WatchTime")] + public static extern global::System.IntPtr new_WatchTime(); + + [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_delete_WatchTime")] + public static extern void delete_WatchTime(global::System.Runtime.InteropServices.HandleRef jarg1); + + [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_WatchTime_GetHour")] + public static extern int WatchTime_GetHour(global::System.Runtime.InteropServices.HandleRef jarg1); + + [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_WatchTime_GetHour24")] + public static extern int WatchTime_GetHour24(global::System.Runtime.InteropServices.HandleRef jarg1); + + [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_WatchTime_GetMinute")] + public static extern int WatchTime_GetMinute(global::System.Runtime.InteropServices.HandleRef jarg1); + + [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_WatchTime_GetSecond")] + public static extern int WatchTime_GetSecond(global::System.Runtime.InteropServices.HandleRef jarg1); + + [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_WatchTime_GetMillisecond")] + public static extern int WatchTime_GetMillisecond(global::System.Runtime.InteropServices.HandleRef jarg1); + + [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_WatchTime_GetYear")] + public static extern int WatchTime_GetYear(global::System.Runtime.InteropServices.HandleRef jarg1); + + [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_WatchTime_GetMonth")] + public static extern int WatchTime_GetMonth(global::System.Runtime.InteropServices.HandleRef jarg1); + + [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_WatchTime_GetDay")] + public static extern int WatchTime_GetDay(global::System.Runtime.InteropServices.HandleRef jarg1); + + [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_WatchTime_GetDayOfWeek")] + public static extern int WatchTime_GetDayOfWeek(global::System.Runtime.InteropServices.HandleRef jarg1); + + [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_WatchTime_GetUtcTime")] + public static extern global::System.IntPtr WatchTime_GetUtcTime(global::System.Runtime.InteropServices.HandleRef jarg1); + + [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_WatchTime_GetUtcTimeStamp")] + public static extern global::System.IntPtr WatchTime_GetUtcTimeStamp(global::System.Runtime.InteropServices.HandleRef jarg1); + + [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_WatchTime_GetTimeZone")] + public static extern string WatchTime_GetTimeZone(global::System.Runtime.InteropServices.HandleRef jarg1); + + [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_WatchTime_GetDaylightSavingTimeStatus")] + public static extern bool WatchTime_GetDaylightSavingTimeStatus(global::System.Runtime.InteropServices.HandleRef jarg1); + + [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_WatchApplication_New__SWIG_0")] + public static extern global::System.IntPtr WatchApplication_New__SWIG_0(); + + [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_WatchApplication_New__SWIG_1")] + public static extern global::System.IntPtr WatchApplication_New__SWIG_1(int jarg1, string jarg2); + + [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_WatchApplication_New__SWIG_2")] + public static extern global::System.IntPtr WatchApplication_New__SWIG_2(int jarg1, string jarg2, string jarg3); + + [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_new_WatchApplication__SWIG_0")] + public static extern global::System.IntPtr new_WatchApplication__SWIG_0(); + + [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_new_WatchApplication__SWIG_1")] + public static extern global::System.IntPtr new_WatchApplication__SWIG_1(global::System.Runtime.InteropServices.HandleRef jarg1); + + [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_WatchApplication_Assign")] + public static extern global::System.IntPtr WatchApplication_Assign(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2); + + [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_delete_WatchApplication")] + public static extern void delete_WatchApplication(global::System.Runtime.InteropServices.HandleRef jarg1); + + [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_WatchApplication_TimeTickSignal")] + public static extern global::System.IntPtr WatchApplication_TimeTickSignal(global::System.Runtime.InteropServices.HandleRef jarg1); + + [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_WatchApplication_AmbientTickSignal")] + public static extern global::System.IntPtr WatchApplication_AmbientTickSignal(global::System.Runtime.InteropServices.HandleRef jarg1); + + [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_WatchApplication_AmbientChangedSignal")] + public static extern global::System.IntPtr WatchApplication_AmbientChangedSignal(global::System.Runtime.InteropServices.HandleRef jarg1); + + //for watch signal + [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_WatchTimeSignal_Empty")] + public static extern bool WatchTimeSignal_Empty(global::System.Runtime.InteropServices.HandleRef jarg1); + + [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_WatchTimeSignal_GetConnectionCount")] + public static extern uint WatchTimeSignal_GetConnectionCount(global::System.Runtime.InteropServices.HandleRef jarg1); + + [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_WatchTimeSignal_Connect")] + public static extern void WatchTimeSignal_Connect(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2); + + [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_WatchTimeSignal_Disconnect")] + public static extern void WatchTimeSignal_Disconnect(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2); + + [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_WatchTimeSignal_Emit")] + public static extern void WatchTimeSignal_Emit(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2, global::System.Runtime.InteropServices.HandleRef jarg3); + + [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_new_WatchTimeSignal")] + public static extern global::System.IntPtr new_WatchTimeSignal(); + + [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_delete_WatchTimeSignal")] + public static extern void delete_WatchTimeSignal(global::System.Runtime.InteropServices.HandleRef jarg1); + + [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_WatchBoolSignal_Empty")] + public static extern bool WatchBoolSignal_Empty(global::System.Runtime.InteropServices.HandleRef jarg1); + + [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_WatchBoolSignal_GetConnectionCount")] + public static extern uint WatchBoolSignal_GetConnectionCount(global::System.Runtime.InteropServices.HandleRef jarg1); + + [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_WatchBoolSignal_Connect")] + public static extern void WatchBoolSignal_Connect(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2); + + [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_WatchBoolSignal_Disconnect")] + public static extern void WatchBoolSignal_Disconnect(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2); + + [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_WatchBoolSignal_Emit")] + public static extern void WatchBoolSignal_Emit(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2, bool jarg3); + + [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_new_WatchBoolSignal")] + public static extern global::System.IntPtr new_WatchBoolSignal(); + + [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_delete_WatchBoolSignal")] + public static extern void delete_WatchBoolSignal(global::System.Runtime.InteropServices.HandleRef jarg1); } } diff --git a/src/Tizen.NUI/src/internal/NDalicPINVOKE.cs b/src/Tizen.NUI/src/internal/NDalicPINVOKE.cs index 9ae5348..f295f0b 100755 --- a/src/Tizen.NUI/src/internal/NDalicPINVOKE.cs +++ b/src/Tizen.NUI/src/internal/NDalicPINVOKE.cs @@ -3252,6 +3252,9 @@ class NDalicPINVOKE { [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_GetDeviceClass")] public static extern int GetDeviceClass(global::System.Runtime.InteropServices.HandleRef jarg1); + [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_GetDeviceSubClass")] + public static extern int GetDeviceSubClass(global::System.Runtime.InteropServices.HandleRef jarg1); + [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_Actor_Property_PARENT_ORIGIN_get")] public static extern int Actor_Property_PARENT_ORIGIN_get(); @@ -5320,23 +5323,17 @@ class NDalicPINVOKE { [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_PaddingType_Set")] public static extern void PaddingType_Set(global::System.Runtime.InteropServices.HandleRef jarg1, float jarg2, float jarg3, float jarg4, float jarg5); - [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_PaddingType_x_set")] - public static extern void PaddingType_x_set(global::System.Runtime.InteropServices.HandleRef jarg1, float jarg2); - - [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_PaddingType_x_get")] - public static extern float PaddingType_x_get(global::System.Runtime.InteropServices.HandleRef jarg1); - [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_PaddingType_left_set")] public static extern void PaddingType_left_set(global::System.Runtime.InteropServices.HandleRef jarg1, float jarg2); [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_PaddingType_left_get")] public static extern float PaddingType_left_get(global::System.Runtime.InteropServices.HandleRef jarg1); - [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_PaddingType_y_set")] - public static extern void PaddingType_y_set(global::System.Runtime.InteropServices.HandleRef jarg1, float jarg2); + [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_PaddingType_start_set")] + public static extern void PaddingType_start_set(global::System.Runtime.InteropServices.HandleRef jarg1, float jarg2); - [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_PaddingType_y_get")] - public static extern float PaddingType_y_get(global::System.Runtime.InteropServices.HandleRef jarg1); + [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_PaddingType_start_get")] + public static extern float PaddingType_start_get(global::System.Runtime.InteropServices.HandleRef jarg1); [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_PaddingType_right_set")] public static extern void PaddingType_right_set(global::System.Runtime.InteropServices.HandleRef jarg1, float jarg2); @@ -5344,11 +5341,11 @@ class NDalicPINVOKE { [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_PaddingType_right_get")] public static extern float PaddingType_right_get(global::System.Runtime.InteropServices.HandleRef jarg1); - [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_PaddingType_width_set")] - public static extern void PaddingType_width_set(global::System.Runtime.InteropServices.HandleRef jarg1, float jarg2); + [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_PaddingType_end_set")] + public static extern void PaddingType_end_set(global::System.Runtime.InteropServices.HandleRef jarg1, float jarg2); - [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_PaddingType_width_get")] - public static extern float PaddingType_width_get(global::System.Runtime.InteropServices.HandleRef jarg1); + [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_PaddingType_end_get")] + public static extern float PaddingType_end_get(global::System.Runtime.InteropServices.HandleRef jarg1); [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_PaddingType_bottom_set")] public static extern void PaddingType_bottom_set(global::System.Runtime.InteropServices.HandleRef jarg1, float jarg2); @@ -5356,12 +5353,6 @@ class NDalicPINVOKE { [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_PaddingType_bottom_get")] public static extern float PaddingType_bottom_get(global::System.Runtime.InteropServices.HandleRef jarg1); - [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_PaddingType_height_set")] - public static extern void PaddingType_height_set(global::System.Runtime.InteropServices.HandleRef jarg1, float jarg2); - - [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_PaddingType_height_get")] - public static extern float PaddingType_height_get(global::System.Runtime.InteropServices.HandleRef jarg1); - [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_PaddingType_top_set")] public static extern void PaddingType_top_set(global::System.Runtime.InteropServices.HandleRef jarg1, float jarg2); @@ -6273,11 +6264,11 @@ class NDalicPINVOKE { [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_IsOpaqueState")] public static extern bool IsOpaqueState(global::System.Runtime.InteropServices.HandleRef jarg1); - [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_SetScreenMode")] - public static extern bool SetScreenMode(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2); + [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_SetScreenOffMode")] + public static extern bool SetScreenOffMode(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2); - [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_GetScreenMode")] - public static extern int GetScreenMode(global::System.Runtime.InteropServices.HandleRef jarg1); + [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_GetScreenOffMode")] + public static extern int GetScreenOffMode(global::System.Runtime.InteropServices.HandleRef jarg1); [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_SetBrightness")] public static extern bool SetBrightness(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2); @@ -6354,6 +6345,12 @@ class NDalicPINVOKE { [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_Application_GetStereoBase")] public static extern float Application_GetStereoBase(global::System.Runtime.InteropServices.HandleRef jarg1); + [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint = "CSharp_Dali_Application_GetLanguage")] + public static extern string Application_GetLanguage(global::System.Runtime.InteropServices.HandleRef jarg1); + + [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint = "CSharp_Dali_Application_GetRegion")] + public static extern string Application_GetRegion(global::System.Runtime.InteropServices.HandleRef jarg1); + [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_Application_InitSignal")] public static extern global::System.IntPtr Application_InitSignal(global::System.Runtime.InteropServices.HandleRef jarg1); @@ -6429,9 +6426,51 @@ class NDalicPINVOKE { [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_delete_ApplicationControlSignal")] public static extern void delete_ApplicationControlSignal(global::System.Runtime.InteropServices.HandleRef jarg1); - [global::System.Runtime.InteropServices.DllImport("NDalic", EntryPoint="CSharp_Dali_Application_New__SWIG_4")] + [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_Application_New__SWIG_4")] public static extern global::System.IntPtr Application_New__SWIG_4(int jarg1, string jarg3, int jarg4, global::System.Runtime.InteropServices.HandleRef jarg5); + [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_Application_LowBatterySignalType_Empty")] + public static extern bool LowBatterySignalType_Empty(global::System.Runtime.InteropServices.HandleRef jarg1); + + [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_Application_LowBatterySignalType_GetConnectionCount")] + public static extern uint LowBatterySignalType_GetConnectionCount(global::System.Runtime.InteropServices.HandleRef jarg1); + + [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_Application_LowBatterySignalType_Connect")] + public static extern void LowBatterySignalType_Connect(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2); + + [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_Application_LowBatterySignalType_Disconnect")] + public static extern void LowBatterySignalType_Disconnect(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2); + + [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_Application_LowBatterySignalType_Emit")] + public static extern void LowBatterySignalType_Emit(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2); + + [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_Application_new_LowBatterySignalType")] + public static extern global::System.IntPtr new_LowBatterySignalType(); + + [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_Application_delete_LowBatterySignalType")] + public static extern void delete_LowBatterySignalType(global::System.Runtime.InteropServices.HandleRef jarg1); + + [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_Application_LowMemorySignalType_Empty")] + public static extern bool LowMemorySignalType_Empty(global::System.Runtime.InteropServices.HandleRef jarg1); + + [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_Application_LowMemorySignalType_GetConnectionCount")] + public static extern uint LowMemorySignalType_GetConnectionCount(global::System.Runtime.InteropServices.HandleRef jarg1); + + [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_Application_LowMemorySignalType_Connect")] + public static extern void LowMemorySignalType_Connect(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2); + + [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_Application_LowMemorySignalType_Disconnect")] + public static extern void LowMemorySignalType_Disconnect(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2); + + [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_Application_LowMemorySignalType_Emit")] + public static extern void LowMemorySignalType_Emit(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2); + + [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_Application_new_LowMemorySignalType")] + public static extern global::System.IntPtr new_LowMemorySignalType(); + + [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_Application_delete_LowMemorySignalType")] + public static extern void delete_LowMemorySignalType(global::System.Runtime.InteropServices.HandleRef jarg1); + [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_TimerSignalType_Empty")] public static extern bool TimerSignalType_Empty(global::System.Runtime.InteropServices.HandleRef jarg1); @@ -9284,9 +9323,6 @@ class NDalicPINVOKE { [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_TextLabel_Property_TEXT_COLOR_get")] public static extern int TextLabel_Property_TEXT_COLOR_get(); - [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_TextLabel_Property_TEXT_COLOR_ANIMATABLE_get")] - public static extern int TextLabel_Property_TEXT_COLOR_ANIMATABLE_get(); - [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_TextLabel_Property_SHADOW_OFFSET_get")] public static extern int TextLabel_Property_SHADOW_OFFSET_get(); @@ -11224,6 +11260,60 @@ class NDalicPINVOKE { [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_AsyncImageLoader_SWIGUpcast")] public static extern global::System.IntPtr AsyncImageLoader_SWIGUpcast(global::System.IntPtr jarg1); + + [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_WebViewLite_New")] + public static extern global::System.IntPtr WebViewLite_New(); + + [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_new_WebViewLite__SWIG_0")] + public static extern global::System.IntPtr new_WebViewLite__SWIG_0(); + + [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_delete_WebViewLite")] + public static extern void delete_WebViewLite(global::System.Runtime.InteropServices.HandleRef jarg1); + + [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_new_WebViewLite__SWIG_1")] + public static extern global::System.IntPtr new_WebViewLite__SWIG_1(global::System.Runtime.InteropServices.HandleRef jarg1); + + [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_WebViewLite_Assign")] + public static extern global::System.IntPtr WebViewLite_Assign(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2); + + [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_WebViewLite_DownCast")] + public static extern global::System.IntPtr WebViewLite_DownCast(global::System.Runtime.InteropServices.HandleRef jarg1); + + [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_WebViewLite_CreateInstance")] + public static extern void WebViewLite_CreateInstance(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2, int jarg3, int jarg4, int jarg5, string jarg6, string jarg7); + + [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_WebViewLite_DestroyInstance")] + public static extern void WebViewLite_DestroyInstance(global::System.Runtime.InteropServices.HandleRef jarg1); + + [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_WebViewLite_LoadHtml")] + public static extern void WebViewLite_LoadHtml(global::System.Runtime.InteropServices.HandleRef jarg1, string jarg2); + + [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_WebViewLite_FinishedSignal")] + public static extern global::System.IntPtr WebViewLite_FinishedSignal(global::System.Runtime.InteropServices.HandleRef jarg1); + + [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_WebViewLiteSignal_Empty")] + public static extern bool WebViewLiteSignal_Empty(global::System.Runtime.InteropServices.HandleRef jarg1); + + [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_WebViewLiteSignal_GetConnectionCount")] + public static extern uint WebViewLiteSignal_GetConnectionCount(global::System.Runtime.InteropServices.HandleRef jarg1); + + [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_WebViewLiteSignal_Connect")] + public static extern void WebViewLiteSignal_Connect(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2); + + [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_WebViewLiteSignal_Disconnect")] + public static extern void WebViewLiteSignal_Disconnect(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2); + + [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_WebViewLiteSignal_Emit")] + public static extern void WebViewLiteSignal_Emit(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2); + + [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_new_WebViewLiteSignal")] + public static extern global::System.IntPtr new_WebViewLiteSignal(); + + [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_delete_WebViewLiteSignal")] + public static extern void delete_WebViewLiteSignal(global::System.Runtime.InteropServices.HandleRef jarg1); + + [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_WebViewLite_SWIGUpcast")] + public static extern global::System.IntPtr WebViewLite_SWIGUpcast(global::System.IntPtr jarg1); } } diff --git a/src/Tizen.NUI/src/internal/NUICoreBackend.cs b/src/Tizen.NUI/src/internal/NUICoreBackend.cs index ef771dc..30a15a2 100755 --- a/src/Tizen.NUI/src/internal/NUICoreBackend.cs +++ b/src/Tizen.NUI/src/internal/NUICoreBackend.cs @@ -160,7 +160,7 @@ namespace Tizen.NUI Log.Debug("NUI", "NUICorebackend OnRegionChanged Called"); var handler = Handlers[EventType.RegionFormatChanged] as Action; // Need to make new signal return in native to return right value. - handler?.Invoke( new RegionFormatChangedEventArgs("")); + handler?.Invoke( new RegionFormatChangedEventArgs(e.Application.GetRegion())); } /// @@ -173,7 +173,24 @@ namespace Tizen.NUI Log.Debug("NUI", "NUICorebackend OnMemoryLow Called"); var handler = Handlers[EventType.LowMemory] as Action; // Need to make new signal return in native to return right value. + switch( e.MemoryStatus ) + { + case Application.MemoryStatus.Normal: + { handler?.Invoke( new LowMemoryEventArgs(LowMemoryStatus.None)); + break; + } + case Application.MemoryStatus.SoftWarning: + { + handler?.Invoke(new LowMemoryEventArgs(LowMemoryStatus.SoftWarning)); + break; + } + case Application.MemoryStatus.HardWarning: + { + handler?.Invoke(new LowMemoryEventArgs(LowMemoryStatus.HardWarning)); + break; + } + } } /// @@ -186,7 +203,7 @@ namespace Tizen.NUI Log.Debug("NUI", "NUICorebackend OnLanguageChanged Called"); var handler = Handlers[EventType.LocaleChanged] as Action; // Need to make new signal return in native to return right value. - handler?.Invoke( new LocaleChangedEventArgs("")); + handler?.Invoke( new LocaleChangedEventArgs(e.Application.GetLanguage())); } /// @@ -199,7 +216,24 @@ namespace Tizen.NUI Log.Debug("NUI", "NUICorebackend OnBatteryLow Called"); var handler = Handlers[EventType.LowBattery] as Action; // Need to make new signal return in native to return right value. + switch( e.BatteryStatus ) + { + case Application.BatteryStatus.Normal: + { handler?.Invoke(new LowBatteryEventArgs(LowBatteryStatus.None)); + break; + } + case Application.BatteryStatus.CriticalLow: + { + handler?.Invoke(new LowBatteryEventArgs(LowBatteryStatus.CriticalLow)); + break; + } + case Application.BatteryStatus.PowerOff: + { + handler?.Invoke(new LowBatteryEventArgs(LowBatteryStatus.PowerOff)); + break; + } + } } /// diff --git a/src/Tizen.NUI/src/internal/NUIEventType.cs b/src/Tizen.NUI/src/internal/NUIEventType.cs index ad3a63e..ff768cb 100755 --- a/src/Tizen.NUI/src/internal/NUIEventType.cs +++ b/src/Tizen.NUI/src/internal/NUIEventType.cs @@ -20,22 +20,32 @@ using Tizen.Applications.CoreBackend; namespace Tizen.NUI { /// - /// This class represents the type of NUI event for backends. This class can be converted from string type. + /// Class that represents the type of NUI event for backends. This class can be converted from string type. /// public class NUIEventType : EventType { /// /// Initializes the EventType class. /// - /// The name of the event type. + /// The name of event type. public NUIEventType(string name) : base(name) { } /// - /// Pre-defined event type "Reset". + /// Pre-defined event type. "TimeTick" /// - public static readonly NUIEventType Reset = "Reset"; + public static readonly NUIEventType TimeTick = "TimeTick"; + + /// + /// Pre-defined event type. "AmbientTick" + /// + public static readonly NUIEventType AmbientTick = "AmbientTick"; + + /// + /// Pre-defined event type. "AmbientChanged" + /// + public static readonly NUIEventType AmbientChanged = "AmbientChanged"; /// /// Converts a string to NUIEventType instance. diff --git a/src/Tizen.NUI/src/internal/SWIGTYPE_p_Dali__SignalT_void_fDali__Toolkit__TextEditor_Dali__Toolkit__TextEditor__InputStyle__MaskF_t.cs b/src/Tizen.NUI/src/internal/SWIGTYPE_p_Dali__SignalT_void_fDali__Toolkit__TextEditor_Dali__Toolkit__TextEditor__InputStyle.cs similarity index 100% rename from src/Tizen.NUI/src/internal/SWIGTYPE_p_Dali__SignalT_void_fDali__Toolkit__TextEditor_Dali__Toolkit__TextEditor__InputStyle__MaskF_t.cs rename to src/Tizen.NUI/src/internal/SWIGTYPE_p_Dali__SignalT_void_fDali__Toolkit__TextEditor_Dali__Toolkit__TextEditor__InputStyle.cs diff --git a/src/Tizen.NUI/src/internal/SWIGTYPE_p_time_t.cs b/src/Tizen.NUI/src/internal/SWIGTYPE_p_time_t.cs new file mode 100755 index 0000000..61b4137 --- /dev/null +++ b/src/Tizen.NUI/src/internal/SWIGTYPE_p_time_t.cs @@ -0,0 +1,40 @@ +/* + * 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 class SWIGTYPE_p_time_t + { + private global::System.Runtime.InteropServices.HandleRef swigCPtr; + + internal SWIGTYPE_p_time_t(global::System.IntPtr cPtr, bool futureUse) + { + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); + } + + protected SWIGTYPE_p_time_t() + { + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); + } + + internal static global::System.Runtime.InteropServices.HandleRef getCPtr(SWIGTYPE_p_time_t obj) + { + return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; + } + } + +} diff --git a/src/Tizen.NUI/src/internal/SWIGTYPE_p_tm.cs b/src/Tizen.NUI/src/internal/SWIGTYPE_p_tm.cs new file mode 100755 index 0000000..f56115d --- /dev/null +++ b/src/Tizen.NUI/src/internal/SWIGTYPE_p_tm.cs @@ -0,0 +1,40 @@ +/* + * 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 class SWIGTYPE_p_tm + { + private global::System.Runtime.InteropServices.HandleRef swigCPtr; + + internal SWIGTYPE_p_tm(global::System.IntPtr cPtr, bool futureUse) + { + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); + } + + protected SWIGTYPE_p_tm() + { + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); + } + + internal static global::System.Runtime.InteropServices.HandleRef getCPtr(SWIGTYPE_p_tm obj) + { + return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; + } + } +} diff --git a/src/Tizen.NUI/src/internal/WatchApplication.cs b/src/Tizen.NUI/src/internal/WatchApplication.cs new file mode 100755 index 0000000..2e89f3e --- /dev/null +++ b/src/Tizen.NUI/src/internal/WatchApplication.cs @@ -0,0 +1,385 @@ +/* + * 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 System.Runtime.InteropServices; +namespace Tizen.NUI +{ + internal class WatchApplication : Application + { + private global::System.Runtime.InteropServices.HandleRef swigCPtr; + + internal WatchApplication(global::System.IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemoryOwn) + { + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); + } + + internal static global::System.Runtime.InteropServices.HandleRef getCPtr(WatchApplication 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. + DisConnectFromSignals(); + + if (swigCPtr.Handle != global::System.IntPtr.Zero) + { + if (swigCMemOwn) + { + swigCMemOwn = false; + NDalicManualPINVOKE.delete_WatchApplication(swigCPtr); + } + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); + } + + base.Dispose(type); + } + + private void DisConnectFromSignals() + { + if (_timeTickCallback != null) + { + this.TimeTickSignal().Disconnect(_timeTickCallback); + } + if (_ambientTickCallback != null) + { + this.AmbientTickSignal().Disconnect(_ambientTickCallback); + } + if (_ambientChangedCallback != null) + { + this.AmbientChangedSignal().Disconnect(_ambientChangedCallback); + } + } + + public static WatchApplication Instance + { + get + { + return _instance; + } + } + + public static WatchApplication NewWatchApplication() + { + WatchApplication ret = New(); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + // we've got an application now connect the signals + _instance = ret; + return ret; + } + + public static WatchApplication NewWatchApplication(string[] args) + { + WatchApplication ret = New(args); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + _instance = ret; + return ret; + } + + public static WatchApplication NewWatchApplication(string[] args, string stylesheet) + { + WatchApplication ret = New(args, stylesheet); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + _instance = ret; + return ret; + } + + public new static WatchApplication New() + { + WatchApplication ret = new WatchApplication(NDalicManualPINVOKE.WatchApplication_New__SWIG_0(), true); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + public static WatchApplication New(string[] args) + { + int argc = args.Length; + string argvStr = string.Join(" ", args); + + WatchApplication ret = new WatchApplication(NDalicManualPINVOKE.WatchApplication_New__SWIG_1(argc, argvStr), true); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + public static WatchApplication New(string[] args, string stylesheet) + { + int argc = args.Length; + string argvStr = string.Join(" ", args); + + WatchApplication ret = new WatchApplication(NDalicManualPINVOKE.WatchApplication_New__SWIG_2(argc, argvStr, stylesheet), true); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + internal WatchApplication(WatchApplication implementation) : this(NDalicManualPINVOKE.new_WatchApplication__SWIG_1(WatchApplication.getCPtr(implementation)), true) + { + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + /// + /// Event arguments that passed via time tick event signal. + /// + public class TimeTickEventArgs : EventArgs + { + /// + /// Application. + /// + public Application Application + { + get; + set; + } + + /// + /// WatchTime. + /// + public WatchTime WatchTime + { + get; + set; + } + } + + [UnmanagedFunctionPointer(CallingConvention.StdCall)] + private delegate void TimeTickCallbackType(IntPtr application, IntPtr watchTime); + private TimeTickCallbackType _timeTickCallback; + private DaliEventHandler _timeTickEventHandler; + + /// + /// TimeTick event. + /// + public event DaliEventHandler TimeTick + { + add + { + if (_timeTickEventHandler == null) + { + _timeTickCallback = new TimeTickCallbackType( OnTimeTick); + TimeTickSignal().Connect(_timeTickCallback); + } + + _timeTickEventHandler += value; + } + + remove + { + _timeTickEventHandler -= value; + + if (_timeTickEventHandler == null && TimeTickSignal().Empty() == false) + { + TimeTickSignal().Disconnect(_timeTickCallback); + } + } + } + + private void OnTimeTick(IntPtr application, IntPtr watchTime) + { + TimeTickEventArgs e = new TimeTickEventArgs(); + if (application != null) + { + e.Application = Application.GetApplicationFromPtr(application); + } + if(watchTime != null) + { + e.WatchTime = WatchTime.GetWatchTimeFromPtr(watchTime); + } + + _timeTickEventHandler?.Invoke(this, e); + } + + internal WatchTimeSignal TimeTickSignal() + { + WatchTimeSignal ret = new WatchTimeSignal(NDalicManualPINVOKE.WatchApplication_TimeTickSignal(swigCPtr), false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + /// + /// Event arguments that passed via ambient tick event signal. + /// + public class AmbientTickEventArgs : EventArgs + { + /// + /// Application. + /// + public Application Application + { + get; + set; + } + + /// + /// WatchTime. + /// + public WatchTime WatchTime + { + get; + set; + } + } + + [UnmanagedFunctionPointer(CallingConvention.StdCall)] + private delegate void AmbientTickCallbackType(IntPtr application, IntPtr watchTime); + private AmbientTickCallbackType _ambientTickCallback; + private DaliEventHandler _ambientTickEventHandler; + + /// + /// AmbientTick event. + /// + public event DaliEventHandler AmbientTick + { + add + { + if (_ambientTickEventHandler == null) + { + _ambientTickCallback = new AmbientTickCallbackType( OnAmbientTick); + AmbientTickSignal().Connect(_ambientTickCallback); + } + + _ambientTickEventHandler += value; + } + + remove + { + _ambientTickEventHandler -= value; + + if (_ambientTickEventHandler == null && AmbientTickSignal().Empty() == false) + { + AmbientTickSignal().Disconnect(_ambientTickCallback); + } + } + } + + private void OnAmbientTick(IntPtr application, IntPtr watchTime) + { + AmbientTickEventArgs e = new AmbientTickEventArgs(); + if (application != null) + { + e.Application = Application.GetApplicationFromPtr(application); + } + if (watchTime != null) + { + e.WatchTime = WatchTime.GetWatchTimeFromPtr(watchTime); + } + + _ambientTickEventHandler?.Invoke(this, e); + } + + internal WatchTimeSignal AmbientTickSignal() + { + WatchTimeSignal ret = new WatchTimeSignal(NDalicManualPINVOKE.WatchApplication_AmbientTickSignal(swigCPtr), false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + /// + /// Event arguments that passed via ambient tick event signal. + /// + public class AmbientChangedEventArgs : EventArgs + { + /// + /// Application. + /// + public Application Application + { + get; + set; + } + + /// + /// Changed. + /// + public bool Changed + { + get; + set; + } + } + + [UnmanagedFunctionPointer(CallingConvention.StdCall)] + private delegate void AmbientChangedCallbackType(IntPtr application, bool changed); + private AmbientChangedCallbackType _ambientChangedCallback; + private DaliEventHandler _ambientChangedEventHandler; + + /// + /// AmbientChanged event. + /// + public event DaliEventHandler AmbientChanged + { + add + { + if (_ambientChangedEventHandler == null) + { + _ambientChangedCallback = new AmbientChangedCallbackType( OnAmbientChanged); + AmbientChangedSignal().Connect(_ambientChangedCallback); + } + + _ambientChangedEventHandler += value; + } + + remove + { + _ambientChangedEventHandler -= value; + + if (_ambientChangedEventHandler == null && AmbientChangedSignal().Empty() == false) + { + AmbientChangedSignal().Disconnect(_ambientChangedCallback); + } + } + } + + private void OnAmbientChanged(IntPtr application, bool changed) + { + AmbientChangedEventArgs e = new AmbientChangedEventArgs(); + if (application != null) + { + e.Application = Application.GetApplicationFromPtr(application); + } + e.Changed = changed; + + _ambientChangedEventHandler?.Invoke(this, e); + } + + internal WatchBoolSignal AmbientChangedSignal() + { + WatchBoolSignal ret = new WatchBoolSignal(NDalicManualPINVOKE.WatchApplication_AmbientChangedSignal(swigCPtr), false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + private static WatchApplication _instance; //singleton + + } + +} diff --git a/src/Tizen.NUI/src/internal/WatchBoolSignal.cs b/src/Tizen.NUI/src/internal/WatchBoolSignal.cs new file mode 100755 index 0000000..b9734ca --- /dev/null +++ b/src/Tizen.NUI/src/internal/WatchBoolSignal.cs @@ -0,0 +1,147 @@ +/* + * 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 class WatchBoolSignal : global::System.IDisposable + { + private global::System.Runtime.InteropServices.HandleRef swigCPtr; + protected bool swigCMemOwn; + + internal WatchBoolSignal(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(WatchBoolSignal 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; + + ~WatchBoolSignal() + { + 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_WatchBoolSignal(swigCPtr); + } + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); + } + + disposed = true; + } + + public bool Empty() + { + bool ret = NDalicManualPINVOKE.WatchBoolSignal_Empty(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + public uint GetConnectionCount() + { + uint ret = NDalicManualPINVOKE.WatchBoolSignal_GetConnectionCount(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + public void Connect(System.Delegate func) + { + System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); + { + NDalicManualPINVOKE.WatchBoolSignal_Connect(swigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip)); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + } + + public void Disconnect(System.Delegate func) + { + System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); + { + NDalicManualPINVOKE.WatchBoolSignal_Disconnect(swigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip)); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + } + + public void Emit(Application arg1, bool arg2) + { + NDalicManualPINVOKE.WatchBoolSignal_Emit(swigCPtr, Application.getCPtr(arg1), arg2); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + public WatchBoolSignal() : this(NDalicManualPINVOKE.new_WatchBoolSignal(), true) + { + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + } + +} diff --git a/src/Tizen.NUI/src/internal/WatchTimeSignal.cs b/src/Tizen.NUI/src/internal/WatchTimeSignal.cs new file mode 100755 index 0000000..b69e3ca --- /dev/null +++ b/src/Tizen.NUI/src/internal/WatchTimeSignal.cs @@ -0,0 +1,147 @@ +/* + * 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 class WatchTimeSignal : global::System.IDisposable + { + private global::System.Runtime.InteropServices.HandleRef swigCPtr; + protected bool swigCMemOwn; + + internal WatchTimeSignal(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(WatchTimeSignal 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; + + ~WatchTimeSignal() + { + 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_WatchTimeSignal(swigCPtr); + } + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); + } + + disposed = true; + } + + public bool Empty() + { + bool ret = NDalicManualPINVOKE.WatchTimeSignal_Empty(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + public uint GetConnectionCount() + { + uint ret = NDalicManualPINVOKE.WatchTimeSignal_GetConnectionCount(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + public void Connect(System.Delegate func) + { + System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); + { + NDalicManualPINVOKE.WatchTimeSignal_Connect(swigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip)); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + } + + public void Disconnect(System.Delegate func) + { + System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); + { + NDalicManualPINVOKE.WatchTimeSignal_Disconnect(swigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip)); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + } + + public void Emit(Application arg1, WatchTime arg2) + { + NDalicManualPINVOKE.WatchTimeSignal_Emit(swigCPtr, Application.getCPtr(arg1), WatchTime.getCPtr(arg2)); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + public WatchTimeSignal() : this(NDalicManualPINVOKE.new_WatchTimeSignal(), true) + { + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + } + +} diff --git a/src/Tizen.NUI/src/internal/WebViewLiteSignal.cs b/src/Tizen.NUI/src/internal/WebViewLiteSignal.cs new file mode 100755 index 0000000..e507948 --- /dev/null +++ b/src/Tizen.NUI/src/internal/WebViewLiteSignal.cs @@ -0,0 +1,181 @@ +/* + * 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 { + +/// +/// WebViewLiteSignal. +/// +public class WebViewLiteSignal : global::System.IDisposable { + private global::System.Runtime.InteropServices.HandleRef swigCPtr; + + /// + /// swigCMemOwn. + /// + protected bool swigCMemOwn; + + internal WebViewLiteSignal(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(WebViewLiteSignal 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; + + /// + /// Distructor. + /// + ~WebViewLiteSignal() + { + if (!isDisposeQueued) + { + isDisposeQueued = true; + DisposeQueue.Instance.Add(this); + } + } + + /// + /// Dispose. + /// + 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); + } + } + + /// + /// you can override it to clean-up your own resources. + /// + /// 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_WebViewLiteSignal(swigCPtr); + } + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); + } + + disposed = true; + } + + + /// + /// Empty + /// + /// true if there is no signal attached + public bool Empty() { + bool ret = NDalicPINVOKE.WebViewLiteSignal_Empty(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + /// + /// GetConnectionCount + /// + /// number of attached signals + public uint GetConnectionCount() { + uint ret = NDalicPINVOKE.WebViewLiteSignal_GetConnectionCount(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + /// + /// signal connect + /// + /// + public void Connect(System.Delegate func) { +System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); + { + NDalicPINVOKE.WebViewLiteSignal_Connect(swigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip)); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + } + + /// + /// signal disconnect + /// + /// + public void Disconnect(System.Delegate func) { +System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); + { + NDalicPINVOKE.WebViewLiteSignal_Disconnect(swigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip)); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + } + + /// + /// Emit + /// + public void Emit(WebViewLite arg) { + NDalicPINVOKE.WebViewLiteSignal_Emit(swigCPtr, WebViewLite.getCPtr(arg)); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + /// + /// WebViewLiteSignal + /// + public WebViewLiteSignal() : this(NDalicPINVOKE.new_WebViewLiteSignal(), true) { + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + +} + +} diff --git a/src/Tizen.NUI/src/public/Animatable.cs b/src/Tizen.NUI/src/public/Animatable.cs index 0bde9f0..e877c64 100755 --- a/src/Tizen.NUI/src/public/Animatable.cs +++ b/src/Tizen.NUI/src/public/Animatable.cs @@ -109,7 +109,9 @@ namespace Tizen.NUI /// 3 public int GetPropertyIndex(string name) { - int ret = NDalicPINVOKE.Handle_GetPropertyIndex(swigCPtr, name); + string daliPropertyName = name.Substring(0, 1).ToLower() + name.Substring(1); + + int ret = NDalicPINVOKE.Handle_GetPropertyIndex(swigCPtr, daliPropertyName); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } diff --git a/src/Tizen.NUI/src/public/BaseComponents/TextField.cs b/src/Tizen.NUI/src/public/BaseComponents/TextField.cs index 0e3a993..0f31a23 100755 --- a/src/Tizen.NUI/src/public/BaseComponents/TextField.cs +++ b/src/Tizen.NUI/src/public/BaseComponents/TextField.cs @@ -279,7 +279,7 @@ namespace Tizen.NUI.BaseComponents 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 class InputStyle @@ -1427,6 +1427,27 @@ namespace Tizen.NUI.BaseComponents } } + /// + /// The Ellipsis property.
+ /// Enable or disable the ellipsis.
+ /// Placeholder PropertyMap is used to add ellipsis to placeholder text. + ///
+ /// 4 + public bool Ellipsis + { + get + { + bool temp = false; + GetProperty(TextField.Property.ELLIPSIS).Get(out temp); + return temp; + } + set + { + SetProperty(TextField.Property.ELLIPSIS, new Tizen.NUI.PropertyValue(value)); + } + } + + } } \ No newline at end of file diff --git a/src/Tizen.NUI/src/public/BaseComponents/TextLabel.cs b/src/Tizen.NUI/src/public/BaseComponents/TextLabel.cs index 5665c33..e87c082 100755 --- a/src/Tizen.NUI/src/public/BaseComponents/TextLabel.cs +++ b/src/Tizen.NUI/src/public/BaseComponents/TextLabel.cs @@ -107,7 +107,6 @@ namespace Tizen.NUI.BaseComponents 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_COLOR_ANIMATABLE = NDalicPINVOKE.TextLabel_Property_TEXT_COLOR_ANIMATABLE_get(); } @@ -404,6 +403,8 @@ namespace Tizen.NUI.BaseComponents /// /// The TextColor property.
/// The color of the text.
+ /// Animation framework can be used to change the color of the text when not using mark up.
+ /// Cannot animate the color when text is auto scrolling.
///
/// 3 public Color TextColor @@ -793,27 +794,6 @@ namespace Tizen.NUI.BaseComponents } /// - /// The TextColorAnimatable property.
- /// The color of the text that can be animatated.
- /// Animation framework can be used to change the color of the text when not using mark up.
- /// Not possible when text is auto scrolling.
- ///
- /// 4 - public Color TextColorAnimatable - { - get - { - Color animatableColor = new Color(0.0f, 0.0f, 0.0f, 0.0f); - GetProperty(TextLabel.Property.TEXT_COLOR_ANIMATABLE).Get(animatableColor); - return animatableColor; - } - set - { - SetProperty(TextLabel.Property.TEXT_COLOR_ANIMATABLE, new Tizen.NUI.PropertyValue(value)); - } - } - - /// /// The line count of the text. /// /// 4 diff --git a/src/Tizen.NUI/src/public/BaseComponents/View.cs b/src/Tizen.NUI/src/public/BaseComponents/View.cs index 3cc5f0a..cd80218 100755 --- a/src/Tizen.NUI/src/public/BaseComponents/View.cs +++ b/src/Tizen.NUI/src/public/BaseComponents/View.cs @@ -28,6 +28,7 @@ namespace Tizen.NUI.BaseComponents { private global::System.Runtime.InteropServices.HandleRef swigCPtr; + internal View(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.View_SWIGUpcast(cPtr), cMemoryOwn) { swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); @@ -44,57 +45,55 @@ namespace Tizen.NUI.BaseComponents /// /// Adds a child view to this view. /// - /// - /// + /// /// 4 public override void Add(View child) { NDalicPINVOKE.Actor_Add(swigCPtr, View.getCPtr(child)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + + Children.Add(child); } /// /// Removes a child view from this View. If the view was not a child of this view, this is a no-op. /// - /// - /// + /// /// 4 public override void Remove(View child) { NDalicPINVOKE.Actor_Remove(swigCPtr, View.getCPtr(child)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + + Children.Remove(child); } /// /// Retrieves a child view by index. /// - /// - /// + /// /// 4 public override View GetChildAt(uint index) { - IntPtr cPtr = NDalicPINVOKE.Actor_GetChildAt(swigCPtr, index); - - View ret = Registry.GetManagedBaseHandleFromNativePtr(cPtr) as View; - - if (NDalicPINVOKE.SWIGPendingException.Pending) - throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret ?? null; + if (index < Children.Count) + { + return Children[Convert.ToInt32(index)]; + } + else + { + return null; + } } /// /// Retrieves the number of children held by the view. /// - /// - /// + /// protected override uint GetChildCount() { - uint ret = NDalicPINVOKE.Actor_GetChildCount(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) - throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; + return Convert.ToUInt32(Children.Count); } /// @@ -103,23 +102,14 @@ namespace Tizen.NUI.BaseComponents /// protected override Container GetParent() { - Container ret; IntPtr cPtr = NDalicPINVOKE.Actor_GetParent(swigCPtr); BaseHandle basehandle = Registry.GetManagedBaseHandleFromNativePtr(cPtr); - if(basehandle is Layer) - { - ret = basehandle as Layer; - } - else - { - ret = basehandle as View; - } - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; + + return basehandle as Container; } /// @@ -177,6 +167,13 @@ namespace Tizen.NUI.BaseComponents } base.Dispose(type); + + // Dispose all Children of this View. + foreach (View childView in Children) + { + childView?.Dispose(); + } + Children.Clear(); } private void DisConnectFromSignals() @@ -2313,6 +2310,21 @@ namespace Tizen.NUI.BaseComponents internal void Raise() { + var parentChildren = Parent?.Children; + + if (parentChildren != null) + { + int currentIndex = parentChildren.IndexOf(this); + + // If the view is not already the last item in the list. + if (currentIndex != parentChildren.Count -1) + { + View temp = parentChildren[currentIndex + 1]; + parentChildren[currentIndex + 1] = this; + parentChildren[currentIndex] = temp; + } + } + NDalicPINVOKE.Raise(swigCPtr); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); @@ -2320,6 +2332,21 @@ namespace Tizen.NUI.BaseComponents internal void Lower() { + var parentChildren = Parent?.Children; + + if (parentChildren != null) + { + int currentIndex = parentChildren.IndexOf(this); + + // If the view is not already the first item in the list. + if (currentIndex > 0) + { + View temp = parentChildren[currentIndex - 1]; + parentChildren[currentIndex - 1] = this; + parentChildren[currentIndex] = temp; + } + } + NDalicPINVOKE.Lower(swigCPtr); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); @@ -2335,6 +2362,14 @@ namespace Tizen.NUI.BaseComponents /// 3 public void RaiseToTop() { + var parentChildren = Parent?.Children; + + if (parentChildren != null) + { + parentChildren.Remove(this); + parentChildren.Add(this); + } + NDalicPINVOKE.RaiseToTop(swigCPtr); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); @@ -2350,6 +2385,14 @@ namespace Tizen.NUI.BaseComponents /// 3 public void LowerToBottom() { + var parentChildren = Parent?.Children; + + if (parentChildren != null) + { + parentChildren.Remove(this); + parentChildren.Insert(0, this); + } + NDalicPINVOKE.LowerToBottom(swigCPtr); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); @@ -2379,6 +2422,21 @@ namespace Tizen.NUI.BaseComponents /// Will be raised above this view. internal void RaiseAbove(View target) { + var parentChildren = Parent?.Children; + + if (parentChildren != null) + { + int currentIndex = parentChildren.IndexOf(this); + int targetIndex = parentChildren.IndexOf(target); + + // 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.RaiseAbove(swigCPtr, View.getCPtr(target)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); @@ -2394,7 +2452,23 @@ namespace Tizen.NUI.BaseComponents /// Will be lowered below this view. internal void LowerBelow(View target) { - NDalicPINVOKE.RaiseAbove(swigCPtr, View.getCPtr(target)); + var parentChildren = Parent?.Children; + + if (parentChildren != null) + { + int currentIndex = parentChildren.IndexOf(this); + int targetIndex = parentChildren.IndexOf(target); + + // 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.LowerBelow(swigCPtr, View.getCPtr(target)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } @@ -2454,9 +2528,7 @@ namespace Tizen.NUI.BaseComponents /// 4 public void Unparent() { - NDalicPINVOKE.Actor_Unparent(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) - throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + GetParent()?.Remove(this); } /// @@ -4052,6 +4124,8 @@ namespace Tizen.NUI.BaseComponents return ClippingModeType.Disabled; case "CLIP_CHILDREN": return ClippingModeType.ClipChildren; + case "CLIP_TO_BOUNDING_BOX": + return ClippingModeType.ClipToBoundingBox; default: return ClippingModeType.Disabled; } diff --git a/src/Tizen.NUI/src/public/Color.cs b/src/Tizen.NUI/src/public/Color.cs index 06e042d..8afc7ec 100755 --- a/src/Tizen.NUI/src/public/Color.cs +++ b/src/Tizen.NUI/src/public/Color.cs @@ -131,8 +131,7 @@ namespace Tizen.NUI public static Color operator +(Color arg1, Color arg2) { Color result = arg1.Add(arg2); - ValueCheck(result); - return result; + return ValueCheck(result); } /// @@ -145,8 +144,7 @@ namespace Tizen.NUI public static Color operator -(Color arg1, Color arg2) { Color result = arg1.Subtract(arg2); - ValueCheck(result); - return result; + return ValueCheck(result); } /// @@ -158,8 +156,7 @@ namespace Tizen.NUI public static Color operator -(Color arg1) { Color result = arg1.Subtract(); - ValueCheck(result); - return result; + return ValueCheck(result); } /// @@ -172,8 +169,7 @@ namespace Tizen.NUI public static Color operator *(Color arg1, Color arg2) { Color result = arg1.Multiply(arg2); - ValueCheck(result); - return result; + return ValueCheck(result); } /// @@ -186,8 +182,7 @@ namespace Tizen.NUI public static Color operator*(Color arg1, float arg2) { Color result = arg1.Multiply(arg2); - ValueCheck(result); - return result; + return ValueCheck(result); } /// @@ -200,8 +195,7 @@ namespace Tizen.NUI public static Color operator /(Color arg1, Color arg2) { Color result = arg1.Divide(arg2); - ValueCheck(result); - return result; + return ValueCheck(result); } /// @@ -214,8 +208,7 @@ namespace Tizen.NUI public static Color operator/(Color arg1, float arg2) { Color result = arg1.Divide(arg2); - ValueCheck(result); - return result; + return ValueCheck(result); } /// @@ -257,12 +250,8 @@ namespace Tizen.NUI /// The blue component. /// The alpha component. /// 3 - public Color(float r, float g, float b, float a) : this(NDalicPINVOKE.new_Vector4__SWIG_1(r, g, b, a), true) + 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) { - ValueCheck(ref r); - ValueCheck(ref g); - ValueCheck(ref b); - ValueCheck(ref a); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } @@ -271,12 +260,8 @@ namespace Tizen.NUI /// /// array Array of R,G,B,A. /// 3 - public Color(float[] array) : this(NDalicPINVOKE.new_Vector4__SWIG_2(array), true) + public Color(float[] array) : this(NDalicPINVOKE.new_Vector4__SWIG_2(ValueCheck(array)), true) { - ValueCheck(ref array[0]); - ValueCheck(ref array[1]); - ValueCheck(ref array[2]); - ValueCheck(ref array[3]); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } @@ -416,8 +401,7 @@ namespace Tizen.NUI { set { - ValueCheck(ref value); - NDalicPINVOKE.Vector4_r_set(swigCPtr, value); + NDalicPINVOKE.Vector4_r_set(swigCPtr, ValueCheck(value)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } get @@ -436,8 +420,7 @@ namespace Tizen.NUI { set { - ValueCheck(ref value); - NDalicPINVOKE.Vector4_g_set(swigCPtr, value); + NDalicPINVOKE.Vector4_g_set(swigCPtr, ValueCheck(value)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } get @@ -456,8 +439,7 @@ namespace Tizen.NUI { set { - ValueCheck(ref value); - NDalicPINVOKE.Vector4_b_set(swigCPtr, value); + NDalicPINVOKE.Vector4_b_set(swigCPtr, ValueCheck(value)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } get @@ -476,8 +458,7 @@ namespace Tizen.NUI { set { - ValueCheck(ref value); - NDalicPINVOKE.Vector4_a_set(swigCPtr, value); + NDalicPINVOKE.Vector4_a_set(swigCPtr, ValueCheck(value)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } get @@ -562,65 +543,86 @@ namespace Tizen.NUI return new Color(vec.R, vec.G, vec.B, vec.A); } - internal static void ValueCheck(Color color) + internal static Color ValueCheck(Color color) { if (color.R < 0.0f) { color.R = 0.0f; - Tizen.Log.Fatal("NUI", "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 (color.R > 1.0f) { color.R = 1.0f; - Tizen.Log.Fatal("NUI", "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 (color.G < 0.0f) { color.G = 0.0f; - Tizen.Log.Fatal("NUI", "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 (color.G > 1.0f) { color.G = 1.0f; - Tizen.Log.Fatal("NUI", "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 (color.B < 0.0f) { color.B = 0.0f; - Tizen.Log.Fatal("NUI", "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 (color.B > 1.0f) { color.B = 1.0f; - Tizen.Log.Fatal("NUI", "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 (color.A < 0.0f) { color.A = 0.0f; - Tizen.Log.Fatal("NUI", "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 (color.A > 1.0f) { color.A = 1.0f; - Tizen.Log.Fatal("NUI", "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 color; } - internal static void ValueCheck(ref float value) + internal static float ValueCheck(float value) { if (value < 0.0f) { value = 0.0f; - Tizen.Log.Fatal("NUI", "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) { value = 1.0f; - Tizen.Log.Fatal("NUI", "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 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 97a5630..1dc767e 100755 --- a/src/Tizen.NUI/src/public/Container.cs +++ b/src/Tizen.NUI/src/public/Container.cs @@ -16,19 +16,31 @@ */ using System; +using System.Collections.Generic; using Tizen.NUI.BaseComponents; namespace Tizen.NUI { /// - /// /// The Container is an abstract class to be inherited from by classes that desire to have views /// added to them. - /// /// public abstract class Container : Animatable { + private List _childViews = new List(); + + /// + /// List of children of Container. + /// + public List Children + { + get + { + return _childViews; + } + } + internal Container(global::System.IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemoryOwn) { // No un-managed data hence no need to store a native ptr @@ -120,4 +132,4 @@ namespace Tizen.NUI } } } -} // namespace Tizen.NUI \ No newline at end of file +} // namespace Tizen.NUI diff --git a/src/Tizen.NUI/src/public/ImfManager.cs b/src/Tizen.NUI/src/public/ImfManager.cs index 32b86fd..79cbe73 100755 --- a/src/Tizen.NUI/src/public/ImfManager.cs +++ b/src/Tizen.NUI/src/public/ImfManager.cs @@ -691,6 +691,15 @@ namespace Tizen.NUI } /// + /// Finalize the IMF.
+ ///
+ public void Finalize() + { + NDalicManualPINVOKE.ImfManager_Finalize(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + /// /// Retrieves a handle to the instance of the ImfManager. /// /// A handle to the ImfManager. diff --git a/src/Tizen.NUI/src/public/Key.cs b/src/Tizen.NUI/src/public/Key.cs index 6ee3284..c4e371d 100755 --- a/src/Tizen.NUI/src/public/Key.cs +++ b/src/Tizen.NUI/src/public/Key.cs @@ -233,7 +233,7 @@ namespace Tizen.NUI } /// - /// the device class the key event originated from. + /// Get the device class the key event originated from. /// /// 3 public DeviceClassType DeviceClass @@ -246,6 +246,19 @@ namespace Tizen.NUI } } + /// + /// Get the device subclass the key event originated from. + /// + /// 4 + public DeviceSubClassType DeviceSubClass + { + get + { + int ret = NDalicPINVOKE.GetDeviceSubClass(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return (DeviceSubClassType)ret; + } + } /// /// The default constructor. diff --git a/src/Tizen.NUI/src/public/Layer.cs b/src/Tizen.NUI/src/public/Layer.cs index e4a03ef..4d60b43 100755 --- a/src/Tizen.NUI/src/public/Layer.cs +++ b/src/Tizen.NUI/src/public/Layer.cs @@ -50,6 +50,8 @@ namespace Tizen.NUI NDalicPINVOKE.Actor_Add(swigCPtr, View.getCPtr(child)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + + Children.Add(child); } /// @@ -63,6 +65,8 @@ namespace Tizen.NUI NDalicPINVOKE.Actor_Remove(swigCPtr, View.getCPtr(child)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + + Children.Remove(child); } /// @@ -74,16 +78,17 @@ namespace Tizen.NUI /// 4 public override View GetChildAt(uint index) { - System.IntPtr cPtr = NDalicPINVOKE.Actor_GetChildAt(swigCPtr, index); - - View ret = Registry.GetManagedBaseHandleFromNativePtr(cPtr) as View; - - if (NDalicPINVOKE.SWIGPendingException.Pending) - throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - - return ret ?? null; + if (index < Children.Count) + { + return Children[Convert.ToInt32(index)]; + } + else + { + return null; + } } + /// /// Get parent of the layer. /// @@ -101,10 +106,7 @@ namespace Tizen.NUI /// 3 protected override uint GetChildCount() { - uint ret = NDalicPINVOKE.Actor_GetChildCount(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) - throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; + return Convert.ToUInt32(Children.Count); } /// @@ -140,6 +142,13 @@ namespace Tizen.NUI } base.Dispose(type); + + // Dispose all Children of this Layer. + foreach (View childView in Children) + { + childView?.Dispose(); + } + Children.Clear(); } diff --git a/src/Tizen.NUI/src/public/NUIConstants.cs b/src/Tizen.NUI/src/public/NUIConstants.cs index 4431c76..a87c3a3 100755 --- a/src/Tizen.NUI/src/public/NUIConstants.cs +++ b/src/Tizen.NUI/src/public/NUIConstants.cs @@ -197,7 +197,11 @@ namespace Tizen.NUI /// /// This actor will clip all children to within its boundaries (the actor will also be visible itself). /// - ClipChildren + ClipChildren, + /// + /// This Actor will clip all children within a screen-aligned rectangle encompassing its boundaries (the actor will also be visible itself). + /// + ClipToBoundingBox } /// @@ -262,6 +266,9 @@ namespace Tizen.NUI LastViewBehaviourFlag } + /// + /// An enum of Device Class types. + /// /// 3 public enum DeviceClassType { @@ -308,6 +315,66 @@ namespace Tizen.NUI } /// + /// An enum of Device Subclass types. + /// + /// 4 + public enum DeviceSubClassType + { + /// + /// Not a device + /// + None, + /// + /// The normal flat of your finger + /// + Finger, + /// + /// A fingernail + /// + Fingernail, + /// + /// A Knuckle + /// + Knuckle, + /// + /// The palm of a users hand + /// + Palm, + /// + /// The side of your hand + /// + HandSide, + /// + /// The flat of your hand + /// + HandFlat, + /// + /// The tip of a pen + /// + PenTip, + /// + /// A trackpad style mouse + /// + Trackpad, + /// + /// A trackpoint style mouse + /// + Trackpoint, + /// + /// A trackball style mouse + /// + Trackball, + /// + /// A remote controller + /// + Remocon, + /// + /// A virtual keyboard + /// + VirtualKeyboard + } + + /// /// This specifies all the property types.
/// Enumeration for the property types supported. ///
@@ -1324,7 +1391,7 @@ namespace Tizen.NUI /// /// Hide last character after this duration, available when SHOW_LAST_CHARACTER mode. /// - public static readonly int ShowDuration = NDalicManualPINVOKE.HIDDENINPUT_PROPERTY_SHOW_DURATION_get(); + public static readonly int ShowLastCharacterDuration = NDalicManualPINVOKE.HIDDENINPUT_PROPERTY_SHOW_LAST_CHARACTER_DURATION_get(); } /// @@ -1350,7 +1417,7 @@ namespace Tizen.NUI /// ShowCount, /// - /// Show last character for the duration (use ShowDuration property to modify duration). + /// Show last character for the duration(use ShowLastCharacterDuration property to modify duration). /// ShowLastCharacter } @@ -1877,15 +1944,15 @@ namespace Tizen.NUI /// An enum of screen mode. ///
/// 3 - public enum ScreenMode { + public enum ScreenOffMode { /// /// The mode which turns the screen off after a timeout. /// - Default, + Timout, /// /// The mode which keeps the screen turned on. /// - AlwaysOn + Never } /// diff --git a/src/Tizen.NUI/src/public/PaddingType.cs b/src/Tizen.NUI/src/public/PaddingType.cs index edcf4e0..0dc76a9 100755 --- a/src/Tizen.NUI/src/public/PaddingType.cs +++ b/src/Tizen.NUI/src/public/PaddingType.cs @@ -17,6 +17,9 @@ namespace Tizen.NUI { + + using System; + /// /// The gesture state. /// @@ -119,8 +122,11 @@ namespace Tizen.NUI } /// - /// Equality operator + /// Equality operator. /// + /// First operand + /// Second operand + /// True if the values are identical /// 3 public static bool operator ==(PaddingType a, PaddingType b) { @@ -137,15 +143,18 @@ namespace Tizen.NUI } // Return true if the fields match: - return (System.Math.Abs(a.Left - b.Left) < NDalic.GetRangedEpsilon(a.Left, b.Left)) && - (System.Math.Abs(a.Right - b.Right) < NDalic.GetRangedEpsilon(a.Right, b.Right)) && + 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. Returns Null if either operand is Null + /// Inequality operator. /// + /// First operand + /// Second operand + /// True if the values are not identical /// 3 public static bool operator !=(PaddingType a, PaddingType b) { @@ -172,8 +181,8 @@ namespace Tizen.NUI PaddingType p = (PaddingType)o; // Return true if the fields match: - return (System.Math.Abs(Left - p.Left) < NDalic.GetRangedEpsilon(Left, p.Left)) && - (System.Math.Abs(Right - p.Right) < NDalic.GetRangedEpsilon(Right, p.Right)) && + 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)); } @@ -191,7 +200,7 @@ namespace Tizen.NUI /// /// The Left value. /// - /// 3 + [Obsolete("Please do not use! this will be removed. please use Start instead")] public float Left { set @@ -205,9 +214,24 @@ namespace Tizen.NUI } /// + /// The Start value. + /// + public float Start + { + set + { + start = value; + } + get + { + return start; + } + } + + /// /// The Right value. /// - /// 3 + [Obsolete("Please do not use! this will be removed. please use End instead")] public float Right { set @@ -221,18 +245,17 @@ namespace Tizen.NUI } /// - /// The Bottom value. + /// The End value. /// - /// 3 - public float Bottom + public float End { set { - bottom = value; + end = value; } get { - return bottom; + return end; } } @@ -253,54 +276,53 @@ namespace Tizen.NUI } /// - /// Create an instance of paddingType. + /// The Bottom value. /// /// 3 - public PaddingType() : this(NDalicPINVOKE.new_PaddingType__SWIG_0(), true) + public float Bottom { - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + set + { + bottom = value; + } + get + { + return bottom; + } } /// - /// Create an instance of BaseHandle. + /// Creates an uninitialized PaddingType. /// - /// The x value. - /// The y value. - /// The width value. - /// The height value. /// 3 - public PaddingType(float x, float y, float width, float height) : this(NDalicPINVOKE.new_PaddingType__SWIG_1(x, y, width, height), true) + public PaddingType() : this(NDalicPINVOKE.new_PaddingType__SWIG_0(), true) { if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } /// - /// Set the x, y, width, height of this paddingtype. + /// PaddingType Constructor. /// - /// The x value. - /// The y value. - /// The width value. - /// The height value. - /// 3 - public void Set(float newX, float newY, float newWidth, float newHeight) + /// Start padding or X coordinate + /// End padding or Y coordinate + /// Top padding or Height + /// Bottom padding or Width + public PaddingType(float start, float end, float top, float bottom) : this(NDalicPINVOKE.new_PaddingType__SWIG_1(start, end, bottom, top), true) { - NDalicPINVOKE.PaddingType_Set(swigCPtr, newX, newY, newWidth, newHeight); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } - private float x + /// + /// Assignment from individual values. + /// + /// Start padding or X coordinate + /// End padding or Y coordinate + /// Top padding or Height + /// Bottom padding or Width + public void Set(float newStart, float newEnd, float newTop, float newBottom) { - set - { - NDalicPINVOKE.PaddingType_x_set(swigCPtr, value); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - get - { - float ret = NDalicPINVOKE.PaddingType_x_get(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } + NDalicPINVOKE.PaddingType_Set(swigCPtr, newStart, newEnd, newBottom, newTop); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } private float left @@ -318,16 +340,16 @@ namespace Tizen.NUI } } - private float y + private float start { set { - NDalicPINVOKE.PaddingType_y_set(swigCPtr, value); + NDalicPINVOKE.PaddingType_start_set(swigCPtr, value); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } get { - float ret = NDalicPINVOKE.PaddingType_y_get(swigCPtr); + float ret = NDalicPINVOKE.PaddingType_start_get(swigCPtr); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } @@ -348,66 +370,50 @@ namespace Tizen.NUI } } - private float width + private float end { set { - NDalicPINVOKE.PaddingType_width_set(swigCPtr, value); + NDalicPINVOKE.PaddingType_end_set(swigCPtr, value); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } get { - float ret = NDalicPINVOKE.PaddingType_width_get(swigCPtr); + float ret = NDalicPINVOKE.PaddingType_end_get(swigCPtr); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } } - private float bottom - { - set - { - NDalicPINVOKE.PaddingType_bottom_set(swigCPtr, value); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - get - { - float ret = NDalicPINVOKE.PaddingType_bottom_get(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - } - - private float height + private float top { set { - NDalicPINVOKE.PaddingType_height_set(swigCPtr, value); + NDalicPINVOKE.PaddingType_top_set(swigCPtr, value); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } get { - float ret = NDalicPINVOKE.PaddingType_height_get(swigCPtr); + float ret = NDalicPINVOKE.PaddingType_top_get(swigCPtr); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } } - private float top + private float bottom { set { - NDalicPINVOKE.PaddingType_top_set(swigCPtr, value); + NDalicPINVOKE.PaddingType_bottom_set(swigCPtr, value); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } get { - float ret = NDalicPINVOKE.PaddingType_top_get(swigCPtr); + float ret = NDalicPINVOKE.PaddingType_bottom_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/RelativeVector2.cs b/src/Tizen.NUI/src/public/RelativeVector2.cs index 0d455af..157ea9d 100755 --- a/src/Tizen.NUI/src/public/RelativeVector2.cs +++ b/src/Tizen.NUI/src/public/RelativeVector2.cs @@ -132,8 +132,7 @@ namespace Tizen.NUI public static RelativeVector2 operator +(RelativeVector2 arg1, RelativeVector2 arg2) { RelativeVector2 result = arg1.Add(arg2); - ValueCheck(result); - return result; + return ValueCheck(result); } /// @@ -146,8 +145,7 @@ namespace Tizen.NUI public static RelativeVector2 operator -(RelativeVector2 arg1, RelativeVector2 arg2) { RelativeVector2 result = arg1.Subtract(arg2); - ValueCheck(result); - return result; + return ValueCheck(result); } /// @@ -160,8 +158,7 @@ namespace Tizen.NUI public static RelativeVector2 operator *(RelativeVector2 arg1, RelativeVector2 arg2) { RelativeVector2 result = arg1.Multiply(arg2); - ValueCheck(result); - return result; + return ValueCheck(result); } /// @@ -174,8 +171,7 @@ namespace Tizen.NUI public static RelativeVector2 operator *(RelativeVector2 arg1, float arg2) { RelativeVector2 result = arg1.Multiply(arg2); - ValueCheck(result); - return result; + return ValueCheck(result); } /// @@ -188,8 +184,7 @@ namespace Tizen.NUI public static RelativeVector2 operator /(RelativeVector2 arg1, RelativeVector2 arg2) { RelativeVector2 result = arg1.Divide(arg2); - ValueCheck(result); - return result; + return ValueCheck(result); } /// @@ -202,8 +197,7 @@ namespace Tizen.NUI public static RelativeVector2 operator /(RelativeVector2 arg1, float arg2) { RelativeVector2 result = arg1.Divide(arg2); - ValueCheck(result); - return result; + return ValueCheck(result); } @@ -246,10 +240,8 @@ namespace Tizen.NUI /// The x component. /// The y component. /// 3 - public RelativeVector2(float x, float y) : this(NDalicPINVOKE.new_Vector2__SWIG_1(x, y), true) + public RelativeVector2(float x, float y) : this(NDalicPINVOKE.new_Vector2__SWIG_1(ValueCheck(x), ValueCheck(y)), true) { - ValueCheck(x); - ValueCheck(y); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } @@ -358,8 +350,7 @@ namespace Tizen.NUI { set { - ValueCheck(value); - NDalicPINVOKE.Vector2_X_set(swigCPtr, value); + NDalicPINVOKE.Vector2_X_set(swigCPtr, ValueCheck(value)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } get @@ -378,8 +369,7 @@ namespace Tizen.NUI { set { - ValueCheck(value); - NDalicPINVOKE.Vector2_Y_set(swigCPtr, value); + NDalicPINVOKE.Vector2_Y_set(swigCPtr, ValueCheck(value)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } get @@ -403,49 +393,50 @@ namespace Tizen.NUI /// 3 public static implicit operator RelativeVector2(Vector2 vec) { - ValueCheck(vec.X); - ValueCheck(vec.Y); - return new RelativeVector2(vec.X, vec.Y); + return new RelativeVector2(ValueCheck(vec.X), ValueCheck(vec.Y)); } - internal static void ValueCheck(RelativeVector2 relativeVector2) + internal static RelativeVector2 ValueCheck(RelativeVector2 relativeVector2) { if(relativeVector2.X < 0.0f) { relativeVector2.X = 0.0f; - Tizen.Log.Fatal("NUI", "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) { relativeVector2.X = 1.0f; - Tizen.Log.Fatal("NUI", "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) { relativeVector2.Y = 0.0f; - Tizen.Log.Fatal("NUI", "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) { relativeVector2.Y = 1.0f; - Tizen.Log.Fatal("NUI", "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 void ValueCheck(float value) + internal static float ValueCheck(float value) { if(value < 0.0f) { value = 0.0f; - Tizen.Log.Fatal("NUI", "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) { value = 1.0f; - Tizen.Log.Fatal("NUI", "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; } } } + diff --git a/src/Tizen.NUI/src/public/RelativeVector3.cs b/src/Tizen.NUI/src/public/RelativeVector3.cs index db8e241..26c5822 100755 --- a/src/Tizen.NUI/src/public/RelativeVector3.cs +++ b/src/Tizen.NUI/src/public/RelativeVector3.cs @@ -132,8 +132,7 @@ namespace Tizen.NUI public static RelativeVector3 operator +(RelativeVector3 arg1, RelativeVector3 arg2) { RelativeVector3 result = arg1.Add(arg2); - ValueCheck(result); - return result; + return ValueCheck(result); } /// @@ -146,8 +145,7 @@ namespace Tizen.NUI public static RelativeVector3 operator -(RelativeVector3 arg1, RelativeVector3 arg2) { RelativeVector3 result = arg1.Subtract(arg2); - ValueCheck(result); - return result; + return ValueCheck(result); } /// @@ -160,8 +158,7 @@ namespace Tizen.NUI public static RelativeVector3 operator *(RelativeVector3 arg1, RelativeVector3 arg2) { RelativeVector3 result = arg1.Multiply(arg2); - ValueCheck(result); - return result; + return ValueCheck(result); } /// @@ -174,8 +171,7 @@ namespace Tizen.NUI public static RelativeVector3 operator *(RelativeVector3 arg1, float arg2) { RelativeVector3 result = arg1.Multiply(arg2); - ValueCheck(result); - return result; + return ValueCheck(result); } /// @@ -188,8 +184,7 @@ namespace Tizen.NUI public static RelativeVector3 operator /(RelativeVector3 arg1, RelativeVector3 arg2) { RelativeVector3 result = arg1.Divide(arg2); - ValueCheck(result); - return result; + return ValueCheck(result); } /// @@ -202,8 +197,7 @@ namespace Tizen.NUI public static RelativeVector3 operator /(RelativeVector3 arg1, float arg2) { RelativeVector3 result = arg1.Divide(arg2); - ValueCheck(result); - return result; + return ValueCheck(result); } @@ -247,11 +241,8 @@ namespace Tizen.NUI /// The y component. /// The z component. /// 3 - public RelativeVector3(float x, float y, float z) : this(NDalicPINVOKE.new_Vector3__SWIG_1(x, y, z), true) + public RelativeVector3(float x, float y, float z) : this(NDalicPINVOKE.new_Vector3__SWIG_1(ValueCheck(x), ValueCheck(y), ValueCheck(z)), true) { - ValueCheck(x); - ValueCheck(y); - ValueCheck(z); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } @@ -360,8 +351,7 @@ namespace Tizen.NUI { set { - ValueCheck(value); - NDalicPINVOKE.Vector3_X_set(swigCPtr, value); + NDalicPINVOKE.Vector3_X_set(swigCPtr, ValueCheck(value)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } get @@ -380,8 +370,7 @@ namespace Tizen.NUI { set { - ValueCheck(value); - NDalicPINVOKE.Vector3_Y_set(swigCPtr, value); + NDalicPINVOKE.Vector3_Y_set(swigCPtr, ValueCheck(value)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } get @@ -400,8 +389,7 @@ namespace Tizen.NUI { set { - ValueCheck(value); - NDalicPINVOKE.Vector3_Z_set(swigCPtr, value); + NDalicPINVOKE.Vector3_Z_set(swigCPtr, ValueCheck(value)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } get @@ -425,60 +413,60 @@ namespace Tizen.NUI /// 3 public static implicit operator RelativeVector3(Vector3 vec) { - ValueCheck(vec.X); - ValueCheck(vec.Y); - ValueCheck(vec.Z); - return new RelativeVector3(vec.X, vec.Y, vec.Z); + return new RelativeVector3(ValueCheck(vec.X), ValueCheck(vec.Y), ValueCheck(vec.Z)); } - internal static void ValueCheck(RelativeVector3 relativeVector3) + internal static RelativeVector3 ValueCheck(RelativeVector3 relativeVector3) { if(relativeVector3.X < 0.0f) { relativeVector3.X = 0.0f; - Tizen.Log.Fatal("NUI", "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(relativeVector3.X > 1.0f) { relativeVector3.X = 1.0f; - Tizen.Log.Fatal("NUI", "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(relativeVector3.Y < 0.0f) { relativeVector3.Y = 0.0f; - Tizen.Log.Fatal("NUI", "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(relativeVector3.Y > 1.0f) { relativeVector3.Y = 1.0f; - Tizen.Log.Fatal("NUI", "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(relativeVector3.Z < 0.0f) { relativeVector3.Z = 0.0f; - Tizen.Log.Fatal("NUI", "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(relativeVector3.Z > 1.0f) { relativeVector3.Z = 1.0f; - Tizen.Log.Fatal("NUI", "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 relativeVector3; } - internal static void ValueCheck(float value) + internal static float ValueCheck(float value) { if(value < 0.0f) { value = 0.0f; - Tizen.Log.Fatal("NUI", "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) { value = 1.0f; - Tizen.Log.Fatal("NUI", "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; } } } + diff --git a/src/Tizen.NUI/src/public/RelativeVector4.cs b/src/Tizen.NUI/src/public/RelativeVector4.cs index d494f0f..d24532e 100755 --- a/src/Tizen.NUI/src/public/RelativeVector4.cs +++ b/src/Tizen.NUI/src/public/RelativeVector4.cs @@ -132,8 +132,7 @@ namespace Tizen.NUI public static RelativeVector4 operator +(RelativeVector4 arg1, RelativeVector4 arg2) { RelativeVector4 result = arg1.Add(arg2); - ValueCheck(result); - return result; + return ValueCheck(result); } /// @@ -146,8 +145,7 @@ namespace Tizen.NUI public static RelativeVector4 operator -(RelativeVector4 arg1, RelativeVector4 arg2) { RelativeVector4 result = arg1.Subtract(arg2); - ValueCheck(result); - return result; + return ValueCheck(result); } /// @@ -160,8 +158,7 @@ namespace Tizen.NUI public static RelativeVector4 operator *(RelativeVector4 arg1, RelativeVector4 arg2) { RelativeVector4 result = arg1.Multiply(arg2); - ValueCheck(result); - return result; + return ValueCheck(result); } /// @@ -174,8 +171,7 @@ namespace Tizen.NUI public static RelativeVector4 operator *(RelativeVector4 arg1, float arg2) { RelativeVector4 result = arg1.Multiply(arg2); - ValueCheck(result); - return result; + return ValueCheck(result); } /// @@ -188,8 +184,7 @@ namespace Tizen.NUI public static RelativeVector4 operator /(RelativeVector4 arg1, RelativeVector4 arg2) { RelativeVector4 result = arg1.Divide(arg2); - ValueCheck(result); - return result; + return ValueCheck(result); } /// @@ -202,8 +197,7 @@ namespace Tizen.NUI public static RelativeVector4 operator /(RelativeVector4 arg1, float arg2) { RelativeVector4 result = arg1.Divide(arg2); - ValueCheck(result); - return result; + return ValueCheck(result); } @@ -248,12 +242,8 @@ namespace Tizen.NUI /// The z component. /// The w component. /// 3 - public RelativeVector4(float x, float y, float z, float w) : this(NDalicPINVOKE.new_Vector4__SWIG_1(x, y, z, w), true) + 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) { - ValueCheck(x); - ValueCheck(y); - ValueCheck(z); - ValueCheck(W); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } @@ -361,8 +351,7 @@ namespace Tizen.NUI { set { - ValueCheck(value); - NDalicPINVOKE.Vector4_X_set(swigCPtr, value); + NDalicPINVOKE.Vector4_X_set(swigCPtr, ValueCheck(value)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } get @@ -381,8 +370,7 @@ namespace Tizen.NUI { set { - ValueCheck(value); - NDalicPINVOKE.Vector4_Y_set(swigCPtr, value); + NDalicPINVOKE.Vector4_Y_set(swigCPtr, ValueCheck(value)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } get @@ -401,8 +389,7 @@ namespace Tizen.NUI { set { - ValueCheck(value); - NDalicPINVOKE.Vector4_Z_set(swigCPtr, value); + NDalicPINVOKE.Vector4_Z_set(swigCPtr, ValueCheck(value)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } get @@ -421,8 +408,7 @@ namespace Tizen.NUI { set { - ValueCheck(value); - NDalicPINVOKE.Vector4_W_set(swigCPtr, value); + NDalicPINVOKE.Vector4_W_set(swigCPtr, ValueCheck(value)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } get @@ -446,72 +432,70 @@ namespace Tizen.NUI /// 3 public static implicit operator RelativeVector4(Vector4 vec) { - ValueCheck(vec.X); - ValueCheck(vec.Y); - ValueCheck(vec.Z); - ValueCheck(vec.W); - return new RelativeVector4(vec.X, vec.Y, vec.Z, vec.W); + return new RelativeVector4(ValueCheck(vec.X), ValueCheck(vec.Y), ValueCheck(vec.Z), ValueCheck(vec.W)); } - internal static void ValueCheck(RelativeVector4 relativeVector4) + internal static RelativeVector4 ValueCheck(RelativeVector4 relativeVector4) { if(relativeVector4.X < 0.0f) { relativeVector4.X = 0.0f; - Tizen.Log.Fatal("NUI", "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) { relativeVector4.X = 1.0f; - Tizen.Log.Fatal("NUI", "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) { relativeVector4.Y = 0.0f; - Tizen.Log.Fatal("NUI", "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) { relativeVector4.Y = 1.0f; - Tizen.Log.Fatal("NUI", "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) { relativeVector4.Z = 0.0f; - Tizen.Log.Fatal("NUI", "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) { relativeVector4.Z = 1.0f; - Tizen.Log.Fatal("NUI", "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) { relativeVector4.W = 0.0f; - Tizen.Log.Fatal("NUI", "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) { relativeVector4.W = 1.0f; - Tizen.Log.Fatal("NUI", "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 void ValueCheck(float value) + internal static float ValueCheck(float value) { if(value < 0.0f) { value = 0.0f; - Tizen.Log.Fatal("NUI", "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) { value = 1.0f; - Tizen.Log.Fatal("NUI", "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; } } - } + diff --git a/src/Tizen.NUI/src/public/WatchTime.cs b/src/Tizen.NUI/src/public/WatchTime.cs new file mode 100755 index 0000000..7b888d9 --- /dev/null +++ b/src/Tizen.NUI/src/public/WatchTime.cs @@ -0,0 +1,370 @@ +/* + * 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 +{ + /// + /// The WatchTime class is used to get time for the WatchApplication.
+ /// A WatchTime has a time handle from watch application framework.
+ /// You can get time(hour, minute, second, millisecond) and date(year, month, day)
+ /// on receiving timeTick signal. + ///
+ public class WatchTime : global::System.IDisposable + { + private global::System.Runtime.InteropServices.HandleRef swigCPtr; + + /// + /// swigCMemOwn. + /// + 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. + /// + protected bool disposed = false; + + /// + /// Distructor. + /// + ~WatchTime() + { + if (!isDisposeQueued) + { + isDisposeQueued = true; + DisposeQueue.Instance.Add(this); + } + } + + /// + /// To make watch time instance be disposed. + /// + 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); + } + } + + /// + /// you can override it to clean-up your own resources. + /// + /// 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; + NDalicManualPINVOKE.delete_WatchTime(swigCPtr); + } + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); + } + + disposed = true; + } + + internal static WatchTime GetWatchTimeFromPtr(global::System.IntPtr cPtr) + { + WatchTime ret = new WatchTime(cPtr, false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + /// + /// Constructor. + /// + public WatchTime() : this(NDalicManualPINVOKE.new_WatchTime(), true) + { + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + /// + /// Get the current hour. + /// + /// The return value is always positive.The WatchTime needs to be initialized. + public int Hour + { + get + { + return GetHour(); + } + } + + internal int GetHour() + { + int ret = NDalicManualPINVOKE.WatchTime_GetHour(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + /// + /// Get the current hour24. + /// + /// The return value is always positive.The WatchTime needs to be initialized. + public int Hour24 + { + get + { + return GetHour24(); + } + } + + internal int GetHour24() + { + int ret = NDalicManualPINVOKE.WatchTime_GetHour24(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + /// + /// Get the current minute. + /// + /// The return value is always positive.The WatchTime needs to be initialized. + public int Minute + { + get + { + return GetMinute(); + } + } + + internal int GetMinute() + { + int ret = NDalicManualPINVOKE.WatchTime_GetMinute(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + /// + /// Get the current second. + /// + /// The return value is always positive.The WatchTime needs to be initialized. + public int Second + { + get + { + return GetSecond(); + } + } + + internal int GetSecond() + { + int ret = NDalicManualPINVOKE.WatchTime_GetSecond(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + /// + /// Get the current millisecond. + /// + /// The return value is always positive.The WatchTime needs to be initialized. + public int Millisecond + { + get + { + return GetMillisecond(); + } + } + + internal int GetMillisecond() + { + int ret = NDalicManualPINVOKE.WatchTime_GetMillisecond(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + /// + /// Get the current year. + /// + /// The return value is always positive.The WatchTime needs to be initialized. + public int Year + { + get + { + return GetYear(); + } + } + + internal int GetYear() + { + int ret = NDalicManualPINVOKE.WatchTime_GetYear(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + /// + /// Get the current month. + /// + /// The return value is always positive.The WatchTime needs to be initialized. + public int Month + { + get + { + return GetMonth(); + } + } + + internal int GetMonth() + { + int ret = NDalicManualPINVOKE.WatchTime_GetMonth(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + /// + /// Get the current day. + /// + /// The return value is always positive.The WatchTime needs to be initialized. + public int Day + { + get + { + return GetDay(); + } + } + + internal int GetDay() + { + int ret = NDalicManualPINVOKE.WatchTime_GetDay(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + /// + /// Get the current week. + /// + /// The return value is always positive.The WatchTime needs to be initialized. + public int DayOfWeek + { + get + { + return GetDayOfWeek(); + } + } + + 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. + /// + /// + /// The WatchTime needs to be initialized.
+ /// The timezone ID, according to the IANA(Internet Assigned Numbers Authority)
+ /// If you want to see more information, please refer to the site :
+ /// https://en.wikipedia.org/wiki/List_of_tz_database_time_zones/ + ///
+ public string TimeZone + { + get + { + return GetTimeZone(); + } + } + + 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. + /// + /// The WatchTime needs to be initialized. + public bool DaylightSavingTimeStatus + { + get + { + return GetDaylightSavingTimeStatus(); + } + } + + internal bool GetDaylightSavingTimeStatus() + { + bool ret = NDalicManualPINVOKE.WatchTime_GetDaylightSavingTimeStatus(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + } + +} diff --git a/src/Tizen.NUI/src/public/WebViewLite.cs b/src/Tizen.NUI/src/public/WebViewLite.cs new file mode 100755 index 0000000..2a3b96a --- /dev/null +++ b/src/Tizen.NUI/src/public/WebViewLite.cs @@ -0,0 +1,203 @@ +/* + * 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 System.Runtime.InteropServices; +using Tizen.NUI.BaseComponents; + +namespace Tizen.NUI { + +/// +/// WebViewLite. +/// +public class WebViewLite : View +{ + private global::System.Runtime.InteropServices.HandleRef swigCPtr; + + internal WebViewLite(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.WebViewLite_SWIGUpcast(cPtr), cMemoryOwn) { + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); + } + + internal static global::System.Runtime.InteropServices.HandleRef getCPtr(WebViewLite obj) { + return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; + } + + /// + /// To make Button instance be disposed. + /// + 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. + + DisConnectFromSignals(); + + if (swigCPtr.Handle != global::System.IntPtr.Zero) + { + if (swigCMemOwn) + { + swigCMemOwn = false; + NDalicPINVOKE.delete_WebViewLite(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 (_loadingFinishedEventCallback != null) + { + FinishedSignal().Disconnect(_loadingFinishedEventCallback); + } + + // BaseHandle CPtr is used in Registry and there is danger of deletion if we keep using it here. + // Restore current CPtr. + swigCPtr = currentCPtr; + } + + private LoadingFinishedCallbackType _loadingFinishedEventCallback; + [UnmanagedFunctionPointer(CallingConvention.StdCall)] + private delegate void LoadingFinishedCallbackType(global::System.IntPtr data); + private EventHandler _loadingFinishedEventHandler; + + /// + /// Web View loading finished event. + /// + public event EventHandler LoadingFinished + { + add + { + if (_loadingFinishedEventHandler == null) + { + NUILog.Debug("[add before]FinishedSignal().Empty=" + FinishedSignal().Empty() + " GetConnectionCount=" + FinishedSignal().GetConnectionCount()); + _loadingFinishedEventCallback = OnFinished; + FinishedSignal().Connect(_loadingFinishedEventCallback); + NUILog.Debug("[add after]FinishedSignal().Empty=" + FinishedSignal().Empty() + " GetConnectionCount=" + FinishedSignal().GetConnectionCount()); + } + _loadingFinishedEventHandler += value; + } + remove + { + _loadingFinishedEventHandler -= value; + + if (_loadingFinishedEventHandler == null && FinishedSignal().Empty() == false) + { + NUILog.Debug("[remove before]FinishedSignal().Empty=" + FinishedSignal().Empty() + " GetConnectionCount=" + FinishedSignal().GetConnectionCount()); + FinishedSignal().Disconnect(_loadingFinishedEventCallback); + NUILog.Debug("[remove after]FinishedSignal().Empty=" + FinishedSignal().Empty() + " GetConnectionCount=" + FinishedSignal().GetConnectionCount()); + } + } + } + private void OnFinished(IntPtr data) + { + if (_loadingFinishedEventHandler != null) + { + //here we send all data to user event handlers + _loadingFinishedEventHandler(this, null); + } + } + + /// + /// Creates an uninitialized WebViewLite. + /// + public WebViewLite () : this (NDalicPINVOKE.WebViewLite_New(), true) { + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + + } + + /// + /// Copy constructor. + /// WebViewLite to copy. The copied WebViewLite will point at the same implementation + /// + public WebViewLite(WebViewLite webViewLite) : this(NDalicPINVOKE.new_WebViewLite__SWIG_1(WebViewLite.getCPtr(webViewLite)), true) { + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + internal WebViewLite Assign(WebViewLite webViewLite) { + WebViewLite ret = new WebViewLite(NDalicPINVOKE.WebViewLite_Assign(swigCPtr, WebViewLite.getCPtr(webViewLite)), false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + internal new static WebViewLite DownCast(BaseHandle handle) { + WebViewLite ret = new WebViewLite(NDalicPINVOKE.WebViewLite_DownCast(BaseHandle.getCPtr(handle)), true); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + /// + /// Creates an internal web view instance (e.g. minimized web engine instance). + /// The width of Web + /// The height of Web + /// The x position of window + /// The y position of window + /// The locale of Web + /// The timezoneID of Web + /// + public void CreateInstance(int width, int height, int windowX, int windowY, string locale, string timezoneID) { + NDalicPINVOKE.WebViewLite_CreateInstance(swigCPtr, width, height, windowX, windowY, locale, timezoneID); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + /// + /// Destroys an internal web view instance (e.g. minimized web engine instance). + /// + public void DestroyInstance() { + NDalicPINVOKE.WebViewLite_DestroyInstance(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + /// + /// Loads a html file. + /// The path of Web + /// + public void LoadHtml(string path) { + NDalicPINVOKE.WebViewLite_LoadHtml(swigCPtr, path); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + internal WebViewLiteSignal FinishedSignal() { + WebViewLiteSignal ret = new WebViewLiteSignal(NDalicPINVOKE.WebViewLite_FinishedSignal(swigCPtr), false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + +} + +} diff --git a/src/Tizen.NUI/src/public/Window.cs b/src/Tizen.NUI/src/public/Window.cs index 28c9ee7..2ed4d93 100755 --- a/src/Tizen.NUI/src/public/Window.cs +++ b/src/Tizen.NUI/src/public/Window.cs @@ -362,13 +362,13 @@ namespace Tizen.NUI } /// - /// Sets a window's screen mode. + /// Sets a window's screen off mode. /// - /// The screen mode. + /// The screen mode. /// True if no error occurred, false otherwise. /// 3 - public bool SetScreenMode(ScreenMode screenMode) { - bool ret = NDalicPINVOKE.SetScreenMode(swigCPtr, (int)screenMode); + public bool SetScreenOffMode(ScreenOffMode screenOffMode) { + bool ret = NDalicPINVOKE.SetScreenOffMode(swigCPtr, (int)screenOffMode); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } @@ -376,10 +376,10 @@ namespace Tizen.NUI /// /// Gets the screen mode of the window. /// - /// The screen mode. + /// The screen off mode. /// 3 - public ScreenMode GetScreenMode() { - ScreenMode ret = (ScreenMode)NDalicPINVOKE.GetScreenMode(swigCPtr); + public ScreenOffMode GetScreenOffMode() { + ScreenOffMode ret = (ScreenOffMode)NDalicPINVOKE.GetScreenOffMode(swigCPtr); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } @@ -646,8 +646,7 @@ namespace Tizen.NUI /// 3 public void Add(View view) { - NDalicPINVOKE.Stage_Add(stageCPtr, View.getCPtr(view)); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + GetRootLayer()?.Add(view); } /// @@ -657,8 +656,7 @@ namespace Tizen.NUI /// 3 public void Remove(View view) { - NDalicPINVOKE.Stage_Remove(stageCPtr, View.getCPtr(view)); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + GetRootLayer()?.Remove(view); } internal Vector2 GetSize() @@ -704,11 +702,13 @@ namespace Tizen.NUI internal Layer GetRootLayer() { - if (_rootLayer == 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()) + { _rootLayer = new Layer(NDalicPINVOKE.Stage_GetRootLayer(stageCPtr), true); - - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } return _rootLayer; }