~ubuntu-branches/ubuntu/gutsy/kdebase-workspace/gutsy-backports

« back to all changes in this revision

Viewing changes to kcontrol/randr/randrcrtc.h

  • Committer: Bazaar Package Importer
  • Author(s): Jonathan Riddell
  • Date: 2007-09-05 20:45:14 UTC
  • Revision ID: james.westby@ubuntu.com-20070905204514-632hhspl0nvrc84i
Tags: upstream-3.93.0
ImportĀ upstreamĀ versionĀ 3.93.0

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