DeviceProtocol

public protocol DeviceProtocol : ObjectProtocol

The DeviceProtocol protocol exposes the methods and properties of an underlying GdkDevice 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 Device. Alternatively, use DeviceRef as a lighweight, unowned reference if you already have an instance you just want to use.

The GdkDevice object represents an input device, such as a keyboard, a mouse, or a touchpad.

See the [classGdk.Seat] documentation for more information about the various kinds of devices, and their relationships.

  • ptr

    Untyped pointer to the underlying GdkDevice instance.

    Declaration

    Swift

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

    Typed pointer to the underlying GdkDevice instance.

    Default Implementation

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

    Declaration

    Swift

    var device_ptr: UnsafeMutablePointer<GdkDevice>! { get }
  • Required Initialiser for types conforming to DeviceProtocol

    Declaration

    Swift

    init(raw: UnsafeMutableRawPointer)

Device Class

  • Bind a DevicePropertyName source property to a given target object.

    Declaration

    Swift

    @discardableResult
    @inlinable
    func bind<Q, T>(property source_property: DevicePropertyName, to target: T, _ target_property: Q, flags f: BindingFlags = .default, transformFrom transform_from: @escaping GLibObject.ValueTransformer = { $0.transform(destValue: $1) }, transformTo transform_to: @escaping GLibObject.ValueTransformer = { $0.transform(destValue: $1) }) -> BindingRef! where Q : PropertyNameProtocol, T : ObjectProtocol

    Parameters

    source_property

    the source property to bind

    target

    the target object to bind to

    target_property

    the target property to bind to

    flags

    the flags to pass to the Binding

    transform_from

    ValueTransformer to use for forward transformation

    transform_to

    ValueTransformer to use for backwards transformation

    Return Value

    binding reference or nil in case of an error

  • get(property:) Extension method

    Get the value of a Device property

    Declaration

    Swift

    @inlinable
    func get(property: DevicePropertyName) -> GLibObject.Value

    Parameters

    property

    the property to get the value for

    Return Value

    the value of the named property

  • set(property:value:) Extension method

    Set the value of a Device property. Note that this will only have an effect on properties that are writable and not construct-only!

    Declaration

    Swift

    @inlinable
    func set(property: DevicePropertyName, value v: GLibObject.Value)

    Parameters

    property

    the property to get the value for

    Return Value

    the value of the named property

