gi-gtk-3.0.43: Gtk bindings

Copyright | Will Thompson and Iñaki García Etxebarria
License | LGPL-2.1
Maintainer | Iñaki García Etxebarria
Safe Haskell | None
Language | Haskell2010

GI.Gtk.Objects.GestureZoom

Contents

- Exported types
- Methods
  - getScaleDelta
  - new
- Signals
  - scaleChanged

Description

`GestureZoom` is a `Gesture` implementation able to recognize pinch/zoom gestures, whenever the distance between both tracked sequences changes, the GestureZoom::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 GestureZoomScaleChangedCallback = Double -> IO ()
- afterGestureZoomScaleChanged :: (IsGestureZoom a, MonadIO m) => a -> ((?self :: a) => GestureZoomScaleChangedCallback) -> m SignalHandlerId
- onGestureZoomScaleChanged :: (IsGestureZoom a, MonadIO m) => a -> ((?self :: a) => GestureZoomScaleChangedCallback) -> m SignalHandlerId

# Exported types

newtype GestureZoom Source #

Memory-managed wrapper type.

Constructors

GestureZoom (ManagedPtr GestureZoom) |

#### Instances

Instances details

Eq GestureZoom Source # |
Instance details Defined in GI.Gtk.Objects.GestureZoom Methods (==) :: GestureZoom -> GestureZoom -> Bool Source # (/=) :: GestureZoom -> GestureZoom -> Bool Source #
GObject GestureZoom Source # |
Instance details Defined in GI.Gtk.Objects.GestureZoom
ManagedPtrNewtype GestureZoom Source # |
Instance details Defined in GI.Gtk.Objects.GestureZoom Methods toManagedPtr :: GestureZoom -> ManagedPtr GestureZoom Source #
TypedObject GestureZoom Source # |
Instance details Defined in GI.Gtk.Objects.GestureZoom Methods glibType :: IO GType Source #
HasParentTypes GestureZoom Source # |
Instance details Defined in GI.Gtk.Objects.GestureZoom
IsGValue (Maybe GestureZoom) Source # | Convert `GestureZoom` to and from `GValue`. See `toGValue` and `fromGValue`.
Instance details Defined in GI.Gtk.Objects.GestureZoom Methods gvalueGType_ :: IO GType Source # gvalueSet_ :: Ptr GValue -> Maybe GestureZoom -> IO () Source # gvalueGet_ :: Ptr GValue -> IO (Maybe GestureZoom) Source #
type ParentTypes GestureZoom Source # |
Instance details Defined in GI.Gtk.Objects.GestureZoom type ParentTypes GestureZoom = '[Gesture, EventController, Object]

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

Instances details

(GObject o, IsDescendantOf GestureZoom o) => IsGestureZoom o Source # |
Instance details 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

### Click to display all available methods, including inherited ones

Expand

#### Methods

bindProperty, bindPropertyFull, forceFloating, freezeNotify, getv, group, handleEvent, handlesSequence, isActive, isFloating, isGroupedWith, isRecognized, notify, notifyByPspec, ref, refSink, reset, runDispose, stealData, stealQdata, thawNotify, ungroup, unref, watchClosure.

#### Getters

getBoundingBox, getBoundingBoxCenter, getData, getDevice, getGroup, getLastEvent, getLastUpdatedSequence, getPoint, getPropagationPhase, getProperty, getQdata, getScaleDelta, getSequenceState, getSequences, getWidget, getWindow.

#### Setters

setData, setDataFull, setPropagationPhase, setProperty, setSequenceState, setState, setWindow.

## getScaleDelta

gestureZoomGetScaleDelta Source #

Arguments

:: (HasCallStack, MonadIO m, IsGestureZoom a) |
=> a | `gesture`: a `GestureZoom`
-> 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

gestureZoomNew Source #

Arguments

:: (HasCallStack, MonadIO m, IsWidget a) |
=> a | `widget`: a `Widget`
-> m GestureZoom | Returns: a newly created `GestureZoom`

Returns a newly created `Gesture` that recognizes zoom in/out gestures (usually known as pinch/zoom).

Since: 3.14

# Signals

## scaleChanged

type GestureZoomScaleChangedCallback Source #

Arguments

= Double | `scale`: Scale delta, taking the initial state as 1:1
-> IO () |

This signal is emitted whenever the distance between both tracked sequences changes.

Since: 3.14

afterGestureZoomScaleChanged :: (IsGestureZoom a, MonadIO m) => a -> ((?self :: 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

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.

onGestureZoomScaleChanged :: (IsGestureZoom a, MonadIO m) => a -> ((?self :: 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