From 7366545d0f8079a313466f31c9a09e385539a60d Mon Sep 17 00:00:00 2001 From: David Redondo Date: Mon, 20 Feb 2023 15:12:56 +0100 Subject: [PATCH] Move Layer and QuickTile enum to kwinglobals.h Q_NAMESPACE can ever only be used once for a namespace otherwise there will be multiple defintions of the staticMetaObject. --- src/libkwineffects/kwinglobals.h | 33 +++++++++++++++++++++++++++++++ src/scripting/scriptedeffect.h | 1 + src/utils/common.h | 34 -------------------------------- 3 files changed, 34 insertions(+), 34 deletions(-) diff --git a/src/libkwineffects/kwinglobals.h b/src/libkwineffects/kwinglobals.h index f24e61c4b7..973a022f63 100644 --- a/src/libkwineffects/kwinglobals.h +++ b/src/libkwineffects/kwinglobals.h @@ -165,6 +165,39 @@ enum class Gravity { BottomRight, }; +enum Layer { + UnknownLayer = -1, + FirstLayer = 0, + DesktopLayer = FirstLayer, + BelowLayer, + NormalLayer, + DockLayer, + AboveLayer, + NotificationLayer, // layer for windows of type notification + ActiveLayer, // active fullscreen, or active dialog + PopupLayer, // tooltips, sub- and context menus + CriticalNotificationLayer, // layer for notifications that should be shown even on top of fullscreen + OnScreenDisplayLayer, // layer for On Screen Display windows such as volume feedback + UnmanagedLayer, // layer for override redirect windows. + NumLayers, // number of layers, must be last +}; +Q_ENUM_NS(Layer) + +// TODO: could this be in Tile itself? +enum class QuickTileFlag { + None = 0, + Left = 1 << 0, + Right = 1 << 1, + Top = 1 << 2, + Bottom = 1 << 3, + Custom = 1 << 4, + Horizontal = Left | Right, + Vertical = Top | Bottom, + Maximize = Left | Right | Top | Bottom, +}; +Q_ENUM_NS(QuickTileFlag); +Q_DECLARE_FLAGS(QuickTileMode, QuickTileFlag) + inline KWIN_EXPORT xcb_connection_t *connection() { return reinterpret_cast(qApp->property("x11Connection").value()); diff --git a/src/scripting/scriptedeffect.h b/src/scripting/scriptedeffect.h index 155a2e1df5..82639992b0 100644 --- a/src/scripting/scriptedeffect.h +++ b/src/scripting/scriptedeffect.h @@ -24,6 +24,7 @@ namespace KWin class KWIN_EXPORT ScriptedEffect : public KWin::AnimationEffect { Q_OBJECT + Q_ENUMS(DataRole) Q_ENUMS(Qt::Axis) Q_ENUMS(Anchor) diff --git a/src/utils/common.h b/src/utils/common.h index efe01121a0..131e9d5aba 100644 --- a/src/utils/common.h +++ b/src/utils/common.h @@ -29,28 +29,9 @@ Q_DECLARE_LOGGING_CATEGORY(KWIN_QPAINTER) Q_DECLARE_LOGGING_CATEGORY(KWIN_VIRTUALKEYBOARD) namespace KWin { -Q_NAMESPACE const QPoint invalidPoint(INT_MIN, INT_MIN); -enum Layer { - UnknownLayer = -1, - FirstLayer = 0, - DesktopLayer = FirstLayer, - BelowLayer, - NormalLayer, - DockLayer, - AboveLayer, - NotificationLayer, // layer for windows of type notification - ActiveLayer, // active fullscreen, or active dialog - PopupLayer, // tooltips, sub- and context menus - CriticalNotificationLayer, // layer for notifications that should be shown even on top of fullscreen - OnScreenDisplayLayer, // layer for On Screen Display windows such as volume feedback - UnmanagedLayer, // layer for override redirect windows. - NumLayers, // number of layers, must be last -}; -Q_ENUM_NS(Layer) - enum StrutArea { StrutAreaInvalid = 0, // Null StrutAreaTop = 1 << 0, @@ -103,21 +84,6 @@ inline MaximizeMode operator^(MaximizeMode m1, MaximizeMode m2) return MaximizeMode(int(m1) ^ int(m2)); } -// TODO: could this be in Tile itself? -enum class QuickTileFlag { - None = 0, - Left = 1 << 0, - Right = 1 << 1, - Top = 1 << 2, - Bottom = 1 << 3, - Custom = 1 << 4, - Horizontal = Left | Right, - Vertical = Top | Bottom, - Maximize = Left | Right | Top | Bottom, -}; -Q_ENUM_NS(QuickTileFlag); -Q_DECLARE_FLAGS(QuickTileMode, QuickTileFlag) - void KWIN_EXPORT grabXServer(); void KWIN_EXPORT ungrabXServer(); bool KWIN_EXPORT grabXKeyboard(xcb_window_t w = XCB_WINDOW_NONE);