From 1f3c2b0ed05f80f6c3985eefcd0ee3c72f2f7987 Mon Sep 17 00:00:00 2001
From: dongsug-song <35130733+dongsug-song@users.noreply.github.com>
Date: Tue, 15 Sep 2020 16:30:52 +0900
Subject: [PATCH] [NUI] Fix tct fail issues (#2012)
* Revert "[NUI] Adding VertexBuffer to replace PropertyBuffer (#1983)"
This reverts commit 114d09295e8deedbfd31ff825164f0e8a6defe9a.
* Revert "[NUI] Change parent class of Hover, Key, Wheel and Gesture to BaseHandle (#2001)"
This reverts commit f57729e8b0e69dbab9864ff8248e9d86584072ad.
---
.../src/internal/Interop/Interop.Gesture.cs | 3 -
.../src/internal/Interop/Interop.VertexBuffer.cs | 39 ---------
src/Tizen.NUI/src/public/Geometry.cs | 16 +---
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/VertexBuffer.cs | 94 ----------------------
src/Tizen.NUI/src/public/Wheel.cs | 10 +--
13 files changed, 23 insertions(+), 217 deletions(-)
delete mode 100644 src/Tizen.NUI/src/internal/Interop/Interop.VertexBuffer.cs
delete mode 100644 src/Tizen.NUI/src/public/VertexBuffer.cs
diff --git a/src/Tizen.NUI/src/internal/Interop/Interop.Gesture.cs b/src/Tizen.NUI/src/internal/Interop/Interop.Gesture.cs
index 9ea1b24..9073f51 100755
--- a/src/Tizen.NUI/src/internal/Interop/Interop.Gesture.cs
+++ b/src/Tizen.NUI/src/internal/Interop/Interop.Gesture.cs
@@ -34,9 +34,6 @@ 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/internal/Interop/Interop.VertexBuffer.cs b/src/Tizen.NUI/src/internal/Interop/Interop.VertexBuffer.cs
deleted file mode 100644
index 256c7cf..0000000
--- a/src/Tizen.NUI/src/internal/Interop/Interop.VertexBuffer.cs
+++ /dev/null
@@ -1,39 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Text;
-
-namespace Tizen.NUI
-{
- internal static partial class Interop
- {
- internal static partial class VertexBuffer
- {
- [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_VertexBuffer_SWIGUpcast")]
- public static extern global::System.IntPtr VertexBuffer_SWIGUpcast(global::System.IntPtr jarg1);
-
- [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_VertexBuffer_New")]
- public static extern global::System.IntPtr VertexBuffer_New(global::System.Runtime.InteropServices.HandleRef jarg1);
-
- [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_new_VertexBuffer__SWIG_0")]
- public static extern global::System.IntPtr new_VertexBuffer__SWIG_0();
-
- [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_delete_VertexBuffer")]
- public static extern void delete_VertexBuffer(global::System.Runtime.InteropServices.HandleRef jarg1);
-
- [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_new_VertexBuffer__SWIG_1")]
- public static extern global::System.IntPtr new_VertexBuffer__SWIG_1(global::System.Runtime.InteropServices.HandleRef jarg1);
-
- [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_VertexBuffer_DownCast")]
- public static extern global::System.IntPtr VertexBuffer_DownCast(global::System.Runtime.InteropServices.HandleRef jarg1);
-
- [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_VertexBuffer_Assign")]
- public static extern global::System.IntPtr VertexBuffer_Assign(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2);
-
- [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_VertexBuffer_SetData")]
- public static extern void VertexBuffer_SetData(global::System.Runtime.InteropServices.HandleRef jarg1, System.IntPtr jarg2, uint jarg3);
-
- [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_VertexBuffer_GetSize")]
- public static extern uint VertexBuffer_GetSize(global::System.Runtime.InteropServices.HandleRef jarg1);
- }
- }
-}
\ No newline at end of file
diff --git a/src/Tizen.NUI/src/public/Geometry.cs b/src/Tizen.NUI/src/public/Geometry.cs
index ebe90a5..93532a3 100755
--- a/src/Tizen.NUI/src/public/Geometry.cs
+++ b/src/Tizen.NUI/src/public/Geometry.cs
@@ -97,20 +97,6 @@ namespace Tizen.NUI
}
///
- /// Adds a VertexBuffer to be used as source of geometry vertices.
- ///
- /// VertexBuffer to be used as source of geometry vertices.
- /// Index of the newly added buffer.
- /// 8
- public uint AddVertexBuffer(VertexBuffer vertexBuffer)
- {
- uint ret = Interop.Geometry.Geometry_AddVertexBuffer(swigCPtr, VertexBuffer.getCPtr(vertexBuffer));
- if (NDalicPINVOKE.SWIGPendingException.Pending)
- throw NDalicPINVOKE.SWIGPendingException.Retrieve();
- return ret;
- }
-
- ///
/// Retrieves the number of vertex buffers that have been added to this geometry.
///
/// Number of vertex buffers that have been added to this geometry.
@@ -181,4 +167,4 @@ namespace Tizen.NUI
Interop.Geometry.delete_Geometry(swigCPtr);
}
}
-}
+}
\ 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 ac418dc..427e387 100755
--- a/src/Tizen.NUI/src/public/Gesture.cs
+++ b/src/Tizen.NUI/src/public/Gesture.cs
@@ -1,5 +1,5 @@
/*
- * Copyright(c) 2020 Samsung Electronics Co., Ltd.
+ * Copyright(c) 2019 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 : BaseHandle
+ public class Gesture : Disposable
{
///
@@ -37,7 +37,7 @@ namespace Tizen.NUI
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
- internal Gesture(global::System.IntPtr cPtr, bool cMemoryOwn) : base(Interop.Gesture.Gesture_SWIGUpcast(cPtr), cMemoryOwn)
+ internal Gesture(global::System.IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemoryOwn)
{
}
@@ -193,17 +193,6 @@ 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 48ca24b..a9e0907 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 : BaseHandle
+ public class Hover : Disposable
{
///
@@ -51,7 +51,7 @@ namespace Tizen.NUI
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
- internal Hover(global::System.IntPtr cPtr, bool cMemoryOwn) : base(Interop.Hover.Hover_SWIGUpcast(cPtr), cMemoryOwn)
+ internal Hover(global::System.IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemoryOwn)
{
}
@@ -159,12 +159,7 @@ namespace Tizen.NUI
internal static Hover GetHoverFromPtr(global::System.IntPtr cPtr)
{
- Hover ret = Registry.GetManagedBaseHandleFromNativePtr(cPtr) as Hover;
- if (ret == null)
- {
- ret = new Hover(cPtr, false);
- }
-
+ Hover 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 07dd8eb..4d6d4b2 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 : BaseHandle
+ public class Key : Disposable
{
///
@@ -50,7 +50,7 @@ namespace Tizen.NUI
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
- internal Key(global::System.IntPtr cPtr, bool cMemoryOwn) : base(Interop.Key.Key_SWIGUpcast(cPtr), cMemoryOwn)
+ internal Key(global::System.IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemoryOwn)
{
}
@@ -324,11 +324,7 @@ namespace Tizen.NUI
internal static Key GetKeyFromPtr(global::System.IntPtr cPtr)
{
- Key ret = Registry.GetManagedBaseHandleFromNativePtr(cPtr) as Key;
- if (ret == null)
- {
- ret = new Key(cPtr, false);
- }
+ Key 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 eba8886..54c0037 100755
--- a/src/Tizen.NUI/src/public/LongPressGesture.cs
+++ b/src/Tizen.NUI/src/public/LongPressGesture.cs
@@ -1,5 +1,5 @@
/*
- * Copyright(c) 2020 Samsung Electronics Co., Ltd.
+ * Copyright(c) 2017 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,11 +135,7 @@ namespace Tizen.NUI
internal static LongPressGesture GetLongPressGestureFromPtr(global::System.IntPtr cPtr)
{
- LongPressGesture ret = Registry.GetManagedBaseHandleFromNativePtr(cPtr) as LongPressGesture;
- if (ret == null)
- {
- ret = new LongPressGesture(cPtr, false);
- }
+ LongPressGesture 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 78e4c36..dcf2016 100755
--- a/src/Tizen.NUI/src/public/PanGesture.cs
+++ b/src/Tizen.NUI/src/public/PanGesture.cs
@@ -1,5 +1,5 @@
/*
- * Copyright(c) 2020 Samsung Electronics Co., Ltd.
+ * Copyright(c) 2017 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,11 +326,7 @@ namespace Tizen.NUI
internal static PanGesture GetPanGestureFromPtr(global::System.IntPtr cPtr)
{
- PanGesture ret = Registry.GetManagedBaseHandleFromNativePtr(cPtr) as PanGesture;
- if (ret == null)
- {
- ret = new PanGesture(cPtr, false);
- }
+ PanGesture 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 fae237d..7c1da7a 100755
--- a/src/Tizen.NUI/src/public/PinchGesture.cs
+++ b/src/Tizen.NUI/src/public/PinchGesture.cs
@@ -1,5 +1,5 @@
/*
- * Copyright(c) 2020 Samsung Electronics Co., Ltd.
+ * Copyright(c) 2017 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,11 +163,7 @@ namespace Tizen.NUI
internal static PinchGesture GetPinchGestureFromPtr(global::System.IntPtr cPtr)
{
- PinchGesture ret = Registry.GetManagedBaseHandleFromNativePtr(cPtr) as PinchGesture;
- if (ret == null)
- {
- ret = new PinchGesture(cPtr, false);
- }
+ PinchGesture 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 8110927..289ae21 100755
--- a/src/Tizen.NUI/src/public/RotationGesture.cs
+++ b/src/Tizen.NUI/src/public/RotationGesture.cs
@@ -1,5 +1,5 @@
/*
- * Copyright(c) 2020 Samsung Electronics Co., Ltd.
+ * Copyright(c) 2019 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,11 +137,7 @@ namespace Tizen.NUI
internal static RotationGesture GetRotationGestureFromPtr(global::System.IntPtr cPtr)
{
- RotationGesture ret = Registry.GetManagedBaseHandleFromNativePtr(cPtr) as RotationGesture;
- if (ret == null)
- {
- ret = new RotationGesture(cPtr, false);
- }
+ RotationGesture 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 aa5b9fd..47dea70 100755
--- a/src/Tizen.NUI/src/public/TapGesture.cs
+++ b/src/Tizen.NUI/src/public/TapGesture.cs
@@ -1,5 +1,5 @@
/*
- * Copyright(c) 2020 Samsung Electronics Co., Ltd.
+ * Copyright(c) 2017 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,11 +161,7 @@ namespace Tizen.NUI
/// The TapGesture object.
internal static TapGesture GetTapGestureFromPtr(global::System.IntPtr cPtr)
{
- TapGesture ret = Registry.GetManagedBaseHandleFromNativePtr(cPtr) as TapGesture;
- if (ret == null)
- {
- ret = new TapGesture(cPtr, false);
- }
+ TapGesture ret = new TapGesture(cPtr, false);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
return ret;
}
diff --git a/src/Tizen.NUI/src/public/VertexBuffer.cs b/src/Tizen.NUI/src/public/VertexBuffer.cs
deleted file mode 100644
index 8168720..0000000
--- a/src/Tizen.NUI/src/public/VertexBuffer.cs
+++ /dev/null
@@ -1,94 +0,0 @@
-/*
- * 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.
- * 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.ComponentModel;
-using System.Runtime.InteropServices;
-
-namespace Tizen.NUI
-{
- ///
- /// VertexBuffer is a handle to an object that contains a buffer of structured data.
- /// VertexBuffers can be used to provide data to Geometry objects.
- ///
- /// 8
- public class VertexBuffer : BaseHandle
- {
-
- ///
- /// Creates a VertexBuffer.
- ///
- /// The map of names and types that describes the components of the buffer.
- /// 8
- public VertexBuffer(PropertyMap bufferFormat) : this(Interop.VertexBuffer.VertexBuffer_New(PropertyMap.getCPtr(bufferFormat)), true)
- {
- if (NDalicPINVOKE.SWIGPendingException.Pending)
- throw NDalicPINVOKE.SWIGPendingException.Retrieve();
- }
-
- internal VertexBuffer(global::System.IntPtr cPtr, bool cMemoryOwn) : base(Interop.VertexBuffer.VertexBuffer_SWIGUpcast(cPtr), cMemoryOwn)
- {
- }
-
- ///
- /// Updates the whole buffer information.
- /// This function expects an array of structures with the same format that was given in the construction.
- ///
- /// The vertex data that will be copied to the buffer.
- /// 8
-
- public void SetData(VertexType[] vertices) where VertexType : struct
- {
- int structSize = Marshal.SizeOf();
- global::System.IntPtr buffer = Marshal.AllocHGlobal(structSize * vertices.Length);
-
- for (int i = 0; i < vertices.Length; i++)
- {
- Marshal.StructureToPtr(vertices[i], buffer + i * structSize, true);
- }
-
- Interop.VertexBuffer.VertexBuffer_SetData(swigCPtr, buffer, (uint)vertices.Length);
- if (NDalicPINVOKE.SWIGPendingException.Pending)
- throw NDalicPINVOKE.SWIGPendingException.Retrieve();
- }
-
- ///
- /// Gets the number of elements in the buffer.
- ///
- /// Number of elements in the buffer.
- /// 8
- public uint GetSize()
- {
- uint ret = Interop.VertexBuffer.VertexBuffer_GetSize(swigCPtr);
- if (NDalicPINVOKE.SWIGPendingException.Pending)
- throw NDalicPINVOKE.SWIGPendingException.Retrieve();
- return ret;
- }
-
- internal static global::System.Runtime.InteropServices.HandleRef getCPtr(VertexBuffer obj)
- {
- return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
- }
-
- /// This will not be public opened.
- [EditorBrowsable(EditorBrowsableState.Never)]
- protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr)
- {
- Interop.VertexBuffer.delete_VertexBuffer(swigCPtr);
- }
- }
-}
diff --git a/src/Tizen.NUI/src/public/Wheel.cs b/src/Tizen.NUI/src/public/Wheel.cs
index adb0230..432c99d 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 : BaseHandle
+ public class Wheel : Disposable
{
///
@@ -53,7 +53,7 @@ namespace Tizen.NUI
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
- internal Wheel(global::System.IntPtr cPtr, bool cMemoryOwn) : base(Interop.Wheel.Wheel_SWIGUpcast(cPtr), cMemoryOwn)
+ internal Wheel(global::System.IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemoryOwn)
{
}
@@ -253,11 +253,7 @@ namespace Tizen.NUI
internal static Wheel GetWheelFromPtr(global::System.IntPtr cPtr)
{
- Wheel ret = Registry.GetManagedBaseHandleFromNativePtr(cPtr) as Wheel;
- if (ret == null)
- {
- ret = new Wheel(cPtr, false);
- }
+ Wheel ret = new Wheel(cPtr, false);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
return ret;
}
--
2.7.4