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

« back to all changes in this revision

Viewing changes to libs/kephal/service/xrandr12/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 <QDebug>
 
23
 
 
24
#include "randr.h"
 
25
 
 
26
#include <QObject>
 
27
#include <QMap>
 
28
#include <QRect>
 
29
 
 
30
 
 
31
class QSize;
 
32
 
 
33
 
 
34
class RandRScreen : public QObject
 
35
{
 
36
    Q_OBJECT
 
37
 
 
38
public:
 
39
    RandRScreen(int screenIndex);
 
40
    ~RandRScreen();
 
41
 
 
42
    int index() const;
 
43
 
 
44
    XRRScreenResources* resources() const;
 
45
    Window rootWindow() const;
 
46
 
 
47
    QSize minSize() const;
 
48
    QSize maxSize() const;
 
49
 
 
50
    void loadSettings(bool notify = false);
 
51
 
 
52
    void handleEvent(XRRScreenChangeNotifyEvent* event);
 
53
    void handleRandREvent(XRRNotifyEvent* event);
 
54
 
 
55
    CrtcMap  crtcs() const;
 
56
    RandRCrtc *crtc(RRCrtc id) const;
 
57
 
 
58
    OutputMap outputs() const;
 
59
    RandROutput *output(RROutput id) const;
 
60
 
 
61
    ModeMap modes() const;
 
62
    RandRMode mode(RRMode id) const;
 
63
 
 
64
    bool adjustSize(const QRect &minimumSize = QRect(0,0,0,0));
 
65
    bool setSize(const QSize &s);
 
66
 
 
67
    /**
 
68
     * Return the number of connected outputs
 
69
     */
 
70
    int connectedCount() const;
 
71
 
 
72
    /**
 
73
     * Return the number of active outputs
 
74
     */
 
75
    int activeCount() const;
 
76
 
 
77
    bool outputsUnified() const;
 
78
    void setOutputsUnified(bool unified);
 
79
 
 
80
    int unifiedRotations() const;
 
81
    SizeList unifiedSizes() const;
 
82
 
 
83
    QRect rect() const;
 
84
 
 
85
    void pollState();
 
86
 
 
87
protected:
 
88
    bool loadModes();
 
89
    void reloadResources();
 
90
 
 
91
public slots:
 
92
    void slotOutputChanged(RROutput id, int changes);
 
93
 
 
94
signals:
 
95
    void configChanged();
 
96
 
 
97
private:
 
98
    int m_index;
 
99
    QSize m_minSize;
 
100
    QSize m_maxSize;
 
101
    QRect m_rect;
 
102
 
 
103
    int m_connectedCount;
 
104
    int m_activeCount;
 
105
 
 
106
    XRRScreenResources* m_resources;
 
107
 
 
108
    CrtcMap m_crtcs;
 
109
    OutputMap m_outputs;
 
110
    ModeMap m_modes;
 
111
 
 
112
};
 
113
 
 
114
#endif