gtkmm
3.91.0
|
Generated when the mouse is scrolled. More...
#include <gdkmm/event.h>
Public Member Functions | |
EventScroll () | |
Creates an invalid event object. More... | |
EventScroll (GdkEventScroll* gobject, bool make_a_copy=false) | |
Wraps a C event instance. More... | |
void | swap (EventScroll& other) noexcept |
GdkEventScroll* | gobj () |
Provides access to the underlying C instance. More... | |
const GdkEventScroll* | gobj () const |
Provides access to the underlying C instance. More... | |
GdkEventScroll* | 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... | |
double | get_delta_x () const |
Returns the scroll delta in the X axis. More... | |
double | get_delta_y () const |
Returns the scroll delta in the Y axis. More... | |
ScrollDirection | get_direction () const |
Returns the direction of the scroll. More... | |
bool | is_scroll_stop_event () const |
Check whether a scroll event is a stop scroll 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 () |
Provides access to the underlying C instance. More... | |
const GdkEvent* | gobj () const |
Provides access to the underlying C instance. More... | |
GdkEvent* | gobj_copy () const |
Provides access to the underlying C instance. 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 (EventScroll& lhs, EventScroll& rhs) noexcept |
const EventScroll& | wrap_event (const GdkEventScroll*& event) |
Wraps a C event instance without making unnecessary copy when the ownership can not be acquired. More... | |
EventScroll& | wrap_event (GdkEventScroll*& event) |
See wrap_event(const GdkEventScroll*& event). More... | |
Gdk::EventScroll | wrap (GdkEventScroll* 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... | |
Generated when the mouse is scrolled.
These events are from button presses for the buttons 4 to 7. Wheel mice are usually configured to generate button press events for buttons 4 and 5 when the wheel is turned.
get_event_type() will return Gdk::Event::Type::SCROLL.
Some GDK backends can also generate 'smooth' scroll events, which can be recognized by the Gdk::ScrollDirection::SMOOTH scroll direction. For these, scroll deltas can be obtained with get_delta_x() and get_delta_y().
Gdk::EventScroll::EventScroll | ( | ) |
Creates an invalid event object.
Calling any member functions is undefined behavior.
|
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. |
double Gdk::EventScroll::get_delta_x | ( | ) | const |
Returns the scroll delta in the X axis.
Meaningful only if get_direction() returns Gdk::ScrollDirection::SMOOTH
double Gdk::EventScroll::get_delta_y | ( | ) | const |
Returns the scroll delta in the Y axis.
Meaningful only if get_direction() returns Gdk::ScrollDirection::SMOOTH
Glib::RefPtr<Gdk::Device> Gdk::EventScroll::get_device | ( | ) |
Returns the device where the event originated from.
Glib::RefPtr<const Gdk::Device> Gdk::EventScroll::get_device | ( | ) | const |
ScrollDirection Gdk::EventScroll::get_direction | ( | ) | const |
Returns the direction of the scroll.
double Gdk::EventScroll::get_root_x | ( | ) | const |
Returns the X coordinate of the pointer relative to the root screen.
double Gdk::EventScroll::get_root_y | ( | ) | const |
Returns the Y coordinate of the pointer relative to the root screen.
ModifierType Gdk::EventScroll::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::EventScroll::get_time | ( | ) | const |
Returns the timestamp of the event in milliseconds.
double Gdk::EventScroll::get_x | ( | ) | const |
Returns the X coordinate of the pointer relative to the window.
double Gdk::EventScroll::get_y | ( | ) | const |
Returns the Y coordinate of the pointer relative to the window.
|
inline |
Provides access to the underlying C instance.
|
inline |
Provides access to the underlying C instance.
GdkEventScroll* Gdk::EventScroll::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.
bool Gdk::EventScroll::is_scroll_stop_event | ( | ) | const |
Check whether a scroll event is a stop scroll event.
Scroll sequences with smooth scroll information may provide a stop scroll event once the interaction with the device finishes, e.g. by lifting a finger. This stop scroll event is the signal that a widget may trigger kinetic scrolling based on the current velocity.
Stop scroll events always have a a delta of 0/0.
true
if the event is a scroll stop event.
|
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 |