Exemplo n.º 1
0
        public static bool OnMouseDown(global::Uno.Runtime.Implementation.PlatformWindowHandle handle, int x, int y, global::Uno.Platform.MouseButton button)
        {
            global::Uno.Application app = global::Uno.Application.Current;

            if (app == null)
            {
                return(false);
            }

            global::Uno.Platform.PointerEventArgs args = new global::Uno.Platform.PointerEventArgs(global::Uno.Platform.PointerType.Mouse, Bootstrapper.GetEventModifiers(handle), button == global::Uno.Platform.MouseButton.Left, new global::Uno.Float2((float)x, (float)y), 0, button, new global::Uno.Float2(0.0f, 0.0f), global::Uno.Platform.WheelDeltaMode.DeltaPixel);
            global::Uno.Platform.EventSources.MouseSource.OnPointerPressed(args);
            return(args.Handled);
        }
Exemplo n.º 2
0
        public static bool OnMouseWheel(global::Uno.Runtime.Implementation.PlatformWindowHandle handle, float dHori, float dVert, int wheelDeltaMode)
        {
            global::Uno.Application app = global::Uno.Application.Current;

            if (app == null)
            {
                return(false);
            }

            global::Uno.Platform.PointerEventArgs args = new global::Uno.Platform.PointerEventArgs(global::Uno.Platform.PointerType.Mouse, Bootstrapper.GetEventModifiers(handle), false, new global::Uno.Float2((float)Bootstrapper._lastMouseX, (float)Bootstrapper._lastMouseY), 0, 0, new global::Uno.Float2(dHori, dVert), (global::Uno.Platform.WheelDeltaMode)wheelDeltaMode);
            global::Uno.Platform.EventSources.MouseSource.OnPointerWheelChanged(args);
            return(args.Handled);
        }
Exemplo n.º 3
0
        public static bool OnMouseOut(global::Uno.Runtime.Implementation.PlatformWindowHandle handle)
        {
            global::Uno.Application app = global::Uno.Application.Current;

            if (app == null)
            {
                return(false);
            }

            global::Uno.Platform.EventModifiers   modifiers = Bootstrapper.GetEventModifiers(handle);
            global::Uno.Platform.PointerEventArgs args      = new global::Uno.Platform.PointerEventArgs(global::Uno.Platform.PointerType.Mouse, modifiers, modifiers.HasFlag(global::Uno.Platform.EventModifiers.LeftButton), new global::Uno.Float2(0.0f, 0.0f), 0, 0, new global::Uno.Float2(0.0f, 0.0f), global::Uno.Platform.WheelDeltaMode.DeltaPixel);
            global::Uno.Platform.EventSources.MouseSource.OnPointerLeft(args);
            return(args.Handled);
        }
Exemplo n.º 4
0
        public static bool OnTouchMove(global::Uno.Runtime.Implementation.PlatformWindowHandle handle, float x, float y, int id)
        {
            global::Uno.Application app = global::Uno.Application.Current;

            if (Bootstrapper._fingerCount == 1)
            {
                Bootstrapper._lastPrimaryFingerId = id;
            }

            if (app == null)
            {
                return(false);
            }

            global::Uno.Platform.PointerEventArgs args = new global::Uno.Platform.PointerEventArgs(global::Uno.Platform.PointerType.Touch, Bootstrapper.GetEventModifiers(handle), Bootstrapper.IsPrimaryFinger(handle, id), new global::Uno.Float2(x, y), id, 0, new global::Uno.Float2(0.0f, 0.0f), global::Uno.Platform.WheelDeltaMode.DeltaPixel);
            global::Uno.Platform.EventSources.MouseSource.OnPointerMoved(args);
            return(args.Handled);
        }
Exemplo n.º 5
0
 public static void BeginTextInput(global::Uno.Platform.TextInputHint hint)
 {
     global::Uno.Runtime.Implementation.PlatformWindowHandle _handle = global::Uno.Application.Current.Window._handle;
     global::Uno.Runtime.Implementation.PlatformWindowImpl.BeginTextInput(_handle, hint);
 }
