Sat, 07 Nov 2015 22:04:17 +0100
Added a new brewpanel program that runs on an SDL/X screen. It will be an emulator for the hardware panels. Development version 0.5.0
#ifndef _SDLGUI_H #define _SDLGUI_H //#include <SDL.h> enum { SGBOX, SGTEXT, SGTTF, SGBUTTON, SGLCD }; /* Object flags: */ #define SG_TOUCHEXIT 1 /* Exit immediately when mouse button is pressed down */ #define SG_EXIT 2 /* Exit when mouse button has been pressed (and released) */ #define SG_DEFAULT 4 /* Marks a default button, selectable with return key */ #define SG_CANCEL 8 /* Marks a cancel button, selectable with ESC key */ #define SG_HIDE 16 /* Button is inactive */ /* Object states: */ #define SG_SELECTED 1 #define SG_LCD_BLINK 2 #define SG_LCD_CURSOR 4 #define SG_LCD_DISPLAY 8 #define SG_LCD_BLIGHT 16 /* Return codes: */ #define SDLGUI_ERROR -1 #define SDLGUI_QUIT -2 #define SDLGUI_UNKNOWNEVENT -3 typedef struct { int type; /* What type of object */ int flags; /* Object flags */ int state; /* Object state */ int x, y; /* The offset to the upper left corner */ int w, h; /* Width and height */ char *txt; /* Text string */ } SGOBJ; int SDLGui_Init(void); int SDLGui_UnInit(void); int SDLGui_SetScreen(SDL_Surface *pScrn); void SDLGui_DrawDialog(const SGOBJ *dlg); int SDLGui_DoDialog(SGOBJ *dlg, SDL_Event *pEventOut); void SDLGui_CenterDlg(SGOBJ *dlg); void SDLGui_LCDwrite(SGOBJ *dlg, int x, int y, Uint8 c, int lcdindex); #endif