The wl_display interface

The core global object. This is a special singleton object. It is used for internal Wayland protocol features. More...

## Data Structures

struct | wl_display_listener

## Macros

#define | WL_DISPLAY_ERROR_SINCE_VERSION 1
#define | WL_DISPLAY_DELETE_ID_SINCE_VERSION 1
#define | WL_DISPLAY_SYNC_SINCE_VERSION 1
#define | WL_DISPLAY_GET_REGISTRY_SINCE_VERSION 1

## Enumerations

enum | wl_display_error { WL_DISPLAY_ERROR_INVALID_OBJECT = 0, WL_DISPLAY_ERROR_INVALID_METHOD = 1, WL_DISPLAY_ERROR_NO_MEMORY = 2 }

## Functions

static int | wl_display_add_listener (struct wl_display *wl_display, const struct wl_display_listener *listener, void *data)
static void | wl_display_set_user_data (struct wl_display *wl_display, void *user_data)
static void * | wl_display_get_user_data (struct wl_display *wl_display)
static struct wl_callback * | wl_display_sync (struct wl_display *wl_display)
static struct wl_registry * | wl_display_get_registry (struct wl_display *wl_display)

## Detailed Description

The core global object. This is a special singleton object. It is used for internal Wayland protocol features.

## Macro Definition Documentation

## WL_DISPLAY_DELETE_ID_SINCE_VERSION

#define WL_DISPLAY_DELETE_ID_SINCE_VERSION 1

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

## WL_DISPLAY_ERROR_SINCE_VERSION

#define WL_DISPLAY_ERROR_SINCE_VERSION 1

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

## WL_DISPLAY_GET_REGISTRY_SINCE_VERSION

#define WL_DISPLAY_GET_REGISTRY_SINCE_VERSION 1

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

## WL_DISPLAY_SYNC_SINCE_VERSION

#define WL_DISPLAY_SYNC_SINCE_VERSION 1

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

## Enumeration Type Documentation

## wl_display_error

enum wl_display_error

global error values

These errors are global and can be emitted in response to any server request.

Enumerator
WL_DISPLAY_ERROR_INVALID_OBJECT | server couldn't find object
WL_DISPLAY_ERROR_INVALID_METHOD | method doesn't exist on the specified interface
WL_DISPLAY_ERROR_NO_MEMORY | server is out of memory

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

{
/**
* server couldn't find object
*/
WL_DISPLAY_ERROR_INVALID_OBJECT = 0,
/**
* method doesn't exist on the specified interface
*/
WL_DISPLAY_ERROR_INVALID_METHOD = 1,
/**
* server is out of memory
*/
WL_DISPLAY_ERROR_NO_MEMORY = 2,
};

## Function Documentation

## wl_display_add_listener()

static int wl_display_add_listener | ( | struct wl_display * | wl_display,
|  | const struct wl_display_listener * | listener,
|  | void * | data
| ) |  |

inline static

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

{
return wl_proxy_add_listener((struct wl_proxy *) wl_display,
(void (**)(void)) listener, data);
}

## wl_display_get_registry()

static struct wl_registry* wl_display_get_registry | ( | struct wl_display * | wl_display | ) |

inline static

This request creates a registry object that allows the client to list and bind the global objects available from the compositor.

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

{
struct wl_proxy *registry;
registry = wl_proxy_marshal_constructor((struct wl_proxy *) wl_display,
WL_DISPLAY_GET_REGISTRY, &wl_registry_interface, NULL);
return (struct wl_registry *) registry;
}

References NULL, WL_DISPLAY_GET_REGISTRY, and wl_registry_interface.

## wl_display_get_user_data()

static void* wl_display_get_user_data | ( | struct wl_display * | wl_display | ) |

inline static

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

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

## wl_display_set_user_data()

static void wl_display_set_user_data | ( | struct wl_display * | wl_display,
|  | void * | user_data
| ) |  |

inline static

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

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

## wl_display_sync()

static struct wl_callback* wl_display_sync | ( | struct wl_display * | wl_display | ) |

inline static

The sync request asks the server to emit the 'done' event on the returned wl_callback object. Since requests are handled in-order and events are delivered in-order, this can be used as a barrier to ensure all previous requests and the resulting events have been handled.

The object returned by this request will be destroyed by the compositor after the callback is fired and as such the client must not attempt to use it after that point.

The callback_data passed in the callback is the event serial.

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

{
struct wl_proxy *callback;
callback = wl_proxy_marshal_constructor((struct wl_proxy *) wl_display,
WL_DISPLAY_SYNC, &wl_callback_interface, NULL);
return (struct wl_callback *) callback;
}

References callback(), NULL, wl_callback_interface, and WL_DISPLAY_SYNC.

NULL
#define NULL
Definition: begin_code.h:167
WL_DISPLAY_GET_REGISTRY
#define WL_DISPLAY_GET_REGISTRY
Definition: wayland-client-protocol.h:888
callback
static Uint32 callback(Uint32 interval, void *param)
Definition: testtimer.c:34
data
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: SDL_opengl.h:1974
WL_DISPLAY_SYNC
#define WL_DISPLAY_SYNC
Definition: wayland-client-protocol.h:887
WL_DISPLAY_ERROR_INVALID_METHOD
@ WL_DISPLAY_ERROR_INVALID_METHOD
Definition: wayland-client-protocol.h:829
WL_DISPLAY_ERROR_INVALID_OBJECT
@ WL_DISPLAY_ERROR_INVALID_OBJECT
Definition: wayland-client-protocol.h:825
WL_DISPLAY_ERROR_NO_MEMORY
@ WL_DISPLAY_ERROR_NO_MEMORY
Definition: wayland-client-protocol.h:833
wl_callback_interface
const struct wl_interface wl_callback_interface
Definition: wayland-protocol.c:184
wl_registry_interface
const struct wl_interface wl_registry_interface
Definition: wayland-protocol.c:174