~jbicha/unity-2d/fix-launcher-quicklist-naming-lp949636

« back to all changes in this revision

Viewing changes to panel/lib/applet.h

  • Committer: Aurelien Gateau
  • Date: 2010-10-06 13:52:55 UTC
  • Revision ID: aurelien.gateau@canonical.com-20101006135255-j4gsdm7k3grh0ydh
Merged in panel

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * This file is part of unity-qt
 
3
 *
 
4
 * Copyright 2010 Canonical Ltd.
 
5
 *
 
6
 * Authors:
 
7
 * - Aurélien Gâteau <aurelien.gateau@canonical.com>
 
8
 *
 
9
 * License: LGPL v3
 
10
 */
 
11
#ifndef APPLET_H
 
12
#define APPLET_H
 
13
 
 
14
// Local
 
15
 
 
16
// Qt
 
17
#include <QX11EmbedWidget>
 
18
 
 
19
namespace UnityQt
 
20
{
 
21
 
 
22
struct AppletPrivate;
 
23
class Applet : public QX11EmbedWidget
 
24
{
 
25
Q_OBJECT
 
26
public:
 
27
    Applet();
 
28
    ~Applet();
 
29
 
 
30
private:
 
31
    Q_DISABLE_COPY(Applet)
 
32
    AppletPrivate* const d;
 
33
};
 
34
 
 
35
typedef Applet* (*AppletCreatorFunction)();
 
36
template <class T>
 
37
Applet* appletCreator()
 
38
{
 
39
    return new T;
 
40
}
 
41
int appletMain(int argc, char** argv, AppletCreatorFunction);
 
42
 
 
43
} // namespace
 
44
 
 
45
#define APPLET_MAIN(APPLET_CLASS) \
 
46
int main(int argc, char** argv) \
 
47
{ \
 
48
    return UnityQt::appletMain(argc, argv, UnityQt::appletCreator<APPLET_CLASS>); \
 
49
}
 
50
 
 
51
#endif /* APPLET_H */