[NUI] Update NUI after removing Window::ResizedSignal (#1949)
authorRichard Huang <hrdisaac@users.noreply.github.com>
Wed, 2 Sep 2020 01:28:32 +0000 (02:28 +0100)
committerGitHub <noreply@github.com>
Wed, 2 Sep 2020 01:28:32 +0000 (10:28 +0900)
Co-authored-by: JoogabYun <40262755+JoogabYun@users.noreply.github.com>
src/Tizen.NUI/src/internal/Interop/Interop.ResizedSignal.cs
src/Tizen.NUI/src/internal/Interop/Interop.Window.cs
src/Tizen.NUI/src/internal/ResizedSignal.cs
src/Tizen.NUI/src/public/WindowEvent.cs

index ae49eeb..ed03a76 100755 (executable)
@@ -6,28 +6,28 @@ namespace Tizen.NUI
 {
     internal static partial class Interop
     {
-        internal static partial class ResizedSignal
+        internal static partial class ResizeSignal
         {
-            [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_ResizedSignal_Empty")]
-            public static extern bool ResizedSignal_Empty(global::System.Runtime.InteropServices.HandleRef jarg1);
+            [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_ResizeSignal_Empty")]
+            public static extern bool ResizeSignal_Empty(global::System.Runtime.InteropServices.HandleRef jarg1);
 
-            [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_ResizedSignal_GetConnectionCount")]
-            public static extern uint ResizedSignal_GetConnectionCount(global::System.Runtime.InteropServices.HandleRef jarg1);
+            [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_ResizeSignal_GetConnectionCount")]
+            public static extern uint ResizeSignal_GetConnectionCount(global::System.Runtime.InteropServices.HandleRef jarg1);
 
-            [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_ResizedSignal_Connect")]
-            public static extern void ResizedSignal_Connect(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2);
+            [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_ResizeSignal_Connect")]
+            public static extern void ResizeSignal_Connect(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2);
 
-            [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_ResizedSignal_Disconnect")]
-            public static extern void ResizedSignal_Disconnect(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2);
+            [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_ResizeSignal_Disconnect")]
+            public static extern void ResizeSignal_Disconnect(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2);
 
-            [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_ResizedSignal_Emit")]
-            public static extern void ResizedSignal_Emit(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2);
+            [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_ResizeSignal_Emit")]
+            public static extern void ResizeSignal_Emit(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2);
 
-            [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_new_ResizedSignal")]
-            public static extern global::System.IntPtr new_ResizedSignal();
+            [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_new_ResizeSignal")]
+            public static extern global::System.IntPtr new_ResizeSignal();
 
-            [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_delete_ResizedSignal")]
-            public static extern void delete_ResizedSignal(global::System.Runtime.InteropServices.HandleRef jarg1);
+            [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_delete_ResizeSignal")]
+            public static extern void delete_ResizeSignal(global::System.Runtime.InteropServices.HandleRef jarg1);
         }
     }
 }
\ No newline at end of file
index 0ff8e80..e4f7a05 100755 (executable)
@@ -144,8 +144,8 @@ namespace Tizen.NUI
             public static extern int GetBrightness(global::System.Runtime.InteropServices.HandleRef jarg1);
             
             // For windows resized signal
-            [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Window_ResizedSignal")]
-            public static extern global::System.IntPtr Window_ResizedSignal(global::System.Runtime.InteropServices.HandleRef jarg1);
+            [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Window_ResizeSignal")]
+            public static extern global::System.IntPtr Window_ResizeSignal(global::System.Runtime.InteropServices.HandleRef jarg1);
 
             [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Window_SetSize")]
             public static extern void SetSize(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2);
index 5c15de6..e17c0a3 100755 (executable)
@@ -1,5 +1,5 @@
 /*
- * Copyright(c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright(c) 2020 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.
 namespace Tizen.NUI
 {
 
-    internal class ResizedSignal : Disposable
+    internal class ResizeSignal : Disposable
     {
 
-        internal ResizedSignal(global::System.IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemoryOwn)
+        internal ResizeSignal(global::System.IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemoryOwn)
         {
         }
 
 
         protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr)
         {
-            Interop.ResizedSignal.delete_ResizedSignal(swigCPtr);
+            Interop.ResizeSignal.delete_ResizeSignal(swigCPtr);
         }
 
         public bool Empty()
         {
-            bool ret = Interop.ResizedSignal.ResizedSignal_Empty(swigCPtr);
+            bool ret = Interop.ResizeSignal.ResizeSignal_Empty(swigCPtr);
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
             return ret;
         }
 
         public uint GetConnectionCount()
         {
-            uint ret = Interop.ResizedSignal.ResizedSignal_GetConnectionCount(swigCPtr);
+            uint ret = Interop.ResizeSignal.ResizeSignal_GetConnectionCount(swigCPtr);
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
             return ret;
         }
@@ -49,7 +49,7 @@ namespace Tizen.NUI
         {
             System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate<System.Delegate>(func);
             {
-                Interop.ResizedSignal.ResizedSignal_Connect(swigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip));
+                Interop.ResizeSignal.ResizeSignal_Connect(swigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip));
                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
             }
         }
@@ -58,18 +58,18 @@ namespace Tizen.NUI
         {
             System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate<System.Delegate>(func);
             {
-                Interop.ResizedSignal.ResizedSignal_Disconnect(swigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip));
+                Interop.ResizeSignal.ResizeSignal_Disconnect(swigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip));
                 if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
             }
         }
 
         public void Emit(Size2D arg)
         {
-            Interop.ResizedSignal.ResizedSignal_Emit(swigCPtr, Size2D.getCPtr(arg));
+            Interop.ResizeSignal.ResizeSignal_Emit(swigCPtr, Size2D.getCPtr(arg));
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
         }
 
-        public ResizedSignal() : this(Interop.ResizedSignal.new_ResizedSignal(), true)
+        public ResizeSignal() : this(Interop.ResizeSignal.new_ResizeSignal(), true)
         {
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
         }
index f5e303d..8d373f5 100755 (executable)
@@ -40,7 +40,7 @@ namespace Tizen.NUI
         private EventCallbackDelegateType0 _stageContextRegainedEventCallbackDelegate;
         private EventHandler _stageSceneCreatedEventHandler;
         private EventCallbackDelegateType0 _stageSceneCreatedEventCallbackDelegate;
-        private WindowResizedEventCallbackType _windowResizedEventCallback;
+        private WindowResizeEventCallbackType _windowResizeEventCallback;
         private WindowFocusChangedEventCallbackType _windowFocusChangedEventCallback2;
         private TransitionEffectEventCallbackType transitionEffectEventCallback;
         private WindowTransitionEffectSignal transitionEffectSignal;
@@ -54,7 +54,7 @@ namespace Tizen.NUI
         [UnmanagedFunctionPointer(CallingConvention.StdCall)]
         private delegate bool WheelEventCallbackType(IntPtr view, IntPtr wheelEvent);
         [UnmanagedFunctionPointer(CallingConvention.StdCall)]
-        private delegate void WindowResizedEventCallbackType(IntPtr windowSize);
+        private delegate void WindowResizeEventCallbackType(IntPtr window, IntPtr windowSize);
         [UnmanagedFunctionPointer(CallingConvention.StdCall)]
         private delegate void WindowFocusChangedEventCallbackType2(IntPtr window, bool focusGained);
         [UnmanagedFunctionPointer(CallingConvention.StdCall)]
@@ -188,21 +188,21 @@ namespace Tizen.NUI
         {
             add
             {
-                if (_windowResizedEventHandler == null)
+                if (_windowResizeEventHandler == null)
                 {
-                    _windowResizedEventCallback = OnResized;
-                    ResizedSignal().Connect(_windowResizedEventCallback);
+                    _windowResizeEventCallback = OnResized;
+                    ResizeSignal().Connect(_windowResizeEventCallback);
                 }
 
-                _windowResizedEventHandler += value;
+                _windowResizeEventHandler += value;
             }
             remove
             {
-                _windowResizedEventHandler -= value;
+                _windowResizeEventHandler -= value;
 
-                if (_windowResizedEventHandler == null && ResizedSignal().Empty() == false && _windowResizedEventCallback != null)
+                if (_windowResizeEventHandler == null && ResizeSignal().Empty() == false && _windowResizeEventCallback != null)
                 {
-                    ResizedSignal().Disconnect(_windowResizedEventCallback);
+                    ResizeSignal().Disconnect(_windowResizeEventCallback);
                 }
             }
         }
@@ -303,7 +303,7 @@ namespace Tizen.NUI
         private event EventHandler<WheelEventArgs> _stageWheelHandler;
         private event EventHandler<KeyEventArgs> _stageKeyHandler;
         private event EventHandler _stageEventProcessingFinishedEventHandler;
-        private event EventHandler<ResizedEventArgs> _windowResizedEventHandler;
+        private event EventHandler<ResizedEventArgs> _windowResizeEventHandler;
         private event EventHandler<FocusChangedEventArgs> _windowFocusChangedEventHandler2;
         private event EventHandler<TransitionEffectArgs> transitionEffectHandler;
         private event EventHandler keyboardRepeatSettingsChangedHandler;
@@ -462,9 +462,9 @@ namespace Tizen.NUI
             return ret;
         }
 
-        internal ResizedSignal ResizedSignal()
+        internal ResizeSignal ResizeSignal()
         {
-            ResizedSignal ret = new ResizedSignal(Interop.Window.Window_ResizedSignal(swigCPtr), false);
+            ResizeSignal ret = new ResizeSignal(Interop.Window.Window_ResizeSignal(swigCPtr), false);
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
             return ret;
         }
@@ -527,9 +527,9 @@ namespace Tizen.NUI
                 SceneCreatedSignal().Disconnect(_stageSceneCreatedEventCallbackDelegate);
             }
 
-            if (_windowResizedEventCallback != null)
+            if (_windowResizeEventCallback != null)
             {
-                ResizedSignal().Disconnect(_windowResizedEventCallback);
+                ResizeSignal().Disconnect(_windowResizeEventCallback);
             }
 
             if (_windowFocusChangedEventCallback2 != null)
@@ -693,8 +693,14 @@ namespace Tizen.NUI
             }
         }
 
-        private void OnResized(IntPtr windowSize)
+        private void OnResized(IntPtr window, IntPtr windowSize)
         {
+            if (window == IntPtr.Zero)
+            {
+                NUILog.Error("OnResized() Window is null! Do nothing!");
+                return;
+            }
+
             ResizedEventArgs e = new ResizedEventArgs();
             // var val = new Uint16Pair(windowSize, false);
             // e.WindowSize = new Size2D(val.GetWidth(), val.GetHeight());
@@ -705,9 +711,9 @@ namespace Tizen.NUI
             // will be fixed later.
             e.WindowSize = this.WindowSize;
 
-            if (_windowResizedEventHandler != null)
+            if (_windowResizeEventHandler != null)
             {
-                _windowResizedEventHandler(this, e);
+                _windowResizeEventHandler(this, e);
             }
         }