The xdg_wm_base interface

The xdg_wm_base interface is exposed as a global object enabling clients to turn their wl_surfaces into windows in a desktop environment. It defines the basic functionality needed for clients and the compositor to create windows that can be dragged, resized, maximized, etc, as well as creating transient windows such as popup menus. More...

## Data Structures

struct | xdg_wm_base_listener

## Macros

#define | XDG_WM_BASE_PING_SINCE_VERSION 1
#define | XDG_WM_BASE_DESTROY_SINCE_VERSION 1
#define | XDG_WM_BASE_CREATE_POSITIONER_SINCE_VERSION 1
#define | XDG_WM_BASE_GET_XDG_SURFACE_SINCE_VERSION 1
#define | XDG_WM_BASE_PONG_SINCE_VERSION 1

## Functions

static int | xdg_wm_base_add_listener (struct xdg_wm_base *xdg_wm_base, const struct xdg_wm_base_listener *listener, void *data)
static void | xdg_wm_base_set_user_data (struct xdg_wm_base *xdg_wm_base, void *user_data)
static void * | xdg_wm_base_get_user_data (struct xdg_wm_base *xdg_wm_base)
static void | xdg_wm_base_destroy (struct xdg_wm_base *xdg_wm_base)
static struct xdg_positioner * | xdg_wm_base_create_positioner (struct xdg_wm_base *xdg_wm_base)
static struct xdg_surface * | xdg_wm_base_get_xdg_surface (struct xdg_wm_base *xdg_wm_base, struct wl_surface *surface)
static void | xdg_wm_base_pong (struct xdg_wm_base *xdg_wm_base, uint32_t serial)

## Detailed Description

The xdg_wm_base interface is exposed as a global object enabling clients to turn their wl_surfaces into windows in a desktop environment. It defines the basic functionality needed for clients and the compositor to create windows that can be dragged, resized, maximized, etc, as well as creating transient windows such as popup menus.

## Macro Definition Documentation

## XDG_WM_BASE_CREATE_POSITIONER_SINCE_VERSION

#define XDG_WM_BASE_CREATE_POSITIONER_SINCE_VERSION 1

Definition at line 425 of file xdg-shell-client-protocol.h.

## XDG_WM_BASE_DESTROY_SINCE_VERSION

#define XDG_WM_BASE_DESTROY_SINCE_VERSION 1

Definition at line 421 of file xdg-shell-client-protocol.h.

## XDG_WM_BASE_GET_XDG_SURFACE_SINCE_VERSION

#define XDG_WM_BASE_GET_XDG_SURFACE_SINCE_VERSION 1

Definition at line 429 of file xdg-shell-client-protocol.h.

## XDG_WM_BASE_PING_SINCE_VERSION

#define XDG_WM_BASE_PING_SINCE_VERSION 1

Definition at line 416 of file xdg-shell-client-protocol.h.

## XDG_WM_BASE_PONG_SINCE_VERSION

#define XDG_WM_BASE_PONG_SINCE_VERSION 1

Definition at line 433 of file xdg-shell-client-protocol.h.

## Function Documentation

## xdg_wm_base_add_listener()

static int xdg_wm_base_add_listener | ( | struct xdg_wm_base * | xdg_wm_base,
|  | const struct xdg_wm_base_listener * | listener,
|  | void * | data
| ) |  |

inline static

Definition at line 401 of file xdg-shell-client-protocol.h.

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

## xdg_wm_base_create_positioner()

static struct xdg_positioner* xdg_wm_base_create_positioner | ( | struct xdg_wm_base * | xdg_wm_base | ) |

inline static

Create a positioner object. A positioner object is used to position surfaces relative to some parent surface. See the interface description and xdg_surface.get_popup for details.

Definition at line 481 of file xdg-shell-client-protocol.h.

{
struct wl_proxy *id;
id = wl_proxy_marshal_constructor((struct wl_proxy *) xdg_wm_base,
XDG_WM_BASE_CREATE_POSITIONER, &xdg_positioner_interface, NULL);
return (struct xdg_positioner *) id;
}

References NULL, xdg_positioner_interface, and XDG_WM_BASE_CREATE_POSITIONER.

