diff --git a/common/control.c b/common/control.c index 241f0db4..bb25a585 100644 --- a/common/control.c +++ b/common/control.c @@ -8,15 +8,6 @@ struct controlBase { int disabled; }; -static uintmax_t type_uiControl = 0; - -uintmax_t uiControlType(void) -{ - if (type_uiControl == 0) - type_uiControl = uiRegisterType("uiControl", 0, sizeof (uiControl)); - return type_uiControl; -} - #define controlBase(c) ((struct controlBase *) (c->Internal)) void uiControlDestroy(uiControl *c) @@ -155,11 +146,17 @@ void controlUpdateState(uiControl *c) //TODO uiControlQueueResize(c); } -uiControl *uiNewControl(uintmax_t type) +#define uiControlSignature 0x7569436F + +// TODO does this need to be public? +uiControl *uiNewControl(size_t size, uint32_t OSsig, uint32_t typesig, const char *typename) { uiControl *c; - c = uiControl(newTyped(type)); + c = (uiControl *) uiAlloc(size, typename); + c->Signature = uiControlSignature; + c->OSSignature = OSsig; + c->TypeSignature = typesig; c->Internal = uiNew(struct controlBase); return c; } diff --git a/ui.h b/ui.h index 01294159..c575241d 100644 --- a/ui.h +++ b/ui.h @@ -54,7 +54,6 @@ struct uiControl { void (*CommitHide)(uiControl *); void (*ContainerUpdateState)(uiControl *); }; -_UI_EXTERN uintmax_t uiControlType(void); #define uiControl(this) ((uiControl *) (this)) _UI_EXTERN void uiControlDestroy(uiControl *); _UI_EXTERN uintptr_t uiControlHandle(uiControl *); @@ -64,7 +63,7 @@ _UI_EXTERN void uiControlShow(uiControl *); _UI_EXTERN void uiControlHide(uiControl *); _UI_EXTERN void uiControlEnable(uiControl *); _UI_EXTERN void uiControlDisable(uiControl *); -_UI_EXTERN uiControl *uiNewControl(uintmax_t type); +_UI_EXTERN uiControl *uiNewControl(size_t size, uint32_t OSsig, uint32_t typesig, const char *typename); typedef struct uiWindow uiWindow; _UI_EXTERN uintmax_t uiWindowType(void);