From 7f2987db18e515aec099a281fb4499fad8ffd4e0 Mon Sep 17 00:00:00 2001 From: 3gg <3gg@shellblade.net> Date: Sun, 8 Mar 2026 10:02:09 -0700 Subject: More concise headers --- src/widget/table.h | 6 ++---- src/widget/widget.h | 19 ++++++++----------- 2 files changed, 10 insertions(+), 15 deletions(-) (limited to 'src/widget') diff --git a/src/widget/table.h b/src/widget/table.h index 9f466de..0585140 100644 --- a/src/widget/table.h +++ b/src/widget/table.h @@ -5,7 +5,5 @@ #include "widget.h" const uiCell* GetCell(const uiTable* table, int row, int col); - -uiCell* GetCellMut(uiTable* table, int row, int col); - -uiCell** GetLastRow(uiTable* table); +uiCell* GetCellMut(uiTable* table, int row, int col); +uiCell** GetLastRow(uiTable* table); diff --git a/src/widget/widget.h b/src/widget/widget.h index c75bd65..79a72f3 100644 --- a/src/widget/widget.h +++ b/src/widget/widget.h @@ -9,17 +9,6 @@ DEF_LIST(Widget, uiWidget*) -#define UI_NEW(TYPE) (TYPE*)uiAlloc(1, sizeof(TYPE)) - -static inline void* uiAlloc(size_t count, size_t size) { - void* mem = calloc(count, size); - ASSERT(mem); - return mem; -} - -// ----------------------------------------------------------------------------- -// Widgets. - /// Base widget type. typedef struct uiWidget { uiWidgetType type; @@ -66,3 +55,11 @@ typedef struct uiTable { } uiTable; void DestroyWidget(uiWidget** ppWidget); + +#define UI_NEW(TYPE) (TYPE*)uiAlloc(1, sizeof(TYPE)) + +static inline void* uiAlloc(size_t count, size_t size) { + void* mem = calloc(count, size); + ASSERT(mem); + return mem; +} -- cgit v1.2.3