1 /*
2 	context_x11.h
3 
4 	(description)
5 
6 	Copyright (C) 1996-1997  Id Software, Inc.
7 	Copyright (C) 1999,2000  contributors of the QuakeForge project
8 	Please see the file "AUTHORS" for a list of contributors
9 
10 	This program is free software; you can redistribute it and/or
11 	modify it under the terms of the GNU General Public License
12 	as published by the Free Software Foundation; either version 2
13 	of the License, or (at your option) any later version.
14 
15 	This program is distributed in the hope that it will be useful,
16 	but WITHOUT ANY WARRANTY; without even the implied warranty of
17 	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
18 
19 	See the GNU General Public License for more details.
20 
21 	You should have received a copy of the GNU General Public License
22 	along with this program; if not, write to:
23 
24 		Free Software Foundation, Inc.
25 		59 Temple Place - Suite 330
26 		Boston, MA  02111-1307, USA
27 
28 */
29 
30 #ifndef __context_x11_h_
31 #define __context_x11_h_
32 
33 #include <X11/Xlib.h>
34 #include <X11/Xutil.h>
35 
36 #include <QF/qtypes.h>
37 
38 
39 #define X11_WINDOW_MASK (VisibilityChangeMask | StructureNotifyMask \
40 						 | ExposureMask)
41 #define X11_KEY_MASK (KeyPressMask | KeyReleaseMask)
42 #define X11_MOUSE_MASK (ButtonPressMask | ButtonReleaseMask \
43 						| PointerMotionMask)
44 #define X11_FOCUS_MASK (FocusChangeMask | EnterWindowMask)
45 #define X11_INPUT_MASK (X11_KEY_MASK | X11_MOUSE_MASK | X11_FOCUS_MASK)
46 #define X11_MASK (X11_WINDOW_MASK | X11_FOCUS_MASK | PointerMotionMask)
47 
48 extern Display	*x_disp;
49 extern Visual	*x_vis;
50 extern Window	x_root;
51 extern Window	x_win;
52 extern Colormap x_cmap;
53 extern XVisualInfo *x_visinfo;
54 extern int		x_screen;
55 extern int		x_shmeventtype;
56 extern Time		x_time;
57 extern Time		x_mouse_time;
58 extern qboolean oktodraw;
59 extern qboolean x_have_focus;
60 
61 qboolean X11_AddEvent (int event, void (*event_handler)(XEvent *));
62 qboolean X11_RemoveEvent (int event, void (*event_handler)(XEvent *));
63 qboolean X11_SetGamma (double);
64 void X11_CloseDisplay (void);
65 void X11_CreateNullCursor (void);
66 void X11_CreateWindow (int, int);
67 void X11_ForceViewPort (void);
68 void X11_Init_Cvars (void);
69 void X11_OpenDisplay (void);
70 void X11_ProcessEvent (void);
71 void X11_ProcessEvents (void);
72 void X11_RestoreGamma (void);
73 void X11_RestoreVidMode (void);
74 void X11_SetCaption (const char *);
75 void X11_SetVidMode (int, int);
76 void X11_SaveMouseAcceleration (void);
77 void X11_RemoveMouseAcceleration (void);
78 void X11_RestoreMouseAcceleration (void);
79 
80 #endif	// __context_x11_h_
81