Copyright | Will Thompson Iñaki García Etxebarria and Jonas Platte |
---|---|
License | LGPL-2.1 |
Maintainer | Iñaki García Etxebarria |
Safe Haskell | None |
Language | Haskell2010 |
GestureZoom
is a Gesture
implementation able to recognize
pinch/zoom gestures, whenever the distance between both tracked
sequences changes, the scaleChanged signal is
emitted to report the scale factor.
Synopsis
- newtype GestureZoom = GestureZoom (ManagedPtr GestureZoom)
- class (GObject o, IsDescendantOf GestureZoom o) => IsGestureZoom o
- toGestureZoom :: (MonadIO m, IsGestureZoom o) => o -> m GestureZoom
- gestureZoomGetScaleDelta :: (HasCallStack, MonadIO m, IsGestureZoom a) => a -> m Double
- gestureZoomNew :: (HasCallStack, MonadIO m, IsWidget a) => a -> m GestureZoom
- type C_GestureZoomScaleChangedCallback = Ptr () -> CDouble -> Ptr () -> IO ()
- type GestureZoomScaleChangedCallback = Double -> IO ()
- afterGestureZoomScaleChanged :: (IsGestureZoom a, MonadIO m) => a -> GestureZoomScaleChangedCallback -> m SignalHandlerId
- genClosure_GestureZoomScaleChanged :: MonadIO m => GestureZoomScaleChangedCallback -> m (GClosure C_GestureZoomScaleChangedCallback)
- mk_GestureZoomScaleChangedCallback :: C_GestureZoomScaleChangedCallback -> IO (FunPtr C_GestureZoomScaleChangedCallback)
- noGestureZoomScaleChangedCallback :: Maybe GestureZoomScaleChangedCallback
- onGestureZoomScaleChanged :: (IsGestureZoom a, MonadIO m) => a -> GestureZoomScaleChangedCallback -> m SignalHandlerId
- wrap_GestureZoomScaleChangedCallback :: GestureZoomScaleChangedCallback -> C_GestureZoomScaleChangedCallback
Exported types
newtype GestureZoom Source #
Memory-managed wrapper type.
Instances
Eq GestureZoom Source # | |
Defined in GI.Gtk.Objects.GestureZoom (==) :: GestureZoom -> GestureZoom -> Bool # (/=) :: GestureZoom -> GestureZoom -> Bool # | |
IsGValue GestureZoom Source # | Convert |
Defined in GI.Gtk.Objects.GestureZoom toGValue :: GestureZoom -> IO GValue # fromGValue :: GValue -> IO GestureZoom # | |
ManagedPtrNewtype GestureZoom Source # | |
Defined in GI.Gtk.Objects.GestureZoom | |
TypedObject GestureZoom Source # | |
Defined in GI.Gtk.Objects.GestureZoom | |
GObject GestureZoom Source # | |
Defined in GI.Gtk.Objects.GestureZoom | |
HasParentTypes GestureZoom Source # | |
Defined in GI.Gtk.Objects.GestureZoom | |
type ParentTypes GestureZoom Source # | |
Defined in GI.Gtk.Objects.GestureZoom |
class (GObject o, IsDescendantOf GestureZoom o) => IsGestureZoom o Source #
Type class for types which can be safely cast to GestureZoom
, for instance with toGestureZoom
.
Instances
(GObject o, IsDescendantOf GestureZoom o) => IsGestureZoom o Source # | |
Defined in GI.Gtk.Objects.GestureZoom |
toGestureZoom :: (MonadIO m, IsGestureZoom o) => o -> m GestureZoom Source #
Cast to GestureZoom
, for types for which this is known to be safe. For general casts, use castTo
.
Methods
Overloaded methods
getScaleDelta
gestureZoomGetScaleDelta Source #
:: (HasCallStack, MonadIO m, IsGestureZoom a) | |
=> a |
|
-> m Double | Returns: the scale delta |
If gesture
is active, this function returns the zooming difference
since the gesture was recognized (hence the starting point is
considered 1:1). If gesture
is not active, 1 is returned.
Since: 3.14
new
:: (HasCallStack, MonadIO m, IsWidget a) | |
=> a |
|
-> m GestureZoom | Returns: a newly created |
Returns a newly created Gesture
that recognizes zoom
in/out gestures (usually known as pinch/zoom).
Since: 3.14
Signals
scaleChanged
type C_GestureZoomScaleChangedCallback = Ptr () -> CDouble -> Ptr () -> IO () Source #
Type for the callback on the (unwrapped) C side.
type GestureZoomScaleChangedCallback Source #
This signal is emitted whenever the distance between both tracked sequences changes.
Since: 3.14
afterGestureZoomScaleChanged :: (IsGestureZoom a, MonadIO m) => a -> GestureZoomScaleChangedCallback -> m SignalHandlerId Source #
Connect a signal handler for the scaleChanged signal, to be run after the default handler. When overloading is enabled, this is equivalent to
after
gestureZoom #scaleChanged callback
genClosure_GestureZoomScaleChanged :: MonadIO m => GestureZoomScaleChangedCallback -> m (GClosure C_GestureZoomScaleChangedCallback) Source #
Wrap the callback into a GClosure
.
mk_GestureZoomScaleChangedCallback :: C_GestureZoomScaleChangedCallback -> IO (FunPtr C_GestureZoomScaleChangedCallback) Source #
Generate a function pointer callable from C code, from a C_GestureZoomScaleChangedCallback
.
noGestureZoomScaleChangedCallback :: Maybe GestureZoomScaleChangedCallback Source #
A convenience synonym for
.Nothing
:: Maybe
GestureZoomScaleChangedCallback
onGestureZoomScaleChanged :: (IsGestureZoom a, MonadIO m) => a -> GestureZoomScaleChangedCallback -> m SignalHandlerId Source #
Connect a signal handler for the scaleChanged signal, to be run before the default handler. When overloading is enabled, this is equivalent to
on
gestureZoom #scaleChanged callback