summaryrefslogtreecommitdiff
path: root/noncore/styles/metal
authorsandman <sandman>2002-07-06 16:42:29 (UTC)
committer sandman <sandman>2002-07-06 16:42:29 (UTC)
commit3a422983abc7342c9229dccac825d0608fca10f3 (patch) (unidiff)
treefd0d71eab4df0b286b78efe24184525ae4c819a3 /noncore/styles/metal
parent8beb5fcdbca8110dc586a7e620bf8eae892087fb (diff)
downloadopie-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') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/styles/metal/metal.pro2
-rw-r--r--noncore/styles/metal/plugin.cpp54
-rw-r--r--noncore/styles/metal/plugin.h27
3 files changed, 69 insertions, 14 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
@@ -2,7 +2,7 @@ TEMPLATE = lib
2CONFIG = qt embedded release warn_on 2CONFIG = qt embedded release warn_on
3SOURCES = metal.cpp plugin.cpp 3SOURCES = metal.cpp plugin.cpp
4 4
5HEADERS = metal.h 5HEADERS = metal.h plugin.h
6LIBS += -lqpe 6LIBS += -lqpe
7INCLUDEPATH += $(OPIEDIR)/include 7INCLUDEPATH += $(OPIEDIR)/include
8DESTDIR = $(OPIEDIR)/plugins/styles 8DESTDIR = $(OPIEDIR)/plugins/styles
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
4extern "C" { 5MetalInterface::MetalInterface ( ) : ref ( 0 )
5 QStyle* allocate ( ); 6{
6 int minor_version ( ); 7}
7 int major_version ( ); 8
8 const char *description ( ); 9MetalInterface::~MetalInterface ( )
10{
11}
12
13QStyle *MetalInterface::create ( )
14{
15 return new MetalStyle ( );
16}
17
18QString MetalInterface::name ( )
19{
20 return QObject::tr( "Metal", "name" );
21}
22
23QString MetalInterface::description ( )
24{
25 return QObject::tr( "Metal style", "description" );
9} 26}
10 27
11QStyle* allocate ( ) 28QCString MetalInterface::key ( )
12{ 29{
13 return new MetalStyle ( ); 30 return QCString ( "metal" );
14} 31}
15 32
16int minor_version ( ) 33unsigned int MetalInterface::version ( )
17{ 34{
18 return 0; 35 return 100; // 1.0.0 (\d+.\d.\d)
19} 36}
20 37
21int major_version ( ) 38QRESULT 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
26const char *description ( ) 53Q_EXPORT_INTERFACE()
27{ 54{
28 return "Metal style plugin"; 55 Q_CREATE_INSTANCE( MetalInterface )
29} 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
7class MetalInterface : public StyleInterface {
8public:
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
23private:
24 ulong ref;
25};
26
27#endif