-rw-r--r-- | noncore/styles/metal/metal.pro | 2 | ||||
-rw-r--r-- | noncore/styles/metal/plugin.cpp | 52 | ||||
-rw-r--r-- | noncore/styles/metal/plugin.h | 27 |
3 files changed, 68 insertions, 13 deletions
diff --git a/noncore/styles/metal/metal.pro b/noncore/styles/metal/metal.pro index 6e99389..cf15f33 100644 --- a/noncore/styles/metal/metal.pro +++ b/noncore/styles/metal/metal.pro | |||
@@ -4,3 +4,3 @@ SOURCES = metal.cpp plugin.cpp | |||
4 | 4 | ||
5 | HEADERS = metal.h | 5 | HEADERS = metal.h plugin.h |
6 | LIBS += -lqpe | 6 | LIBS += -lqpe |
diff --git a/noncore/styles/metal/plugin.cpp b/noncore/styles/metal/plugin.cpp index e5bee10..1db4aac 100644 --- a/noncore/styles/metal/plugin.cpp +++ b/noncore/styles/metal/plugin.cpp | |||
@@ -1,12 +1,14 @@ | |||
1 | #include "metal.h" | 1 | #include "metal.h" |
2 | #include "plugin.h" | ||
2 | 3 | ||
3 | 4 | ||
4 | extern "C" { | 5 | MetalInterface::MetalInterface ( ) : ref ( 0 ) |
5 | QStyle* allocate ( ); | 6 | { |
6 | int minor_version ( ); | ||
7 | int major_version ( ); | ||
8 | const char *description ( ); | ||
9 | } | 7 | } |
10 | 8 | ||
11 | QStyle* allocate ( ) | 9 | MetalInterface::~MetalInterface ( ) |
10 | { | ||
11 | } | ||
12 | |||
13 | QStyle *MetalInterface::create ( ) | ||
12 | { | 14 | { |
@@ -15,15 +17,41 @@ QStyle* allocate ( ) | |||
15 | 17 | ||
16 | int minor_version ( ) | 18 | QString MetalInterface::name ( ) |
17 | { | 19 | { |
18 | return 0; | 20 | return QObject::tr( "Metal", "name" ); |
19 | } | 21 | } |
20 | 22 | ||
21 | int major_version ( ) | 23 | QString MetalInterface::description ( ) |
22 | { | 24 | { |
23 | return 1; | 25 | return QObject::tr( "Metal style", "description" ); |
24 | } | 26 | } |
25 | 27 | ||
26 | const char *description ( ) | 28 | QCString MetalInterface::key ( ) |
27 | { | 29 | { |
28 | return "Metal style plugin"; | 30 | return QCString ( "metal" ); |
29 | } | 31 | } |
32 | |||
33 | unsigned int MetalInterface::version ( ) | ||
34 | { | ||
35 | return 100; // 1.0.0 (\d+.\d.\d) | ||
36 | } | ||
37 | |||
38 | QRESULT MetalInterface::queryInterface ( const QUuid &uuid, QUnknownInterface **iface ) | ||
39 | { | ||
40 | *iface = 0; | ||
41 | |||
42 | if ( uuid == IID_QUnknown ) | ||
43 | *iface = this; | ||
44 | else if ( uuid == IID_Style ) | ||
45 | *iface = this; | ||
46 | |||
47 | if ( *iface ) | ||
48 | (*iface)-> addRef ( ); | ||
49 | |||
50 | return QS_OK; | ||
51 | } | ||
52 | |||
53 | Q_EXPORT_INTERFACE() | ||
54 | { | ||
55 | Q_CREATE_INSTANCE( MetalInterface ) | ||
56 | } | ||
57 | |||
diff --git a/noncore/styles/metal/plugin.h b/noncore/styles/metal/plugin.h new file mode 100644 index 0000000..f61c833 --- a/dev/null +++ b/noncore/styles/metal/plugin.h | |||
@@ -0,0 +1,27 @@ | |||
1 | #ifndef __OPIE_METAL_PLUGIN_H__ | ||
2 | #define __OPIE_METAL_PLUGIN_H__ | ||
3 | |||
4 | #include <qpe/styleinterface.h> | ||
5 | |||
6 | |||
7 | class MetalInterface : public StyleInterface { | ||
8 | public: | ||
9 | MetalInterface ( ); | ||
10 | virtual ~MetalInterface ( ); | ||
11 | |||
12 | QRESULT queryInterface ( const QUuid &, QUnknownInterface ** ); | ||
13 | Q_REFCOUNT | ||
14 | |||
15 | virtual QStyle *create ( ); | ||
16 | |||
17 | virtual QString description ( ); | ||
18 | virtual QString name ( ); | ||
19 | virtual QCString key ( ); | ||
20 | |||
21 | virtual unsigned int version ( ); | ||
22 | |||
23 | private: | ||
24 | ulong ref; | ||
25 | }; | ||
26 | |||
27 | #endif | ||