From 1a7e8aeaf25a647712ebc14edf753b5213dfeda1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Thu, 12 Mar 2015 11:14:44 +0100 Subject: [PATCH] Move enum QuickTileFlag and ::setQuickTileMode to AbstractClient --- abstract_client.h | 18 ++++++++++++++++++ client.h | 15 +-------------- 2 files changed, 19 insertions(+), 14 deletions(-) diff --git a/abstract_client.h b/abstract_client.h index 11cb4c6645..7134da6c34 100644 --- a/abstract_client.h +++ b/abstract_client.h @@ -135,6 +135,23 @@ public: // a helper for the workspace window packing. tests for screen validity and updates since in maximization case as with normal moving virtual void packTo(int left, int top); + enum QuickTileFlag { + QuickTileNone = 0, + QuickTileLeft = 1, + QuickTileRight = 1<<1, + QuickTileTop = 1<<2, + QuickTileBottom = 1<<3, + QuickTileHorizontal = QuickTileLeft|QuickTileRight, + QuickTileVertical = QuickTileTop|QuickTileBottom, + QuickTileMaximize = QuickTileLeft|QuickTileRight|QuickTileTop|QuickTileBottom + }; + Q_DECLARE_FLAGS(QuickTileMode, QuickTileFlag) + /** Set the quick tile mode ("snap") of this window. + * This will also handle preserving and restoring of window geometry as necessary. + * @param mode The tile mode (left/right) to give this window. + */ + virtual void setQuickTileMode(QuickTileMode mode, bool keyboard = false) = 0; + // TODO: remove boolean trap static bool belongToSameApplication(const AbstractClient* c1, const AbstractClient* c2, bool active_hack = false); @@ -151,5 +168,6 @@ protected: Q_DECLARE_METATYPE(KWin::AbstractClient*) Q_DECLARE_METATYPE(QList) +Q_DECLARE_OPERATORS_FOR_FLAGS(KWin::AbstractClient::QuickTileMode) #endif diff --git a/client.h b/client.h index 273d081279..1b2ce7ef31 100644 --- a/client.h +++ b/client.h @@ -377,18 +377,6 @@ public: QRect geometryRestore() const; MaximizeMode maximizeMode() const override; - enum QuickTileFlag { - QuickTileNone = 0, - QuickTileLeft = 1, - QuickTileRight = 1<<1, - QuickTileTop = 1<<2, - QuickTileBottom = 1<<3, - QuickTileHorizontal = QuickTileLeft|QuickTileRight, - QuickTileVertical = QuickTileTop|QuickTileBottom, - QuickTileMaximize = QuickTileLeft|QuickTileRight|QuickTileTop|QuickTileBottom - }; - - Q_DECLARE_FLAGS(QuickTileMode, QuickTileFlag) QuickTileMode quickTileMode() const; bool isMinimizable() const override; void setMaximize(bool vertically, bool horizontally); @@ -476,7 +464,7 @@ public: * This will also handle preserving and restoring of window geometry as necessary. * @param mode The tile mode (left/right) to give this window. */ - void setQuickTileMode(QuickTileMode mode, bool keyboard = false); + void setQuickTileMode(QuickTileMode mode, bool keyboard = false) override; void growHorizontal() override; void shrinkHorizontal() override; @@ -1280,6 +1268,5 @@ inline void Client::print(T &stream) const } // namespace Q_DECLARE_METATYPE(KWin::Client*) Q_DECLARE_METATYPE(QList) -Q_DECLARE_OPERATORS_FOR_FLAGS(KWin::Client::QuickTileMode) #endif