From 44bbad70e58288d5fba1d9c5f334facbf981edcf Mon Sep 17 00:00:00 2001 From: Pietro Gagliardi Date: Fri, 29 May 2015 22:44:48 -0400 Subject: [PATCH] Removed/moved around the remnants of the autogenerated typefuncs system. --- redo/GNUmakefile | 1 + redo/box.c | 2 ++ redo/control.c | 9 +++++++++ redo/menu.c | 19 +++++++++++++++++++ redo/windows/window.c | 2 ++ 5 files changed, 33 insertions(+) create mode 100644 redo/menu.c diff --git a/redo/GNUmakefile b/redo/GNUmakefile index 83d7316b..304066a6 100644 --- a/redo/GNUmakefile +++ b/redo/GNUmakefile @@ -28,6 +28,7 @@ baseHFILES = \ baseCFILES = \ box.c \ control.c \ + menu.c \ ptrarray.c \ shouldquit.c \ types.c \ diff --git a/redo/box.c b/redo/box.c index 4ae4e9e0..4737774f 100644 --- a/redo/box.c +++ b/redo/box.c @@ -19,6 +19,8 @@ struct boxControl { intmax_t height; }; +uiDefineControlType(uiBox, uiTypeBox, struct box) + static void boxCommitDestroy(uiControl *c) { struct box *b = (struct box *) c; diff --git a/redo/control.c b/redo/control.c index 4d71c0e5..2ca91840 100644 --- a/redo/control.c +++ b/redo/control.c @@ -8,6 +8,15 @@ struct controlBase { int disabled; }; +static uintmax_t type_uiControl = 0; + +uintmax_t uiTypeControl(void) +{ + if (type_uiControl == 0) + type_uiControl = uiRegisterType("uiControl", 0, 0); + return type_uiControl; +} + #define controlBase(c) ((struct controlBase *) (c->Internal)) static void controlBaseDestroy(uiControl *c) diff --git a/redo/menu.c b/redo/menu.c new file mode 100644 index 00000000..5cc8b019 --- /dev/null +++ b/redo/menu.c @@ -0,0 +1,19 @@ +// 29 may 2015 +#include "out/ui.h" + +static uintmax_t type_uiMenu = 0; +static uintmax_t type_uiMenuItem = 0; + +uintmax_t uiTypeMenu(void) +{ + if (type_uiMenu == 0) + type_uiMenu = uiRegisterType("uiMenu", 0, 0); + return type_uiMenu; +} + +uintmax_t uiTypeMenuItem(void) +{ + if (type_uiMenuItem == 0) + type_uiMenuItem = uiRegisterType("uiMenuItem", 0, 0); + return type_uiMenuItem; +} diff --git a/redo/windows/window.c b/redo/windows/window.c index cec07a77..094e589e 100644 --- a/redo/windows/window.c +++ b/redo/windows/window.c @@ -14,6 +14,8 @@ struct window { int margined; }; +uiDefineControlType(uiWindow, uiTypeWindow, struct window) + static LRESULT CALLBACK windowWndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) { struct window *w;