Device signals

  • Connect a Swift signal handler to the given, typed DeviceSignalName signal

    Declaration

    Swift

    @discardableResult
    @inlinable
    func connect(signal s: DeviceSignalName, flags f: ConnectFlags = ConnectFlags(0), handler h: @escaping SignalHandler) -> Int

    Parameters

    signal

    The signal to connect

    flags

    The connection flags to use

    data

    A pointer to user data to provide to the callback

    destroyData

    A GClosureNotify C function to destroy the data pointed to by userData

    handler

    The Swift signal handler (function or callback) to invoke on the given signal

    Return Value

    The signal handler ID (always greater than 0 for successful connections)

  • Connect a C signal handler to the given, typed DeviceSignalName signal

    Declaration

    Swift

    @discardableResult
    @inlinable
    func connect(signal s: DeviceSignalName, flags f: ConnectFlags = ConnectFlags(0), data userData: gpointer!, destroyData destructor: GClosureNotify? = nil, signalHandler h: @escaping GCallback) -> Int

    Parameters

    signal

    The signal to connect

    flags

    The connection flags to use

    data

    A pointer to user data to provide to the callback

    destroyData

    A GClosureNotify C function to destroy the data pointed to by userData

    signalHandler

    The C function to be called on the given signal

    Return Value

    The signal handler ID (always greater than 0 for successful connections)

  • onChanged(flags:handler:) Extension method

    Emitted either when the the number of either axes or keys changes.

    On X11 this will normally happen when the physical device routing events through the logical device changes (for example, user switches from the USB mouse to a tablet); in that case the logical device will change to reflect the axes and keys on the new physical device.

    Note

    This represents the underlying changed signal

    Declaration

    Swift

    @discardableResult
    @inlinable
    func onChanged(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: DeviceRef) -> Void) -> Int

    Parameters

    flags

    Flags

    unownedSelf

    Reference to instance of self

    handler

    The signal handler to call Run the given callback whenever the changed signal is emitted

  • changedSignal Extension method

    Typed changed signal for using the connect(signal:) methods

    Declaration

    Swift

    static var changedSignal: DeviceSignalName { get }
  • Emitted on pen/eraser devices whenever tools enter or leave proximity.

    Note

    This represents the underlying tool-changed signal

    Declaration

    Swift

    @discardableResult
    @inlinable
    func onToolChanged(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: DeviceRef, _ tool: DeviceToolRef) -> Void) -> Int

    Parameters

    flags

    Flags

    unownedSelf

    Reference to instance of self

    tool

    The new current tool

    handler

    The signal handler to call Run the given callback whenever the toolChanged signal is emitted

  • toolChangedSignal Extension method

    Typed tool-changed signal for using the connect(signal:) methods

    Declaration

    Swift

    static var toolChangedSignal: DeviceSignalName { get }
  • The notify signal is emitted on an object when one of its properties has its value set through g_object_set_property(), g_object_set(), et al.

    Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with G_PARAM_EXPLICIT_NOTIFY, then any call to g_object_set_property() results in notify being emitted, even if the new value is the same as the old. If they did pass G_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly call g_object_notify() or g_object_notify_by_pspec(), and common practice is to do that only when the value has actually changed.

    This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the g_signal_connect() call, like this: (C Language Example):

    g_signal_connect (text_view->buffer, "notify::paste-target-list",
                      G_CALLBACK (gtk_text_view_target_list_notify),
                      text_view)
    

    It is important to note that you must use canonical parameter names as detail strings for the notify signal.

    Note

    This represents the underlying notify::caps-lock-state signal

    Declaration

    Swift

    @discardableResult
    @inlinable
    func onNotifyCapsLockState(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: DeviceRef, _ pspec: ParamSpecRef) -> Void) -> Int

    Parameters

    flags

    Flags

    unownedSelf

    Reference to instance of self

    pspec

    the GParamSpec of the property which changed.

    handler

    The signal handler to call Run the given callback whenever the notifyCapsLockState signal is emitted

  • notifyCapsLockStateSignal Extension method

    Typed notify::caps-lock-state signal for using the connect(signal:) methods

    Declaration

    Swift

    static var notifyCapsLockStateSignal: DeviceSignalName { get }
  • The notify signal is emitted on an object when one of its properties has its value set through g_object_set_property(), g_object_set(), et al.

    Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with G_PARAM_EXPLICIT_NOTIFY, then any call to g_object_set_property() results in notify being emitted, even if the new value is the same as the old. If they did pass G_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly call g_object_notify() or g_object_notify_by_pspec(), and common practice is to do that only when the value has actually changed.

    This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the g_signal_connect() call, like this: (C Language Example):

    g_signal_connect (text_view->buffer, "notify::paste-target-list",
                      G_CALLBACK (gtk_text_view_target_list_notify),
                      text_view)
    

    It is important to note that you must use canonical parameter names as detail strings for the notify signal.

    Note

    This represents the underlying notify::direction signal

    Declaration

    Swift

    @discardableResult
    @inlinable
    func onNotifyDirection(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: DeviceRef, _ pspec: ParamSpecRef) -> Void) -> Int

    Parameters

    flags

    Flags

    unownedSelf

    Reference to instance of self

    pspec

    the GParamSpec of the property which changed.

    handler

    The signal handler to call Run the given callback whenever the notifyDirection signal is emitted

  • notifyDirectionSignal Extension method

    Typed notify::direction signal for using the connect(signal:) methods

    Declaration

    Swift

    static var notifyDirectionSignal: DeviceSignalName { get }
  • The notify signal is emitted on an object when one of its properties has its value set through g_object_set_property(), g_object_set(), et al.

    Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with G_PARAM_EXPLICIT_NOTIFY, then any call to g_object_set_property() results in notify being emitted, even if the new value is the same as the old. If they did pass G_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly call g_object_notify() or g_object_notify_by_pspec(), and common practice is to do that only when the value has actually changed.

    This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the g_signal_connect() call, like this: (C Language Example):

    g_signal_connect (text_view->buffer, "notify::paste-target-list",
                      G_CALLBACK (gtk_text_view_target_list_notify),
                      text_view)
    

    It is important to note that you must use canonical parameter names as detail strings for the notify signal.

    Note

    This represents the underlying notify::display signal

    Declaration

    Swift

    @discardableResult
    @inlinable
    func onNotifyDisplay(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: DeviceRef, _ pspec: ParamSpecRef) -> Void) -> Int

    Parameters

    flags

    Flags

    unownedSelf

    Reference to instance of self

    pspec

    the GParamSpec of the property which changed.

    handler

    The signal handler to call Run the given callback whenever the notifyDisplay signal is emitted

  • notifyDisplaySignal Extension method

    Typed notify::display signal for using the connect(signal:) methods

    Declaration

    Swift

    static var notifyDisplaySignal: DeviceSignalName { get }
  • The notify signal is emitted on an object when one of its properties has its value set through g_object_set_property(), g_object_set(), et al.

    Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with G_PARAM_EXPLICIT_NOTIFY, then any call to g_object_set_property() results in notify being emitted, even if the new value is the same as the old. If they did pass G_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly call g_object_notify() or g_object_notify_by_pspec(), and common practice is to do that only when the value has actually changed.

    This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the g_signal_connect() call, like this: (C Language Example):

    g_signal_connect (text_view->buffer, "notify::paste-target-list",
                      G_CALLBACK (gtk_text_view_target_list_notify),
                      text_view)
    

    It is important to note that you must use canonical parameter names as detail strings for the notify signal.

    Note

    This represents the underlying notify::has-bidi-layouts signal

    Declaration

    Swift

    @discardableResult
    @inlinable
    func onNotifyHasBidiLayouts(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: DeviceRef, _ pspec: ParamSpecRef) -> Void) -> Int

    Parameters

    flags

    Flags

    unownedSelf

    Reference to instance of self

    pspec

    the GParamSpec of the property which changed.

    handler

    The signal handler to call Run the given callback whenever the notifyHasBidiLayouts signal is emitted

  • notifyHasBidiLayoutsSignal Extension method

    Typed notify::has-bidi-layouts signal for using the connect(signal:) methods

    Declaration

    Swift

    static var notifyHasBidiLayoutsSignal: DeviceSignalName { get }
  • The notify signal is emitted on an object when one of its properties has its value set through g_object_set_property(), g_object_set(), et al.

    Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with G_PARAM_EXPLICIT_NOTIFY, then any call to g_object_set_property() results in notify being emitted, even if the new value is the same as the old. If they did pass G_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly call g_object_notify() or g_object_notify_by_pspec(), and common practice is to do that only when the value has actually changed.

    This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the g_signal_connect() call, like this: (C Language Example):

    g_signal_connect (text_view->buffer, "notify::paste-target-list",
                      G_CALLBACK (gtk_text_view_target_list_notify),
                      text_view)
    

    It is important to note that you must use canonical parameter names as detail strings for the notify signal.

    Note

    This represents the underlying notify::has-cursor signal

    Declaration

    Swift

    @discardableResult
    @inlinable
    func onNotifyHasCursor(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: DeviceRef, _ pspec: ParamSpecRef) -> Void) -> Int

    Parameters

    flags

    Flags

    unownedSelf

    Reference to instance of self

    pspec

    the GParamSpec of the property which changed.

    handler

    The signal handler to call Run the given callback whenever the notifyHasCursor signal is emitted

  • notifyHasCursorSignal Extension method

    Typed notify::has-cursor signal for using the connect(signal:) methods

    Declaration

    Swift

    static var notifyHasCursorSignal: DeviceSignalName { get }
  • The notify signal is emitted on an object when one of its properties has its value set through g_object_set_property(), g_object_set(), et al.

    Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with G_PARAM_EXPLICIT_NOTIFY, then any call to g_object_set_property() results in notify being emitted, even if the new value is the same as the old. If they did pass G_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly call g_object_notify() or g_object_notify_by_pspec(), and common practice is to do that only when the value has actually changed.

    This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the g_signal_connect() call, like this: (C Language Example):

    g_signal_connect (text_view->buffer, "notify::paste-target-list",
                      G_CALLBACK (gtk_text_view_target_list_notify),
                      text_view)
    

    It is important to note that you must use canonical parameter names as detail strings for the notify signal.

    Note

    This represents the underlying notify::modifier-state signal

    Declaration

    Swift

    @discardableResult
    @inlinable
    func onNotifyModifierState(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: DeviceRef, _ pspec: ParamSpecRef) -> Void) -> Int

    Parameters

    flags

    Flags

    unownedSelf

    Reference to instance of self

    pspec

    the GParamSpec of the property which changed.

    handler

    The signal handler to call Run the given callback whenever the notifyModifierState signal is emitted

  • notifyModifierStateSignal Extension method

    Typed notify::modifier-state signal for using the connect(signal:) methods

    Declaration

    Swift

    static var notifyModifierStateSignal: DeviceSignalName { get }
  • The notify signal is emitted on an object when one of its properties has its value set through g_object_set_property(), g_object_set(), et al.

    Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with G_PARAM_EXPLICIT_NOTIFY, then any call to g_object_set_property() results in notify being emitted, even if the new value is the same as the old. If they did pass G_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly call g_object_notify() or g_object_notify_by_pspec(), and common practice is to do that only when the value has actually changed.

    This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the g_signal_connect() call, like this: (C Language Example):

    g_signal_connect (text_view->buffer, "notify::paste-target-list",
                      G_CALLBACK (gtk_text_view_target_list_notify),
                      text_view)
    

    It is important to note that you must use canonical parameter names as detail strings for the notify signal.

    Note

    This represents the underlying notify::n-axes signal

    Declaration

    Swift

    @discardableResult
    @inlinable
    func onNotifyNAxes(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: DeviceRef, _ pspec: ParamSpecRef) -> Void) -> Int

    Parameters

    flags

    Flags

    unownedSelf

    Reference to instance of self

    pspec

    the GParamSpec of the property which changed.

    handler

    The signal handler to call Run the given callback whenever the notifyNAxes signal is emitted

  • notifyNAxesSignal Extension method

    Typed notify::n-axes signal for using the connect(signal:) methods

    Declaration

    Swift

    static var notifyNAxesSignal: DeviceSignalName { get }
  • onNotifyName(flags:handler:) Extension method

    The notify signal is emitted on an object when one of its properties has its value set through g_object_set_property(), g_object_set(), et al.

    Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with G_PARAM_EXPLICIT_NOTIFY, then any call to g_object_set_property() results in notify being emitted, even if the new value is the same as the old. If they did pass G_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly call g_object_notify() or g_object_notify_by_pspec(), and common practice is to do that only when the value has actually changed.

    This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the g_signal_connect() call, like this: (C Language Example):

    g_signal_connect (text_view->buffer, "notify::paste-target-list",
                      G_CALLBACK (gtk_text_view_target_list_notify),
                      text_view)
    

    It is important to note that you must use canonical parameter names as detail strings for the notify signal.

    Note

    This represents the underlying notify::name signal

    Declaration

    Swift

    @discardableResult
    @inlinable
    func onNotifyName(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: DeviceRef, _ pspec: ParamSpecRef) -> Void) -> Int

    Parameters

    flags

    Flags

    unownedSelf

    Reference to instance of self

    pspec

    the GParamSpec of the property which changed.

    handler

    The signal handler to call Run the given callback whenever the notifyName signal is emitted

  • notifyNameSignal Extension method

    Typed notify::name signal for using the connect(signal:) methods

    Declaration

    Swift

    static var notifyNameSignal: DeviceSignalName { get }
  • The notify signal is emitted on an object when one of its properties has its value set through g_object_set_property(), g_object_set(), et al.

    Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with G_PARAM_EXPLICIT_NOTIFY, then any call to g_object_set_property() results in notify being emitted, even if the new value is the same as the old. If they did pass G_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly call g_object_notify() or g_object_notify_by_pspec(), and common practice is to do that only when the value has actually changed.

    This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the g_signal_connect() call, like this: (C Language Example):

    g_signal_connect (text_view->buffer, "notify::paste-target-list",
                      G_CALLBACK (gtk_text_view_target_list_notify),
                      text_view)
    

    It is important to note that you must use canonical parameter names as detail strings for the notify signal.

    Note

    This represents the underlying notify::num-lock-state signal

    Declaration

    Swift

    @discardableResult
    @inlinable
    func onNotifyNumLockState(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: DeviceRef, _ pspec: ParamSpecRef) -> Void) -> Int

    Parameters

    flags

    Flags

    unownedSelf

    Reference to instance of self

    pspec

    the GParamSpec of the property which changed.

    handler

    The signal handler to call Run the given callback whenever the notifyNumLockState signal is emitted

  • notifyNumLockStateSignal Extension method

    Typed notify::num-lock-state signal for using the connect(signal:) methods

    Declaration

    Swift

    static var notifyNumLockStateSignal: DeviceSignalName { get }
  • The notify signal is emitted on an object when one of its properties has its value set through g_object_set_property(), g_object_set(), et al.

    Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with G_PARAM_EXPLICIT_NOTIFY, then any call to g_object_set_property() results in notify being emitted, even if the new value is the same as the old. If they did pass G_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly call g_object_notify() or g_object_notify_by_pspec(), and common practice is to do that only when the value has actually changed.

    This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the g_signal_connect() call, like this: (C Language Example):

    g_signal_connect (text_view->buffer, "notify::paste-target-list",
                      G_CALLBACK (gtk_text_view_target_list_notify),
                      text_view)
    

    It is important to note that you must use canonical parameter names as detail strings for the notify signal.

    Note

    This represents the underlying notify::num-touches signal

    Declaration

    Swift

    @discardableResult
    @inlinable
    func onNotifyNumTouches(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: DeviceRef, _ pspec: ParamSpecRef) -> Void) -> Int

    Parameters

    flags

    Flags

    unownedSelf

    Reference to instance of self

    pspec

    the GParamSpec of the property which changed.

    handler

    The signal handler to call Run the given callback whenever the notifyNumTouches signal is emitted

  • notifyNumTouchesSignal Extension method

    Typed notify::num-touches signal for using the connect(signal:) methods

    Declaration

    Swift

    static var notifyNumTouchesSignal: DeviceSignalName { get }
  • The notify signal is emitted on an object when one of its properties has its value set through g_object_set_property(), g_object_set(), et al.

    Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with G_PARAM_EXPLICIT_NOTIFY, then any call to g_object_set_property() results in notify being emitted, even if the new value is the same as the old. If they did pass G_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly call g_object_notify() or g_object_notify_by_pspec(), and common practice is to do that only when the value has actually changed.

    This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the g_signal_connect() call, like this: (C Language Example):

    g_signal_connect (text_view->buffer, "notify::paste-target-list",
                      G_CALLBACK (gtk_text_view_target_list_notify),
                      text_view)
    

    It is important to note that you must use canonical parameter names as detail strings for the notify signal.

    Note

    This represents the underlying notify::product-id signal

    Declaration

    Swift

    @discardableResult
    @inlinable
    func onNotifyProductId(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: DeviceRef, _ pspec: ParamSpecRef) -> Void) -> Int

    Parameters

    flags

    Flags

    unownedSelf

    Reference to instance of self

    pspec

    the GParamSpec of the property which changed.

    handler

    The signal handler to call Run the given callback whenever the notifyProductId signal is emitted

  • notifyProductIdSignal Extension method

    Typed notify::product-id signal for using the connect(signal:) methods

    Declaration

    Swift

    static var notifyProductIdSignal: DeviceSignalName { get }
  • The notify signal is emitted on an object when one of its properties has its value set through g_object_set_property(), g_object_set(), et al.

    Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with G_PARAM_EXPLICIT_NOTIFY, then any call to g_object_set_property() results in notify being emitted, even if the new value is the same as the old. If they did pass G_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly call g_object_notify() or g_object_notify_by_pspec(), and common practice is to do that only when the value has actually changed.

    This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the g_signal_connect() call, like this: (C Language Example):

    g_signal_connect (text_view->buffer, "notify::paste-target-list",
                      G_CALLBACK (gtk_text_view_target_list_notify),
                      text_view)
    

    It is important to note that you must use canonical parameter names as detail strings for the notify signal.

    Note

    This represents the underlying notify::scroll-lock-state signal

    Declaration

    Swift

    @discardableResult
    @inlinable
    func onNotifyScrollLockState(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: DeviceRef, _ pspec: ParamSpecRef) -> Void) -> Int

    Parameters

    flags

    Flags

    unownedSelf

    Reference to instance of self

    pspec

    the GParamSpec of the property which changed.

    handler

    The signal handler to call Run the given callback whenever the notifyScrollLockState signal is emitted

  • notifyScrollLockStateSignal Extension method

    Typed notify::scroll-lock-state signal for using the connect(signal:) methods

    Declaration

    Swift

    static var notifyScrollLockStateSignal: DeviceSignalName { get }
  • onNotifySeat(flags:handler:) Extension method

    The notify signal is emitted on an object when one of its properties has its value set through g_object_set_property(), g_object_set(), et al.

    Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with G_PARAM_EXPLICIT_NOTIFY, then any call to g_object_set_property() results in notify being emitted, even if the new value is the same as the old. If they did pass G_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly call g_object_notify() or g_object_notify_by_pspec(), and common practice is to do that only when the value has actually changed.

    This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the g_signal_connect() call, like this: (C Language Example):

    g_signal_connect (text_view->buffer, "notify::paste-target-list",
                      G_CALLBACK (gtk_text_view_target_list_notify),
                      text_view)
    

    It is important to note that you must use canonical parameter names as detail strings for the notify signal.

    Note

    This represents the underlying notify::seat signal

    Declaration

    Swift

    @discardableResult
    @inlinable
    func onNotifySeat(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: DeviceRef, _ pspec: ParamSpecRef) -> Void) -> Int

    Parameters

    flags

    Flags

    unownedSelf

    Reference to instance of self

    pspec

    the GParamSpec of the property which changed.

    handler

    The signal handler to call Run the given callback whenever the notifySeat signal is emitted

  • notifySeatSignal Extension method

    Typed notify::seat signal for using the connect(signal:) methods

    Declaration

    Swift

    static var notifySeatSignal: DeviceSignalName { get }
  • The notify signal is emitted on an object when one of its properties has its value set through g_object_set_property(), g_object_set(), et al.

    Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with G_PARAM_EXPLICIT_NOTIFY, then any call to g_object_set_property() results in notify being emitted, even if the new value is the same as the old. If they did pass G_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly call g_object_notify() or g_object_notify_by_pspec(), and common practice is to do that only when the value has actually changed.

    This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the g_signal_connect() call, like this: (C Language Example):

    g_signal_connect (text_view->buffer, "notify::paste-target-list",
                      G_CALLBACK (gtk_text_view_target_list_notify),
                      text_view)
    

    It is important to note that you must use canonical parameter names as detail strings for the notify signal.

    Note

    This represents the underlying notify::source signal

    Declaration

    Swift

    @discardableResult
    @inlinable
    func onNotifySource(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: DeviceRef, _ pspec: ParamSpecRef) -> Void) -> Int

    Parameters

    flags

    Flags

    unownedSelf

    Reference to instance of self

    pspec

    the GParamSpec of the property which changed.

    handler

    The signal handler to call Run the given callback whenever the notifySource signal is emitted

  • notifySourceSignal Extension method

    Typed notify::source signal for using the connect(signal:) methods

    Declaration

    Swift

    static var notifySourceSignal: DeviceSignalName { get }
  • onNotifyTool(flags:handler:) Extension method

    The notify signal is emitted on an object when one of its properties has its value set through g_object_set_property(), g_object_set(), et al.

    Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with G_PARAM_EXPLICIT_NOTIFY, then any call to g_object_set_property() results in notify being emitted, even if the new value is the same as the old. If they did pass G_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly call g_object_notify() or g_object_notify_by_pspec(), and common practice is to do that only when the value has actually changed.

    This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the g_signal_connect() call, like this: (C Language Example):

    g_signal_connect (text_view->buffer, "notify::paste-target-list",
                      G_CALLBACK (gtk_text_view_target_list_notify),
                      text_view)
    

    It is important to note that you must use canonical parameter names as detail strings for the notify signal.

    Note

    This represents the underlying notify::tool signal

    Declaration

    Swift

    @discardableResult
    @inlinable
    func onNotifyTool(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: DeviceRef, _ pspec: ParamSpecRef) -> Void) -> Int

    Parameters

    flags

    Flags

    unownedSelf

    Reference to instance of self

    pspec

    the GParamSpec of the property which changed.

    handler

    The signal handler to call Run the given callback whenever the notifyTool signal is emitted

  • notifyToolSignal Extension method

    Typed notify::tool signal for using the connect(signal:) methods

    Declaration

    Swift

    static var notifyToolSignal: DeviceSignalName { get }
  • The notify signal is emitted on an object when one of its properties has its value set through g_object_set_property(), g_object_set(), et al.

    Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with G_PARAM_EXPLICIT_NOTIFY, then any call to g_object_set_property() results in notify being emitted, even if the new value is the same as the old. If they did pass G_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly call g_object_notify() or g_object_notify_by_pspec(), and common practice is to do that only when the value has actually changed.

    This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the g_signal_connect() call, like this: (C Language Example):

    g_signal_connect (text_view->buffer, "notify::paste-target-list",
                      G_CALLBACK (gtk_text_view_target_list_notify),
                      text_view)
    

    It is important to note that you must use canonical parameter names as detail strings for the notify signal.

    Note

    This represents the underlying notify::vendor-id signal

    Declaration

    Swift

    @discardableResult
    @inlinable
    func onNotifyVendorId(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: DeviceRef, _ pspec: ParamSpecRef) -> Void) -> Int

    Parameters

    flags

    Flags

    unownedSelf

    Reference to instance of self

    pspec

    the GParamSpec of the property which changed.

    handler

    The signal handler to call Run the given callback whenever the notifyVendorId signal is emitted

  • notifyVendorIdSignal Extension method

    Typed notify::vendor-id signal for using the connect(signal:) methods

    Declaration

    Swift

    static var notifyVendorIdSignal: DeviceSignalName { get }

