Clutter.CairoTexture¶
- Subclasses:
None
Methods¶
- Inherited:
Clutter.Texture (28), Clutter.Actor (238), GObject.Object (37), Clutter.Animatable (5), Clutter.Container (17), Clutter.Scriptable (4)
- Structs:
class |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
Clutter.Texture (3), Clutter.Actor (35), GObject.Object (7), Clutter.Animatable (5), Clutter.Container (13), Clutter.Scriptable (4)
|
|
|
Properties¶
- Inherited:
Name |
Type |
Flags |
Short Description |
---|---|---|---|
d/r/w |
Whether the surface should match the allocation |
||
d/r/w |
The height of the Cairo surface |
||
d/r/w |
The width of the Cairo surface |
Signals¶
Name |
Short Description |
---|---|
The |
|
The |
Fields¶
Name |
Type |
Access |
Description |
---|---|---|---|
parent_instance |
r |
Class Details¶
- class Clutter.CairoTexture(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
The
Clutter.CairoTexture
struct contains only private data.New in version 1.0.
Deprecated since version 1.12: Use
Clutter.Canvas
instead- classmethod new(width, height)¶
- Parameters:
- Returns:
the newly created
Clutter.CairoTexture
actor- Return type:
Creates a new
Clutter.CairoTexture
actor, with a surface of width by height pixels.New in version 1.0.
Deprecated since version 1.12: Use
Clutter.Canvas
instead
- clear()¶
Clears self's internal drawing surface, so that the next upload will replace the previous contents of the
Clutter.CairoTexture
rather than adding to it.Calling this function from within a
Clutter.CairoTexture
::draw
signal handler will clear the invalidated area.New in version 1.0.
Deprecated since version 1.12: Use
Clutter.Canvas
instead
- create()¶
- Returns:
a newly created Cairo context. Use cairo_destroy() to upload the contents of the context when done drawing
- Return type:
Creates a new Cairo context for the cairo texture. It is similar to using
Clutter.CairoTexture.create_region
() with x_offset and y_offset of 0, width equal to the cairo texture surface width and height equal to the cairo texture surface height.Do not call this function within the paint virtual function or from a callback to the
Clutter.Actor
::paint
signal.New in version 1.0.
Deprecated since version 1.8: Use the
Clutter.CairoTexture
::draw
signal and theClutter.CairoTexture.invalidate
() function to obtain a Cairo context for 2D drawing.
- create_region(x_offset, y_offset, width, height)¶
- Parameters:
- Returns:
a newly created Cairo context. Use cairo_destroy() to upload the contents of the context when done drawing
- Return type:
Creates a new Cairo context that will updat the region defined by x_offset, y_offset, width and height.
Do not call this function within the paint virtual function or from a callback to the
Clutter.Actor
::paint
signal.New in version 1.0.
Deprecated since version 1.8: Use the
Clutter.CairoTexture
::draw
signal andClutter.CairoTexture.invalidate_rectangle
() to obtain a clipped Cairo context for 2D drawing.
- get_auto_resize()¶
- Returns:
True
if theClutter.CairoTexture
should track the allocation, andFalse
otherwise- Return type:
Retrieves the value set using
Clutter.CairoTexture.set_auto_resize
().New in version 1.8.
Deprecated since version 1.12: Use
Clutter.Canvas
instead
- get_surface_size()¶
- Returns:
- Return type:
Retrieves the surface width and height for self.
New in version 1.0.
Deprecated since version 1.12: Use
Clutter.Canvas
instead
- invalidate()¶
Invalidates the whole surface of a
Clutter.CairoTexture
.This function will cause the
Clutter.CairoTexture
::draw
signal to be emitted.See also:
Clutter.CairoTexture.invalidate_rectangle
()New in version 1.8.
Deprecated since version 1.12: Use
Clutter.Canvas
instead
- invalidate_rectangle(rect)¶
- Parameters:
rect (
cairo.RectangleInt
orNone
) – a rectangle with the area to invalida, orNone
to perform an unbounded invalidation
Invalidates a rectangular region of a
Clutter.CairoTexture
.The invalidation will cause the
Clutter.CairoTexture
::draw
signal to be emitted.See also:
Clutter.CairoTexture.invalidate
()New in version 1.8.
Deprecated since version 1.12: Use
Clutter.Canvas
instead
- set_auto_resize(value)¶
- Parameters:
value (
bool
) –True
if theClutter.CairoTexture
should bind the surface size to the allocation
Sets whether the
Clutter.CairoTexture
should ensure that the backing Cairo surface used matches the allocation assigned to the actor. If the allocation changes, the contents of theClutter.CairoTexture
will also be invalidated automatically.New in version 1.8.
Deprecated since version 1.12: Use
Clutter.Canvas
instead
- set_surface_size(width, height)¶
-
Resizes the Cairo surface used by self to width and height.
This function will not invalidate the contents of the Cairo texture: you will have to explicitly call either
Clutter.CairoTexture.invalidate_rectangle
() orClutter.CairoTexture.invalidate
().New in version 1.0.
Deprecated since version 1.12: Use
Clutter.Canvas
instead
- do_create_surface(width, height) virtual¶
- Parameters:
- Return type:
- do_draw(cr) virtual¶
- Parameters:
cr (
cairo.Context
) –- Return type:
Signal Details¶
- Clutter.CairoTexture.signals.create_surface(cairo_texture, width, height)¶
- Signal Name:
create-surface
- Flags:
- Parameters:
cairo_texture (
Clutter.CairoTexture
) – The object which received the signalwidth (
int
) – the width of the surface to createheight (
int
) – the height of the surface to create
- Returns:
the newly created
cairo.Surface
for the texture- Return type:
The
::create-surface
signal is emitted when aClutter.CairoTexture
news its surface (re)created, which happens either when the Cairo context is created withClutter.CairoTexture.create
() orClutter.CairoTexture.create_region
(), or when the surface is resized throughClutter.CairoTexture.set_surface_size
().The first signal handler that returns a non-
None
, valid surface will stop any further signal emission, and the returned surface will be the one used.New in version 1.6.
Deprecated since version 1.12.
- Clutter.CairoTexture.signals.draw(cairo_texture, cr)¶
- Signal Name:
draw
- Flags:
- Parameters:
cairo_texture (
Clutter.CairoTexture
) – The object which received the signalcr (
cairo.Context
) – the Cairo context to use to draw
- Returns:
True
if the signal emission should stop, andFalse
to continue- Return type:
The
::draw
signal is emitted each time aClutter.CairoTexture
has been invalidated.The passed Cairo context passed will be clipped to the invalidated area.
It is safe to connect multiple callbacks to this signals; the state of the Cairo context passed to each callback is automatically saved and restored, so it’s not necessary to call
cairo.Context.save
() andcairo.Context.restore
().New in version 1.8.
Deprecated since version 1.12.
Property Details¶
- Clutter.CairoTexture.props.auto_resize¶
- Name:
auto-resize
- Type:
- Default Value:
- Flags:
Controls whether the
Clutter.CairoTexture
should automatically resize the Cairo surface whenever the actor’s allocation changes. If:auto-resize
is set toTrue
the surface contents will also be invalidated automatically.New in version 1.8.
Deprecated since version 1.12.
- Clutter.CairoTexture.props.surface_height¶
- Name:
surface-height
- Type:
- Default Value:
0
- Flags:
The height of the Cairo surface used by the
Clutter.CairoTexture
actor, in pixels.New in version 1.0.
Deprecated since version 1.12.
- Clutter.CairoTexture.props.surface_width¶
- Name:
surface-width
- Type:
- Default Value:
0
- Flags:
The width of the Cairo surface used by the
Clutter.CairoTexture
actor, in pixels.New in version 1.0.
Deprecated since version 1.12.