1 | /******************************************************************** |
2 | KWin - the KDE window manager |
3 | This file is part of the KDE project. |
4 | |
5 | Copyright (C) 2007 Rivo Laks <rivolaks@hot.ee> |
6 | |
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. |
11 | |
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. |
16 | |
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 | *********************************************************************/ |
20 | |
21 | #ifndef KWIN_COMPOSITINGPREFS_H |
22 | #define KWIN_COMPOSITINGPREFS_H |
23 | |
24 | #include <QString> |
25 | #include <QStringList> |
26 | |
27 | #include "kwinglutils.h" |
28 | #include "kwinglobals.h" |
29 | |
30 | |
31 | namespace KWin |
32 | { |
33 | |
34 | class CompositingPrefs |
35 | { |
36 | public: |
37 | CompositingPrefs(); |
38 | ~CompositingPrefs(); |
39 | |
40 | static bool compositingPossible(); |
41 | static QString compositingNotPossibleReason(); |
42 | static bool openGlIsBroken(); |
43 | /** |
44 | * Tests whether GLX is supported and returns @c true |
45 | * in case KWin is compiled with OpenGL support and GLX |
46 | * is available. |
47 | * |
48 | * If KWin is compiled with OpenGL ES or without OpenGL at |
49 | * all, @c false is returned. |
50 | * @returns @c true if GLX is available, @c false otherwise and if not build with OpenGL support. |
51 | **/ |
52 | static bool hasGlx(); |
53 | bool enableDirectRendering() const { |
54 | return mEnableDirectRendering; |
55 | } |
56 | |
57 | void detect(); |
58 | |
59 | private: |
60 | bool mEnableDirectRendering; |
61 | }; |
62 | |
63 | } |
64 | |
65 | #endif //KWIN_COMPOSITINGPREFS_H |
66 | |
67 | |
68 | |