author | sandman <sandman> | 2002-10-04 01:42:57 (UTC) |
---|---|---|
committer | sandman <sandman> | 2002-10-04 01:42:57 (UTC) |
commit | 4a6ccb87f45065bc37f801adb61c3462f870cb92 (patch) (side-by-side diff) | |
tree | 86b6819ee7a13b8df82b14b2bdcf46741b5935a0 /noncore/styles/theme | |
parent | b7ec6d0674f0f7835da7f114683dcfa74e6bc546 (diff) | |
download | opie-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)
-rw-r--r-- | noncore/styles/theme/plugin.cpp | 80 | ||||
-rw-r--r-- | noncore/styles/theme/plugin.h | 23 |
2 files changed, 30 insertions, 73 deletions
diff --git a/noncore/styles/theme/plugin.cpp b/noncore/styles/theme/plugin.cpp index 4383693..2560720 100644 --- a/noncore/styles/theme/plugin.cpp +++ b/noncore/styles/theme/plugin.cpp @@ -1,2 +1,4 @@ +#include <qapplication.h> + #include "othemestyle.h" #include "themeset.h" @@ -7,4 +9,5 @@ ThemeInterface::ThemeInterface ( ) : ref ( 0 ) { + m_widget = 0; } @@ -13,67 +16,25 @@ ThemeInterface::~ThemeInterface ( ) } -QStyle *ThemeInterface::create ( ) +QStyle *ThemeInterface::style ( ) { return new OThemeStyle ( "" ); } -QString ThemeInterface::name ( ) -{ - return QObject::tr( "Themed style", "name" ); -} - -QString ThemeInterface::description ( ) -{ - return QObject::tr( "KDE2 theme compatible style engine", "description" ); -} - -QCString ThemeInterface::key ( ) -{ - return QCString ( "theme" ); -} - -unsigned int ThemeInterface::version ( ) +QString ThemeInterface::name ( ) const { - return 100; // 1.0.0 (\d+.\d.\d) + return qApp-> translate ( "Styles", "Themed style" ); } -QRESULT ThemeInterface::queryInterface ( const QUuid &uuid, QUnknownInterface **iface ) +QString ThemeInterface::description ( ) const { - static ThemeSettingsInterface *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 ThemeSettingsInterface ( ); - *iface = setiface; - } - - if ( *iface ) - (*iface)-> addRef ( ); - - return QS_OK; + return qApp-> translate ( "Styles", "KDE2 theme compatible style engine" ); } -Q_EXPORT_INTERFACE() +bool ThemeInterface::hasSettings ( ) const { - Q_CREATE_INSTANCE( ThemeInterface ) + return true; } - -ThemeSettingsInterface::ThemeSettingsInterface ( ) : ref ( 0 ) -{ - m_widget = 0; -} - -ThemeSettingsInterface::~ThemeSettingsInterface ( ) -{ -} - -QWidget *ThemeSettingsInterface::create ( QWidget *parent, const char *name ) +QWidget *ThemeInterface::create ( QWidget *parent, const char *name ) { m_widget = new ThemeSettings ( parent, name ? name : "THEME-SETTINGS" ); @@ -82,5 +43,5 @@ QWidget *ThemeSettingsInterface::create ( QWidget *parent, const char *name ) } -bool ThemeSettingsInterface::accept ( ) +bool ThemeInterface::accept ( ) { if ( !m_widget ) @@ -90,16 +51,18 @@ bool ThemeSettingsInterface::accept ( ) } -void ThemeSettingsInterface::reject ( ) +void ThemeInterface::reject ( ) { } -QRESULT ThemeSettingsInterface::queryInterface ( const QUuid &uuid, QUnknownInterface **iface ) + +QRESULT ThemeInterface::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; @@ -110,2 +73,9 @@ QRESULT ThemeSettingsInterface::queryInterface ( const QUuid &uuid, QUnknownInte } +Q_EXPORT_INTERFACE() +{ + Q_CREATE_INSTANCE( ThemeInterface ) +} + + + diff --git a/noncore/styles/theme/plugin.h b/noncore/styles/theme/plugin.h index d13fc5d..60cae97 100644 --- a/noncore/styles/theme/plugin.h +++ b/noncore/styles/theme/plugin.h @@ -6,5 +6,5 @@ class ThemeSettings; -class ThemeInterface : public StyleInterface { +class ThemeInterface : public StyleExtendedInterface { public: ThemeInterface ( ); @@ -14,24 +14,11 @@ public: Q_REFCOUNT - virtual QStyle *create ( ); + virtual QStyle *style ( ); + virtual QString name ( ) const; - virtual QString description ( ); - virtual QString name ( ); - virtual QCString key ( ); + virtual QString description ( ) const; - virtual unsigned int version ( ); + virtual bool hasSettings ( ) const; -private: - ulong ref; -}; - -class ThemeSettingsInterface : public StyleSettingsInterface { -public: - ThemeSettingsInterface ( ); - virtual ~ThemeSettingsInterface ( ); - - QRESULT queryInterface ( const QUuid &, QUnknownInterface ** ); - Q_REFCOUNT - virtual QWidget *create ( QWidget *parent, const char *name = 0 ); |