[NUI] Remove unused signal : Window.ViewAdded
authorEunki, Hong <eunkiki.hong@samsung.com>
Fri, 21 Apr 2023 05:23:55 +0000 (14:23 +0900)
committerJoogabYun <40262755+JoogabYun@users.noreply.github.com>
Wed, 26 Apr 2023 07:07:45 +0000 (16:07 +0900)
Due to the performance issue, we do not allow to use Window.ViewAdded signal.
Instead, We need to guide app to use View.AddedToWindow event

Signed-off-by: Eunki, Hong <eunkiki.hong@samsung.com>
src/Tizen.NUI/src/internal/Common/WindowViewAddedSignal.cs [deleted file]
src/Tizen.NUI/src/internal/Interop/Interop.WindowViewAddedSignal.cs [deleted file]
src/Tizen.NUI/src/public/Window/WindowEvent.cs

diff --git a/src/Tizen.NUI/src/internal/Common/WindowViewAddedSignal.cs b/src/Tizen.NUI/src/internal/Common/WindowViewAddedSignal.cs
deleted file mode 100755 (executable)
index da16f17..0000000
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- * Copyright(c) 2023 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 WindowViewAddedSignal : Disposable
-    {
-
-        internal WindowViewAddedSignal(global::System.IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemoryOwn)
-        {
-        }
-
-        protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr)
-        {
-            Interop.WindowViewAddedSignal.DeleteSignal(swigCPtr);
-        }
-
-        public bool Empty()
-        {
-            bool ret = Interop.WindowViewAddedSignal.Empty(SwigCPtr);
-
-            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
-            return ret;
-        }
-
-        public uint GetConnectionCount()
-        {
-            uint ret = Interop.WindowViewAddedSignal.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<System.Delegate>(func);
-            {
-                Interop.WindowViewAddedSignal.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<System.Delegate>(func);
-            {
-                Interop.WindowViewAddedSignal.Disconnect(SwigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip));
-                if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
-            }
-        }
-
-        public bool Emit()
-        {
-            bool ret = Interop.WindowViewAddedSignal.Emit(SwigCPtr);
-            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
-            return ret;
-        }
-
-        public WindowViewAddedSignal(Window window) : this(Interop.WindowViewAddedSignal.GetSignal(Window.getCPtr(window)), false)
-        {
-            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
-        }
-    }
-}
diff --git a/src/Tizen.NUI/src/internal/Interop/Interop.WindowViewAddedSignal.cs b/src/Tizen.NUI/src/internal/Interop/Interop.WindowViewAddedSignal.cs
deleted file mode 100755 (executable)
index e8c3465..0000000
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright(c) 2023 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.Runtime.InteropServices;
-
-namespace Tizen.NUI
-{
-    internal static partial class Interop
-    {
-        internal static partial class WindowViewAddedSignal
-        {
-            [DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Window_View_Added_Signal")]
-            public static extern global::System.IntPtr GetSignal(HandleRef jarg1);
-
-            [DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Window_View_Added_Signal_Empty")]
-            [return: global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.U1)]
-            public static extern bool Empty(HandleRef jarg1);
-
-            [DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Window_View_Added_Signal_GetConnectionCount")]
-            public static extern uint GetConnectionCount(HandleRef jarg1);
-
-            [DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Window_View_Added_Signal_Connect")]
-            public static extern void Connect(HandleRef jarg1, HandleRef jarg2);
-
-            [DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Window_View_Added_Signal_Disconnect")]
-            public static extern void Disconnect(HandleRef jarg1, HandleRef jarg2);
-
-            [DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Window_View_Added_Signal_Emit")]
-            [return: global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.U1)]
-            public static extern bool Emit(HandleRef jarg1);
-
-            [DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Window_View_Added_Signal_new")]
-            public static extern global::System.IntPtr NewSignal();
-
-            [DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Window_View_Added_delete")]
-            public static extern void DeleteSignal(HandleRef jarg1);
-        }
-    }
-}
index 9588b3c..b1f00ed 100755 (executable)
@@ -49,7 +49,6 @@ namespace Tizen.NUI
         private MovedEventCallbackType movedEventCallback;
         private OrientationChangedEventCallbackType orientationChangedEventCallback;
         private KeyboardRepeatSettingsChangedEventCallbackType keyboardRepeatSettingsChangedEventCallback;
-        private ViewAddedEventCallbackType viewAddedEventCallback;
         private AuxiliaryMessageEventCallbackType auxiliaryMessageEventCallback;
         [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
         private delegate void WindowFocusChangedEventCallbackType(IntPtr window, bool focusGained);
@@ -70,8 +69,6 @@ namespace Tizen.NUI
         [UnmanagedFunctionPointer(CallingConvention.StdCall)]
         private delegate void KeyboardRepeatSettingsChangedEventCallbackType();
         [UnmanagedFunctionPointer(CallingConvention.StdCall)]
-        private delegate void ViewAddedEventCallbackType(IntPtr view);
-        [UnmanagedFunctionPointer(CallingConvention.StdCall)]
         private delegate void AuxiliaryMessageEventCallbackType(IntPtr kData, IntPtr vData, IntPtr optionsArray);
         [UnmanagedFunctionPointer(CallingConvention.StdCall)]
         private delegate bool InterceptKeyEventDelegateType(IntPtr arg1);
@@ -444,36 +441,6 @@ namespace Tizen.NUI
             }
         }
 
-        /// <summary>
-        /// ViewAdded will be triggered when the view added on Window
-        /// </summary>
-        /// <since_tizen> 6 </since_tizen>
-        /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
-        [EditorBrowsable(EditorBrowsableState.Never)]
-        public event EventHandler ViewAdded
-        {
-            add
-            {
-                if (viewAddedHandler == null)
-                {
-                    viewAddedEventCallback = OnViewAdded;
-                    using WindowViewAddedSignal signal = new WindowViewAddedSignal(Interop.WindowViewAddedSignal.GetSignal(SwigCPtr), false);
-                    signal.Ensure()?.Connect(viewAddedEventCallback);
-                }
-                viewAddedHandler += value;
-            }
-            remove
-            {
-                viewAddedHandler -= value;
-                if (viewAddedHandler == null && viewAddedEventCallback != null)
-                {
-                    using WindowViewAddedSignal signal = new WindowViewAddedSignal(Interop.WindowViewAddedSignal.GetSignal(SwigCPtr), false);
-                    signal.Ensure()?.Disconnect(viewAddedEventCallback);
-                    viewAddedEventCallback = null;
-                }
-            }
-        }
-
         private event EventHandler<FocusChangedEventArgs> windowFocusChangedEventHandler;
         private event EventHandler<TouchEventArgs> rootLayerTouchDataEventHandler;
         private ReturnTypeEventHandler<object, TouchEventArgs, bool> rootLayerInterceptTouchDataEventHandler;
@@ -487,7 +454,6 @@ namespace Tizen.NUI
         private event EventHandler<WindowMovedEventArgs> movedHandler;
         private event EventHandler<WindowOrientationChangedEventArgs> orientationChangedHandler;
         private event EventHandler keyboardRepeatSettingsChangedHandler;
-        private event EventHandler viewAddedHandler;
         private event EventHandler<AuxiliaryMessageEventArgs> auxiliaryMessageEventHandler;
 
 
@@ -725,13 +691,6 @@ namespace Tizen.NUI
                 keyboardRepeatSettingsChangedEventCallback = null;
             }
 
-            if (viewAddedEventCallback != null)
-            {
-                using WindowViewAddedSignal signal = new WindowViewAddedSignal(Interop.WindowViewAddedSignal.GetSignal(GetBaseHandleCPtrHandleRef), false);
-                signal?.Disconnect(viewAddedEventCallback);
-                viewAddedEventCallback = null;
-            }
-
             if (auxiliaryMessageEventCallback != null)
             {
                 using WindowAuxiliaryMessageSignal signal = new WindowAuxiliaryMessageSignal(Interop.WindowAuxiliaryMessageSignalType.Get(GetBaseHandleCPtrHandleRef), false);
@@ -959,22 +918,6 @@ namespace Tizen.NUI
             return;
         }
 
-        private void OnViewAdded(IntPtr view)
-        {
-            if (view == global::System.IntPtr.Zero)
-            {
-                return;
-            }
-
-            View addedView = Extensions.GetInstanceSafely<View>(this, view);
-            if (addedView)
-            {
-                // Note : object sender is View, not window it selfs (Since tizen_5.5, Pull Request #705)
-                viewAddedHandler?.Invoke(view, EventArgs.Empty);
-            }
-            return;
-        }
-
         /// <summary>
         /// The focus changed event argument.
         /// </summary>