gtkmm  3.97.1
Public Member Functions | Related Functions | List of all members
Gdk::EventScroll Class Reference

Generated when the mouse is scrolled. More...

#include <gdkmm/events.h>

Inheritance diagram for Gdk::EventScroll:
Inheritance graph
[legend]

Public Member Functions

GdkEventScroll* gobj () noexcept
 Provides access to the underlying C instance. More...
 
const GdkEventScroll* gobj () const noexcept
 Provides access to the underlying C instance. More...
 
GdkEventScroll* gobj_copy ()
 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...
 
void get_coords (double& x_win, double& y_win) const
 Extract the event surface relative x/y coordinates from an event. More...
 
bool get_scroll_deltas (double& delta_x, double& delta_y) const
 Retrieves the scroll deltas from a Gdk::Event. More...
 
ScrollDirection get_scroll_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...
 
- Public Member Functions inherited from Gdk::Event
 Event (Event&& src) noexcept
 
Eventoperator= (Event&& src) noexcept
 
 ~Event () noexcept override
 
GdkEvent* gobj ()
 Provides access to the underlying C GObject. More...
 
const GdkEvent* gobj () const
 Provides access to the underlying C GObject. More...
 
GdkEvent* 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::RefPtr< Eventcopy () const
 Copies a Gdk::Event, copying or incrementing the reference count of the resources associated with it (e.g. Gdk::Surface’s and strings). More...
 
Type get_event_type () const
 Retrieves the type of the event. More...
 
Glib::RefPtr< Gdk::Surfaceget_surface ()
 Extracts the Gdk::Surface associated with an event. More...
 
Glib::RefPtr< const Gdk::Surfaceget_surface () const
 Extracts the Gdk::Surface associated with an event. More...
 
