summaryrefslogtreecommitdiff
path: root/noncore/styles/liquid
Unidiff
Diffstat (limited to 'noncore/styles/liquid') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/styles/liquid/liquid.pro6
-rw-r--r--noncore/styles/liquid/liquidset.cpp (renamed from noncore/styles/liquid/settings/liquidset.cpp)26
-rw-r--r--noncore/styles/liquid/liquidset.h (renamed from noncore/styles/liquid/settings/liquidset.h)7
-rw-r--r--noncore/styles/liquid/opie-liquid.control2
-rw-r--r--noncore/styles/liquid/plugin.cpp108
-rw-r--r--noncore/styles/liquid/plugin.h46
-rw-r--r--noncore/styles/liquid/settings/.cvsignore2
-rw-r--r--noncore/styles/liquid/settings/main.cpp34
-rw-r--r--noncore/styles/liquid/settings/settings.pro24
9 files changed, 162 insertions, 93 deletions
diff --git a/noncore/styles/liquid/liquid.pro b/noncore/styles/liquid/liquid.pro
index 23dce09..a07eaf2 100644
--- a/noncore/styles/liquid/liquid.pro
+++ b/noncore/styles/liquid/liquid.pro
@@ -3,11 +3,15 @@ CONFIG = qt embedded release warn_on
3SOURCES = liquid.cpp \ 3SOURCES = liquid.cpp \
4 liquiddeco.cpp \ 4 liquiddeco.cpp \
5 effects.cpp \ 5 effects.cpp \
6 liquidset.cpp \
6 plugin.cpp 7 plugin.cpp
7 8
8HEADERS = liquid.h \ 9HEADERS = liquid.h \
9 liquiddeco.h \ 10 liquiddeco.h \
10 effects.h 11 effects.h \
12 liquidset.h \
13 plugin.h
14
11LIBS += -lqpe 15LIBS += -lqpe
12INCLUDEPATH += $(OPIEDIR)/include 16INCLUDEPATH += $(OPIEDIR)/include
13DESTDIR = $(OPIEDIR)/plugins/styles 17DESTDIR = $(OPIEDIR)/plugins/styles
diff --git a/noncore/styles/liquid/settings/liquidset.cpp b/noncore/styles/liquid/liquidset.cpp
index 1479ac0..5ae19ba 100644
--- a/noncore/styles/liquid/settings/liquidset.cpp
+++ b/noncore/styles/liquid/liquidset.cpp
@@ -21,7 +21,7 @@
21 21
22 22
23#include "liquidset.h" 23#include "liquidset.h"
24#include "../liquid.h" 24#include "liquid.h"
25 25
26#include <qpe/qpeapplication.h> 26#include <qpe/qpeapplication.h>
27#include <qpe/global.h> 27#include <qpe/global.h>
@@ -57,8 +57,8 @@ static void changeButtonColor ( QWidget *btn, const QColor &col )
57} 57}
58 58
59 59
60LiquidSet::LiquidSet ( QWidget* parent, const char *name, WFlags fl ) 60LiquidSettings::LiquidSettings ( QWidget* parent, const char *name, WFlags fl )
61 : QDialog ( parent, name, fl ) 61 : QWidget ( parent, name, fl )
62{ 62{
63 setCaption ( tr( "Liquid Style" ) ); 63 setCaption ( tr( "Liquid Style" ) );
64 64
@@ -122,7 +122,7 @@ LiquidSet::LiquidSet ( QWidget* parent, const char *name, WFlags fl )
122 122
123 QPopupMenu *popup; 123 QPopupMenu *popup;
124 124
125 popup = new ColorPopupMenu ( m_menucol, this ); 125 popup = new ColorPopupMenu ( m_menucol, 0 );
126 m_menubtn-> setPopup ( popup ); 126 m_menubtn-> setPopup ( popup );
127 m_menubtn-> setPopupDelay ( 0 ); 127 m_menubtn-> setPopupDelay ( 0 );
128 connect ( popup, SIGNAL( colorSelected ( const QColor & )), this, SLOT( changeMenuColor ( const QColor & ))); 128 connect ( popup, SIGNAL( colorSelected ( const QColor & )), this, SLOT( changeMenuColor ( const QColor & )));
@@ -131,7 +131,7 @@ LiquidSet::LiquidSet ( QWidget* parent, const char *name, WFlags fl )
131 m_textbtn = new QToolButton ( this ); 131 m_textbtn = new QToolButton ( this );
132 grid-> addWidget ( m_textbtn, 0, 5 ); 132 grid-> addWidget ( m_textbtn, 0, 5 );
133 133
134 popup = new ColorPopupMenu ( m_textcol, this ); 134 popup = new ColorPopupMenu ( m_textcol, 0 );
135 m_textbtn-> setPopup ( popup ); 135 m_textbtn-> setPopup ( popup );
136 m_textbtn-> setPopupDelay ( 0 ); 136 m_textbtn-> setPopupDelay ( 0 );
137 connect ( popup, SIGNAL( colorSelected ( const QColor & )), this, SLOT( changeTextColor ( const QColor & ))); 137 connect ( popup, SIGNAL( colorSelected ( const QColor & )), this, SLOT( changeTextColor ( const QColor & )));
@@ -176,7 +176,7 @@ LiquidSet::LiquidSet ( QWidget* parent, const char *name, WFlags fl )
176 connect ( windeco, SIGNAL( toggled ( bool ) ), this, SLOT( changeDeco ( bool ) ) ); 176 connect ( windeco, SIGNAL( toggled ( bool ) ), this, SLOT( changeDeco ( bool ) ) );
177} 177}
178 178
179void LiquidSet::changeType ( int t ) 179void LiquidSettings::changeType ( int t )
180{ 180{
181 bool custom = ( t == Custom ); 181 bool custom = ( t == Custom );
182 182
@@ -190,30 +190,30 @@ void LiquidSet::changeType ( int t )
190 m_type = t; 190 m_type = t;
191} 191}
192 192
193void LiquidSet::changeMenuColor ( const QColor &col ) 193void LiquidSettings::changeMenuColor ( const QColor &col )
194{ 194{
195 changeButtonColor ( m_menubtn, col ); 195 changeButtonColor ( m_menubtn, col );
196 m_menucol = col; 196 m_menucol = col;
197} 197}
198 198
199void LiquidSet::changeTextColor ( const QColor &col ) 199void LiquidSettings::changeTextColor ( const QColor &col )
200{ 200{
201 changeButtonColor ( m_textbtn, col ); 201 changeButtonColor ( m_textbtn, col );
202 m_textcol = col; 202 m_textcol = col;
203} 203}
204 204
205void LiquidSet::changeShadow ( bool b ) 205void LiquidSettings::changeShadow ( bool b )
206{ 206{
207 m_shadow = b; 207 m_shadow = b;
208} 208}
209 209
210void LiquidSet::changeDeco ( bool b ) 210void LiquidSettings::changeDeco ( bool b )
211{ 211{
212 m_deco = b; 212 m_deco = b;
213} 213}
214 214
215 215
216void LiquidSet::accept ( ) 216bool LiquidSettings::writeConfig ( )
217{ 217{
218 Config config ( "qpe" ); 218 Config config ( "qpe" );
219 config. setGroup ( "Liquid-Style" ); 219 config. setGroup ( "Liquid-Style" );
@@ -227,8 +227,6 @@ void LiquidSet::accept ( )
227 config. writeEntry ( "StippleContrast", m_contsld-> value ( )); 227 config. writeEntry ( "StippleContrast", m_contsld-> value ( ));
228 config. write ( ); 228 config. write ( );
229 229
230 Global::applyStyle ( ); 230 return true;
231
232 QDialog::accept ( );
233} 231}
234 232
diff --git a/noncore/styles/liquid/settings/liquidset.h b/noncore/styles/liquid/liquidset.h
index a0f590a..7843513 100644
--- a/noncore/styles/liquid/settings/liquidset.h
+++ b/noncore/styles/liquid/liquidset.h
@@ -8,11 +8,11 @@ class QLabel;
8class QToolButton; 8class QToolButton;
9class QSlider; 9class QSlider;
10 10
11class LiquidSet : public QDialog { 11class LiquidSettings : public QWidget {
12 Q_OBJECT 12 Q_OBJECT
13 13
14public: 14public:
15 LiquidSet ( QWidget *parent = 0, const char *name = 0, WFlags fl = 0 ); 15 LiquidSettings ( QWidget *parent = 0, const char *name = 0, WFlags fl = 0 );
16 16
17public slots: 17public slots:
18 void changeType ( int t ); 18 void changeType ( int t );
@@ -21,8 +21,7 @@ public slots:
21 void changeShadow ( bool b ); 21 void changeShadow ( bool b );
22 void changeDeco ( bool b ); 22 void changeDeco ( bool b );
23 23
24protected: 24 virtual bool writeConfig ( );
25 virtual void accept ( );
26 25
27private: 26private:
28 QColor m_menucol; 27 QColor m_menucol;
diff --git a/noncore/styles/liquid/opie-liquid.control b/noncore/styles/liquid/opie-liquid.control
index 6311dee..7b6ae71 100644
--- a/noncore/styles/liquid/opie-liquid.control
+++ b/noncore/styles/liquid/opie-liquid.control
@@ -1,4 +1,4 @@
1Files: plugins/styles/libliquid.so* bin/liquid-settings apps/Settings/Liquid.desktop pics/liquid/Liquid.png 1Files: plugins/styles/libliquid.so*
2Priority: optional 2Priority: optional
3Section: opie/system 3Section: opie/system
4Maintainer: Robert Griebl <sandman@handhelds.org> 4Maintainer: Robert Griebl <sandman@handhelds.org>
diff --git a/noncore/styles/liquid/plugin.cpp b/noncore/styles/liquid/plugin.cpp
index d9aa8ef..f149c29 100644
--- a/noncore/styles/liquid/plugin.cpp
+++ b/noncore/styles/liquid/plugin.cpp
@@ -1,29 +1,111 @@
1#include "liquid.h" 1#include "liquid.h"
2#include "liquidset.h"
3#include "plugin.h"
2 4
3 5
4extern "C" { 6
5 QStyle* allocate ( ); 7LiquidInterface::LiquidInterface ( ) : ref ( 0 )
6 int minor_version ( ); 8{
7 int major_version ( ); 9}
8 const char *description ( ); 10
11LiquidInterface::~LiquidInterface ( )
12{
13}
14
15QStyle *LiquidInterface::create ( )
16{
17 return new LiquidStyle ( );
18}
19
20QString LiquidInterface::name ( )
21{
22 return QObject::tr( "Liquid", "name" );
23}
24
25QString LiquidInterface::description ( )
26{
27 return QObject::tr( "High Performance Liquid style by Mosfet", "description" );
28}
29
30QCString LiquidInterface::key ( )
31{
32 return QCString ( "liquid" );
33}
34
35unsigned int LiquidInterface::version ( )
36{
37 return 100; // 1.0.0 (\d+.\d.\d)
38}
39
40QRESULT 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
62Q_EXPORT_INTERFACE()
63{
64 Q_CREATE_INSTANCE( LiquidInterface )
9} 65}
10 66
11QStyle* allocate ( ) 67
68LiquidSettingsInterface::LiquidSettingsInterface ( ) : ref ( 0 )
69{
70 m_widget = 0;
71}
72
73LiquidSettingsInterface::~LiquidSettingsInterface ( )
12{ 74{
13 return new LiquidStyle ( ); 75}
76
77QWidget *LiquidSettingsInterface::create ( QWidget *parent, const char *name )
78{
79 m_widget = new LiquidSettings ( parent, name ? name : "LIQUID-SETTINGS" );
80
81 return m_widget;
14} 82}
15 83
16int minor_version ( ) 84bool LiquidSettingsInterface::accept ( )
17{ 85{
18 return 0; 86 if ( !m_widget )
87 return false;
88
89 return m_widget-> writeConfig ( );
19} 90}
20 91
21int major_version ( ) 92void LiquidSettingsInterface::reject ( )
22{ 93{
23 return 1;
24} 94}
25 95
26const char *description ( ) 96QRESULT LiquidSettingsInterface::queryInterface ( const QUuid &uuid, QUnknownInterface **iface )
27{ 97{
28 return "High Performance Liquid"; 98 *iface = 0;
99
100
101 if ( uuid == IID_QUnknown )
102 *iface = this;
103 else if ( uuid == IID_StyleSettings )
104 *iface = this;
105
106 if ( *iface )
107 (*iface)-> addRef ( );
108
109 return QS_OK;
29} 110}
111
diff --git a/noncore/styles/liquid/plugin.h b/noncore/styles/liquid/plugin.h
new file mode 100644
index 0000000..759577f
--- a/dev/null
+++ b/noncore/styles/liquid/plugin.h
@@ -0,0 +1,46 @@
1#ifndef __OPIE_LIQUID_PLUGIN_H__
2#define __OPIE_LIQUID_PLUGIN_H__
3
4#include <qpe/styleinterface.h>
5
6class LiquidSettings;
7
8class LiquidInterface : public StyleInterface {
9public:
10 LiquidInterface ( );
11 virtual ~LiquidInterface ( );
12
13 QRESULT queryInterface ( const QUuid &, QUnknownInterface ** );
14 Q_REFCOUNT
15
16 virtual QStyle *create ( );
17
18 virtual QString description ( );
19 virtual QString name ( );
20 virtual QCString key ( );
21
22 virtual unsigned int version ( );
23
24private:
25 ulong ref;
26};
27
28class LiquidSettingsInterface : public StyleSettingsInterface {
29public:
30 LiquidSettingsInterface ( );
31 virtual ~LiquidSettingsInterface ( );
32
33 QRESULT queryInterface ( const QUuid &, QUnknownInterface ** );
34 Q_REFCOUNT
35
36 virtual QWidget *create ( QWidget *parent, const char *name = 0 );
37
38 virtual bool accept ( );
39 virtual void reject ( );
40
41private:
42 LiquidSettings *m_widget;
43 ulong ref;
44};
45
46#endif
diff --git a/noncore/styles/liquid/settings/.cvsignore b/noncore/styles/liquid/settings/.cvsignore
deleted file mode 100644
index c13418b..0000000
--- a/noncore/styles/liquid/settings/.cvsignore
+++ b/dev/null
@@ -1,2 +0,0 @@
1Makefile*
2moc_*
diff --git a/noncore/styles/liquid/settings/main.cpp b/noncore/styles/liquid/settings/main.cpp
deleted file mode 100644
index fd69007..0000000
--- a/noncore/styles/liquid/settings/main.cpp
+++ b/dev/null
@@ -1,34 +0,0 @@
1/**********************************************************************
2** Copyright (C) 2000 Trolltech AS. All rights reserved.
3**
4** This file is part of Qtopia Environment.
5**
6** This file may be distributed and/or modified under the terms of the
7** GNU General Public License version 2 as published by the Free Software
8** Foundation and appearing in the file LICENSE.GPL included in the
9** packaging of this file.
10**
11** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
13**
14** See http://www.trolltech.com/gpl/ for GPL licensing information.
15**
16** Contact info@trolltech.com if any conditions of this licensing are
17** not clear to you.
18**
19**********************************************************************/
20
21#include "liquidset.h"
22
23#include <qpe/qpeapplication.h>
24
25
26int main ( int argc, char** argv )
27{
28 QPEApplication a ( argc, argv );
29
30 LiquidSet dlg;
31 a. showMainWidget ( &dlg );
32
33 return a. exec ( );
34}
diff --git a/noncore/styles/liquid/settings/settings.pro b/noncore/styles/liquid/settings/settings.pro
deleted file mode 100644
index bfda7a4..0000000
--- a/noncore/styles/liquid/settings/settings.pro
+++ b/dev/null
@@ -1,24 +0,0 @@
1 TEMPLATE= app
2 CONFIG += qt warn_on release
3 DESTDIR = $(OPIEDIR)/bin
4 HEADERS = liquidset.h
5 SOURCES = liquidset.cpp main.cpp
6INCLUDEPATH += $(OPIEDIR)/include
7 DEPENDPATH+= ../$(OPIEDIR)/include
8LIBS += -lqpe -lopie
9 TARGET = liquid-settings
10
11TRANSLATIONS = ../../../../i18n/de/liquid-settings.ts \
12 ../../../../i18n/en/liquid-settings.ts \
13 ../../../../i18n/es/liquid-settings.ts \
14 ../../../../i18n/fr/liquid-settings.ts \
15 ../../../../i18n/hu/liquid-settings.ts \
16 ../../../../i18n/ja/liquid-settings.ts \
17 ../../../../i18n/ko/liquid-settings.ts \
18 ../../../../i18n/no/liquid-settings.ts \
19 ../../../../i18n/pl/liquid-settings.ts \
20 ../../../../i18n/pt/liquid-settings.ts \
21 ../../../../i18n/pt_BR/liquid-settings.ts \
22 ../../../../i18n/sl/liquid-settings.ts \
23 ../../../../i18n/zh_CN/liquid-settings.ts \
24 ../../../../i18n/zh_TW/liquid-settings.ts