[NUI] Add GetMouseButton in Touch (#302)
authordongsug-song <35130733+dongsug-song@users.noreply.github.com>
Wed, 20 Jun 2018 08:05:53 +0000 (17:05 +0900)
committerGitHub <noreply@github.com>
Wed, 20 Jun 2018 08:05:53 +0000 (17:05 +0900)
src/Tizen.NUI/src/internal/ManualPINVOKE.cs
src/Tizen.NUI/src/public/Touch.cs

index 93cd728..be50b6d 100755 (executable)
@@ -1774,5 +1774,8 @@ namespace Tizen.NUI
         [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint = "CSharp_Dali_SetLayout__SWIG_1")]
         public static extern void SetLayout__SWIG_1(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2);
 
+        [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint = "CSharp_Dali_Touch_GetMouseButton")]
+        public static extern int Touch_GetMouseButton(global::System.Runtime.InteropServices.HandleRef jarg1, ulong jarg2);
+
     }
 }
index 635c679..df95248 100755 (executable)
  * limitations under the License.
  *
  */
+using System.ComponentModel;
+using System.Runtime.InteropServices;
+using Tizen.NUI.BaseComponents;
 
 namespace Tizen.NUI
 {
-    using System.Runtime.InteropServices;
-    using Tizen.NUI.BaseComponents;
     /// <summary>
     /// Touch events are a collection of points at a specific moment in time.<br />
     /// When a multi-touch event occurs, each point represents the points that are currently being
@@ -45,12 +46,12 @@ namespace Tizen.NUI
         /// <since_tizen> 3 </since_tizen>
         protected override void Dispose(DisposeTypes type)
         {
-            if(disposed)
+            if (disposed)
             {
                 return;
             }
 
-            if(type == DisposeTypes.Explicit)
+            if (type == DisposeTypes.Explicit)
             {
                 //Called by User
                 //Release your own managed resources here.
@@ -260,6 +261,48 @@ namespace Tizen.NUI
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
             return ret;
         }
+        /// <summary>
+        /// Get mouse device's button value (ex: right/left button)
+        /// </summary>
+        /// <param name="point">The point required</param>
+        /// <returns></returns>
+        /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public MouseButtonType GetMouseButton(uint point)
+        {
+            int ret = NDalicManualPINVOKE.Touch_GetMouseButton(swigCPtr, point);
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+            return (MouseButtonType)ret;
+        }
+    }
 
+    /// <summary>
+    /// Mouse device button type
+    /// </summary>
+    /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
+    [EditorBrowsable(EditorBrowsableState.Never)]
+    public enum MouseButtonType
+    {
+        /// <summary>
+        /// No mouse button event or invalid data
+        /// </summary>
+        Invalid = -1,
+        /// <summary>
+        /// Left mouse button
+        /// </summary>
+        LeftButton = 1,
+        /// <summary>
+        /// Center(Wheel) mouse button
+        /// </summary>
+        CenterButton = 2,
+        /// <summary>
+        /// Right mouse button
+        /// </summary>
+        RightButton = 3,
+        /// <summary>
+        /// Reserved mouse button for different mouse devices
+        /// </summary>
+        Reserved = 4,
     }
+
 }
\ No newline at end of file