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