summaryrefslogtreecommitdiff
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
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 (more/less context) (show whitespace changes)
-rw-r--r--noncore/styles/liquid/liquid.cpp2
-rw-r--r--noncore/styles/liquid/liquid.pro2
-rw-r--r--noncore/styles/liquid/liquidset.cpp31
-rw-r--r--noncore/styles/liquid/liquidset.h2
-rw-r--r--noncore/styles/liquid/plugin.cpp81
-rw-r--r--noncore/styles/liquid/plugin.h22
-rw-r--r--noncore/styles/metal/plugin.cpp22
-rw-r--r--noncore/styles/metal/plugin.h9
-rw-r--r--noncore/styles/theme/plugin.cpp80
-rw-r--r--noncore/styles/theme/plugin.h23
10 files changed, 69 insertions, 205 deletions
diff --git a/noncore/styles/liquid/liquid.cpp b/noncore/styles/liquid/liquid.cpp
index 0d9d259..1d01c65 100644
--- a/noncore/styles/liquid/liquid.cpp
+++ b/noncore/styles/liquid/liquid.cpp
@@ -12,3 +12,3 @@
#include "liquid.h"
-#include "liquiddeco.h"
+//#include "liquiddeco.h"
#include <qapplication.h>
diff --git a/noncore/styles/liquid/liquid.pro b/noncore/styles/liquid/liquid.pro
index ed1c2f1..0e3716f 100644
--- a/noncore/styles/liquid/liquid.pro
+++ b/noncore/styles/liquid/liquid.pro
@@ -3,3 +3,2 @@ CONFIG = qt embedded release warn_on
SOURCES = liquid.cpp \
- liquiddeco.cpp \
effects.cpp \
@@ -9,3 +8,2 @@ SOURCES = liquid.cpp \
HEADERS = liquid.h \
- liquiddeco.h \
effects.h \
diff --git a/noncore/styles/liquid/liquidset.cpp b/noncore/styles/liquid/liquidset.cpp
index 4fffe12..ea0b3c9 100644
--- a/noncore/styles/liquid/liquidset.cpp
+++ b/noncore/styles/liquid/liquidset.cpp
@@ -40,19 +40,2 @@
-static void changeButtonColor ( QWidget *btn, const QColor &col )
-{
- QPalette pal = btn-> palette ( );
-
- pal. setColor ( QPalette::Normal, QColorGroup::Button, col );
- pal. setColor ( QPalette::Active, QColorGroup::Button, col );
- pal. setColor ( QPalette::Disabled, QColorGroup::Button, col );
- pal. setColor ( QPalette::Inactive, QColorGroup::Button, col );
- pal. setColor ( QPalette::Normal, QColorGroup::Background, col );
- pal. setColor ( QPalette::Active, QColorGroup::Background, col );
- pal. setColor ( QPalette::Disabled, QColorGroup::Background, col );
- pal. setColor ( QPalette::Inactive, QColorGroup::Background, col );
-
- btn-> setPalette ( pal );
-}
-
-
LiquidSettings::LiquidSettings ( QWidget* parent, const char *name, WFlags fl )
@@ -70,3 +53,2 @@ LiquidSettings::LiquidSettings ( QWidget* parent, const char *name, WFlags fl )
m_shadow = config. readBoolEntry ( "ShadowText", true );
- m_deco = config. readBoolEntry ( "WinDecoration", true );
int contrast = config. readNumEntry ( "StippleContrast", 5 );
@@ -120,8 +102,2 @@ LiquidSettings::LiquidSettings ( QWidget* parent, const char *name, WFlags fl )
- QCheckBox *windeco = new QCheckBox ( tr( "Draw liquid window title bars" ), this );
- windeco-> setChecked ( m_deco );
- vbox-> addWidget ( windeco );
-
- vbox-> addSpacing ( 4 );
-
QCheckBox *flattb = new QCheckBox ( tr( "Make toolbar buttons appear flat" ), this );
@@ -148,3 +124,2 @@ LiquidSettings::LiquidSettings ( QWidget* parent, const char *name, WFlags fl )
connect ( shadow, SIGNAL( toggled ( bool ) ), this, SLOT( changeShadow ( bool ) ) );
- connect ( windeco, SIGNAL( toggled ( bool ) ), this, SLOT( changeDeco ( bool ) ) );
connect ( flattb, SIGNAL( toggled ( bool ) ), this, SLOT( changeFlat ( bool ) ) );
@@ -171,7 +146,2 @@ void LiquidSettings::changeShadow ( bool b )
-void LiquidSettings::changeDeco ( bool b )
-{
- m_deco = b;
-}
-
void LiquidSettings::changeFlat ( bool b )
@@ -192,3 +162,2 @@ bool LiquidSettings::writeConfig ( )
config. writeEntry ( "ShadowText", m_shadow );
- config. writeEntry ( "WinDecoration", m_deco );
config. writeEntry ( "StippleContrast", m_contsld-> value ( ));
diff --git a/noncore/styles/liquid/liquidset.h b/noncore/styles/liquid/liquidset.h
index 8a03447..6d9555a 100644
--- a/noncore/styles/liquid/liquidset.h
+++ b/noncore/styles/liquid/liquidset.h
@@ -19,3 +19,2 @@ public slots:
void changeShadow ( bool b );
- void changeDeco ( bool b );
void changeFlat ( bool b );
@@ -27,3 +26,2 @@ private:
bool m_shadow;
- bool m_deco;
bool m_flat;
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 +1,3 @@
+#include <qapplication.h>
+
#include "liquid.h"
@@ -8,2 +10,3 @@ LiquidInterface::LiquidInterface ( ) : ref ( 0 )
{
+ m_widget = 0;
}
@@ -14,3 +17,3 @@ LiquidInterface::~LiquidInterface ( )
-QStyle *LiquidInterface::create ( )
+QStyle *LiquidInterface::style ( )
{
@@ -19,60 +22,18 @@ QStyle *LiquidInterface::create ( )
-QString LiquidInterface::name ( )
-{
- return QObject::tr( "Liquid", "name" );
-}
-
-QString LiquidInterface::description ( )
-{
- return QObject::tr( "High Performance Liquid style by Mosfet", "description" );
-}
-
-QCString LiquidInterface::key ( )
-{
- return QCString ( "liquid" );
-}
-
-unsigned int LiquidInterface::version ( )
-{
- return 100; // 1.0.0 (\d+.\d.\d)
-}
-
-QRESULT LiquidInterface::queryInterface ( const QUuid &uuid, QUnknownInterface **iface )
-{
- 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;
-}
-
-Q_EXPORT_INTERFACE()
+QString LiquidInterface::name ( ) const
{
- Q_CREATE_INSTANCE( LiquidInterface )
+ return qApp-> translate ( "Styles", "Liquid" );
}
-
-LiquidSettingsInterface::LiquidSettingsInterface ( ) : ref ( 0 )
+QString LiquidInterface::description ( ) const
{
- m_widget = 0;
+ return qApp-> translate ( "Styles", "High Performance Liquid style by Mosfet" );
}
-LiquidSettingsInterface::~LiquidSettingsInterface ( )
+bool LiquidInterface::hasSettings ( ) const
{
+ return true;
}
-QWidget *LiquidSettingsInterface::create ( QWidget *parent, const char *name )
+QWidget *LiquidInterface::create ( QWidget *parent, const char *name )
{
@@ -83,3 +44,3 @@ QWidget *LiquidSettingsInterface::create ( QWidget *parent, const char *name )
-bool LiquidSettingsInterface::accept ( )
+bool LiquidInterface::accept ( )
{
@@ -91,3 +52,3 @@ bool LiquidSettingsInterface::accept ( )
-void LiquidSettingsInterface::reject ( )
+void LiquidInterface::reject ( )
{
@@ -95,3 +56,4 @@ void LiquidSettingsInterface::reject ( )
-QRESULT LiquidSettingsInterface::queryInterface ( const QUuid &uuid, QUnknownInterface **iface )
+
+QRESULT LiquidInterface::queryInterface ( const QUuid &uuid, QUnknownInterface **iface )
{
@@ -99,6 +61,7 @@ QRESULT LiquidSettingsInterface::queryInterface ( const QUuid &uuid, QUnknownInt
-
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;
@@ -111,2 +74,10 @@ QRESULT LiquidSettingsInterface::queryInterface ( const QUuid &uuid, QUnknownInt
+Q_EXPORT_INTERFACE()
+{
+ Q_CREATE_INSTANCE( LiquidInterface )
+}
+
+
+
+
// Hack for Retail Z experiments
diff --git a/noncore/styles/liquid/plugin.h b/noncore/styles/liquid/plugin.h
index 759577f..6a9b7ac 100644
--- a/noncore/styles/liquid/plugin.h
+++ b/noncore/styles/liquid/plugin.h
@@ -7,3 +7,3 @@ class LiquidSettings;
-class LiquidInterface : public StyleInterface {
+class LiquidInterface : public StyleExtendedInterface {
public:
@@ -15,21 +15,9 @@ public:
- virtual QStyle *create ( );
+ virtual QStyle *style ( );
- virtual QString description ( );
- virtual QString name ( );
- virtual QCString key ( );
+ virtual QString name ( ) const;
- virtual unsigned int version ( );
+ virtual QString description ( ) const;
-private:
- ulong ref;
-};
-
-class LiquidSettingsInterface : public StyleSettingsInterface {
-public:
- LiquidSettingsInterface ( );
- virtual ~LiquidSettingsInterface ( );
-
- QRESULT queryInterface ( const QUuid &, QUnknownInterface ** );
- Q_REFCOUNT
+ virtual bool hasSettings ( ) const;
diff --git a/noncore/styles/metal/plugin.cpp b/noncore/styles/metal/plugin.cpp
index 1db4aac..4c9f64d 100644
--- a/noncore/styles/metal/plugin.cpp
+++ b/noncore/styles/metal/plugin.cpp
@@ -1 +1,3 @@
+#include <qapplication.h>
+
#include "metal.h"
@@ -12,3 +14,3 @@ MetalInterface::~MetalInterface ( )
-QStyle *MetalInterface::create ( )
+QStyle *MetalInterface::style ( )
{
@@ -17,21 +19,7 @@ QStyle *MetalInterface::create ( )
-QString MetalInterface::name ( )
+QString MetalInterface::name ( ) const
{
- return QObject::tr( "Metal", "name" );
+ return qApp-> translate ( "Styles", "Metal" );
}
-QString MetalInterface::description ( )
-{
- return QObject::tr( "Metal style", "description" );
-}
-
-QCString MetalInterface::key ( )
-{
- return QCString ( "metal" );
-}
-
-unsigned int MetalInterface::version ( )
-{
- return 100; // 1.0.0 (\d+.\d.\d)
-}
diff --git a/noncore/styles/metal/plugin.h b/noncore/styles/metal/plugin.h
index f61c833..545aea9 100644
--- a/noncore/styles/metal/plugin.h
+++ b/noncore/styles/metal/plugin.h
@@ -14,9 +14,4 @@ public:
- virtual QStyle *create ( );
-
- virtual QString description ( );
- virtual QString name ( );
- virtual QCString key ( );
-
- virtual unsigned int version ( );
+ virtual QStyle *style ( );
+ virtual QString name ( ) const;
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 +1,3 @@
+#include <qapplication.h>
+
#include "othemestyle.h"
@@ -8,2 +10,3 @@ ThemeInterface::ThemeInterface ( ) : ref ( 0 )
{
+ m_widget = 0;
}
@@ -14,3 +17,3 @@ ThemeInterface::~ThemeInterface ( )
-QStyle *ThemeInterface::create ( )
+QStyle *ThemeInterface::style ( )
{
@@ -19,60 +22,18 @@ QStyle *ThemeInterface::create ( )
-QString ThemeInterface::name ( )
-{
- return QObject::tr( "Themed style", "name" );
-}
-
-QString ThemeInterface::description ( )
-{
- return QObject::tr( "KDE2 theme compatible style engine", "description" );
-}
-
-QCString ThemeInterface::key ( )
+QString ThemeInterface::name ( ) const
{
- return QCString ( "theme" );
+ return qApp-> translate ( "Styles", "Themed style" );
}
-unsigned int ThemeInterface::version ( )
+QString ThemeInterface::description ( ) const
{
- return 100; // 1.0.0 (\d+.\d.\d)
+ return qApp-> translate ( "Styles", "KDE2 theme compatible style engine" );
}
-QRESULT ThemeInterface::queryInterface ( const QUuid &uuid, QUnknownInterface **iface )
+bool ThemeInterface::hasSettings ( ) 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 true;
}
-Q_EXPORT_INTERFACE()
-{
- Q_CREATE_INSTANCE( ThemeInterface )
-}
-
-
-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 )
{
@@ -83,3 +44,3 @@ QWidget *ThemeSettingsInterface::create ( QWidget *parent, const char *name )
-bool ThemeSettingsInterface::accept ( )
+bool ThemeInterface::accept ( )
{
@@ -91,3 +52,3 @@ bool ThemeSettingsInterface::accept ( )
-void ThemeSettingsInterface::reject ( )
+void ThemeInterface::reject ( )
{
@@ -95,3 +56,4 @@ void ThemeSettingsInterface::reject ( )
-QRESULT ThemeSettingsInterface::queryInterface ( const QUuid &uuid, QUnknownInterface **iface )
+
+QRESULT ThemeInterface::queryInterface ( const QUuid &uuid, QUnknownInterface **iface )
{
@@ -99,6 +61,7 @@ QRESULT ThemeSettingsInterface::queryInterface ( const QUuid &uuid, QUnknownInte
-
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;
@@ -111 +74,8 @@ 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
@@ -7,3 +7,3 @@ class ThemeSettings;
-class ThemeInterface : public StyleInterface {
+class ThemeInterface : public StyleExtendedInterface {
public:
@@ -15,21 +15,8 @@ public:
- 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 ( );
-
-private:
- ulong ref;
-};
-
-class ThemeSettingsInterface : public StyleSettingsInterface {
-public:
- ThemeSettingsInterface ( );
- virtual ~ThemeSettingsInterface ( );
-
- QRESULT queryInterface ( const QUuid &, QUnknownInterface ** );
- Q_REFCOUNT
+ virtual bool hasSettings ( ) const;