## ClutterWaylandSurface

ClutterWaylandSurface — An actor which displays the content of a client surface

## Functions

ClutterActor * | clutter_wayland_surface_new ()
gboolean | clutter_wayland_surface_attach_buffer ()
void | clutter_wayland_surface_damage_buffer ()
CoglTexture * | clutter_wayland_surface_get_cogl_texture ()
struct wl_surface * | clutter_wayland_surface_get_surface ()
void | clutter_wayland_surface_set_surface ()

## Types and Values

struct | ClutterWaylandSurface
struct | ClutterWaylandSurfaceClass

## Description

ClutterWaylandSurface is an actor for displaying the contents of a client surface. It is intended to support developers implementing Clutter based wayland compositors.

## Functions

### clutter_wayland_surface_new ()

    ClutterActor *
    clutter_wayland_surface_new (struct wl_surface *surface);

Creates a new ClutterWaylandSurface for `surface`

#### Parameters

surface | the Wayland surface this actor should represent |

#### Returns

A new ClutterWaylandSurface representing `surface`

Since: 1.8

Stability Level: Unstable

### clutter_wayland_surface_attach_buffer ()

    gboolean
    clutter_wayland_surface_attach_buffer (ClutterWaylandSurface *self,
                                           struct wl_resource *buffer,
                                           GError **error);

This associates a client's buffer with the ClutterWaylandSurface actor `self` . This will automatically result in `self` being re-drawn with the new buffer contents.

#### Parameters

self | A ClutterWaylandSurface actor |
buffer | A compositor side resource representing a wl_buffer |
error | A GError |

Since: 1.8

Stability Level: Unstable

### clutter_wayland_surface_damage_buffer ()

    void
    clutter_wayland_surface_damage_buffer (ClutterWaylandSurface *self,
                                           struct wl_resource *buffer,
                                           gint32 x,
                                           gint32 y,
                                           gint32 width,
                                           gint32 height);

This marks a region of the given `buffer` has having been changed by the client. This will automatically result in the corresponding damaged region of the actor `self` being redrawn.

If multiple regions are changed then this should be called multiple times with different damage rectangles.

#### Parameters

self | A ClutterWaylandSurface actor |
buffer | A wayland resource for a buffer |
x | The x coordinate of the damaged rectangle |
y | The y coordinate of the damaged rectangle |
width | The width of the damaged rectangle |
height | The height of the damaged rectangle |

Since: 1.8

Stability Level: Unstable

### clutter_wayland_surface_get_cogl_texture ()

    CoglTexture *
    clutter_wayland_surface_get_cogl_texture
                                   (ClutterWaylandSurface *self);

Retrieves the Cogl texture with the contents of the Wayland surface.

#### Parameters

self | a ClutterWaylandSurface |

#### Returns

a Cogl texture, or `NULL`.

[transfer none]

Since: 1.10

### clutter_wayland_surface_get_surface ()

    struct wl_surface *
    clutter_wayland_surface_get_surface (ClutterWaylandSurface *self);

Retrieves a point to the Wayland surface used by the actor.

#### Parameters

self | a ClutterWaylandSurface |

#### Returns

a wl_surface pointer, or `NULL`.

[transfer none]

Since: 1.10

### clutter_wayland_surface_set_surface ()

    void
    clutter_wayland_surface_set_surface (ClutterWaylandSurface *self,
                                         struct wl_surface *surface);

Sets the Wayland surface to be used by the actor.

#### Parameters

self | a ClutterWaylandSurface |
surface | a Wayland wl_surface pointer |

Since: 1.10

## Types and Values

### struct ClutterWaylandSurface

    struct ClutterWaylandSurface {
    };

The ClutterWaylandSurface structure contains only private data

Since: 1.10

Stability Level: Unstable

### struct ClutterWaylandSurfaceClass

    struct ClutterWaylandSurfaceClass {
      void (*queue_damage_redraw) (ClutterWaylandSurface *texture,
                                   gint x,
                                   gint y,
                                   gint width,
                                   gint height);
    };

The ClutterWaylandSurfaceClass structure contains only private data

#### Members

`queue_damage_redraw` () | class handler of the “queue-damage-redraw” signal |

Since: 1.10

Stability Level: Unstable