author | sandman <sandman> | 2002-07-06 16:42:29 (UTC) |
---|---|---|
committer | sandman <sandman> | 2002-07-06 16:42:29 (UTC) |
commit | 3a422983abc7342c9229dccac825d0608fca10f3 (patch) (unidiff) | |
tree | fd0d71eab4df0b286b78efe24184525ae4c819a3 /noncore/styles/metal/plugin.cpp | |
parent | 8beb5fcdbca8110dc586a7e620bf8eae892087fb (diff) | |
download | opie-3a422983abc7342c9229dccac825d0608fca10f3.zip opie-3a422983abc7342c9229dccac825d0608fca10f3.tar.gz opie-3a422983abc7342c9229dccac825d0608fca10f3.tar.bz2 |
Complete renovation of the external style API:
- created two QCom interfaces in "styleinterface.h"
- moved the liquid/theme settings apps into the plugins
- modified the plugin interface for all three styles
- extended appearance to fully support the new API (replaces the
settings apps)
Additional work:
- made a workaround in appearance for a Qt Bug -- now a QDialog again
(this should really be fixed in Qt, but Z won't work that way)
Diffstat (limited to 'noncore/styles/metal/plugin.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/styles/metal/plugin.cpp | 54 |
1 files changed, 41 insertions, 13 deletions
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,29 +1,57 @@ | |||
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 | } |
7 | int major_version ( ); | 8 | |
8 | const char *description ( ); | 9 | MetalInterface::~MetalInterface ( ) |
10 | { | ||
11 | } | ||
12 | |||
13 | QStyle *MetalInterface::create ( ) | ||
14 | { | ||
15 | return new MetalStyle ( ); | ||
16 | } | ||
17 | |||
18 | QString MetalInterface::name ( ) | ||
19 | { | ||
20 | return QObject::tr( "Metal", "name" ); | ||
21 | } | ||
22 | |||
23 | QString MetalInterface::description ( ) | ||
24 | { | ||
25 | return QObject::tr( "Metal style", "description" ); | ||
9 | } | 26 | } |
10 | 27 | ||
11 | QStyle* allocate ( ) | 28 | QCString MetalInterface::key ( ) |
12 | { | 29 | { |
13 | return new MetalStyle ( ); | 30 | return QCString ( "metal" ); |
14 | } | 31 | } |
15 | 32 | ||
16 | int minor_version ( ) | 33 | unsigned int MetalInterface::version ( ) |
17 | { | 34 | { |
18 | return 0; | 35 | return 100; // 1.0.0 (\d+.\d.\d) |
19 | } | 36 | } |
20 | 37 | ||
21 | int major_version ( ) | 38 | QRESULT MetalInterface::queryInterface ( const QUuid &uuid, QUnknownInterface **iface ) |
22 | { | 39 | { |
23 | return 1; | 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; | ||
24 | } | 51 | } |
25 | 52 | ||
26 | const char *description ( ) | 53 | Q_EXPORT_INTERFACE() |
27 | { | 54 | { |
28 | return "Metal style plugin"; | 55 | Q_CREATE_INSTANCE( MetalInterface ) |
29 | } | 56 | } |
57 | |||