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

« back to all changes in this revision

Viewing changes to kcontrol/randr/randrscreen.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
 * Copyright (c) 2007 Gustavo Pichorim Boiko <gustavo.boiko@kdemail.net>
 
3
 *
 
4
 *  This program is free software; you can redistribute it and/or modify
 
5
 *  it under the terms of the GNU General Public License as published by
 
6
 *  the Free Software Foundation; either version 2 of the License, or
 
7
 *  (at your option) any later version.
 
8
 *
 
9
 *  This program is distributed in the hope that it will be useful,
 
10
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 
11
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
12
 *  GNU General Public License for more details.
 
13
 *
 
14
 *  You should have received a copy of the GNU General Public License
 
15
 *  along with this program; if not, write to the Free Software
 
16
 *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 
17
 */
 
18
 
 
19
#ifndef __RANDRSCREEN_H__
 
20
#define __RANDRSCREEN_H__
 
21
 
 
22
#include "randr.h"
 
23
 
 
24
#include <QX11Info>
 
25
#include <QObject>
 
26
#include <QMap>
 
27
 
 
28
class QSize;
 
29
class QAction;
 
30
class KConfig;
 
31
 
 
32
class RandRScreen : public QObject
 
33
{
 
34
        Q_OBJECT
 
35
 
 
36
public:
 
37
        RandRScreen(int screenIndex);
 
38
        ~RandRScreen();
 
39
 
 
40
        int index() const;
 
41
 
 
42
        XRRScreenResources* resources() const;
 
43
        Window rootWindow() const;
 
44
 
 
45
        QSize minSize() const;
 
46
        QSize maxSize() const;
 
47
 
 
48
        void loadSettings(bool notify = false);
 
49
 
 
50
        void handleEvent(XRRScreenChangeNotifyEvent* event);
 
51
        void handleRandREvent(XRRNotifyEvent* event);
 
52
 
 
53
        CrtcMap  crtcs() const;
 
54
        RandRCrtc *crtc(RRCrtc id) const;
 
55
        
 
56
        OutputMap outputs() const;
 
57
        RandROutput *output(RROutput id) const;
 
58
 
 
59
#ifdef HAS_RANDR_1_3
 
60
        void setPrimaryOutput(RandROutput* output);
 
61
        RandROutput* primaryOutput();
 
62
 
 
63
        void proposePrimaryOutput(RandROutput* output);
 
64
#endif
 
65
 
 
66
        ModeMap modes() const;
 
67
        RandRMode mode(RRMode id) const;
 
68
 
 
69
        bool adjustSize(const QRect &minimumSize = QRect(0,0,0,0));
 
70
        bool setSize(const QSize &s);
 
71
 
 
72
        /**
 
73
         * Return the number of connected outputs
 
74
         */
 
75
        int connectedCount() const;
 
76
 
 
77
        /**
 
78
         * Return the number of active outputs
 
79
         */
 
80
        int activeCount() const;
 
81
 
 
82
        bool outputsUnified() const;
 
83
        void setOutputsUnified(bool unified);
 
84
 
 
85
        int unifiedRotations() const;
 
86
        SizeList unifiedSizes() const;
 
87
 
 
88
        QRect rect() const;
 
89
 
 
90
        bool applyProposed(bool confirm);
 
91
 
 
92
        void load(KConfig &config);
 
93
        void save(KConfig &config);
 
94
        QStringList startupCommands() const;
 
95
 
 
96
public slots:
 
97
        void slotUnifyOutputs(bool unify);
 
98
        void slotResizeUnified(QAction *action);
 
99
        void slotRotateUnified(QAction *action);
 
100
 
 
101
        void slotOutputChanged(RROutput id, int changes);
 
102
 
 
103
        void save();
 
104
        void load();
 
105
 
 
106
signals:
 
107
        void configChanged();
 
108
 
 
109
protected slots:
 
110
        void unifyOutputs();
 
111
 
 
112
private:
 
113
        int m_index;
 
114
        QSize m_minSize;
 
115
        QSize m_maxSize;
 
116
        QRect m_rect;
 
117
 
 
118
        bool m_outputsUnified;
 
119
        QRect m_unifiedRect;
 
120
        int m_unifiedRotation;
 
121
 
 
122
        int m_connectedCount;
 
123
        int m_activeCount;
 
124
 
 
125
#ifdef HAS_RANDR_1_3
 
126
        RandROutput* m_originalPrimaryOutput;
 
127
        RandROutput* m_proposedPrimaryOutput;
 
128
#endif //HAS_RANDR_1_3
 
129
 
 
130
        XRRScreenResources* m_resources;
 
131
 
 
132
        CrtcMap m_crtcs;
 
133
        OutputMap m_outputs;
 
134
        ModeMap m_modes;
 
135
                
 
136
};
 
137
 
 
138
#endif
 
139
// vim:noet:sts=8:sw=8: