gtkmm 4.17.0
|
Event controller for scroll events. More...
#include <gtkmm/eventcontrollerscroll.h>
Public Types | |
enum class | Flags { Flags::NONE = 0x0 , Flags::VERTICAL = 1 << 0 , Flags::HORIZONTAL = 1 << 1 , Flags::DISCRETE = 1 << 2 , Flags::KINETIC = 1 << 3 , Flags::BOTH_AXES = 0x3 } |
Describes the behavior of a Gtk::EventControllerScroll . More... | |
![]() | |
typedef void(*)(gpointer data | DestroyNotify) |
![]() | |
typedef internal::func_destroy_notify | func_destroy_notify |
![]() | |
typedef internal::func_destroy_notify | func_destroy_notify |
Public Member Functions | |
EventControllerScroll (EventControllerScroll &&src) noexcept | |
EventControllerScroll & | operator= (EventControllerScroll &&src) noexcept |
~EventControllerScroll () noexcept override | |
GtkEventControllerScroll * | gobj () |
Provides access to the underlying C GObject. | |
const GtkEventControllerScroll * | gobj () const |
Provides access to the underlying C GObject. | |
GtkEventControllerScroll * | gobj_copy () |
Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs. | |
void | set_flags (Flags flags) |
Sets the flags conditioning scroll controller behavior. | |
Flags | get_flags () const |
Gets the flags conditioning the scroll controller behavior. | |
Gdk::ScrollUnit | get_unit () const |
Gets the scroll unit of the last signal_scroll() signal received. | |
Glib::PropertyProxy< Flags > | property_flags () |
The flags affecting event controller behavior. | |
Glib::PropertyProxy_ReadOnly< Flags > | property_flags () const |
The flags affecting event controller behavior. | |
Glib::SignalProxy< void()> | signal_scroll_begin () |
Glib::SignalProxy< bool(double, double)> | signal_scroll () |
Glib::SignalProxy< void()> | signal_scroll_end () |
Glib::SignalProxy< void(double, double)> | signal_decelerate () |
![]() | |
EventController (EventController &&src) noexcept | |
EventController & | operator= (EventController &&src) noexcept |
~EventController () noexcept override | |
GtkEventController * | gobj () |
Provides access to the underlying C GObject. | |
const GtkEventController * | gobj () const |
Provides access to the underlying C GObject. | |
GtkEventController * | gobj_copy () |
Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs. | |
Widget * | get_widget () |
Returns the Gtk::Widget this controller relates to. | |
const Widget * | get_widget () const |
Returns the Gtk::Widget this controller relates to. | |
void | reset () |
Resets the controller to a clean state. | |
PropagationPhase | get_propagation_phase () const |
Gets the propagation phase at which controller handles events. | |
void | set_propagation_phase (PropagationPhase phase) |
Sets the propagation phase at which a controller handles events. | |
PropagationLimit | get_propagation_limit () const |
Gets the propagation limit of the event controller. | |
void | set_propagation_limit (PropagationLimit limit) |
Sets the event propagation limit on the event controller. | |
Glib::ustring | get_name () const |
Gets the name of controller. | |
void | set_name (const Glib::ustring & name) |
Sets a name on the controller that can be used for debugging. | |
Glib::RefPtr< const Gdk::Event > | get_current_event () const |
Returns the event that is currently being handled by the controller. | |
guint32 | get_current_event_time () const |
Returns the timestamp of the event that is currently being handled by the controller. | |
Glib::RefPtr< Gdk::Device > | get_current_event_device () |
Returns the device of the event that is currently being handled by the controller. | |
Glib::RefPtr< const Gdk::Device > | get_current_event_device () const |
Returns the event that is currently being handled by the controller. | |
Gdk::ModifierType | get_current_event_state () const |
Returns the modifier state of the event that is currently being handled by the controller. | |
Glib::PropertyProxy_ReadOnly< Widget * > | property_widget () const |
The widget receiving the Gdk::Events that the controller will handle. | |
Glib::PropertyProxy< PropagationPhase > | property_propagation_phase () |
The propagation phase at which this controller will handle events. | |
Glib::PropertyProxy_ReadOnly< PropagationPhase > | property_propagation_phase () const |
The propagation phase at which this controller will handle events. | |
Glib::PropertyProxy< PropagationLimit > | property_propagation_limit () |
The limit for which events this controller will handle. | |
Glib::PropertyProxy_ReadOnly< PropagationLimit > | property_propagation_limit () const |
The limit for which events this controller will handle. | |
Glib::PropertyProxy< Glib::ustring > | property_name () |
The name for this controller, typically used for debugging purposes. | |
Glib::PropertyProxy_ReadOnly< Glib::ustring > | property_name () const |
The name for this controller, typically used for debugging purposes. | |
![]() | |
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_with_c_callback (const Quark &key, void *data, GDestroyNotify notify) |
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) |
![]() | |
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 |
![]() | |
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. | |
static Glib::RefPtr< EventControllerScroll > | create () |
![]() | |
static GType | get_type () |
Get the GType for this class, for use with the underlying GObject type system. | |
Protected Member Functions | |
EventControllerScroll () | |
![]() | |
EventController () | |
There is no create() method that corresponds to this constructor, because only derived classes shall be created. | |
![]() | |
Object () | |
Object (const Glib::ConstructParams &construct_params) | |
Object (GObject *castitem) | |
~Object () noexcept override | |
![]() | |
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 Symbols | |
(Note that these are not member symbols.) | |
Glib::RefPtr< Gtk::EventControllerScroll > | wrap (GtkEventControllerScroll *object, bool take_copy=false) |
A Glib::wrap() method for this object. | |
![]() | |
Glib::RefPtr< Gtk::EventController > | wrap (GtkEventController *object, bool take_copy=false) |
A Glib::wrap() method for this object. | |
Event controller for scroll events.
Gtk::EventControllerScroll is an event controller meant to handle scroll events from mice and touchpads. It is capable of handling both discrete and continuous scroll events, abstracting them both on the signal_scroll() signal (deltas in the discrete case are multiples of 1).
In the case of continuous scroll events, EventControllerScroll encloses all signal_scroll() events between two signal_scroll_begin() and signal_scroll_end() signals.
The behavior of the event controller can be modified by the flags given at creation time, or modified at a later point through set_flags() (e.g. because the scrolling conditions of the widget changed).
The controller can be set up to emit motion for either/both vertical and horizontal scroll events through Gtk::EventControllerScroll::Flags::VERTICAL, Gtk::EventControllerScroll::Flags::HORIZONTAL and Gtk::EventControllerScroll::Flags::BOTH_AXES. If any axis is disabled, the respective signal_scroll() delta will be 0. Vertical scroll events will be translated to horizontal motion for the devices incapable of horizontal scrolling.
The event controller can also be forced to emit discrete events on all devices through Gtk::EventControllerScroll::Flags::DISCRETE. This can be used to implement discrete actions triggered through scroll events (e.g. switching across combobox options).
The Gtk::EventControllerScroll::Flags::KINETIC flag toggles the emission of the signal_decelerate() signal, emitted at the end of scrolling with two X/Y velocity arguments that are consistent with the motion that was received.
|
noexcept |
|
overridenoexcept |
|
protected |
|
static |
Flags Gtk::EventControllerScroll::get_flags | ( | ) | const |
Gets the flags conditioning the scroll controller behavior.
|
static |
Get the GType for this class, for use with the underlying GObject type system.
Gdk::ScrollUnit Gtk::EventControllerScroll::get_unit | ( | ) | const |
Gets the scroll unit of the last signal_scroll() signal received.
Always returns Gdk::ScrollUnit::WHEEL if the Gtk::EventControllerScroll::Flags::DISCRETE flag is set.
|
inline |
Provides access to the underlying C GObject.
|
inline |
Provides access to the underlying C GObject.
GtkEventControllerScroll * Gtk::EventControllerScroll::gobj_copy | ( | ) |
Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs.
|
noexcept |
Glib::PropertyProxy< Flags > Gtk::EventControllerScroll::property_flags | ( | ) |
The flags affecting event controller behavior.
Default value: Gtk::EventControllerScroll::Flags::NONE
Glib::PropertyProxy_ReadOnly< Flags > Gtk::EventControllerScroll::property_flags | ( | ) | const |
The flags affecting event controller behavior.
Default value: Gtk::EventControllerScroll::Flags::NONE
Sets the flags conditioning scroll controller behavior.
flags | Flags affecting the controller behavior. |
void on_my_decelerate(double vel_x, double vel_y)
Flags: Run First
Emitted after scroll is finished if the Gtk::EventControllerScroll::Flags::KINETIC flag is set.
vel_x and vel_y express the initial velocity that was imprinted by the scroll events. vel_x and vel_y are expressed in pixels/ms.
vel_x | X velocity. |
vel_y | Y velocity. |
bool on_my_scroll(double dx, double dy)
Flags: Run Last
Signals that the widget should scroll by the amount specified by dx and dy.
For the representation unit of the deltas, see Gtk::EventControllerScroll::get_unit().
dx | X delta. |
dy | Y delta. |
true
if the scroll event was handled, false
otherwise. Glib::SignalProxy< void()> Gtk::EventControllerScroll::signal_scroll_begin | ( | ) |
void on_my_scroll_begin()
Flags: Run First
Signals that a new scrolling operation has begun.
It will only be emitted on devices capable of it.
Glib::SignalProxy< void()> Gtk::EventControllerScroll::signal_scroll_end | ( | ) |
void on_my_scroll_end()
Flags: Run First
Signals that a scrolling operation has finished.
It will only be emitted on devices capable of it.
|
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 or ref. |