[NUI] Remove internal ObjectRegistry that is not used
authordongsug.song <dongsug.song@samsung.com>
Tue, 13 Aug 2024 09:11:11 +0000 (18:11 +0900)
committerJiyun Yang <ji.yang@samsung.com>
Wed, 21 Aug 2024 06:10:37 +0000 (15:10 +0900)
src/Tizen.NUI/src/internal/Common/ObjectRegistry.cs [deleted file]
src/Tizen.NUI/src/internal/Interop/Interop.ObjectRegistry.cs [deleted file]
src/Tizen.NUI/src/internal/Interop/Interop.Stage.cs
src/Tizen.NUI/src/public/Window/Window.cs
test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/internal/Common/TSObjectRegistry.cs [deleted file]
test/Tizen.NUI.Tests/Tizen.NUI.TCT/testcase/public/Window/TSWindow.cs

diff --git a/src/Tizen.NUI/src/internal/Common/ObjectRegistry.cs b/src/Tizen.NUI/src/internal/Common/ObjectRegistry.cs
deleted file mode 100755 (executable)
index 37bad4c..0000000
+++ /dev/null
@@ -1,203 +0,0 @@
-/*
- * Copyright(c) 2021 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 ObjectRegistry : BaseHandle
-    {
-        internal ObjectRegistry(global::System.IntPtr cPtr, bool cMemoryOwn) : this(cPtr, cMemoryOwn, cMemoryOwn)
-        {
-        }
-
-        internal ObjectRegistry(global::System.IntPtr cPtr, bool cMemoryOwn, bool cRegister) : base(cPtr, cMemoryOwn, cRegister)
-        {
-        }
-
-        protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr)
-        {
-            Interop.ObjectRegistry.DeleteObjectRegistry(swigCPtr);
-        }
-
-        public class ObjectCreatedEventArgs : EventArgs
-        {
-            private BaseHandle baseHandle;
-
-            public BaseHandle BaseHandle
-            {
-                get
-                {
-                    return baseHandle;
-                }
-                set
-                {
-                    baseHandle = value;
-                }
-            }
-        }
-
-        public class ObjectDestroyedEventArgs : EventArgs
-        {
-            private RefObject refObject;
-
-            public RefObject RefObject
-            {
-                get
-                {
-                    return refObject;
-                }
-                set
-                {
-                    refObject = value;
-                }
-            }
-        }
-
-        [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
-        private delegate void ObjectCreatedEventCallbackDelegate(IntPtr baseHandle);
-        private DaliEventHandler<object, ObjectCreatedEventArgs> objectRegistryObjectCreatedEventHandler;
-        private ObjectCreatedEventCallbackDelegate objectRegistryObjectCreatedEventCallbackDelegate;
-
-        [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
-        private delegate void ObjectDestroyedEventCallbackDelegate(IntPtr fefObject);
-        private DaliEventHandler<object, ObjectDestroyedEventArgs> objectRegistryObjectDestroyedEventHandler;
-        private ObjectDestroyedEventCallbackDelegate objectRegistryObjectDestroyedEventCallbackDelegate;
-
-        public event DaliEventHandler<object, ObjectCreatedEventArgs> ObjectCreated
-        {
-            add
-            {
-                // Restricted to only one listener
-                if (objectRegistryObjectCreatedEventHandler == null)
-                {
-                    objectRegistryObjectCreatedEventHandler += value;
-
-                    objectRegistryObjectCreatedEventCallbackDelegate = new ObjectCreatedEventCallbackDelegate(OnObjectCreated);
-                    this.ObjectCreatedSignal().Connect(objectRegistryObjectCreatedEventCallbackDelegate);
-                }
-                else
-                {
-                    Tizen.Log.Error("NUI", "[ObjectRegistry.ObjectCreated] Only one listener is allowed\n");
-                }
-            }
-
-            remove
-            {
-                if (objectRegistryObjectCreatedEventHandler != null)
-                {
-                    objectRegistryObjectCreatedEventHandler -= value;
-                    if (objectRegistryObjectCreatedEventHandler == null)
-                    {
-                        this.ObjectCreatedSignal().Disconnect(objectRegistryObjectCreatedEventCallbackDelegate);
-                        objectRegistryObjectCreatedEventCallbackDelegate = null;
-                    }
-                }
-            }
-        }
-
-        // Callback for ObjectRegistry ObjectCreatedSignal
-        private void OnObjectCreated(IntPtr baseHandle)
-        {
-            ObjectCreatedEventArgs e = new ObjectCreatedEventArgs();
-
-            // Populate all members of "e" (ObjectCreatedEventArgs) with real data
-            //e.BaseHandle = BaseHandle.GetBaseHandleFromPtr(baseHandle); //GetBaseHandleFromPtr() is not present in BaseHandle.cs. Not sure what is the reason?
-
-            if (objectRegistryObjectCreatedEventHandler != null)
-            {
-                //here we send all data to user event handlers
-                objectRegistryObjectCreatedEventHandler(this, e);
-            }
-        }
-
-        public event DaliEventHandler<object, ObjectDestroyedEventArgs> ObjectDestroyed
-        {
-            add
-            {
-                // Restricted to only one listener
-                if (objectRegistryObjectDestroyedEventHandler == null)
-                {
-                    objectRegistryObjectDestroyedEventHandler += value;
-
-                    objectRegistryObjectDestroyedEventCallbackDelegate = new ObjectDestroyedEventCallbackDelegate(OnObjectDestroyed);
-                    this.ObjectDestroyedSignal().Connect(objectRegistryObjectDestroyedEventCallbackDelegate);
-                }
-                else
-                {
-                    Tizen.Log.Error("NUI", "[ObjectRegistry.ObjectDestroyed] Only one listener is allowed\n");
-                }
-            }
-
-            remove
-            {
-                if (objectRegistryObjectDestroyedEventHandler != null)
-                {
-                    objectRegistryObjectDestroyedEventHandler -= value;
-                    if (objectRegistryObjectDestroyedEventHandler == null)
-                    {
-                        this.ObjectDestroyedSignal().Disconnect(objectRegistryObjectDestroyedEventCallbackDelegate);
-                        objectRegistryObjectDestroyedEventCallbackDelegate = null;
-                    }
-                }
-            }
-        }
-
-        // Callback for ObjectRegistry ObjectDestroyedSignal
-        private void OnObjectDestroyed(IntPtr refObject)
-        {
-            ObjectDestroyedEventArgs e = new ObjectDestroyedEventArgs();
-
-            // Populate all members of "e" (ObjectDestroyedEventArgs) with real data
-            e.RefObject = RefObject.GetRefObjectFromPtr(refObject);
-
-            if (objectRegistryObjectDestroyedEventHandler != null)
-            {
-                //here we send all data to user event handlers
-                objectRegistryObjectDestroyedEventHandler(this, e);
-            }
-        }
-
-
-        public ObjectRegistry() : this(Interop.ObjectRegistry.NewObjectRegistry(), true, false)
-        {
-            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
-        }
-
-        public ObjectRegistry Assign(ObjectRegistry rhs)
-        {
-            ObjectRegistry ret = new ObjectRegistry(Interop.ObjectRegistry.Assign(SwigCPtr, ObjectRegistry.getCPtr(rhs)), false);
-            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
-            return ret;
-        }
-
-        public ObjectCreatedSignal ObjectCreatedSignal()
-        {
-            ObjectCreatedSignal ret = new ObjectCreatedSignal(Interop.ObjectRegistry.ObjectCreatedSignal(SwigCPtr), false);
-            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
-            return ret;
-        }
-
-        public ObjectDestroyedSignal ObjectDestroyedSignal()
-        {
-            ObjectDestroyedSignal ret = new ObjectDestroyedSignal(Interop.ObjectRegistry.ObjectDestroyedSignal(SwigCPtr), false);
-            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
-            return ret;
-        }
-    }
-}
diff --git a/src/Tizen.NUI/src/internal/Interop/Interop.ObjectRegistry.cs b/src/Tizen.NUI/src/internal/Interop/Interop.ObjectRegistry.cs
deleted file mode 100755 (executable)
index fb498a3..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Copyright(c) 2021 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 static partial class Interop
-    {
-        internal static partial class ObjectRegistry
-        {
-
-            [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_new_ObjectRegistry__SWIG_0")]
-            public static extern global::System.IntPtr NewObjectRegistry();
-
-            [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_delete_ObjectRegistry")]
-            public static extern void DeleteObjectRegistry(global::System.Runtime.InteropServices.HandleRef jarg1);
-
-            [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_ObjectRegistry_Assign")]
-            public static extern global::System.IntPtr Assign(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2);
-
-            [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_ObjectRegistry_ObjectCreatedSignal")]
-            public static extern global::System.IntPtr ObjectCreatedSignal(global::System.Runtime.InteropServices.HandleRef jarg1);
-
-            [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_ObjectRegistry_ObjectDestroyedSignal")]
-            public static extern global::System.IntPtr ObjectDestroyedSignal(global::System.Runtime.InteropServices.HandleRef jarg1);
-        }
-    }
-}
index 9d65c051eb5ec67f325bbdca27b3d9475f71425d..be9877ab2912ac144a2473dc4f4f56a842d24db9 100755 (executable)
@@ -43,9 +43,6 @@ namespace Tizen.NUI
             [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Stage_GetDpi")]
             public static extern global::System.IntPtr GetDpi(global::System.Runtime.InteropServices.HandleRef jarg1);
 
-            [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Stage_GetObjectRegistry")]
-            public static extern global::System.IntPtr GetObjectRegistry(global::System.Runtime.InteropServices.HandleRef jarg1);
-
             [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Stage_SetRenderingBehavior")]
             public static extern void SetRenderingBehavior(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2);
 
index e8692812adf7e009d918d02e6a25c85b4dd71d01..4dce26fc6001a0b112bdd43f82fa1b06a5ab9441 100755 (executable)
@@ -1661,26 +1661,6 @@ namespace Tizen.NUI
             return ret;
         }
 
-        internal ObjectRegistry GetObjectRegistry()
-        {
-            global::System.IntPtr cPtr = Interop.Stage.GetObjectRegistry(stageCPtr);
-
-            ObjectRegistry ret = Registry.GetManagedBaseHandleFromNativePtr(cPtr) as ObjectRegistry;
-            if (ret != null)
-            {
-                global::System.Runtime.InteropServices.HandleRef CPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
-                Interop.BaseHandle.DeleteBaseHandle(CPtr);
-                CPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
-            }
-            else
-            {
-                ret = new ObjectRegistry(cPtr, true);
-            }
-
-            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
-            return ret;
-        }
-
         internal void SetRenderingBehavior(RenderingBehaviorType renderingBehavior)
         {
             Interop.Stage.SetRenderingBehavior(stageCPtr, (int)renderingBehavior);
diff --git a/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/internal/Common/TSObjectRegistry.cs b/test/Tizen.NUI.Tests/Tizen.NUI.Devel.Tests/testcase/internal/Common/TSObjectRegistry.cs
deleted file mode 100755 (executable)
index 09e7b56..0000000
+++ /dev/null
@@ -1,178 +0,0 @@
-using global::System;
-using NUnit.Framework;
-using NUnit.Framework.TUnit;
-using Tizen.NUI.Components;
-using Tizen.NUI.BaseComponents;
-
-namespace Tizen.NUI.Devel.Tests
-{
-    using tlog = Tizen.Log;
-
-    [TestFixture]
-    [Description("internal/Common/ObjectRegistry")]
-    public class InternalObjectRegistryTest
-    {
-        private const string tag = "NUITEST";
-
-        [SetUp]
-        public void Init()
-        {
-            tlog.Info(tag, "Init() is called!");
-        }
-
-        [TearDown]
-        public void Destroy()
-        {
-            tlog.Info(tag, "Destroy() is called!");
-        }
-
-        [Test]
-        [Category("P1")]
-        [Description("ObjectRegistry constructor.")]
-        [Property("SPEC", "Tizen.NUI.ObjectRegistry.ObjectRegistry C")]
-        [Property("SPEC_URL", "-")]
-        [Property("CRITERIA", "CONSTR")]
-        [Property("COVPARAM", "")]
-        [Property("AUTHOR", "guowei.wang@samsung.com")]
-        public void ObjectRegistryConstructor()
-        {
-            tlog.Debug(tag, $"ObjectRegistryConstructor START");
-
-            var testingTarget = new ObjectRegistry();
-            Assert.IsNotNull(testingTarget, "null handle");
-            Assert.IsInstanceOf<ObjectRegistry>(testingTarget, "Should return ObjectRegistry instance.");
-
-            testingTarget.Dispose();
-            tlog.Debug(tag, $"ObjectRegistryConstructor END (OK)");
-        }
-
-        [Test]
-        [Category("P1")]
-        [Description("ObjectRegistry ObjectCreatedEventArgs .")]
-        [Property("SPEC", "Tizen.NUI.ObjectRegistry.ObjectCreatedEventArgs  A")]
-        [Property("SPEC_URL", "-")]
-        [Property("CRITERIA", "PRW")]
-        [Property("COVPARAM", "")]
-        [Property("AUTHOR", "guowei.wang@samsung.com")]
-        public void ObjectRegistryObjectCreatedEventArgs()
-        {
-            tlog.Debug(tag, $"ObjectRegistryObjectCreatedEventArgs START");
-
-            var testingTarget = new Tizen.NUI.ObjectRegistry.ObjectCreatedEventArgs();
-            Assert.IsNotNull(testingTarget, "null handle");
-            Assert.IsInstanceOf<Tizen.NUI.ObjectRegistry.ObjectCreatedEventArgs>(testingTarget, "Should return ObjectCreatedEventArgs instance.");
-
-            using (View view = new View())
-            {
-                testingTarget.BaseHandle = view;
-                tlog.Debug(tag, "BaseHandle : " + testingTarget.BaseHandle);
-            }
-
-            tlog.Debug(tag, $"ObjectRegistryObjectCreatedEventArgs END (OK)");
-        }
-
-        [Test]
-        [Category("P1")]
-        [Description("ObjectRegistry ObjectDestroyedEventArgs .")]
-        [Property("SPEC", "Tizen.NUI.ObjectRegistry.ObjectDestroyedEventArgs  A")]
-        [Property("SPEC_URL", "-")]
-        [Property("CRITERIA", "PRW")]
-        [Property("COVPARAM", "")]
-        [Property("AUTHOR", "guowei.wang@samsung.com")]
-        public void ObjectRegistryObjectDestroyedEventArgs()
-        {
-            tlog.Debug(tag, $"ObjectRegistryObjectDestroyedEventArgs START");
-
-            var testingTarget = new Tizen.NUI.ObjectRegistry.ObjectDestroyedEventArgs();
-            Assert.IsNotNull(testingTarget, "null handle");
-            Assert.IsInstanceOf<Tizen.NUI.ObjectRegistry.ObjectDestroyedEventArgs>(testingTarget, "Should return ObjectDestroyedEventArgs instance.");
-
-            using (View view = new View())
-            {
-                RefObject obj = RefObject.GetRefObjectFromPtr(view.SwigCPtr.Handle);
-                testingTarget.RefObject = obj;
-                tlog.Debug(tag, "RefObject : " + testingTarget.RefObject);
-            }
-
-            tlog.Debug(tag, $"ObjectRegistryObjectDestroyedEventArgs END (OK)");
-        }
-
-        [Test]
-        [Category("P1")]
-        [Description("ObjectRegistry ObjectRegistry .")]
-        [Property("SPEC", "Tizen.NUI.ObjectRegistry.ObjectRegistry C")]
-        [Property("SPEC_URL", "-")]
-        [Property("CRITERIA", "PRW")]
-        [Property("COVPARAM", "")]
-        [Property("AUTHOR", "guowei.wang@samsung.com")]
-        public void ObjectRegistryObjectRegistry()
-        {
-            tlog.Debug(tag, $"ObjectRegistryObjectRegistry START");
-
-            using (ObjectRegistry obj = new ObjectRegistry(new View().SwigCPtr.Handle, false))
-            {
-                var testingTarget = new ObjectRegistry(obj);
-                Assert.IsNotNull(testingTarget, "null handle");
-                Assert.IsInstanceOf<ObjectRegistry>(testingTarget, "Should return ObjectRegistry instance.");
-
-                testingTarget.Dispose();
-            }
-
-            tlog.Debug(tag, $"ObjectRegistryObjectRegistry END (OK)");
-        }
-
-        [Test]
-        [Category("P1")]
-        [Description("ObjectRegistry Assign .")]
-        [Property("SPEC", "Tizen.NUI.ObjectRegistry.Assign M")]
-        [Property("SPEC_URL", "-")]
-        [Property("CRITERIA", "MR")]
-        [Property("COVPARAM", "")]
-        [Property("AUTHOR", "guowei.wang@samsung.com")]
-        public void ObjectRegistryAssign()
-        {
-            tlog.Debug(tag, $"ObjectRegistryAssign START");
-
-            using (ObjectRegistry obj = new ObjectRegistry(new View().SwigCPtr.Handle, false))
-            {
-                var testingTarget = obj.Assign(obj);
-                Assert.IsNotNull(testingTarget, "null handle");
-                Assert.IsInstanceOf<ObjectRegistry>(testingTarget, "Should return ObjectRegistry instance.");
-
-                testingTarget.Dispose();
-            }
-
-            tlog.Debug(tag, $"ObjectRegistryAssign END (OK)");
-        }
-
-        [Test]
-        [Category("P1")]
-        [Description("ObjectRegistry ObjectCreatedSignal .")]
-        [Property("SPEC", "Tizen.NUI.ObjectRegistry.ObjectCreatedSignal M")]
-        [Property("SPEC_URL", "-")]
-        [Property("CRITERIA", "MR")]
-        [Property("COVPARAM", "")]
-        [Property("AUTHOR", "guowei.wang@samsung.com")]
-        public void ObjectRegistryObjectCreatedSignal()
-        {
-            tlog.Debug(tag, $"ObjectRegistryObjectCreatedSignal START");
-
-            using (View view = new View())
-            {
-                var testingTarget = new ObjectRegistry(view.SwigCPtr.Handle, false);
-                Assert.IsNotNull(testingTarget, "null handle");
-                Assert.IsInstanceOf<ObjectRegistry>(testingTarget, "Should return ObjectRegistry instance.");
-
-                var createdSignal = testingTarget.ObjectCreatedSignal();
-                Assert.IsInstanceOf<ObjectCreatedSignal>(createdSignal, "Should return ObjectCreatedSignal instance.");
-
-                var destroyedSignal = testingTarget.ObjectDestroyedSignal();
-                Assert.IsInstanceOf<ObjectDestroyedSignal>(destroyedSignal, "Should return ObjectDestroyedSignal instance.");
-
-                testingTarget.Dispose();
-            }
-
-            tlog.Debug(tag, $"ObjectRegistryObjectCreatedSignal END (OK)");
-        }
-    }
-}
index 2c0f29d99c64723df706b21108580be941a5ae22..8dd7347deed6a39fab598c2ab0d6ae404958fc84 100755 (executable)
@@ -319,29 +319,6 @@ namespace Tizen.NUI.Devel.Tests
             Assert.Pass("WindowGetRenderTaskList");
         }
 
-        [Test]
-        [Category("P1")]
-        [Description("Window GetObjectRegistry")]
-        [Property("SPEC", "Tizen.NUI.Window.GetObjectRegistry M")]
-        [Property("SPEC_URL", "-")]
-        [Property("CRITERIA", "MR")]
-        public void WindowGetObjectRegistry()
-        {
-            tlog.Debug(tag, $"WindowGetObjectRegistry START");
-            try
-            {
-                myWin.GetObjectRegistry();
-            }
-            catch (Exception e)
-            {
-                Tizen.Log.Error(tag, "Caught Exception" + e.ToString());
-
-                Assert.Fail("Caught Exception" + e.ToString());
-            }
-            tlog.Debug(tag, $"WindowGetObjectRegistry END (OK)");
-            Assert.Pass("WindowGetObjectRegistry");
-        }
-
         [Test]
         [Category("P1")]
         [Description("Window SetWindowSize")]