add more spacing
[personal-kdebase.git] / workspace / libs / kephal / xrandr12 / randrdisplay.h
blob14789c09e25abb1efd0dda6d3e5837760b9a16ee
1 /*
2 * Copyright (c) 2007 Gustavo Pichorim Boiko <gustavo.boiko@kdemail.net>
3 * Copyright (c) 2002,2003 Hamish Rodda <rodda@kde.org>
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20 #ifndef __RANDRDISPLAY_H__
21 #define __RANDRDISPLAY_H__
23 #include "randr.h"
25 //#include <X11/Xlib.h>
27 class RandRDisplay
29 public:
30 RandRDisplay();
31 ~RandRDisplay();
33 bool isValid() const;
34 const QString& errorCode() const;
35 const QString& version() const;
37 int eventBase() const;
38 int errorBase() const;
40 int screenIndexOfWidget(QWidget* widget);
42 int numScreens() const;
43 RandRScreen* screen(int index);
44 RandRScreen* currentScreen();
46 void setCurrentScreen(int index);
47 int currentScreenIndex() const;
49 bool needsRefresh() const;
50 void refresh();
52 void applyProposed(bool confirm = true);
54 bool canHandle(const XEvent *e) const;
55 void handleEvent(XEvent *e);
57 private:
58 Display *m_dpy;
59 int m_numScreens;
60 int m_currentScreenIndex;
62 ScreenList m_screens;
64 bool m_valid;
65 QString m_errorCode;
66 QString m_version;
68 int m_eventBase;
69 int m_errorBase;
72 #endif