2010-11-10 19:21:56 +00:00
|
|
|
/********************************************************************
|
|
|
|
KWin - the KDE window manager
|
|
|
|
This file is part of the KDE project.
|
|
|
|
|
|
|
|
Copyright (C) 2010 Thomas Lübking <thomas.luebking@web.de>
|
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation; either version 2 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*********************************************************************/
|
|
|
|
|
|
|
|
#ifndef WINDOWGEOMETRY_H
|
|
|
|
#define WINDOWGEOMETRY_H
|
|
|
|
|
|
|
|
#include <kwineffects.h>
|
|
|
|
|
|
|
|
namespace KWin
|
|
|
|
{
|
|
|
|
|
2011-02-25 19:25:21 +00:00
|
|
|
class WindowGeometry : public Effect
|
2010-11-10 19:21:56 +00:00
|
|
|
{
|
|
|
|
Q_OBJECT
|
2012-08-11 09:24:37 +00:00
|
|
|
Q_PROPERTY(bool handlesMoves READ isHandlesMoves)
|
|
|
|
Q_PROPERTY(bool handlesResizes READ isHandlesResizes)
|
2010-11-10 19:21:56 +00:00
|
|
|
public:
|
|
|
|
WindowGeometry();
|
|
|
|
~WindowGeometry();
|
|
|
|
|
2011-01-30 14:34:42 +00:00
|
|
|
inline bool provides(Effect::Feature ef) {
|
|
|
|
return ef == Effect::GeometryTip;
|
|
|
|
}
|
|
|
|
void reconfigure(ReconfigureFlags);
|
2010-11-10 19:21:56 +00:00
|
|
|
void paintScreen(int mask, QRegion region, ScreenPaintData &data);
|
2011-08-27 09:21:31 +00:00
|
|
|
virtual bool isActive() const;
|
2010-11-10 19:21:56 +00:00
|
|
|
|
2012-08-11 09:24:37 +00:00
|
|
|
// for properties
|
|
|
|
bool isHandlesMoves() const {
|
|
|
|
return iHandleMoves;
|
|
|
|
}
|
|
|
|
bool isHandlesResizes() const {
|
|
|
|
return iHandleResizes;
|
|
|
|
}
|
2013-07-22 14:07:39 +00:00
|
|
|
private Q_SLOTS:
|
2010-11-10 19:21:56 +00:00
|
|
|
void toggle();
|
2012-01-29 11:29:24 +00:00
|
|
|
void slotWindowStartUserMovedResized(KWin::EffectWindow *w);
|
|
|
|
void slotWindowFinishUserMovedResized(KWin::EffectWindow *w);
|
|
|
|
void slotWindowStepUserMovedResized(KWin::EffectWindow *w, const QRect &geometry);
|
2010-11-10 19:21:56 +00:00
|
|
|
private:
|
|
|
|
EffectWindow *myResizeWindow;
|
|
|
|
EffectFrame *myMeasure[3];
|
|
|
|
QRect myOriginalGeometry, myCurrentGeometry;
|
2013-01-30 16:26:19 +00:00
|
|
|
QRect myExtraDirtyArea;
|
2010-11-10 19:21:56 +00:00
|
|
|
bool iAmActive, iAmActivated, iHandleMoves, iHandleResizes;
|
|
|
|
QString myCoordString[2], myResizeString;
|
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace
|
|
|
|
|
|
|
|
#endif
|