56 lines
1.1 KiB
C
56 lines
1.1 KiB
C
#pragma once
|
|
|
|
#include <wayland-client.h>
|
|
#include "../WAYLAND/xdg-shell.h"
|
|
|
|
typedef struct {
|
|
struct wl_compositor *compositor;
|
|
struct wl_subcompositor *subcompositor;
|
|
struct xdg_wm_base *xdg_wm_base;
|
|
struct wl_output *output;
|
|
} surface_builders;
|
|
|
|
typedef struct {
|
|
struct wl_display *display;
|
|
struct wl_registry *registry;
|
|
surface_builders *builders;
|
|
} wl_context;
|
|
|
|
#define GLUT_SCREEN_WIDTH 0
|
|
#define GLUT_SCREEN_HEIGHT 1
|
|
|
|
void global_registry(
|
|
void *data,
|
|
struct wl_registry *wl_registry,
|
|
uint32_t name,
|
|
const char *interface,
|
|
uint32_t version
|
|
);
|
|
|
|
void global_remove(
|
|
void *data,
|
|
struct wl_registry *wl_registry,
|
|
uint32_t name
|
|
);
|
|
|
|
|
|
/*
|
|
the only event dispatched by the WM is the "ping" one
|
|
emitted periodically to check if clients are still alive
|
|
|
|
calls
|
|
xdg_wm_base_pong
|
|
to inform the server that the client is alive and responsive
|
|
*/
|
|
void wm_ping(
|
|
void *data,
|
|
struct xdg_wm_base *xdg_wm_base,
|
|
uint32_t serial);
|
|
|
|
|
|
|
|
/* connects to the default display and initializes basic wayland resources */
|
|
wl_context* wl_context_new();
|
|
|
|
int wl_context_get( int query);
|