From 471b3a57e75263b76eece91fa0ceeacaba99a4c9 Mon Sep 17 00:00:00 2001 From: Pietro Gagliardi Date: Thu, 9 Apr 2015 16:37:04 -0400 Subject: Big change time: decided to stop playing around with hiding and made both uiControl and uiSizing public. Also restructured uiSizing to make system-dependent data in another structure. --- new/ui.h | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'new/ui.h') diff --git a/new/ui.h b/new/ui.h index 8387dda..82d549b 100644 --- a/new/ui.h +++ b/new/ui.h @@ -17,9 +17,30 @@ void uiQuit(void); void uiFreeText(char *); +typedef struct uiSizing uiSizing; +struct uiSizing { + intmax_t xPadding; + intmax_t yPadding; + struct uiSizingSys *sys; +}; + typedef struct uiControl uiControl; +struct uiControl { + void *data; // for use by implementations only + void *internal; // for use by ui only + void (*destroy)(uiControl *); + uintptr_t (*handle)(uiControl *); + void (*setParent)(uiControl *, uintptr_t); + void (*removeParent)(uiControl *); + void (*preferredSize)(uiControl *, uiSizing *, intmax_t *, intmax_t *); + void (*resize)(uiControl *, intmax_t, intmax_t, intmax_t, intmax_t, uiSizing *); +}; void uiControlDestroy(uiControl *); uintptr_t uiControlHandle(uiControl *); +void uiControlSetParent(uiControl *, uintptr_t); +void uiControlRemoveParent(uiControl *); +void uiControlPreferredSize(uiControl *, uiSizing *, intmax_t *width, intmax_t *height); +void uiControlResize(uiControl *, intmax_t, intmax_t, intmax_t, intmax_t, uiSizing *); typedef struct uiWindow uiWindow; uiWindow *uiNewWindow(char *, int, int); -- cgit v1.2.3