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

« back to all changes in this revision

Viewing changes to kwin/outline.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) 2011 Arthur Arlt <a.arlt@stud.uni-heidelberg.de>
 
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_OUTLINE_H
 
22
#define KWIN_OUTLINE_H
 
23
#include <X11/X.h>
 
24
#include <fixx11h.h>
 
25
#include <QtCore/QRect>
 
26
#include <QtCore/QVector>
 
27
 
 
28
namespace KWin {
 
29
 
 
30
/**
 
31
 * @short This class is used to show the outline of a given geometry.
 
32
 *
 
33
 * The class renders an outline by using four windows. One for each border of
 
34
 * the geometry. It is possible to replace the outline with an effect. If an
 
35
 * effect is available the effect will be used, otherwise the outline will be
 
36
 * rendered by using the X implementation.
 
37
 *
 
38
 * @author Arthur Arlt
 
39
 * @since 4.7
 
40
 */
 
41
class Outline {
 
42
public:
 
43
    Outline();
 
44
    ~Outline();
 
45
 
 
46
    /**
 
47
     * Set the outline geometry.
 
48
     * To show the outline use @link showOutline.
 
49
     * @param outlineGeometry The geometry of the outline to be shown
 
50
     * @see showOutline
 
51
     */
 
52
    void setGeometry(const QRect &outlineGeometry);
 
53
 
 
54
    /**
 
55
     * Shows the outline of a window using either an effect or the X implementation.
 
56
     * To stop the outline process use @link hideOutline.
 
57
     * @see hideOutline
 
58
     */
 
59
    void show();
 
60
 
 
61
    /**
 
62
     * Shows the outline for the given @p outlineGeometry.
 
63
     * This is the same as setOutlineGeometry followed by showOutline directly.
 
64
     * To stop the outline process use @link hideOutline.
 
65
     * @param outlineGeometry The geometry of the outline to be shown
 
66
     * @see hideOutline
 
67
     */
 
68
    void show(const QRect &outlineGeometry);
 
69
 
 
70
    /**
 
71
     * Hides shown outline.
 
72
     * @see showOutline
 
73
     */
 
74
    void hide();
 
75
 
 
76
    /**
 
77
     * Return outline window ids
 
78
     * @return The window ids created to represent the outline
 
79
     */
 
80
    QVector<Window> windowIds() const;
 
81
private:
 
82
 
 
83
    /**
 
84
     * Show the window outline using the X implementation
 
85
     */
 
86
    void showWithX();
 
87
 
 
88
    /**
 
89
     * Hide previously shown outline used the X implementation
 
90
     */
 
91
    void hideWithX();
 
92
 
 
93
    Window m_topOutline;
 
94
    Window m_rightOutline;
 
95
    Window m_bottomOutline;
 
96
    Window m_leftOutline;
 
97
    QRect m_outlineGeometry;
 
98
    bool m_initialized;
 
99
};
 
100
 
 
101
}
 
102
 
 
103
#endif