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

« back to all changes in this revision

Viewing changes to kwin/effects/thumbnailaside/thumbnailaside.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) 2007 Lubos Lunak <l.lunak@kde.org>
 
6
Copyright (C) 2007 Christian Nitschkowski <christian.nitschkowski@kdemail.net>
 
7
 
 
8
This program is free software; you can redistribute it and/or modify
 
9
it under the terms of the GNU General Public License as published by
 
10
the Free Software Foundation; either version 2 of the License, or
 
11
(at your option) any later version.
 
12
 
 
13
This program is distributed in the hope that it will be useful,
 
14
but WITHOUT ANY WARRANTY; without even the implied warranty of
 
15
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
16
GNU General Public License for more details.
 
17
 
 
18
You should have received a copy of the GNU General Public License
 
19
along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
20
*********************************************************************/
 
21
 
 
22
/*
 
23
 
 
24
 Testing of painting a window more than once.
 
25
 
 
26
*/
 
27
 
 
28
#ifndef KWIN_THUMBNAILASIDE_H
 
29
#define KWIN_THUMBNAILASIDE_H
 
30
 
 
31
#include <kwineffects.h>
 
32
 
 
33
#include <qhash.h>
 
34
 
 
35
namespace KWin
 
36
{
 
37
 
 
38
class ThumbnailAsideEffect
 
39
    : public Effect
 
40
{
 
41
    Q_OBJECT
 
42
public:
 
43
    ThumbnailAsideEffect();
 
44
    virtual void reconfigure(ReconfigureFlags);
 
45
    virtual void paintScreen(int mask, QRegion region, ScreenPaintData& data);
 
46
private slots:
 
47
    void toggleCurrentThumbnail();
 
48
    void slotWindowClosed(EffectWindow *w);
 
49
    void slotWindowGeometryShapeChanged(EffectWindow *w, const QRect &old);
 
50
    void slotWindowDamaged(EffectWindow* w, const QRect& damage);
 
51
private:
 
52
    void addThumbnail(EffectWindow* w);
 
53
    void removeThumbnail(EffectWindow* w);
 
54
    void arrange();
 
55
    void repaintAll();
 
56
    struct Data {
 
57
        EffectWindow* window; // the same like the key in the hash (makes code simpler)
 
58
        int index;
 
59
        QRect rect;
 
60
    };
 
61
    QHash< EffectWindow*, Data > windows;
 
62
    int maxwidth;
 
63
    int spacing;
 
64
    double opacity;
 
65
    int screen;
 
66
};
 
67
 
 
68
} // namespace
 
69
 
 
70
#endif