Revert "[NUI] Fix tct fail issues (#2012)" (#2017)
authordongsug-song <35130733+dongsug-song@users.noreply.github.com>
Wed, 16 Sep 2020 08:30:43 +0000 (17:30 +0900)
committerGitHub <noreply@github.com>
Wed, 16 Sep 2020 08:30:43 +0000 (17:30 +0900)
This reverts commit 1f3c2b0ed05f80f6c3985eefcd0ee3c72f2f7987.

src/Tizen.NUI/src/internal/Interop/Interop.Gesture.cs
src/Tizen.NUI/src/public/Gesture.cs
src/Tizen.NUI/src/public/Hover.cs
src/Tizen.NUI/src/public/Key.cs
src/Tizen.NUI/src/public/LongPressGesture.cs
src/Tizen.NUI/src/public/PanGesture.cs
src/Tizen.NUI/src/public/PinchGesture.cs
src/Tizen.NUI/src/public/RotationGesture.cs
src/Tizen.NUI/src/public/TapGesture.cs
src/Tizen.NUI/src/public/Wheel.cs

index 9073f51..9ea1b24 100755 (executable)
@@ -34,6 +34,9 @@ namespace Tizen.NUI
 
             [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Gesture_time_get")]
             public static extern uint Gesture_time_get(global::System.Runtime.InteropServices.HandleRef jarg1);
+
+            [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Gesture_SWIGUpcast")]
+            public static extern global::System.IntPtr Gesture_SWIGUpcast(global::System.IntPtr jarg1);
         }
     }
 }
\ No newline at end of file
index 427e387..ac418dc 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.
@@ -24,7 +24,7 @@ namespace Tizen.NUI
     /// in a particular order or within a certain time frame (for example, pinch).<br />
     /// </summary>
     /// <since_tizen> 3 </since_tizen>
-    public class Gesture : Disposable
+    public class Gesture : BaseHandle
     {
 
         /// <summary>
@@ -37,7 +37,7 @@ namespace Tizen.NUI
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
         }
 
-        internal Gesture(global::System.IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemoryOwn)
+        internal Gesture(global::System.IntPtr cPtr, bool cMemoryOwn) : base(Interop.Gesture.Gesture_SWIGUpcast(cPtr), cMemoryOwn)
         {
         }
 
@@ -193,6 +193,17 @@ namespace Tizen.NUI
             return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
         }
 
+        internal static Gesture GetGestureFromPtr(global::System.IntPtr cPtr)
+        {
+            Gesture ret = Registry.GetManagedBaseHandleFromNativePtr(cPtr) as Gesture;
+            if (ret == null)
+            {
+                ret = new Gesture(cPtr, false);
+            }
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+            return ret;
+        }
+
         /// This will not be public opened.
         [EditorBrowsable(EditorBrowsableState.Never)]
         protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr)
index a9e0907..48ca24b 100755 (executable)
@@ -25,7 +25,7 @@ namespace Tizen.NUI
     /// hovered or the points where a hover has stopped.<br />
     /// </summary>
     /// <since_tizen> 3 </since_tizen>
-    public class Hover : Disposable
+    public class Hover : BaseHandle
     {
 
         /// <summary>
@@ -51,7 +51,7 @@ namespace Tizen.NUI
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
         }
 
-        internal Hover(global::System.IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemoryOwn)
+        internal Hover(global::System.IntPtr cPtr, bool cMemoryOwn) : base(Interop.Hover.Hover_SWIGUpcast(cPtr), cMemoryOwn)
         {
         }
 
@@ -159,7 +159,12 @@ namespace Tizen.NUI
 
         internal static Hover GetHoverFromPtr(global::System.IntPtr cPtr)
         {
-            Hover ret = new Hover(cPtr, false);
+            Hover ret = Registry.GetManagedBaseHandleFromNativePtr(cPtr) as Hover;
+            if (ret == null)
+            {
+                ret = new Hover(cPtr, false);
+            }
+
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
             return ret;
         }
index 4d6d4b2..07dd8eb 100755 (executable)
@@ -24,7 +24,7 @@ namespace Tizen.NUI
     /// The key structure is used to store a key press.
     /// </summary>
     /// <since_tizen> 3 </since_tizen>
-    public class Key : Disposable
+    public class Key : BaseHandle
     {
 
         /// <summary>
@@ -50,7 +50,7 @@ namespace Tizen.NUI
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
         }
 
-        internal Key(global::System.IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemoryOwn)
+        internal Key(global::System.IntPtr cPtr, bool cMemoryOwn) : base(Interop.Key.Key_SWIGUpcast(cPtr), cMemoryOwn)
         {
         }
 
