Changeset View
Changeset View
Standalone View
Standalone View
backends/xrandr/xrandrconfig.h
Show All 9 Lines | |||||
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * | 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * | ||
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * | 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * | ||
12 | * Lesser General Public License for more details. * | 12 | * Lesser General Public License for more details. * | ||
13 | * * | 13 | * * | ||
14 | * You should have received a copy of the GNU Lesser General Public * | 14 | * You should have received a copy of the GNU Lesser General Public * | ||
15 | * License along with this library; if not, write to the Free Software * | 15 | * License along with this library; if not, write to the Free Software * | ||
16 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * | 16 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * | ||
17 | *************************************************************************************/ | 17 | *************************************************************************************/ | ||
18 | 18 | #pragma once | |||
19 | #ifndef XRANDRCONFIG_H | | |||
20 | #define XRANDRCONFIG_H | | |||
21 | 19 | | |||
22 | #include <QObject> | 20 | #include <QObject> | ||
23 | 21 | | |||
24 | #include "xrandr.h" | 22 | #include "xrandr.h" | ||
25 | #include "xrandrcrtc.h" | 23 | #include "xrandrcrtc.h" | ||
26 | #include "xrandroutput.h" | 24 | #include "xrandroutput.h" | ||
27 | 25 | | |||
28 | class XRandRScreen; | 26 | class XRandRScreen; | ||
29 | namespace KScreen { | 27 | namespace KScreen { | ||
30 | class Config; | 28 | class Config; | ||
31 | } | 29 | } | ||
32 | 30 | | |||
33 | class XRandRConfig : public QObject | 31 | class XRandRConfig : public QObject | ||
34 | { | 32 | { | ||
35 | Q_OBJECT | 33 | Q_OBJECT | ||
36 | 34 | | |||
37 | public: | 35 | public: | ||
38 | explicit XRandRConfig(); | 36 | XRandRConfig(); | ||
39 | ~XRandRConfig() override; | 37 | ~XRandRConfig() override; | ||
40 | 38 | | |||
41 | XRandROutput::Map outputs() const; | 39 | XRandROutput::Map outputs() const; | ||
42 | XRandROutput *output(xcb_randr_output_t output) const; | 40 | XRandROutput *output(xcb_randr_output_t output) const; | ||
43 | 41 | | |||
44 | XRandRCrtc::Map crtcs() const; | 42 | XRandRCrtc::Map crtcs() const; | ||
45 | XRandRCrtc *crtc(xcb_randr_crtc_t crtc) const; | 43 | XRandRCrtc *crtc(xcb_randr_crtc_t crtc) const; | ||
46 | 44 | | |||
47 | XRandRScreen *screen() const; | 45 | XRandRScreen *screen() const; | ||
48 | 46 | | |||
49 | void addNewOutput(xcb_randr_output_t id); | 47 | void addNewOutput(xcb_randr_output_t id); | ||
50 | void addNewCrtc(xcb_randr_crtc_t crtc); | 48 | void addNewCrtc(xcb_randr_crtc_t crtc); | ||
51 | void removeOutput(xcb_randr_output_t id); | 49 | void removeOutput(xcb_randr_output_t id); | ||
52 | 50 | | |||
53 | KScreen::ConfigPtr toKScreenConfig() const; | 51 | KScreen::ConfigPtr toKScreenConfig() const; | ||
54 | void applyKScreenConfig(const KScreen::ConfigPtr &config); | 52 | void applyKScreenConfig(const KScreen::ConfigPtr &config); | ||
55 | 53 | | |||
56 | private: | 54 | private: | ||
57 | /** | | |||
58 | * We need to print stuff to discover the damn bug | | |||
59 | * where currentMode is null | | |||
60 | */ | | |||
61 | void printConfig(const KScreen::ConfigPtr &config) const; | | |||
62 | void printInternalCond() const; | | |||
63 | QSize screenSize(const KScreen::ConfigPtr &config) const; | 55 | QSize screenSize(const KScreen::ConfigPtr &config) const; | ||
64 | bool setScreenSize(const QSize &size) const; | 56 | bool setScreenSize(const QSize &size) const; | ||
57 | | ||||
65 | void setPrimaryOutput(xcb_randr_output_t outputId) const; | 58 | void setPrimaryOutput(xcb_randr_output_t outputId) const; | ||
59 | | ||||
66 | bool disableOutput(const KScreen::OutputPtr &output) const; | 60 | bool disableOutput(const KScreen::OutputPtr &output) const; | ||
67 | bool enableOutput(const KScreen::OutputPtr &output) const; | 61 | bool enableOutput(const KScreen::OutputPtr &output) const; | ||
68 | bool changeOutput(const KScreen::OutputPtr &output) const; | 62 | bool changeOutput(const KScreen::OutputPtr &output) const; | ||
69 | 63 | | |||
64 | /** | ||||
65 | * We need to print stuff to discover the damn bug | ||||
66 | * where currentMode is null | ||||
67 | */ | ||||
68 | void printConfig(const KScreen::ConfigPtr &config) const; | ||||
69 | void printInternalCond() const; | ||||
70 | | ||||
70 | XRandROutput::Map m_outputs; | 71 | XRandROutput::Map m_outputs; | ||
71 | XRandRCrtc::Map m_crtcs; | 72 | XRandRCrtc::Map m_crtcs; | ||
72 | XRandRScreen *m_screen; | 73 | XRandRScreen *m_screen; | ||
73 | }; | 74 | }; | ||
74 | | ||||
75 | #endif // XRANDRCONFIG_H | |