gi-handy-1.0.4: libhandy bindings
CopyrightWill Thompson and Iñaki García Etxebarria
LicenseLGPL-2.1
MaintainerIñaki García Etxebarria
Safe HaskellSafe-Inferred
LanguageHaskell2010

GI.Handy.Interfaces.Swipeable

Description

An interface for swipeable widgets.

The HdySwipeable interface is implemented by all swipeable widgets. They can be synced using [classswipeGroup].

See [classswipeTracker] for details about implementing it.

Since: 1.0

Synopsis

Exported types

newtype Swipeable Source #

Memory-managed wrapper type.

Constructors

Swipeable (ManagedPtr Swipeable) 

Instances

Instances details
Eq Swipeable Source # 
Instance details

Defined in GI.Handy.Interfaces.Swipeable

GObject Swipeable Source # 
Instance details

Defined in GI.Handy.Interfaces.Swipeable

ManagedPtrNewtype Swipeable Source # 
Instance details

Defined in GI.Handy.Interfaces.Swipeable

Methods

toManagedPtr :: Swipeable -> ManagedPtr Swipeable

TypedObject Swipeable Source # 
Instance details

Defined in GI.Handy.Interfaces.Swipeable

Methods

glibType :: IO GType

HasParentTypes Swipeable Source # 
Instance details

Defined in GI.Handy.Interfaces.Swipeable

IsGValue (Maybe Swipeable) Source #

Convert Swipeable to and from GValue. See toGValue and fromGValue.

Instance details

Defined in GI.Handy.Interfaces.Swipeable

Methods

gvalueGType_ :: IO GType

gvalueSet_ :: Ptr GValue -> Maybe Swipeable -> IO ()

gvalueGet_ :: Ptr GValue -> IO (Maybe Swipeable)

type ParentTypes Swipeable Source # 
Instance details

Defined in GI.Handy.Interfaces.Swipeable

type ParentTypes Swipeable = '[Object, Widget]

class (GObject o, IsDescendantOf Swipeable o) => IsSwipeable o Source #

Type class for types which can be safely cast to Swipeable, for instance with toSwipeable.

Instances

Instances details
(GObject o, IsDescendantOf Swipeable o) => IsSwipeable o Source # 
Instance details

Defined in GI.Handy.Interfaces.Swipeable

toSwipeable :: (MonadIO m, IsSwipeable o) => o -> m Swipeable Source #

Cast to Swipeable, 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

activate, addAccelerator, addChild, addDeviceEvents, addEvents, addMnemonicLabel, addTickCallback, bindProperty, bindPropertyFull, canActivateAccel, childFocus, childNotify, classPath, computeExpand, constructChild, createPangoContext, createPangoLayout, customFinished, customTagEnd, customTagStart, destroy, destroyed, deviceIsShadowed, dragBegin, dragBeginWithCoordinates, dragCheckThreshold, dragDestAddImageTargets, dragDestAddTextTargets, dragDestAddUriTargets, dragDestFindTarget, dragDestGetTargetList, dragDestGetTrackMotion, dragDestSet, dragDestSetProxy, dragDestSetTargetList, dragDestSetTrackMotion, dragDestUnset, dragGetData, dragHighlight, dragSourceAddImageTargets, dragSourceAddTextTargets, dragSourceAddUriTargets, dragSourceGetTargetList, dragSourceSet, dragSourceSetIconGicon, dragSourceSetIconName, dragSourceSetIconPixbuf, dragSourceSetIconStock, dragSourceSetTargetList, dragSourceUnset, dragUnhighlight, draw, emitChildSwitched, ensureStyle, errorBell, event, forceFloating, freezeChildNotify, freezeNotify, getv, grabAdd, grabDefault, grabFocus, grabRemove, hasDefault, hasFocus, hasGrab, hasRcStyle, hasScreen, hasVisibleFocus, hide, hideOnDelete, inDestruction, initTemplate, inputShapeCombineRegion, insertActionGroup, intersect, isAncestor, isComposited, isDrawable, isFloating, isFocus, isSensitive, isToplevel, isVisible, keynavFailed, listAccelClosures, listActionPrefixes, listMnemonicLabels, map, mnemonicActivate, modifyBase, modifyBg, modifyCursor, modifyFg, modifyFont, modifyStyle, modifyText, notify, notifyByPspec, overrideBackgroundColor, overrideColor, overrideCursor, overrideFont, overrideSymbolicColor, parserFinished, path, queueAllocate, queueComputeExpand, queueDraw, queueDrawArea, queueDrawRegion, queueResize, queueResizeNoRedraw, realize, ref, refSink, regionIntersect, registerWindow, removeAccelerator, removeMnemonicLabel, removeTickCallback, renderIcon, renderIconPixbuf, reparent, resetRcStyles, resetStyle, runDispose, sendExpose, sendFocusChange, shapeCombineRegion, show, showAll, showNow, sizeAllocate, sizeAllocateWithBaseline, sizeRequest, stealData, stealQdata, styleAttach, styleGetProperty, switchChild, thawChildNotify, thawNotify, translateCoordinates, triggerTooltipQuery, unmap, unparent, unrealize, unref, unregisterWindow, unsetStateFlags, watchClosure.

Getters

