add more spacing
[personal-kdebase.git] / workspace / libs / kephal / xrandr12 / randrscreen.h
blob3120f06e6fefee1ee5ca751257d914002456fb69
1 /*
2 * Copyright (c) 2007 Gustavo Pichorim Boiko <gustavo.boiko@kdemail.net>
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.
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.
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.
19 #ifndef __RANDRSCREEN_H__
20 #define __RANDRSCREEN_H__
22 #include <QDebug>
24 #include "randr.h"
26 #include <QX11Info>
27 #include <QObject>
28 #include <QMap>
29 #include <QRect>
32 class QSize;
35 class RandRScreen : public QObject
37 Q_OBJECT
39 public:
40 RandRScreen(int screenIndex);
41 ~RandRScreen();
43 int index() const;
45 XRRScreenResources* resources() const;
46 Window rootWindow() const;
48 QSize minSize() const;
49 QSize maxSize() const;
51 void loadSettings(bool notify = false);
53 void handleEvent(XRRScreenChangeNotifyEvent* event);
54 void handleRandREvent(XRRNotifyEvent* event);
56 CrtcMap crtcs() const;
57 RandRCrtc *crtc(RRCrtc id) const;
59 OutputMap outputs() const;
60 RandROutput *output(RROutput id) const;
62 ModeMap modes() const;
63 RandRMode mode(RRMode id) const;
65 bool adjustSize(const QRect &minimumSize = QRect(0,0,0,0));
66 bool setSize(const QSize &s);
68 /**
69 * Return the number of connected outputs
71 int connectedCount() const;
73 /**
74 * Return the number of active outputs
76 int activeCount() const;
78 bool outputsUnified() const;
79 void setOutputsUnified(bool unified);
81 int unifiedRotations() const;
82 SizeList unifiedSizes() const;
84 QRect rect() const;
86 void pollState();
88 protected:
89 bool loadModes();
90 void reloadResources();
92 public slots:
93 void slotOutputChanged(RROutput id, int changes);
95 signals:
96 void configChanged();
98 private:
99 int m_index;
100 QSize m_minSize;
101 QSize m_maxSize;
102 QRect m_rect;
104 int m_connectedCount;
105 int m_activeCount;
107 XRRScreenResources* m_resources;
109 CrtcMap m_crtcs;
110 OutputMap m_outputs;
111 ModeMap m_modes;
115 #endif