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.Canvasstructure 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.Canvascontent uses theClutter.Settings:window-scaling-factorproperty, 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
Trueif the size change caused a content invalidation, andFalseotherwise- 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:
class handler for the
Clutter.Canvas::drawsignal
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:
Trueif the signal emission should stop, andFalseotherwise- Return type:
The
Clutter.Canvas::drawsignal 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-factoris set to a negative value, the value of theClutter.Settings:window-scaling-factorproperty is used instead.Use
Clutter.Canvas:scale-factor-setto check if the scale factor is set.New in version 1.18.
- Clutter.Canvas.props.scale_factor_set¶
-
Whether the
Clutter.Canvas:scale-factorproperty is set.If the
Clutter.Canvas:scale-factor-setproperty isFalsethenClutter.Canvaswill use theClutter.Settings:window-scaling-factorproperty.New in version 1.18.