2007-11-27 19:40:25 +00:00
|
|
|
/********************************************************************
|
2007-04-29 17:35:43 +00:00
|
|
|
KWin - the KDE window manager
|
|
|
|
This file is part of the KDE project.
|
|
|
|
|
|
|
|
Copyright (C) 2006 Lubos Lunak <l.lunak@kde.org>
|
|
|
|
|
2007-11-27 19:40:25 +00:00
|
|
|
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/>.
|
|
|
|
*********************************************************************/
|
2007-04-29 17:35:43 +00:00
|
|
|
|
|
|
|
#ifndef KWIN_DELETED_H
|
|
|
|
#define KWIN_DELETED_H
|
|
|
|
|
|
|
|
#include "toplevel.h"
|
|
|
|
|
|
|
|
namespace KWin
|
|
|
|
{
|
2012-09-28 09:59:42 +00:00
|
|
|
class PaintRedirector;
|
2007-04-29 17:35:43 +00:00
|
|
|
|
|
|
|
class Deleted
|
|
|
|
: public Toplevel
|
2011-01-30 14:34:42 +00:00
|
|
|
{
|
2007-04-29 17:35:43 +00:00
|
|
|
Q_OBJECT
|
2012-07-21 16:09:58 +00:00
|
|
|
Q_PROPERTY(bool minimized READ isMinimized)
|
2013-06-03 13:08:05 +00:00
|
|
|
Q_PROPERTY(bool modal READ isModal)
|
2011-01-30 14:34:42 +00:00
|
|
|
public:
|
|
|
|
static Deleted* create(Toplevel* c);
|
|
|
|
// used by effects to keep the window around for e.g. fadeout effects when it's destroyed
|
|
|
|
void refWindow();
|
2013-05-31 17:15:51 +00:00
|
|
|
void unrefWindow();
|
2013-04-26 07:47:45 +00:00
|
|
|
void discard();
|
2011-01-30 14:34:42 +00:00
|
|
|
virtual int desktop() const;
|
|
|
|
virtual QStringList activities() const;
|
|
|
|
virtual QPoint clientPos() const;
|
|
|
|
virtual QSize clientSize() const;
|
|
|
|
virtual QRect transparentRect() const;
|
2012-01-15 09:51:09 +00:00
|
|
|
virtual bool isDeleted() const;
|
2011-01-30 14:34:42 +00:00
|
|
|
bool noBorder() const {
|
|
|
|
return no_border;
|
|
|
|
}
|
2012-09-06 10:55:15 +00:00
|
|
|
void layoutDecorationRects(QRect &left, QRect &top, QRect &right, QRect &bottom, int unused = 0) const;
|
2011-01-30 14:34:42 +00:00
|
|
|
QRect decorationRect() const;
|
2012-04-07 14:43:27 +00:00
|
|
|
virtual Layer layer() const {
|
|
|
|
return m_layer;
|
|
|
|
}
|
2012-07-21 16:09:58 +00:00
|
|
|
bool isMinimized() const {
|
|
|
|
return m_minimized;
|
|
|
|
}
|
2013-06-03 13:08:05 +00:00
|
|
|
bool isModal() const {
|
|
|
|
return m_modal;
|
|
|
|
}
|
|
|
|
ClientList mainClients() const {
|
|
|
|
return m_mainClients;
|
|
|
|
}
|
2012-09-06 07:09:31 +00:00
|
|
|
NET::WindowType windowType(bool direct = false, int supported_types = 0) const;
|
2012-09-28 09:59:42 +00:00
|
|
|
PaintRedirector *decorationPaintRedirector() {
|
|
|
|
return m_paintRedirector;
|
2012-09-06 10:55:15 +00:00
|
|
|
}
|
2013-06-23 22:13:08 +00:00
|
|
|
bool wasClient() const {
|
|
|
|
return m_wasClient;
|
|
|
|
}
|
2011-01-30 14:34:42 +00:00
|
|
|
protected:
|
|
|
|
virtual void debug(QDebug& stream) const;
|
|
|
|
virtual bool shouldUnredirect() const;
|
2013-06-03 13:08:05 +00:00
|
|
|
private Q_SLOTS:
|
|
|
|
void mainClientClosed(KWin::Toplevel *client);
|
2011-01-30 14:34:42 +00:00
|
|
|
private:
|
2013-05-08 11:39:06 +00:00
|
|
|
Deleted(); // use create()
|
2011-01-30 14:34:42 +00:00
|
|
|
void copyToDeleted(Toplevel* c);
|
|
|
|
virtual ~Deleted(); // deleted only using unrefWindow()
|
|
|
|
int delete_refcount;
|
|
|
|
double window_opacity;
|
|
|
|
int desk;
|
|
|
|
QStringList activityList;
|
|
|
|
QRect contentsRect; // for clientPos()/clientSize()
|
|
|
|
QRect transparent_rect;
|
2009-07-29 11:07:28 +00:00
|
|
|
|
2011-01-30 14:34:42 +00:00
|
|
|
bool no_border;
|
|
|
|
QRect decoration_left;
|
|
|
|
QRect decoration_right;
|
|
|
|
QRect decoration_top;
|
|
|
|
QRect decoration_bottom;
|
|
|
|
int padding_left, padding_top, padding_right, padding_bottom;
|
2012-04-07 14:43:27 +00:00
|
|
|
Layer m_layer;
|
2012-07-21 16:09:58 +00:00
|
|
|
bool m_minimized;
|
2013-06-03 13:08:05 +00:00
|
|
|
bool m_modal;
|
|
|
|
ClientList m_mainClients;
|
2012-09-28 09:59:42 +00:00
|
|
|
PaintRedirector *m_paintRedirector;
|
2013-06-23 22:13:08 +00:00
|
|
|
bool m_wasClient;
|
2011-01-30 14:34:42 +00:00
|
|
|
};
|
2007-04-29 17:35:43 +00:00
|
|
|
|
|
|
|
inline void Deleted::refWindow()
|
2011-01-30 14:34:42 +00:00
|
|
|
{
|
2007-04-29 17:35:43 +00:00
|
|
|
++delete_refcount;
|
2011-01-30 14:34:42 +00:00
|
|
|
}
|
2007-04-29 17:35:43 +00:00
|
|
|
|
|
|
|
} // namespace
|
|
|
|
|
|
|
|
#endif
|