Clutter.Canvas¶
- Subclasses:
None
Methods¶
- Inherited:
- Structs:
class |
|
|
|
|
Virtual Methods¶
- Inherited:
|
Properties¶
Name |
Type |
Flags |
Short Description |
---|---|---|---|
r/w |
The height of the canvas |
||
r/w |
The scaling factor for the surface |
||
r |
Whether the scale-factor property is set |
||
r/w |
The width of the canvas |
Signals¶
- Inherited:
Name |
Short Description |
---|---|
The |
Fields¶
- Inherited:
Name |
Type |
Access |
Description |
---|---|---|---|
parent_instance |
r |
Class Details¶
- class Clutter.Canvas(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
The
Clutter.Canvas
structure contains private data and should only be accessed using the provided API.New in version 1.10.
- classmethod new()¶
- Returns:
The newly allocated instance of
Clutter.Canvas
. UseGObject.Object.unref
() when done.- Return type:
Creates a new instance of
Clutter.Canvas
.You should call
Clutter.Canvas.set_size
() to set the size of the canvas.You should call
Clutter.Content.invalidate
() every time you wish to draw the contents of the canvas.New in version 1.10.
- get_scale_factor()¶
- Returns:
the scaling factor, or -1 if the self uses the default from
Clutter.Settings
- Return type:
Retrieves the scaling factor of self, as set using
Clutter.Canvas.set_scale_factor
().New in version 1.18.
- set_scale_factor(scale)¶
- Parameters:
scale (
int
) – the scale factor, or -1 for the default
Sets the scaling factor for the Cairo surface used by self.
This function should rarely be used.
The default scaling factor of a
Clutter.Canvas
content uses theClutter.Settings
:window-scaling-factor
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 self.
New in version 1.18.
- set_size(width, height)¶
- Parameters:
- Returns:
this function returns
True
if the size change caused a content invalidation, andFalse
otherwise- Return type:
Sets the size of the self, and invalidates the content.
This function will cause the self to be invalidated only if the size of the canvas surface has changed.
If you want to invalidate the contents of the self when setting the size, you can use the return value of the function to conditionally call
Clutter.Content.invalidate
():if (!clutter_canvas_set_size (canvas, width, height)) clutter_content_invalidate (CLUTTER_CONTENT (canvas));
New in version 1.10.
- do_draw(cr, width, height) virtual¶
- Parameters:
cr (
cairo.Context
) –width (
int
) –height (
int
) –
- Return type:
Signal Details¶
- Clutter.Canvas.signals.draw(canvas, cr, width, height)¶
- Signal Name:
draw
- Flags:
- Parameters:
canvas (
Clutter.Canvas
) – The object which received the signalcr (
cairo.Context
) – the Cairo context used to drawwidth (
int
) – the width of the canvasheight (
int
) – the height of the canvas
- Returns:
True
if the signal emission should stop, andFalse
otherwise- Return type:
The
Clutter.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.Context.save
() andcairo.Context.restore
() pairs.New in version 1.10.
Property Details¶
- Clutter.Canvas.props.height¶
-
The height of the canvas.
New in version 1.10.
- Clutter.Canvas.props.scale_factor¶
-
The scaling factor to be applied to the Cairo surface used for drawing.
If
Clutter.Canvas
:scale-factor
is set to a negative value, the value of theClutter.Settings
:window-scaling-factor
property is used instead.Use
Clutter.Canvas
:scale-factor-set
to check if the scale factor is set.New in version 1.18.
- Clutter.Canvas.props.scale_factor_set¶
-
Whether the
Clutter.Canvas
:scale-factor
property is set.If the
Clutter.Canvas
:scale-factor-set
property isFalse
thenClutter.Canvas
will use theClutter.Settings
:window-scaling-factor
property.New in version 1.18.