EventMotionProtocol

public protocol EventMotionProtocol

The EventMotionProtocol protocol exposes the methods and properties of an underlying GdkEventMotion instance. The default implementation of these can be found in the protocol extension below. For a concrete class that implements these methods and properties, see EventMotion. Alternatively, use EventMotionRef as a lighweight, unowned reference if you already have an instance you just want to use.

Generated when the pointer moves.

  • ptr

    Untyped pointer to the underlying GdkEventMotion instance.

    Declaration

    Swift

    var ptr: UnsafeMutableRawPointer! { get }
  • _ptr Default implementation

    Typed pointer to the underlying GdkEventMotion instance.

    Default Implementation

    Return the stored, untyped pointer as a typed pointer to the GdkEventMotion instance.

    Declaration

    Swift

    var _ptr: UnsafeMutablePointer<GdkEventMotion>! { get }
  • Required Initialiser for types conforming to EventMotionProtocol

    Declaration

    Swift

    init(raw: UnsafeMutableRawPointer)

EventMotion Record: EventMotionProtocol extension (methods and fields)

  • requestMotions() Extension method

    Request more motion notifies if event is a motion notify hint event.

    This function should be used instead of gdk_window_get_pointer() to request further motion notifies, because it also works for extension events where motion notifies are provided for devices other than the core pointer. Coordinate extraction, processing and requesting more motion events from a GDK_MOTION_NOTIFY event usually works like this:

    (C Language Example):

    {
      // motion_event handler
      x = motion_event->x;
      y = motion_event->y;
      // handle (x,y) motion
      gdk_event_request_motions (motion_event); // handles is_hint events
    }
    

    Declaration

    Swift

    @inlinable
    func requestMotions()
  • eventRequestMotions() Extension method

    Request more motion notifies if event is a motion notify hint event.

    This function should be used instead of gdk_window_get_pointer() to request further motion notifies, because it also works for extension events where motion notifies are provided for devices other than the core pointer. Coordinate extraction, processing and requesting more motion events from a GDK_MOTION_NOTIFY event usually works like this:

    (C Language Example):

    {
      // motion_event handler
      x = motion_event->x;
      y = motion_event->y;
      // handle (x,y) motion
      gdk_event_request_motions (motion_event); // handles is_hint events
    }
    

    Declaration

    Swift

    @inlinable
    func eventRequestMotions()
  • type Extension method

    the type of the event.

    Declaration

    Swift

    @inlinable
    var type: GdkEventType { get set }
  • window Extension method

    the window which received the event.

    Declaration

    Swift

    @inlinable
    var window: WindowRef! { get set }
  • sendEvent Extension method

    true if the event was sent explicitly.

    Declaration

    Swift

    @inlinable
    var sendEvent: gint8 { get set }
  • time Extension method

    the time of the event in milliseconds.

    Declaration

    Swift

    @inlinable
    var time: guint32 { get set }
  • x Extension method

    the x coordinate of the pointer relative to the window.

    Declaration

    Swift

    @inlinable
    var x: gdouble { get set }
  • y Extension method

    the y coordinate of the pointer relative to the window.

    Declaration

    Swift

    @inlinable
    var y: gdouble { get set }
  • axes Extension method

    x, y translated to the axes of device, or nil if device is the mouse.

    Declaration

    Swift

    @inlinable
    var axes: UnsafeMutablePointer<gdouble>! { get set }
  • state Extension method

    a bit-mask representing the state of the modifier keys (e.g. Control, Shift and Alt) and the pointer buttons. See GdkModifierType.

    Declaration

    Swift

    @inlinable
    var state: ModifierType { get set }
  • isHint Extension method

    set to 1 if this event is just a hint, see the GDK_POINTER_MOTION_HINT_MASK value of GdkEventMask.

    Declaration

    Swift

    @inlinable
    var isHint: gint16 { get set }
  • device Extension method

    the master device that the event originated from. Use gdk_event_get_source_device() to get the slave device.

    Declaration

    Swift

    @inlinable
    var device: DeviceRef! { get set }
  • xRoot Extension method

    the x coordinate of the pointer relative to the root of the screen.

    Declaration

    Swift

    @inlinable
    var xRoot: gdouble { get set }
  • yRoot Extension method

    the y coordinate of the pointer relative to the root of the screen.

    Declaration

    Swift

    @inlinable
    var yRoot: gdouble { get set }