コード例 #1
0
ファイル: DefaultBorder.cs プロジェクト: lol-github/TizenFX
        // Window moves through pan gestures.
        private void OnWinPanGestureDetected(object source, PanGestureDetector.DetectedEventArgs e)
        {
            if (currentGesture <= CurrentGesture.PanGesture /*&& panGesture.NumberOfTouches == 1*/)
            {
                PanGesture panGesture = e.PanGesture;

                if (panGesture.State == Gesture.StateType.Started)
                {
                    currentGesture = CurrentGesture.PanGesture;
                    if (BorderWindow.IsMaximized() == true)
                    {
                        BorderWindow.Maximize(false);
                    }
                    else
                    {
                        BorderWindow.RequestMoveToServer();
                    }
                }
                else if (panGesture.State == Gesture.StateType.Finished || panGesture.State == Gesture.StateType.Cancelled)
                {
                    currentGesture = CurrentGesture.None;
                    ClearWindowGesture();
                }
            }
        }
コード例 #2
0
ファイル: ViewWrapperImpl.cs プロジェクト: yunmiha/TizenFX
        private void DirectorOnPan(global::System.IntPtr pan)
        {
            var panGesture = new PanGesture(pan, false);

            OnPan?.Invoke(panGesture);
            panGesture.Dispose();
        }
コード例 #3
0
 public void Emit(View arg1, PanGesture arg2)
 {
     Interop.PanGestureDetector.PanGestureDetectedSignalEmit(swigCPtr, View.getCPtr(arg1), PanGesture.getCPtr(arg2));
     if (NDalicPINVOKE.SWIGPendingException.Pending)
     {
         throw NDalicPINVOKE.SWIGPendingException.Retrieve();
     }
 }
コード例 #4
0
 public static void SetPanGestureProperties(PanGesture pan)
 {
     Interop.PanGestureDetector.SetPanGestureProperties(PanGesture.getCPtr(pan));
     if (NDalicPINVOKE.SWIGPendingException.Pending)
     {
         throw NDalicPINVOKE.SWIGPendingException.Retrieve();
     }
 }
コード例 #5
0
ファイル: ViewWrapperImpl.cs プロジェクト: yunmiha/TizenFX
        private bool DirectorOnAccessibilityPan(global::System.IntPtr gesture)
        {
            var panGesture = new PanGesture(gesture, true);
            var ret        = OnAccessibilityPan?.Invoke(panGesture) ?? false;

            panGesture.Dispose();
            return(ret);
        }
コード例 #6
0
        internal static PanGesture GetPanGestureFromPtr(global::System.IntPtr cPtr)
        {
            PanGesture ret = new PanGesture(cPtr, false);

            if (NDalicPINVOKE.SWIGPendingException.Pending)
            {
                throw NDalicPINVOKE.SWIGPendingException.Retrieve();
            }
            return(ret);
        }
コード例 #7
0
ファイル: DefaultBorder.cs プロジェクト: lol-github/TizenFX
        /// Determines the behavior of borders.
        private void OnPanGestureDetected(object source, PanGestureDetector.DetectedEventArgs e)
        {
            if (e == null)
            {
                return;
            }
            PanGesture panGesture = e.PanGesture;

            if (panGesture.State == Gesture.StateType.Started && panGesture.Position != null)
            {
                direction = BorderWindow.GetDirection(panGesture.Position.X, panGesture.Position.Y);
                if (direction == Window.BorderDirection.Move)
                {
                    if (BorderWindow.IsMaximized() == true)
                    {
                        BorderWindow.Maximize(false);
                    }
                    else
                    {
                        BorderWindow.RequestMoveToServer();
                    }
                }
                else if (direction != Window.BorderDirection.None)
                {
                    OnRequestResize();
                    BorderWindow.RequestResizeToServer((Window.ResizeDirection)direction);
                }
            }
            else if (panGesture.State == Gesture.StateType.Continuing)
            {
                if (direction == Window.BorderDirection.BottomLeft || direction == Window.BorderDirection.BottomRight || direction == Window.BorderDirection.TopLeft || direction == Window.BorderDirection.TopRight)
                {
                    BorderWindow.WindowSize += new Size2D((int)panGesture.ScreenDisplacement.X, (int)panGesture.ScreenDisplacement.Y);
                }
                else if (direction == Window.BorderDirection.Left || direction == Window.BorderDirection.Right)
                {
                    BorderWindow.WindowSize += new Size2D((int)panGesture.ScreenDisplacement.X, 0);
                }
                else if (direction == Window.BorderDirection.Bottom || direction == Window.BorderDirection.Top)
                {
                    BorderWindow.WindowSize += new Size2D(0, (int)panGesture.ScreenDisplacement.Y);
                }
                else if (direction == Window.BorderDirection.Move)
                {
                    BorderWindow.WindowPosition += new Position2D((int)panGesture.ScreenDisplacement.X, (int)panGesture.ScreenDisplacement.Y);
                }
            }
            else if (panGesture.State == Gesture.StateType.Finished || panGesture.State == Gesture.StateType.Cancelled)
            {
                direction = Window.BorderDirection.None;
                ClearWindowGesture();
            }
        }
コード例 #8
0
ファイル: PanGesture.cs プロジェクト: xerrni/TizenFX
        internal static PanGesture GetPanGestureFromPtr(global::System.IntPtr cPtr)
        {
            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);
        }
コード例 #9
0
ファイル: DefaultBorder.cs プロジェクト: wonrst/TizenFX
        /// Determines the behavior of borders.
        private void OnPanGestureDetected(object source, PanGestureDetector.DetectedEventArgs e)
        {
            if (e == null)
            {
                return;
            }
            PanGesture panGesture = e.PanGesture;

            if (panGesture.State == Gesture.StateType.Started && panGesture.Position != null)
            {
                direction = BorderWindow.GetDirection(panGesture.Position.X, panGesture.Position.Y);

                if (direction == Window.BorderDirection.Move)
                {
                    if (BorderWindow.IsMaximized() == true)
                    {
                        BorderWindow.Maximize(false);
                        OnMaximize(false);
                    }
                    else
                    {
                        BorderWindow.RequestMoveToServer();
                    }
                }
                else if (direction != Window.BorderDirection.None && ResizePolicy != Window.BorderResizePolicyType.Fixed)
                {
                    OnRequestResize();
                    BorderWindow.RequestResizeToServer((Window.ResizeDirection)direction);
                }
            }
            else if (panGesture.State == Gesture.StateType.Finished || panGesture.State == Gesture.StateType.Cancelled)
            {
                direction = Window.BorderDirection.None;
                ClearWindowGesture();
            }
        }
コード例 #10
0
 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(PanGesture obj)
 {
     return((obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr);
 }