brewpanel/sdlgui.h

changeset 409
cdf68044adaf
child 410
e3f8a51b566a
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/brewpanel/sdlgui.h	Sat Nov 07 22:04:17 2015 +0100
@@ -0,0 +1,56 @@
+#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

mercurial