Проект разнесён по файлам

This commit is contained in:
2025-11-16 17:02:39 +03:00
parent b11a56ad06
commit 1f700295ff
8 changed files with 509 additions and 323 deletions

28
wayland/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