From 68a8de252989072bb8ccd9a0ff7a50564f2813a5 Mon Sep 17 00:00:00 2001
From: dongsug-song <35130733+dongsug-song@users.noreply.github.com>
Date: Wed, 16 Sep 2020 17:30:43 +0900
Subject: [PATCH] Revert "[NUI] Fix tct fail issues (#2012)" (#2017)
This reverts commit 1f3c2b0ed05f80f6c3985eefcd0ee3c72f2f7987.
---
src/Tizen.NUI/src/internal/Interop/Interop.Gesture.cs | 3 +++
src/Tizen.NUI/src/public/Gesture.cs | 17 ++++++++++++++---
src/Tizen.NUI/src/public/Hover.cs | 11 ++++++++---
src/Tizen.NUI/src/public/Key.cs | 10 +++++++---
src/Tizen.NUI/src/public/LongPressGesture.cs | 8 ++++++--
src/Tizen.NUI/src/public/PanGesture.cs | 8 ++++++--
src/Tizen.NUI/src/public/PinchGesture.cs | 8 ++++++--
src/Tizen.NUI/src/public/RotationGesture.cs | 8 ++++++--
src/Tizen.NUI/src/public/TapGesture.cs | 8 ++++++--
src/Tizen.NUI/src/public/Wheel.cs | 10 +++++++---
10 files changed, 69 insertions(+), 22 deletions(-)
diff --git a/src/Tizen.NUI/src/internal/Interop/Interop.Gesture.cs b/src/Tizen.NUI/src/internal/Interop/Interop.Gesture.cs
index 9073f51..9ea1b24 100755
--- a/src/Tizen.NUI/src/internal/Interop/Interop.Gesture.cs
+++ b/src/Tizen.NUI/src/internal/Interop/Interop.Gesture.cs
@@ -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
diff --git a/src/Tizen.NUI/src/public/Gesture.cs b/src/Tizen.NUI/src/public/Gesture.cs
index 427e387..ac418dc 100755
--- a/src/Tizen.NUI/src/public/Gesture.cs
+++ b/src/Tizen.NUI/src/public/Gesture.cs
@@ -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).
///
/// 3
- public class Gesture : Disposable
+ public class Gesture : BaseHandle
{
///
@@ -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)
diff --git a/src/Tizen.NUI/src/public/Hover.cs b/src/Tizen.NUI/src/public/Hover.cs
index a9e0907..48ca24b 100755
--- a/src/Tizen.NUI/src/public/Hover.cs
+++ b/src/Tizen.NUI/src/public/Hover.cs
@@ -25,7 +25,7 @@ namespace Tizen.NUI
/// hovered or the points where a hover has stopped.
///
/// 3
- public class Hover : Disposable
+ public class Hover : BaseHandle
{
///
@@ -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;
}
diff --git a/src/Tizen.NUI/src/public/Key.cs b/src/Tizen.NUI/src/public/Key.cs
index 4d6d4b2..07dd8eb 100755
--- a/src/Tizen.NUI/src/public/Key.cs
+++ b/src/Tizen.NUI/src/public/Key.cs
@@ -24,7 +24,7 @@ namespace Tizen.NUI
/// The key structure is used to store a key press.
///
/// 3
- public class Key : Disposable
+ public class Key : BaseHandle
{
///
@@ -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;
}
diff --git a/src/Tizen.NUI/src/public/LongPressGesture.cs b/src/Tizen.NUI/src/public/LongPressGesture.cs
index 54c0037..eba8886 100755
--- a/src/Tizen.NUI/src/public/LongPressGesture.cs
+++ b/src/Tizen.NUI/src/public/LongPressGesture.cs
@@ -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;
}
diff --git a/src/Tizen.NUI/src/public/PanGesture.cs b/src/Tizen.NUI/src/public/PanGesture.cs
index dcf2016..78e4c36 100755
--- a/src/Tizen.NUI/src/public/PanGesture.cs
+++ b/src/Tizen.NUI/src/public/PanGesture.cs
@@ -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;
}
diff --git a/src/Tizen.NUI/src/public/PinchGesture.cs b/src/Tizen.NUI/src/public/PinchGesture.cs
index 7c1da7a..fae237d 100755
--- a/src/Tizen.NUI/src/public/PinchGesture.cs
+++ b/src/Tizen.NUI/src/public/PinchGesture.cs
@@ -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;
}
diff --git a/src/Tizen.NUI/src/public/RotationGesture.cs b/src/Tizen.NUI/src/public/RotationGesture.cs
index 289ae21..8110927 100755
--- a/src/Tizen.NUI/src/public/RotationGesture.cs
+++ b/src/Tizen.NUI/src/public/RotationGesture.cs
@@ -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;
}
diff --git a/src/Tizen.NUI/src/public/TapGesture.cs b/src/Tizen.NUI/src/public/TapGesture.cs
index 47dea70..aa5b9fd 100755
--- a/src/Tizen.NUI/src/public/TapGesture.cs
+++ b/src/Tizen.NUI/src/public/TapGesture.cs
@@ -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
/// The TapGesture object.
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;
}
diff --git a/src/Tizen.NUI/src/public/Wheel.cs b/src/Tizen.NUI/src/public/Wheel.cs
index 432c99d..adb0230 100755
--- a/src/Tizen.NUI/src/public/Wheel.cs
+++ b/src/Tizen.NUI/src/public/Wheel.cs
@@ -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.
///
/// 3
- public class Wheel : Disposable
+ public class Wheel : BaseHandle
{
///
@@ -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;
}
--
2.7.4