|
1 #ifndef _SDLGUI_H |
|
2 #define _SDLGUI_H |
|
3 |
|
4 //#include <SDL.h> |
|
5 |
|
6 enum |
|
7 { |
|
8 SGBOX, |
|
9 SGTEXT, |
|
10 SGTTF, |
|
11 SGBUTTON, |
|
12 SGLCD |
|
13 }; |
|
14 |
|
15 |
|
16 /* Object flags: */ |
|
17 #define SG_TOUCHEXIT 1 /* Exit immediately when mouse button is pressed down */ |
|
18 #define SG_EXIT 2 /* Exit when mouse button has been pressed (and released) */ |
|
19 #define SG_DEFAULT 4 /* Marks a default button, selectable with return key */ |
|
20 #define SG_CANCEL 8 /* Marks a cancel button, selectable with ESC key */ |
|
21 #define SG_HIDE 16 /* Button is inactive */ |
|
22 |
|
23 /* Object states: */ |
|
24 #define SG_SELECTED 1 |
|
25 #define SG_LCD_BLINK 2 |
|
26 #define SG_LCD_CURSOR 4 |
|
27 #define SG_LCD_DISPLAY 8 |
|
28 #define SG_LCD_BLIGHT 16 |
|
29 |
|
30 /* Return codes: */ |
|
31 #define SDLGUI_ERROR -1 |
|
32 #define SDLGUI_QUIT -2 |
|
33 #define SDLGUI_UNKNOWNEVENT -3 |
|
34 |
|
35 |
|
36 typedef struct |
|
37 { |
|
38 int type; /* What type of object */ |
|
39 int flags; /* Object flags */ |
|
40 int state; /* Object state */ |
|
41 int x, y; /* The offset to the upper left corner */ |
|
42 int w, h; /* Width and height */ |
|
43 char *txt; /* Text string */ |
|
44 } SGOBJ; |
|
45 |
|
46 |
|
47 |
|
48 int SDLGui_Init(void); |
|
49 int SDLGui_UnInit(void); |
|
50 int SDLGui_SetScreen(SDL_Surface *pScrn); |
|
51 void SDLGui_DrawDialog(const SGOBJ *dlg); |
|
52 int SDLGui_DoDialog(SGOBJ *dlg, SDL_Event *pEventOut); |
|
53 void SDLGui_CenterDlg(SGOBJ *dlg); |
|
54 void SDLGui_LCDwrite(SGOBJ *dlg, int x, int y, Uint8 c, int lcdindex); |
|
55 |
|
56 #endif |