glonkers/wayland.h

48 lines
1.1 KiB
C

#include <EGL/egl.h>
#include <wayland-egl.h>
#include "xdg-shell-protocol.h"
#include "wlr-layer-shell-unstable-v1-protocol.h"
/// A normal window
#define OUTPUT_WINDOW 0
/// A desktop layer (wallpaper)
#define OUTPUT_LAYER 1
struct surface {
struct wl_surface *wl_surface;
struct xdg_surface *xdg_surface;
struct xdg_toplevel *xdg_toplevel;
struct wl_egl_window *egl_window;
struct zwlr_layer_surface_v1 *zwlr_layer_surface_v1;
struct wl_output *wl_output;
EGLSurface egl_surface;
};
struct surface_list {
struct surface data;
struct surface_list *next;
};
struct client_state {
// TODO: move this to surface
int width, height;
int running;
int output_type;
/* Globals */
struct wl_display *wl_display;
struct wl_registry *wl_registry;
struct wl_compositor *wl_compositor;
struct xdg_wm_base *xdg_wm_base;
struct zwlr_layer_shell_v1 *zwlr_layer_shell_v1;
struct surface_list *surface_list;
EGLDisplay egl_display;
EGLConfig egl_config;
EGLContext egl_context;
};
void wayland_init(struct client_state *state, int output_type);
void commit(struct client_state *state);