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
25 #include <QStringList>
27 #include "kwinglutils.h"
28 #include "kwinglobals.h"
34 class CompositingPrefs
40 class Version
: public QStringList
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
; }
64 QString
driver() const { return mDriver
; }
65 Version
version() const { return mVersion
; }
66 bool xgl() const { return mXgl
; }
71 void detectDriverAndVersion();
72 void applyDriverSpecificOptions();
73 static bool detectXgl();
75 bool initGLXContext();
76 void deleteGLXContext();
87 bool mEnableCompositing
;
89 bool mEnableDirectRendering
;
92 #ifdef KWIN_HAVE_OPENGL_COMPOSITING
93 GLXContext mGLContext
;
100 #endif //KWIN_COMPOSITINGPREFS_H