1 /*
2     GUILIB:  An example GUI framework library for use with SDL
3 */
4 
5 /* This is the most generic widget possible, -- it's exported for C functions
6  */
7 
8 #ifndef _GUI_generic_h
9 #define _GUI_generic_h
10 
11 #include "GUI_C.h"
12 #include "GUI_widget.h"
13 
14 
15 class GUI_GenericWidget : public GUI_Widget {
16 
17 public:
18 	GUI_GenericWidget(void *data, GUI_DrawProc drawproc,
19 			GUI_EventProc eventproc, GUI_FreeProc freeproc);
20 	~GUI_GenericWidget();
21 
22 	/* Show the widget.
23 	   If the surface needs to be locked, it will be locked
24 	   before this call, and unlocked after it returns.
25 	 */
26 	virtual void Display(void);
27 
28 	/* Main event handler function.
29 	   This function gets raw SDL events from the GUI.
30 	 */
31 	virtual GUI_status HandleEvent(const SDL_Event *event);
32 
33 protected:
34 	GUI_DrawProc DrawProc;
35 	GUI_EventProc EventProc;
36 	GUI_FreeProc FreeProc;
37 
38 	/* Fill a widget_info structure with our info */
39 	virtual void FillInfo(widget_info *info);
40 };
41 
42 #endif /* _GUI_generic_h */
43