Started cleaning things up from zOLD as well.

This commit is contained in:
Pietro Gagliardi 2019-06-16 19:55:51 -04:00
parent edee2b930c
commit 3f744de64e
2 changed files with 0 additions and 33 deletions

View File

@ -7,16 +7,6 @@ uintptr_t uiControlHandle(uiControl *c)
return (*(c->Handle))(c);
}
uiControl *uiControlParent(uiControl *c)
{
return (*(c->Parent))(c);
}
void uiControlSetParent(uiControl *c, uiControl *parent)
{
(*(c->SetParent))(c, parent);
}
int uiControlToplevel(uiControl *c)
{
return (*(c->Toplevel))(c);
@ -52,19 +42,6 @@ void uiControlDisable(uiControl *c)
(*(c->Disable))(c);
}
void uiControlVerifySetParent(uiControl *c, uiControl *parent)
{
uiControl *curParent;
if (uiControlToplevel(c))
uiprivUserBug("You cannot give a toplevel uiControl a parent. (control: %p)", c);
curParent = uiControlParent(c);
if (parent != NULL && curParent != NULL)
uiprivUserBug("You cannot give a uiControl a parent while it already has one. (control: %p; current parent: %p; new parent: %p)", c, curParent, parent);
if (parent == NULL && curParent == NULL)
uiprivImplBug("attempt to double unparent uiControl %p", c);
}
int uiControlEnabledToUser(uiControl *c)
{
while (c != NULL) {

View File

@ -41,13 +41,7 @@ uiprivExtern void uiFreeText(char *text);
typedef struct uiControl uiControl;
struct uiControl {
uint32_t Signature;
uint32_t OSSignature;
uint32_t TypeSignature;
void (*Destroy)(uiControl *);
uintptr_t (*Handle)(uiControl *);
uiControl *(*Parent)(uiControl *);
void (*SetParent)(uiControl *, uiControl *);
int (*Toplevel)(uiControl *);
int (*Visible)(uiControl *);
void (*Show)(uiControl *);
@ -58,10 +52,7 @@ struct uiControl {
};
// TOOD add argument names to all arguments
#define uiControl(this) ((uiControl *) (this))
uiprivExtern void uiControlDestroy(uiControl *);
uiprivExtern uintptr_t uiControlHandle(uiControl *);
uiprivExtern uiControl *uiControlParent(uiControl *);
uiprivExtern void uiControlSetParent(uiControl *, uiControl *);
uiprivExtern int uiControlToplevel(uiControl *);
uiprivExtern int uiControlVisible(uiControl *);
uiprivExtern void uiControlShow(uiControl *);
@ -74,7 +65,6 @@ uiprivExtern uiControl *uiAllocControl(size_t n, uint32_t OSsig, uint32_t typesi
uiprivExtern void uiFreeControl(uiControl *);
// TODO make sure all controls have these
uiprivExtern void uiControlVerifySetParent(uiControl *, uiControl *);
uiprivExtern int uiControlEnabledToUser(uiControl *);
uiprivExtern void uiUserBugCannotSetParentOnToplevel(const char *type);