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

« back to all changes in this revision

Viewing changes to libs/kephal/service/xrandr12/randrcrtc.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 __RANDRCRTC_H__
 
20
#define __RANDRCRTC_H__
 
21
 
 
22
#include <QDebug>
 
23
 
 
24
#include "randr.h"
 
25
 
 
26
#include <QObject>
 
27
#include <QRect>
 
28
 
 
29
 
 
30
/** Class representing a CRT controller. */
 
31
class RandRCrtc : public QObject
 
32
{
 
33
    Q_OBJECT
 
34
 
 
35
public:
 
36
    RandRCrtc(RandRScreen *parent, RRCrtc id);
 
37
    ~RandRCrtc();
 
38
 
 
39
    RRCrtc id() const;
 
40
    int rotations() const;
 
41
    int rotation() const;
 
42
 
 
43
    void loadSettings(bool notify = false);
 
44
    void handleEvent(XRRCrtcChangeNotifyEvent *event);
 
45
 
 
46
    bool isValid(void) const;
 
47
    RandRMode mode() const;
 
48
    QRect rect() const;
 
49
    float refreshRate() const;
 
50
 
 
51
    bool proposeSize(const QSize &s);
 
52
    bool proposePosition(const QPoint &p);
 
53
    bool proposeRotation(int rotation);
 
54
    bool proposeRefreshRate(float rate);
 
55
 
 
56
    // applying stuff
 
57
    bool applyProposed();
 
58
    void proposeOriginal();
 
59
    void setOriginal();
 
60
    bool proposedChanged();
 
61
 
 
62
    bool addOutput(RROutput output, const QSize &size = QSize());
 
63
    bool removeOutput(RROutput output);
 
64
    OutputList connectedOutputs() const;
 
65
 
 
66
    ModeList modes() const;
 
67
 
 
68
signals:
 
69
    void crtcChanged(RRCrtc c, int changes);
 
70
 
 
71
private:
 
72
    RRCrtc m_id;
 
73
    RRMode m_currentMode;
 
74
 
 
75
    QRect m_currentRect;
 
76
    float m_currentRate;
 
77
    int m_currentRotation;
 
78
 
 
79
 
 
80
    QRect m_originalRect;
 
81
    float m_originalRate;
 
82
    int m_originalRotation;
 
83
 
 
84
    QRect m_proposedRect;
 
85
    float m_proposedRate;
 
86
    int m_proposedRotation;
 
87
 
 
88
    OutputList m_connectedOutputs;
 
89
    OutputList m_possibleOutputs;
 
90
    int m_rotations;
 
91
 
 
92
    RandRScreen *m_screen;
 
93
};
 
94
 
 
95
#endif