2002-01-16 12:26:03 +00:00
|
|
|
/*
|
|
|
|
This is the new kwindecoration kcontrol module
|
|
|
|
|
|
|
|
Copyright (c) 2001
|
|
|
|
Karol Szwed <gallium@kde.org>
|
|
|
|
http://gallium.n3.net/
|
|
|
|
|
|
|
|
Supports new kwin configuration plugins, and titlebar button position
|
|
|
|
modification via dnd interface.
|
|
|
|
|
2003-09-16 19:34:03 +00:00
|
|
|
Based on original "kwintheme" (Window Borders)
|
2002-01-16 12:26:03 +00:00
|
|
|
Copyright (C) 2001 Rik Hemsley (rikkus) <rik@kde.org>
|
2003-09-19 11:14:41 +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, write to the Free Software
|
|
|
|
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
|
|
|
|
2002-01-16 12:26:03 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef KWINDECORATION_H
|
|
|
|
#define KWINDECORATION_H
|
|
|
|
|
|
|
|
#include <kcmodule.h>
|
|
|
|
#include <dcopobject.h>
|
2003-09-16 19:34:03 +00:00
|
|
|
#include <buttons.h>
|
2002-01-16 12:26:03 +00:00
|
|
|
#include <kconfig.h>
|
|
|
|
#include <klibloader.h>
|
|
|
|
|
2003-09-24 12:41:56 +00:00
|
|
|
#include <kdecoration.h>
|
|
|
|
|
2002-01-16 12:26:03 +00:00
|
|
|
#include "kwindecorationIface.h"
|
|
|
|
|
2003-06-30 08:14:54 +00:00
|
|
|
class KComboBox;
|
2002-01-16 12:26:03 +00:00
|
|
|
class QCheckBox;
|
2003-06-30 08:14:54 +00:00
|
|
|
class QLabel;
|
2002-01-16 12:26:03 +00:00
|
|
|
class QTabWidget;
|
|
|
|
class QVBox;
|
2003-09-24 12:41:56 +00:00
|
|
|
class QSlider;
|
2002-01-16 12:26:03 +00:00
|
|
|
|
2003-09-16 19:34:03 +00:00
|
|
|
class KDecorationPlugins;
|
|
|
|
class KDecorationPreview;
|
|
|
|
|
2002-01-16 12:26:03 +00:00
|
|
|
// Stores themeName and its corresponding library Name
|
|
|
|
struct DecorationInfo
|
|
|
|
{
|
|
|
|
QString name;
|
|
|
|
QString libraryName;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2003-09-24 12:41:56 +00:00
|
|
|
class KWinDecorationModule : public KCModule, virtual public KWinDecorationIface, public KDecorationDefines
|
2002-01-16 12:26:03 +00:00
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
|
|
|
KWinDecorationModule(QWidget* parent, const char* name, const QStringList &);
|
|
|
|
~KWinDecorationModule();
|
|
|
|
|
|
|
|
virtual void load();
|
|
|
|
virtual void save();
|
|
|
|
virtual void defaults();
|
|
|
|
|
|
|
|
QString quickHelp() const;
|
|
|
|
const KAboutData* aboutData() const;
|
|
|
|
|
|
|
|
virtual void dcopUpdateClientList();
|
|
|
|
|
|
|
|
signals:
|
|
|
|
void pluginLoad( KConfig* conf );
|
|
|
|
void pluginSave( KConfig* conf );
|
|
|
|
void pluginDefaults();
|
|
|
|
|
|
|
|
protected slots:
|
|
|
|
// Allows us to turn "save" on
|
|
|
|
void slotSelectionChanged();
|
2003-06-30 08:14:54 +00:00
|
|
|
void slotChangeDecoration( const QString & );
|
2003-10-23 14:56:44 +00:00
|
|
|
void slotBorderChanged( int );
|
2002-01-16 12:26:03 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
void readConfig( KConfig* conf );
|
|
|
|
void writeConfig( KConfig* conf );
|
|
|
|
void findDecorations();
|
|
|
|
void createDecorationList();
|
|
|
|
void updateSelection();
|
|
|
|
QString decorationLibName( const QString& name );
|
|
|
|
QString decorationName ( QString& libName );
|
2003-10-23 14:56:44 +00:00
|
|
|
static QString styleToConfigLib( QString& styleLib );
|
2003-06-30 08:14:54 +00:00
|
|
|
void resetPlugin( KConfig* conf, const QString& currentDecoName = QString::null );
|
2002-01-16 12:26:03 +00:00
|
|
|
void resetKWin();
|
2003-10-23 14:56:44 +00:00
|
|
|
void checkSupportedBorderSizes();
|
|
|
|
static int borderSizeToIndex( BorderSize size, QValueList< BorderSize > sizes );
|
|
|
|
static BorderSize indexToBorderSize( int index, QValueList< BorderSize > sizes );
|
2002-01-16 12:26:03 +00:00
|
|
|
|
|
|
|
QTabWidget* tabWidget;
|
|
|
|
|
|
|
|
// Page 1
|
2003-06-30 08:14:54 +00:00
|
|
|
KComboBox* decorationList;
|
2002-01-16 12:26:03 +00:00
|
|
|
QValueList<DecorationInfo> decorations;
|
2003-09-16 19:34:03 +00:00
|
|
|
|
2003-10-23 14:56:44 +00:00
|
|
|
KDecorationPreview* preview;
|
|
|
|
KDecorationPlugins* plugins;
|
|
|
|
KConfig kwinConfig;
|
2003-09-16 19:34:03 +00:00
|
|
|
|
2002-01-16 12:26:03 +00:00
|
|
|
QCheckBox* cbUseCustomButtonPositions;
|
|
|
|
// QCheckBox* cbUseMiniWindows;
|
|
|
|
QCheckBox* cbShowToolTips;
|
2003-10-23 14:56:44 +00:00
|
|
|
QLabel* lBorder;
|
|
|
|
QSlider* slBorder;
|
|
|
|
BorderSize border_size;
|
2002-01-16 12:26:03 +00:00
|
|
|
|
2003-07-29 13:12:39 +00:00
|
|
|
QObject* pluginObject;
|
2003-10-23 14:56:44 +00:00
|
|
|
QGroupBox* pluginSettingsGrp;
|
2003-09-16 19:34:03 +00:00
|
|
|
QWidget* pluginConfigWidget;
|
2002-01-16 12:26:03 +00:00
|
|
|
QString currentLibraryName;
|
|
|
|
QString oldLibraryName;
|
|
|
|
QObject* (*allocatePlugin)( KConfig* conf, QWidget* parent );
|
2003-09-16 19:34:03 +00:00
|
|
|
|
|
|
|
// Page 2
|
|
|
|
ButtonDropSite* dropSite;
|
|
|
|
ButtonSource* buttonSource;
|
2003-05-31 17:40:57 +00:00
|
|
|
QGroupBox* buttonBox;
|
2003-09-16 19:34:03 +00:00
|
|
|
QVBox* buttonPage;
|
2002-01-16 12:26:03 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
#endif
|
|
|
|
// vim: ts=4
|