# Clutter::Cairo::Texture Class Reference

Inherits Clutter::Texture.

Collaboration diagram for Clutter::Cairo::Texture:
[legend]

List of all members.

## Public Member Functions

virtual | ~Texture ()
ClutterCairoTexture* | gobj ()
| Provides access to the underlying C GObject.
const ClutterCairoTexture* | gobj () const
| Provides access to the underlying C GObject.
ClutterCairoTexture* | gobj_copy ()
| Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs.
void | 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.
void | set_surface_size (guint width, guint height)
| Resizes the Cairo surface used by self to width and height.
void | get_surface_size (guint& width, guint& height) const
| Retrieves the surface width and height for self.
Glib::RefPtr< ::Cairo::Context > | create_context ()
| Creates a new Cairo context for the cairo texture.
Glib::RefPtr< ::Cairo::Context > | create_context_region (int x_offset, int y_offset, int width, int height)
| Creates a new Cairo context that will updat the region defined by x_offset, y_offset, width and height.

## Static Public Member Functions

static Glib::RefPtr< Texture > | create (guint width, guint height)

## Protected Member Functions

| Texture (guint width, guint height)

## Related Functions

(Note that these are not member functions.)
Glib::RefPtr < Clutter::Cairo::Texture > | wrap (ClutterCairoTexture* object, bool take_copy=false)
| A Glib::wrap() method for this object.

## Constructor & Destructor Documentation

virtual Clutter::Cairo::Texture::~Texture | ( |  | ) | `[virtual]`

Reimplemented from Clutter::Texture.

Clutter::Cairo::Texture::Texture | ( | guint | width,
|  | guint | height |
| ) |  |  | `[explicit, protected]`

## Member Function Documentation

void Clutter::Cairo::Texture::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.

Since cluttermm 1.0:

static Glib::RefPtr<Texture> Clutter::Cairo::Texture::create | ( | guint | width,
|  | guint | height |
| ) |  |  | `[static]`

Glib::RefPtr< ::Cairo::Context > Clutter::Cairo::Texture::create_context | ( |  | ) |

Creates a new Cairo context for the cairo texture.

It is similar to using 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.

<warning>

Do not call this function within the paint virtual function or from a callback to the Clutter::Actor::paint signal.

</warning>

Since cluttermm 1.0:

Returns:
  A newly created Cairo context. Use cairo_destroy() to upload the contents of the context when done drawing.

Glib::RefPtr< ::Cairo::Context > Clutter::Cairo::Texture::create_context_region | ( | int | x_offset,
|  | int | y_offset,
|  | int | width,
|  | int | height |
| ) |  |  |

Creates a new Cairo context that will updat the region defined by x_offset, y_offset, width and height.

<warning>

Do not call this function within the paint virtual function or from a callback to the Clutter::Actor::paint signal.

</warning>

Since cluttermm 1.0:

Parameters:

  | x_offset | Offset of the region on the X axis.
  | y_offset | Offset of the region on the Y axis.
  | width | Width of the region, or -1 for the full surface width.
  | height | Height of the region, or -1 for the full surface height.

Returns:
  A newly created Cairo context. Use cairo_destroy() to upload the contents of the context when done drawing.

void Clutter::Cairo::Texture::get_surface_size | ( | guint & | width,
|  | guint & | height |
| ) |  |  | const

Retrieves the surface width and height for self.

Since cluttermm 1.0:

Parameters:

  | width | Return location for the surface width, or `0`.
  | height | Return location for the surface height, or `0`.

const ClutterCairoTexture* Clutter::Cairo::Texture::gobj | ( |  | ) | const`[inline]`

Provides access to the underlying C GObject.

Reimplemented from Clutter::Texture.

ClutterCairoTexture* Clutter::Cairo::Texture::gobj | ( |  | ) | `[inline]`

Provides access to the underlying C GObject.

Reimplemented from Clutter::Texture.

ClutterCairoTexture* Clutter::Cairo::Texture::gobj_copy | ( |  | ) |

Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs.

Reimplemented from Clutter::Texture.

void Clutter::Cairo::Texture::set_surface_size | ( | guint | width,
|  | guint | height |
| ) |  |  |

Resizes the Cairo surface used by self to width and height.

Since cluttermm 1.0:

Parameters:

  | width | The new width of the surface.
  | height | The new height of the surface.

## Friends And Related Function Documentation

Glib::RefPtr< Clutter::Cairo::Texture > wrap | ( | ClutterCairoTexture * | object,
|  | bool | take_copy = `false` |
| ) |  |  | `[related]`

A Glib::wrap() method for this object.

Parameters:

  | object | The C instance.
  | take_copy | False if the result should take ownership of the C instance. True if it should take a new copy or ref.

Returns:
  A C++ instance that wraps this C instance.

The documentation for this class was generated from the following file:

- cluttermm/cairo-texture.h