DevicePadProtocol
public protocol DevicePadProtocol : DeviceProtocol
The DevicePadProtocol
protocol exposes the methods and properties of an underlying GdkDevicePad
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 DevicePad
.
Alternatively, use DevicePadRef
as a lighweight, unowned
reference if you already have an instance you just want to use.
GdkDevicePad
is an interface implemented by devices of type
GDK_SOURCE_TABLET_PAD
, it allows querying the features provided
by the pad device.
Tablet pads may contain one or more groups, each containing a subset
of the buttons/rings/strips available. gdk_device_pad_get_n_groups()
can be used to obtain the number of groups, gdk_device_pad_get_n_features()
and gdk_device_pad_get_feature_group()
can be combined to find out the
number of buttons/rings/strips the device has, and how are they grouped.
Each of those groups have different modes, which may be used to map
each individual pad feature to multiple actions. Only one mode is
effective (current) for each given group, different groups may have
different current modes. The number of available modes in a group can
be found out through gdk_device_pad_get_group_n_modes()
, and the current
mode for a given group will be notified through the GdkEventPadGroupMode
event.
-
Untyped pointer to the underlying
GdkDevicePad
instance.Declaration
Swift
var ptr: UnsafeMutableRawPointer! { get }
-
device_pad_ptr
Default implementationTyped pointer to the underlying
GdkDevicePad
instance.Default Implementation
Return the stored, untyped pointer as a typed pointer to the
GdkDevicePad
instance.Declaration
Swift
var device_pad_ptr: UnsafeMutablePointer<GdkDevicePad>! { get }
-
Required Initialiser for types conforming to
DevicePadProtocol
Declaration
Swift
init(raw: UnsafeMutableRawPointer)
-
bind(property:
Extension methodto: _: flags: transformFrom: transformTo: ) Bind a
DevicePadPropertyName
source property to a given target object.Declaration
Swift
@discardableResult @inlinable func bind<Q, T>(property source_property: DevicePadPropertyName, 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 DevicePad property
Declaration
Swift
@inlinable func get(property: DevicePadPropertyName) -> 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 DevicePad property. Note that this will only have an effect on properties that are writable and not construct-only!
Declaration
Swift
@inlinable func set(property: DevicePadPropertyName, value v: GLibObject.Value)
Parameters
property
the property to get the value for
Return Value
the value of the named property
-
getFeatureGroup(feature:
Extension methodfeatureIdx: ) Returns the group the given
feature
andidx
belong to, or -1 if feature/index do not exist inpad
.Declaration
Swift
@inlinable func getFeatureGroup(feature: GdkDevicePadFeature, featureIdx: Int) -> Int
-
getGroupNModes(groupIdx:
Extension method) Returns the number of modes that
group
may have.Declaration
Swift
@inlinable func getGroupNModes(groupIdx: Int) -> Int
-
getNFeatures(feature:
Extension method) Returns the number of features a tablet pad has.
Declaration
Swift
@inlinable func getNFeatures(feature: GdkDevicePadFeature) -> Int
-
getNGroups()
Extension methodReturns the number of groups this pad device has. Pads have at least one group. A pad group is a subcollection of buttons/strip/rings that is affected collectively by a same current mode.
Declaration
Swift
@inlinable func getNGroups() -> Int
-
nGroups
Extension methodReturns the number of groups this pad device has. Pads have at least one group. A pad group is a subcollection of buttons/strip/rings that is affected collectively by a same current mode.
Declaration
Swift
@inlinable var nGroups: Int { get }