2015-04-06 11:20:51 -05:00
|
|
|
// 6 april 2015
|
|
|
|
|
|
|
|
#ifndef __UI_UI_H__
|
|
|
|
#define __UI_UI_H__
|
|
|
|
|
|
|
|
#include <stdint.h>
|
|
|
|
|
|
|
|
typedef struct uiInitError uiInitError;
|
|
|
|
typedef struct uiInitOptions uiInitOptions;
|
|
|
|
|
|
|
|
uiInitError *uiInit(uiInitOptions *);
|
|
|
|
const char *uiInitErrorMessage(uiInitError *);
|
|
|
|
void uiInitErrorFree(uiInitError *);
|
|
|
|
|
|
|
|
void uiMain(void);
|
|
|
|
void uiQuit(void);
|
|
|
|
|
2015-04-09 01:43:49 -05:00
|
|
|
void uiFreeText(char *);
|
|
|
|
|
2015-04-07 03:02:21 -05:00
|
|
|
typedef struct uiControl uiControl;
|
2015-04-07 23:43:35 -05:00
|
|
|
void uiControlDestroy(uiControl *);
|
2015-04-07 03:12:03 -05:00
|
|
|
uintptr_t uiControlHandle(uiControl *);
|
2015-04-07 03:02:21 -05:00
|
|
|
|
2015-04-06 11:20:51 -05:00
|
|
|
typedef struct uiWindow uiWindow;
|
|
|
|
uiWindow *uiNewWindow(char *, int, int);
|
|
|
|
void uiWindowDestroy(uiWindow *);
|
|
|
|
uintptr_t uiWindowHandle(uiWindow *);
|
2015-04-09 01:43:49 -05:00
|
|
|
char *uiWindowTitle(uiWindow *);
|
|
|
|
void uiWindowSetTitle(uiWindow *, const char *);
|
2015-04-06 11:20:51 -05:00
|
|
|
void uiWindowShow(uiWindow *);
|
|
|
|
void uiWindowHide(uiWindow *);
|
|
|
|
void uiWindowOnClosing(uiWindow *, int (*)(uiWindow *, void *), void *);
|
2015-04-07 03:02:21 -05:00
|
|
|
void uiWindowSetChild(uiWindow *, uiControl *);
|
2015-04-06 11:20:51 -05:00
|
|
|
|
2015-04-07 03:02:21 -05:00
|
|
|
uiControl *uiNewButton(const char *);
|
2015-04-09 01:43:49 -05:00
|
|
|
char *uiButtonText(uiControl *);
|
|
|
|
void uiButtonSetText(uiControl *, const char *);
|
2015-04-07 03:02:21 -05:00
|
|
|
void uiButtonOnClicked(uiControl *, void (*)(uiControl *, void *), void *);
|
2015-04-07 02:12:34 -05:00
|
|
|
|
2015-04-07 17:53:09 -05:00
|
|
|
uiControl *uiNewHorizontalStack(void);
|
|
|
|
uiControl *uiNewVerticalStack(void);
|
|
|
|
void uiStackAdd(uiControl *, uiControl *, int);
|
|
|
|
|
2015-04-08 22:22:59 -05:00
|
|
|
uiControl *uiNewEntry(void);
|
2015-04-09 01:43:49 -05:00
|
|
|
char *uiEntryText(uiControl *);
|
|
|
|
void uiEntrySetText(uiControl *, const char *);
|
2015-04-08 22:22:59 -05:00
|
|
|
|
2015-04-09 11:14:18 -05:00
|
|
|
uiControl *uiNewCheckbox(const char *);
|
2015-04-09 11:32:59 -05:00
|
|
|
char *uiCheckboxText(uiControl *);
|
2015-04-09 11:14:18 -05:00
|
|
|
void uiCheckboxSetText(uiControl *, const char *);
|
2015-04-09 11:26:59 -05:00
|
|
|
void uiCheckboxOnToggled(uiControl *, void (*)(uiControl *, void *), void *);
|
2015-04-09 11:52:34 -05:00
|
|
|
int uiCheckboxChecked(uiControl *);
|
|
|
|
// TODO should this trigger an event?
|
|
|
|
void uiChekboxSetChecked(uiControl *, int);
|
2015-04-09 11:14:18 -05:00
|
|
|
|
2015-04-06 11:20:51 -05:00
|
|
|
#endif
|