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.CairoTexturestruct contains only private data.New in version 1.0.
Deprecated since version 1.12: Use
Clutter.Canvasinstead- classmethod new(width, height)¶
- Parameters:
- Returns:
the newly created
Clutter.CairoTextureactor- Return type:
Creates a new
Clutter.CairoTextureactor, with a surface of width by height pixels.New in version 1.0.
Deprecated since version 1.12: Use
Clutter.Canvasinstead
- clear()¶
Clears self's internal drawing surface, so that the next upload will replace the previous contents of the
Clutter.CairoTexturerather than adding to it.Calling this function from within a
Clutter.CairoTexture::drawsignal handler will clear the invalidated area.New in version 1.0.
Deprecated since version 1.12: Use
Clutter.Canvasinstead
- 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::paintsignal.New in version 1.0.
Deprecated since version 1.8: Use the
Clutter.CairoTexture::drawsignal 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::paintsignal.New in version 1.0.
Deprecated since version 1.8: Use the
Clutter.CairoTexture::drawsignal andClutter.CairoTexture.invalidate_rectangle() to obtain a clipped Cairo context for 2D drawing.
- get_auto_resize()¶
- Returns:
Trueif theClutter.CairoTextureshould track the allocation, andFalseotherwise- Return type:
Retrieves the value set using
Clutter.CairoTexture.set_auto_resize().New in version 1.8.
Deprecated since version 1.12: Use
Clutter.Canvasinstead
- 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.Canvasinstead
- invalidate()¶
Invalidates the whole surface of a
Clutter.CairoTexture.This function will cause the
Clutter.CairoTexture::drawsignal to be emitted.See also:
Clutter.CairoTexture.invalidate_rectangle()New in version 1.8.
Deprecated since version 1.12: Use
Clutter.Canvasinstead
- invalidate_rectangle(rect)¶
- Parameters:
rect (
cairo.RectangleIntorNone) – a rectangle with the area to invalida, orNoneto perform an unbounded invalidation
Invalidates a rectangular region of a
Clutter.CairoTexture.The invalidation will cause the
Clutter.CairoTexture::drawsignal to be emitted.See also:
Clutter.CairoTexture.invalidate()New in version 1.8.
Deprecated since version 1.12: Use
Clutter.Canvasinstead
- set_auto_resize(value)¶
- Parameters:
value (
bool) –Trueif theClutter.CairoTextureshould bind the surface size to the allocation
Sets whether the
Clutter.CairoTextureshould ensure that the backing Cairo surface used matches the allocation assigned to the actor. If the allocation changes, the contents of theClutter.CairoTexturewill also be invalidated automatically.New in version 1.8.
Deprecated since version 1.12: Use
Clutter.Canvasinstead
- 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.Canvasinstead
- do_create_surface(width, height) virtual¶
- Parameters:
- Return type:
class handler for the
Clutter.CairoTexture::create-surfacesignal
- do_draw(cr) virtual¶
- Parameters:
cr (
cairo.Context) –- Return type:
class handler for the
Clutter.CairoTexture::drawsignal
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.Surfacefor the texture- Return type:
The
::create-surfacesignal is emitted when aClutter.CairoTexturenews 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:
Trueif the signal emission should stop, andFalseto continue- Return type:
The
::drawsignal is emitted each time aClutter.CairoTexturehas 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.CairoTextureshould automatically resize the Cairo surface whenever the actor’s allocation changes. If:auto-resizeis set toTruethe 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.CairoTextureactor, 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.CairoTextureactor, in pixels.New in version 1.0.
Deprecated since version 1.12.