add more spacing
[personal-kdebase.git] / workspace / kwin / compositingprefs.h
blobc0722bb8a2c7ef9564f245240daa37c50341477a
1 /********************************************************************
2 KWin - the KDE window manager
3 This file is part of the KDE project.
5 Copyright (C) 2007 Rivo Laks <rivolaks@hot.ee>
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2 of the License, or
10 (at your option) any later version.
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with this program. If not, see <http://www.gnu.org/licenses/>.
19 *********************************************************************/
21 #ifndef KWIN_COMPOSITINGPREFS_H
22 #define KWIN_COMPOSITINGPREFS_H
24 #include <QString>
25 #include <QStringList>
27 #include "kwinglutils.h"
28 #include "kwinglobals.h"
31 namespace KWin
34 class CompositingPrefs
36 public:
37 CompositingPrefs();
38 ~CompositingPrefs();
40 class Version : public QStringList
42 public:
43 Version() : QStringList() {}
44 Version( const QString& str );
46 int compare( const Version& v ) const;
48 bool operator<( const Version& v ) const { return ( compare( v ) == -1 ); }
49 bool operator<=( const Version& v ) const { return ( compare( v ) != 1 ); }
50 bool operator>( const Version& v ) const { return ( compare( v ) == 1 ); }
51 bool operator>=( const Version& v ) const { return ( compare( v ) != -1 ); }
54 static bool compositingPossible();
55 static QString compositingNotPossibleReason();
56 bool validateSetup( CompositingType compositingType ) const;
57 bool enableCompositing() const;
58 bool enableVSync() const { return mEnableVSync; }
59 bool enableDirectRendering() const { return mEnableDirectRendering; }
60 bool strictBinding() const { return mStrictBinding; }
62 void detect();
64 QString driver() const { return mDriver; }
65 Version version() const { return mVersion; }
66 bool xgl() const { return mXgl; }
69 protected:
71 void detectDriverAndVersion();
72 void applyDriverSpecificOptions();
73 static bool detectXgl();
75 bool initGLXContext();
76 void deleteGLXContext();
79 private:
80 QString mGLVendor;
81 QString mGLRenderer;
82 QString mGLVersion;
83 QString mDriver;
84 Version mVersion;
85 bool mXgl;
87 bool mEnableCompositing;
88 bool mEnableVSync;
89 bool mEnableDirectRendering;
90 bool mStrictBinding;
92 #ifdef KWIN_HAVE_OPENGL_COMPOSITING
93 GLXContext mGLContext;
94 Window mGLWindow;
95 #endif
100 #endif //KWIN_COMPOSITINGPREFS_H