39 lines
863 B
C
39 lines
863 B
C
#include <stdint.h>
|
|
|
|
/// A normal window
|
|
#define OUTPUT_WINDOW 0
|
|
/// A desktop layer (wallpaper)
|
|
#define OUTPUT_LAYER 1
|
|
|
|
#define DEFAULT_WIDTH 400
|
|
#define DEFAULT_HEIGHT 400
|
|
|
|
|
|
struct client_state;
|
|
|
|
struct surface;
|
|
struct surface_list;
|
|
struct client_state;
|
|
|
|
#define EVENT_NONE 0
|
|
#define EVENT_DRAW 1
|
|
#define EVENT_EXIT 2
|
|
|
|
struct event {
|
|
int type;
|
|
union {
|
|
/// EVENT_DRAW
|
|
struct {
|
|
int width, height;
|
|
uint32_t time;
|
|
struct surface *surface;
|
|
} draw;
|
|
} data;
|
|
};
|
|
|
|
/// output_list: if not NULL, only select outputs should be drawn to
|
|
struct client_state* wayland_init(int output_type, char *output_list[], int output_list_len);
|
|
void commit(struct client_state *state);
|
|
struct event wait_for_event(struct client_state *state);
|
|
void swap_buffers(struct client_state *state, struct surface *surface);
|
|
|