@@ -324,7 +324,11 @@ namespace Tizen.NUI
 
         internal static Key GetKeyFromPtr(global::System.IntPtr cPtr)
         {
-            Key ret = new Key(cPtr, false);
+            Key ret = Registry.GetManagedBaseHandleFromNativePtr(cPtr) as Key;
+            if (ret == null)
+            {
+                ret = new Key(cPtr, false);
+            }
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
             return ret;
         }
index 54c0037..eba8886 100755 (executable)
@@ -1,5 +1,5 @@
 /*
- * Copyright(c) 2017 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.
@@ -135,7 +135,11 @@ namespace Tizen.NUI
 
         internal static LongPressGesture GetLongPressGestureFromPtr(global::System.IntPtr cPtr)
         {
-            LongPressGesture ret = new LongPressGesture(cPtr, false);
+            LongPressGesture ret = Registry.GetManagedBaseHandleFromNativePtr(cPtr) as LongPressGesture;
+            if (ret == null)
+            {
+                ret = new LongPressGesture(cPtr, false);
+            }
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
             return ret;
         }
index dcf2016..78e4c36 100755 (executable)
@@ -1,5 +1,5 @@
 /*
- * Copyright(c) 2017 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.
@@ -326,7 +326,11 @@ namespace Tizen.NUI
 
         internal static PanGesture GetPanGestureFromPtr(global::System.IntPtr cPtr)
         {
-            PanGesture ret = new PanGesture(cPtr, false);
+            PanGesture ret = Registry.GetManagedBaseHandleFromNativePtr(cPtr) as PanGesture;
+            if (ret == null)
+            {
+                ret = new PanGesture(cPtr, false);
+            }
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
             return ret;
         }
index 7c1da7a..fae237d 100755 (executable)
@@ -1,5 +1,5 @@
 /*
- * Copyright(c) 2017 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.
@@ -163,7 +163,11 @@ namespace Tizen.NUI
 
         internal static PinchGesture GetPinchGestureFromPtr(global::System.IntPtr cPtr)
         {
-            PinchGesture ret = new PinchGesture(cPtr, false);
+            PinchGesture ret = Registry.GetManagedBaseHandleFromNativePtr(cPtr) as PinchGesture;
+            if (ret == null)
+            {
+                ret = new PinchGesture(cPtr, false);
+            }
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
             return ret;
         }
index 289ae21..8110927 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.
@@ -137,7 +137,11 @@ namespace Tizen.NUI
 
         internal static RotationGesture GetRotationGestureFromPtr(global::System.IntPtr cPtr)
         {
-            RotationGesture ret = new RotationGesture(cPtr, false);
+            RotationGesture ret = Registry.GetManagedBaseHandleFromNativePtr(cPtr) as RotationGesture;
+            if (ret == null)
+            {
+                ret = new RotationGesture(cPtr, false);
+            }
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
             return ret;
         }
index 47dea70..aa5b9fd 100755 (executable)
@@ -1,5 +1,5 @@
 /*
- * Copyright(c) 2017 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.
@@ -161,7 +161,11 @@ namespace Tizen.NUI
         /// <returns>The TapGesture object.</returns>
         internal static TapGesture GetTapGestureFromPtr(global::System.IntPtr cPtr)
         {
-            TapGesture ret = new TapGesture(cPtr, false);
+            TapGesture ret = Registry.GetManagedBaseHandleFromNativePtr(cPtr) as TapGesture;
+            if (ret == null)
+            {
+                ret = new TapGesture(cPtr, false);
+            }
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
             return ret;
         }
index 432c99d..adb0230 100755 (executable)
@@ -26,7 +26,7 @@ namespace Tizen.NUI
     /// The mouse wheel event can be sent to the specific actor but the custom wheel event will be sent to the window.<br />
     /// </summary>
     /// <since_tizen> 3 </since_tizen>
-    public class Wheel : Disposable
+    public class Wheel : BaseHandle
     {
 
         /// <summary>
@@ -53,7 +53,7 @@ namespace Tizen.NUI
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
         }
 
-        internal Wheel(global::System.IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemoryOwn)
+        internal Wheel(global::System.IntPtr cPtr, bool cMemoryOwn) : base(Interop.Wheel.Wheel_SWIGUpcast(cPtr), cMemoryOwn)
         {
         }
 
@@ -253,7 +253,11 @@ namespace Tizen.NUI
 
         internal static Wheel GetWheelFromPtr(global::System.IntPtr cPtr)
         {
-            Wheel ret = new Wheel(cPtr, false);
+            Wheel ret = Registry.GetManagedBaseHandleFromNativePtr(cPtr) as Wheel;
+            if (ret == null)
+            {
+                ret = new Wheel(cPtr, false);
+            }
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
             return ret;
         }