summaryrefslogtreecommitdiff
path: root/noncore/styles/liquid/plugin.cpp
authorsandman <sandman>2002-10-04 01:42:57 (UTC)
committer sandman <sandman>2002-10-04 01:42:57 (UTC)
commit4a6ccb87f45065bc37f801adb61c3462f870cb92 (patch) (side-by-side diff)
tree86b6819ee7a13b8df82b14b2bdcf46741b5935a0 /noncore/styles/liquid/plugin.cpp
parentb7ec6d0674f0f7835da7f114683dcfa74e6bc546 (diff)
downloadopie-4a6ccb87f45065bc37f801adb61c3462f870cb92.zip
opie-4a6ccb87f45065bc37f801adb61c3462f870cb92.tar.gz
opie-4a6ccb87f45065bc37f801adb61c3462f870cb92.tar.bz2
- ported all OPIE styles to the new Qtopia compatible style interface
- some cleanup in liquid (unused code)
Diffstat (limited to 'noncore/styles/liquid/plugin.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/styles/liquid/plugin.cpp81
1 files changed, 26 insertions, 55 deletions
diff --git a/noncore/styles/liquid/plugin.cpp b/noncore/styles/liquid/plugin.cpp
index 5f4c8e5..0740420 100644
--- a/noncore/styles/liquid/plugin.cpp
+++ b/noncore/styles/liquid/plugin.cpp
@@ -1,3 +1,5 @@
+#include <qapplication.h>
+
#include "liquid.h"
#include "liquidset.h"
#include "plugin.h"
@@ -6,82 +8,41 @@
LiquidInterface::LiquidInterface ( ) : ref ( 0 )
{
+ m_widget = 0;
}
LiquidInterface::~LiquidInterface ( )
{
}
-QStyle *LiquidInterface::create ( )
+QStyle *LiquidInterface::style ( )
{
return new LiquidStyle ( );
}
-QString LiquidInterface::name ( )
-{
- return QObject::tr( "Liquid", "name" );
-}
-
-QString LiquidInterface::description ( )
-{
- return QObject::tr( "High Performance Liquid style by Mosfet", "description" );
-}
-
-QCString LiquidInterface::key ( )
+QString LiquidInterface::name ( ) const
{
- return QCString ( "liquid" );
+ return qApp-> translate ( "Styles", "Liquid" );
}
-unsigned int LiquidInterface::version ( )
+QString LiquidInterface::description ( ) const
{
- return 100; // 1.0.0 (\d+.\d.\d)
+ return qApp-> translate ( "Styles", "High Performance Liquid style by Mosfet" );
}
-QRESULT LiquidInterface::queryInterface ( const QUuid &uuid, QUnknownInterface **iface )
+bool LiquidInterface::hasSettings ( ) const
{
- static LiquidSettingsInterface *setiface = 0;
-
- *iface = 0;
-
- if ( uuid == IID_QUnknown )
- *iface = this;
- else if ( uuid == IID_Style )
- *iface = this;
- else if ( uuid == IID_StyleSettings ) {
- if ( !setiface )
- setiface = new LiquidSettingsInterface ( );
- *iface = setiface;
- }
-
- if ( *iface )
- (*iface)-> addRef ( );
-
- return QS_OK;
+ return true;
}
-Q_EXPORT_INTERFACE()
-{
- Q_CREATE_INSTANCE( LiquidInterface )
-}
-
-
-LiquidSettingsInterface::LiquidSettingsInterface ( ) : ref ( 0 )
-{
- m_widget = 0;
-}
-
-LiquidSettingsInterface::~LiquidSettingsInterface ( )
-{
-}
-
-QWidget *LiquidSettingsInterface::create ( QWidget *parent, const char *name )
+QWidget *LiquidInterface::create ( QWidget *parent, const char *name )
{
m_widget = new LiquidSettings ( parent, name ? name : "LIQUID-SETTINGS" );
return m_widget;
}
-bool LiquidSettingsInterface::accept ( )
+bool LiquidInterface::accept ( )
{
if ( !m_widget )
return false;
@@ -89,18 +50,20 @@ bool LiquidSettingsInterface::accept ( )
return m_widget-> writeConfig ( );
}
-void LiquidSettingsInterface::reject ( )
+void LiquidInterface::reject ( )
{
}
-QRESULT LiquidSettingsInterface::queryInterface ( const QUuid &uuid, QUnknownInterface **iface )
+
+QRESULT LiquidInterface::queryInterface ( const QUuid &uuid, QUnknownInterface **iface )
{
*iface = 0;
-
if ( uuid == IID_QUnknown )
*iface = this;
- else if ( uuid == IID_StyleSettings )
+ else if ( uuid == IID_Style )
+ *iface = this;
+ else if ( uuid == IID_StyleExtended )
*iface = this;
if ( *iface )
@@ -109,5 +72,13 @@ QRESULT LiquidSettingsInterface::queryInterface ( const QUuid &uuid, QUnknownInt
return QS_OK;
}
+Q_EXPORT_INTERFACE()
+{
+ Q_CREATE_INSTANCE( LiquidInterface )
+}
+
+
+
+
// Hack for Retail Z experiments
extern "C" { QStyle *allocate ( ) { return new LiquidStyle ( ); } }