Eneboo - Documentación para desarrolladores
|
00001 //#ifdef don't do this, this file is supposed to be included 00002 //#define multiple times 00003 00004 /* Usage: 00005 00006 If you get compile errors caused by X11 includes (the line 00007 where first error appears contains word like None, Unsorted, 00008 Below, etc.), put #include <fixx11h.h> in the .cpp file 00009 (not .h file!) between the place where X11 headers are 00010 included and the place where the file with compile 00011 error is included (or the place where the compile error 00012 in the .cpp file occurs). 00013 00014 This file remaps X11 #defines to const variables or 00015 inline functions. The side effect may be that these 00016 symbols may now refer to different variables 00017 (e.g. if X11 #defined NoButton, after this file 00018 is included NoButton would no longer be X11's 00019 NoButton, but Qt::NoButton instead). At this time, 00020 there's no conflict known that could cause problems. 00021 00022 The original X11 symbols are still accessible 00023 (e.g. for None) as X::None, XNone, and also still 00024 None, unless name lookup finds different None 00025 first (in the current class, etc.) 00026 00027 Use 'Unsorted', 'Bool' and 'index' as templates. 00028 00029 */ 00030 00031 namespace X 00032 { 00033 00034 // template ---> 00035 // Affects: Should be without side effects. 00036 #ifdef Unsorted 00037 #ifndef FIXX11H_Unsorted 00038 #define FIXX11H_Unsorted 00039 const int XUnsorted = Unsorted; 00040 #undef Unsorted 00041 const int Unsorted = XUnsorted; 00042 #endif 00043 #undef Unsorted 00044 #endif 00045 // template <--- 00046 00047 // Affects: Should be without side effects. 00048 #ifdef None 00049 #ifndef FIXX11H_None 00050 #define FIXX11H_None 00051 const XID XNone = None; 00052 #undef None 00053 const XID None = XNone; 00054 #endif 00055 #undef None 00056 #endif 00057 00058 // template ---> 00059 // Affects: Should be without side effects. 00060 #ifdef Bool 00061 #ifndef FIXX11H_Bool 00062 #define FIXX11H_Bool 00063 typedef Bool XBool; 00064 #undef Bool 00065 typedef XBool Bool; 00066 #endif 00067 #undef Bool 00068 #endif 00069 // template <--- 00070 00071 // Affects: Should be without side effects. 00072 #ifdef KeyPress 00073 #ifndef FIXX11H_KeyPress 00074 #define FIXX11H_KeyPress 00075 const int XKeyPress = KeyPress; 00076 #undef KeyPress 00077 const int KeyPress = XKeyPress; 00078 #endif 00079 #undef KeyPress 00080 #endif 00081 00082 // Affects: Should be without side effects. 00083 #ifdef KeyRelease 00084 #ifndef FIXX11H_KeyRelease 00085 #define FIXX11H_KeyRelease 00086 const int XKeyRelease = KeyRelease; 00087 #undef KeyRelease 00088 const int KeyRelease = XKeyRelease; 00089 #endif 00090 #undef KeyRelease 00091 #endif 00092 00093 // Affects: Should be without side effects. 00094 #ifdef Above 00095 #ifndef FIXX11H_Above 00096 #define FIXX11H_Above 00097 const int XAbove = Above; 00098 #undef Above 00099 const int Above = XAbove; 00100 #endif 00101 #undef Above 00102 #endif 00103 00104 // Affects: Should be without side effects. 00105 #ifdef Below 00106 #ifndef FIXX11H_Below 00107 #define FIXX11H_Below 00108 const int XBelow = Below; 00109 #undef Below 00110 const int Below = XBelow; 00111 #endif 00112 #undef Below 00113 #endif 00114 00115 // Affects: Should be without side effects. 00116 #ifdef FocusIn 00117 #ifndef FIXX11H_FocusIn 00118 #define FIXX11H_FocusIn 00119 const int XFocusIn = FocusIn; 00120 #undef FocusIn 00121 const int FocusIn = XFocusIn; 00122 #endif 00123 #undef FocusIn 00124 #endif 00125 00126 // Affects: Should be without side effects. 00127 #ifdef FocusOut 00128 #ifndef FIXX11H_FocusOut 00129 #define FIXX11H_FocusOut 00130 const int XFocusOut = FocusOut; 00131 #undef FocusOut 00132 const int FocusOut = XFocusOut; 00133 #endif 00134 #undef FocusOut 00135 #endif 00136 00137 // Affects: Should be without side effects. 00138 #ifdef Always 00139 #ifndef FIXX11H_Always 00140 #define FIXX11H_Always 00141 const int XAlways = Always; 00142 #undef Always 00143 const int Always = XAlways; 00144 #endif 00145 #undef Always 00146 #endif 00147 00148 // Affects: Should be without side effects. 00149 #ifdef Success 00150 #ifndef FIXX11H_Success 00151 #define FIXX11H_Success 00152 const int XSuccess = Success; 00153 #undef Success 00154 const int Success = XSuccess; 00155 #endif 00156 #undef Success 00157 #endif 00158 00159 // Affects: Should be without side effects. 00160 #ifdef GrayScale 00161 #ifndef FIXX11H_GrayScale 00162 #define FIXX11H_GrayScale 00163 const int XGrayScale = GrayScale; 00164 #undef GrayScale 00165 const int GrayScale = XGrayScale; 00166 #endif 00167 #undef GrayScale 00168 #endif 00169 00170 // Affects: Should be without side effects. 00171 #ifdef Status 00172 #ifndef FIXX11H_Status 00173 #define FIXX11H_Status 00174 typedef Status XStatus; 00175 #undef Status 00176 typedef XStatus Status; 00177 #endif 00178 #undef Status 00179 #endif 00180 00181 // Affects: Should be without side effects. 00182 #ifdef CursorShape 00183 #ifndef FIXX11H_CursorShape 00184 #define FIXX11H_CursorShape 00185 const int XCursorShape = CursorShape; 00186 #undef CursorShape 00187 const int CursorShape = CursorShape; 00188 #endif 00189 #undef CursorShape 00190 #endif 00191 00192 // template ---> 00193 // Affects: Should be without side effects. 00194 #ifdef index 00195 #ifndef FIXX11H_index 00196 #define FIXX11H_index 00197 inline 00198 char* Xindex( const char* s, int c ) 00199 { 00200 return index( s, c ); 00201 } 00202 #undef index 00203 inline 00204 char* index( const char* s, int c ) 00205 { 00206 return Xindex( s, c ); 00207 } 00208 #endif 00209 #undef index 00210 #endif 00211 // template <--- 00212 00213 #ifdef rindex 00214 // Affects: Should be without side effects. 00215 #ifndef FIXX11H_rindex 00216 #define FIXX11H_rindex 00217 inline 00218 char* Xrindex( const char* s, int c ) 00219 { 00220 return rindex( s, c ); 00221 } 00222 #undef rindex 00223 inline 00224 char* rindex( const char* s, int c ) 00225 { 00226 return Xrindex( s, c ); 00227 } 00228 #endif 00229 #undef rindex 00230 #endif 00231 } 00232 00233 using namespace X;