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__
36 const QString
& errorCode() const;
37 const QString
& version() const;
39 int eventBase() const;
40 int errorBase() const;
42 int screenIndexOfWidget(QWidget
* widget
);
44 int numScreens() const;
45 LegacyRandRScreen
* legacyScreen(int index
);
46 LegacyRandRScreen
* currentLegacyScreen();
48 RandRScreen
* screen(int index
);
49 RandRScreen
* currentScreen();
51 void setCurrentScreen(int index
);
52 int currentScreenIndex() const;
54 bool needsRefresh() const;
58 * Loads saved settings.
60 * @param config the KConfig object to load from
61 * @param loadScreens whether to call LegacyRandRScreen::load() for each screen
62 * @retuns true if the settings should be applied on KDE startup.
64 bool loadDisplay(KConfig
& config
, bool loadScreens
= true);
65 void saveDisplay(KConfig
& config
, bool applyOnStartup
, bool syncTrayApp
);
67 static bool applyOnStartup(KConfig
& config
);
68 static bool syncTrayApp(KConfig
& config
);
70 void applyProposed(bool confirm
= true);
72 bool canHandle(const XEvent
*e
) const;
73 void handleEvent(XEvent
*e
);
78 int m_currentScreenIndex
;
79 LegacyScreenList m_legacyScreens
;