2007-11-27 19:40:25 +00:00
|
|
|
/********************************************************************
|
2007-09-18 13:59:06 +00:00
|
|
|
KWin - the KDE window manager
|
|
|
|
This file is part of the KDE project.
|
|
|
|
|
|
|
|
Copyright (C) 2007 Rivo Laks <rivolaks@hot.ee>
|
|
|
|
|
2007-11-27 19:40:25 +00:00
|
|
|
This program is free software; you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation; either version 2 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*********************************************************************/
|
2007-09-18 13:59:06 +00:00
|
|
|
|
|
|
|
#ifndef KWIN_COMPOSITINGPREFS_H
|
|
|
|
#define KWIN_COMPOSITINGPREFS_H
|
|
|
|
|
|
|
|
#include <QString>
|
|
|
|
#include <QStringList>
|
|
|
|
|
|
|
|
#include "kwinglutils.h"
|
2008-10-15 13:41:53 +00:00
|
|
|
#include "kwinglobals.h"
|
2007-09-18 13:59:06 +00:00
|
|
|
|
|
|
|
|
|
|
|
namespace KWin
|
|
|
|
{
|
|
|
|
|
|
|
|
class CompositingPrefs
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
CompositingPrefs();
|
|
|
|
~CompositingPrefs();
|
|
|
|
|
|
|
|
class Version : public QStringList
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
Version() : QStringList() {}
|
|
|
|
Version( const QString& str );
|
|
|
|
|
|
|
|
int compare( const Version& v ) const;
|
|
|
|
|
|
|
|
bool operator<( const Version& v ) const { return ( compare( v ) == -1 ); }
|
|
|
|
bool operator<=( const Version& v ) const { return ( compare( v ) != 1 ); }
|
|
|
|
bool operator>( const Version& v ) const { return ( compare( v ) == 1 ); }
|
|
|
|
bool operator>=( const Version& v ) const { return ( compare( v ) != -1 ); }
|
|
|
|
};
|
|
|
|
|
2007-09-26 16:34:08 +00:00
|
|
|
static bool compositingPossible();
|
2007-11-12 16:32:25 +00:00
|
|
|
static QString compositingNotPossibleReason();
|
2008-10-15 13:41:53 +00:00
|
|
|
bool validateSetup( CompositingType compositingType ) const;
|
2008-01-03 19:10:44 +00:00
|
|
|
bool enableCompositing() const;
|
2007-09-18 13:59:06 +00:00
|
|
|
bool enableVSync() const { return mEnableVSync; }
|
|
|
|
bool enableDirectRendering() const { return mEnableDirectRendering; }
|
2007-10-17 15:37:14 +00:00
|
|
|
bool strictBinding() const { return mStrictBinding; }
|
2007-09-18 13:59:06 +00:00
|
|
|
|
|
|
|
void detect();
|
|
|
|
|
|
|
|
QString driver() const { return mDriver; }
|
|
|
|
Version version() const { return mVersion; }
|
2007-10-17 15:37:14 +00:00
|
|
|
bool xgl() const { return mXgl; }
|
2007-09-18 13:59:06 +00:00
|
|
|
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
|
|
|
void detectDriverAndVersion();
|
|
|
|
void applyDriverSpecificOptions();
|
2007-10-17 15:37:14 +00:00
|
|
|
static bool detectXgl();
|
2007-09-18 13:59:06 +00:00
|
|
|
|
2008-01-22 17:04:41 +00:00
|
|
|
bool initGLXContext();
|
2007-09-18 13:59:06 +00:00
|
|
|
void deleteGLXContext();
|
|
|
|
|
|
|
|
|
|
|
|
private:
|
2007-09-27 13:59:58 +00:00
|
|
|
QString mGLVendor;
|
|
|
|
QString mGLRenderer;
|
|
|
|
QString mGLVersion;
|
2007-09-18 13:59:06 +00:00
|
|
|
QString mDriver;
|
|
|
|
Version mVersion;
|
2007-10-17 15:37:14 +00:00
|
|
|
bool mXgl;
|
2007-09-18 13:59:06 +00:00
|
|
|
|
|
|
|
bool mEnableCompositing;
|
|
|
|
bool mEnableVSync;
|
|
|
|
bool mEnableDirectRendering;
|
2007-10-17 15:37:14 +00:00
|
|
|
bool mStrictBinding;
|
2007-09-18 13:59:06 +00:00
|
|
|
|
2007-12-17 14:14:53 +00:00
|
|
|
#ifdef KWIN_HAVE_OPENGL_COMPOSITING
|
2007-09-18 13:59:06 +00:00
|
|
|
GLXContext mGLContext;
|
|
|
|
Window mGLWindow;
|
2007-09-18 14:48:01 +00:00
|
|
|
#endif
|
2007-09-18 13:59:06 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif //KWIN_COMPOSITINGPREFS_H
|
|
|
|
|
|
|
|
|