kwin/screenedge.h
Arthur Arlt 7aecca019f Rename member variables
Renaming member variables to consistent naming scheme and using phrase
"screenEdge" instead of electric window.
2011-07-04 13:24:51 +02:00

79 lines
3 KiB
C++

/********************************************************************
KWin - the KDE window manager
This file is part of the KDE project.
Copyright (C) 2011 Arthur Arlt <a.arlt@stud.uni-heidelberg.de>
Since the functionality provided in this class has been moved from
class Workspace, it is not clear who exactly has written the code.
The list below contains the copyright holders of the class Workspace.
Copyright (C) 1999, 2000 Matthias Ettrich <ettrich@kde.org>
Copyright (C) 2003 Lubos Lunak <l.lunak@kde.org>
Copyright (C) 2009 Lucas Murray <lmurray@undefinedfire.com>
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 KWIN_SCREENEDGE_H
#define KWIN_SCREENEDGE_H
#include <QtCore/QObject>
#include <QtCore/QVector>
#include "kwinglobals.h"
namespace KWin {
//-----------------------------------------------------------------------------
// Electric Borders
//-----------------------------------------------------------------------------
// Electric Border Window management. Electric borders allow a user to change
// the virtual desktop or activate another features by moving the mouse pointer
// to the borders or corners. Technically this is done with input only windows.
//-----------------------------------------------------------------------------
class ScreenEdge : QObject {
Q_OBJECT
public:
ScreenEdge();
~ScreenEdge();
void init();
void checkElectricBorder(const QPoint& pos, Time now);
void restoreElectricBorderSize(ElectricBorder border);
void reserveElectricBorder(ElectricBorder border);
void unreserveElectricBorder(ElectricBorder border);
void reserveElectricBorderActions(bool reserve);
void reserveElectricBorderSwitching(bool reserve);
void raiseElectricBorderWindows();
void destroyElectricBorders();
bool electricBorderEvent(XEvent * e);
const QVector< Window* >& screenEdgeWindows();
public Q_SLOTS:
void updateElectricBorders();
private:
void electricBorderSwitchDesktop(ElectricBorder border, const QPoint& pos);
ElectricBorder m_currentScreenEdge;
Window m_screenEdgeWindows[ELECTRIC_COUNT];
int m_screenEdgeLeft;
int m_screenEdgeRight;
int m_screenEdgeTop;
int m_screenEdgeBottom;
Time m_screenEdgeTimeFirst;
Time m_screenEdgeTimeLast;
Time m_screenEdgeTimeLastTrigger;
QPoint m_screenEdgePushPoint;
int m_screenEdgeReserved[ELECTRIC_COUNT]; // Corners/edges used by something
};
}
#endif // KWIN_SCREENEDGE_H