add more spacing
[personal-kdebase.git] / workspace / libs / kephal / screens / output / outputscreens.h
blob6849dcfd8e86158854db22190c2374ddc05bd1e5
1 /*
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_OUTPUTSCREENS_H
22 #define KEPHAL_OUTPUTSCREENS_H
24 #include <QPoint>
25 #include "kephal/screens.h"
26 #include "../simplescreen.h"
27 #include "kephal/outputs.h"
30 namespace Kephal {
32 class OutputScreen : public SimpleScreen {
33 Q_OBJECT
34 public:
35 OutputScreen(QObject * parent);
37 void add(Output * output);
38 void remove(Output * output);
39 void clearOutputs();
40 QList<Output *> outputs();
42 private:
43 QList<Output *> m_outputs;
47 class OutputScreens : public Screens {
48 Q_OBJECT
49 public:
50 OutputScreens(QObject * parent);
51 virtual QList<Screen *> screens();
53 protected:
54 virtual void prepareScreens(QMap<int, OutputScreen *> & screens);
55 void rebuildScreens();
56 void triggerRebuildScreens(); // Triggers a rebuild aftera short delay; requests are coalesced.
58 void timerEvent(QTimerEvent *event);
60 private Q_SLOTS:
61 void outputActivated(Kephal::Output * o);
62 void outputDeactivated(Kephal::Output * o);
63 void outputResized(Kephal::Output * o, QSize oldSize, QSize newSize);
64 void outputMoved(Kephal::Output * o, QPoint oldPosition, QPoint newPosition);
66 private:
67 void init();
68 void buildScreens();
69 int findId();
71 QMap<int, OutputScreen *> m_screens;
73 int m_rebuildTimerId;
74 int m_rebuildDelay;
80 #endif // KEPHAL_OUTPUTSCREENS_H