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.
-
Untyped pointer to the underlying
GdkDevice
instance.Declaration
Swift
var ptr: UnsafeMutableRawPointer! { get }
-
device_ptr
Default implementationTyped 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)
-
bind(property:
Extension methodto: _: flags: transformFrom: transformTo: ) 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 transformationtransform_to
ValueTransformer
to use for backwards transformationReturn 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:
Extension methodvalue: ) 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
-
connect(signal:
Extension methodflags: handler: ) Connect a Swift signal handler to the given, typed
DeviceSignalName
signalDeclaration
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 byuserData
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(signal:
Extension methodflags: data: destroyData: signalHandler: ) Connect a C signal handler to the given, typed
DeviceSignalName
signalDeclaration
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 byuserData
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:
Extension methodhandler: ) 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 underlyingchanged
signalDeclaration
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 methodTyped
changed
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var changedSignal: DeviceSignalName { get }
-
onToolChanged(flags:
Extension methodhandler: ) Emitted on pen/eraser devices whenever tools enter or leave proximity.
Note
This represents the underlyingtool-changed
signalDeclaration
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 methodTyped
tool-changed
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var toolChangedSignal: DeviceSignalName { get }
-
onNotifyCapsLockState(flags:
Extension methodhandler: ) 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 tog_object_set_property()
results innotify
being emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY
, then this signal is emitted only when they explicitly callg_object_notify()
org_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 underlyingnotify::caps-lock-state
signalDeclaration
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 methodTyped
notify::caps-lock-state
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var notifyCapsLockStateSignal: DeviceSignalName { get }
-
onNotifyDirection(flags:
Extension methodhandler: ) 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 tog_object_set_property()
results innotify
being emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY
, then this signal is emitted only when they explicitly callg_object_notify()
org_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 underlyingnotify::direction
signalDeclaration
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 methodTyped
notify::direction
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var notifyDirectionSignal: DeviceSignalName { get }
-
onNotifyDisplay(flags:
Extension methodhandler: ) 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 tog_object_set_property()
results innotify
being emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY
, then this signal is emitted only when they explicitly callg_object_notify()
org_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 underlyingnotify::display
signalDeclaration
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 methodTyped
notify::display
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var notifyDisplaySignal: DeviceSignalName { get }
-
onNotifyHasBidiLayouts(flags:
Extension methodhandler: ) 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 tog_object_set_property()
results innotify
being emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY
, then this signal is emitted only when they explicitly callg_object_notify()
org_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 underlyingnotify::has-bidi-layouts
signalDeclaration
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 methodTyped
notify::has-bidi-layouts
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var notifyHasBidiLayoutsSignal: DeviceSignalName { get }
-
onNotifyHasCursor(flags:
Extension methodhandler: ) 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 tog_object_set_property()
results innotify
being emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY
, then this signal is emitted only when they explicitly callg_object_notify()
org_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 underlyingnotify::has-cursor
signalDeclaration
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 methodTyped
notify::has-cursor
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var notifyHasCursorSignal: DeviceSignalName { get }
-
onNotifyModifierState(flags:
Extension methodhandler: ) 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 tog_object_set_property()
results innotify
being emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY
, then this signal is emitted only when they explicitly callg_object_notify()
org_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 underlyingnotify::modifier-state
signalDeclaration
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 methodTyped
notify::modifier-state
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var notifyModifierStateSignal: DeviceSignalName { get }
-
onNotifyNAxes(flags:
Extension methodhandler: ) 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 tog_object_set_property()
results innotify
being emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY
, then this signal is emitted only when they explicitly callg_object_notify()
org_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 underlyingnotify::n-axes
signalDeclaration
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 methodTyped
notify::n-axes
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var notifyNAxesSignal: DeviceSignalName { get }
-
onNotifyName(flags:
Extension methodhandler: ) 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 tog_object_set_property()
results innotify
being emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY
, then this signal is emitted only when they explicitly callg_object_notify()
org_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 underlyingnotify::name
signalDeclaration
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 methodTyped
notify::name
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var notifyNameSignal: DeviceSignalName { get }
-
onNotifyNumLockState(flags:
Extension methodhandler: ) 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 tog_object_set_property()
results innotify
being emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY
, then this signal is emitted only when they explicitly callg_object_notify()
org_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 underlyingnotify::num-lock-state
signalDeclaration
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 methodTyped
notify::num-lock-state
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var notifyNumLockStateSignal: DeviceSignalName { get }
-
onNotifyNumTouches(flags:
Extension methodhandler: ) 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 tog_object_set_property()
results innotify
being emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY
, then this signal is emitted only when they explicitly callg_object_notify()
org_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 underlyingnotify::num-touches
signalDeclaration
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 methodTyped
notify::num-touches
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var notifyNumTouchesSignal: DeviceSignalName { get }
-
onNotifyProductId(flags:
Extension methodhandler: ) 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 tog_object_set_property()
results innotify
being emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY
, then this signal is emitted only when they explicitly callg_object_notify()
org_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 underlyingnotify::product-id
signalDeclaration
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 methodTyped
notify::product-id
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var notifyProductIdSignal: DeviceSignalName { get }
-
onNotifyScrollLockState(flags:
Extension methodhandler: ) 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 tog_object_set_property()
results innotify
being emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY
, then this signal is emitted only when they explicitly callg_object_notify()
org_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 underlyingnotify::scroll-lock-state
signalDeclaration
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 methodTyped
notify::scroll-lock-state
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var notifyScrollLockStateSignal: DeviceSignalName { get }
-
onNotifySeat(flags:
Extension methodhandler: ) 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 tog_object_set_property()
results innotify
being emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY
, then this signal is emitted only when they explicitly callg_object_notify()
org_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 underlyingnotify::seat
signalDeclaration
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 methodTyped
notify::seat
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var notifySeatSignal: DeviceSignalName { get }
-
onNotifySource(flags:
Extension methodhandler: ) 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 tog_object_set_property()
results innotify
being emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY
, then this signal is emitted only when they explicitly callg_object_notify()
org_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 underlyingnotify::source
signalDeclaration
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 methodTyped
notify::source
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var notifySourceSignal: DeviceSignalName { get }
-
onNotifyTool(flags:
Extension methodhandler: ) 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 tog_object_set_property()
results innotify
being emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY
, then this signal is emitted only when they explicitly callg_object_notify()
org_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 underlyingnotify::tool
signalDeclaration
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 methodTyped
notify::tool
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var notifyToolSignal: DeviceSignalName { get }
-
onNotifyVendorId(flags:
Extension methodhandler: ) 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 tog_object_set_property()
results innotify
being emitted, even if the new value is the same as the old. If they did passG_PARAM_EXPLICIT_NOTIFY
, then this signal is emitted only when they explicitly callg_object_notify()
org_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 underlyingnotify::vendor-id
signalDeclaration
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 methodTyped
notify::vendor-id
signal for using theconnect(signal:)
methodsDeclaration
Swift
static var notifyVendorIdSignal: DeviceSignalName { get }
-
getCapsLockState()
Extension methodRetrieves 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 methodRetrieves the current tool for
device
.Declaration
Swift
@inlinable func getDeviceTool() -> DeviceToolRef!
-
getDirection()
Extension methodReturns 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 [func
Pango.unichar_direction
].Declaration
Swift
@inlinable func getDirection() -> PangoDirection
-
getDisplay()
Extension methodReturns the
GdkDisplay
to whichdevice
pertains.Declaration
Swift
@inlinable func getDisplay() -> DisplayRef!
-
getHasCursor()
Extension methodDetermines 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 methodRetrieves the current modifier state of the keyboard.
This is only relevant for keyboard devices.
Declaration
Swift
@inlinable func getModifierState() -> ModifierType
-
getName()
Extension methodThe name of the device, suitable for showing in a user interface.
Declaration
Swift
@inlinable func getName() -> String!
-
getNumLockState()
Extension methodRetrieves 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 methodRetrieves the number of touch points associated to
device
.Declaration
Swift
@inlinable func getNumTouches() -> Int
-
getProductId()
Extension methodReturns the product ID of this device.
This ID is retrieved from the device, and does not change. See [method
Gdk.Device.get_vendor_id
] for more information.Declaration
Swift
@inlinable func getProductId() -> String!
-
getScrollLockState()
Extension methodRetrieves 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 methodReturns the
GdkSeat
the device belongs to.Declaration
Swift
@inlinable func getSeat() -> SeatRef!
-
getSource()
Extension methodDetermines the type of the device.
Declaration
Swift
@inlinable func getSource() -> GdkInputSource
-
getSurfaceAtPosition(winX:
Extension methodwinY: ) Obtains the surface underneath
device
, returning the location of the device inwin_x
andwin_y
Returns
nil
if the surface tree underdevice
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 methodReturns 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 methodReturns the vendor ID of this device.
This ID is retrieved from the device, and does not change.
This function, together with [method
Gdk.Device.get_product_id
], can be used to eg. composeGSettings
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 methodDetermines 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 methodRetrieves 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 methodRetrieves the current tool for
device
.Declaration
Swift
@inlinable var deviceTool: DeviceToolRef! { get }
-
direction
Extension methodThe direction of the current layout.
This is only relevant for keyboard devices.
Declaration
Swift
@inlinable var direction: PangoDirection { get }
-
display
Extension methodThe
GdkDisplay
theGdkDevice
pertains to.Declaration
Swift
@inlinable var display: DisplayRef! { get }
-
hasCursor
Extension methodDetermines 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 methodRetrieves the current modifier state of the keyboard.
This is only relevant for keyboard devices.
Declaration
Swift
@inlinable var modifierState: ModifierType { get }
-
name
Extension methodThe device name.
Declaration
Swift
@inlinable var name: String! { get }
-
numLockState
Extension methodRetrieves 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 methodRetrieves the number of touch points associated to
device
.Declaration
Swift
@inlinable var numTouches: Int { get }
-
productId
Extension methodReturns the product ID of this device.
This ID is retrieved from the device, and does not change. See [method
Gdk.Device.get_vendor_id
] for more information.Declaration
Swift
@inlinable var productId: String! { get }
-
scrollLockState
Extension methodRetrieves 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 methodGdkSeat
of this device.Declaration
Swift
@inlinable var seat: SeatRef! { get }
-
source
Extension methodSource type for the device.
Declaration
Swift
@inlinable var source: GdkInputSource { get }
-
timestamp
Extension methodReturns 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 methodReturns the vendor ID of this device.
This ID is retrieved from the device, and does not change.
This function, together with [method
Gdk.Device.get_product_id
], can be used to eg. composeGSettings
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 }