• Skip to content
  • Skip to link menu
KDE 4.3 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 #ifdef _XTYPEDEF_BOOL /* Xdefs.h has typedef'ed Bool already */
00093  #undef Bool
00094 #else
00095  typedef Bool XBool;
00096  #undef Bool
00097  typedef XBool Bool;
00098 #endif
00099 #endif
00100 #undef Bool
00101 #define _XTYPEDEF_BOOL
00102 #endif
00103 // template <---
00104 
00105 // Affects: Should be without side effects.
00106 #ifdef KeyPress
00107 #ifndef FIXX11H_KeyPress
00108 #define FIXX11H_KeyPress
00109 const int XKeyPress = KeyPress;
00110 #undef KeyPress
00111 const int KeyPress = XKeyPress;
00112 #endif
00113 #undef KeyPress
00114 #endif
00115 
00116 // Affects: Should be without side effects.
00117 #ifdef KeyRelease
00118 #ifndef FIXX11H_KeyRelease
00119 #define FIXX11H_KeyRelease
00120 const int XKeyRelease = KeyRelease;
00121 #undef KeyRelease
00122 const int KeyRelease = XKeyRelease;
00123 #endif
00124 #undef KeyRelease
00125 #endif
00126 
00127 // Affects: Should be without side effects.
00128 #ifdef Above
00129 #ifndef FIXX11H_Above
00130 #define FIXX11H_Above
00131 const int XAbove = Above;
00132 #undef Above
00133 const int Above = XAbove;
00134 #endif
00135 #undef Above
00136 #endif
00137 
00138 // Affects: Should be without side effects.
00139 #ifdef Below
00140 #ifndef FIXX11H_Below
00141 #define FIXX11H_Below
00142 const int XBelow = Below;
00143 #undef Below
00144 const int Below = XBelow;
00145 #endif
00146 #undef Below
00147 #endif
00148 
00149 // Affects: Should be without side effects.
00150 #ifdef FocusIn
00151 #ifndef FIXX11H_FocusIn
00152 #define FIXX11H_FocusIn
00153 const int XFocusIn = FocusIn;
00154 #undef FocusIn
00155 const int FocusIn = XFocusIn;
00156 #endif
00157 #undef FocusIn
00158 #endif
00159 
00160 // Affects: Should be without side effects.
00161 #ifdef FocusOut
00162 #ifndef FIXX11H_FocusOut
00163 #define FIXX11H_FocusOut
00164 const int XFocusOut = FocusOut;
00165 #undef FocusOut
00166 const int FocusOut = XFocusOut;
00167 #endif
00168 #undef FocusOut
00169 #endif
00170 
00171 // Affects: Should be without side effects.
00172 #ifdef Always
00173 #ifndef FIXX11H_Always
00174 #define FIXX11H_Always
00175 const int XAlways = Always;
00176 #undef Always
00177 const int Always = XAlways;
00178 #endif
00179 #undef Always
00180 #endif
00181 
00182 // Affects: Should be without side effects.
00183 #ifdef Success
00184 #ifndef FIXX11H_Success
00185 #define FIXX11H_Success
00186 const int XSuccess = Success;
00187 #undef Success
00188 const int Success = XSuccess;
00189 #endif
00190 #undef Success
00191 #endif
00192 
00193 // Affects: Should be without side effects.
00194 #ifdef GrayScale
00195 #ifndef FIXX11H_GrayScale
00196 #define FIXX11H_GrayScale
00197 const int XGrayScale = GrayScale;
00198 #undef GrayScale
00199 const int GrayScale = XGrayScale;
00200 #endif
00201 #undef GrayScale
00202 #endif
00203 
00204 // Affects: Should be without side effects.
00205 #ifdef Status
00206 #ifndef FIXX11H_Status
00207 #define FIXX11H_Status
00208 typedef Status XStatus;
00209 #undef Status
00210 typedef XStatus Status;
00211 #endif
00212 #undef Status
00213 #endif
00214 
00215 // Affects: Should be without side effects.
00216 #ifdef CursorShape
00217 #ifndef FIXX11H_CursorShape
00218 #define FIXX11H_CursorShape
00219 const int XCursorShape = CursorShape;
00220 #undef CursorShape
00221 const int CursorShape = CursorShape;
00222 #endif
00223 #undef CursorShape
00224 #endif
00225 
00226 // template --->
00227 // Affects: Should be without side effects.
00228 #ifdef CursorShape
00229 #ifndef FIXX11H_CursorShape
00230 #define FIXX11H_CursorShape
00231 const int XCursorShape = CursorShape;
00232 #undef CursorShape
00233 const int CursorShape = XCursorShape;
00234 #endif
00235 #undef CursorShape
00236 #endif
00237 // template <---
00238 
00239 // template --->
00240 // Affects: Should be without side effects.
00241 #ifdef FontChange
00242 #ifndef FIXX11H_FontChange
00243 #define FIXX11H_FontChange
00244 const int XFontChange = FontChange;
00245 #undef FontChange
00246 const int FontChange = XFontChange;
00247 #endif
00248 #undef FontChange
00249 #endif
00250 // template <---
00251 
00252 // Affects: Should be without side effects.
00253 #ifdef NormalState
00254 #ifndef FIXX11H_NormalState
00255 #define FIXX11H_NormalState
00256 const XID XNormalState = NormalState;
00257 #undef NormalState
00258 const XID NormalState = XNormalState;
00259 #endif
00260 #undef NormalState
00261 #endif
00262 
00263 // template --->
00264 // Affects: Should be without side effects.
00265 #ifdef index
00266 #ifndef FIXX11H_index
00267 #define FIXX11H_index
00268 inline
00269 const char* Xindex( const char* s, int c )
00270     {
00271     return index( s, c );
00272     }
00273 #undef index
00274 inline
00275 const char* index( const char* s, int c )
00276     {
00277     return Xindex( s, c );
00278     }
00279 #endif
00280 #undef index
00281 #endif
00282 // template <---
00283 
00284 #ifdef rindex
00285 // Affects: Should be without side effects.
00286 #ifndef FIXX11H_rindex
00287 #define FIXX11H_rindex
00288 inline
00289 const char* Xrindex( const char* s, int c )
00290     {
00291     return rindex( s, c );
00292     }
00293 #undef rindex
00294 inline
00295 const char* rindex( const char* s, int c )
00296     {
00297     return Xrindex( s, c );
00298     }
00299 #endif
00300 #undef rindex
00301 #endif
00302 }
00303 
00304 using namespace X;
00305 
00306 #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
  • KPty
  • Kross
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Generated for kdelibs by doxygen 1.6.1
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