Adjusted common/control.c for the new type-based control system. Now to fix up the individual OSs.

This commit is contained in:
Pietro Gagliardi 2016-04-24 15:15:36 -04:00
parent f60178798f
commit 8a532d66cc
2 changed files with 9 additions and 13 deletions

View File

@ -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;
}

3
ui.h
View File

@ -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);