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

« back to all changes in this revision

Viewing changes to kwin/effects/coverswitch/coverswitch.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) 2008 Martin Gräßlin <ubuntu@martin-graesslin.com>
 
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_COVERSWITCH_H
 
22
#define KWIN_COVERSWITCH_H
 
23
 
 
24
#include <QHash>
 
25
#include <QRect>
 
26
#include <QRegion>
 
27
#include <QSize>
 
28
#include <QTimeLine>
 
29
#include <QQueue>
 
30
 
 
31
#include <kwineffects.h>
 
32
#include <kwinglutils.h>
 
33
 
 
34
namespace KWin
 
35
{
 
36
 
 
37
class CoverSwitchEffect
 
38
    : public Effect
 
39
{
 
40
    Q_OBJECT
 
41
public:
 
42
    CoverSwitchEffect();
 
43
    ~CoverSwitchEffect();
 
44
 
 
45
    virtual void reconfigure(ReconfigureFlags);
 
46
    virtual void prePaintScreen(ScreenPrePaintData& data, int time);
 
47
    virtual void paintScreen(int mask, QRegion region, ScreenPaintData& data);
 
48
    virtual void postPaintScreen();
 
49
    virtual void paintWindow(EffectWindow* w, int mask, QRegion region, WindowPaintData& data);
 
50
    virtual void windowInputMouseEvent(Window w, QEvent* e);
 
51
 
 
52
    static bool supported();
 
53
 
 
54
public Q_SLOTS:
 
55
    void slotWindowClosed(EffectWindow *c);
 
56
    void slotTabBoxAdded(int mode);
 
57
    void slotTabBoxClosed();
 
58
    void slotTabBoxUpdated();
 
59
 
 
60
private:
 
61
    void paintScene(EffectWindow* frontWindow, const EffectWindowList& leftWindows, const EffectWindowList& rightWindows,
 
62
                    bool reflectedWindows = false);
 
63
    void paintWindowCover(EffectWindow* w, bool reflectedWindow, WindowPaintData& data);
 
64
    void paintFrontWindow(EffectWindow* frontWindow, int width, int leftWindows, int rightWindows, bool reflectedWindow);
 
65
    void paintWindows(const EffectWindowList& windows, bool left, bool reflectedWindows, EffectWindow* additionalWindow = NULL);
 
66
    void abort();
 
67
 
 
68
    bool mActivated;
 
69
    float angle;
 
70
    bool animateSwitch;
 
71
    bool animateStart;
 
72
    bool animateStop;
 
73
    bool animation;
 
74
    bool start;
 
75
    bool stop;
 
76
    bool reflection;
 
77
    float mirrorColor[2][4];
 
78
    bool windowTitle;
 
79
    int animationDuration;
 
80
    bool stopRequested;
 
81
    bool startRequested;
 
82
    QTimeLine timeLine;
 
83
    QRect area;
 
84
    Window input;
 
85
    float zPosition;
 
86
    float scaleFactor;
 
87
    enum Direction {
 
88
        Left,
 
89
        Right
 
90
    };
 
91
    Direction direction;
 
92
    QQueue<Direction> scheduled_directions;
 
93
    EffectWindow* selected_window;
 
94
    int activeScreen;
 
95
    QList< EffectWindow* > leftWindows;
 
96
    QList< EffectWindow* > rightWindows;
 
97
    EffectWindowList currentWindowList;
 
98
    EffectWindowList referrencedWindows;
 
99
 
 
100
    EffectFrame* captionFrame;
 
101
    QFont captionFont;
 
102
 
 
103
    bool thumbnails;
 
104
    bool dynamicThumbnails;
 
105
    int thumbnailWindows;
 
106
 
 
107
    bool primaryTabBox;
 
108
    bool secondaryTabBox;
 
109
 
 
110
    GLShader *m_reflectionShader;
 
111
};
 
112
 
 
113
} // namespace
 
114
 
 
115
#endif