KWinLibraries
kwinglobals.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef KWIN_LIB_KWINGLOBALS_H
00022 #define KWIN_LIB_KWINGLOBALS_H
00023
00024 #include <QtGui/QX11Info>
00025 #include <QtCore/QPoint>
00026 #include <QtGui/QRegion>
00027
00028 #include <kdemacros.h>
00029
00030 #include <X11/Xlib.h>
00031 #include <fixx11h.h>
00032
00033 #include <kwinconfig.h>
00034
00035 #define KWIN_EXPORT KDE_EXPORT
00036
00037 namespace KWin
00038 {
00039
00040
00041 enum CompositingType
00042 {
00043 NoCompositing = 0,
00044 OpenGLCompositing,
00045 XRenderCompositing
00046 };
00047
00048 enum clientAreaOption
00049 {
00050 PlacementArea,
00051 MovementArea,
00052 MaximizeArea,
00053 MaximizeFullArea,
00054 FullScreenArea,
00055
00056 WorkArea,
00057 FullArea,
00058 ScreenArea
00059 };
00060
00061 enum ElectricBorder
00062 {
00063 ElectricTop,
00064 ElectricTopRight,
00065 ElectricRight,
00066 ElectricBottomRight,
00067 ElectricBottom,
00068 ElectricBottomLeft,
00069 ElectricLeft,
00070 ElectricTopLeft,
00071 ELECTRIC_COUNT,
00072 ElectricNone
00073 };
00074
00075
00076
00077
00078 enum TabBoxMode { TabBoxDesktopMode, TabBoxDesktopListMode, TabBoxWindowsMode };
00079
00080 inline
00081 KWIN_EXPORT Display* display()
00082 {
00083 return QX11Info::display();
00084 }
00085
00086 inline
00087 KWIN_EXPORT Window rootWindow()
00088 {
00089 return QX11Info::appRootWindow();
00090 }
00091
00092 inline
00093 KWIN_EXPORT Window xTime()
00094 {
00095 return QX11Info::appTime();
00096 }
00097
00098 inline
00099 KWIN_EXPORT int displayWidth()
00100 {
00101 return XDisplayWidth( display(), DefaultScreen( display()));
00102 }
00103
00104 inline
00105 KWIN_EXPORT int displayHeight()
00106 {
00107 return XDisplayHeight( display(), DefaultScreen( display()));
00108 }
00109
00111 class KWIN_EXPORT Extensions
00112 {
00113 public:
00114 static void init();
00115 static bool shapeAvailable() { return shape_version > 0; }
00116 static bool shapeInputAvailable();
00117 static int shapeNotifyEvent();
00118 static bool hasShape( Window w );
00119 static bool randrAvailable() { return has_randr; }
00120 static int randrNotifyEvent();
00121 static bool damageAvailable() { return has_damage; }
00122 static int damageNotifyEvent();
00123 static bool compositeAvailable() { return composite_version > 0; }
00124 static bool compositeOverlayAvailable();
00125 static bool renderAvailable() { return render_version > 0; }
00126 static bool fixesAvailable() { return fixes_version > 0; }
00127 static bool fixesRegionAvailable();
00128 static bool glxAvailable() { return has_glx; }
00129 static bool syncAvailable() { return has_sync; }
00130 static int syncAlarmNotifyEvent();
00131 static void fillExtensionsData( const char**& extensions, int& nextensions, int*&majors, int*& error_bases );
00132 private:
00133 static void addData( const char* name );
00134 static int shape_version;
00135 static int shape_event_base;
00136 static bool has_randr;
00137 static int randr_event_base;
00138 static bool has_damage;
00139 static int damage_event_base;
00140 static int composite_version;
00141 static int render_version;
00142 static int fixes_version;
00143 static bool has_glx;
00144 static bool has_sync;
00145 static int sync_event_base;
00146 static const char* data_extensions[ 32 ];
00147 static int data_nextensions;
00148 static int data_opcodes[ 32 ];
00149 static int data_error_bases[ 32 ];
00150 };
00151
00152 }
00153
00154 #endif