gtkmm: Gdk::Device Class Reference
A Gdk::Device instance contains a detailed description of an extended input device. More...
#include <gdkmm/device.h>
Public Member Functions | |
Device (Device&& src) noexcept | |
Device& | operator= (Device&& src) noexcept |
~Device () noexcept override | |
GdkDevice* | gobj () |
Provides access to the underlying C GObject. More... | |
const GdkDevice* | gobj () const |
Provides access to the underlying C GObject. More... | |
GdkDevice* | gobj_copy () |
Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs. More... | |
Glib::ustring | get_name () const |
Determines the name of the device, suitable for showing in a user interface. More... | |
bool | get_has_cursor () const |
Determines whether the pointer follows device motion. More... | |
InputSource | get_source () const |
Determines the type of the device. More... | |
Glib::RefPtr< Display > | get_display () |
Returns the Gdk::Display to which device pertains. More... | |
Glib::RefPtr< const Display > | get_display () const |
Returns the Gdk::Display to which device pertains. More... | |
Glib::RefPtr< Surface > | get_surface_at_position (double& win_x, double& win_y) |
Obtains the surface underneath device, returning the location of the device in win_x and win_y in double precision. More... | |
Glib::RefPtr< const Surface > | get_surface_at_position (double& win_x, double& win_y) const |
Obtains the surface underneath device, returning the location of the device in win_x and win_y in double precision. More... | |
Glib::RefPtr< Surface > | get_surface_at_position () |
Obtains the surface underneath the device. More... | |
Glib::RefPtr< const Surface > | get_surface_at_position () const |
Obtains the surface underneath the device. More... | |
Glib::ustring | get_vendor_id () const |
Returns the vendor ID of this device, or nullptr if this information couldn't be obtained. More... | |
Glib::ustring | get_product_id () |
Returns the product ID of this device, or nullptr if this information couldn't be obtained. More... | |
Glib::RefPtr< Seat > | get_seat () |
Returns the Gdk::Seat the device belongs to. More... | |
Glib::RefPtr< const Seat > | get_seat () const |
Returns the Gdk::Seat the device belongs to. More... | |
guint | get_num_touches () const |
Retrieves the number of touch points associated to device. More... | |
Glib::RefPtr< DeviceTool > | get_device_tool () |
Retrieves the Gdk::DeviceTool associated to device. More... | |
Glib::RefPtr< const DeviceTool > | get_device_tool () const |
Retrieves the Gdk::DeviceTool associated to device. More... | |
bool | get_caps_lock_state () const |
Retrieves whether the Caps Lock modifier of the keyboard is locked, if device is a keyboard device. More... | |
bool | get_num_lock_state () const |
Retrieves whether the Num Lock modifier of the keyboard is locked, if device is a keyboard device. More... | |
bool | get_scroll_lock_state () const |
Retrieves whether the Scroll Lock modifier of the keyboard is locked, if device is a keyboard device. More... | |
ModifierType | get_modifier_state () const |
Retrieves the current modifier state of the keyboard, if device is a keyboard device. More... | |
Pango::Direction | get_direction () const |
Returns the direction of effective layout of the keyboard, if device is a keyboard device. More... | |
bool | has_bidi_layouts () const |
Determines if keyboard layouts for both right-to-left and left-to-right languages are in use on the keyboard, if device is a keyboard device. More... | |
bool | has_device_pad () const |
Checks if this Device instance is a DeviceWithPad. More... | |
Glib::RefPtr< DeviceWithPad > | device_with_pad_cast () |
Casts this Device instance to a DeviceWithPad, if possible. More... | |
Glib::RefPtr< const DeviceWithPad > | device_with_pad_cast () const |
Casts this Device instance to a DeviceWithPad, if possible. More... | |
Glib::SignalProxy< void()> | signal_changed () |
Glib::SignalProxy< void(const Glib::RefPtr< DeviceTool >&)> | signal_tool_changed () |
Glib::PropertyProxy_ReadOnly< Glib::RefPtr< Display > > | property_display () const |
The Gdk::Display the Gdk::Device pertains to. More... | |
Glib::PropertyProxy_ReadOnly< Glib::ustring > | property_name () const |
The device name. More... | |
Glib::PropertyProxy_ReadOnly< InputSource > | property_source () const |
Source type for the device. More... | |
Glib::PropertyProxy_ReadOnly< bool > | property_has_cursor () const |
Whether the device is represented by a cursor on the screen. More... | |
Glib::PropertyProxy_ReadOnly< guint > | property_n_axes () const |
Number of axes in the device. More... | |
Glib::PropertyProxy_ReadOnly< Glib::ustring > | property_vendor_id () const |
Vendor ID of this device, see Gdk::Device::get_vendor_id(). More... | |
Glib::PropertyProxy_ReadOnly< Glib::ustring > | property_product_id () const |
Product ID of this device, see Gdk::Device::get_product_id(). More... | |
Glib::PropertyProxy< Glib::RefPtr< Seat > > | property_seat () |
Gdk::Seat of this device. More... | |
Glib::PropertyProxy_ReadOnly< Glib::RefPtr< Seat > > | property_seat () const |
Gdk::Seat of this device. More... | |
Glib::PropertyProxy_ReadOnly< guint > | property_num_touches () const |
The maximal number of concurrent touches on a touch device. More... | |
Glib::PropertyProxy_ReadOnly< Glib::RefPtr< DeviceTool > > | property_tool () const |
The tool that is currently used with this device. More... | |
Glib::PropertyProxy_ReadOnly< Pango::Direction > | property_direction () const |
The direction of the current layout of the keyboard. More... | |
Glib::PropertyProxy_ReadOnly< bool > | property_has_bidi_layouts () const |
Whether the keyboard has bidi layouts. More... | |
Glib::PropertyProxy_ReadOnly< bool > | property_caps_lock_state () const |
Whether the keyboard caps lock is on. More... | |
Glib::PropertyProxy_ReadOnly< bool > | property_num_lock_state () const |
Whether the keyboard num lock is on. More... | |
Glib::PropertyProxy_ReadOnly< bool > | property_scroll_lock_state () const |
Whether the keyboard scroll lock is on. More... | |
Glib::PropertyProxy_ReadOnly< ModifierType > | property_modifier_state () const |
The modifier state of the keyboard. More... | |
Public Member Functions inherited from Glib::Object | |
Object (const Object &)=delete | |
Object & | operator= (const Object &)=delete |
Object (Object &&src) noexcept | |
Object & | operator= (Object &&src) noexcept |
void * | get_data (const QueryQuark &key) |
void | set_data (const Quark &key, void *data) |
void | set_data (const Quark &key, void *data, DestroyNotify notify) |
void | remove_data (const QueryQuark &quark) |
void * | steal_data (const QueryQuark &quark) |
Glib::RefPtr< Glib::Object > | wrap (GObject *object, bool take_copy=false) |
Public Member Functions inherited from Glib::ObjectBase | |
ObjectBase (const ObjectBase &)=delete | |
ObjectBase & | operator= (const ObjectBase &)=delete |
void | set_property_value (const Glib::ustring &property_name, const Glib::ValueBase &value) |
void | get_property_value (const Glib::ustring &property_name, Glib::ValueBase &value) const |
void | set_property (const Glib::ustring &property_name, const PropertyType &value) |
void | get_property (const Glib::ustring &property_name, PropertyType &value) const |
PropertyType | get_property (const Glib::ustring &property_name) const |
sigc::connection | connect_property_changed (const Glib::ustring &property_name, const sigc::slot< void()> &slot) |
sigc::connection | connect_property_changed (const Glib::ustring &property_name, sigc::slot< void()> &&slot) |
void | freeze_notify () |
void | thaw_notify () |
virtual void | reference () const |
virtual void | unreference () const |
GObject * | gobj () |
const GObject * | gobj () const |
GObject * | gobj_copy () const |
Public Member Functions inherited from sigc::trackable | |
trackable () noexcept | |
trackable (const trackable &src) noexcept | |
trackable (trackable &&src) noexcept | |
~trackable () | |
void | add_destroy_notify_callback (notifiable *data, func_destroy_notify func) const |
void | notify_callbacks () |
trackable & | operator= (const trackable &src) |
trackable & | operator= (trackable &&src) noexcept |
void | remove_destroy_notify_callback (notifiable *data) const |
Static Public Member Functions | |
static GType | get_type () |
Get the GType for this class, for use with the underlying GObject type system. More... | |
Protected Member Functions | |
Device () | |
Protected Member Functions inherited from Glib::Object | |
Object () | |
Object (const Glib::ConstructParams &construct_params) | |
Object (GObject *castitem) | |
~Object () noexcept override | |
Protected Member Functions inherited from Glib::ObjectBase | |
ObjectBase () | |
ObjectBase (const char *custom_type_name) | |
ObjectBase (const std::type_info &custom_type_info) | |
ObjectBase (ObjectBase &&src) noexcept | |
ObjectBase & | operator= (ObjectBase &&src) noexcept |
virtual | ~ObjectBase () noexcept=0 |
void | initialize (GObject *castitem) |
void | initialize_move (GObject *castitem, Glib::ObjectBase *previous_wrapper) |
Related Functions | |
(Note that these are not member functions.) | |
Glib::RefPtr< Gdk::Device > | wrap (GdkDevice* object, bool take_copy=false) |
A Glib::wrap() method for this object. More... | |
Additional Inherited Members | |
Public Types inherited from Glib::Object | |
typedef void(*)(gpointer data | DestroyNotify) |
Public Types inherited from sigc::trackable | |
typedef internal::func_destroy_notify | func_destroy_notify |
Public Types inherited from sigc::notifiable | |
typedef internal::func_destroy_notify | func_destroy_notify |
Detailed Description
A Gdk::Device instance contains a detailed description of an extended input device.
Constructor & Destructor Documentation
|
noexcept |
|
overridenoexcept |
|
protected |
Member Function Documentation
Glib::RefPtr<DeviceWithPad> Gdk::Device::device_with_pad_cast | ( | ) |
Casts this Device instance to a DeviceWithPad, if possible.
- Returns
- A DeviceWithPad pointer, or an empty Glib::RefPtr if this Device can't be dynamic_cast to a DeviceWithPad.
Glib::RefPtr<const DeviceWithPad> Gdk::Device::device_with_pad_cast | ( | ) | const |
Casts this Device instance to a DeviceWithPad, if possible.
- Returns
- A DeviceWithPad pointer, or an empty Glib::RefPtr if this Device can't be dynamic_cast to a DeviceWithPad.
bool Gdk::Device::get_caps_lock_state | ( | ) | const |
Retrieves whether the Caps Lock modifier of the keyboard is locked, if device is a keyboard device.
- Returns
true
if Caps Lock is on for device.
Glib::RefPtr<DeviceTool> Gdk::Device::get_device_tool | ( | ) |
Retrieves the Gdk::DeviceTool associated to device.
- Returns
- The Gdk::DeviceTool.
Glib::RefPtr<const DeviceTool> Gdk::Device::get_device_tool | ( | ) | const |
Retrieves the Gdk::DeviceTool associated to device.
- Returns
- The Gdk::DeviceTool.
Pango::Direction Gdk::Device::get_direction | ( | ) | const |
Returns the direction of effective layout of the keyboard, if device is a keyboard device.
The direction of a layout is the direction of the majority of its symbols. See pango_unichar_direction().
- Returns
- Pango::Direction::LTR or Pango::Direction::RTL if it can determine the direction. Pango::Direction::NEUTRAL otherwise.
Glib::RefPtr<Display> Gdk::Device::get_display | ( | ) |
Returns the Gdk::Display to which device pertains.
- Returns
- A Gdk::Display. This memory is owned by GTK, and must not be freed or unreffed.
Glib::RefPtr<const Display> Gdk::Device::get_display | ( | ) | const |
Returns the Gdk::Display to which device pertains.
- Returns
- A Gdk::Display. This memory is owned by GTK, and must not be freed or unreffed.
bool Gdk::Device::get_has_cursor | ( | ) | const |
Determines whether the pointer follows device motion.
This is not meaningful for keyboard devices, which don't have a pointer.
- Returns
true
if the pointer follows device motion.
ModifierType Gdk::Device::get_modifier_state | ( | ) | const |
Retrieves the current modifier state of the keyboard, if device is a keyboard device.
- Returns
- The current modifier state.
Glib::ustring Gdk::Device::get_name | ( | ) | const |
Determines the name of the device, suitable for showing in a user interface.
- Returns
- A name.
bool Gdk::Device::get_num_lock_state | ( | ) | const |
Retrieves whether the Num Lock modifier of the keyboard is locked, if device is a keyboard device.
- Returns
true
if Num Lock is on for device.
guint Gdk::Device::get_num_touches | ( | ) | const |
Retrieves the number of touch points associated to device.
- Returns
- The number of touch points.
Glib::ustring Gdk::Device::get_product_id | ( | ) |
Returns the product ID of this device, or nullptr
if this information couldn't be obtained.
This ID is retrieved from the device, and is thus constant for it. See get_vendor_id() for more information.
- Returns
- The product ID, or
nullptr
.
bool Gdk::Device::get_scroll_lock_state | ( | ) | const |
Retrieves whether the Scroll Lock modifier of the keyboard is locked, if device is a keyboard device.
- Returns
true
if Scroll Lock is on for device.
Glib::RefPtr<Seat> Gdk::Device::get_seat | ( | ) |
Glib::RefPtr<const Seat> Gdk::Device::get_seat | ( | ) | const |
InputSource Gdk::Device::get_source | ( | ) | const |
Determines the type of the device.
- Returns
- A Gdk::InputSource.
Glib::RefPtr<Surface> Gdk::Device::get_surface_at_position | ( | double & | win_x, |
double & | win_y | ||
) |
Obtains the surface underneath device, returning the location of the device in win_x and win_y in double precision.
Returns nullptr
if the surface tree under device is not known to GDK (for example, belongs to another application).
- Parameters
-
win_x Return location for the X coordinate of the device location, relative to the surface origin, or nullptr
.win_y Return location for the Y coordinate of the device location, relative to the surface origin, or nullptr
.
- Returns
- The Gdk::Surface under the device position, or
nullptr
.
Glib::RefPtr<const Surface> Gdk::Device::get_surface_at_position | ( | double & | win_x, |
double & | win_y | ||
) | const |
Obtains the surface underneath device, returning the location of the device in win_x and win_y in double precision.
Returns nullptr
if the surface tree under device is not known to GDK (for example, belongs to another application).
- Parameters
-
win_x Return location for the X coordinate of the device location, relative to the surface origin, or nullptr
.win_y Return location for the Y coordinate of the device location, relative to the surface origin, or nullptr
.
- Returns
- The Gdk::Surface under the device position, or
nullptr
.
Glib::RefPtr<Surface> Gdk::Device::get_surface_at_position | ( | ) |
Obtains the surface underneath the device.
Returns an empty RefPtr if the surface tree under the device is not known to GDK (for example, belongs to another application).
- Returns
- The Gdk::Surface under the device position.
Glib::RefPtr<const Surface> Gdk::Device::get_surface_at_position | ( | ) | const |
Obtains the surface underneath the device.
Returns an empty RefPtr if the surface tree under the device is not known to GDK (for example, belongs to another application).
- Returns
- The Gdk::Surface under the device position.
|
static |
Get the GType for this class, for use with the underlying GObject type system.
Glib::ustring Gdk::Device::get_vendor_id | ( | ) | const |
Returns the vendor ID of this device, or nullptr
if this information couldn't be obtained.
This ID is retrieved from the device, and is thus constant for it.
This function, together with get_product_id(), can be used to eg. compose Gio::Settings paths to store settings for this device.
[C example ellipted]
- Returns
- The vendor ID, or
nullptr
.
|
inline |
Provides access to the underlying C GObject.
|
inline |
Provides access to the underlying C GObject.
GdkDevice* Gdk::Device::gobj_copy | ( | ) |
Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs.
bool Gdk::Device::has_bidi_layouts | ( | ) | const |
Determines if keyboard layouts for both right-to-left and left-to-right languages are in use on the keyboard, if device is a keyboard device.
- Returns
true
if there are layouts with both directions,false
otherwise.
bool Gdk::Device::has_device_pad | ( | ) | const |
Checks if this Device instance is a DeviceWithPad.
The underlying C object is usually a subclass of GdkDevice. If that subclass implements the GdkDevicePad interface, this C++ Gdk::Device instance is a Gdk::DeviceWithPad instance, and can be cast to a Gdk::DeviceWithPad by device_with_pad_cast().
- Returns
true
if this instance is a DeviceWithPad.
Glib::PropertyProxy_ReadOnly< bool > Gdk::Device::property_caps_lock_state | ( | ) | const |
Whether the keyboard caps lock is on.
Default value: false
- Returns
- A PropertyProxy_ReadOnly that allows you to get the value of the property, or receive notification when the value of the property changes.
Glib::PropertyProxy_ReadOnly< Pango::Direction > Gdk::Device::property_direction | ( | ) | const |
The direction of the current layout of the keyboard.
Default value: Pango::Direction::NEUTRAL
- Returns
- A PropertyProxy_ReadOnly that allows you to get the value of the property, or receive notification when the value of the property changes.
Glib::PropertyProxy_ReadOnly< Glib::RefPtr<Display> > Gdk::Device::property_display | ( | ) | const |
The Gdk::Display the Gdk::Device pertains to.
- Returns
- A PropertyProxy_ReadOnly that allows you to get the value of the property, or receive notification when the value of the property changes.
Glib::PropertyProxy_ReadOnly< bool > Gdk::Device::property_has_bidi_layouts | ( | ) | const |
Whether the keyboard has bidi layouts.
Default value: false
- Returns
- A PropertyProxy_ReadOnly that allows you to get the value of the property, or receive notification when the value of the property changes.
Glib::PropertyProxy_ReadOnly< bool > Gdk::Device::property_has_cursor | ( | ) | const |
Whether the device is represented by a cursor on the screen.
Default value: false
- Returns
- A PropertyProxy_ReadOnly that allows you to get the value of the property, or receive notification when the value of the property changes.
Glib::PropertyProxy_ReadOnly< ModifierType > Gdk::Device::property_modifier_state | ( | ) | const |
The modifier state of the keyboard.
Default value: 0
- Returns
- A PropertyProxy_ReadOnly that allows you to get the value of the property, or receive notification when the value of the property changes.
Glib::PropertyProxy_ReadOnly< guint > Gdk::Device::property_n_axes | ( | ) | const |
Number of axes in the device.
Default value: 0
- Returns
- A PropertyProxy_ReadOnly that allows you to get the value of the property, or receive notification when the value of the property changes.
Glib::PropertyProxy_ReadOnly< Glib::ustring > Gdk::Device::property_name | ( | ) | const |
The device name.
Default value: ""
- Returns
- A PropertyProxy_ReadOnly that allows you to get the value of the property, or receive notification when the value of the property changes.
Glib::PropertyProxy_ReadOnly< bool > Gdk::Device::property_num_lock_state | ( | ) | const |
Whether the keyboard num lock is on.
Default value: false
- Returns
- A PropertyProxy_ReadOnly that allows you to get the value of the property, or receive notification when the value of the property changes.
Glib::PropertyProxy_ReadOnly< guint > Gdk::Device::property_num_touches | ( | ) | const |
The maximal number of concurrent touches on a touch device.
Will be 0 if the device is not a touch device or if the number of touches is unknown.
Default value: 0
- Returns
- A PropertyProxy_ReadOnly that allows you to get the value of the property, or receive notification when the value of the property changes.
Glib::PropertyProxy_ReadOnly< Glib::ustring > Gdk::Device::property_product_id | ( | ) | const |
Product ID of this device, see Gdk::Device::get_product_id().
Default value: ""
- Returns
- A PropertyProxy_ReadOnly that allows you to get the value of the property, or receive notification when the value of the property changes.
Glib::PropertyProxy_ReadOnly< bool > Gdk::Device::property_scroll_lock_state | ( | ) | const |
Whether the keyboard scroll lock is on.
Default value: false
- Returns
- A PropertyProxy_ReadOnly that allows you to get the value of the property, or receive notification when the value of the property changes.
Glib::PropertyProxy< Glib::RefPtr<Seat> > Gdk::Device::property_seat | ( | ) |
Gdk::Seat of this device.
- Returns
- A PropertyProxy that allows you to get or set the value of the property, or receive notification when the value of the property changes.
Glib::PropertyProxy_ReadOnly< Glib::RefPtr<Seat> > Gdk::Device::property_seat | ( | ) | const |
Gdk::Seat of this device.
- Returns
- A PropertyProxy_ReadOnly that allows you to get the value of the property, or receive notification when the value of the property changes.
Glib::PropertyProxy_ReadOnly< InputSource > Gdk::Device::property_source | ( | ) | const |
Source type for the device.
Default value: Gdk::InputSource::MOUSE
- Returns
- A PropertyProxy_ReadOnly that allows you to get the value of the property, or receive notification when the value of the property changes.
Glib::PropertyProxy_ReadOnly< Glib::RefPtr<DeviceTool> > Gdk::Device::property_tool | ( | ) | const |
The tool that is currently used with this device.
- Returns
- A PropertyProxy_ReadOnly that allows you to get the value of the property, or receive notification when the value of the property changes.
Glib::PropertyProxy_ReadOnly< Glib::ustring > Gdk::Device::property_vendor_id | ( | ) | const |
Vendor ID of this device, see Gdk::Device::get_vendor_id().
Default value: ""
- Returns
- A PropertyProxy_ReadOnly that allows you to get the value of the property, or receive notification when the value of the property changes.
Glib::SignalProxy<void()> Gdk::Device::signal_changed | ( | ) |
- Slot Prototype:
void on_my_changed()
Flags: Run Last
The signal_changed() signal is emitted either when the Gdk::Device has changed the number of either axes or keys. For example 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.
Glib::SignalProxy<void(const Glib::RefPtr<DeviceTool>&)> Gdk::Device::signal_tool_changed | ( | ) |
- Slot Prototype:
void on_my_tool_changed(const Glib::RefPtr<DeviceTool>& tool)
Flags: Run Last
The signal_tool_changed() signal is emitted on pen/eraser Gdk::Devices whenever tools enter or leave proximity.
- Parameters
-
tool The new current tool.
Friends And Related Function Documentation
|
related |
A Glib::wrap() method for this object.
- Parameters
-
object The C instance. take_copy False if the result should take ownership of the C instance. True if it should take a new copy or ref.
- Returns
- A C++ instance that wraps this C instance.