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.
This commit is contained in:
David Redondo 2023-02-20 15:12:56 +01:00 committed by Vlad Zahorodnii
parent 81571203f1
commit 7366545d0f
3 changed files with 34 additions and 34 deletions

View file

@ -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<xcb_connection_t *>(qApp->property("x11Connection").value<void *>());

View file

@ -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)

View file

@ -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);