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) (side-by-side diff)
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
CONFIG = qt embedded release warn_on
SOURCES = metal.cpp plugin.cpp
-HEADERS = metal.h
+HEADERS = metal.h plugin.h
LIBS += -lqpe
INCLUDEPATH += $(OPIEDIR)/include
DESTDIR = $(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 @@
#include "metal.h"
+#include "plugin.h"
-extern "C" {
- QStyle* allocate ( );
- int minor_version ( );
- int major_version ( );
- const char *description ( );
+MetalInterface::MetalInterface ( ) : ref ( 0 )
+{
+}
+
+MetalInterface::~MetalInterface ( )
+{
+}
+
+QStyle *MetalInterface::create ( )
+{
+ return new MetalStyle ( );
+}
+
+QString MetalInterface::name ( )
+{
+ return QObject::tr( "Metal", "name" );
+}
+
+QString MetalInterface::description ( )
+{
+ return QObject::tr( "Metal style", "description" );
}
-QStyle* allocate ( )
+QCString MetalInterface::key ( )
{
- return new MetalStyle ( );
+ return QCString ( "metal" );
}
-int minor_version ( )
+unsigned int MetalInterface::version ( )
{
- return 0;
+ return 100; // 1.0.0 (\d+.\d.\d)
}
-int major_version ( )
+QRESULT MetalInterface::queryInterface ( const QUuid &uuid, QUnknownInterface **iface )
{
- return 1;
+ *iface = 0;
+
+ if ( uuid == IID_QUnknown )
+ *iface = this;
+ else if ( uuid == IID_Style )
+ *iface = this;
+
+ if ( *iface )
+ (*iface)-> addRef ( );
+
+ return QS_OK;
}
-const char *description ( )
+Q_EXPORT_INTERFACE()
{
- return "Metal style plugin";
+ Q_CREATE_INSTANCE( MetalInterface )
}
+
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 @@
+#ifndef __OPIE_METAL_PLUGIN_H__
+#define __OPIE_METAL_PLUGIN_H__
+
+#include <qpe/styleinterface.h>
+
+
+class MetalInterface : public StyleInterface {
+public:
+ MetalInterface ( );
+ virtual ~MetalInterface ( );
+
+ QRESULT queryInterface ( const QUuid &, QUnknownInterface ** );
+ Q_REFCOUNT
+
+ virtual QStyle *create ( );
+
+ virtual QString description ( );
+ virtual QString name ( );
+ virtual QCString key ( );
+
+ virtual unsigned int version ( );
+
+private:
+ ulong ref;
+};
+
+#endif