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
|
|
|
|
{
|
|
|
|
|
2015-09-11 13:55:23 +00:00
|
|
|
class AbstractClient;
|
|
|
|
|
2014-07-23 07:20:28 +00:00
|
|
|
namespace Decoration
|
|
|
|
{
|
|
|
|
class Renderer;
|
|
|
|
}
|
|
|
|
|
2015-10-22 08:06:01 +00:00
|
|
|
class KWIN_EXPORT Deleted
|
2007-04-29 17:35:43 +00:00
|
|
|
: 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)
|
2016-01-27 13:14:37 +00:00
|
|
|
Q_PROPERTY(bool fullScreen READ isFullScreen CONSTANT)
|
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;
|
2015-12-08 09:11:26 +00:00
|
|
|
QPoint clientContentPos() const override {
|
|
|
|
return m_contentPos;
|
|
|
|
}
|
2011-01-30 14:34:42 +00:00
|
|
|
virtual QRect transparentRect() const;
|
2012-01-15 09:51:09 +00:00
|
|
|
virtual bool isDeleted() const;
|
2013-09-10 06:13:33 +00:00
|
|
|
virtual xcb_window_t frameId() const override;
|
2011-01-30 14:34:42 +00:00
|
|
|
bool noBorder() const {
|
|
|
|
return no_border;
|
|
|
|
}
|
2014-07-25 10:55:28 +00:00
|
|
|
void layoutDecorationRects(QRect &left, QRect &top, QRect &right, QRect &bottom) 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;
|
|
|
|
}
|
2015-09-11 13:55:23 +00:00
|
|
|
QList<AbstractClient*> mainClients() const {
|
2013-06-03 13:08:05 +00:00
|
|
|
return m_mainClients;
|
|
|
|
}
|
2012-09-06 07:09:31 +00:00
|
|
|
NET::WindowType windowType(bool direct = false, int supported_types = 0) const;
|
2013-06-23 22:13:08 +00:00
|
|
|
bool wasClient() const {
|
|
|
|
return m_wasClient;
|
|
|
|
}
|
2015-03-04 06:56:51 +00:00
|
|
|
double opacity() const override;
|
2015-03-04 07:53:51 +00:00
|
|
|
QByteArray windowRole() const override;
|
2014-07-23 07:20:28 +00:00
|
|
|
|
|
|
|
const Decoration::Renderer *decorationRenderer() const {
|
|
|
|
return m_decorationRenderer;
|
|
|
|
}
|
2016-01-27 13:14:37 +00:00
|
|
|
|
|
|
|
bool isFullScreen() const {
|
|
|
|
return m_fullscreen;
|
|
|
|
}
|
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()
|
2015-12-08 09:11:26 +00:00
|
|
|
QPoint m_contentPos;
|
2011-01-30 14:34:42 +00:00
|
|
|
QRect transparent_rect;
|
2013-09-10 06:13:33 +00:00
|
|
|
xcb_window_t m_frame;
|
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;
|
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;
|
2015-09-11 13:55:23 +00:00
|
|
|
QList<AbstractClient*> m_mainClients;
|
2013-06-23 22:13:08 +00:00
|
|
|
bool m_wasClient;
|
2014-07-23 07:20:28 +00:00
|
|
|
Decoration::Renderer *m_decorationRenderer;
|
2015-03-04 06:56:51 +00:00
|
|
|
double m_opacity;
|
2015-03-04 07:26:57 +00:00
|
|
|
NET::WindowType m_type = NET::Unknown;
|
2015-03-04 07:53:51 +00:00
|
|
|
QByteArray m_windowRole;
|
2016-01-27 13:14:37 +00:00
|
|
|
bool m_fullscreen;
|
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
|
|
|
|
|
2015-10-22 08:06:01 +00:00
|
|
|
Q_DECLARE_METATYPE(KWin::Deleted*)
|
|
|
|
|
2007-04-29 17:35:43 +00:00
|
|
|
#endif
|