summaryrefslogtreecommitdiff
path: root/noncore/applets/zkbapplet/zkbapplet.cpp
Unidiff
Diffstat (limited to 'noncore/applets/zkbapplet/zkbapplet.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/applets/zkbapplet/zkbapplet.cpp49
1 files changed, 49 insertions, 0 deletions
diff --git a/noncore/applets/zkbapplet/zkbapplet.cpp b/noncore/applets/zkbapplet/zkbapplet.cpp
new file mode 100644
index 0000000..6c71568
--- a/dev/null
+++ b/noncore/applets/zkbapplet/zkbapplet.cpp
@@ -0,0 +1,49 @@
1#include <stdio.h>
2#include <qlabel.h>
3#include <qbutton.h>
4#include <qwindowsystem_qws.h>
5#include "zkbapplet.h"
6#include "zkbwidget.h"
7
8
9ZkbApplet::ZkbApplet() : app(0){
10}
11
12ZkbApplet::~ZkbApplet()
13{
14 if (app) delete app;
15}
16
17QWidget* ZkbApplet::applet(QWidget* parent) {
18 if (app == 0) {
19 app = new ZkbWidget(parent);
20 }
21
22 return app;
23}
24
25int ZkbApplet::position() const {
26 return 8;
27}
28
29QRESULT ZkbApplet::queryInterface(const QUuid& uuid, QUnknownInterface** iface) {
30
31 *iface = 0;
32 if (uuid == IID_QUnknown) {
33 *iface = this;
34 } else if (uuid == IID_TaskbarApplet) {
35 *iface = this;
36 } else {
37 return QS_FALSE;
38 }
39
40 if (*iface) {
41 (*iface)->addRef();
42 }
43
44 return QS_OK;
45}
46
47Q_EXPORT_INTERFACE() {
48 Q_CREATE_INSTANCE(ZkbApplet)
49}