Превосходное состояние проекта

This commit is contained in:
2025-11-17 01:31:00 +03:00
parent 0d3efeda49
commit e0ac79bae1
8 changed files with 336 additions and 271 deletions

View File

@@ -3,9 +3,12 @@
#include <wayland-client.h>
/* Called by registry when a wl_seat is bound */
/* Вызывается при привязке wl_seat регистром */
void input_register_seat(struct wl_seat *seat);
/* Perform any input-related cleanup (destroy keyboard, xkb state) */
/* Очистка input (разрушить keyboard и xkb state) */
void input_cleanup(void);
/* Возвращает wl_surface, имеющую фокус клавиатуры или NULL */
struct wl_surface *input_get_keyboard_focus(void);
#endif

View File

@@ -3,19 +3,10 @@
#include <wayland-client.h>
/* Initialize registry listener on the given registry */
void registry_add_listener(struct wl_registry *registry);
int registry_global_bind(struct wl_display *display);
void registry_global_unbind(void);
/* Prepare per-thread bindings for compositor/shm/xdg_wm_base */
int registry_thread_bind(struct wl_display *display, struct wl_event_queue *queue);
/* Release per-thread resources allocated by registry_thread_bind */
void registry_thread_unbind(void);
/* Reset global registry bookkeeping (used during teardown) */
void registry_reset_globals(void);
/* Accessors for bound globals (per-thread via registry_thread_bind) */
/* Доступ к привязанным глобальным объектам */
struct wl_compositor *registry_get_compositor(void);
struct wl_shm *registry_get_shm(void);
struct xdg_wm_base *registry_get_xdg_wm_base(void);

View File

@@ -3,16 +3,16 @@
#include <stdint.h>
/* Initialize shared Wayland connection and prepare global data */
/* Инициализация общего соединения Wayland и подготовка глобальных данных */
int32_t init_wayland(void);
/* Spawn a new window thread; returns slot index or negative on failure */
/* Создать поток для окна; вернуть индекс слота или отрицательное при ошибке */
int32_t run_window(void);
/* Block until all window threads have exited */
/* Блокировать до завершения всех оконных потоков */
void wait_for_windows(void);
/* Tear down window threads, input, and the shared Wayland connection */
/* Остановить оконные потоки, очистить input и закрыть соединение Wayland */
void destroy_wayland(void);
#endif

View File

@@ -3,7 +3,7 @@
#include <wayland-client.h>
/* Data for a single Wayland window (one surface) */
/* Данные одного Wayland-окна (одна поверхность) */
struct wayland_window {
int id;
struct wl_surface *wl_surface;
@@ -11,6 +11,7 @@ struct wayland_window {
struct wl_callback *frame_callback;
struct xdg_surface *xdg_surface;
struct xdg_toplevel *xdg_toplevel;
struct wl_event_queue *queue; /* очередь событий для окна */
uint8_t *data;
int32_t width;
int32_t height;
@@ -18,13 +19,13 @@ struct wayland_window {
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);
/* Инициализация окна; структура предоставляется вызывающим */
int window_init(struct wl_display *display, struct wl_event_queue *queue, 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