www.pudn.com > screensaver.rar > GUILib.h


#ifndef GUILIB_H 
#define GUILIB_H 
#include "genlib.h" 
 
//#define OPTION_DEBUG 
 
#define STATE_NORMAL	0 
#define STATE_HOVER		1 
#define STATE_DOWN		2 
 
#define WINDOW_WIDTH	12 
#define WINDOW_HEIGHT	6.75 
 
typedef struct { 
	void * prevWin; 
	void * nextWin; 
	double left; 
	double top; 
	double width; 
	double height; 
	int state; 
	string text; 
	void (* onClick)(void * this); 
	void (* onMouseMove)(void * this); 
	void (* onMouseDown)(void * this); 
	void (* onMouseUp)(void * this); 
	void (* onMouseExit)(void * this); 
	void (* onRedraw)(void * this); 
} window_t; 
 
typedef window_t * handle_t; 
 
bool CreateWindow(handle_t win); 
bool RemoveWindow(handle_t hWin); 
void StartGUI(); 
void InitGUI(); 
void EndGUI(); 
handle_t WindowFromPoint(double x, double y); 
handle_t GenWindow(double left, double top, double width, double height, string text,  
				   void (*onClick)(handle_t), void (*onMouseMove)(handle_t), void (*onMouseDown)(handle_t), 
				   void (*onMouseUp)(handle_t), void (*onMouseExit)(handle_t), void (*onRedraw)(handle_t)); 
void InvokeRedraw(handle_t win); 
void RedrawAll(); 
void ExitGUI(); 
string GetTextSummary(string strOrg, double width); 
 
#endif