made pointers in wayland.h opaque
This commit is contained in:
parent
60f8b89c2b
commit
fe19562367
3 changed files with 62 additions and 57 deletions
59
wayland.h
59
wayland.h
|
|
@ -1,9 +1,3 @@
|
|||
#include <EGL/egl.h>
|
||||
#include <wayland-egl.h>
|
||||
#include <wayland-cursor.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)
|
||||
|
|
@ -15,55 +9,9 @@
|
|||
|
||||
struct client_state;
|
||||
|
||||
struct surface {
|
||||
int width, height;
|
||||
|
||||
/// Wating to be redrawn.
|
||||
bool dirty;
|
||||
|
||||
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;
|
||||
|
||||
/// We need a back-pointer for callbacks.
|
||||
struct client_state *state;
|
||||
};
|
||||
|
||||
struct surface_list {
|
||||
struct surface data;
|
||||
struct surface_list *next;
|
||||
};
|
||||
|
||||
struct client_state {
|
||||
bool running;
|
||||
int output_type;
|
||||
/* Globals */
|
||||
struct wl_display *wl_display;
|
||||
struct wl_registry *wl_registry;
|
||||
struct wl_compositor *wl_compositor;
|
||||
struct wl_shm *wl_shm;
|
||||
struct xdg_wm_base *xdg_wm_base;
|
||||
struct zwlr_layer_shell_v1 *zwlr_layer_shell_v1;
|
||||
struct wl_seat *wl_seat;
|
||||
struct wl_pointer *wl_pointer;
|
||||
|
||||
// Cursor
|
||||
struct wl_surface *cursor_surface;
|
||||
struct wl_cursor_image *wl_cursor_image;
|
||||
|
||||
struct surface_list *surface_list;
|
||||
/// Next in queue to check if it wants to be rendered.
|
||||
struct surface_list *surface_list_next;
|
||||
|
||||
EGLDisplay egl_display;
|
||||
EGLConfig egl_config;
|
||||
EGLContext egl_context;
|
||||
};
|
||||
struct surface;
|
||||
struct surface_list;
|
||||
struct client_state;
|
||||
|
||||
#define EVENT_NONE 0
|
||||
#define EVENT_DRAW 1
|
||||
|
|
@ -82,7 +30,6 @@ struct event {
|
|||
|
||||
void wayland_init(struct client_state *state, int output_type);
|
||||
void commit(struct client_state *state);
|
||||
/// Provide pointer to be filled.
|
||||
struct event wait_for_event(struct client_state *state);
|
||||
void swap_buffers(struct client_state *state, struct surface *surface);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue