Start to port to new dbus
svn path=/trunk/KDE/kdebase/workspace/; revision=549040
This commit is contained in:
parent
5646eafb33
commit
e8bcbc84d3
6 changed files with 108 additions and 8 deletions
|
@ -3,7 +3,7 @@ include_directories( ${CMAKE_SOURCE_DIR}/workspace/kwin/lib )
|
||||||
|
|
||||||
########### next target ###############
|
########### next target ###############
|
||||||
|
|
||||||
set(kcm_kwindecoration_PART_SRCS kwindecoration.cpp buttons.cpp preview.cpp )
|
set(kcm_kwindecoration_PART_SRCS kwindecorationadaptor.cpp kwindecoration.cpp buttons.cpp preview.cpp )
|
||||||
|
|
||||||
kde4_automoc(${kcm_kwindecoration_PART_SRCS})
|
kde4_automoc(${kcm_kwindecoration_PART_SRCS})
|
||||||
|
|
||||||
|
|
|
@ -54,13 +54,14 @@
|
||||||
#include <kdialog.h>
|
#include <kdialog.h>
|
||||||
#include <kgenericfactory.h>
|
#include <kgenericfactory.h>
|
||||||
#include <kaboutdata.h>
|
#include <kaboutdata.h>
|
||||||
#include <dcopclient.h>
|
|
||||||
|
|
||||||
#include "kwindecoration.h"
|
#include "kwindecoration.h"
|
||||||
#include "preview.h"
|
#include "preview.h"
|
||||||
#include <kdecoration_plugins_p.h>
|
#include <kdecoration_plugins_p.h>
|
||||||
#include <kdecorationfactory.h>
|
#include <kdecorationfactory.h>
|
||||||
#include <kvbox.h>
|
#include <kvbox.h>
|
||||||
|
#include "kwindecorationadaptor.h"
|
||||||
|
#include <dbus/qdbus.h>
|
||||||
|
|
||||||
// KCModule plugin interface
|
// KCModule plugin interface
|
||||||
// =========================
|
// =========================
|
||||||
|
@ -68,12 +69,13 @@ typedef KGenericFactory<KWinDecorationModule, QWidget> KWinDecoFactory;
|
||||||
K_EXPORT_COMPONENT_FACTORY( kcm_kwindecoration, KWinDecoFactory("kcmkwindecoration") )
|
K_EXPORT_COMPONENT_FACTORY( kcm_kwindecoration, KWinDecoFactory("kcmkwindecoration") )
|
||||||
|
|
||||||
KWinDecorationModule::KWinDecorationModule(QWidget* parent, const QStringList &)
|
KWinDecorationModule::KWinDecorationModule(QWidget* parent, const QStringList &)
|
||||||
: DCOPObject("KWinClientDecoration"),
|
: KCModule(KWinDecoFactory::instance(), parent),
|
||||||
KCModule(KWinDecoFactory::instance(), parent),
|
|
||||||
kwinConfig("kwinrc"),
|
kwinConfig("kwinrc"),
|
||||||
pluginObject(0)
|
pluginObject(0)
|
||||||
{
|
{
|
||||||
kwinConfig.setGroup("Style");
|
new DecorationAdaptor(this);
|
||||||
|
QDBus::sessionBus().registerObject("/KWinClientDecoration", this);
|
||||||
|
kwinConfig.setGroup("Style");
|
||||||
plugins = new KDecorationPreviewPlugins( &kwinConfig );
|
plugins = new KDecorationPreviewPlugins( &kwinConfig );
|
||||||
|
|
||||||
QVBoxLayout* layout = new QVBoxLayout(this);
|
QVBoxLayout* layout = new QVBoxLayout(this);
|
||||||
|
@ -192,7 +194,7 @@ KWinDecorationModule::KWinDecorationModule(QWidget* parent, const QStringList &)
|
||||||
|
|
||||||
// Allow kwin dcop signal to update our selection list
|
// Allow kwin dcop signal to update our selection list
|
||||||
connectDCOPSignal("kwin", 0, "dcopResetAllClients()", "dcopUpdateClientList()", false);
|
connectDCOPSignal("kwin", 0, "dcopResetAllClients()", "dcopUpdateClientList()", false);
|
||||||
|
|
||||||
KAboutData *about =
|
KAboutData *about =
|
||||||
new KAboutData(I18N_NOOP("kcmkwindecoration"),
|
new KAboutData(I18N_NOOP("kcmkwindecoration"),
|
||||||
I18N_NOOP("Window Decoration Control Module"),
|
I18N_NOOP("Window Decoration Control Module"),
|
||||||
|
@ -616,10 +618,13 @@ QString KWinDecorationModule::quickHelp() const
|
||||||
|
|
||||||
void KWinDecorationModule::resetKWin()
|
void KWinDecorationModule::resetKWin()
|
||||||
{
|
{
|
||||||
|
#warning "kde4: port it to dbus call kwin*"
|
||||||
|
#if 0
|
||||||
bool ok = kapp->dcopClient()->send("kwin*", "KWinInterface",
|
bool ok = kapp->dcopClient()->send("kwin*", "KWinInterface",
|
||||||
"reconfigure()", QByteArray());
|
"reconfigure()", QByteArray());
|
||||||
if (!ok)
|
if (!ok)
|
||||||
kDebug() << "kcmkwindecoration: Could not reconfigure kwin" << endl;
|
kDebug() << "kcmkwindecoration: Could not reconfigure kwin" << endl;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
#include "kwindecoration.moc"
|
#include "kwindecoration.moc"
|
||||||
|
|
|
@ -38,7 +38,6 @@
|
||||||
|
|
||||||
#include <kdecoration.h>
|
#include <kdecoration.h>
|
||||||
|
|
||||||
#include "kwindecorationIface.h"
|
|
||||||
//Added by qt3to4:
|
//Added by qt3to4:
|
||||||
#include <QLabel>
|
#include <QLabel>
|
||||||
#include <kvbox.h>
|
#include <kvbox.h>
|
||||||
|
@ -61,7 +60,7 @@ struct DecorationInfo
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
class KWinDecorationModule : public KCModule, virtual public KWinDecorationIface, public KDecorationDefines
|
class KWinDecorationModule : public KCModule, public KDecorationDefines
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
|
|
45
kcmkwin/kwindecoration/kwindecorationadaptor.cpp
Normal file
45
kcmkwin/kwindecoration/kwindecorationadaptor.cpp
Normal file
|
@ -0,0 +1,45 @@
|
||||||
|
/*
|
||||||
|
* This file was generated by dbusidl2cpp version 0.5
|
||||||
|
* when processing input file org.kde.kwin.Decoration.xml
|
||||||
|
*
|
||||||
|
* dbusidl2cpp is Copyright (C) 2006 Trolltech AS. All rights reserved.
|
||||||
|
*
|
||||||
|
* This is an auto-generated file.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "kwindecorationadaptor.h"
|
||||||
|
#include <QtCore/QMetaObject>
|
||||||
|
#include <QtCore/QByteArray>
|
||||||
|
#include <QtCore/QList>
|
||||||
|
#include <QtCore/QMap>
|
||||||
|
#include <QtCore/QString>
|
||||||
|
#include <QtCore/QStringList>
|
||||||
|
#include <QtCore/QVariant>
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Implementation of adaptor class DecorationAdaptor
|
||||||
|
*/
|
||||||
|
|
||||||
|
DecorationAdaptor::DecorationAdaptor(QObject *parent)
|
||||||
|
: QDBusAbstractAdaptor(parent)
|
||||||
|
{
|
||||||
|
// constructor
|
||||||
|
setAutoRelaySignals(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
DecorationAdaptor::~DecorationAdaptor()
|
||||||
|
{
|
||||||
|
// destructor
|
||||||
|
}
|
||||||
|
|
||||||
|
void DecorationAdaptor::dcopUpdateClientList()
|
||||||
|
{
|
||||||
|
// handle method call org.kde.kwin.Decoration.dcopUpdateClientList
|
||||||
|
QMetaObject::invokeMethod(parent(), "dcopUpdateClientList");
|
||||||
|
|
||||||
|
// Alternative:
|
||||||
|
//static_cast<YourObjectType *>(parent())->dcopUpdateClientList();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#include "kwindecorationadaptor.moc"
|
44
kcmkwin/kwindecoration/kwindecorationadaptor.h
Normal file
44
kcmkwin/kwindecoration/kwindecorationadaptor.h
Normal file
|
@ -0,0 +1,44 @@
|
||||||
|
/*
|
||||||
|
* This file was generated by dbusidl2cpp version 0.5
|
||||||
|
* when processing input file org.kde.kwin.Decoration.xml
|
||||||
|
*
|
||||||
|
* dbusidl2cpp is Copyright (C) 2006 Trolltech AS. All rights reserved.
|
||||||
|
*
|
||||||
|
* This is an auto-generated file.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef KWINDECORATIONADAPTOR_H_55611149668415
|
||||||
|
#define KWINDECORATIONADAPTOR_H_55611149668415
|
||||||
|
|
||||||
|
#include <QtCore/QObject>
|
||||||
|
#include <dbus/qdbus.h>
|
||||||
|
class QByteArray;
|
||||||
|
template<class T> class QList;
|
||||||
|
template<class Key, class Value> class QMap;
|
||||||
|
class QString;
|
||||||
|
class QStringList;
|
||||||
|
class QVariant;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Adaptor class for interface org.kde.kwin.Decoration
|
||||||
|
*/
|
||||||
|
class DecorationAdaptor: public QDBusAbstractAdaptor
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
Q_CLASSINFO("D-Bus Interface", "org.kde.kwin.Decoration")
|
||||||
|
Q_CLASSINFO("D-Bus Introspection", ""
|
||||||
|
" <interface name=\"org.kde.kwin.Decoration\" >\n"
|
||||||
|
" <method name=\"dcopUpdateClientList\" />\n"
|
||||||
|
" </interface>\n"
|
||||||
|
"")
|
||||||
|
public:
|
||||||
|
DecorationAdaptor(QObject *parent);
|
||||||
|
virtual ~DecorationAdaptor();
|
||||||
|
|
||||||
|
public: // PROPERTIES
|
||||||
|
public Q_SLOTS: // METHODS
|
||||||
|
void dcopUpdateClientList();
|
||||||
|
Q_SIGNALS: // SIGNALS
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
7
kcmkwin/kwindecoration/org.kde.kwin.Decoration.xml
Normal file
7
kcmkwin/kwindecoration/org.kde.kwin.Decoration.xml
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN"
|
||||||
|
"http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">
|
||||||
|
<node>
|
||||||
|
<interface name="org.kde.kwin.Decoration">
|
||||||
|
<method name="dcopUpdateClientList"/>
|
||||||
|
</interface>
|
||||||
|
</node>
|
Loading…
Reference in a new issue