| Copyright | Will Thompson and Iñaki García Etxebarria |
|---|---|
| License | LGPL-2.1 |
| Maintainer | Iñaki García Etxebarria |
| Safe Haskell | Safe-Inferred |
| Language | Haskell2010 |
GI.Clutter.Objects.Path
Contents
Description
The Path struct contains only private data and should
be accessed with the functions below.
Since: 1.0
Synopsis
- newtype Path = Path (ManagedPtr Path)
- class (GObject o, IsDescendantOf Path o) => IsPath o
- toPath :: (MonadIO m, IsPath o) => o -> m Path
- pathAddCairoPath :: (HasCallStack, MonadIO m, IsPath a) => a -> Path -> m ()
- pathAddClose :: (HasCallStack, MonadIO m, IsPath a) => a -> m ()
- pathAddCurveTo :: (HasCallStack, MonadIO m, IsPath a) => a -> Int32 -> Int32 -> Int32 -> Int32 -> Int32 -> Int32 -> m ()
- pathAddLineTo :: (HasCallStack, MonadIO m, IsPath a) => a -> Int32 -> Int32 -> m ()
- pathAddMoveTo :: (HasCallStack, MonadIO m, IsPath a) => a -> Int32 -> Int32 -> m ()
- pathAddNode :: (HasCallStack, MonadIO m, IsPath a) => a -> PathNode -> m ()
- pathAddRelCurveTo :: (HasCallStack, MonadIO m, IsPath a) => a -> Int32 -> Int32 -> Int32 -> Int32 -> Int32 -> Int32 -> m ()
- pathAddRelLineTo :: (HasCallStack, MonadIO m, IsPath a) => a -> Int32 -> Int32 -> m ()
- pathAddRelMoveTo :: (HasCallStack, MonadIO m, IsPath a) => a -> Int32 -> Int32 -> m ()
- pathAddString :: (HasCallStack, MonadIO m, IsPath a) => a -> Text -> m Bool
- pathClear :: (HasCallStack, MonadIO m, IsPath a) => a -> m ()
- pathForeach :: (HasCallStack, MonadIO m, IsPath a) => a -> PathCallback -> m ()
- pathGetDescription :: (HasCallStack, MonadIO m, IsPath a) => a -> m Text
- pathGetLength :: (HasCallStack, MonadIO m, IsPath a) => a -> m Word32
- pathGetNNodes :: (HasCallStack, MonadIO m, IsPath a) => a -> m Word32
- pathGetNode :: (HasCallStack, MonadIO m, IsPath a) => a -> Word32 -> m PathNode
- pathGetNodes :: (HasCallStack, MonadIO m, IsPath a) => a -> m [PathNode]
- pathGetPosition :: (HasCallStack, MonadIO m, IsPath a) => a -> Double -> m (Word32, Knot)
- pathInsertNode :: (HasCallStack, MonadIO m, IsPath a) => a -> Int32 -> PathNode -> m ()
- pathNew :: (HasCallStack, MonadIO m) => m Path
- pathNewWithDescription :: (HasCallStack, MonadIO m) => Text -> m Path
- pathRemoveNode :: (HasCallStack, MonadIO m, IsPath a) => a -> Word32 -> m ()
- pathReplaceNode :: (HasCallStack, MonadIO m, IsPath a) => a -> Word32 -> PathNode -> m ()
- pathSetDescription :: (HasCallStack, MonadIO m, IsPath a) => a -> Text -> m Bool
- pathToCairoPath :: (HasCallStack, MonadIO m, IsPath a) => a -> Context -> m ()
- clearPathDescription :: (MonadIO m, IsPath o) => o -> m ()
- constructPathDescription :: (IsPath o, MonadIO m) => Text -> m (GValueConstruct o)
- getPathDescription :: (MonadIO m, IsPath o) => o -> m (Maybe Text)
- setPathDescription :: (MonadIO m, IsPath o) => o -> Text -> m ()
- getPathLength :: (MonadIO m, IsPath o) => o -> m Word32
Exported types
Memory-managed wrapper type.
Instances
| Eq Path Source # | |
| GObject Path Source # | |
Defined in GI.Clutter.Objects.Path | |
| ManagedPtrNewtype Path Source # | |
Defined in GI.Clutter.Objects.Path Methods toManagedPtr :: Path -> ManagedPtr Path | |
| TypedObject Path Source # | |
Defined in GI.Clutter.Objects.Path | |
| HasParentTypes Path Source # | |
Defined in GI.Clutter.Objects.Path | |
| IsGValue (Maybe Path) Source # | Convert |
Defined in GI.Clutter.Objects.Path Methods gvalueGType_ :: IO GType gvalueSet_ :: Ptr GValue -> Maybe Path -> IO () gvalueGet_ :: Ptr GValue -> IO (Maybe Path) | |
| type ParentTypes Path Source # | |
Defined in GI.Clutter.Objects.Path type ParentTypes Path = '[Object] | |
class (GObject o, IsDescendantOf Path o) => IsPath o Source #
Instances
| (GObject o, IsDescendantOf Path o) => IsPath o Source # | |
Defined in GI.Clutter.Objects.Path | |
Methods
Click to display all available methods, including inherited ones
Methods
addCairoPath, addClose, addCurveTo, addLineTo, addMoveTo, addNode, addRelCurveTo, addRelLineTo, addRelMoveTo, addString, bindProperty, bindPropertyFull, clear, forceFloating, foreach, freezeNotify, getv, insertNode, isFloating, notify, notifyByPspec, ref, refSink, removeNode, replaceNode, runDispose, stealData, stealQdata, thawNotify, toCairoPath, unref, watchClosure.
Getters
getData, getDescription, getLength, getNNodes, getNode, getNodes, getPosition, getProperty, getQdata.
Setters
addCairoPath
Arguments
| :: (HasCallStack, MonadIO m, IsPath a) | |
| => a |
|
| -> Path |
|
| -> m () |
Add the nodes of the Cairo path to the end of path.
Since: 1.0
addClose
Arguments
| :: (HasCallStack, MonadIO m, IsPath a) | |
| => a |
|
| -> m () |
Adds a PathNodeTypeClose type node to the path. This creates a
straight line from the last node to the last PathNodeTypeMoveTo
type node.
Since: 1.0
addCurveTo
Arguments
| :: (HasCallStack, MonadIO m, IsPath a) | |
| => a |
|
| -> Int32 |
|
| -> Int32 |
|
| -> Int32 |
|
| -> Int32 |
|
| -> Int32 |
|
| -> Int32 |
|
| -> m () |
Adds a PathNodeTypeCurveTo type node to the path. This causes
the actor to follow a bezier from the last node to (x3, y3) using
(x1, y1) and (x2,y2) as control points.
Since: 1.0
addLineTo
Arguments
| :: (HasCallStack, MonadIO m, IsPath a) | |
| => a |
|
| -> Int32 |
|
| -> Int32 |
|
| -> m () |
Adds a PathNodeTypeLineTo type node to the path. This causes the
actor to move to the new coordinates in a straight line.
Since: 1.0
addMoveTo
Arguments
| :: (HasCallStack, MonadIO m, IsPath a) | |
| => a |
|
| -> Int32 |
|
| -> Int32 |
|
| -> m () |
Adds a PathNodeTypeMoveTo type node to the path. This is usually
used as the first node in a path. It can also be used in the middle
of the path to cause the actor to jump to the new coordinate.
Since: 1.0
addNode
Adds node to the end of the path.
Since: 1.0
addRelCurveTo
Arguments
| :: (HasCallStack, MonadIO m, IsPath a) | |
| => a |
|
| -> Int32 |
|
| -> Int32 |
|
| -> Int32 |
|
| -> Int32 |
|
| -> Int32 |
|
| -> Int32 |
|
| -> m () |
Same as pathAddCurveTo except the coordinates are
relative to the previous node.
Since: 1.0
addRelLineTo
Arguments
| :: (HasCallStack, MonadIO m, IsPath a) | |
| => a |
|
| -> Int32 |
|
| -> Int32 |
|
| -> m () |
Same as pathAddLineTo except the coordinates are
relative to the previous node.
Since: 1.0
addRelMoveTo
Arguments
| :: (HasCallStack, MonadIO m, IsPath a) | |
| => a |
|
| -> Int32 |
|
| -> Int32 |
|
| -> m () |
Same as pathAddMoveTo except the coordinates are
relative to the previous node.
Since: 1.0
addString
Arguments
| :: (HasCallStack, MonadIO m, IsPath a) | |
| => a |
|
| -> Text |
|
| -> m Bool | Returns: |
Adds new nodes to the end of the path as described in str. The
format is a subset of the SVG path format. Each node is represented
by a letter and is followed by zero, one or three pairs of
coordinates. The coordinates can be separated by spaces or a
comma. The types are:
M: Adds aPathNodeTypeMoveTonode. Takes one pair of coordinates.L: Adds aPathNodeTypeLineTonode. Takes one pair of coordinates.C: Adds aPathNodeTypeCurveTonode. Takes three pairs of coordinates.z: Adds aPathNodeTypeClosenode. No coordinates are needed.
The M, L and C commands can also be specified in lower case which means the coordinates are relative to the previous node.
For example, to move an actor in a 100 by 100 pixel square centered on the point 300,300 you could use the following path:
M 250,350 l 0 -100 L 350,250 l 0 100 z
If the path description isn't valid False will be returned and no
nodes will be added.
Since: 1.0
clear
Arguments
| :: (HasCallStack, MonadIO m, IsPath a) | |
| => a |
|
| -> m () |
Removes all nodes from the path.
Since: 1.0
foreach
Arguments
| :: (HasCallStack, MonadIO m, IsPath a) | |
| => a |
|
| -> PathCallback |
|
| -> m () |
Calls a function for each node of the path.
Since: 1.0
getDescription
Arguments
| :: (HasCallStack, MonadIO m, IsPath a) | |
| => a |
|
| -> m Text | Returns: a string description of the path. Free with |
Returns a newly allocated string describing the path in the same
format as used by pathAddString.
Since: 1.0
getLength
Arguments
| :: (HasCallStack, MonadIO m, IsPath a) | |
| => a |
|
| -> m Word32 | Returns: the length of the path. |
Retrieves an approximation of the total length of the path.
Since: 1.0
getNNodes
Arguments
| :: (HasCallStack, MonadIO m, IsPath a) | |
| => a |
|
| -> m Word32 | Returns: the number of nodes. |
Retrieves the number of nodes in the path.
Since: 1.0
getNode
Arguments
| :: (HasCallStack, MonadIO m, IsPath a) | |
| => a |
|
| -> Word32 |
|
| -> m PathNode |
Retrieves the node of the path indexed by index.
Since: 1.0
getNodes
Arguments
| :: (HasCallStack, MonadIO m, IsPath a) | |
| => a |
|
| -> m [PathNode] | Returns: a list of nodes in the path. |
getPosition
Arguments
| :: (HasCallStack, MonadIO m, IsPath a) | |
| => a |
|
| -> Double |
|
| -> m (Word32, Knot) | Returns: index of the node used to calculate the position. |
The value in progress represents a position along the path where
0.0 is the beginning and 1.0 is the end of the path. An
interpolated position is then stored in position.
Since: 1.0
insertNode
Arguments
| :: (HasCallStack, MonadIO m, IsPath a) | |
| => a |
|
| -> Int32 |
|
| -> PathNode |
|
| -> m () |
Inserts node into the path before the node at the given offset. If
index_ is negative it will append the node to the end of the path.
Since: 1.0
new
Arguments
| :: (HasCallStack, MonadIO m) | |
| => m Path | Returns: the newly created |
Creates a new Path instance with no nodes.
The object has a floating reference so if you add it to a
BehaviourPath then you do not need to unref it.
Since: 1.0
newWithDescription
pathNewWithDescription Source #
Arguments
| :: (HasCallStack, MonadIO m) | |
| => Text |
|
| -> m Path | Returns: the newly created |
Creates a new Path instance with the nodes described in
desc. See pathAddString for details of the format of
the string.
The object has a floating reference so if you add it to a
BehaviourPath then you do not need to unref it.
Since: 1.0
removeNode
Arguments
| :: (HasCallStack, MonadIO m, IsPath a) | |
| => a |
|
| -> Word32 |
|
| -> m () |
Removes the node at the given offset from the path.
Since: 1.0
replaceNode
Arguments
| :: (HasCallStack, MonadIO m, IsPath a) | |
| => a |
|
| -> Word32 |
|
| -> PathNode |
|
| -> m () |
Replaces the node at offset index_ with node.
Since: 1.0
setDescription
Arguments
| :: (HasCallStack, MonadIO m, IsPath a) | |
| => a |
|
| -> Text |
|
| -> m Bool |
Replaces all of the nodes in the path with nodes described by
str. See pathAddString for details of the format.
If the string is invalid then False is returned and the path is
unaltered.
Since: 1.0
toCairoPath
Arguments
| :: (HasCallStack, MonadIO m, IsPath a) | |
| => a |
|
| -> Context |
|
| -> m () |
Add the nodes of the ClutterPath to the path in the Cairo context.
Since: 1.0
Properties
description
No description available in the introspection data.
clearPathDescription :: (MonadIO m, IsPath o) => o -> m () Source #
Set the value of the “description” property to Nothing.
When overloading is enabled, this is equivalent to
clear #description
constructPathDescription :: (IsPath o, MonadIO m) => Text -> m (GValueConstruct o) Source #
Construct a GValueConstruct with valid value for the “description” property. This is rarely needed directly, but it is used by new.
getPathDescription :: (MonadIO m, IsPath o) => o -> m (Maybe Text) Source #
Get the value of the “description” property.
When overloading is enabled, this is equivalent to
get path #description
setPathDescription :: (MonadIO m, IsPath o) => o -> Text -> m () Source #
Set the value of the “description” property.
When overloading is enabled, this is equivalent to
setpath [ #description:=value ]
length
No description available in the introspection data.
getPathLength :: (MonadIO m, IsPath o) => o -> m Word32 Source #
Get the value of the “length” property.
When overloading is enabled, this is equivalent to
get path #length