gi-clutter-1.0.5: clutter GObject bindings
CopyrightWill Thompson and Iñaki García Etxebarria
LicenseLGPL-2.1
MaintainerIñaki García Etxebarria
Safe HaskellSafe-Inferred
LanguageHaskell2010

GI.Clutter.Objects.Path

Description

The Path struct contains only private data and should be accessed with the functions below.

Since: 1.0

Synopsis

Exported types

newtype Path Source #

Memory-managed wrapper type.

Constructors

Path (ManagedPtr Path) 

Instances

Instances details
Eq Path Source # 
Instance details

Defined in GI.Clutter.Objects.Path

Methods

(==) :: Path -> Path -> Bool #

(/=) :: Path -> Path -> Bool #

GObject Path Source # 
Instance details

Defined in GI.Clutter.Objects.Path

ManagedPtrNewtype Path Source # 
Instance details

Defined in GI.Clutter.Objects.Path

Methods

toManagedPtr :: Path -> ManagedPtr Path

TypedObject Path Source # 
Instance details

Defined in GI.Clutter.Objects.Path

Methods

glibType :: IO GType

HasParentTypes Path Source # 
Instance details

Defined in GI.Clutter.Objects.Path

IsGValue (Maybe Path) Source #

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

Instance details

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 # 
Instance details

Defined in GI.Clutter.Objects.Path

type ParentTypes Path = '[Object]

class (GObject o, IsDescendantOf Path o) => IsPath o Source #

Type class for types which can be safely cast to Path, for instance with toPath.

Instances

Instances details
(GObject o, IsDescendantOf Path o) => IsPath o Source # 
Instance details

Defined in GI.Clutter.Objects.Path

toPath :: (MonadIO m, IsPath o) => o -> m Path Source #

Cast to Path, for types for which this is known to be safe. For general casts, use castTo.

Methods

addCairoPath

pathAddCairoPath Source #

Arguments

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

path: a Path

-> Path

cpath: a Cairo path

-> m () 

Add the nodes of the Cairo path to the end of path.

Since: 1.0

addClose

pathAddClose Source #

Arguments

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

path: a Path

-> 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

pathAddCurveTo Source #

Arguments

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

path: a Path

-> Int32

x1: the x coordinate of the first control point

-> Int32

y1: the y coordinate of the first control point

-> Int32

x2: the x coordinate of the second control point

-> Int32

y2: the y coordinate of the second control point

-> Int32

x3: the x coordinate of the third control point

-> Int32

y3: the y coordinate of the third control point

-> 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

pathAddLineTo Source #

Arguments

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

path: a Path

-> Int32

x: the x coordinate

-> Int32

y: the y coordinate

-> 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

pathAddMoveTo Source #

Arguments

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

path: a Path

-> Int32

x: the x coordinate

-> Int32

y: the y coordinate

-> 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

pathAddNode Source #

Arguments

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

path: a Path

-> PathNode

node: a PathNode

-> m () 

Adds node to the end of the path.

Since: 1.0

addRelCurveTo

pathAddRelCurveTo Source #

Arguments

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

path: a Path

-> Int32

x1: the x coordinate of the first control point

-> Int32

y1: the y coordinate of the first control point

-> Int32

x2: the x coordinate of the second control point

-> Int32

y2: the y coordinate of the second control point

-> Int32

x3: the x coordinate of the third control point

-> Int32

y3: the y coordinate of the third control point

-> m () 

Same as pathAddCurveTo except the coordinates are relative to the previous node.

Since: 1.0

addRelLineTo

pathAddRelLineTo Source #

Arguments

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

path: a Path

-> Int32

x: the x coordinate

-> Int32

y: the y coordinate

-> m () 

Same as pathAddLineTo except the coordinates are relative to the previous node.

Since: 1.0

addRelMoveTo

pathAddRelMoveTo Source #

Arguments

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

path: a Path

-> Int32

x: the x coordinate

-> Int32

y: the y coordinate

-> m () 

Same as pathAddMoveTo except the coordinates are relative to the previous node.

Since: 1.0

addString

pathAddString Source #

Arguments

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

path: a Path

-> Text

str: a string describing the new nodes

-> m Bool

Returns: True is the path description was valid or False otherwise.

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:

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

pathClear Source #

Arguments

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

path: a Path

-> m () 

Removes all nodes from the path.

Since: 1.0

foreach

pathForeach Source #

Arguments

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

path: a Path

-> PathCallback

callback: the function to call with each node

-> m () 

Calls a function for each node of the path.

Since: 1.0

getDescription

pathGetDescription Source #

Arguments

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

path: a Path

-> m Text

Returns: a string description of the path. Free with free.

Returns a newly allocated string describing the path in the same format as used by pathAddString.

Since: 1.0

getLength

pathGetLength Source #

Arguments

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

path: a Path

-> m Word32

Returns: the length of the path.

Retrieves an approximation of the total length of the path.

Since: 1.0

getNNodes

pathGetNNodes Source #

Arguments

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

path: a Path

-> m Word32

Returns: the number of nodes.

Retrieves the number of nodes in the path.

Since: 1.0

getNode

pathGetNode Source #

Arguments

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

path: a Path

-> Word32

index_: the node number to retrieve

-> m PathNode 

Retrieves the node of the path indexed by index.

Since: 1.0

getNodes

pathGetNodes Source #

Arguments

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

path: a Path

-> m [PathNode]

Returns: a list of nodes in the path.

Returns a SList of PathNodes. The list should be freed with g_slist_free(). The nodes are owned by the path and should not be freed. Altering the path may cause the nodes in the list to become invalid so you should copy them if you want to keep the list.

Since: 1.0

getPosition

pathGetPosition Source #

Arguments

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

path: a Path

-> Double

progress: a position along the path as a fraction of its length

-> 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

pathInsertNode Source #

Arguments

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

path: a Path

-> Int32

index_: offset of where to insert the node

-> PathNode

node: the node to insert

-> 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

pathNew Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> m Path

Returns: the newly created Path

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

desc: a string describing the path

-> m Path

Returns: the newly created Path

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

pathRemoveNode Source #

Arguments

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

path: a Path

-> Word32

index_: index of the node to remove

-> m () 

Removes the node at the given offset from the path.

Since: 1.0

replaceNode

pathReplaceNode Source #

Arguments

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

path: a Path

-> Word32

index_: index to the existing node

-> PathNode

node: the replacement node

-> m () 

Replaces the node at offset index_ with node.

Since: 1.0

setDescription

pathSetDescription Source #

Arguments

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

path: a Path

-> Text

str: a string describing the path

-> m Bool

Returns: True is the path was valid, False otherwise.

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

pathToCairoPath Source #

Arguments

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

path: a Path

-> Context

cr: a Cairo 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

set path [ #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