gtkmm: Gdk::Device Class Reference

gtkmm 2.24.5

Public Member Functions | Static Public Member Functions | Protected Member Functions | Related Functions | List of all members
Gdk::Device Class Reference

A Gdk::Device instance contains a detailed description of an extended input device. More...

Inheritance diagram for Gdk::Device:
[legend]
Collaboration diagram for Gdk::Device:
[legend]

## 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...
void | set_source (InputSource source)
bool | set_mode (InputMode mode)
void | get_key (guint index_, guint& keyval, ModifierType& modifiers) const
| If index_ has a valid keyval, this function will fill in keyval and modifiers with the keyval settings. More...
void | set_key (guint index_, guint keyval, ModifierType modifiers)
AxisUse | get_axis_use (guint index_) const
| Returns the axis use for index_. More...
void | set_axis_use (guint index_, AxisUse use)
void | get_state (const Glib::RefPtr< Window >& window, double& axes, ModifierType& mask)
| Gets the current state of a device. More...
bool | get_history (const Glib::RefPtr< Window >& window, guint32 start, guint32 stop, GdkTimeCoord**& events, int& n_events)
| Obtains the motion history for a device; given a starting and ending timestamp, return all events in the motion history for the device in the given range of time. More...
bool | get_axis (double& axes, AxisUse use, double& value) const
| Interprets an array of double as axis values for a given device, and locates the value in the array for a given axis use. More...
Glib::ustring | get_name () const
| Determines the name of the device. More...
InputSource | get_source () const
| Determines the type of the device. More...
InputMode | get_mode () const
| Determines the mode of the device. More...
bool | get_has_cursor () const
| Determines whether the pointer follows device motion. More...
gint | get_n_axes () const
| Gets the number of axes of a device. 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
void | connect_property_changed (const Glib::ustring &property_name, const sigc::slot< void > &slot)
void | connect_property_changed (const Glib::ustring &property_name, sigc::slot< void > &&slot)
sigc::connection | connect_property_changed_with_return (const Glib::ustring &property_name, const sigc::slot< void > &slot)
sigc::connection | connect_property_changed_with_return (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)
| ~trackable ()
void | add_destroy_notify_callback (void *data, func_destroy_notify func) const
void | notify_callbacks ()
trackable & | operator= (const trackable &src)
trackable & | operator= (trackable &&src)
void | remove_destroy_notify_callback (void *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

## Detailed Description

A Gdk::Device instance contains a detailed description of an extended input device.

## Constructor & Destructor Documentation

## ◆ Device() [1/2]

Gdk::Device::Device | ( | Device&& | src | ) |
| noexcept

## ◆ ~Device()

Gdk::Device::~Device | ( |  | ) |
| overridenoexcept

## ◆ Device() [2/2]

Gdk::Device::Device | ( |  | ) |
| protected

## Member Function Documentation

## ◆ get_axis()

bool Gdk::Device::get_axis | ( | double & | axes,
|  | AxisUse | use,
|  | double & | value
| ) |  | const

Interprets an array of double as axis values for a given device, and locates the value in the array for a given axis use.

Parameters

  axes | Pointer to an array of axes.
  use | The use to look for.
  value | Location to store the found value.

Returns
  `true` if the given axis use was found, otherwise `false`.

## ◆ get_axis_use()

AxisUse Gdk::Device::get_axis_use | ( | guint | index_ | ) | const

Returns the axis use for index_.

Since gtkmm 2.22:

Parameters

  index_ | The index of the axis.

Returns
  A Gdk::AxisUse specifying how the axis is used.

## ◆ get_has_cursor()

bool Gdk::Device::get_has_cursor | ( |  | ) | const

Determines whether the pointer follows device motion.

Since gtkmm 2.22:

Returns
  `true` if the pointer follows device motion.

## ◆ get_history()

bool Gdk::Device::get_history | ( | const Glib::RefPtr< Window >& | window,
|  | guint32 | start,
|  | guint32 | stop,
|  | GdkTimeCoord **& | events,
|  | int & | n_events
| ) |  |

Obtains the motion history for a 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, `false` will be returned. (This is not distinguishable from the case where motion history is supported and no events were found.)

Parameters

  window | The window with respect to which which the event coordinates will be reported.
  start | Starting timestamp for range of events to return.
  stop | Ending timestamp for the range of events to return.
  events | Location to store a newly-allocated array of Gdk::TimeCoord, or `nullptr`.
  n_events | Location to store the length of events, or `nullptr`.

Returns
  `true` if the windowing system supports motion history and at least one event was found.

## ◆ get_key()

void Gdk::Device::get_key | ( | guint | index_,
|  | guint & | keyval,
|  | ModifierType& | modifiers
| ) |  | const

If index_ has a valid keyval, this function will fill in keyval and modifiers with the keyval settings.

Since gtkmm 2.22:

Parameters

  index_ | The index of the macro button to get.
  keyval | Return value for the keyval.
  modifiers | Return value for modifiers.

## ◆ get_mode()

InputMode Gdk::Device::get_mode | ( |  | ) | const

Determines the mode of the device.

Since gtkmm 2.22:

Returns
  A Gdk::InputSource.

## ◆ get_n_axes()

gint Gdk::Device::get_n_axes | ( |  | ) | const

Gets the number of axes of a device.

Since gtkmm 2.22:

Returns
  The number of axes of device.

## ◆ get_name()

Glib::ustring Gdk::Device::get_name | ( |  | ) | const

Determines the name of the device.

Since gtkmm 2.22:

Returns
  A name.

## ◆ get_source()

InputSource Gdk::Device::get_source | ( |  | ) | const

Determines the type of the device.

Since gtkmm 2.22:

Returns
  A Gdk::InputSource.

## ◆ get_state()

void Gdk::Device::get_state | ( | const Glib::RefPtr< Window >& | window,
|  | double & | axes,
|  | ModifierType& | mask
| ) |  |

Gets the current state of a device.

Parameters

  window | A Gdk::Window.
  axes | An array of doubles to store the values of the axes of device in, or `nullptr`.
  mask | Location to store the modifiers, or `nullptr`.

## ◆ get_type()

static GType Gdk::Device::get_type | ( |  | ) |
| static

Get the GType for this class, for use with the underlying GObject type system.

## ◆ gobj() [1/2]

GdkDevice* Gdk::Device::gobj | ( |  | ) |
| inline

Provides access to the underlying C GObject.

## ◆ gobj() [2/2]

const GdkDevice* Gdk::Device::gobj | ( |  | ) | const
| inline

Provides access to the underlying C GObject.

## ◆ gobj_copy()

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.

## ◆ operator=()

Device& Gdk::Device::operator= | ( | Device&& | src | ) |
| noexcept

## ◆ set_axis_use()

void Gdk::Device::set_axis_use | ( | guint | index_,
|  | AxisUse | use
| ) |  |

## ◆ set_key()

void Gdk::Device::set_key | ( | guint | index_,
|  | guint | keyval,
|  | ModifierType | modifiers
| ) |  |

## ◆ set_mode()

bool Gdk::Device::set_mode | ( | InputMode | mode | ) |

## ◆ set_source()

void Gdk::Device::set_source | ( | InputSource | source | ) |

## Friends And Related Function Documentation

## ◆ wrap()

Glib::RefPtr< Gdk::Device > wrap | ( | GdkDevice * | object,
|  | bool | take_copy = `false`
| ) |  |
| 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.

The documentation for this class was generated from the following file:

- gdkmm/device.h