Panda3D
get_x11.h
1 // Filename: get_x11.h
2 // Created by: drose (28Aug11)
3 //
4 ////////////////////////////////////////////////////////////////////
5 //
6 // PANDA 3D SOFTWARE
7 // Copyright (c) Carnegie Mellon University. All rights reserved.
8 //
9 // All use of this software is subject to the terms of the revised BSD
10 // license. You should have received a copy of this license along
11 // with this source code in a file named "LICENSE."
12 //
13 ////////////////////////////////////////////////////////////////////
14 
15 #ifndef GET_X11_H
16 #define GET_X11_H
17 
18 #include "pandabase.h"
19 
20 #ifdef HAVE_X11
21 // This header file is designed to help work around some of the
22 // namespace spamming that X11 causes, by renaming the symbols that
23 // X11 declares that are known to conflict with other library names
24 // (like Apple's Core Graphics, for instance).
25 
26 // In order for this to work, everyone who uses X11 within Panda
27 // should include this file instead of including the X11 headers
28 // directly.
29 
30 #ifdef CPPPARSER
31 // A simple hack so interrogate can get all of the necessary
32 // typenames.
33 typedef struct _XDisplay X11_Display;
34 typedef unsigned int XID;
35 typedef unsigned int Atom;
36 typedef unsigned int Cardinal;
37 typedef XID Colormap;
38 typedef XID X11_Window;
39 typedef XID X11_Cursor;
40 typedef struct _XIM *XIM;
41 typedef struct _XIC *XIC;
42 struct XErrorEvent;
43 struct XVisualInfo;
44 #define Bool int
45 #define Status int
46 #define True 1
47 #define False 0
48 #else
49 
50 #include "pre_x11_include.h"
51 #include <X11/Xlib.h>
52 #include <X11/Xutil.h>
53 #include <X11/keysym.h>
54 #include <X11/Xatom.h>
55 
56 #ifdef HAVE_XRANDR
57 #include <X11/extensions/Xrandr.h>
58 #endif // HAVE_XRANDR
59 
60 #ifdef HAVE_XCURSOR
61 #include <X11/Xcursor/Xcursor.h>
62 #endif
63 
64 #ifdef HAVE_XF86DGA
65 #include <X11/extensions/xf86dga.h>
66 #endif
67 
68 #include "post_x11_include.h"
69 
70 #endif // CPPPARSER
71 #endif // HAVE_X11
72 
73 #endif