The wl_buffer interface

## Data Structures

struct | wl_buffer_listener

## Macros

#define | WL_BUFFER_RELEASE_SINCE_VERSION 1
#define | WL_BUFFER_DESTROY_SINCE_VERSION 1

## Functions

static int | wl_buffer_add_listener (struct wl_buffer *wl_buffer, const struct wl_buffer_listener *listener, void *data)
static void | wl_buffer_set_user_data (struct wl_buffer *wl_buffer, void *user_data)
static void * | wl_buffer_get_user_data (struct wl_buffer *wl_buffer)
static void | wl_buffer_destroy (struct wl_buffer *wl_buffer)

## Detailed Description

A buffer provides the content for a wl_surface. Buffers are created through factory interfaces such as wl_drm, wl_shm or similar. It has a width and a height and can be attached to a wl_surface, but the mechanism by which a client provides and updates the contents is defined by the buffer factory interface.

## Macro Definition Documentation

## WL_BUFFER_DESTROY_SINCE_VERSION

#define WL_BUFFER_DESTROY_SINCE_VERSION 1

Definition at line 1723 of file wayland-client-protocol.h.

## WL_BUFFER_RELEASE_SINCE_VERSION

#define WL_BUFFER_RELEASE_SINCE_VERSION 1

Definition at line 1718 of file wayland-client-protocol.h.

## Function Documentation

## wl_buffer_add_listener()

static int wl_buffer_add_listener | ( | struct wl_buffer * | wl_buffer,
|  | const struct wl_buffer_listener * | listener,
|  | void * | data
| ) |  |

inline static

Definition at line 1706 of file wayland-client-protocol.h.

{
return wl_proxy_add_listener((struct wl_proxy *) wl_buffer,
(void (**)(void)) listener, data);
}
data
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: SDL_opengl.h:1974

## wl_buffer_destroy()

static void wl_buffer_destroy | ( | struct wl_buffer * | wl_buffer | ) |

inline static

Destroy a buffer. If and how you need to release the backing storage is defined by the buffer factory interface.

For possible side-effects to a surface, see wl_surface.attach.

Definition at line 1754 of file wayland-client-protocol.h.

References WL_BUFFER_DESTROY.

{
wl_proxy_marshal((struct wl_proxy *) wl_buffer,
WL_BUFFER_DESTROY);
wl_proxy_destroy((struct wl_proxy *) wl_buffer);
}
WL_BUFFER_DESTROY
#define WL_BUFFER_DESTROY
Definition: wayland-client-protocol.h:1713

## wl_buffer_get_user_data()

static void* wl_buffer_get_user_data | ( | struct wl_buffer * | wl_buffer | ) |

inline static

Definition at line 1734 of file wayland-client-protocol.h.

{
return wl_proxy_get_user_data((struct wl_proxy *) wl_buffer);
}

## wl_buffer_set_user_data()

static void wl_buffer_set_user_data | ( | struct wl_buffer * | wl_buffer,
|  | void * | user_data
| ) |  |

inline static

Definition at line 1727 of file wayland-client-protocol.h.

{
wl_proxy_set_user_data((struct wl_proxy *) wl_buffer, user_data);
}