name a few anon structs

This commit is contained in:
Kovid Goyal
2025-08-22 11:20:23 +05:30
parent c2a5af19b0
commit 3483f99d09

View File

@@ -24,7 +24,7 @@ typedef enum { LEFT_EDGE = 1, TOP_EDGE = 2, RIGHT_EDGE = 4, BOTTOM_EDGE = 8 } Ed
typedef enum { REPEAT_MIRROR, REPEAT_CLAMP, REPEAT_DEFAULT } RepeatStrategy; typedef enum { REPEAT_MIRROR, REPEAT_CLAMP, REPEAT_DEFAULT } RepeatStrategy;
typedef enum { WINDOW_NORMAL, WINDOW_FULLSCREEN, WINDOW_MAXIMIZED, WINDOW_MINIMIZED, WINDOW_HIDDEN } WindowState; typedef enum { WINDOW_NORMAL, WINDOW_FULLSCREEN, WINDOW_MAXIMIZED, WINDOW_MINIMIZED, WINDOW_HIDDEN } WindowState;
typedef struct { typedef struct UrlPrefix {
char_type string[16]; char_type string[16];
size_t len; size_t len;
} UrlPrefix; } UrlPrefix;
@@ -38,7 +38,7 @@ struct MenuItem {
const char *definition; const char *definition;
}; };
typedef struct { typedef struct Options {
monotonic_t visual_bell_duration, cursor_blink_interval, cursor_stop_blinking_after, click_interval; monotonic_t visual_bell_duration, cursor_blink_interval, cursor_stop_blinking_after, click_interval;
struct { struct {
monotonic_t hide_wait, unhide_wait; monotonic_t hide_wait, unhide_wait;
@@ -146,13 +146,13 @@ typedef struct {
unsigned int left, top, right, bottom; unsigned int left, top, right, bottom;
} WindowGeometry; } WindowGeometry;
typedef struct { typedef struct WindowRenderData {
ssize_t vao_idx; ssize_t vao_idx;
WindowGeometry geometry; WindowGeometry geometry;
Screen *screen; Screen *screen;
} WindowRenderData; } WindowRenderData;
typedef struct { typedef struct Click {
monotonic_t at; monotonic_t at;
int button, modifiers; int button, modifiers;
double x, y; double x, y;
@@ -160,7 +160,7 @@ typedef struct {
} Click; } Click;
#define CLICK_QUEUE_SZ 3 #define CLICK_QUEUE_SZ 3
typedef struct { typedef struct ClickQueue {
Click clicks[CLICK_QUEUE_SZ]; Click clicks[CLICK_QUEUE_SZ];
unsigned int length; unsigned int length;
} ClickQueue; } ClickQueue;
@@ -190,7 +190,7 @@ typedef struct WindowBarData {
bool needs_render; bool needs_render;
} WindowBarData; } WindowBarData;
typedef struct { typedef struct Window {
id_type id; id_type id;
bool visible; bool visible;
float cursor_opacity_at_last_render; float cursor_opacity_at_last_render;
@@ -218,19 +218,19 @@ typedef struct {
} pending_clicks; } pending_clicks;
} Window; } Window;
typedef struct { typedef struct BorderRect {
float left, top, right, bottom; float left, top, right, bottom;
uint32_t color; uint32_t color;
} BorderRect; } BorderRect;
typedef struct { typedef struct BorderRects {
BorderRect *rect_buf; BorderRect *rect_buf;
unsigned int num_border_rects, capacity; unsigned int num_border_rects, capacity;
bool is_dirty; bool is_dirty;
ssize_t vao_idx; ssize_t vao_idx;
} BorderRects; } BorderRects;
typedef struct { typedef struct CursorTrail {
bool needs_render; bool needs_render;
monotonic_t updated_at; monotonic_t updated_at;
float opacity; float opacity;
@@ -240,7 +240,7 @@ typedef struct {
float cursor_edge_y[2]; float cursor_edge_y[2];
} CursorTrail; } CursorTrail;
typedef struct { typedef struct Tab {
id_type id; id_type id;
unsigned int active_window, num_windows, capacity; unsigned int active_window, num_windows, capacity;
Window *windows; Window *windows;
@@ -251,7 +251,7 @@ typedef struct {
enum RENDER_STATE { RENDER_FRAME_NOT_REQUESTED, RENDER_FRAME_REQUESTED, RENDER_FRAME_READY }; enum RENDER_STATE { RENDER_FRAME_NOT_REQUESTED, RENDER_FRAME_REQUESTED, RENDER_FRAME_READY };
typedef enum { NO_CLOSE_REQUESTED, CONFIRMABLE_CLOSE_REQUESTED, CLOSE_BEING_CONFIRMED, IMPERATIVE_CLOSE_REQUESTED } CloseRequest; typedef enum { NO_CLOSE_REQUESTED, CONFIRMABLE_CLOSE_REQUESTED, CLOSE_BEING_CONFIRMED, IMPERATIVE_CLOSE_REQUESTED } CloseRequest;
typedef struct { typedef struct LiveResizeInfo {
monotonic_t last_resize_event_at; monotonic_t last_resize_event_at;
bool in_progress; bool in_progress;
bool from_os_notification; bool from_os_notification;
@@ -278,7 +278,7 @@ typedef struct BackgroundImageRenderSettings {
bool linear; uint32_t bgcolor; float opacity; bool linear; uint32_t bgcolor; float opacity;
} BackgroundImageRenderSettings; } BackgroundImageRenderSettings;
typedef struct { typedef struct OSWindow {
void *handle; void *handle;
id_type id; id_type id;
monotonic_t created_at; monotonic_t created_at;
@@ -328,7 +328,7 @@ typedef struct {
} OSWindow; } OSWindow;
typedef struct { typedef struct GlobalState {
Options opts; Options opts;
id_type os_window_id_counter, tab_id_counter, window_id_counter; id_type os_window_id_counter, tab_id_counter, window_id_counter;