## xdg_wm_base_destroy()

static void xdg_wm_base_destroy | ( | struct xdg_wm_base * | xdg_wm_base | ) |

inline static

Destroy this xdg_wm_base object.

Destroying a bound xdg_wm_base object while there are surfaces still alive created by this xdg_wm_base object instance is illegal and will result in a protocol error.

Definition at line 465 of file xdg-shell-client-protocol.h.

{
wl_proxy_marshal((struct wl_proxy *) xdg_wm_base,
XDG_WM_BASE_DESTROY);
wl_proxy_destroy((struct wl_proxy *) xdg_wm_base);
}

References XDG_WM_BASE_DESTROY.

## xdg_wm_base_get_user_data()

static void* xdg_wm_base_get_user_data | ( | struct xdg_wm_base * | xdg_wm_base | ) |

inline static

Definition at line 444 of file xdg-shell-client-protocol.h.

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

## xdg_wm_base_get_xdg_surface()

static struct xdg_surface* xdg_wm_base_get_xdg_surface | ( | struct xdg_wm_base * | xdg_wm_base,
|  | struct wl_surface * | surface
| ) |  |

inline static

This creates an xdg_surface for the given surface. While xdg_surface itself is not a role, the corresponding surface may only be assigned a role extending xdg_surface, such as xdg_toplevel or xdg_popup.

This creates an xdg_surface for the given surface. An xdg_surface is used as basis to define a role to a given surface, such as xdg_toplevel or xdg_popup. It also manages functionality shared between xdg_surface based surface roles.

See the documentation of xdg_surface for more details about what an xdg_surface is and how it is used.

Definition at line 507 of file xdg-shell-client-protocol.h.

{
struct wl_proxy *id;
id = wl_proxy_marshal_constructor((struct wl_proxy *) xdg_wm_base,
XDG_WM_BASE_GET_XDG_SURFACE, &xdg_surface_interface, NULL, surface);
return (struct xdg_surface *) id;
}

References NULL, xdg_surface_interface, and XDG_WM_BASE_GET_XDG_SURFACE.

## xdg_wm_base_pong()

static void xdg_wm_base_pong | ( | struct xdg_wm_base * | xdg_wm_base,
|  | uint32_t | serial
| ) |  |

inline static

A client must respond to a ping event with a pong request or the client may be deemed unresponsive. See xdg_wm_base.ping.

Definition at line 524 of file xdg-shell-client-protocol.h.

{
wl_proxy_marshal((struct wl_proxy *) xdg_wm_base,
XDG_WM_BASE_PONG, serial);
}

References XDG_WM_BASE_PONG.

## xdg_wm_base_set_user_data()

static void xdg_wm_base_set_user_data | ( | struct xdg_wm_base * | xdg_wm_base,
|  | void * | user_data
| ) |  |

inline static

Definition at line 437 of file xdg-shell-client-protocol.h.

{
wl_proxy_set_user_data((struct wl_proxy *) xdg_wm_base, user_data);
}
XDG_WM_BASE_GET_XDG_SURFACE
#define XDG_WM_BASE_GET_XDG_SURFACE
Definition: xdg-shell-client-protocol.h:410
xdg_positioner_interface
const struct wl_interface xdg_positioner_interface
Definition: xdg-shell-protocol.c:97
NULL
#define NULL
Definition: begin_code.h:167
surface
EGLSurface surface
Definition: eglext.h:248
data
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: SDL_opengl.h:1974
XDG_WM_BASE_CREATE_POSITIONER
#define XDG_WM_BASE_CREATE_POSITIONER
Definition: xdg-shell-client-protocol.h:409
XDG_WM_BASE_DESTROY
#define XDG_WM_BASE_DESTROY
Definition: xdg-shell-client-protocol.h:408
id
GLuint id
Definition: SDL_opengl_glext.h:528
XDG_WM_BASE_PONG
#define XDG_WM_BASE_PONG
Definition: xdg-shell-client-protocol.h:411
xdg_surface_interface
const struct wl_interface xdg_surface_interface
Definition: xdg-shell-protocol.c:115