summaryrefslogtreecommitdiff
path: root/decorators/libdecorator
diff options
context:
space:
mode:
authorAbdiel Janulgue <abdiel.janulgue@nokia.com>2010-04-28 18:57:39 +0300
committerAbdiel Janulgue <abdiel.janulgue@nokia.com>2010-04-28 18:57:39 +0300
commitca00457291ca49978b6e2b05bbcc043ef14ecb98 (patch)
treef3a2ae5659b3cf36795d29d4e643e47b0dbf6036 /decorators/libdecorator
parentb626c5a0bde6ba3b337cf6d12ef7c2bbf79c590a (diff)
Changes: Dynamically inform compositor of decorator geometry
RevBy: TrustMe
Diffstat (limited to 'decorators/libdecorator')
-rw-r--r--decorators/libdecorator/libdecorator.pro1
-rw-r--r--decorators/libdecorator/mabstractdecorator.cpp45
-rw-r--r--decorators/libdecorator/mabstractdecorator.h19
3 files changed, 57 insertions, 8 deletions
diff --git a/decorators/libdecorator/libdecorator.pro b/decorators/libdecorator/libdecorator.pro
index 9ff1a87..466e061 100644
--- a/decorators/libdecorator/libdecorator.pro
+++ b/decorators/libdecorator/libdecorator.pro
@@ -5,7 +5,6 @@ INCLUDEPATH += .
CONFIG += dll release
QT += opengl network
TARGET = decorator
-VERSION = 0.3.10
HEADERS += mabstractdecorator.h \
mrmiclient_p.h \
diff --git a/decorators/libdecorator/mabstractdecorator.cpp b/decorators/libdecorator/mabstractdecorator.cpp
index 2c21683..1c9ae93 100644
--- a/decorators/libdecorator/mabstractdecorator.cpp
+++ b/decorators/libdecorator/mabstractdecorator.cpp
@@ -17,23 +17,41 @@
**
****************************************************************************/
-#include "mabstractdecorator.h"
-
#include <QtDebug>
+#include "mabstractdecorator.h"
#include <mrmiserver.h>
+#include <mrmiclient.h>
#include <QX11Info>
+#include <QRect>
+#include <QRegion>
+#include <QDesktopWidget>
+#include <QApplication>
#include <X11/Xutil.h>
#include <X11/Xlib.h>
#include <X11/Xatom.h>
#include <X11/Xmd.h>
+class MAbstractDecoratorPrivate
+{
+public:
+
+ Qt::HANDLE client;
+ MRmiClient* remote_compositor;
+ QRect clientGeometry;
+ MAbstractDecorator* q_ptr;
+};
+
MAbstractDecorator::MAbstractDecorator(QObject *parent)
- : QObject(parent)
+ : QObject(parent),
+ d(new MAbstractDecoratorPrivate())
{
+ Q_D(MAbstractDecorator);
+
MRmiServer *s = new MRmiServer(".mabstractdecorator", this);
s->exportObject(this);
+ d->remote_compositor = new MRmiClient(".mcompositor", this);
}
MAbstractDecorator::~MAbstractDecorator()
@@ -42,7 +60,9 @@ MAbstractDecorator::~MAbstractDecorator()
Qt::HANDLE MAbstractDecorator::managedWinId()
{
- return client;
+ Q_D(MAbstractDecorator);
+
+ return d->client;
}
void MAbstractDecorator::minimize()
@@ -88,7 +108,9 @@ void MAbstractDecorator::close()
void MAbstractDecorator::RemoteSetManagedWinId(qulonglong window)
{
- client = window;
+ Q_D(MAbstractDecorator);
+
+ d->client = window;
manageEvent(window);
}
@@ -101,3 +123,16 @@ void MAbstractDecorator::RemoteSetAutoRotation(bool mode)
{
setAutoRotation(mode);
}
+
+void MAbstractDecorator::RemoteSetClientGeometry(const QRect& r)
+{
+ Q_D(MAbstractDecorator);
+ d->clientGeometry = r;
+}
+
+void MAbstractDecorator::setAvailableGeometry(const QRect& rect)
+{
+ Q_D(MAbstractDecorator);
+
+ d->remote_compositor->invoke("MCompositeManager", "decoratorRectChanged", rect);
+}
diff --git a/decorators/libdecorator/mabstractdecorator.h b/decorators/libdecorator/mabstractdecorator.h
index e03e954..a29b439 100644
--- a/decorators/libdecorator/mabstractdecorator.h
+++ b/decorators/libdecorator/mabstractdecorator.h
@@ -22,6 +22,10 @@
#include <QObject>
+class MAbstractDecoratorPrivate;
+class MRmiClient;
+class QRect;
+
/*!
* MAbstractDecorator is the base class for window decorators
*/
@@ -39,6 +43,14 @@ public:
* Returns the id of the window decorated by this decorator
*/
Qt::HANDLE managedWinId();
+
+ /*!
+ * Informs the compositor of the available client geometry when client
+ * is managed by the decorator.
+ *
+ * \param rect is the geometry of the decorator area.
+ */
+ void setAvailableGeometry(const QRect& rect);
public slots:
@@ -58,6 +70,7 @@ public slots:
void RemoteSetManagedWinId(qulonglong window);
void RemoteActivateWindow();
void RemoteSetAutoRotation(bool mode);
+ void RemoteSetClientGeometry(const QRect& rect);
protected:
@@ -79,8 +92,10 @@ protected:
virtual void setAutoRotation(bool mode) = 0;
private:
- Qt::HANDLE client;
-
+
+ Q_DECLARE_PRIVATE(MAbstractDecorator)
+
+ MAbstractDecoratorPrivate * const d;
};
#endif //MABSTRACTDECORATOR_H