Exemplo n.º 6
0
 public static void EndTextInput()
 {
     global::Uno.Runtime.Implementation.PlatformWindowHandle _handle = global::Uno.Application.Current.Window._handle;
     global::Uno.Runtime.Implementation.PlatformWindowImpl.EndTextInput(_handle);
 }
Exemplo n.º 7
0
 public OSFrame()
 {
     this._handle = global::Uno.Runtime.Implementation.PlatformWindowImpl.GetInstance();
 }
Exemplo n.º 8
0
 public static bool OnTextInput(global::Uno.Runtime.Implementation.PlatformWindowHandle handle, string text)
 {
     return(global::Uno.Platform.EventSources.TextSource.OnTextInput(text, Bootstrapper.GetEventModifiers(handle)));
 }
Exemplo n.º 9
0
 public static bool OnKeyUp(global::Uno.Runtime.Implementation.PlatformWindowHandle handle, global::Uno.Platform.Key key)
 {
     return(global::Uno.Platform.EventSources.HardwareKeys.OnKeyUp(key, Bootstrapper.GetEventModifiers(handle)));
 }
Exemplo n.º 10
0
 public static global::Uno.Platform.EventModifiers GetEventModifiers(global::Uno.Runtime.Implementation.PlatformWindowHandle handle)
 {
     return(((((((global::Uno.Runtime.Implementation.PlatformWindowImpl.GetKeyState(handle, global::Uno.Platform.Key.ControlKey) ? global::Uno.Platform.EventModifiers.ControlKey : 0) | (global::Uno.Runtime.Implementation.PlatformWindowImpl.GetKeyState(handle, global::Uno.Platform.Key.ShiftKey) ? global::Uno.Platform.EventModifiers.ShiftKey : 0)) | (global::Uno.Runtime.Implementation.PlatformWindowImpl.GetKeyState(handle, global::Uno.Platform.Key.AltKey) ? global::Uno.Platform.EventModifiers.AltKey : 0)) | (global::Uno.Runtime.Implementation.PlatformWindowImpl.GetKeyState(handle, global::Uno.Platform.Key.MetaKey) ? global::Uno.Platform.EventModifiers.MetaKey : 0)) | (global::Uno.Runtime.Implementation.PlatformWindowImpl.GetMouseButtonState(handle, global::Uno.Platform.MouseButton.Left) ? global::Uno.Platform.EventModifiers.LeftButton : 0)) | (global::Uno.Runtime.Implementation.PlatformWindowImpl.GetMouseButtonState(handle, global::Uno.Platform.MouseButton.Middle) ? global::Uno.Platform.EventModifiers.MiddleButton : 0)) | (global::Uno.Runtime.Implementation.PlatformWindowImpl.GetMouseButtonState(handle, global::Uno.Platform.MouseButton.Right) ? global::Uno.Platform.EventModifiers.RightButton : 0));
 }
Exemplo n.º 11
0
 public static bool OnAppTerminating(global::Uno.Runtime.Implementation.PlatformWindowHandle handle)
 {
     global::Uno.Platform.CoreApp.EnterBackground();
     global::Uno.Platform.CoreApp.Terminate();
     return(false);
 }
Exemplo n.º 12
0
 public static bool IsPrimaryFinger(global::Uno.Runtime.Implementation.PlatformWindowHandle handle, int fingerId)
 {
     return((Bootstrapper._lastPrimaryFingerId == fingerId) && false);
 }
Exemplo n.º 13
0
 protected override float GetDensity()
 {
     global::Uno.Runtime.Implementation.PlatformWindowHandle wnd = global::Uno.Runtime.Implementation.PlatformWindowImpl.GetInstance();
     return(global::Uno.Runtime.Implementation.PlatformWindowImpl.GetDensity(wnd));
 }