Реструктуризация проекта

This commit is contained in:
2025-11-16 17:52:09 +03:00
parent 1f700295ff
commit eeb632ed0e
9 changed files with 43 additions and 40 deletions

11
wayland/include/input.h Normal file
View File

@@ -0,0 +1,11 @@
#ifndef WAYLAND_INPUT_H
#define WAYLAND_INPUT_H
#include <wayland-client.h>
/* Called by registry when a wl_seat is bound */
void input_register_seat(struct wl_seat *seat);
/* Perform any input-related cleanup (destroy keyboard, xkb state) */
void input_cleanup(void);
#endif

View File

@@ -0,0 +1,14 @@
#ifndef WAYLAND_REGISTRY_H
#define WAYLAND_REGISTRY_H
#include <wayland-client.h>
/* Initialize registry listener on the given registry */
void registry_add_listener(struct wl_registry *registry);
/* Accessors for bound globals */
struct wl_compositor *registry_get_compositor(void);
struct wl_shm *registry_get_shm(void);
struct xdg_wm_base *registry_get_xdg_wm_base(void);
#endif

28
wayland/include/window.h Normal file
View File

@@ -0,0 +1,28 @@
#ifndef WAYLAND_WINDOW_H
#define WAYLAND_WINDOW_H
#include <wayland-client.h>
/* Data for a single Wayland window (one surface) */
struct wayland_window {
struct wl_surface *wl_surface;
struct wl_buffer *buffer;
struct xdg_surface *xdg_surface;
struct xdg_toplevel *xdg_toplevel;
uint8_t *data;
int16_t width;
int16_t height;
int need_close;
uint8_t color;
};
/* Initialize windowing for the given window structure. Caller provides the struct (on stack or heap) */
int window_init(struct wl_display *display, struct wayland_window *win);
/* Returns non-zero if the window requested to close */
int window_should_close(struct wayland_window *win);
/* Destroy window and related resources */
void window_destroy(struct wayland_window *win);
#endif