#pragma once #include #include #include #include #include #include #include #include #include #include #include #include //#include #include #include "window.h" #if defined STELA_API_VULKAN #include "vk_common.h" #elif defined STELA_API_OPENGL #include "egl_common.h" #endif #define STELA_WAYLAND_KEY_MAX KEY_MAX #define STELA_WAYLAND_KEY_COUNT KEY_CNT struct stl_wayland_global { struct wl_display *display; struct { u8 *data; u32 size; } icon; s32 display_fd; struct wl_registry *registry; u16 keycodes[STELA_WAYLAND_KEY_COUNT]; array(struct stl_monitor *) monitors; #if defined STELA_API_VULKAN const char **vk_extensions; #elif defined STELA_API_OPENGL struct stl_egl_global egl; #endif void (*output_discovered)(void *, struct stl_monitor *); void *userdata; }; struct stl_monitor_wayland { struct stl_monitor m; struct wl_output *output; struct zxdg_output_v1 *xdg_output; }; struct stl_window_wayland { struct stl_window w; struct wl_display *display; struct wl_registry *registry; struct wl_compositor *compositor; struct wl_shm *shm; struct wl_seat *seat; struct wl_pointer *pointer; struct wl_keyboard *keyboard; struct wl_surface *surface; struct xdg_wm_base *xdg_wm_base; struct xdg_surface *xdg_surface; struct xdg_toplevel *xdg_toplevel; struct zxdg_decoration_manager_v1 *zxdg_decoration_manager; struct wp_cursor_shape_manager_v1 *cursor_shape_manager; struct wp_cursor_shape_device_v1 *cursor_shape_device; struct { struct xdg_toplevel_icon_manager_v1 *manager; struct wl_shm_pool *pool; struct wl_buffer *buffer; struct xdg_toplevel_icon_v1 *icon; } icon; struct zxdg_toplevel_decoration_v1 *zxdg_toplevel_decoration; struct zwlr_layer_shell_v1 *layer_shell; struct stl_monitor_wayland *monitor; struct zwlr_layer_surface_v1 *layer_surface; struct wl_egl_window *egl_window; #if defined STELA_API_OPENGL struct stl_egl egl; #endif #if defined STELA_POLL_INLINE && defined STELA_PAUSE struct nn_pollfd fds[2]; #else struct nn_pollfd fds[1]; #endif s32 geom_width; s32 geom_height; bool pending_configure; struct { u32 serial; struct wl_pointer *pointer; u8 shape; #ifdef STELA_MOUSE2_DRAG bool grabbed_by_toplevel_move; #endif } cursor; bool decorated; struct { f64 pointer_x; f64 pointer_y; f64 scroll_x; f64 scroll_y; } frame; };