getAccessible, getActionGroup, getAllocatedBaseline, getAllocatedHeight, getAllocatedSize, getAllocatedWidth, getAllocation, getAncestor, getAppPaintable, getCanDefault, getCanFocus, getCancelProgress, getChildRequisition, getChildVisible, getClip, getClipboard, getCompositeName, getData, getDeviceEnabled, getDeviceEvents, getDirection, getDisplay, getDistance, getDoubleBuffered, getEvents, getFocusOnClick, getFontMap, getFontOptions, getFrameClock, getHalign, getHasTooltip, getHasWindow, getHexpand, getHexpandSet, getInternalChild, getMapped, getMarginBottom, getMarginEnd, getMarginLeft, getMarginRight, getMarginStart, getMarginTop, getModifierMask, getModifierStyle, getName, getNoShowAll, getOpacity, getPangoContext, getParent, getParentWindow, getPath, getPointer, getPreferredHeight, getPreferredHeightAndBaselineForWidth, getPreferredHeightForWidth, getPreferredSize, getPreferredWidth, getPreferredWidthForHeight, getProgress, getProperty, getQdata, getRealized, getReceivesDefault, getRequestMode, getRequisition, getRootWindow, getScaleFactor, getScreen, getSensitive, getSettings, getSizeRequest, getSnapPoints, getState, getStateFlags, getStyle, getStyleContext, getSupportMultidevice, getSwipeArea, getSwipeTracker, getTemplateChild, getTooltipMarkup, getTooltipText, getTooltipWindow, getToplevel, getValign, getValignWithBaseline, getVexpand, getVexpandSet, getVisible, getVisual, getWindow.

Setters

setAccelPath, setAllocation, setAppPaintable, setBuildableProperty, setCanDefault, setCanFocus, setChildVisible, setClip, setCompositeName, setData, setDataFull, setDeviceEnabled, setDeviceEvents, setDirection, setDoubleBuffered, setEvents, setFocusOnClick, setFontMap, setFontOptions, setHalign, setHasTooltip, setHasWindow, setHexpand, setHexpandSet, setMapped, setMarginBottom, setMarginEnd, setMarginLeft, setMarginRight, setMarginStart, setMarginTop, setName, setNoShowAll, setOpacity, setParent, setParentWindow, setProperty, setRealized, setReceivesDefault, setRedrawOnAllocate, setSensitive, setSizeRequest, setState, setStateFlags, setStyle, setSupportMultidevice, setTooltipMarkup, setTooltipText, setTooltipWindow, setValign, setVexpand, setVexpandSet, setVisible, setVisual, setWindow.

emitChildSwitched

swipeableEmitChildSwitched Source #

Arguments

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

self: a swipeable

-> Word32

index: the index of the child to switch to

-> Int64

duration: animation duration, in milliseconds

-> m () 

Emits signalswipeable[childSwitched] signal.

This should be called when the widget switches visible child widget.

duration can be 0 if the child is switched without animation.

Since: 1.0

getCancelProgress

swipeableGetCancelProgress Source #

Arguments

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

self: a swipeable

-> m Double

Returns: the cancel progress, unitless

Gets the progress self will snap back to after the gesture is canceled.

Since: 1.0

getDistance

swipeableGetDistance Source #

Arguments

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

self: a swipeable

-> m Double

Returns: the swipe distance in pixels

Gets the swipe distance of self.

This corresponds to how many pixels 1 unit represents.

Since: 1.0

getProgress

swipeableGetProgress Source #

Arguments

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

self: a swipeable

-> m Double

Returns: the current progress, unitless

Gets the current progress of self.

Since: 1.0

getSnapPoints

swipeableGetSnapPoints Source #

Arguments

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

self: a swipeable

-> m [Double]

Returns: the snap points

Gets the snap points of self.

Each snap point represents a progress value that is considered acceptable to end the swipe on.

Since: 1.0

getSwipeArea

swipeableGetSwipeArea Source #

Arguments

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

self: a swipeable

-> NavigationDirection

navigationDirection: the direction of the swipe

-> Bool

isDrag: whether the swipe is caused by a dragging gesture

-> m Rectangle 

Gets the area self can start a swipe from for the given direction and gesture type.

This can be used to restrict swipes to only be possible from a certain area, for example, to only allow edge swipes, or to have a draggable element and ignore swipes elsewhere.

Swipe area is only considered for direct swipes (as in, not initiated by [classswipeGroup]).

If not implemented, the default implementation returns the allocation of self, allowing swipes from anywhere.

Since: 1.0

getSwipeTracker

swipeableGetSwipeTracker Source #

Arguments

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

self: a swipeable

-> m SwipeTracker

Returns: the swipe tracker

Gets the [classswipeTracker] used by this swipeable widget.

Since: 1.0

switchChild

swipeableSwitchChild Source #

Arguments

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

self: a swipeable

-> Word32

index: the index of the child to switch to

-> Int64

duration: animation duration, in milliseconds

-> m () 

Switches to child with index index.

See signalswipeable[childSwitched].

Since: 1.0

Signals

childSwitched

type SwipeableChildSwitchedCallback Source #

Arguments

 = Word32

index: the index of the child to switch to

-> Int64

duration: animation duration, in milliseconds

-> IO () 

Emitted when the widget's visible child is changed.

duration can be 0 if the child is switched without animation.

This is used by [classswipeGroup], applications should not connect to it.

Since: 1.0

afterSwipeableChildSwitched :: (IsSwipeable a, MonadIO m) => a -> ((?self :: a) => SwipeableChildSwitchedCallback) -> m SignalHandlerId Source #

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

after swipeable #childSwitched 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.

onSwipeableChildSwitched :: (IsSwipeable a, MonadIO m) => a -> ((?self :: a) => SwipeableChildSwitchedCallback) -> m SignalHandlerId Source #

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

on swipeable #childSwitched callback