|
|
1.1 root 1: /*
1.1.1.2 root 2: Hatari - sdlgui.h
3:
4: This file is distributed under the GNU Public License, version 2 or at
5: your option any later version. Read the file gpl.txt for details.
1.1 root 6:
7: Header for the tiny graphical user interface for Hatari.
8: */
9:
1.1.1.2 root 10: #ifndef HATARI_SDLGUI_H
11: #define HATARI_SDLGUI_H
12:
1.1 root 13: #include <SDL.h>
14:
15: enum
16: {
17: SGBOX,
18: SGTEXT,
1.1.1.3 root 19: SGEDITFIELD,
1.1 root 20: SGBUTTON,
21: SGRADIOBUT,
22: SGCHECKBOX,
1.1.1.9 root 23: SGPOPUP,
24: SGSCROLLBAR
1.1 root 25: };
26:
27:
28: /* Object flags: */
1.1.1.7 root 29: #define SG_TOUCHEXIT 1 /* Exit immediately when mouse button is pressed down */
30: #define SG_EXIT 2 /* Exit when mouse button has been pressed (and released) */
31: #define SG_DEFAULT 4 /* Marks a default button, selectable with return key */
32: #define SG_CANCEL 8 /* Marks a cancel button, selectable with ESC key */
1.1 root 33:
34: /* Object states: */
1.1.1.9 root 35: #define SG_SELECTED 1
36: #define SG_MOUSEDOWN 16
37: #define SG_MOUSEUP (((int)-1) - SG_MOUSEDOWN)
1.1 root 38:
1.1.1.3 root 39: /* Special characters: */
40: #define SGRADIOBUTTON_NORMAL 12
41: #define SGRADIOBUTTON_SELECTED 13
1.1.1.9 root 42: #define SGCHECKBOX_NORMAL 14
43: #define SGCHECKBOX_SELECTED 15
44: #define SGARROWUP 1
45: #define SGARROWDOWN 2
46: #define SGFOLDER 5
1.1.1.3 root 47:
1.1.1.5 root 48: /* Return codes: */
49: #define SDLGUI_ERROR -1
50: #define SDLGUI_QUIT -2
51: #define SDLGUI_UNKNOWNEVENT -3
52:
1.1 root 53:
54: typedef struct
55: {
56: int type; /* What type of object */
57: int flags; /* Object flags */
1.1.1.4 root 58: int state; /* Object state */
1.1 root 59: int x, y; /* The offset to the upper left corner */
1.1.1.9 root 60: int w, h; /* Width and height (for scrollbar : height and position) */
1.1 root 61: char *txt; /* Text string */
62: } SGOBJ;
63:
1.1.1.10! root 64: extern int sdlgui_fontwidth; /* Width of the actual font */
! 65: extern int sdlgui_fontheight; /* Height of the actual font */
1.1 root 66:
1.1.1.3 root 67: extern int SDLGui_Init(void);
68: extern int SDLGui_UnInit(void);
1.1.1.5 root 69: extern int SDLGui_SetScreen(SDL_Surface *pScrn);
1.1.1.8 root 70: extern void SDLGui_GetFontSize(int *width, int *height);
71: extern void SDLGui_Text(int x, int y, const char *txt);
1.1.1.6 root 72: extern void SDLGui_DrawDialog(const SGOBJ *dlg);
1.1.1.5 root 73: extern int SDLGui_DoDialog(SGOBJ *dlg, SDL_Event *pEventOut);
1.1.1.3 root 74: extern void SDLGui_CenterDlg(SGOBJ *dlg);
1.1.1.8 root 75: extern char* SDLGui_FileSelect(const char *path_and_name, char **zip_path, bool bAllowNew);
76: extern bool SDLGui_FileConfSelect(char *dlgname, char *confname, int maxlen, bool bAllowNew);
1.1.1.2 root 77:
78: #endif
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.