gi-gsk-4.0.9: Gsk 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.Gsk.Objects.CairoNode

Contents

- Exported types
- Methods
  - getDrawContext
  - getSurface
  - new

Description

A render node for a Cairo surface.

Synopsis

- newtype CairoNode = CairoNode (ManagedPtr CairoNode)
- class (BoxedPtr o, TypedObject o, IsDescendantOf CairoNode o) => IsCairoNode o
- toCairoNode :: (MonadIO m, IsCairoNode o) => o -> m CairoNode
- cairoNodeGetDrawContext :: (HasCallStack, MonadIO m, IsCairoNode a) => a -> m Context
- cairoNodeGetSurface :: (HasCallStack, MonadIO m, IsCairoNode a) => a -> m Surface
- cairoNodeNew :: (HasCallStack, MonadIO m) => Rect -> m CairoNode

# Exported types

newtype CairoNode Source #

Memory-managed wrapper type.

Constructors

CairoNode (ManagedPtr CairoNode) |

#### Instances

Instances details

Eq CairoNode Source # |
Instance details Defined in GI.Gsk.Objects.CairoNode Methods (==) :: CairoNode -> CairoNode -> Bool Source # (/=) :: CairoNode -> CairoNode -> Bool Source #
BoxedPtr CairoNode Source # |
Instance details Defined in GI.Gsk.Objects.CairoNode Methods boxedPtrCopy :: CairoNode -> IO CairoNode Source # boxedPtrFree :: CairoNode -> IO () Source #
ManagedPtrNewtype CairoNode Source # |
Instance details Defined in GI.Gsk.Objects.CairoNode Methods toManagedPtr :: CairoNode -> ManagedPtr CairoNode Source #
TypedObject CairoNode Source # |
Instance details Defined in GI.Gsk.Objects.CairoNode Methods glibType :: IO GType Source #
HasParentTypes CairoNode Source # |
Instance details Defined in GI.Gsk.Objects.CairoNode
type ParentTypes CairoNode Source # |
Instance details Defined in GI.Gsk.Objects.CairoNode type ParentTypes CairoNode = '[RenderNode]

class (BoxedPtr o, TypedObject o, IsDescendantOf CairoNode o) => IsCairoNode o Source #

Type class for types which can be safely cast to `CairoNode`, for instance with `toCairoNode`.

#### Instances

Instances details

(BoxedPtr o, TypedObject o, IsDescendantOf CairoNode o) => IsCairoNode o Source # |
Instance details Defined in GI.Gsk.Objects.CairoNode

toCairoNode :: (MonadIO m, IsCairoNode o) => o -> m CairoNode Source #

Cast to `CairoNode`, 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

draw, ref, serialize, unref, writeToFile.

#### Getters

getBounds, getChildren, getDrawContext, getNodeType, getOpaqueRect, getSurface.

#### Setters

None.

## getDrawContext

cairoNodeGetDrawContext Source #

Arguments

:: (HasCallStack, MonadIO m, IsCairoNode a) |
=> a | `node`: a `GskRenderNode` for a Cairo surface
-> m Context | Returns: a Cairo context used for drawing; use `cairo_destroy()` when done drawing

Creates a Cairo context for drawing using the surface associated to the render node.

If no surface exists yet, a surface will be created optimized for rendering to `renderer`.

## getSurface

cairoNodeGetSurface Source #

Arguments

:: (HasCallStack, MonadIO m, IsCairoNode a) |
=> a | `node`: a `GskRenderNode` for a Cairo surface
-> m Surface | Returns: a Cairo surface

Retrieves the Cairo surface used by the render node.

## new

cairoNodeNew Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> Rect | `bounds`: the rectangle to render to
-> m CairoNode | Returns: A new `GskRenderNode`

Creates a `GskRenderNode` that will render a cairo surface into the area given by `bounds`.

You can draw to the cairo surface using `cairoNodeGetDrawContext`.