• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • tdecore
 

tdecore

  • tdecore
fixx11h.h
1//#ifdef don't do this, this file is supposed to be included
2//#define multiple times
3
4/* Usage:
5
6 If you get compile errors caused by X11 includes (the line
7 where first error appears contains word like None, Unsorted,
8 Below, etc.), put #include <fixx11h.h> in the .cpp file
9 (not .h file!) between the place where X11 headers are
10 included and the place where the file with compile
11 error is included (or the place where the compile error
12 in the .cpp file occurs).
13
14 This file remaps X11 #defines to const variables or
15 inline functions. The side effect may be that these
16 symbols may now refer to different variables
17 (e.g. if X11 #defined NoButton, after this file
18 is included NoButton would no longer be X11's
19 NoButton, but TQt::NoButton instead). At this time,
20 there's no conflict known that could cause problems.
21
22 The original X11 symbols are still accessible
23 (e.g. for None) as X::None, XNone, and also still
24 None, unless name lookup finds different None
25 first (in the current class, etc.)
26
27 Use 'Unsorted', 'Bool' and 'index' as templates.
28
29*/
30
31namespace X
32{
33
34// template --->
35// Affects: Should be without side effects.
36#ifdef Unsorted
37#ifndef FIXX11H_Unsorted
38#define FIXX11H_Unsorted
39const int XUnsorted = Unsorted;
40#undef Unsorted
41const int Unsorted = XUnsorted;
42#endif
43#undef Unsorted
44#endif
45// template <---
46
47// Affects: Should be without side effects.
48#ifdef None
49#ifndef FIXX11H_None
50#define FIXX11H_None
51const XID XNone = None;
52#undef None
53const XID None = XNone;
54#endif
55#undef None
56#endif
57
58// template --->
59// Affects: Should be without side effects.
60#ifndef _XTYPEDEF_BOOL
61#ifdef Bool
62#ifndef FIXX11H_Bool
63#define FIXX11H_Bool
64typedef Bool XBool;
65#undef Bool
66#define _XTYPEDEF_BOOL
67typedef XBool Bool;
68#endif
69#undef Bool
70#endif
71#endif // _XTYPEDEF_BOOL
72// template <---
73
74// Affects: Should be without side effects.
75#ifdef KeyPress
76#ifndef FIXX11H_KeyPress
77#define FIXX11H_KeyPress
78const int XKeyPress = KeyPress;
79#undef KeyPress
80const int KeyPress = XKeyPress;
81#endif
82#undef KeyPress
83#endif
84
85// Affects: Should be without side effects.
86#ifdef KeyRelease
87#ifndef FIXX11H_KeyRelease
88#define FIXX11H_KeyRelease
89const int XKeyRelease = KeyRelease;
90#undef KeyRelease
91const int KeyRelease = XKeyRelease;
92#endif
93#undef KeyRelease
94#endif
95
96// Affects: Should be without side effects.
97#ifdef Above
98#ifndef FIXX11H_Above
99#define FIXX11H_Above
100const int XAbove = Above;
101#undef Above
102const int Above = XAbove;
103#endif
104#undef Above
105#endif
106
107// Affects: Should be without side effects.
108#ifdef Below
109#ifndef FIXX11H_Below
110#define FIXX11H_Below
111const int XBelow = Below;
112#undef Below
113const int Below = XBelow;
114#endif
115#undef Below
116#endif
117
118// Affects: Should be without side effects.
119#ifdef FocusIn
120#ifndef FIXX11H_FocusIn
121#define FIXX11H_FocusIn
122const int XFocusIn = FocusIn;
123#undef FocusIn
124const int FocusIn = XFocusIn;
125#endif
126#undef FocusIn
127#endif
128
129// Affects: Should be without side effects.
130#ifdef FocusOut
131#ifndef FIXX11H_FocusOut
132#define FIXX11H_FocusOut
133const int XFocusOut = FocusOut;
134#undef FocusOut
135const int FocusOut = XFocusOut;
136#endif
137#undef FocusOut
138#endif
139
140// Affects: Should be without side effects.
141#ifdef Always
142#ifndef FIXX11H_Always
143#define FIXX11H_Always
144const int XAlways = Always;
145#undef Always
146const int Always = XAlways;
147#endif
148#undef Always
149#endif
150
151// Affects: Should be without side effects.
152#ifdef Success
153#ifndef FIXX11H_Success
154#define FIXX11H_Success
155const int XSuccess = Success;
156#undef Success
157const int Success = XSuccess;
158#endif
159#undef Success
160#endif
161
162// Affects: Should be without side effects.
163#ifdef GrayScale
164#ifndef FIXX11H_GrayScale
165#define FIXX11H_GrayScale
166const int XGrayScale = GrayScale;
167#undef GrayScale
168const int GrayScale = XGrayScale;
169#endif
170#undef GrayScale
171#endif
172
173// Affects: Should be without side effects.
174#ifdef Status
175#ifndef FIXX11H_Status
176#define FIXX11H_Status
177typedef Status XStatus;
178#undef Status
179typedef XStatus Status;
180#endif
181#undef Status
182#endif
183
184// Affects: Should be without side effects.
185#ifdef CursorShape
186#ifndef FIXX11H_CursorShape
187#define FIXX11H_CursorShape
188const int XCursorShape = CursorShape;
189#undef CursorShape
190const int CursorShape = CursorShape;
191#endif
192#undef CursorShape
193#endif
194
195// template --->
196// Affects: Should be without side effects.
197#ifdef index
198#ifndef FIXX11H_index
199#define FIXX11H_index
200inline
201char* Xindex( const char* s, int c )
202 {
203 return index( s, c );
204 }
205#undef index
206inline
207char* index( const char* s, int c )
208 {
209 return Xindex( s, c );
210 }
211#endif
212#undef index
213#endif
214// template <---
215
216#ifdef rindex
217// Affects: Should be without side effects.
218#ifndef FIXX11H_rindex
219#define FIXX11H_rindex
220inline
221char* Xrindex( const char* s, int c )
222 {
223 return rindex( s, c );
224 }
225#undef rindex
226inline
227char* rindex( const char* s, int c )
228 {
229 return Xrindex( s, c );
230 }
231#endif
232#undef rindex
233#endif
234}
235
236using namespace X;

tdecore

Skip menu "tdecore"
  • Main Page
  • Modules
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

tdecore

Skip menu "tdecore"
  • arts
  • dcop
  • dnssd
  • interfaces
  •   kspeech
  •     interface
  •     library
  •   tdetexteditor
  • kate
  • kded
  • kdoctools
  • kimgio
  • kjs
  • libtdemid
  • libtdescreensaver
  • tdeabc
  • tdecmshell
  • tdecore
  • tdefx
  • tdehtml
  • tdeinit
  • tdeio
  •   bookmarks
  •   httpfilter
  •   kpasswdserver
  •   kssl
  •   tdefile
  •   tdeio
  •   tdeioexec
  • tdeioslave
  •   http
  • tdemdi
  •   tdemdi
  • tdenewstuff
  • tdeparts
  • tdeprint
  • tderandr
  • tderesources
  • tdespell2
  • tdesu
  • tdeui
  • tdeunittest
  • tdeutils
  • tdewallet
Generated for tdecore by doxygen 1.9.4
This website is maintained by Timothy Pearson.