gtkmm
3.91.2
|
Generated when a mouse pointer is moved. More...
#include <gdkmm/events.h>
Public Member Functions | |
EventMotion () | |
Creates an invalid event object. More... | |
EventMotion (GdkEventMotion* gobject, bool make_a_copy=false) | |
Wraps a C event instance. More... | |
void | swap (EventMotion& other) noexcept |
GdkEventMotion* | gobj () noexcept |
Provides access to the underlying C instance. More... | |
const GdkEventMotion* | gobj () const noexcept |
Provides access to the underlying C instance. More... | |
GdkEventMotion* | gobj_copy () const |
Provides access to the underlying C instance. More... | |
guint32 | get_time () const |
Returns the timestamp of the event in milliseconds. More... | |
ModifierType | get_state () const |
Returns a bit mask representing the state of the modifier keys (e.g. More... | |
double | get_x () const |
Returns the X coordinate of the pointer relative to the window. More... | |
double | get_y () const |
Returns the Y coordinate of the pointer relative to the window. More... | |
double | get_root_x () const |
Returns the X coordinate of the pointer relative to the root screen. More... | |
double | get_root_y () const |
Returns the Y coordinate of the pointer relative to the root screen. More... | |
bool | get_axis (Gdk::AxisUse axis_use, double& value) const |
Extract the axis value for a particular axis use from an event structure. More... | |
bool | get_is_hint () const |
Returns true if the event is motion hint. More... | |
void | request_motions () |
Request more motion notifies if event is a motion notify hint event. More... | |
Glib::RefPtr< Gdk::Device > | get_device () |
Returns the device where the event originated from. More... | |
Glib::RefPtr< const Gdk::Device > | get_device () const |
![]() | |
Event () | |
Creates an invalid event object. More... | |
Event (GdkEvent* gobject, bool make_a_copy=false) | |
Wraps a C event instance. More... | |
Event (const Event& other) | |
Event& | operator= (const Event& other) |
Event (Event&& other) noexcept | |
Event& | operator= (Event&& other) noexcept |
~Event () noexcept | |
void | swap (Event& other) noexcept |
GdkEvent* | gobj () noexcept |
Provides access to the underlying C instance. More... | |
const GdkEvent* | gobj () const noexcept |
Provides access to the underlying C instance. More... | |
GdkEvent* | gobj_copy () const |
Provides access to the underlying C instance. More... | |
operator bool () const noexcept | |
Discover whether the event is valid. More... | |
Event::Type | get_event_type () const |
Retrieves the type of the event. More... | |
Glib::RefPtr< Gdk::Window > | get_window () |
Returns the window which received the event. More... | |
Glib::RefPtr< const Gdk::Window > | get_window () const |
bool | is_send_event () const |
Returns true if the event was sent explicitly (e.g. More... | |
Glib::RefPtr< Screen > | get_screen () |
Returns the screen for the event. More... | |
Glib::RefPtr< const Screen > | get_screen () const |
Returns the screen for the event. More... | |
Glib::RefPtr< Seat > | get_seat () |
Returns the Gdk::Seat this event was generated for. More... | |
Glib::RefPtr< const Seat > | get_seat () const |
Returns the Gdk::Seat this event was generated for. More... | |
void | put () |
Appends a copy of the given event onto the front of the event queue for event->any.window’s display, or the default event queue if event->any.window is nullptr . More... | |
Related Functions | |
(Note that these are not member functions.) | |
void | swap (EventMotion& lhs, EventMotion& rhs) noexcept |
const EventMotion& | wrap_event (const GdkEventMotion*& event) |
Wraps a C event instance without making unnecessary copy when the ownership can not be acquired. More... | |
EventMotion& | wrap_event (GdkEventMotion*& event) |
See wrap_event(const GdkEventMotion*& event). More... | |
Gdk::EventMotion | wrap (GdkEventMotion* object, bool take_copy=false) |
A Glib::wrap() method for this object. More... | |
![]() | |
void | swap (Event& lhs, Event& rhs) noexcept |
const Event& | wrap_event (const GdkEvent*& event) |
Wraps a C event instance without making unnecessary copy when the ownership can not be acquired. More... | |
Event& | wrap_event (GdkEvent*& event) |
See wrap_event(const GdkEvent*& event). More... | |
Gdk::Event | wrap (GdkEvent* object, bool take_copy=false) |
A Glib::wrap() method for this object. More... | |
Additional Inherited Members | |
![]() | |
enum | Type { Type::NOTHING = -1, Type::DELETE = 0, Type::DESTROY = 1, Type::EXPOSE = 2, Type::MOTION_NOTIFY = 3, Type::BUTTON_PRESS = 4, Type::DOUBLE_BUTTON_PRESS = 5, Type::TRIPLE_BUTTON_PRESS = 6, Type::BUTTON_RELEASE = 7, Type::KEY_PRESS = 8, Type::KEY_RELEASE = 9, Type::ENTER_NOTIFY = 10, Type::LEAVE_NOTIFY = 11, Type::FOCUS_CHANGE = 12, Type::CONFIGURE = 13, Type::MAP = 14, Type::UNMAP = 15, Type::PROPERTY_NOTIFY = 16, Type::SELECTION_CLEAR = 17, Type::SELECTION_REQUEST = 18, Type::SELECTION_NOTIFY = 19, Type::PROXIMITY_IN = 20, Type::PROXIMITY_OUT = 21, Type::DRAG_ENTER = 22, Type::DRAG_LEAVE = 23, Type::DRAG_MOTION = 24, Type::DRAG_STATUS = 25, Type::DROP_START = 26, Type::DROP_FINISHED = 27, Type::CLIENT_EVENT = 28, Type::VISIBILITY_NOTIFY = 29, Type::SCROLL = 31, Type::WINDOW_STATE = 32, Type::SETTING = 33, Type::OWNER_CHANGE = 34, Type::GRAB_BROKEN = 35, Type::DAMAGE = 36, Type::TOUCH_BEGIN = 37, Type::TOUCH_UPDATE = 38, Type::TOUCH_END = 39, Type::TOUCH_CANCEL = 40, Type::TOUCHPAD_SWIPE = 41, Type::TOUCHPAD_PINCH = 42, Type::PAD_BUTTON_PRESS = 43, Type::PAD_BUTTON_RELEASE = 44, Type::PAD_RING = 45, Type::PAD_STRIP = 46, Type::PAD_GROUP_MODE = 47, Type::EVENT_LAST = 48 } |
Specifies the type of the event. More... | |
![]() | |
static GType | get_type () |
Get the GType for this class, for use with the underlying GObject type system. More... | |
static void | set_show_events (bool show_events) |
Sets whether a trace of received events is output. More... | |
static bool | get_show_events () |
Gets whether event debugging output is enabled. More... | |
static Event | get () |
Checks all open displays for a Gdk::Event to process,to be processed on, fetching events from the windowing system if necessary. More... | |
static Event | peek () |
If there is an event waiting in the event queue of some open display, returns a copy of it. More... | |
static bool | events_pending () |
Checks if any events are ready to be processed for any display. More... | |
Generated when a mouse pointer is moved.
get_event_type() will return Gdk::Event::Type::MOTION_NOTIFY.
Gdk::EventMotion::EventMotion | ( | ) |
Creates an invalid event object.
Calling any member functions other than operator bool() is undefined behavior. An invalid event object can be used in a function call, if the underlying C function expects a NULL GdkEventMotion pointer.
|
explicit |
Wraps a C event instance.
This constructor either acquires ownership of gobject, or copies it.
gobject | Event to wrap. |
make_a_copy | If false , the ownership of gobject is acquired, otherwise a copy is made. |
bool Gdk::EventMotion::get_axis | ( | Gdk::AxisUse | axis_use, |
double & | value | ||
) | const |
Extract the axis value for a particular axis use from an event structure.
axis_use | The axis use to look for. |
value | Location to store the value found. |
true
if the specified axis was found, otherwise false
. Glib::RefPtr<Gdk::Device> Gdk::EventMotion::get_device | ( | ) |
Returns the device where the event originated from.
Glib::RefPtr<const Gdk::Device> Gdk::EventMotion::get_device | ( | ) | const |
bool Gdk::EventMotion::get_is_hint | ( | ) | const |
Returns true
if the event is motion hint.
Motion hints are received only if Gdk::EventMask::POINTER_MOTION_HINT_MASK is set. It is used to reduce the number of Gdk::Event::Type::MOTION_NOTIFY events received. Normally a Gdk::Event::Type::MOTION_NOTIFY event is received each time the mouse moves. However, if the application spends a lot of time processing the event (updating the display, for example), it can lag behind the position of the mouse. When using Gdk::EventMask::POINTER_MOTION_HINT_MASK, fewer Gdk::Event::Type::MOTION_NOTIFY events will be sent, some of which are marked as a hint. To receive more motion events after a motion hint event, the application needs to ask for more, by calling request_motions().
double Gdk::EventMotion::get_root_x | ( | ) | const |
Returns the X coordinate of the pointer relative to the root screen.
double Gdk::EventMotion::get_root_y | ( | ) | const |
Returns the Y coordinate of the pointer relative to the root screen.
ModifierType Gdk::EventMotion::get_state | ( | ) | const |
Returns a bit mask representing the state of the modifier keys (e.g.
Control, Shift and Alt) and the pointer buttons.
guint32 Gdk::EventMotion::get_time | ( | ) | const |
Returns the timestamp of the event in milliseconds.
double Gdk::EventMotion::get_x | ( | ) | const |
Returns the X coordinate of the pointer relative to the window.
double Gdk::EventMotion::get_y | ( | ) | const |
Returns the Y coordinate of the pointer relative to the window.
|
inlinenoexcept |
Provides access to the underlying C instance.
|
inlinenoexcept |
Provides access to the underlying C instance.
GdkEventMotion* Gdk::EventMotion::gobj_copy | ( | ) | const |
Provides access to the underlying C instance.
The caller is responsible for freeing it with gdk_event_free(). Use when directly setting fields in structs.
void Gdk::EventMotion::request_motions | ( | ) |
Request more motion notifies if event is a motion notify hint event.
This function should be used instead of gdk_window_get_pointer() to request further motion notifies, because it also works for extension events where motion notifies are provided for devices other than the core pointer. Coordinate extraction, processing and requesting more motion events from a Gdk::Event::Type::MOTION_NOTIFY event usually works like this:
[C example ellipted]
|
noexcept |
|
related |
lhs | The left-hand side |
rhs | The right-hand side |
|
related |
A Glib::wrap() method for this object.
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. |
|
related |
Wraps a C event instance without making unnecessary copy when the ownership can not be acquired.
The event pointer must not be deleted until last usage of the returned instance. Note, that this requirement applies to the pointer itself, in addition to the object it is pointing to.
|
related |