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

Description

The Canvas structure contains private data and should only be accessed using the provided API.

Since: 1.10

Synopsis

Exported types

newtype Canvas Source #

Memory-managed wrapper type.

Constructors

Canvas (ManagedPtr Canvas) 

Instances

Instances details
Eq Canvas Source # 
Instance details

Defined in GI.Clutter.Objects.Canvas

Methods

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

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

GObject Canvas Source # 
Instance details

Defined in GI.Clutter.Objects.Canvas

ManagedPtrNewtype Canvas Source # 
Instance details

Defined in GI.Clutter.Objects.Canvas

Methods

toManagedPtr :: Canvas -> ManagedPtr Canvas

TypedObject Canvas Source # 
Instance details

Defined in GI.Clutter.Objects.Canvas

Methods

glibType :: IO GType

HasParentTypes Canvas Source # 
Instance details

Defined in GI.Clutter.Objects.Canvas

IsGValue (Maybe Canvas) Source #

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

Instance details

Defined in GI.Clutter.Objects.Canvas

Methods

gvalueGType_ :: IO GType

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

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

type ParentTypes Canvas Source # 
Instance details

Defined in GI.Clutter.Objects.Canvas

type ParentTypes Canvas = '[Object, Content]

class (GObject o, IsDescendantOf Canvas o) => IsCanvas o Source #

Type class for types which can be safely cast to Canvas, for instance with toCanvas.

Instances

Instances details
(GObject o, IsDescendantOf Canvas o) => IsCanvas o Source # 
Instance details

Defined in GI.Clutter.Objects.Canvas

toCanvas :: (MonadIO m, IsCanvas o) => o -> m Canvas Source #

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

Methods

getScaleFactor

canvasGetScaleFactor Source #

Arguments

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

canvas: a Canvas

-> m Int32

Returns: the scaling factor, or -1 if the canvas uses the default from Settings

Retrieves the scaling factor of canvas, as set using canvasSetScaleFactor.

Since: 1.18

new

canvasNew Source #

Arguments

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

Returns: The newly allocated instance of Canvas. Use objectUnref when done.

Creates a new instance of Canvas.

You should call canvasSetSize to set the size of the canvas.

You should call contentInvalidate every time you wish to draw the contents of the canvas.

Since: 1.10

setScaleFactor

canvasSetScaleFactor Source #

Arguments

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

canvas: a Canvas

-> Int32

scale: the scale factor, or -1 for the default

-> m () 

Sets the scaling factor for the Cairo surface used by canvas.

This function should rarely be used.

The default scaling factor of a Canvas content uses the Settings:windowScalingFactor property, which is set by the windowing system. By using this function it is possible to override that setting.

Changing the scale factor will invalidate the canvas.

Since: 1.18

setSize

canvasSetSize Source #

Arguments

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

canvas: a Canvas

-> Int32

width: the width of the canvas, in pixels

-> Int32

height: the height of the canvas, in pixels

-> m Bool

Returns: this function returns True if the size change caused a content invalidation, and False otherwise

Sets the size of the canvas, and invalidates the content.

This function will cause the canvas to be invalidated only if the size of the canvas surface has changed.

If you want to invalidate the contents of the canvas when setting the size, you can use the return value of the function to conditionally call contentInvalidate:

 if (!clutter_canvas_set_size (canvas, width, height))
   clutter_content_invalidate (CLUTTER_CONTENT (canvas));

Since: 1.10

Properties

height

The height of the canvas.

Since: 1.10

constructCanvasHeight :: (IsCanvas o, MonadIO m) => Int32 -> m (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “height” property. This is rarely needed directly, but it is used by new.

getCanvasHeight :: (MonadIO m, IsCanvas o) => o -> m Int32 Source #

Get the value of the “height” property. When overloading is enabled, this is equivalent to

get canvas #height

setCanvasHeight :: (MonadIO m, IsCanvas o) => o -> Int32 -> m () Source #

Set the value of the “height” property. When overloading is enabled, this is equivalent to

set canvas [ #height := value ]

scaleFactor

The scaling factor to be applied to the Cairo surface used for drawing.

If Canvas:scaleFactor is set to a negative value, the value of the Settings:windowScalingFactor property is used instead.

Use Canvas:scaleFactorSet to check if the scale factor is set.

Since: 1.18

constructCanvasScaleFactor :: (IsCanvas o, MonadIO m) => Int32 -> m (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “scale-factor” property. This is rarely needed directly, but it is used by new.

getCanvasScaleFactor :: (MonadIO m, IsCanvas o) => o -> m Int32 Source #

Get the value of the “scale-factor” property. When overloading is enabled, this is equivalent to

get canvas #scaleFactor

setCanvasScaleFactor :: (MonadIO m, IsCanvas o) => o -> Int32 -> m () Source #

Set the value of the “scale-factor” property. When overloading is enabled, this is equivalent to

set canvas [ #scaleFactor := value ]

scaleFactorSet

Whether the Canvas:scaleFactor property is set.

If the Canvas:scaleFactorSet property is False then Canvas will use the Settings:windowScalingFactor property.

Since: 1.18

getCanvasScaleFactorSet :: (MonadIO m, IsCanvas o) => o -> m Bool Source #

Get the value of the “scale-factor-set” property. When overloading is enabled, this is equivalent to

get canvas #scaleFactorSet

width

The width of the canvas.

Since: 1.10

constructCanvasWidth :: (IsCanvas o, MonadIO m) => Int32 -> m (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “width” property. This is rarely needed directly, but it is used by new.

getCanvasWidth :: (MonadIO m, IsCanvas o) => o -> m Int32 Source #

Get the value of the “width” property. When overloading is enabled, this is equivalent to

get canvas #width

setCanvasWidth :: (MonadIO m, IsCanvas o) => o -> Int32 -> m () Source #

Set the value of the “width” property. When overloading is enabled, this is equivalent to

set canvas [ #width := value ]

Signals

draw

type CanvasDrawCallback Source #

Arguments

 = Context

cr: the Cairo context used to draw

-> Int32

width: the width of the canvas

-> Int32

height: the height of the canvas

-> IO Bool

Returns: True if the signal emission should stop, and False otherwise

The Canvas::draw signal is emitted each time a canvas is invalidated.

It is safe to connect multiple handlers to this signal: each handler invocation will be automatically protected by cairo_save() and cairo_restore() pairs.

Since: 1.10

afterCanvasDraw :: (IsCanvas a, MonadIO m) => a -> ((?self :: a) => CanvasDrawCallback) -> m SignalHandlerId Source #

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

after canvas #draw 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.

onCanvasDraw :: (IsCanvas a, MonadIO m) => a -> ((?self :: a) => CanvasDrawCallback) -> m SignalHandlerId Source #

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

on canvas #draw callback