comment and organize the file

This commit is contained in:
IoIxD 2025-12-09 00:46:54 -07:00
commit e7f0d8a262
3 changed files with 126 additions and 114 deletions

View file

@ -54,18 +54,22 @@ struct _MwLLWaylandTopLevel {
struct _MwLLWayland {
struct _MwLLCommon common;
// data that's only loaded if it's a toplevel
/* Pointer for data that's only loaded if the widget is a toplevel */
struct _MwLLWaylandTopLevel* toplevel;
enum {
MWLL_WAYLAND_TOPLEVEL = 0,
MWLL_WAYLAND_SUBLEVEL = 1,
MWLL_WAYLAND_SUBLEVEL = 1, /* Sublevels are surfaces that have the toplevel as a parent. They could be implemented as subsurfaces if we ever switch away from OpenGL. Some parts of the code also call them subwidgets. */
} type;
/* Map of Wayland interfaces to their relevant setup functions. */
struct {
const char* key;
wl_setup_func* value;
}* wl_protocol_setup_map;
/* Map of Wayland interfaces to any information we keep about them once we've registered them. */
struct {
const char* key;
wayland_protocol_t* value;
@ -76,43 +80,31 @@ struct _MwLLWayland {
struct wl_compositor* compositor;
struct wl_subcompositor* subcompositor;
struct wl_surface* surface;
struct wl_shm* shm;
struct wl_registry_listener registry_listener;
struct wl_event_queue* event_queue;
struct wl_pointer* pointer;
MwLL* subwidgets;
MwBool configured;
MwBool force_redraw;
MwBool egl_setup;
MwBool has_set_xy;
int resize_counter;
MwU32 x, y;
MwU32 ww, wh;
MwU32 lw, lh;
MwPoint cur_mouse_pos;
struct timeval timer;
MwU64 cooldown_timer;
MwU64 cooldown_timer_epoch;
MwLL parent;
MwLL topmost_parent;
MwBool draw_recursively;
MwBool no_viewport;
GLuint fbo;
unsigned int fbo_texture;
EGLNativeWindowType egl_window_native;
EGLDisplay egl_display;
EGLContext egl_context;
EGLSurface egl_surface;
EGLConfig egl_config;
MwLL* sublevels; /* stb_ds managed array of any sublevels */
MwBool configured; /* Whether or not xdg_toplevel_configure has run once */
MwBool egl_setup; /* Whether or not EGL has been set up */
MwBool has_set_xy /* Whether or not MwSetXY has been called */;
int resize_counter; /* Counter that's for a hack in event_loop */
MwU32 x, y, ww, wh; /* Window position */
MwU32 lw, lh; /* Last known window position */
MwPoint cur_mouse_pos; /* Currently known mouse position */
struct timeval timer;
MwU64 cooldown_timer;
MwU64 cooldown_timer_epoch;
MwLL parent;
MwLL topmost_parent; /* The parent at the top of all the other parents. Usually a toplevel. */
};
struct _MwLLWaylandColor {