2
* Copyright 2006, 2007 Aaron Seigo <aseigo@kde.org>
3
* Copyright 2008 Chani Armitage <chanika@gmail.com>
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
7
* published by the Free Software Foundation; either version 2,
8
* or (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 Library General Public
16
* License along with this program; if not, write to the
17
* Free Software Foundation, Inc.,
18
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
28
#include <KUniqueApplication>
30
#include <plasma/plasma.h>
39
class BackgroundDialog;
41
class PlasmaApp : public KUniqueApplication
44
Q_CLASSINFO("D-Bus Interface", "org.kde.plasmaoverlay.App")
48
static PlasmaApp* self();
49
static bool hasComposite();
51
Plasma::Corona* corona();
53
void setActiveOpacity(qreal opacity);
54
void setIdleOpacity(qreal opacity);
55
qreal activeOpacity() const;
56
qreal idleOpacity() const;
60
//if you change stuff, remember to regenerate with:
61
//qdbuscpp2xml -S -M plasmaapp.h > org.kde.plasma-overlay.App.xml
63
//XXX can this be deleted? probably. if lockprocess really cares it can use the unmapnotify
68
//if you change stuff, remember to regenerate ^^^
70
* tell plasma to go into active mode, ready for interaction
72
void setActive(bool activate);
79
//not really slots, but we want them in dbus:
82
* get plasma all set up and ready
83
* this makes sure things like opacity, visibility and locked-ness are set right
84
* normally this is called only by plasmaapp itself when it finishes initialization, but it's
85
* possible that it might need to be run again by lockprocess
87
* @param setupMode whether we're starting in setup mode
89
void setup(bool setupMode);
92
* quit the application
93
* this is a duplicate so we can have everything we need in one dbus interface
99
//void adjustSize(int screen);
100
void dialogDestroyed(QObject *obj);
101
void configureContainment(Plasma::Containment*);
103
void immutabilityChanged(Plasma::ImmutabilityType immutability);
104
void createWaitingViews();
105
void containmentScreenOwnerChanged(int, int, Plasma::Containment*);
110
void setViewOpacity(qreal opacity);
113
void hideWidgetExplorer();
114
void enableSetupMode();
115
void disableSetupMode();
120
bool eventFilter(QObject *obj, QEvent *event);
123
PlasmaApp(Display* display, Qt::HANDLE visual, Qt::HANDLE colormap);
124
SaverView *viewForScreen(int screen);
126
Plasma::Corona *m_corona;
127
QList<SaverView*> m_views;
128
QList<QWidget*> m_dialogs;
129
QPointer<BackgroundDialog> m_configDialog;
131
QList<QWeakPointer<Plasma::Containment> > m_viewsWaiting;
132
QTimer m_viewCreationTimer;
134
qreal m_activeOpacity;
139
#endif // multiple inclusion guard