bool is_sent () const
 Returns true if the event was sent explicitly (e.g. More...
 
void set_device (const Glib::RefPtr< Device >& device)
 Sets the device for event to device. More...
 
Glib::RefPtr< Deviceget_device ()
 If the event contains a “device” field, this function will return it, else it will return nullptr. More...
 
Glib::RefPtr< const Deviceget_device () const
 If the event contains a “device” field, this function will return it, else it will return nullptr. More...
 
void set_source_device (const Glib::RefPtr< Device >& device)
 Sets the slave device for event to device. More...
 
Glib::RefPtr< Deviceget_source_device ()
 This function returns the hardware (slave) Gdk::Device that has triggered the event, falling back to the virtual (master) device (as in get_device()) if the event wasn’t caused by interaction with a hardware device. More...
 
Glib::RefPtr< const Deviceget_source_device () const
 This function returns the hardware (slave) Gdk::Device that has triggered the event, falling back to the virtual (master) device (as in get_device()) if the event wasn’t caused by interaction with a hardware device. More...
 
void set_display (const Glib::RefPtr< Display >& display)
 Sets the display that an event is associated with. More...
 
Glib::RefPtr< Displayget_display ()
 Retrieves the Gdk::Display associated to the event. More...
 
Glib::RefPtr< const Displayget_display () const
 Retrieves the Gdk::Display associated to the event. More...
 
Glib::RefPtr< Seatget_seat ()
 Returns the Gdk::Seat this event was generated for. More...
 
Glib::RefPtr< const Seatget_seat () const
 Returns the Gdk::Seat this event was generated for. More...
 
Glib::PropertyProxy_ReadOnly< Typeproperty_event_type () const
 Event type. More...
 
- Public Member Functions inherited from Glib::Object
 Object (const Object &)=delete
 
Objectoperator= (const Object &)=delete
 
 Object (Object &&src) noexcept
 
Objectoperator= (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::Objectwrap (GObject *object, bool take_copy=false)
 
- Public Member Functions inherited from Glib::ObjectBase
 ObjectBase (const ObjectBase &)=delete
 
ObjectBaseoperator= (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
 

Related Functions

(Note that these are not member functions.)

Glib::RefPtr< Gdk::EventScrollwrap (GdkEventScroll* object, bool take_copy=false)
 A Glib::wrap() method for this object. More...
 

Additional Inherited Members

- Public Types inherited from Gdk::Event
enum  Type {
  Type::NOTHING,
  Type::DELETE,
  Type::DESTROY,
  Type::MOTION_NOTIFY,
  Type::BUTTON_PRESS,
  Type::BUTTON_RELEASE,
  Type::KEY_PRESS,
  Type::KEY_RELEASE,
  Type::ENTER_NOTIFY,
  Type::LEAVE_NOTIFY,
  Type::FOCUS_CHANGE,
  Type::CONFIGURE,
  Type::PROXIMITY_IN,
  Type::PROXIMITY_OUT,
  Type::DRAG_ENTER,
  Type::DRAG_LEAVE,
  Type::DRAG_MOTION,
  Type::DROP_START,
  Type::SCROLL,
  Type::GRAB_BROKEN,
  Type::TOUCH_BEGIN,
  Type::TOUCH_UPDATE,
  Type::TOUCH_END,
  Type::TOUCH_CANCEL,
  Type::TOUCHPAD_SWIPE,
  Type::TOUCHPAD_PINCH,
  Type::PAD_BUTTON_PRESS,
  Type::PAD_BUTTON_RELEASE,
  Type::PAD_RING,
  Type::PAD_STRIP,
  Type::PAD_GROUP_MODE,
  Type::EVENT_LAST
}
 
- Public Types inherited from Glib::Object
typedef void(*)(gpointer data DestroyNotify)
 
- Static Public Member Functions inherited from Gdk::Event
static GType get_type ()
 Get the GType for this class, for use with the underlying GObject type system. More...
 
static Glib::RefPtr< Eventcreate (Type event_type)
 Creates a new event of the given type. More...
 
static void set_show_events (bool show_events=true)
 Sets whether a trace of received events is output. More...
 
static bool get_show_events ()
 Gets whether event debugging output is enabled. More...
 
- Protected Member Functions inherited from Gdk::Event
 Event (Type event_type)
 
- 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
 
ObjectBaseoperator= (ObjectBase &&src) noexcept
 
virtual ~ObjectBase () noexcept=0
 
void initialize (GObject *castitem)
 
void initialize_move (GObject *castitem, Glib::ObjectBase *previous_wrapper)
 

Detailed Description

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().

Since gtkmm 3.90:

Member Function Documentation

◆ get_coords()

void Gdk::EventScroll::get_coords ( double &  x_win,
double &  y_win 
) const

Extract the event surface relative x/y coordinates from an event.

Parameters
x_winLocation to put event surface x coordinate.
y_winLocation to put event surface y coordinate.

◆ get_scroll_deltas()

bool Gdk::EventScroll::get_scroll_deltas ( double &  delta_x,
double &  delta_y 
) const

Retrieves the scroll deltas from a Gdk::Event.

Parameters
delta_xReturn location for X delta.
delta_yReturn location for Y delta.
Returns
true if the event contains smooth scroll information.

◆ get_scroll_direction()

ScrollDirection Gdk::EventScroll::get_scroll_direction ( ) const

Returns the direction of the scroll.

◆ get_state()

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.

◆ get_time()

guint32 Gdk::EventScroll::get_time ( ) const

Returns the timestamp of the event in milliseconds.

◆ gobj() [1/2]

const GdkEventScroll* Gdk::EventScroll::gobj ( ) const
inlinenoexcept

Provides access to the underlying C instance.

◆ gobj() [2/2]

GdkEventScroll* Gdk::EventScroll::gobj ( )
inlinenoexcept

Provides access to the underlying C instance.

◆ gobj_copy()

GdkEventScroll* Gdk::EventScroll::gobj_copy ( )

Provides access to the underlying C instance.

The caller is responsible for unrefing it with g_object_unref(). Use when directly setting fields in structs.

◆ is_scroll_stop_event()

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 delta of 0/0.

Returns
true if the event is a scroll stop event.

Friends And Related Function Documentation

◆ wrap()

Glib::RefPtr< Gdk::EventScroll > wrap ( GdkEventScroll *  object,
bool  take_copy = false 
)
related

A Glib::wrap() method for this object.

Parameters
objectThe C instance.
take_copyfalse 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.