| Copyright | Will Thompson Iñaki García Etxebarria and Jonas Platte |
|---|---|
| License | LGPL-2.1 |
| Maintainer | Iñaki García Etxebarria (garetxe@gmail.com) |
| Safe Haskell | None |
| Language | Haskell2010 |
GI.Gtk.Objects.GesturePan
Description
GesturePan is a Gesture implementation able to recognize
pan gestures, those are drags that are locked to happen along one
axis. The axis that a GesturePan handles is defined at
construct time, and can be changed through
gesturePanSetOrientation.
When the gesture starts to be recognized, GesturePan 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
- newtype GesturePan = GesturePan (ManagedPtr GesturePan)
- class GObject o => IsGesturePan o
- toGesturePan :: (MonadIO m, IsGesturePan o) => o -> m GesturePan
- noGesturePan :: Maybe GesturePan
- gesturePanGetOrientation :: (HasCallStack, MonadIO m, IsGesturePan a) => a -> m Orientation
- gesturePanNew :: (HasCallStack, MonadIO m, IsWidget a) => a -> Orientation -> m GesturePan
- gesturePanSetOrientation :: (HasCallStack, MonadIO m, IsGesturePan a) => a -> Orientation -> m ()
- constructGesturePanOrientation :: IsGesturePan o => Orientation -> IO (GValueConstruct o)
- getGesturePanOrientation :: (MonadIO m, IsGesturePan o) => o -> m Orientation
- setGesturePanOrientation :: (MonadIO m, IsGesturePan o) => o -> Orientation -> m ()
- type C_GesturePanPanCallback = Ptr () -> CUInt -> CDouble -> Ptr () -> IO ()
- type GesturePanPanCallback = PanDirection -> Double -> IO ()
- afterGesturePanPan :: (IsGesturePan a, MonadIO m) => a -> GesturePanPanCallback -> m SignalHandlerId
- genClosure_GesturePanPan :: GesturePanPanCallback -> IO Closure
- mk_GesturePanPanCallback :: C_GesturePanPanCallback -> IO (FunPtr C_GesturePanPanCallback)
- noGesturePanPanCallback :: Maybe GesturePanPanCallback
- onGesturePanPan :: (IsGesturePan a, MonadIO m) => a -> GesturePanPanCallback -> m SignalHandlerId
- wrap_GesturePanPanCallback :: GesturePanPanCallback -> C_GesturePanPanCallback
Exported types
newtype GesturePan Source #
Memory-managed wrapper type.
Constructors
| GesturePan (ManagedPtr GesturePan) |
Instances
| GObject GesturePan Source # | |
Defined in GI.Gtk.Objects.GesturePan Methods gobjectType :: GesturePan -> IO GType # | |
| IsObject GesturePan Source # | |
Defined in GI.Gtk.Objects.GesturePan | |
| IsEventController GesturePan Source # | |
Defined in GI.Gtk.Objects.GesturePan | |
| IsGesture GesturePan Source # | |
Defined in GI.Gtk.Objects.GesturePan | |
| IsGestureDrag GesturePan Source # | |
Defined in GI.Gtk.Objects.GesturePan | |
| IsGestureSingle GesturePan Source # | |
Defined in GI.Gtk.Objects.GesturePan | |
| IsGesturePan GesturePan Source # | |
Defined in GI.Gtk.Objects.GesturePan | |
class GObject o => IsGesturePan o Source #
Type class for types which can be safely cast to GesturePan, for instance with toGesturePan.
Instances
| (GObject a, (UnknownAncestorError GesturePan a :: Constraint)) => IsGesturePan a Source # | |
Defined in GI.Gtk.Objects.GesturePan | |
| IsGesturePan GesturePan Source # | |
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.
noGesturePan :: Maybe GesturePan Source #
A convenience alias for Nothing :: Maybe GesturePan.
Methods
getOrientation
gesturePanGetOrientation Source #
Arguments
| :: (HasCallStack, MonadIO m, IsGesturePan a) | |
| => a |
|
| -> m Orientation | Returns: the expected orientation for pan gestures |
Returns the orientation of the pan gestures that this gesture expects.
Since: 3.14
new
Arguments
| :: (HasCallStack, MonadIO m, IsWidget a) | |
| => a |
|
| -> Orientation |
|
| -> m GesturePan | Returns: a newly created |
Returns a newly created Gesture that recognizes pan gestures.
Since: 3.14
setOrientation
gesturePanSetOrientation Source #
Arguments
| :: (HasCallStack, MonadIO m, IsGesturePan a) | |
| => a |
|
| -> Orientation |
|
| -> m () |
Sets the orientation to be expected on pan gestures.
Since: 3.14
Properties
orientation
The expected orientation of pan gestures.
Since: 3.14
constructGesturePanOrientation :: IsGesturePan o => Orientation -> IO (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
setgesturePan [ #orientation:=value ]
Signals
pan
type C_GesturePanPanCallback = Ptr () -> CUInt -> CDouble -> Ptr () -> IO () Source #
Type for the callback on the (unwrapped) C side.
type GesturePanPanCallback Source #
Arguments
| = PanDirection |
|
| -> Double |
|
| -> IO () |
This signal is emitted once a panning gesture along the expected axis is detected.
Since: 3.14
afterGesturePanPan :: (IsGesturePan a, MonadIO m) => 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
genClosure_GesturePanPan :: GesturePanPanCallback -> IO Closure Source #
Wrap the callback into a Closure.
mk_GesturePanPanCallback :: C_GesturePanPanCallback -> IO (FunPtr C_GesturePanPanCallback) Source #
Generate a function pointer callable from C code, from a C_GesturePanPanCallback.
noGesturePanPanCallback :: Maybe GesturePanPanCallback Source #
A convenience synonym for .Nothing :: Maybe GesturePanPanCallback
onGesturePanPan :: (IsGesturePan a, MonadIO m) => 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