Device Class: DeviceProtocol extension (methods and fields)

  • getCapsLockState() Extension method

    Retrieves whether the Caps Lock modifier of the keyboard is locked.

    This is only relevant for keyboard devices.

    Declaration

    Swift

    @inlinable
    func getCapsLockState() -> Bool
  • getDeviceTool() Extension method

    Retrieves the current tool for device.

    Declaration

    Swift

    @inlinable
    func getDeviceTool() -> DeviceToolRef!
  • getDirection() Extension method

    Returns the direction of effective layout of the keyboard.

    This is only relevant for keyboard devices.

    The direction of a layout is the direction of the majority of its symbols. See [funcPango.unichar_direction].

    Declaration

    Swift

    @inlinable
    func getDirection() -> PangoDirection
  • getDisplay() Extension method

    Returns the GdkDisplay to which device pertains.

    Declaration

    Swift

    @inlinable
    func getDisplay() -> DisplayRef!
  • getHasCursor() Extension method

    Determines whether the pointer follows device motion.

    This is not meaningful for keyboard devices, which don’t have a pointer.

    Declaration

    Swift

    @inlinable
    func getHasCursor() -> Bool
  • getModifierState() Extension method

    Retrieves the current modifier state of the keyboard.

    This is only relevant for keyboard devices.

    Declaration

    Swift

    @inlinable
    func getModifierState() -> ModifierType
  • getName() Extension method

    The name of the device, suitable for showing in a user interface.

    Declaration

    Swift

    @inlinable
    func getName() -> String!
  • getNumLockState() Extension method

    Retrieves whether the Num Lock modifier of the keyboard is locked.

    This is only relevant for keyboard devices.

    Declaration

    Swift

    @inlinable
    func getNumLockState() -> Bool
  • getNumTouches() Extension method

    Retrieves the number of touch points associated to device.

    Declaration

    Swift

    @inlinable
    func getNumTouches() -> Int
  • getProductId() Extension method

    Returns the product ID of this device.

    This ID is retrieved from the device, and does not change. See [methodGdk.Device.get_vendor_id] for more information.

    Declaration

    Swift

    @inlinable
    func getProductId() -> String!
  • getScrollLockState() Extension method

    Retrieves whether the Scroll Lock modifier of the keyboard is locked.

    This is only relevant for keyboard devices.

    Declaration

    Swift

    @inlinable
    func getScrollLockState() -> Bool
  • getSeat() Extension method

    Returns the GdkSeat the device belongs to.

    Declaration

    Swift

    @inlinable
    func getSeat() -> SeatRef!
  • getSource() Extension method

    Determines the type of the device.

    Declaration

    Swift

    @inlinable
    func getSource() -> GdkInputSource
  • Obtains the surface underneath device, returning the location of the device in win_x and win_y

    Returns nil if the surface tree under device is not known to GDK (for example, belongs to another application).

    Declaration

    Swift

    @inlinable
    func getSurfaceAtPosition(winX: UnsafeMutablePointer<CDouble>! = nil, winY: UnsafeMutablePointer<CDouble>! = nil) -> SurfaceRef!
  • getTimestamp() Extension method

    Returns the timestamp of the last activity for this device.

    In practice, this means the timestamp of the last event that was received from the OS for this device. (GTK may occasionally produce events for a device that are not received from the OS, and will not update the timestamp).

    Declaration

    Swift

    @inlinable
    func getTimestamp() -> guint32
  • getVendorId() Extension method

    Returns the vendor ID of this device.

    This ID is retrieved from the device, and does not change.

    This function, together with [methodGdk.Device.get_product_id], can be used to eg. compose GSettings paths to store settings for this device.

     static GSettings *
     get_device_settings (GdkDevice *device)
     {
       const char *vendor, *product;
       GSettings *settings;
       GdkDevice *device;
       char *path;
    
       vendor = gdk_device_get_vendor_id (device);
       product = gdk_device_get_product_id (device);
    
       path = g_strdup_printf ("/org/example/app/devices/`s:``s`/", vendor, product);
       settings = g_settings_new_with_path (DEVICE_SCHEMA, path);
       g_free (path);
    
       return settings;
     }
    

    Declaration

    Swift

    @inlinable
    func getVendorId() -> String!
  • hasBidiLayouts() Extension method

    Determines if layouts for both right-to-left and left-to-right languages are in use on the keyboard.

    This is only relevant for keyboard devices.

    Declaration

    Swift

    @inlinable
    func hasBidiLayouts() -> Bool
  • capsLockState Extension method

    Retrieves whether the Caps Lock modifier of the keyboard is locked.

    This is only relevant for keyboard devices.

    Declaration

    Swift

    @inlinable
    var capsLockState: Bool { get }
  • deviceTool Extension method

    Retrieves the current tool for device.

    Declaration

    Swift

    @inlinable
    var deviceTool: DeviceToolRef! { get }
  • direction Extension method

    The direction of the current layout.

    This is only relevant for keyboard devices.

    Declaration

    Swift

    @inlinable
    var direction: PangoDirection { get }
  • display Extension method

    The GdkDisplay the GdkDevice pertains to.

    Declaration

    Swift

    @inlinable
    var display: DisplayRef! { get }
  • hasCursor Extension method

    Determines whether the pointer follows device motion.

    This is not meaningful for keyboard devices, which don’t have a pointer.

    Declaration

    Swift

    @inlinable
    var hasCursor: Bool { get }
  • modifierState Extension method

    Retrieves the current modifier state of the keyboard.

    This is only relevant for keyboard devices.

    Declaration

    Swift

    @inlinable
    var modifierState: ModifierType { get }
  • name Extension method

    The device name.

    Declaration

    Swift

    @inlinable
    var name: String! { get }
  • numLockState Extension method

    Retrieves whether the Num Lock modifier of the keyboard is locked.

    This is only relevant for keyboard devices.

    Declaration

    Swift

    @inlinable
    var numLockState: Bool { get }
  • numTouches Extension method

    Retrieves the number of touch points associated to device.

    Declaration

    Swift

    @inlinable
    var numTouches: Int { get }
  • productId Extension method

    Returns the product ID of this device.

    This ID is retrieved from the device, and does not change. See [methodGdk.Device.get_vendor_id] for more information.

    Declaration

    Swift

    @inlinable
    var productId: String! { get }
  • scrollLockState Extension method

    Retrieves whether the Scroll Lock modifier of the keyboard is locked.

    This is only relevant for keyboard devices.

    Declaration

    Swift

    @inlinable
    var scrollLockState: Bool { get }
  • seat Extension method

    GdkSeat of this device.

    Declaration

    Swift

    @inlinable
    var seat: SeatRef! { get }
  • source Extension method

    Source type for the device.

    Declaration

    Swift

    @inlinable
    var source: GdkInputSource { get }
  • timestamp Extension method

    Returns the timestamp of the last activity for this device.

    In practice, this means the timestamp of the last event that was received from the OS for this device. (GTK may occasionally produce events for a device that are not received from the OS, and will not update the timestamp).

    Declaration

    Swift

    @inlinable
    var timestamp: guint32 { get }
  • vendorId Extension method

    Returns the vendor ID of this device.

    This ID is retrieved from the device, and does not change.

    This function, together with [methodGdk.Device.get_product_id], can be used to eg. compose GSettings paths to store settings for this device.

     static GSettings *
     get_device_settings (GdkDevice *device)
     {
       const char *vendor, *product;
       GSettings *settings;
       GdkDevice *device;
       char *path;
    
       vendor = gdk_device_get_vendor_id (device);
       product = gdk_device_get_product_id (device);
    
       path = g_strdup_printf ("/org/example/app/devices/`s:``s`/", vendor, product);
       settings = g_settings_new_with_path (DEVICE_SCHEMA, path);
       g_free (path);
    
       return settings;
     }
    

    Declaration

    Swift

    @inlinable
    var vendorId: String! { get }