2 * Copyright 2008 Aike J Sommer <dev@aikesommer.name>
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
6 * published by the Free Software Foundation; either version 2,
7 * or (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 Library General Public
15 * License along with this program; if not, write to the
16 * Free Software Foundation, Inc.,
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
21 #ifndef KEPHAL_BACKENDCONFIGURATIONS_H
22 #define KEPHAL_BACKENDCONFIGURATIONS_H
29 #include "kephal/configurations.h"
34 class BackendConfiguration
: public Configuration
{
37 BackendConfiguration(QObject
* parent
);
40 * Returns the real layout, with screen-sizes
41 * taken from the actual Outputs.
43 * @param simpleLayout The layout as returned
45 * @param outputScreens A mapping of Outputs
47 * @param outputSizes The sizes to use for the
48 * Outputs instead of the current ones.
50 QMap
<int, QRect
> realLayout(const QMap
<int, QPoint
> & simpleLayout
, const QMap
<Output
*, int> & outputScreens
, const QMap
<Output
*, QSize
> & outputSizes
);
53 * Returns the real layout, with screen-sizes
54 * taken from the actual Outputs.
56 * @param simpleLayout The layout as returned
58 * @param outputScreens A mapping of Outputs
61 QMap
<int, QRect
> realLayout(const QMap
<int, QPoint
> & simpleLayout
, const QMap
<Output
*, int> & outputScreens
);
64 * Returns the real layout, with screen-sizes
65 * taken from the actual Outputs.
66 * This will calculate the layout by calling
69 * @param outputScreens A mapping of Outputs
72 QMap
<int, QRect
> realLayout(const QMap
<Output
*, int> & outputScreens
);
75 * Returns the real layout, with screen-sizes
76 * taken from the actual Outputs.
77 * This will calculate the layout by calling
78 * layout() and use the Output to Screen
79 * mapping as currently active if possible.
81 QMap
<int, QRect
> realLayout();
84 * Returns a set of points covered in the
85 * layout returned by layout().
87 QSet
<QPoint
> positions();
90 * Returns the positions as in positions
91 * to which the Screen can be cloned.
93 QSet
<QPoint
> clonePositions(int screen
);
96 * Returns the layout if the Screen screen
97 * was to be cloned to any of the other
100 QMap
<int, QPoint
> cloneLayout(int screen
);
103 * Returns the possible positions as in
104 * positions() to move the Screen screen
107 QSet
<QPoint
> possiblePositions(int screen
);
110 void simpleToReal(QMap
<int, QPoint
> & simpleLayout
, const QMap
<int, QSize
> & screenSizes
, int index
, QMap
<int, QRect
> & screens
);
111 QList
<QSet
<QPoint
> > partition(int screen
);
112 QSet
<QPoint
> border(QSet
<QPoint
> screens
);
117 class BackendConfigurations
: public Configurations
{
120 static BackendConfigurations
* self();
122 BackendConfigurations(QObject
* parent
);
123 virtual ~BackendConfigurations();
126 * Find the Configuration for the currently
129 virtual Configuration
* findConfiguration() = 0;
132 * Apply Output-specific settings such as size,
133 * refresh-rate and rotation.
135 virtual void applyOutputSettings() = 0;
137 virtual BackendConfiguration
* activeBackendConfiguration();
140 static BackendConfigurations
* m_instance
;
146 #endif // KEPHAL_BACKENDCONFIGURATIONS_H