kwin/effects/windowgeometry/windowgeometry.h
Vlad Zahorodnii 1fb9f6f13a Switch to SPDX license markers
The main advantage of SPDX license identifiers over the traditional
license headers is that it's more difficult to overlook inappropriate
licenses for kwin, for example GPL 3. We also don't have to copy a
lot of boilerplate text.

In order to create this change, I ran licensedigger -r -c from the
toplevel source directory.
2020-08-07 19:57:56 +00:00

62 lines
1.7 KiB
C++

/********************************************************************
KWin - the KDE window manager
This file is part of the KDE project.
SPDX-FileCopyrightText: 2010 Thomas Lübking <thomas.luebking@web.de>
SPDX-License-Identifier: GPL-2.0-or-later
*********************************************************************/
#ifndef WINDOWGEOMETRY_H
#define WINDOWGEOMETRY_H
#include <kwineffects.h>
namespace KWin
{
class WindowGeometry : public Effect
{
Q_OBJECT
Q_PROPERTY(bool handlesMoves READ isHandlesMoves)
Q_PROPERTY(bool handlesResizes READ isHandlesResizes)
public:
WindowGeometry();
~WindowGeometry() override;
inline bool provides(Effect::Feature ef) override {
return ef == Effect::GeometryTip;
}
void reconfigure(ReconfigureFlags) override;
void paintScreen(int mask, const QRegion &region, ScreenPaintData &data) override;
bool isActive() const override;
int requestedEffectChainPosition() const override {
return 90;
}
// for properties
bool isHandlesMoves() const {
return iHandleMoves;
}
bool isHandlesResizes() const {
return iHandleResizes;
}
private Q_SLOTS:
void toggle();
void slotWindowStartUserMovedResized(KWin::EffectWindow *w);
void slotWindowFinishUserMovedResized(KWin::EffectWindow *w);
void slotWindowStepUserMovedResized(KWin::EffectWindow *w, const QRect &geometry);
private:
void createFrames();
EffectWindow *myResizeWindow;
EffectFrame *myMeasure[3] = {nullptr, nullptr, nullptr};
QRect myOriginalGeometry, myCurrentGeometry;
QRect myExtraDirtyArea;
bool iAmActive, iAmActivated, iHandleMoves, iHandleResizes;
QString myCoordString[2], myResizeString;
};
} // namespace
#endif