www.pudn.com > emGUI.rar > window.h


/* 
 *  Window layer 
 * 
 * 
 *  COPYRIGHT (c) 2001 - 2010. 
 *  emTech System Corporation. 
 * 
 *  The license and distribution terms for this file may be 
 *  found in found in the file LICENSE. 
 */ 
 
/*	Huangf emcore@263.net 
 */ 
 
#ifndef __WINDOW_h 
#define __WINDOW_h 
 
/*  mode of the form */ 
#define		MAINWND				1 
#define		APPMODAL			2 
#define		SYSMODAL			3 
#define		SUBWIN				4 
 
#define 	WINMODE_MAX			SUBWIN 
 
typedef struct Window Window; 
/*  Wnd Struct */ 
struct Window{ 
	Chain_Node		node; 
	Chain_Control	subWinList; 
 
	Window			*parent; 
	Application		*application; 
 
	unsigned32		(*wndProc)();	/*  Window handle procedure */ 
	void			*drawArea;		/*  drawing memory pointer */ 
	void			*memory;		/*  memory for window */ 
 
	short			mode; 
 
	short			left; 
	short			top; 
	short			right; 
	short			bottom; 
 
	/*  Window invalid RECT */ 
	short			paint_count; 
	 
	short			invalid_l; 
	short			invalid_t; 
	short			invalid_r; 
	short			invalid_b; 
/*  for old code compatible */ 
#define pMem		drawArea	 
}; 
typedef struct Window Wnd; 
typedef struct Window *WndID; 
 
#define WndDrawArea(_win)	((_win)->drawArea) 
#define FirstWindow(_app)	((Window *)((_app)->WinList.first)) 
#define WndDrawMemory(_win)	WndDrawArea((_win)) 
 
void WndInitialization(); 
 
WndID CreateWindow( 
	AppID		pApp, 
	WndID		parent, 
	int 		mode, 
	void		*wndProc, 
	int			l, 
	int			t, 
	int			w, 
	int			h 
); 
 
void DestroyWindow( 
	WndID		win 
); 
 
void _DestroyWindow( 
	WndID	win 
); 
 
Window *FindWindow( 
	Application *app, 
	int			x, 
	int			y 
); 
 
void HideWindow( 
	WndID	win 
); 
 
void ShowWindow( 
	WndID	win 
); 
 
void InvalidateRect( 
	WndID	win, 
	LPRECT	lpRect 
); 
 
#endif