gi-gtk-4.0.10: Gtk bindings
CopyrightWill Thompson and Iñaki García Etxebarria
LicenseLGPL-2.1
MaintainerIñaki García Etxebarria
Safe HaskellNone
LanguageHaskell2010

GI.Gtk.Objects.GesturePan

Description

GtkGesturePan is a GtkGesture for pan gestures.

These are drags that are locked to happen along one axis. The axis that a GtkGesturePan handles is defined at construct time, and can be changed through gesturePanSetOrientation.

When the gesture starts to be recognized, GtkGesturePan will attempt to determine as early as possible whether the sequence is moving in the expected direction, and denying the sequence if this does not happen.

Once a panning gesture along the expected axis is recognized, the GesturePan::pan signal will be emitted as input events are received, containing the offset in the given axis.

Synopsis

Exported types

class (GObject o, IsDescendantOf GesturePan o) => IsGesturePan o Source #

Type class for types which can be safely cast to GesturePan, for instance with toGesturePan.

Instances

Instances details
(GObject o, IsDescendantOf GesturePan o) => IsGesturePan o Source # 
Instance details

Defined in GI.Gtk.Objects.GesturePan

toGesturePan :: (MonadIO m, IsGesturePan o) => o -> m GesturePan Source #

Cast to GesturePan, for types for which this is known to be safe. For general casts, use castTo.

Methods

getOrientation

gesturePanGetOrientation Source #

Arguments

:: (HasCallStack, MonadIO m, IsGesturePan a) 
=> a

gesture: A GtkGesturePan

-> m Orientation

Returns: the expected orientation for pan gestures

Returns the orientation of the pan gestures that this gesture expects.

new

gesturePanNew Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Orientation

orientation: expected orientation

-> m GesturePan

Returns: a newly created GtkGesturePan

Returns a newly created GtkGesture that recognizes pan gestures.

setOrientation

gesturePanSetOrientation Source #

Arguments

:: (HasCallStack, MonadIO m, IsGesturePan a) 
=> a

gesture: A GtkGesturePan

-> Orientation

orientation: expected orientation

-> m () 

Sets the orientation to be expected on pan gestures.

Properties

orientation

The expected orientation of pan gestures.

constructGesturePanOrientation :: (IsGesturePan o, MonadIO m) => Orientation -> m (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “orientation” property. This is rarely needed directly, but it is used by new.

getGesturePanOrientation :: (MonadIO m, IsGesturePan o) => o -> m Orientation Source #

Get the value of the “orientation” property. When overloading is enabled, this is equivalent to

get gesturePan #orientation

setGesturePanOrientation :: (MonadIO m, IsGesturePan o) => o -> Orientation -> m () Source #

Set the value of the “orientation” property. When overloading is enabled, this is equivalent to

set gesturePan [ #orientation := value ]

Signals

pan

type GesturePanPanCallback Source #

Arguments

 = PanDirection

direction: current direction of the pan gesture

-> Double

offset: Offset along the gesture orientation

-> IO () 

Emitted once a panning gesture along the expected axis is detected.

afterGesturePanPan :: (IsGesturePan a, MonadIO m) => a -> ((?self :: a) => GesturePanPanCallback) -> m SignalHandlerId Source #

Connect a signal handler for the pan signal, to be run after the default handler. When overloading is enabled, this is equivalent to

after gesturePan #pan callback

By default the object invoking the signal is not passed to the callback. If you need to access it, you can use the implit ?self parameter. Note that this requires activating the ImplicitParams GHC extension.

onGesturePanPan :: (IsGesturePan a, MonadIO m) => a -> ((?self :: a) => GesturePanPanCallback) -> m SignalHandlerId Source #

Connect a signal handler for the pan signal, to be run before the default handler. When overloading is enabled, this is equivalent to

on gesturePan #pan callback