• Skip to content
  • Skip to link menu
KDE 4.2 API Reference
  • KDE API Reference
  • kdelibs
  • Sitemap
  • Contact Us
 

KDEUI

fixx11h.h

Go to the documentation of this file.
00001 /****************************************************************************
00002 
00003  Copyright (C) 2003 Lubos Lunak        <l.lunak@kde.org>
00004 
00005 Permission is hereby granted, free of charge, to any person obtaining a
00006 copy of this software and associated documentation files (the "Software"),
00007 to deal in the Software without restriction, including without limitation
00008 the rights to use, copy, modify, merge, publish, distribute, sublicense,
00009 and/or sell copies of the Software, and to permit persons to whom the
00010 Software is furnished to do so, subject to the following conditions:
00011 
00012 The above copyright notice and this permission notice shall be included in
00013 all copies or substantial portions of the Software.
00014 
00015 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
00016 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
00017 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
00018 THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
00019 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
00020 FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
00021 DEALINGS IN THE SOFTWARE.
00022 
00023 ****************************************************************************/
00024 
00025 
00026 //#ifdef    don't do this, this file is supposed to be included
00027 //#define   multiple times
00028 
00029 #include <QtCore/QtGlobal>
00030 
00031 #ifdef Q_WS_X11
00032 
00033 /* Usage:
00034 
00035  If you get compile errors caused by X11 includes (the line
00036  where first error appears contains word like None, Unsorted,
00037  Below, etc.), put #include <fixx11h.h> in the .cpp file 
00038  (not .h file!) between the place where X11 headers are
00039  included and the place where the file with compile
00040  error is included (or the place where the compile error
00041  in the .cpp file occurs).
00042  
00043  This file remaps X11 #defines to const variables or
00044  inline functions. The side effect may be that these
00045  symbols may now refer to different variables
00046  (e.g. if X11 #defined NoButton, after this file
00047  is included NoButton would no longer be X11's
00048  NoButton, but Qt::NoButton instead). At this time,
00049  there's no conflict known that could cause problems.
00050 
00051  The original X11 symbols are still accessible
00052  (e.g. for None) as X::None, XNone, and also still
00053  None, unless name lookup finds different None
00054  first (in the current class, etc.)
00055 
00056  Use 'Unsorted', 'Bool' and 'index' as templates.
00057 
00058 */
00059 
00060 namespace X
00061 {
00062 
00063 // template --->
00064 // Affects: Should be without side effects.
00065 #ifdef Unsorted
00066 #ifndef FIXX11H_Unsorted
00067 #define FIXX11H_Unsorted
00068 const int XUnsorted = Unsorted;
00069 #undef Unsorted
00070 const int Unsorted = XUnsorted;
00071 #endif
00072 #undef Unsorted
00073 #endif
00074 // template <---
00075 
00076 // Affects: Should be without side effects.
00077 #ifdef None
00078 #ifndef FIXX11H_None
00079 #define FIXX11H_None
00080 const XID XNone = None;
00081 #undef None
00082 const XID None = XNone;
00083 #endif
00084 #undef None
00085 #endif
00086 
00087 // template --->
00088 // Affects: Should be without side effects.
00089 #ifdef Bool
00090 #ifndef FIXX11H_Bool
00091 #define FIXX11H_Bool
00092 typedef Bool XBool;
00093 #undef Bool
00094 typedef XBool Bool;
00095 #endif
00096 #undef Bool
00097 #endif
00098 // template <---
00099 
00100 // Affects: Should be without side effects.
00101 #ifdef KeyPress
00102 #ifndef FIXX11H_KeyPress
00103 #define FIXX11H_KeyPress
00104 const int XKeyPress = KeyPress;
00105 #undef KeyPress
00106 const int KeyPress = XKeyPress;
00107 #endif
00108 #undef KeyPress
00109 #endif
00110 
00111 // Affects: Should be without side effects.
00112 #ifdef KeyRelease
00113 #ifndef FIXX11H_KeyRelease
00114 #define FIXX11H_KeyRelease
00115 const int XKeyRelease = KeyRelease;
00116 #undef KeyRelease
00117 const int KeyRelease = XKeyRelease;
00118 #endif
00119 #undef KeyRelease
00120 #endif
00121 
00122 // Affects: Should be without side effects.
00123 #ifdef Above
00124 #ifndef FIXX11H_Above
00125 #define FIXX11H_Above
00126 const int XAbove = Above;
00127 #undef Above
00128 const int Above = XAbove;
00129 #endif
00130 #undef Above
00131 #endif
00132 
00133 // Affects: Should be without side effects.
00134 #ifdef Below
00135 #ifndef FIXX11H_Below
00136 #define FIXX11H_Below
00137 const int XBelow = Below;
00138 #undef Below
00139 const int Below = XBelow;
00140 #endif
00141 #undef Below
00142 #endif
00143 
00144 // Affects: Should be without side effects.
00145 #ifdef FocusIn
00146 #ifndef FIXX11H_FocusIn
00147 #define FIXX11H_FocusIn
00148 const int XFocusIn = FocusIn;
00149 #undef FocusIn
00150 const int FocusIn = XFocusIn;
00151 #endif
00152 #undef FocusIn
00153 #endif
00154 
00155 // Affects: Should be without side effects.
00156 #ifdef FocusOut
00157 #ifndef FIXX11H_FocusOut
00158 #define FIXX11H_FocusOut
00159 const int XFocusOut = FocusOut;
00160 #undef FocusOut
00161 const int FocusOut = XFocusOut;
00162 #endif
00163 #undef FocusOut
00164 #endif
00165 
00166 // Affects: Should be without side effects.
00167 #ifdef Always
00168 #ifndef FIXX11H_Always
00169 #define FIXX11H_Always
00170 const int XAlways = Always;
00171 #undef Always
00172 const int Always = XAlways;
00173 #endif
00174 #undef Always
00175 #endif
00176 
00177 // Affects: Should be without side effects.
00178 #ifdef Success
00179 #ifndef FIXX11H_Success
00180 #define FIXX11H_Success
00181 const int XSuccess = Success;
00182 #undef Success
00183 const int Success = XSuccess;
00184 #endif
00185 #undef Success
00186 #endif
00187 
00188 // Affects: Should be without side effects.
00189 #ifdef GrayScale
00190 #ifndef FIXX11H_GrayScale
00191 #define FIXX11H_GrayScale
00192 const int XGrayScale = GrayScale;
00193 #undef GrayScale
00194 const int GrayScale = XGrayScale;
00195 #endif
00196 #undef GrayScale
00197 #endif
00198 
00199 // Affects: Should be without side effects.
00200 #ifdef Status
00201 #ifndef FIXX11H_Status
00202 #define FIXX11H_Status
00203 typedef Status XStatus;
00204 #undef Status
00205 typedef XStatus Status;
00206 #endif
00207 #undef Status
00208 #endif
00209 
00210 // Affects: Should be without side effects.
00211 #ifdef CursorShape
00212 #ifndef FIXX11H_CursorShape
00213 #define FIXX11H_CursorShape
00214 const int XCursorShape = CursorShape;
00215 #undef CursorShape
00216 const int CursorShape = CursorShape;
00217 #endif
00218 #undef CursorShape
00219 #endif
00220 
00221 // template --->
00222 // Affects: Should be without side effects.
00223 #ifdef CursorShape
00224 #ifndef FIXX11H_CursorShape
00225 #define FIXX11H_CursorShape
00226 const int XCursorShape = CursorShape;
00227 #undef CursorShape
00228 const int CursorShape = XCursorShape;
00229 #endif
00230 #undef CursorShape
00231 #endif
00232 // template <---
00233 
00234 // template --->
00235 // Affects: Should be without side effects.
00236 #ifdef FontChange
00237 #ifndef FIXX11H_FontChange
00238 #define FIXX11H_FontChange
00239 const int XFontChange = FontChange;
00240 #undef FontChange
00241 const int FontChange = XFontChange;
00242 #endif
00243 #undef FontChange
00244 #endif
00245 // template <---
00246 
00247 
00248 // template --->
00249 // Affects: Should be without side effects.
00250 #ifdef index
00251 #ifndef FIXX11H_index
00252 #define FIXX11H_index
00253 inline
00254 char* Xindex( const char* s, int c )
00255     {
00256     return index( s, c );
00257     }
00258 #undef index
00259 inline
00260 char* index( const char* s, int c )
00261     {
00262     return Xindex( s, c );
00263     }
00264 #endif
00265 #undef index
00266 #endif
00267 // template <---
00268 
00269 #ifdef rindex
00270 // Affects: Should be without side effects.
00271 #ifndef FIXX11H_rindex
00272 #define FIXX11H_rindex
00273 inline
00274 char* Xrindex( const char* s, int c )
00275     {
00276     return rindex( s, c );
00277     }
00278 #undef rindex
00279 inline
00280 char* rindex( const char* s, int c )
00281     {
00282     return Xrindex( s, c );
00283     }
00284 #endif
00285 #undef rindex
00286 #endif
00287 }
00288 
00289 using namespace X;
00290 
00291 #endif

KDEUI

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

kdelibs

Skip menu "kdelibs"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • Kate
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • Kross
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Generated for kdelibs by doxygen 1.5.7
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal