Package ch.bailu.gtk.gtk
Class EventControllerScroll
java.lang.Object
ch.bailu.gtk.type.Type
ch.bailu.gtk.type.Pointer
ch.bailu.gtk.gobject.Object
ch.bailu.gtk.gtk.EventController
ch.bailu.gtk.gtk.EventControllerScroll
- All Implemented Interfaces:
PointerInterface
`GtkEventControllerScroll` is an event controller that handles scroll
events.
It is capable of handling both discrete and continuous scroll
events from mice or touchpads, abstracting them both with the
[signal@Gtk.EventControllerScroll::scroll] signal. Deltas in
the discrete case are multiples of 1.
In the case of continuous scroll events, `GtkEventControllerScroll`
encloses all [signal@Gtk.EventControllerScroll::scroll] emissions
between two [signal@Gtk.EventControllerScroll::scroll-begin] and
[signal@Gtk.EventControllerScroll::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
[method@Gtk.EventControllerScroll.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_EVENT_CONTROLLER_SCROLL_VERTICAL,
%GTK_EVENT_CONTROLLER_SCROLL_HORIZONTAL and %GTK_EVENT_CONTROLLER_SCROLL_BOTH_AXES.
If any axis is disabled, the respective [signal@Gtk.EventControllerScroll::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_EVENT_CONTROLLER_SCROLL_DISCRETE. This can be used
to implement discrete actions triggered through scroll events (e.g.
switching across combobox options).
The %GTK_EVENT_CONTROLLER_SCROLL_KINETIC flag toggles the emission of the
[signal@Gtk.EventControllerScroll::decelerate] signal, emitted at the end
of scrolling with two X/Y velocity arguments that are consistent with the
motion that was received.
events.
It is capable of handling both discrete and continuous scroll
events from mice or touchpads, abstracting them both with the
[signal@Gtk.EventControllerScroll::scroll] signal. Deltas in
the discrete case are multiples of 1.
In the case of continuous scroll events, `GtkEventControllerScroll`
encloses all [signal@Gtk.EventControllerScroll::scroll] emissions
between two [signal@Gtk.EventControllerScroll::scroll-begin] and
[signal@Gtk.EventControllerScroll::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
[method@Gtk.EventControllerScroll.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_EVENT_CONTROLLER_SCROLL_VERTICAL,
%GTK_EVENT_CONTROLLER_SCROLL_HORIZONTAL and %GTK_EVENT_CONTROLLER_SCROLL_BOTH_AXES.
If any axis is disabled, the respective [signal@Gtk.EventControllerScroll::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_EVENT_CONTROLLER_SCROLL_DISCRETE. This can be used
to implement discrete actions triggered through scroll events (e.g.
switching across combobox options).
The %GTK_EVENT_CONTROLLER_SCROLL_KINETIC flag toggles the emission of the
[signal@Gtk.EventControllerScroll::decelerate] signal, emitted at the end
of scrolling with two X/Y velocity arguments that are consistent with the
motion that was received.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic interface
static interface
static interface
static interface
Nested classes/interfaces inherited from class ch.bailu.gtk.gobject.Object
Object.OnBindingTransformFunc, Object.OnDestroyNotify, Object.OnDuplicateFunc, Object.OnNotify, Object.OnToggleNotify, Object.OnWeakNotify
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
static final String
static final String
static final String
Fields inherited from class ch.bailu.gtk.gobject.Object
SIGNAL_ON_NOTIFY
-
Constructor Summary
ConstructorDescriptionEventControllerScroll
(int flags) Creates a new event controller that will handle scroll events.EventControllerScroll
(PointerContainer pointer) -
Method Summary
Modifier and TypeMethodDescriptionstatic ClassHandler
int
getFlags()
Gets the flags conditioning the scroll controller behavior.static int
static long
static TypeSystem.TypeSize
static long
static TypeSystem.TypeSize
int
getUnit()
Gets the scroll unit of the last
[signal@Gtk.EventControllerScroll::scroll] signal received.Connect to signal "decelerate".Connect to signal "scroll".Connect to signal "scroll-begin".Connect to signal "scroll-end".void
setFlags
(int flags) Sets the flags conditioning scroll controller behavior.Methods inherited from class ch.bailu.gtk.gtk.EventController
getCurrentEvent, getCurrentEventDevice, getCurrentEventState, getCurrentEventTime, getName, getPropagationLimit, getPropagationPhase, getWidget, reset, setName, setName, setPropagationLimit, setPropagationPhase, setStaticName, setStaticName
Methods inherited from class ch.bailu.gtk.gobject.Object
addToggleRef, bindProperty, bindProperty, bindPropertyFull, bindPropertyFull, bindPropertyWithClosures, bindPropertyWithClosures, compatControl, connect, connect, disconnect, disconnect, dupData, dupData, dupQdata, forceFloating, freezeNotify, get, get, getData, getData, getProperty, getProperty, getQdata, interfaceFindProperty, interfaceInstallProperty, isFloating, notify, notify, notifyByPspec, onNotify, ref, refSink, removeToggleRef, replaceData, replaceData, replaceQdata, runDispose, set, set, setData, setData, setDataFull, setDataFull, setProperty, setProperty, setQdata, setQdataFull, stealData, stealData, stealQdata, takeRef, thawNotify, unref, watchClosure, weakRef, weakUnref
Methods inherited from class ch.bailu.gtk.type.Pointer
asCPointer, cast, connectSignal, disconnectSignals, disconnectSignals, equals, hashCode, throwIfNull, throwNullPointerException, toString, unregisterCallbacks, unregisterCallbacks
Methods inherited from class ch.bailu.gtk.type.Type
asCPointer, asCPointer, asCPointerNotNull, asJnaPointer, asJnaPointer, asPointer, asPointer, cast, cast, throwIfNull
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface ch.bailu.gtk.type.PointerInterface
asCPointerNotNull, asJnaPointer, asPointer, isNotNull, isNull
-
Field Details
-
SIGNAL_ON_DECELERATE
- See Also:
-
SIGNAL_ON_SCROLL
- See Also:
-
SIGNAL_ON_SCROLL_BEGIN
- See Also:
-
SIGNAL_ON_SCROLL_END
- See Also:
-
-
Constructor Details
-
EventControllerScroll
-
EventControllerScroll
public EventControllerScroll(int flags) Creates a new event controller that will handle scroll events.- Parameters:
flags
- flags affecting the controller behavior
-
-
Method Details
-
getClassHandler
-
getFlags
public int getFlags()Gets the flags conditioning the scroll controller behavior.- Returns:
- the controller flags.
-
getUnit
public int getUnit()Gets the scroll unit of the last
[signal@Gtk.EventControllerScroll::scroll] signal received.
Always returns %GDK_SCROLL_UNIT_WHEEL if the
%GTK_EVENT_CONTROLLER_SCROLL_DISCRETE flag is set.- Returns:
- the scroll unit.
-
setFlags
public void setFlags(int flags) Sets the flags conditioning scroll controller behavior.- Parameters:
flags
- flags affecting the controller behavior
-
onDecelerate
Connect to signal "decelerate".
SeeEventControllerScroll.OnDecelerate.onDecelerate(double, double)
for signal description.
FieldSIGNAL_ON_DECELERATE
contains original signal name and can be used as resource reference.- Parameters:
signal
- callback function (lambda).- Returns:
SignalHandler
. Can be used to disconnect signal and to release callback function.
-
onScroll
Connect to signal "scroll".
SeeEventControllerScroll.OnScroll.onScroll(double, double)
for signal description.
FieldSIGNAL_ON_SCROLL
contains original signal name and can be used as resource reference.- Parameters:
signal
- callback function (lambda).- Returns:
SignalHandler
. Can be used to disconnect signal and to release callback function.
-
onScrollBegin
Connect to signal "scroll-begin".
SeeEventControllerScroll.OnScrollBegin.onScrollBegin()
for signal description.
FieldSIGNAL_ON_SCROLL_BEGIN
contains original signal name and can be used as resource reference.- Parameters:
signal
- callback function (lambda).- Returns:
SignalHandler
. Can be used to disconnect signal and to release callback function.
-
onScrollEnd
Connect to signal "scroll-end".
SeeEventControllerScroll.OnScrollEnd.onScrollEnd()
for signal description.
FieldSIGNAL_ON_SCROLL_END
contains original signal name and can be used as resource reference.- Parameters:
signal
- callback function (lambda).- Returns:
SignalHandler
. Can be used to disconnect signal and to release callback function.
-
getTypeID
public static long getTypeID() -
getParentTypeID
public static long getParentTypeID() -
getTypeSize
-
getParentTypeSize
-
getInstanceSize
public static int getInstanceSize()
-