1 |
/* |
2 |
* |
3 |
* This file is taken from the ARAnyM project which builds a new and powerful |
4 |
* TOS/FreeMiNT compatible virtual machine running on almost any hardware. |
5 |
* |
6 |
* This file is distributed under the GNU Public License, version 2 or at |
7 |
* your option any later version. Read the file gpl.txt for details. |
8 |
* |
9 |
*/ |
10 |
|
11 |
#ifndef _SDLGUI_H |
12 |
#define _SDLGUI_H |
13 |
|
14 |
#include <SDL.h> |
15 |
|
16 |
enum |
17 |
{ |
18 |
SGBOX, |
19 |
SGTEXT, |
20 |
SGEDITFIELD, |
21 |
SGBUTTON, |
22 |
SGCHECKBOX, |
23 |
SGPOPUP |
24 |
}; |
25 |
|
26 |
|
27 |
/* Object flags: */ |
28 |
#define SG_TOUCHEXIT 1 |
29 |
#define SG_EXIT 2 |
30 |
#define SG_BUTTON_RIGHT 4 |
31 |
#define SG_DEFAULT 8 |
32 |
#define SG_SELECTABLE 16 |
33 |
#define SG_BACKGROUND 32 |
34 |
#define SG_RADIO 64 |
35 |
|
36 |
/* Object states: */ |
37 |
#define SG_SELECTED 1 |
38 |
#define SG_HIDDEN 2 |
39 |
#define SG_DISABLED 4 |
40 |
|
41 |
/* Special characters: */ |
42 |
#define SGCHECKBOX_RADIO_NORMAL 12 |
43 |
#define SGCHECKBOX_RADIO_SELECTED 13 |
44 |
#define SGCHECKBOX_NORMAL 14 |
45 |
#define SGCHECKBOX_SELECTED 15 |
46 |
#define SGARROWUP 1 |
47 |
#define SGARROWDOWN 2 |
48 |
#define SGFOLDER 5 |
49 |
|
50 |
|
51 |
typedef struct |
52 |
{ |
53 |
int type; /* What type of object */ |
54 |
int flags; /* Object flags */ |
55 |
int state; /* Object state */ |
56 |
int x, y; /* The offset to the upper left corner */ |
57 |
unsigned int w, h; /* Width and height */ |
58 |
char *txt; /* Text string */ |
59 |
} SGOBJ; |
60 |
|
61 |
typedef struct |
62 |
{ |
63 |
int object; |
64 |
int position; |
65 |
int blink_counter; |
66 |
bool blink_state; |
67 |
} cursor_state; |
68 |
|
69 |
extern void screenlock(); |
70 |
extern void screenunlock(); |
71 |
|
72 |
bool SDLGui_Init(SDL_Surface *GUISurface); |
73 |
int SDLGui_UnInit(void); |
74 |
int SDLGui_DoDialog(SGOBJ *dlg); |
75 |
int SDLGui_PrepareFont(void); |
76 |
void SDLGui_FreeFont(void); |
77 |
|
78 |
SDL_Rect *SDLGui_GetFirstBackgroundRect(void); |
79 |
SDL_Rect *SDLGui_GetNextBackgroundRect(void); |
80 |
|
81 |
SDL_Event getEvent(SGOBJ *dlg, cursor_state *cursor); |
82 |
|
83 |
#endif /* _SDLGUI_H */ |