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 @@ #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 ) } + |