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 a single input device, such
as a keyboard, a mouse, a touchpad, etc.
See the GdkDeviceManager documentation for more information
about the various kinds of master and slave devices, and their
relationships.
-
Untyped pointer to the underlying
GdkDeviceinstance.Declaration
Swift
var ptr: UnsafeMutableRawPointer! { get } -
device_ptrDefault implementationTyped pointer to the underlying
GdkDeviceinstance.Default Implementation
Return the stored, untyped pointer as a typed pointer to the
GdkDeviceinstance.Declaration
Swift
var device_ptr: UnsafeMutablePointer<GdkDevice>! { get } -
Required Initialiser for types conforming to
DeviceProtocolDeclaration
Swift
init(raw: UnsafeMutableRawPointer)
-
bind(property:Extension methodto: _: flags: transformFrom: transformTo: ) Bind a
DevicePropertyNamesource 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 : ObjectProtocolParameters
source_propertythe source property to bind
targetthe target object to bind to
target_propertythe target property to bind to
flagsthe flags to pass to the
Bindingtransform_fromValueTransformerto use for forward transformationtransform_toValueTransformerto use for backwards transformationReturn Value
binding reference or
nilin case of an error -
get(property:Extension method) Get the value of a Device property
Declaration
Swift
@inlinable func get(property: DevicePropertyName) -> GLibObject.ValueParameters
propertythe 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
propertythe 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
DeviceSignalNamesignalDeclaration
Swift
@discardableResult @inlinable func connect(signal s: DeviceSignalName, flags f: ConnectFlags = ConnectFlags(0), handler h: @escaping SignalHandler) -> IntParameters
signalThe signal to connect
flagsThe connection flags to use
dataA pointer to user data to provide to the callback
destroyDataA
GClosureNotifyC function to destroy the data pointed to byuserDatahandlerThe 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
DeviceSignalNamesignalDeclaration
Swift
@discardableResult @inlinable func connect(signal s: DeviceSignalName, flags f: ConnectFlags = ConnectFlags(0), data userData: gpointer!, destroyData destructor: GClosureNotify? = nil, signalHandler h: @escaping GCallback) -> IntParameters
signalThe signal to connect
flagsThe connection flags to use
dataA pointer to user data to provide to the callback
destroyDataA
GClosureNotifyC function to destroy the data pointed to byuserDatasignalHandlerThe 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: ) The
changedsignal is emitted either when theGdkDevicehas changed the number of either axes or keys. For example In X this will normally happen when the slave device routing events through the master device changes (for example, user switches from the USB mouse to a tablet), in that case the master device will change to reflect the new slave device axes and keys.Note
This represents the underlyingchangedsignalDeclaration
Swift
@discardableResult @inlinable func onChanged(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: DeviceRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
handlerThe signal handler to call Run the given callback whenever the
changedsignal is emitted -
changedSignalExtension methodTyped
changedsignal for using theconnect(signal:)methodsDeclaration
Swift
static var changedSignal: DeviceSignalName { get } -
onToolChanged(flags:Extension methodhandler: ) The
tool-changedsignal is emitted on pen/eraserGdkDeviceswhenever tools enter or leave proximity.Note
This represents the underlyingtool-changedsignalDeclaration
Swift
@discardableResult @inlinable func onToolChanged(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: DeviceRef, _ tool: DeviceToolRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
toolThe new current tool
handlerThe signal handler to call Run the given callback whenever the
toolChangedsignal is emitted -
toolChangedSignalExtension methodTyped
tool-changedsignal for using theconnect(signal:)methodsDeclaration
Swift
static var toolChangedSignal: DeviceSignalName { get } -
onNotifyAssociatedDevice(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 innotifybeing 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::associated-devicesignalDeclaration
Swift
@discardableResult @inlinable func onNotifyAssociatedDevice(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: DeviceRef, _ pspec: ParamSpecRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
pspecthe
GParamSpecof the property which changed.handlerThe signal handler to call Run the given callback whenever the
notifyAssociatedDevicesignal is emitted -
notifyAssociatedDeviceSignalExtension methodTyped
notify::associated-devicesignal for using theconnect(signal:)methodsDeclaration
Swift
static var notifyAssociatedDeviceSignal: DeviceSignalName { get } -
onNotifyAxes(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 innotifybeing 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::axessignalDeclaration
Swift
@discardableResult @inlinable func onNotifyAxes(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: DeviceRef, _ pspec: ParamSpecRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
pspecthe
GParamSpecof the property which changed.handlerThe signal handler to call Run the given callback whenever the
notifyAxessignal is emitted -
notifyAxesSignalExtension methodTyped
notify::axessignal for using theconnect(signal:)methodsDeclaration
Swift
static var notifyAxesSignal: DeviceSignalName { get } -
onNotifyDeviceManager(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 innotifybeing 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::device-managersignalDeclaration
Swift
@discardableResult @inlinable func onNotifyDeviceManager(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: DeviceRef, _ pspec: ParamSpecRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
pspecthe
GParamSpecof the property which changed.handlerThe signal handler to call Run the given callback whenever the
notifyDeviceManagersignal is emitted -
notifyDeviceManagerSignalExtension methodTyped
notify::device-managersignal for using theconnect(signal:)methodsDeclaration
Swift
static var notifyDeviceManagerSignal: 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 innotifybeing 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::displaysignalDeclaration
Swift
@discardableResult @inlinable func onNotifyDisplay(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: DeviceRef, _ pspec: ParamSpecRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
pspecthe
GParamSpecof the property which changed.handlerThe signal handler to call Run the given callback whenever the
notifyDisplaysignal is emitted -
notifyDisplaySignalExtension methodTyped
notify::displaysignal for using theconnect(signal:)methodsDeclaration
Swift
static var notifyDisplaySignal: 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 innotifybeing 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-cursorsignalDeclaration
Swift
@discardableResult @inlinable func onNotifyHasCursor(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: DeviceRef, _ pspec: ParamSpecRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
pspecthe
GParamSpecof the property which changed.handlerThe signal handler to call Run the given callback whenever the
notifyHasCursorsignal is emitted -
notifyHasCursorSignalExtension methodTyped
notify::has-cursorsignal for using theconnect(signal:)methodsDeclaration
Swift
static var notifyHasCursorSignal: DeviceSignalName { get } -
onNotifyInputMode(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 innotifybeing 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::input-modesignalDeclaration
Swift
@discardableResult @inlinable func onNotifyInputMode(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: DeviceRef, _ pspec: ParamSpecRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
pspecthe
GParamSpecof the property which changed.handlerThe signal handler to call Run the given callback whenever the
notifyInputModesignal is emitted -
notifyInputModeSignalExtension methodTyped
notify::input-modesignal for using theconnect(signal:)methodsDeclaration
Swift
static var notifyInputModeSignal: DeviceSignalName { get } -
onNotifyInputSource(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 innotifybeing 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::input-sourcesignalDeclaration
Swift
@discardableResult @inlinable func onNotifyInputSource(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: DeviceRef, _ pspec: ParamSpecRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
pspecthe
GParamSpecof the property which changed.handlerThe signal handler to call Run the given callback whenever the
notifyInputSourcesignal is emitted -
notifyInputSourceSignalExtension methodTyped
notify::input-sourcesignal for using theconnect(signal:)methodsDeclaration
Swift
static var notifyInputSourceSignal: 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 innotifybeing 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-axessignalDeclaration
Swift
@discardableResult @inlinable func onNotifyNAxes(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: DeviceRef, _ pspec: ParamSpecRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
pspecthe
GParamSpecof the property which changed.handlerThe signal handler to call Run the given callback whenever the
notifyNAxessignal is emitted -
notifyNAxesSignalExtension methodTyped
notify::n-axessignal 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 innotifybeing 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::namesignalDeclaration
Swift
@discardableResult @inlinable func onNotifyName(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: DeviceRef, _ pspec: ParamSpecRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
pspecthe
GParamSpecof the property which changed.handlerThe signal handler to call Run the given callback whenever the
notifyNamesignal is emitted -
notifyNameSignalExtension methodTyped
notify::namesignal for using theconnect(signal:)methodsDeclaration
Swift
static var notifyNameSignal: 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 innotifybeing 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-touchessignalDeclaration
Swift
@discardableResult @inlinable func onNotifyNumTouches(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: DeviceRef, _ pspec: ParamSpecRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
pspecthe
GParamSpecof the property which changed.handlerThe signal handler to call Run the given callback whenever the
notifyNumTouchessignal is emitted -
notifyNumTouchesSignalExtension methodTyped
notify::num-touchessignal 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 innotifybeing 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-idsignalDeclaration
Swift
@discardableResult @inlinable func onNotifyProductId(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: DeviceRef, _ pspec: ParamSpecRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
pspecthe
GParamSpecof the property which changed.handlerThe signal handler to call Run the given callback whenever the
notifyProductIdsignal is emitted -
notifyProductIdSignalExtension methodTyped
notify::product-idsignal for using theconnect(signal:)methodsDeclaration
Swift
static var notifyProductIdSignal: 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 innotifybeing 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::seatsignalDeclaration
Swift
@discardableResult @inlinable func onNotifySeat(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: DeviceRef, _ pspec: ParamSpecRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
pspecthe
GParamSpecof the property which changed.handlerThe signal handler to call Run the given callback whenever the
notifySeatsignal is emitted -
notifySeatSignalExtension methodTyped
notify::seatsignal for using theconnect(signal:)methodsDeclaration
Swift
static var notifySeatSignal: 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 innotifybeing 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::toolsignalDeclaration
Swift
@discardableResult @inlinable func onNotifyTool(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: DeviceRef, _ pspec: ParamSpecRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
pspecthe
GParamSpecof the property which changed.handlerThe signal handler to call Run the given callback whenever the
notifyToolsignal is emitted -
notifyToolSignalExtension methodTyped
notify::toolsignal for using theconnect(signal:)methodsDeclaration
Swift
static var notifyToolSignal: DeviceSignalName { get } -
onNotifyType(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 innotifybeing 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::typesignalDeclaration
Swift
@discardableResult @inlinable func onNotifyType(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: DeviceRef, _ pspec: ParamSpecRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
pspecthe
GParamSpecof the property which changed.handlerThe signal handler to call Run the given callback whenever the
notifyTypesignal is emitted -
notifyTypeSignalExtension methodTyped
notify::typesignal for using theconnect(signal:)methodsDeclaration
Swift
static var notifyTypeSignal: 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 innotifybeing 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-idsignalDeclaration
Swift
@discardableResult @inlinable func onNotifyVendorId(flags: ConnectFlags = ConnectFlags(0), handler: @escaping (_ unownedSelf: DeviceRef, _ pspec: ParamSpecRef) -> Void) -> IntParameters
flagsFlags
unownedSelfReference to instance of self
pspecthe
GParamSpecof the property which changed.handlerThe signal handler to call Run the given callback whenever the
notifyVendorIdsignal is emitted -
notifyVendorIdSignalExtension methodTyped
notify::vendor-idsignal for using theconnect(signal:)methodsDeclaration
Swift
static var notifyVendorIdSignal: DeviceSignalName { get }
-
getAssociatedDevice()Extension methodReturns the associated device to
device, ifdeviceis of typeGDK_DEVICE_TYPE_MASTER, it will return the paired pointer or keyboard.If
deviceis of typeGDK_DEVICE_TYPE_SLAVE, it will return the master device to whichdeviceis attached to.If
deviceis of typeGDK_DEVICE_TYPE_FLOATING,nilwill be returned, as there is no associated device.Declaration
Swift
@inlinable func getAssociatedDevice() -> DeviceRef! -
getAxes()Extension methodReturns the axes currently available on the device.
Declaration
Swift
@inlinable func getAxes() -> AxisFlags -
getAxis(axes:Extension methoduse: value: ) Interprets an array of double as axis values for a given device, and locates the value in the array for a given axis use.
Declaration
Swift
@inlinable func getAxis(axes: UnsafeMutablePointer<gdouble>!, use: GdkAxisUse, value: UnsafeMutablePointer<gdouble>!) -> Bool -
getAxisUse(index_:Extension method) Returns the axis use for
index_.Declaration
Swift
@inlinable func getAxisUse(index_: Int) -> GdkAxisUse -
getAxisValue(axes:Extension methodaxisLabel: value: ) Interprets an array of double as axis values for a given device, and locates the value in the array for a given axis label, as returned by
gdk_device_list_axes()Declaration
Swift
@inlinable func getAxisValue(axes: UnsafeMutablePointer<gdouble>!, axisLabel: GdkAtom!, value: UnsafeMutablePointer<gdouble>!) -> Bool -
getDeviceType()Extension methodReturns the device type for
device.Declaration
Swift
@inlinable func getDeviceType() -> GdkDeviceType -
getDisplay()Extension methodReturns the
GdkDisplayto whichdevicepertains.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 -
getHistory(window:Extension methodstart: stop: events: nEvents: ) Obtains the motion history for a pointer device; given a starting and ending timestamp, return all events in the motion history for the device in the given range of time. Some windowing systems do not support motion history, in which case,
falsewill be returned. (This is not distinguishable from the case where motion history is supported and no events were found.)Note that there is also
gdk_window_set_event_compression()to get more motion events delivered directly, independent of the windowing system.Declaration
Swift
@inlinable func getHistory<WindowT>(window: WindowT, start: guint32, stop: guint32, events: UnsafeMutablePointer<UnsafeMutablePointer<UnsafeMutablePointer<GdkTimeCoord>?>?>! = nil, nEvents: UnsafeMutablePointer<gint>! = nil) -> Bool where WindowT : WindowProtocol -
getKey(index_:Extension methodkeyval: modifiers: ) If
index_has a valid keyval, this function will returntrueand fill inkeyvalandmodifierswith the keyval settings.Declaration
Swift
@inlinable func getKey(index_: Int, keyval: UnsafeMutablePointer<guint>!, modifiers: UnsafeMutablePointer<GdkModifierType>!) -> Bool -
getLastEventWindow()Extension methodGets information about which window the given pointer device is in, based on events that have been received so far from the display server. If another application has a pointer grab, or this application has a grab with owner_events =
false,nilmay be returned even if the pointer is physically over one of this application’s windows.Declaration
Swift
@inlinable func getLastEventWindow() -> WindowRef! -
getMode()Extension methodDetermines the mode of the device.
Declaration
Swift
@inlinable func getMode() -> GdkInputMode -
getNAxes()Extension methodReturns the number of axes the device currently has.
Declaration
Swift
@inlinable func getNAxes() -> Int -
getNKeys()Extension methodReturns the number of keys the device currently has.
Declaration
Swift
@inlinable func getNKeys() -> Int -
getName()Extension methodDetermines the name of the device.
Declaration
Swift
@inlinable func getName() -> String! -
getPosition(screen:Extension methodx: y: ) Gets the current location of
device. As a slave device coordinates are those of its master pointer, This function may not be called on devices of typeGDK_DEVICE_TYPE_SLAVE, unless there is an ongoing grab on them, seegdk_device_grab().Declaration
Swift
@inlinable func getPosition(screen: UnsafeMutablePointer<UnsafeMutablePointer<GdkScreen>?>! = nil, x: UnsafeMutablePointer<gint>! = nil, y: UnsafeMutablePointer<gint>! = nil) -
getPositionDouble(screen:Extension methodx: y: ) Gets the current location of
devicein double precision. As a slave device’s coordinates are those of its master pointer, this function may not be called on devices of typeGDK_DEVICE_TYPE_SLAVE, unless there is an ongoing grab on them. Seegdk_device_grab().Declaration
Swift
@inlinable func getPositionDouble(screen: UnsafeMutablePointer<UnsafeMutablePointer<GdkScreen>?>! = nil, x: UnsafeMutablePointer<gdouble>! = nil, y: UnsafeMutablePointer<gdouble>! = nil) -
getProductId()Extension methodReturns the product ID of this device, or
nilif this information couldn’t be obtained. This ID is retrieved from the device, and is thus constant for it. Seegdk_device_get_vendor_id()for more information.Declaration
Swift
@inlinable func getProductId() -> String! -
getSeat()Extension methodReturns the
GdkSeatthe device belongs to.Declaration
Swift
@inlinable func getSeat() -> SeatRef! -
getSource()Extension methodDetermines the type of the device.
Declaration
Swift
@inlinable func getSource() -> GdkInputSource -
getState(window:Extension methodaxes: mask: ) Gets the current state of a pointer device relative to
window. As a slave device’s coordinates are those of its master pointer, this function may not be called on devices of typeGDK_DEVICE_TYPE_SLAVE, unless there is an ongoing grab on them. Seegdk_device_grab().Declaration
Swift
@inlinable func getState<WindowT>(window: WindowT, axes: UnsafeMutablePointer<gdouble>! = nil, mask: UnsafeMutablePointer<GdkModifierType>! = nil) where WindowT : WindowProtocol -
getVendorId()Extension methodReturns the vendor ID of this device, or
nilif this information couldn’t be obtained. This ID is retrieved from the device, and is thus constant for it.This function, together with
gdk_device_get_product_id(), can be used to eg. composeGSettingspaths to store settings for this device.(C Language Example):
static GSettings * get_device_settings (GdkDevice *device) { const gchar *vendor, *product; GSettings *settings; GdkDevice *device; gchar *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! -
getWindowAtPosition(winX:Extension methodwinY: ) Obtains the window underneath
device, returning the location of the device inwin_xandwin_y. Returnsnilif the window tree underdeviceis not known to GDK (for example, belongs to another application).As a slave device coordinates are those of its master pointer, This function may not be called on devices of type
GDK_DEVICE_TYPE_SLAVE, unless there is an ongoing grab on them, seegdk_device_grab().Declaration
Swift
@inlinable func getWindowAtPosition(winX: UnsafeMutablePointer<gint>! = nil, winY: UnsafeMutablePointer<gint>! = nil) -> WindowRef! -
getWindowAtPositionDouble(winX:Extension methodwinY: ) Obtains the window underneath
device, returning the location of the device inwin_xandwin_yin double precision. Returnsnilif the window tree underdeviceis not known to GDK (for example, belongs to another application).As a slave device coordinates are those of its master pointer, This function may not be called on devices of type
GDK_DEVICE_TYPE_SLAVE, unless there is an ongoing grab on them, seegdk_device_grab().Declaration
Swift
@inlinable func getWindowAtPositionDouble(winX: UnsafeMutablePointer<gdouble>! = nil, winY: UnsafeMutablePointer<gdouble>! = nil) -> WindowRef! -
grab(window:Extension methodgrabOwnership: ownerEvents: eventMask: cursor: time_: ) Grabs the device so that all events coming from this device are passed to this application until the device is ungrabbed with
gdk_device_ungrab(), or the window becomes unviewable. This overrides any previous grab on the device by this client.Note that
deviceandwindowneed to be on the same display.Device grabs are used for operations which need complete control over the given device events (either pointer or keyboard). For example in GTK+ this is used for Drag and Drop operations, popup menus and such.
Note that if the event mask of an X window has selected both button press and button release events, then a button press event will cause an automatic pointer grab until the button is released. X does this automatically since most applications expect to receive button press and release events in pairs. It is equivalent to a pointer grab on the window with
owner_eventsset totrue.If you set up anything at the time you take the grab that needs to be cleaned up when the grab ends, you should handle the
GdkEventGrabBrokenevents that are emitted when the grab ends unvoluntarily.grab is deprecated: Use gdk_seat_grab() instead.
Declaration
Swift
@available(*, deprecated) @inlinable func grab<WindowT>(window: WindowT, grabOwnership: GdkGrabOwnership, ownerEvents: Bool, eventMask: EventMask, cursor: CursorRef? = nil, time_: guint32) -> GdkGrabStatus where WindowT : WindowProtocol -
grab(window:Extension methodgrabOwnership: ownerEvents: eventMask: cursor: time_: ) Grabs the device so that all events coming from this device are passed to this application until the device is ungrabbed with
gdk_device_ungrab(), or the window becomes unviewable. This overrides any previous grab on the device by this client.Note that
deviceandwindowneed to be on the same display.Device grabs are used for operations which need complete control over the given device events (either pointer or keyboard). For example in GTK+ this is used for Drag and Drop operations, popup menus and such.
Note that if the event mask of an X window has selected both button press and button release events, then a button press event will cause an automatic pointer grab until the button is released. X does this automatically since most applications expect to receive button press and release events in pairs. It is equivalent to a pointer grab on the window with
owner_eventsset totrue.If you set up anything at the time you take the grab that needs to be cleaned up when the grab ends, you should handle the
GdkEventGrabBrokenevents that are emitted when the grab ends unvoluntarily.grab is deprecated: Use gdk_seat_grab() instead.
Declaration
Swift
@available(*, deprecated) @inlinable func grab<CursorT, WindowT>(window: WindowT, grabOwnership: GdkGrabOwnership, ownerEvents: Bool, eventMask: EventMask, cursor: CursorT?, time_: guint32) -> GdkGrabStatus where CursorT : CursorProtocol, WindowT : WindowProtocol -
listAxes()Extension methodReturns a
GListofGdkAtoms, containing the labels for the axes thatdevicecurrently has.Declaration
Swift
@inlinable func listAxes() -> GLib.ListRef! -
listSlaveDevices()Extension methodIf the device if of type
GDK_DEVICE_TYPE_MASTER, it will return the list of slave devices attached to it, otherwise it will returnnilDeclaration
Swift
@inlinable func listSlaveDevices() -> GLib.ListRef! -
setAxisUse(index_:Extension methoduse: ) Specifies how an axis of a device is used.
Declaration
Swift
@inlinable func setAxisUse(index_: Int, use: GdkAxisUse) -
setKey(index_:Extension methodkeyval: modifiers: ) Specifies the X key event to generate when a macro button of a device is pressed.
Declaration
Swift
@inlinable func setKey(index_: Int, keyval: Int, modifiers: ModifierType) -
set(mode:Extension method) Sets a the mode of an input device. The mode controls if the device is active and whether the device’s range is mapped to the entire screen or to a single window.
Note: This is only meaningful for floating devices, master devices (and slaves connected to these) drive the pointer cursor, which is not limited by the input mode.
Declaration
Swift
@inlinable func set(mode: GdkInputMode) -> Bool -
ungrab(time_:Extension method) Release any grab on
device.ungrab is deprecated: Use gdk_seat_ungrab() instead.
Declaration
Swift
@available(*, deprecated) @inlinable func ungrab(time_: guint32) -
warp(screen:Extension methodx: y: ) Warps
deviceindisplayto the pointx,yon the screenscreen, unless the device is confined to a window by a grab, in which case it will be moved as far as allowed by the grab. Warping the pointer creates events as if the user had moved the mouse instantaneously to the destination.Note that the pointer should normally be under the control of the user. This function was added to cover some rare use cases like keyboard navigation support for the color picker in the
GtkColorSelectionDialog.Declaration
Swift
@inlinable func warp<ScreenT>(screen: ScreenT, x: Int, y: Int) where ScreenT : ScreenProtocol -
grabInfoLibgtkOnly(display:Extension methodgrabWindow: ownerEvents: ) Determines information about the current keyboard grab. This is not public API and must not be used by applications.
grab_info_libgtk_only is deprecated: The symbol was never meant to be used outside of GTK+
Declaration
Swift
@available(*, deprecated) @inlinable func grabInfoLibgtkOnly<DisplayT>(display: DisplayT, grabWindow: UnsafeMutablePointer<UnsafeMutablePointer<GdkWindow>?>!, ownerEvents: UnsafeMutablePointer<gboolean>!) -> Bool where DisplayT : DisplayProtocol -
dragBeginForDevice(window:Extension methodtargets: ) Starts a drag and creates a new drag context for it.
This function is called by the drag source.
Declaration
Swift
@inlinable func dragBeginForDevice<ListT, WindowT>(window: WindowT, targets: ListT) -> DragContextRef! where ListT : ListProtocol, WindowT : WindowProtocol -
dragBeginFromPoint(window:Extension methodtargets: xRoot: yRoot: ) Starts a drag and creates a new drag context for it.
This function is called by the drag source.
Declaration
Swift
@inlinable func dragBeginFromPoint<ListT, WindowT>(window: WindowT, targets: ListT, xRoot: Int, yRoot: Int) -> DragContextRef! where ListT : ListProtocol, WindowT : WindowProtocol -
associatedDeviceExtension methodReturns the associated device to
device, ifdeviceis of typeGDK_DEVICE_TYPE_MASTER, it will return the paired pointer or keyboard.If
deviceis of typeGDK_DEVICE_TYPE_SLAVE, it will return the master device to whichdeviceis attached to.If
deviceis of typeGDK_DEVICE_TYPE_FLOATING,nilwill be returned, as there is no associated device.Declaration
Swift
@inlinable var associatedDevice: DeviceRef! { get } -
axesExtension methodThe axes currently available for this device.
Declaration
Swift
@inlinable var axes: AxisFlags { get } -
deviceTypeExtension methodReturns the device type for
device.Declaration
Swift
@inlinable var deviceType: GdkDeviceType { get } -
displayExtension methodThe
GdkDisplaytheGdkDevicepertains to.Declaration
Swift
@inlinable var display: DisplayRef! { get } -
hasCursorExtension 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 } -
lastEventWindowExtension methodGets information about which window the given pointer device is in, based on events that have been received so far from the display server. If another application has a pointer grab, or this application has a grab with owner_events =
false,nilmay be returned even if the pointer is physically over one of this application’s windows.Declaration
Swift
@inlinable var lastEventWindow: WindowRef! { get } -
modeExtension methodDetermines the mode of the device.
Declaration
Swift
@inlinable var mode: GdkInputMode { get nonmutating set } -
nAxesExtension methodReturns the number of axes the device currently has.
Declaration
Swift
@inlinable var nAxes: Int { get } -
nKeysExtension methodReturns the number of keys the device currently has.
Declaration
Swift
@inlinable var nKeys: Int { get } -
nameExtension methodThe device name.
Declaration
Swift
@inlinable var name: String! { get } -
productIdExtension methodReturns the product ID of this device, or
nilif this information couldn’t be obtained. This ID is retrieved from the device, and is thus constant for it. Seegdk_device_get_vendor_id()for more information.Declaration
Swift
@inlinable var productId: String! { get } -
seatExtension methodGdkSeatof this device.Declaration
Swift
@inlinable var seat: SeatRef! { get } -
sourceExtension methodDetermines the type of the device.
Declaration
Swift
@inlinable var source: GdkInputSource { get } -
vendorIdExtension methodReturns the vendor ID of this device, or
nilif this information couldn’t be obtained. This ID is retrieved from the device, and is thus constant for it.This function, together with
gdk_device_get_product_id(), can be used to eg. composeGSettingspaths to store settings for this device.(C Language Example):
static GSettings * get_device_settings (GdkDevice *device) { const gchar *vendor, *product; GSettings *settings; GdkDevice *device; gchar *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 }
View on GitHub
Install in Dash
DeviceProtocol Protocol Reference