summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/widget/table.h6
-rw-r--r--src/widget/widget.h19
2 files changed, 10 insertions, 15 deletions
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 @@
5#include "widget.h" 5#include "widget.h"
6 6
7const uiCell* GetCell(const uiTable* table, int row, int col); 7const uiCell* GetCell(const uiTable* table, int row, int col);
8 8uiCell* GetCellMut(uiTable* table, int row, int col);
9uiCell* GetCellMut(uiTable* table, int row, int col); 9uiCell** GetLastRow(uiTable* table);
10
11uiCell** 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 @@
9 9
10DEF_LIST(Widget, uiWidget*) 10DEF_LIST(Widget, uiWidget*)
11 11
12#define UI_NEW(TYPE) (TYPE*)uiAlloc(1, sizeof(TYPE))
13
14static inline void* uiAlloc(size_t count, size_t size) {
15 void* mem = calloc(count, size);
16 ASSERT(mem);
17 return mem;
18}
19
20// -----------------------------------------------------------------------------
21// Widgets.
22
23/// Base widget type. 12/// Base widget type.
24typedef struct uiWidget { 13typedef struct uiWidget {
25 uiWidgetType type; 14 uiWidgetType type;
@@ -66,3 +55,11 @@ typedef struct uiTable {
66} uiTable; 55} uiTable;
67 56
68void DestroyWidget(uiWidget** ppWidget); 57void DestroyWidget(uiWidget** ppWidget);
58
59#define UI_NEW(TYPE) (TYPE*)uiAlloc(1, sizeof(TYPE))
60
61static inline void* uiAlloc(size_t count, size_t size) {
62 void* mem = calloc(count, size);
63 ASSERT(mem);
64 return mem;
65}