author | sandman <sandman> | 2002-10-04 01:42:57 (UTC) |
---|---|---|
committer | sandman <sandman> | 2002-10-04 01:42:57 (UTC) |
commit | 4a6ccb87f45065bc37f801adb61c3462f870cb92 (patch) (unidiff) | |
tree | 86b6819ee7a13b8df82b14b2bdcf46741b5935a0 /noncore/styles | |
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/liquid/liquid.cpp | 2 | ||||
-rw-r--r-- | noncore/styles/liquid/liquid.pro | 2 | ||||
-rw-r--r-- | noncore/styles/liquid/liquidset.cpp | 31 | ||||
-rw-r--r-- | noncore/styles/liquid/liquidset.h | 2 | ||||
-rw-r--r-- | noncore/styles/liquid/plugin.cpp | 81 | ||||
-rw-r--r-- | noncore/styles/liquid/plugin.h | 22 | ||||
-rw-r--r-- | noncore/styles/metal/plugin.cpp | 22 | ||||
-rw-r--r-- | noncore/styles/metal/plugin.h | 9 | ||||
-rw-r--r-- | noncore/styles/theme/plugin.cpp | 80 | ||||
-rw-r--r-- | noncore/styles/theme/plugin.h | 23 |
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 | |||
@@ -10,7 +10,7 @@ | |||
10 | 10 | ||
11 | #include <qmenudata.h> | 11 | #include <qmenudata.h> |
12 | #include "liquid.h" | 12 | #include "liquid.h" |
13 | #include "liquiddeco.h" | 13 | //#include "liquiddeco.h" |
14 | #include <qapplication.h> | 14 | #include <qapplication.h> |
15 | #include <qpe/config.h> | 15 | #include <qpe/config.h> |
16 | #include "effects.h" | 16 | #include "effects.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 | |||
@@ -1,13 +1,11 @@ | |||
1 | TEMPLATE = lib | 1 | TEMPLATE = lib |
2 | CONFIG = qt embedded release warn_on | 2 | CONFIG = qt embedded release warn_on |
3 | SOURCES = liquid.cpp \ | 3 | SOURCES = liquid.cpp \ |
4 | liquiddeco.cpp \ | ||
5 | effects.cpp \ | 4 | effects.cpp \ |
6 | liquidset.cpp \ | 5 | liquidset.cpp \ |
7 | plugin.cpp | 6 | plugin.cpp |
8 | 7 | ||
9 | HEADERS = liquid.h \ | 8 | HEADERS = liquid.h \ |
10 | liquiddeco.h \ | ||
11 | effects.h \ | 9 | effects.h \ |
12 | liquidset.h \ | 10 | liquidset.h \ |
13 | plugin.h | 11 | plugin.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 | |||
@@ -38,23 +38,6 @@ | |||
38 | #include <opie/ocolorbutton.h> | 38 | #include <opie/ocolorbutton.h> |
39 | 39 | ||
40 | 40 | ||
41 | static void changeButtonColor ( QWidget *btn, const QColor &col ) | ||
42 | { | ||
43 | QPalette pal = btn-> palette ( ); | ||
44 | |||
45 | pal. setColor ( QPalette::Normal, QColorGroup::Button, col ); | ||
46 | pal. setColor ( QPalette::Active, QColorGroup::Button, col ); | ||
47 | pal. setColor ( QPalette::Disabled, QColorGroup::Button, col ); | ||
48 | pal. setColor ( QPalette::Inactive, QColorGroup::Button, col ); | ||
49 | pal. setColor ( QPalette::Normal, QColorGroup::Background, col ); | ||
50 | pal. setColor ( QPalette::Active, QColorGroup::Background, col ); | ||
51 | pal. setColor ( QPalette::Disabled, QColorGroup::Background, col ); | ||
52 | pal. setColor ( QPalette::Inactive, QColorGroup::Background, col ); | ||
53 | |||
54 | btn-> setPalette ( pal ); | ||
55 | } | ||
56 | |||
57 | |||
58 | LiquidSettings::LiquidSettings ( QWidget* parent, const char *name, WFlags fl ) | 41 | LiquidSettings::LiquidSettings ( QWidget* parent, const char *name, WFlags fl ) |
59 | : QWidget ( parent, name, fl ) | 42 | : QWidget ( parent, name, fl ) |
60 | { | 43 | { |
@@ -68,7 +51,6 @@ LiquidSettings::LiquidSettings ( QWidget* parent, const char *name, WFlags fl ) | |||
68 | QColor tcol = QColor ( config. readEntry ( "TextColor", QApplication::palette ( ). active ( ). text ( ). name ( ))); | 51 | QColor tcol = QColor ( config. readEntry ( "TextColor", QApplication::palette ( ). active ( ). text ( ). name ( ))); |
69 | int opacity = config. readNumEntry ( "Opacity", 10 ); | 52 | int opacity = config. readNumEntry ( "Opacity", 10 ); |
70 | m_shadow = config. readBoolEntry ( "ShadowText", true ); | 53 | m_shadow = config. readBoolEntry ( "ShadowText", true ); |
71 | m_deco = config. readBoolEntry ( "WinDecoration", true ); | ||
72 | int contrast = config. readNumEntry ( "StippleContrast", 5 ); | 54 | int contrast = config. readNumEntry ( "StippleContrast", 5 ); |
73 | m_flat = config. readBoolEntry ( "FlatToolButtons", false ); | 55 | m_flat = config. readBoolEntry ( "FlatToolButtons", false ); |
74 | 56 | ||
@@ -118,12 +100,6 @@ LiquidSettings::LiquidSettings ( QWidget* parent, const char *name, WFlags fl ) | |||
118 | 100 | ||
119 | vbox-> addSpacing ( 4 ); | 101 | vbox-> addSpacing ( 4 ); |
120 | 102 | ||
121 | QCheckBox *windeco = new QCheckBox ( tr( "Draw liquid window title bars" ), this ); | ||
122 | windeco-> setChecked ( m_deco ); | ||
123 | vbox-> addWidget ( windeco ); | ||
124 | |||
125 | vbox-> addSpacing ( 4 ); | ||
126 | |||
127 | QCheckBox *flattb = new QCheckBox ( tr( "Make toolbar buttons appear flat" ), this ); | 103 | QCheckBox *flattb = new QCheckBox ( tr( "Make toolbar buttons appear flat" ), this ); |
128 | flattb-> setChecked ( m_flat ); | 104 | flattb-> setChecked ( m_flat ); |
129 | vbox-> addWidget ( flattb ); | 105 | vbox-> addWidget ( flattb ); |
@@ -146,7 +122,6 @@ LiquidSettings::LiquidSettings ( QWidget* parent, const char *name, WFlags fl ) | |||
146 | 122 | ||
147 | connect ( cb, SIGNAL( highlighted ( int ) ), this, SLOT( changeType ( int ) ) ); | 123 | connect ( cb, SIGNAL( highlighted ( int ) ), this, SLOT( changeType ( int ) ) ); |
148 | connect ( shadow, SIGNAL( toggled ( bool ) ), this, SLOT( changeShadow ( bool ) ) ); | 124 | connect ( shadow, SIGNAL( toggled ( bool ) ), this, SLOT( changeShadow ( bool ) ) ); |
149 | connect ( windeco, SIGNAL( toggled ( bool ) ), this, SLOT( changeDeco ( bool ) ) ); | ||
150 | connect ( flattb, SIGNAL( toggled ( bool ) ), this, SLOT( changeFlat ( bool ) ) ); | 125 | connect ( flattb, SIGNAL( toggled ( bool ) ), this, SLOT( changeFlat ( bool ) ) ); |
151 | } | 126 | } |
152 | 127 | ||
@@ -169,11 +144,6 @@ void LiquidSettings::changeShadow ( bool b ) | |||
169 | m_shadow = b; | 144 | m_shadow = b; |
170 | } | 145 | } |
171 | 146 | ||
172 | void LiquidSettings::changeDeco ( bool b ) | ||
173 | { | ||
174 | m_deco = b; | ||
175 | } | ||
176 | |||
177 | void LiquidSettings::changeFlat ( bool b ) | 147 | void LiquidSettings::changeFlat ( bool b ) |
178 | { | 148 | { |
179 | m_flat = b; | 149 | m_flat = b; |
@@ -190,7 +160,6 @@ bool LiquidSettings::writeConfig ( ) | |||
190 | config. writeEntry ( "TextColor", m_textbtn-> color ( ). name ( )); | 160 | config. writeEntry ( "TextColor", m_textbtn-> color ( ). name ( )); |
191 | config. writeEntry ( "Opacity", m_opacsld-> value ( )); | 161 | config. writeEntry ( "Opacity", m_opacsld-> value ( )); |
192 | config. writeEntry ( "ShadowText", m_shadow ); | 162 | config. writeEntry ( "ShadowText", m_shadow ); |
193 | config. writeEntry ( "WinDecoration", m_deco ); | ||
194 | config. writeEntry ( "StippleContrast", m_contsld-> value ( )); | 163 | config. writeEntry ( "StippleContrast", m_contsld-> value ( )); |
195 | config. writeEntry ( "FlatToolButtons", m_flat ); | 164 | config. writeEntry ( "FlatToolButtons", m_flat ); |
196 | config. write ( ); | 165 | config. write ( ); |
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 | |||
@@ -17,7 +17,6 @@ public: | |||
17 | public slots: | 17 | public slots: |
18 | void changeType ( int t ); | 18 | void changeType ( int t ); |
19 | void changeShadow ( bool b ); | 19 | void changeShadow ( bool b ); |
20 | void changeDeco ( bool b ); | ||
21 | void changeFlat ( bool b ); | 20 | void changeFlat ( bool b ); |
22 | 21 | ||
23 | virtual bool writeConfig ( ); | 22 | virtual bool writeConfig ( ); |
@@ -25,7 +24,6 @@ public slots: | |||
25 | private: | 24 | private: |
26 | int m_type; | 25 | int m_type; |
27 | bool m_shadow; | 26 | bool m_shadow; |
28 | bool m_deco; | ||
29 | bool m_flat; | 27 | bool m_flat; |
30 | 28 | ||
31 | QSlider * m_opacsld; | 29 | QSlider * m_opacsld; |
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 @@ | |||
1 | #include <qapplication.h> | ||
2 | |||
1 | #include "liquid.h" | 3 | #include "liquid.h" |
2 | #include "liquidset.h" | 4 | #include "liquidset.h" |
3 | #include "plugin.h" | 5 | #include "plugin.h" |
@@ -6,82 +8,41 @@ | |||
6 | 8 | ||
7 | LiquidInterface::LiquidInterface ( ) : ref ( 0 ) | 9 | LiquidInterface::LiquidInterface ( ) : ref ( 0 ) |
8 | { | 10 | { |
11 | m_widget = 0; | ||
9 | } | 12 | } |
10 | 13 | ||
11 | LiquidInterface::~LiquidInterface ( ) | 14 | LiquidInterface::~LiquidInterface ( ) |
12 | { | 15 | { |
13 | } | 16 | } |
14 | 17 | ||
15 | QStyle *LiquidInterface::create ( ) | 18 | QStyle *LiquidInterface::style ( ) |
16 | { | 19 | { |
17 | return new LiquidStyle ( ); | 20 | return new LiquidStyle ( ); |
18 | } | 21 | } |
19 | 22 | ||
20 | QString LiquidInterface::name ( ) | 23 | QString LiquidInterface::name ( ) const |
21 | { | ||
22 | return QObject::tr( "Liquid", "name" ); | ||
23 | } | ||
24 | |||
25 | QString LiquidInterface::description ( ) | ||
26 | { | ||
27 | return QObject::tr( "High Performance Liquid style by Mosfet", "description" ); | ||
28 | } | ||
29 | |||
30 | QCString LiquidInterface::key ( ) | ||
31 | { | ||
32 | return QCString ( "liquid" ); | ||
33 | } | ||
34 | |||
35 | unsigned int LiquidInterface::version ( ) | ||
36 | { | ||
37 | return 100; // 1.0.0 (\d+.\d.\d) | ||
38 | } | ||
39 | |||
40 | QRESULT LiquidInterface::queryInterface ( const QUuid &uuid, QUnknownInterface **iface ) | ||
41 | { | ||
42 | static LiquidSettingsInterface *setiface = 0; | ||
43 | |||
44 | *iface = 0; | ||
45 | |||
46 | if ( uuid == IID_QUnknown ) | ||
47 | *iface = this; | ||
48 | else if ( uuid == IID_Style ) | ||
49 | *iface = this; | ||
50 | else if ( uuid == IID_StyleSettings ) { | ||
51 | if ( !setiface ) | ||
52 | setiface = new LiquidSettingsInterface ( ); | ||
53 | *iface = setiface; | ||
54 | } | ||
55 | |||
56 | if ( *iface ) | ||
57 | (*iface)-> addRef ( ); | ||
58 | |||
59 | return QS_OK; | ||
60 | } | ||
61 | |||
62 | Q_EXPORT_INTERFACE() | ||
63 | { | 24 | { |
64 | Q_CREATE_INSTANCE( LiquidInterface ) | 25 | return qApp-> translate ( "Styles", "Liquid" ); |
65 | } | 26 | } |
66 | 27 | ||
67 | 28 | QString LiquidInterface::description ( ) const | |
68 | LiquidSettingsInterface::LiquidSettingsInterface ( ) : ref ( 0 ) | ||
69 | { | 29 | { |
70 | m_widget = 0; | 30 | return qApp-> translate ( "Styles", "High Performance Liquid style by Mosfet" ); |
71 | } | 31 | } |
72 | 32 | ||
73 | LiquidSettingsInterface::~LiquidSettingsInterface ( ) | 33 | bool LiquidInterface::hasSettings ( ) const |
74 | { | 34 | { |
35 | return true; | ||
75 | } | 36 | } |
76 | 37 | ||
77 | QWidget *LiquidSettingsInterface::create ( QWidget *parent, const char *name ) | 38 | QWidget *LiquidInterface::create ( QWidget *parent, const char *name ) |
78 | { | 39 | { |
79 | m_widget = new LiquidSettings ( parent, name ? name : "LIQUID-SETTINGS" ); | 40 | m_widget = new LiquidSettings ( parent, name ? name : "LIQUID-SETTINGS" ); |
80 | 41 | ||
81 | return m_widget; | 42 | return m_widget; |
82 | } | 43 | } |
83 | 44 | ||
84 | bool LiquidSettingsInterface::accept ( ) | 45 | bool LiquidInterface::accept ( ) |
85 | { | 46 | { |
86 | if ( !m_widget ) | 47 | if ( !m_widget ) |
87 | return false; | 48 | return false; |
@@ -89,18 +50,20 @@ bool LiquidSettingsInterface::accept ( ) | |||
89 | return m_widget-> writeConfig ( ); | 50 | return m_widget-> writeConfig ( ); |
90 | } | 51 | } |
91 | 52 | ||
92 | void LiquidSettingsInterface::reject ( ) | 53 | void LiquidInterface::reject ( ) |
93 | { | 54 | { |
94 | } | 55 | } |
95 | 56 | ||
96 | QRESULT LiquidSettingsInterface::queryInterface ( const QUuid &uuid, QUnknownInterface **iface ) | 57 | |
58 | QRESULT LiquidInterface::queryInterface ( const QUuid &uuid, QUnknownInterface **iface ) | ||
97 | { | 59 | { |
98 | *iface = 0; | 60 | *iface = 0; |
99 | 61 | ||
100 | |||
101 | if ( uuid == IID_QUnknown ) | 62 | if ( uuid == IID_QUnknown ) |
102 | *iface = this; | 63 | *iface = this; |
103 | else if ( uuid == IID_StyleSettings ) | 64 | else if ( uuid == IID_Style ) |
65 | *iface = this; | ||
66 | else if ( uuid == IID_StyleExtended ) | ||
104 | *iface = this; | 67 | *iface = this; |
105 | 68 | ||
106 | if ( *iface ) | 69 | if ( *iface ) |
@@ -109,5 +72,13 @@ QRESULT LiquidSettingsInterface::queryInterface ( const QUuid &uuid, QUnknownInt | |||
109 | return QS_OK; | 72 | return QS_OK; |
110 | } | 73 | } |
111 | 74 | ||
75 | Q_EXPORT_INTERFACE() | ||
76 | { | ||
77 | Q_CREATE_INSTANCE( LiquidInterface ) | ||
78 | } | ||
79 | |||
80 | |||
81 | |||
82 | |||
112 | // Hack for Retail Z experiments | 83 | // Hack for Retail Z experiments |
113 | extern "C" { QStyle *allocate ( ) { return new LiquidStyle ( ); } } | 84 | extern "C" { QStyle *allocate ( ) { return new LiquidStyle ( ); } } |
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 | |||
@@ -5,7 +5,7 @@ | |||
5 | 5 | ||
6 | class LiquidSettings; | 6 | class LiquidSettings; |
7 | 7 | ||
8 | class LiquidInterface : public StyleInterface { | 8 | class LiquidInterface : public StyleExtendedInterface { |
9 | public: | 9 | public: |
10 | LiquidInterface ( ); | 10 | LiquidInterface ( ); |
11 | virtual ~LiquidInterface ( ); | 11 | virtual ~LiquidInterface ( ); |
@@ -13,25 +13,13 @@ public: | |||
13 | QRESULT queryInterface ( const QUuid &, QUnknownInterface ** ); | 13 | QRESULT queryInterface ( const QUuid &, QUnknownInterface ** ); |
14 | Q_REFCOUNT | 14 | Q_REFCOUNT |
15 | 15 | ||
16 | virtual QStyle *create ( ); | 16 | virtual QStyle *style ( ); |
17 | 17 | ||
18 | virtual QString description ( ); | 18 | virtual QString name ( ) const; |
19 | virtual QString name ( ); | ||
20 | virtual QCString key ( ); | ||
21 | 19 | ||
22 | virtual unsigned int version ( ); | 20 | virtual QString description ( ) const; |
23 | 21 | ||
24 | private: | 22 | virtual bool hasSettings ( ) const; |
25 | ulong ref; | ||
26 | }; | ||
27 | |||
28 | class LiquidSettingsInterface : public StyleSettingsInterface { | ||
29 | public: | ||
30 | LiquidSettingsInterface ( ); | ||
31 | virtual ~LiquidSettingsInterface ( ); | ||
32 | |||
33 | QRESULT queryInterface ( const QUuid &, QUnknownInterface ** ); | ||
34 | Q_REFCOUNT | ||
35 | 23 | ||
36 | virtual QWidget *create ( QWidget *parent, const char *name = 0 ); | 24 | virtual QWidget *create ( QWidget *parent, const char *name = 0 ); |
37 | 25 | ||
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,3 +1,5 @@ | |||
1 | #include <qapplication.h> | ||
2 | |||
1 | #include "metal.h" | 3 | #include "metal.h" |
2 | #include "plugin.h" | 4 | #include "plugin.h" |
3 | 5 | ||
@@ -10,30 +12,16 @@ MetalInterface::~MetalInterface ( ) | |||
10 | { | 12 | { |
11 | } | 13 | } |
12 | 14 | ||
13 | QStyle *MetalInterface::create ( ) | 15 | QStyle *MetalInterface::style ( ) |
14 | { | 16 | { |
15 | return new MetalStyle ( ); | 17 | return new MetalStyle ( ); |
16 | } | 18 | } |
17 | 19 | ||
18 | QString MetalInterface::name ( ) | 20 | QString MetalInterface::name ( ) const |
19 | { | 21 | { |
20 | return QObject::tr( "Metal", "name" ); | 22 | return qApp-> translate ( "Styles", "Metal" ); |
21 | } | 23 | } |
22 | 24 | ||
23 | QString MetalInterface::description ( ) | ||
24 | { | ||
25 | return QObject::tr( "Metal style", "description" ); | ||
26 | } | ||
27 | |||
28 | QCString MetalInterface::key ( ) | ||
29 | { | ||
30 | return QCString ( "metal" ); | ||
31 | } | ||
32 | |||
33 | unsigned int MetalInterface::version ( ) | ||
34 | { | ||
35 | return 100; // 1.0.0 (\d+.\d.\d) | ||
36 | } | ||
37 | 25 | ||
38 | QRESULT MetalInterface::queryInterface ( const QUuid &uuid, QUnknownInterface **iface ) | 26 | QRESULT MetalInterface::queryInterface ( const QUuid &uuid, QUnknownInterface **iface ) |
39 | { | 27 | { |
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 | |||
@@ -12,13 +12,8 @@ public: | |||
12 | QRESULT queryInterface ( const QUuid &, QUnknownInterface ** ); | 12 | QRESULT queryInterface ( const QUuid &, QUnknownInterface ** ); |
13 | Q_REFCOUNT | 13 | Q_REFCOUNT |
14 | 14 | ||
15 | virtual QStyle *create ( ); | 15 | virtual QStyle *style ( ); |
16 | 16 | virtual QString name ( ) const; | |
17 | virtual QString description ( ); | ||
18 | virtual QString name ( ); | ||
19 | virtual QCString key ( ); | ||
20 | |||
21 | virtual unsigned int version ( ); | ||
22 | 17 | ||
23 | private: | 18 | private: |
24 | ulong ref; | 19 | ulong ref; |
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,3 +1,5 @@ | |||
1 | #include <qapplication.h> | ||
2 | |||
1 | #include "othemestyle.h" | 3 | #include "othemestyle.h" |
2 | #include "themeset.h" | 4 | #include "themeset.h" |
3 | #include "plugin.h" | 5 | #include "plugin.h" |
@@ -6,82 +8,41 @@ | |||
6 | 8 | ||
7 | ThemeInterface::ThemeInterface ( ) : ref ( 0 ) | 9 | ThemeInterface::ThemeInterface ( ) : ref ( 0 ) |
8 | { | 10 | { |
11 | m_widget = 0; | ||
9 | } | 12 | } |
10 | 13 | ||
11 | ThemeInterface::~ThemeInterface ( ) | 14 | ThemeInterface::~ThemeInterface ( ) |
12 | { | 15 | { |
13 | } | 16 | } |
14 | 17 | ||
15 | QStyle *ThemeInterface::create ( ) | 18 | QStyle *ThemeInterface::style ( ) |
16 | { | 19 | { |
17 | return new OThemeStyle ( "" ); | 20 | return new OThemeStyle ( "" ); |
18 | } | 21 | } |
19 | 22 | ||
20 | QString ThemeInterface::name ( ) | 23 | QString ThemeInterface::name ( ) const |
21 | { | ||
22 | return QObject::tr( "Themed style", "name" ); | ||
23 | } | ||
24 | |||
25 | QString ThemeInterface::description ( ) | ||
26 | { | ||
27 | return QObject::tr( "KDE2 theme compatible style engine", "description" ); | ||
28 | } | ||
29 | |||
30 | QCString ThemeInterface::key ( ) | ||
31 | { | 24 | { |
32 | return QCString ( "theme" ); | 25 | return qApp-> translate ( "Styles", "Themed style" ); |
33 | } | 26 | } |
34 | 27 | ||
35 | unsigned int ThemeInterface::version ( ) | 28 | QString ThemeInterface::description ( ) const |
36 | { | 29 | { |
37 | return 100; // 1.0.0 (\d+.\d.\d) | 30 | return qApp-> translate ( "Styles", "KDE2 theme compatible style engine" ); |
38 | } | 31 | } |
39 | 32 | ||
40 | QRESULT ThemeInterface::queryInterface ( const QUuid &uuid, QUnknownInterface **iface ) | 33 | bool ThemeInterface::hasSettings ( ) const |
41 | { | 34 | { |
42 | static ThemeSettingsInterface *setiface = 0; | 35 | return true; |
43 | |||
44 | *iface = 0; | ||
45 | |||
46 | if ( uuid == IID_QUnknown ) | ||
47 | *iface = this; | ||
48 | else if ( uuid == IID_Style ) | ||
49 | *iface = this; | ||
50 | else if ( uuid == IID_StyleSettings ) { | ||
51 | if ( !setiface ) | ||
52 | setiface = new ThemeSettingsInterface ( ); | ||
53 | *iface = setiface; | ||
54 | } | ||
55 | |||
56 | if ( *iface ) | ||
57 | (*iface)-> addRef ( ); | ||
58 | |||
59 | return QS_OK; | ||
60 | } | 36 | } |
61 | 37 | ||
62 | Q_EXPORT_INTERFACE() | 38 | QWidget *ThemeInterface::create ( QWidget *parent, const char *name ) |
63 | { | ||
64 | Q_CREATE_INSTANCE( ThemeInterface ) | ||
65 | } | ||
66 | |||
67 | |||
68 | ThemeSettingsInterface::ThemeSettingsInterface ( ) : ref ( 0 ) | ||
69 | { | ||
70 | m_widget = 0; | ||
71 | } | ||
72 | |||
73 | ThemeSettingsInterface::~ThemeSettingsInterface ( ) | ||
74 | { | ||
75 | } | ||
76 | |||
77 | QWidget *ThemeSettingsInterface::create ( QWidget *parent, const char *name ) | ||
78 | { | 39 | { |
79 | m_widget = new ThemeSettings ( parent, name ? name : "THEME-SETTINGS" ); | 40 | m_widget = new ThemeSettings ( parent, name ? name : "THEME-SETTINGS" ); |
80 | 41 | ||
81 | return m_widget; | 42 | return m_widget; |
82 | } | 43 | } |
83 | 44 | ||
84 | bool ThemeSettingsInterface::accept ( ) | 45 | bool ThemeInterface::accept ( ) |
85 | { | 46 | { |
86 | if ( !m_widget ) | 47 | if ( !m_widget ) |
87 | return false; | 48 | return false; |
@@ -89,18 +50,20 @@ bool ThemeSettingsInterface::accept ( ) | |||
89 | return m_widget-> writeConfig ( ); | 50 | return m_widget-> writeConfig ( ); |
90 | } | 51 | } |
91 | 52 | ||
92 | void ThemeSettingsInterface::reject ( ) | 53 | void ThemeInterface::reject ( ) |
93 | { | 54 | { |
94 | } | 55 | } |
95 | 56 | ||
96 | QRESULT ThemeSettingsInterface::queryInterface ( const QUuid &uuid, QUnknownInterface **iface ) | 57 | |
58 | QRESULT ThemeInterface::queryInterface ( const QUuid &uuid, QUnknownInterface **iface ) | ||
97 | { | 59 | { |
98 | *iface = 0; | 60 | *iface = 0; |
99 | 61 | ||
100 | |||
101 | if ( uuid == IID_QUnknown ) | 62 | if ( uuid == IID_QUnknown ) |
102 | *iface = this; | 63 | *iface = this; |
103 | else if ( uuid == IID_StyleSettings ) | 64 | else if ( uuid == IID_Style ) |
65 | *iface = this; | ||
66 | else if ( uuid == IID_StyleExtended ) | ||
104 | *iface = this; | 67 | *iface = this; |
105 | 68 | ||
106 | if ( *iface ) | 69 | if ( *iface ) |
@@ -109,3 +72,10 @@ QRESULT ThemeSettingsInterface::queryInterface ( const QUuid &uuid, QUnknownInte | |||
109 | return QS_OK; | 72 | return QS_OK; |
110 | } | 73 | } |
111 | 74 | ||
75 | Q_EXPORT_INTERFACE() | ||
76 | { | ||
77 | Q_CREATE_INSTANCE( ThemeInterface ) | ||
78 | } | ||
79 | |||
80 | |||
81 | |||
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 | |||
@@ -5,7 +5,7 @@ | |||
5 | 5 | ||
6 | class ThemeSettings; | 6 | class ThemeSettings; |
7 | 7 | ||
8 | class ThemeInterface : public StyleInterface { | 8 | class ThemeInterface : public StyleExtendedInterface { |
9 | public: | 9 | public: |
10 | ThemeInterface ( ); | 10 | ThemeInterface ( ); |
11 | virtual ~ThemeInterface ( ); | 11 | virtual ~ThemeInterface ( ); |
@@ -13,25 +13,12 @@ public: | |||
13 | QRESULT queryInterface ( const QUuid &, QUnknownInterface ** ); | 13 | QRESULT queryInterface ( const QUuid &, QUnknownInterface ** ); |
14 | Q_REFCOUNT | 14 | Q_REFCOUNT |
15 | 15 | ||
16 | virtual QStyle *create ( ); | 16 | virtual QStyle *style ( ); |
17 | virtual QString name ( ) const; | ||
17 | 18 | ||
18 | virtual QString description ( ); | 19 | virtual QString description ( ) const; |
19 | virtual QString name ( ); | ||
20 | virtual QCString key ( ); | ||
21 | 20 | ||
22 | virtual unsigned int version ( ); | 21 | virtual bool hasSettings ( ) const; |
23 | |||
24 | private: | ||
25 | ulong ref; | ||
26 | }; | ||
27 | |||
28 | class ThemeSettingsInterface : public StyleSettingsInterface { | ||
29 | public: | ||
30 | ThemeSettingsInterface ( ); | ||
31 | virtual ~ThemeSettingsInterface ( ); | ||
32 | |||
33 | QRESULT queryInterface ( const QUuid &, QUnknownInterface ** ); | ||
34 | Q_REFCOUNT | ||
35 | 22 | ||
36 | virtual QWidget *create ( QWidget *parent, const char *name = 0 ); | 23 | virtual QWidget *create ( QWidget *parent, const char *name = 0 ); |
37 | 24 | ||