12#include "config-kwin.h"
14#include <QCoreApplication>
20#include <kwin_export.h>
22#define KWIN_QT5_PORTING 0
26KWIN_EXPORT Q_NAMESPACE
144Q_DECLARE_FLAGS(LEDs,
LED)
215 return m_image.isNull();
237 return QRect(INT_MIN / 2, INT_MIN / 2, INT_MAX, INT_MAX);
243KWIN_EXPORT
inline QRectF
scaledRect(
const QRectF &rect, qreal scale)
245 return QRectF{rect.x() * scale, rect.y() * scale, rect.width() * scale, rect.height() * scale};
253 return QVector2D(std::round(
input.x()), std::round(
input.y()));
264 return QPoint(std::floor(point.x()), std::floor(point.y()));
271static inline bool exclusiveContains(
const QRectF &rect,
const QPointF &point)
273 return point.x() >= rect.x() && point.y() >= rect.y() && point.x() < (rect.x() + rect.width()) && point.y() < (rect.y() + rect.height());
309#define KWIN_SINGLETON_VARIABLE(ClassName, variableName) \
311 static ClassName *create(QObject *parent = nullptr); \
312 static ClassName *self() \
314 return variableName; \
318 explicit ClassName(QObject *parent = nullptr); \
321 static ClassName *variableName;
323#define KWIN_SINGLETON(ClassName) KWIN_SINGLETON_VARIABLE(ClassName, s_self)
325#define KWIN_SINGLETON_FACTORY_VARIABLE_FACTORED(ClassName, FactoredClassName, variableName) \
326 ClassName *ClassName::variableName = nullptr; \
327 ClassName *ClassName::create(QObject *parent) \
329 Q_ASSERT(!variableName); \
330 variableName = new FactoredClassName(parent); \
331 return variableName; \
333#define KWIN_SINGLETON_FACTORY_VARIABLE(ClassName, variableName) KWIN_SINGLETON_FACTORY_VARIABLE_FACTORED(ClassName, ClassName, variableName)
334#define KWIN_SINGLETON_FACTORY_FACTORED(ClassName, FactoredClassName) KWIN_SINGLETON_FACTORY_VARIABLE_FACTORED(ClassName, FactoredClassName, s_self)
335#define KWIN_SINGLETON_FACTORY(ClassName) KWIN_SINGLETON_FACTORY_VARIABLE(ClassName, s_self)
KWIN_EXPORT QRect infiniteRegion()
PointerAxisDirection
The direction in which a pointer axis is moved.
@ SwitchDesktopOnScreenEdgeMovingWindows
@ SwitchDesktopOnScreenEdge
Q_ENUM_NS(PresentationMode)
@ NoOpenGLPlatformInterface
@ ElectricActionActivityManager
@ ElectricActionLockScreen
@ ElectricActionApplicationLauncher
@ ElectricActionShowDesktop
@ TabBoxCurrentAppWindowsMode
@ TabBoxCurrentAppWindowsAlternativeMode
@ TabBoxWindowsAlternativeMode
SwipeDirection
Directions for swipe gestures.
InputRedirection * input()
KWIN_EXPORT QPoint flooredPoint(const QPointF &point)
KWIN_EXPORT QRectF scaledRect(const QRectF &rect, qreal scale)
@ CriticalNotificationLayer
KWIN_EXPORT QVector2D roundVector(const QVector2D &input)