kdecore Library: fixx11h.h Source File (kdecore Library)

| # kdecore Library API Documentation
Overview | Class Hierarchy | Classes | Classes (annotated) | Members | Namespaces | Source Files

# fixx11h.h

    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 // template --->
    00182 // Affects: Should be without side effects.
    00183 #ifdef index
    00184 #ifndef FIXX11H_index
    00185 #define FIXX11H_index
    00186 inline
    00187 char* Xindex( const char* s, int c )
    00188     {
    00189     return index( s, c );
    00190     }
    00191 #undef index
    00192 inline
    00193 char* index( const char* s, int c )
    00194     {
    00195     return Xindex( s, c );
    00196     }
    00197 #endif
    00198 #undef index
    00199 #endif
    00200 // template <---
    00201
    00202 #ifdef rindex
    00203 // Affects: Should be without side effects.
    00204 #ifndef FIXX11H_rindex
    00205 #define FIXX11H_rindex
    00206 inline
    00207 char* Xrindex( const char* s, int c )
    00208     {
    00209     return rindex( s, c );
    00210     }
    00211 #undef rindex
    00212 inline
    00213 char* rindex( const char* s, int c )
    00214     {
    00215     return Xrindex( s, c );
    00216     }
    00217 #endif
    00218 #undef rindex
    00219 #endif
    00220 }
    00221
    00222 using namespace X;

This file is part of the documentation for kdecore Library Version 3.4.1.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Sat Jun 11 20:18:00 2005 by doxygen 1.4.1 written by Dimitri van Heesch, © 1997-2003