From d8ce81d241109a525d73ff3c7c81b1121e29654d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Wed, 4 Jan 2012 19:51:51 +0100 Subject: [PATCH] First set of properties and signals added to Aurorae --- clients/aurorae/src/aurorae.cpp | 14 ++++++++---- clients/aurorae/src/aurorae.h | 39 +++++++++++++++++++++++++++++++-- 2 files changed, 47 insertions(+), 6 deletions(-) diff --git a/clients/aurorae/src/aurorae.cpp b/clients/aurorae/src/aurorae.cpp index f6d59ca69d..a828de0032 100644 --- a/clients/aurorae/src/aurorae.cpp +++ b/clients/aurorae/src/aurorae.cpp @@ -164,8 +164,8 @@ AuroraeClient::AuroraeClient(KDecorationBridge *bridge, KDecorationFactory *fact connect(m_scene, SIGNAL(tabRemoved(int)), SLOT(tabRemoved(int))); connect(m_scene, SIGNAL(tabMoved(int,int)), SLOT(tabMoved(int,int))); connect(m_scene, SIGNAL(tabMovedToGroup(long int,int)), SLOT(tabMovedToGroup(long int,int))); - connect(this, SIGNAL(keepAboveChanged(bool)), SLOT(keepAboveChanged(bool))); - connect(this, SIGNAL(keepBelowChanged(bool)), SLOT(keepBelowChanged(bool))); + connect(this, SIGNAL(keepAboveChanged(bool)), SLOT(slotKeepAboveChanged(bool))); + connect(this, SIGNAL(keepBelowChanged(bool)), SLOT(slotKeepBelowChanged(bool))); } AuroraeClient::~AuroraeClient() @@ -215,21 +215,25 @@ void AuroraeClient::activeChange() if (m_scene->isActive() != isActive()) { m_scene->setActive(isActive()); } + emit activeChanged(); } void AuroraeClient::captionChange() { checkTabs(true); + emit captionChanged(); } void AuroraeClient::iconChange() { m_scene->setIcon(icon()); + emit iconChanged(); } void AuroraeClient::desktopChange() { m_scene->setAllDesktops(isOnAllDesktops()); + emit desktopChanged(); } void AuroraeClient::maximizeChange() @@ -237,6 +241,7 @@ void AuroraeClient::maximizeChange() if (!options()->moveResizeMaximizedWindows()) { m_scene->setMaximizeMode(maximizeMode()); } + emit maximizeChanged(); } void AuroraeClient::resize(const QSize &s) @@ -251,6 +256,7 @@ void AuroraeClient::resize(const QSize &s) void AuroraeClient::shadeChange() { m_scene->setShade(isShade()); + emit shadeChanged(); } void AuroraeClient::borders(int &left, int &right, int &top, int &bottom) const @@ -342,7 +348,7 @@ void AuroraeClient::toggleShade() setShade(!isShade()); } -void AuroraeClient::keepAboveChanged(bool above) +void AuroraeClient::slotKeepAboveChanged(bool above) { if (above && m_scene->isKeepBelow()) { m_scene->setKeepBelow(false); @@ -350,7 +356,7 @@ void AuroraeClient::keepAboveChanged(bool above) m_scene->setKeepAbove(above); } -void AuroraeClient::keepBelowChanged(bool below) +void AuroraeClient::slotKeepBelowChanged(bool below) { if (below && m_scene->isKeepAbove()) { m_scene->setKeepAbove(false); diff --git a/clients/aurorae/src/aurorae.h b/clients/aurorae/src/aurorae.h index f920533473..441747a061 100644 --- a/clients/aurorae/src/aurorae.h +++ b/clients/aurorae/src/aurorae.h @@ -60,6 +60,31 @@ private: class AuroraeClient : public KDecorationUnstable { Q_OBJECT + Q_PROPERTY(bool active READ isActive NOTIFY activeChanged) + Q_PROPERTY(QString caption READ caption NOTIFY captionChanged) + Q_PROPERTY(int desktop READ desktop WRITE setDesktop NOTIFY desktopChanged) + Q_PROPERTY(QRect geometry READ geometry) + Q_PROPERTY(int height READ height) + Q_PROPERTY(QIcon icon READ icon NOTIFY iconChanged) + Q_PROPERTY(bool closeable READ isCloseable) + Q_PROPERTY(bool maximizeable READ isMaximizable) + Q_PROPERTY(bool minimizeable READ isMinimizable) + Q_PROPERTY(bool modal READ isModal) + Q_PROPERTY(bool moveable READ isMovable) + Q_PROPERTY(bool onAllDesktops READ isOnAllDesktops NOTIFY desktopChanged) + Q_PROPERTY(bool preview READ isPreview CONSTANT) + Q_PROPERTY(bool resizeable READ isResizable) + Q_PROPERTY(bool setShade READ isSetShade NOTIFY shadeChanged) + Q_PROPERTY(bool shade READ isShade WRITE setShade NOTIFY shadeChanged) + Q_PROPERTY(bool shadeable READ isShadeable) + Q_PROPERTY(bool keepAbove READ keepAbove WRITE setKeepAbove NOTIFY keepAboveChanged) + Q_PROPERTY(bool keepBelow READ keepBelow WRITE setKeepBelow NOTIFY keepBelowChanged) + // TODO: maximize mode + Q_PROPERTY(bool providesContextHelp READ providesContextHelp) + Q_PROPERTY(QRect transparentRect READ transparentRect) + Q_PROPERTY(int width READ width) + Q_PROPERTY(qulonglong windowId READ windowId CONSTANT) + // TODO: window tabs - they suck for dynamic features public: AuroraeClient(KDecorationBridge* bridge, KDecorationFactory* factory); virtual ~AuroraeClient(); @@ -78,11 +103,21 @@ public: virtual void padding(int &left, int &right, int &top, int &bottom) const; virtual void reset(long unsigned int changed); +Q_SIGNALS: + void activeChanged(); + void captionChanged(); + void desktopChanged(); + void iconChanged(); + void maximizeChanged(); + void shadeChanged(); + void keepAboveChanged(); + void keepBelowChanged(); + private slots: void menuClicked(); void toggleShade(); - void keepAboveChanged(bool above); - void keepBelowChanged(bool below); + void slotKeepAboveChanged(bool above); + void slotKeepBelowChanged(bool below); void toggleKeepAbove(); void toggleKeepBelow(); void titlePressed(Qt::MouseButton button, Qt::MouseButtons buttons);