From c8331784bae844e71b2f960e2ebc4c9472ae607c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Tue, 20 Aug 2013 11:17:48 +0200 Subject: [PATCH] Merge KDecorationBridgeUnstable into KDecorationBridge --- bridge.h | 2 +- libkdecorations/kdecoration.cpp | 34 +++++++++++++---------------- libkdecorations/kdecorationbridge.h | 8 ------- 3 files changed, 16 insertions(+), 28 deletions(-) diff --git a/bridge.h b/bridge.h index 6312ea73ba..200ba68ebd 100644 --- a/bridge.h +++ b/bridge.h @@ -28,7 +28,7 @@ namespace KWin class Client; -class Bridge : public KDecorationBridgeUnstable +class Bridge : public KDecorationBridge { public: explicit Bridge(Client* cl); diff --git a/libkdecorations/kdecoration.cpp b/libkdecorations/kdecoration.cpp index 2a15e6acdd..be92c59117 100644 --- a/libkdecorations/kdecoration.cpp +++ b/libkdecorations/kdecoration.cpp @@ -408,10 +408,7 @@ KDecoration::Position KDecoration::mousePosition(const QPoint& p) const QRect KDecoration::transparentRect() const { - if (KDecorationBridgeUnstable *bridge2 = dynamic_cast(bridge_)) - return bridge2->transparentRect(); - else - return QRect(); + return bridge_->transparentRect(); } void KDecoration::setAlphaEnabled(bool enabled) @@ -431,7 +428,6 @@ bool KDecoration::isAlphaEnabled() const KDecorationUnstable::KDecorationUnstable(KDecorationBridge* bridge, KDecorationFactory* factory) : KDecoration(bridge, factory) { - Q_ASSERT(dynamic_cast< KDecorationBridgeUnstable* >(bridge)); } KDecorationUnstable::~KDecorationUnstable() @@ -440,7 +436,7 @@ KDecorationUnstable::~KDecorationUnstable() bool KDecorationUnstable::compositingActive() const { - return static_cast< KDecorationBridgeUnstable* >(bridge_)->compositingActive(); + return bridge_->compositingActive(); } void KDecorationUnstable::padding(int &left, int &right, int &top, int &bottom) const @@ -452,69 +448,69 @@ void KDecorationUnstable::padding(int &left, int &right, int &top, int &bottom) int KDecorationUnstable::tabCount() const { - return static_cast< KDecorationBridgeUnstable* >(bridge_)->tabCount(); + return bridge_->tabCount(); } long KDecorationUnstable::tabId(int idx) const { - return static_cast< KDecorationBridgeUnstable* >(bridge_)->tabId(idx); + return bridge_->tabId(idx); } QString KDecorationUnstable::caption(int idx) const { - return static_cast< KDecorationBridgeUnstable* >(bridge_)->caption(idx); + return bridge_->caption(idx); } QIcon KDecorationUnstable::icon(int idx) const { - return static_cast< KDecorationBridgeUnstable* >(bridge_)->icon(idx); + return bridge_->icon(idx); } long KDecorationUnstable::currentTabId() const { - return static_cast< KDecorationBridgeUnstable* >(bridge_)->currentTabId(); + return bridge_->currentTabId(); } void KDecorationUnstable::setCurrentTab(long id) { - static_cast< KDecorationBridgeUnstable* >(bridge_)->setCurrentTab(id); + bridge_->setCurrentTab(id); } void KDecorationUnstable::tab_A_before_B(long A, long B) { - static_cast< KDecorationBridgeUnstable* >(bridge_)->tab_A_before_B(A, B); + bridge_->tab_A_before_B(A, B); } void KDecorationUnstable::tab_A_behind_B(long A, long B) { - static_cast< KDecorationBridgeUnstable* >(bridge_)->tab_A_behind_B(A, B); + bridge_->tab_A_behind_B(A, B); } void KDecorationUnstable::untab(long id, const QRect& newGeom) { - static_cast< KDecorationBridgeUnstable* >(bridge_)->untab(id, newGeom); + bridge_->untab(id, newGeom); } void KDecorationUnstable::closeTab(long id) { - static_cast< KDecorationBridgeUnstable* >(bridge_)->closeTab(id); + bridge_->closeTab(id); } void KDecorationUnstable::closeTabGroup() { - static_cast< KDecorationBridgeUnstable* >(bridge_)->closeTabGroup(); + bridge_->closeTabGroup(); } void KDecorationUnstable::showWindowMenu(const QPoint &pos, long id) { - static_cast< KDecorationBridgeUnstable* >(bridge_)->showWindowMenu(pos, id); + bridge_->showWindowMenu(pos, id); } //END tabbing KDecoration::WindowOperation KDecorationUnstable::buttonToWindowOperation(Qt::MouseButtons button) { - return static_cast< KDecorationBridgeUnstable* >(bridge_)->buttonToWindowOperation(button); + return bridge_->buttonToWindowOperation(button); } QRegion KDecoration::region(KDecorationDefines::Region) diff --git a/libkdecorations/kdecorationbridge.h b/libkdecorations/kdecorationbridge.h index 4f7aadc290..a8dedb1e6e 100644 --- a/libkdecorations/kdecorationbridge.h +++ b/libkdecorations/kdecorationbridge.h @@ -84,25 +84,17 @@ public: virtual QWidget* initialParentWidget() const = 0; virtual Qt::WindowFlags initialWFlags() const = 0; virtual void grabXServer(bool grab) = 0; -}; -class KDecorationBridgeUnstable - : public KDecorationBridge -{ -public: virtual bool compositingActive() const = 0; virtual QRect transparentRect() const = 0; // Window tabbing - using KDecorationBridge::caption; virtual QString caption(int idx) const = 0; virtual void closeTab(long id) = 0; virtual void closeTabGroup() = 0; virtual long currentTabId() const = 0; - using KDecorationBridge::icon; virtual QIcon icon(int idx) const = 0; virtual void setCurrentTab(long id) = 0; - using KDecorationBridge::showWindowMenu; virtual void showWindowMenu(const QPoint& pos, long id) = 0; virtual void tab_A_before_B(long A, long B) = 0; virtual void tab_A_behind_B(long A, long B) = 0;