diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/widget/table.h | 6 | ||||
| -rw-r--r-- | src/widget/widget.h | 19 |
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 | ||
| 7 | const uiCell* GetCell(const uiTable* table, int row, int col); | 7 | const uiCell* GetCell(const uiTable* table, int row, int col); |
| 8 | 8 | uiCell* GetCellMut(uiTable* table, int row, int col); | |
| 9 | uiCell* GetCellMut(uiTable* table, int row, int col); | 9 | uiCell** GetLastRow(uiTable* table); |
| 10 | |||
| 11 | 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 @@ | |||
| 9 | 9 | ||
| 10 | DEF_LIST(Widget, uiWidget*) | 10 | DEF_LIST(Widget, uiWidget*) |
| 11 | 11 | ||
| 12 | #define UI_NEW(TYPE) (TYPE*)uiAlloc(1, sizeof(TYPE)) | ||
| 13 | |||
| 14 | static 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. |
| 24 | typedef struct uiWidget { | 13 | typedef struct uiWidget { |
| 25 | uiWidgetType type; | 14 | uiWidgetType type; |
| @@ -66,3 +55,11 @@ typedef struct uiTable { | |||
| 66 | } uiTable; | 55 | } uiTable; |
| 67 | 56 | ||
| 68 | void DestroyWidget(uiWidget** ppWidget); | 57 | void DestroyWidget(uiWidget** ppWidget); |
| 58 | |||
| 59 | #define UI_NEW(TYPE) (TYPE*)uiAlloc(1, sizeof(TYPE)) | ||
| 60 | |||
| 61 | static inline void* uiAlloc(size_t count, size_t size) { | ||
| 62 | void* mem = calloc(count, size); | ||
| 63 | ASSERT(mem); | ||
| 64 | return mem; | ||
| 65 | } | ||
