~ubuntu-branches/ubuntu/utopic/kde-workspace/utopic-proposed

« back to all changes in this revision

Viewing changes to kwin/deleted.h

  • Committer: Bazaar Package Importer
  • Author(s): Michał Zając
  • Date: 2011-07-09 08:31:15 UTC
  • Revision ID: james.westby@ubuntu.com-20110709083115-ohyxn6z93mily9fc
Tags: upstream-4.6.90
Import upstream version 4.6.90

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/********************************************************************
 
2
 KWin - the KDE window manager
 
3
 This file is part of the KDE project.
 
4
 
 
5
Copyright (C) 2006 Lubos Lunak <l.lunak@kde.org>
 
6
 
 
7
This program is free software; you can redistribute it and/or modify
 
8
it under the terms of the GNU General Public License as published by
 
9
the Free Software Foundation; either version 2 of the License, or
 
10
(at your option) any later version.
 
11
 
 
12
This program is distributed in the hope that it will be useful,
 
13
but WITHOUT ANY WARRANTY; without even the implied warranty of
 
14
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
15
GNU General Public License for more details.
 
16
 
 
17
You should have received a copy of the GNU General Public License
 
18
along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
19
*********************************************************************/
 
20
 
 
21
#ifndef KWIN_DELETED_H
 
22
#define KWIN_DELETED_H
 
23
 
 
24
#include "toplevel.h"
 
25
 
 
26
namespace KWin
 
27
{
 
28
 
 
29
class Deleted
 
30
    : public Toplevel
 
31
{
 
32
    Q_OBJECT
 
33
public:
 
34
    static Deleted* create(Toplevel* c);
 
35
    // used by effects to keep the window around for e.g. fadeout effects when it's destroyed
 
36
    void refWindow();
 
37
    void unrefWindow(bool delay = false);
 
38
    void discard(allowed_t);
 
39
    virtual int desktop() const;
 
40
    virtual QStringList activities() const;
 
41
    virtual QPoint clientPos() const;
 
42
    virtual QSize clientSize() const;
 
43
    virtual QRect transparentRect() const;
 
44
    const QPixmap *topDecoPixmap() const {
 
45
        return &decorationPixmapTop;
 
46
    }
 
47
    const QPixmap *leftDecoPixmap() const {
 
48
        return &decorationPixmapLeft;
 
49
    }
 
50
    const QPixmap *bottomDecoPixmap() const {
 
51
        return &decorationPixmapBottom;
 
52
    }
 
53
    const QPixmap *rightDecoPixmap() const {
 
54
        return &decorationPixmapRight;
 
55
    }
 
56
    bool noBorder() const {
 
57
        return no_border;
 
58
    }
 
59
    void layoutDecorationRects(QRect &left, QRect &top, QRect &right, QRect &bottom) const;
 
60
    virtual void addRepaintFull(); // in composite.cpp
 
61
    QRect decorationRect() const;
 
62
protected:
 
63
    virtual void debug(QDebug& stream) const;
 
64
    virtual bool shouldUnredirect() const;
 
65
private:
 
66
    Deleted(Workspace *ws);   // use create()
 
67
    void copyToDeleted(Toplevel* c);
 
68
    virtual ~Deleted(); // deleted only using unrefWindow()
 
69
    int delete_refcount;
 
70
    double window_opacity;
 
71
    int desk;
 
72
    QStringList activityList;
 
73
    QRect contentsRect; // for clientPos()/clientSize()
 
74
    QRect transparent_rect;
 
75
 
 
76
    QPixmap decorationPixmapLeft;
 
77
    QPixmap decorationPixmapRight;
 
78
    QPixmap decorationPixmapTop;
 
79
    QPixmap decorationPixmapBottom;
 
80
    bool no_border;
 
81
    QRect decoration_left;
 
82
    QRect decoration_right;
 
83
    QRect decoration_top;
 
84
    QRect decoration_bottom;
 
85
    int padding_left, padding_top, padding_right, padding_bottom;
 
86
};
 
87
 
 
88
inline void Deleted::refWindow()
 
89
{
 
90
    ++delete_refcount;
 
91
}
 
92
 
 
93
} // namespace
 
94
 
 
95
#endif