summaryrefslogtreecommitdiff
path: root/new/ui.h
blob: d22e949595806b543f9f68f923bcef42fc278db8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
// 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);

typedef struct uiControl uiControl;
// TODO public?
void uiControlDestroy(uiControl *);
// TODO before destroy?
uintptr_t uiControlHandle(uiControl *);

typedef struct uiWindow uiWindow;
uiWindow *uiNewWindow(char *, int, int);
void uiWindowDestroy(uiWindow *);
uintptr_t uiWindowHandle(uiWindow *);
// TODO titles
void uiWindowShow(uiWindow *);
void uiWindowHide(uiWindow *);
void uiWindowOnClosing(uiWindow *, int (*)(uiWindow *, void *), void *);
void uiWindowSetChild(uiWindow *, uiControl *);

uiControl *uiNewButton(const char *);
// TODO text
void uiButtonOnClicked(uiControl *, void (*)(uiControl *, void *), void *);

uiControl *uiNewHorizontalStack(void);
uiControl *uiNewVerticalStack(void);
void uiStackAdd(uiControl *, uiControl *, int);

#endif