summaryrefslogtreecommitdiff
path: root/libopie2
Unidiff
Diffstat (limited to 'libopie2') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/opiecore/device/odevice.cpp10
-rw-r--r--libopie2/opiecore/device/odevice_ipaq.cpp2
-rw-r--r--libopie2/opiecore/device/odevice_ipaq.h2
-rw-r--r--libopie2/opiecore/device/odevice_jornada.cpp2
-rw-r--r--libopie2/opiecore/device/odevice_jornada.h2
-rw-r--r--libopie2/opiecore/device/odevice_ramses.cpp2
-rw-r--r--libopie2/opiecore/device/odevice_ramses.h2
-rw-r--r--libopie2/opiecore/device/odevice_simpad.cpp2
-rw-r--r--libopie2/opiecore/device/odevice_simpad.h2
-rw-r--r--libopie2/opiecore/device/odevice_yopy.cpp2
-rw-r--r--libopie2/opiecore/device/odevice_yopy.h2
-rw-r--r--libopie2/opiecore/device/odevice_zaurus.cpp10
-rw-r--r--libopie2/opiecore/device/odevice_zaurus.h2
-rw-r--r--libopie2/opiecore/device/odevicebutton.cpp8
-rw-r--r--libopie2/opiecore/device/odevicebutton.h4
-rw-r--r--libopie2/opiecore/oapplication.cpp4
-rw-r--r--libopie2/opiecore/oapplication.h4
-rw-r--r--libopie2/opiecore/oconfig.h6
-rw-r--r--libopie2/opiecore/odebug.cpp11
-rw-r--r--libopie2/opiecore/oprocctrl.cpp8
-rw-r--r--libopie2/opiecore/oprocctrl.h8
-rw-r--r--libopie2/opiecore/oprocess.cpp4
-rw-r--r--libopie2/opiecore/oprocess.h6
-rw-r--r--libopie2/opiedb/osqlitedriver.cpp2
-rw-r--r--libopie2/opiedb/osqlitedriver.h2
-rw-r--r--libopie2/opiedb/osqlmanager.cpp4
-rw-r--r--libopie2/opienet/odebugmapper.cpp2
-rw-r--r--libopie2/opienet/odebugmapper.h2
-rw-r--r--libopie2/opienet/onetutils.cpp2
-rw-r--r--libopie2/opienet/onetutils.h2
-rw-r--r--libopie2/opienet/onetwork.cpp4
-rw-r--r--libopie2/opieui/big-screen/obigscreen_p.h2
-rw-r--r--libopie2/opieui/big-screen/osplitter.cpp6
-rw-r--r--libopie2/opieui/big-screen/osplitter.h6
-rw-r--r--libopie2/opieui/fileselector/ofileselector.cpp5
-rw-r--r--libopie2/opieui/fileselector/ofileselector.h12
-rw-r--r--libopie2/opieui/fileselector/ofileselector_p.h2
-rw-r--r--libopie2/opieui/ofontselector.cpp4
-rw-r--r--libopie2/opieui/ofontselector.h4
-rw-r--r--libopie2/opieui/okeyconfigwidget.cpp41
-rw-r--r--libopie2/opieui/okeyconfigwidget.h8
-rw-r--r--libopie2/opieui/okeyconfigwidget_p.h2
-rw-r--r--libopie2/opieui/otaskbarapplet.h4
43 files changed, 116 insertions, 105 deletions
diff --git a/libopie2/opiecore/device/odevice.cpp b/libopie2/opiecore/device/odevice.cpp
index 1ad0327..ee66d95 100644
--- a/libopie2/opiecore/device/odevice.cpp
+++ b/libopie2/opiecore/device/odevice.cpp
@@ -60,53 +60,53 @@ _;:, .> :=|. This program is free software; you can
60 60
61const char* PATH_PROC_CPUINFO = "/proc/cpuinfo"; 61const char* PATH_PROC_CPUINFO = "/proc/cpuinfo";
62 62
63using namespace Opie::Core; 63using namespace Opie::Core;
64 64
65ODevice *ODevice::inst() 65ODevice *ODevice::inst()
66{ 66{
67 static ODevice *dev = 0; 67 static ODevice *dev = 0;
68 68
69 // rewrite this to only use /proc/cpuinfo or so 69 // rewrite this to only use /proc/cpuinfo or so
70 70
71 if ( !dev ) 71 if ( !dev )
72 { 72 {
73 QFile f( PATH_PROC_CPUINFO ); 73 QFile f( PATH_PROC_CPUINFO );
74 if ( f.open( IO_ReadOnly ) ) 74 if ( f.open( IO_ReadOnly ) )
75 { 75 {
76 QTextStream s( &f ); 76 QTextStream s( &f );
77 while ( !s.atEnd() ) 77 while ( !s.atEnd() )
78 { 78 {
79 QString line; 79 QString line;
80 line = s.readLine(); 80 line = s.readLine();
81 if ( line.startsWith( "Hardware" ) ) 81 if ( line.startsWith( "Hardware" ) )
82 { 82 {
83 qDebug( "ODevice() - found '%s'", (const char*) line ); 83 qDebug( "ODevice() - found '%s'", (const char*) line );
84 if ( line.contains( "sharp", false ) ) dev = new Private::Zaurus(); 84 if ( line.contains( "sharp", false ) ) dev = new Internal::Zaurus();
85 else if ( line.contains( "ipaq", false ) ) dev = new Private::iPAQ(); 85 else if ( line.contains( "ipaq", false ) ) dev = new Internal::iPAQ();
86 else if ( line.contains( "simpad", false ) ) dev = new Private::SIMpad(); 86 else if ( line.contains( "simpad", false ) ) dev = new Internal::SIMpad();
87 else if ( line.contains( "jornada", false ) ) dev = new Private::Jornada(); 87 else if ( line.contains( "jornada", false ) ) dev = new Internal::Jornada();
88 else if ( line.contains( "ramses", false ) ) dev = new Private::Ramses(); 88 else if ( line.contains( "ramses", false ) ) dev = new Internal::Ramses();
89 else qWarning( "ODevice() - unknown hardware - using default." ); 89 else qWarning( "ODevice() - unknown hardware - using default." );
90 break; 90 break;
91 } 91 }
92 } 92 }
93 } 93 }
94 else 94 else
95 { 95 {
96 qWarning( "ODevice() - can't open '%s' - unknown hardware - using default.", PATH_PROC_CPUINFO ); 96 qWarning( "ODevice() - can't open '%s' - unknown hardware - using default.", PATH_PROC_CPUINFO );
97 } 97 }
98 if ( !dev ) dev = new ODevice(); 98 if ( !dev ) dev = new ODevice();
99 dev->init(); 99 dev->init();
100 } 100 }
101 return dev; 101 return dev;
102} 102}
103 103
104ODevice::ODevice() 104ODevice::ODevice()
105{ 105{
106 d = new ODeviceData; 106 d = new ODeviceData;
107 107
108 d->m_modelstr = "Unknown"; 108 d->m_modelstr = "Unknown";
109 d->m_model = Model_Unknown; 109 d->m_model = Model_Unknown;
110 d->m_vendorstr = "Unknown"; 110 d->m_vendorstr = "Unknown";
111 d->m_vendor = Vendor_Unknown; 111 d->m_vendor = Vendor_Unknown;
112 d->m_systemstr = "Unknown"; 112 d->m_systemstr = "Unknown";
diff --git a/libopie2/opiecore/device/odevice_ipaq.cpp b/libopie2/opiecore/device/odevice_ipaq.cpp
index 177fd4c..2efcd3a 100644
--- a/libopie2/opiecore/device/odevice_ipaq.cpp
+++ b/libopie2/opiecore/device/odevice_ipaq.cpp
@@ -34,49 +34,49 @@
34#include <qfile.h> 34#include <qfile.h>
35#include <qtextstream.h> 35#include <qtextstream.h>
36#include <qwindowsystem_qws.h> 36#include <qwindowsystem_qws.h>
37 37
38/* OPIE */ 38/* OPIE */
39#include <qpe/config.h> 39#include <qpe/config.h>
40#include <qpe/resource.h> 40#include <qpe/resource.h>
41#include <qpe/sound.h> 41#include <qpe/sound.h>
42#include <qpe/qcopenvelope_qws.h> 42#include <qpe/qcopenvelope_qws.h>
43 43
44/* STD */ 44/* STD */
45#include <fcntl.h> 45#include <fcntl.h>
46#include <math.h> 46#include <math.h>
47#include <stdlib.h> 47#include <stdlib.h>
48#include <signal.h> 48#include <signal.h>
49#include <sys/ioctl.h> 49#include <sys/ioctl.h>
50#include <sys/time.h> 50#include <sys/time.h>
51#include <unistd.h> 51#include <unistd.h>
52#ifndef QT_NO_SOUND 52#ifndef QT_NO_SOUND
53#include <linux/soundcard.h> 53#include <linux/soundcard.h>
54#endif 54#endif
55 55
56 56
57using namespace Opie::Core; 57using namespace Opie::Core;
58using namespace Opie::Core::Private; 58using namespace Opie::Core::Internal;
59 59
60/* KERNEL */ 60/* KERNEL */
61#define OD_IOC(dir,type,number,size) (( dir << 30 ) | ( type << 8 ) | ( number ) | ( size << 16 )) 61#define OD_IOC(dir,type,number,size) (( dir << 30 ) | ( type << 8 ) | ( number ) | ( size << 16 ))
62 62
63#define OD_IO(type,number) OD_IOC(0,type,number,0) 63#define OD_IO(type,number) OD_IOC(0,type,number,0)
64#define OD_IOW(type,number,size) OD_IOC(1,type,number,sizeof(size)) 64#define OD_IOW(type,number,size) OD_IOC(1,type,number,sizeof(size))
65#define OD_IOR(type,number,size) OD_IOC(2,type,number,sizeof(size)) 65#define OD_IOR(type,number,size) OD_IOC(2,type,number,sizeof(size))
66#define OD_IORW(type,number,size) OD_IOC(3,type,number,sizeof(size)) 66#define OD_IORW(type,number,size) OD_IOC(3,type,number,sizeof(size))
67 67
68typedef struct { 68typedef struct {
69 unsigned char OffOnBlink; /* 0=off 1=on 2=Blink */ 69 unsigned char OffOnBlink; /* 0=off 1=on 2=Blink */
70 unsigned char TotalTime; /* Units of 5 seconds */ 70 unsigned char TotalTime; /* Units of 5 seconds */
71 unsigned char OnTime; /* units of 100m/s */ 71 unsigned char OnTime; /* units of 100m/s */
72 unsigned char OffTime; /* units of 100m/s */ 72 unsigned char OffTime; /* units of 100m/s */
73} LED_IN; 73} LED_IN;
74 74
75typedef struct { 75typedef struct {
76 unsigned char mode; 76 unsigned char mode;
77 unsigned char pwr; 77 unsigned char pwr;
78 unsigned char brightness; 78 unsigned char brightness;
79} FLITE_IN; 79} FLITE_IN;
80 80
81#define LED_ON OD_IOW( 'f', 5, LED_IN ) 81#define LED_ON OD_IOW( 'f', 5, LED_IN )
82#define FLITE_ON OD_IOW( 'f', 7, FLITE_IN ) 82#define FLITE_ON OD_IOW( 'f', 7, FLITE_IN )
diff --git a/libopie2/opiecore/device/odevice_ipaq.h b/libopie2/opiecore/device/odevice_ipaq.h
index 4f4af46..968f715 100644
--- a/libopie2/opiecore/device/odevice_ipaq.h
+++ b/libopie2/opiecore/device/odevice_ipaq.h
@@ -16,49 +16,49 @@
16    : ..    .:,     . . . without even the implied warranty of 16    : ..    .:,     . . . without even the implied warranty of
17    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A 17    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
18  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU 18  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU
19..}^=.=       =       ; Library General Public License for more 19..}^=.=       =       ; Library General Public License for more
20++=   -.     .`     .: details. 20++=   -.     .`     .: details.
21 :     =  ...= . :.=- 21 :     =  ...= . :.=-
22 -.   .:....=;==+<; You should have received a copy of the GNU 22 -.   .:....=;==+<; You should have received a copy of the GNU
23  -_. . .   )=.  = Library General Public License along with 23  -_. . .   )=.  = Library General Public License along with
24    --        :-=` this library; see the file COPYING.LIB. 24    --        :-=` this library; see the file COPYING.LIB.
25 If not, write to the Free Software Foundation, 25 If not, write to the Free Software Foundation,
26 Inc., 59 Temple Place - Suite 330, 26 Inc., 59 Temple Place - Suite 330,
27 Boston, MA 02111-1307, USA. 27 Boston, MA 02111-1307, USA.
28*/ 28*/
29 29
30#ifndef ODEVICE_IPAQ 30#ifndef ODEVICE_IPAQ
31#define ODEVICE_IPAQ 31#define ODEVICE_IPAQ
32 32
33#include "odevice.h" 33#include "odevice.h"
34 34
35/* QT */ 35/* QT */
36#include <qwindowsystem_qws.h> 36#include <qwindowsystem_qws.h>
37 37
38namespace Opie { 38namespace Opie {
39namespace Core { 39namespace Core {
40namespace Private { 40namespace Internal {
41 41
42class iPAQ : public ODevice, public QWSServer::KeyboardFilter 42class iPAQ : public ODevice, public QWSServer::KeyboardFilter
43{ 43{
44 44
45 protected: 45 protected:
46 virtual void init(); 46 virtual void init();
47 virtual void initButtons(); 47 virtual void initButtons();
48 48
49 public: 49 public:
50 virtual bool setSoftSuspend( bool soft ); 50 virtual bool setSoftSuspend( bool soft );
51 51
52 virtual bool setDisplayBrightness( int b ); 52 virtual bool setDisplayBrightness( int b );
53 virtual int displayBrightnessResolution() const; 53 virtual int displayBrightnessResolution() const;
54 54
55 virtual void playAlarmSound(); 55 virtual void playAlarmSound();
56 56
57 virtual QValueList <OLed> ledList() const; 57 virtual QValueList <OLed> ledList() const;
58 virtual QValueList <OLedState> ledStateList( OLed led ) const; 58 virtual QValueList <OLedState> ledStateList( OLed led ) const;
59 virtual OLedState ledState( OLed led ) const; 59 virtual OLedState ledState( OLed led ) const;
60 virtual bool setLedState( OLed led, OLedState st ); 60 virtual bool setLedState( OLed led, OLedState st );
61 61
62 virtual bool hasLightSensor() const; 62 virtual bool hasLightSensor() const;
63 virtual int readLightSensor(); 63 virtual int readLightSensor();
64 virtual int lightSensorResolution() const; 64 virtual int lightSensorResolution() const;
diff --git a/libopie2/opiecore/device/odevice_jornada.cpp b/libopie2/opiecore/device/odevice_jornada.cpp
index b79b0b5..eaa93ca 100644
--- a/libopie2/opiecore/device/odevice_jornada.cpp
+++ b/libopie2/opiecore/device/odevice_jornada.cpp
@@ -56,49 +56,49 @@
56/* KERNEL */ 56/* KERNEL */
57#define OD_IOC(dir,type,number,size) (( dir << 30 ) | ( type << 8 ) | ( number ) | ( size << 16 )) 57#define OD_IOC(dir,type,number,size) (( dir << 30 ) | ( type << 8 ) | ( number ) | ( size << 16 ))
58 58
59#define OD_IO(type,number) OD_IOC(0,type,number,0) 59#define OD_IO(type,number) OD_IOC(0,type,number,0)
60#define OD_IOW(type,number,size) OD_IOC(1,type,number,sizeof(size)) 60#define OD_IOW(type,number,size) OD_IOC(1,type,number,sizeof(size))
61#define OD_IOR(type,number,size) OD_IOC(2,type,number,sizeof(size)) 61#define OD_IOR(type,number,size) OD_IOC(2,type,number,sizeof(size))
62#define OD_IORW(type,number,size) OD_IOC(3,type,number,sizeof(size)) 62#define OD_IORW(type,number,size) OD_IOC(3,type,number,sizeof(size))
63 63
64typedef struct { 64typedef struct {
65 unsigned char OffOnBlink; /* 0=off 1=on 2=Blink */ 65 unsigned char OffOnBlink; /* 0=off 1=on 2=Blink */
66 unsigned char TotalTime; /* Units of 5 seconds */ 66 unsigned char TotalTime; /* Units of 5 seconds */
67 unsigned char OnTime; /* units of 100m/s */ 67 unsigned char OnTime; /* units of 100m/s */
68 unsigned char OffTime; /* units of 100m/s */ 68 unsigned char OffTime; /* units of 100m/s */
69} LED_IN; 69} LED_IN;
70 70
71typedef struct { 71typedef struct {
72 unsigned char mode; 72 unsigned char mode;
73 unsigned char pwr; 73 unsigned char pwr;
74 unsigned char brightness; 74 unsigned char brightness;
75} FLITE_IN; 75} FLITE_IN;
76 76
77#define LED_ON OD_IOW( 'f', 5, LED_IN ) 77#define LED_ON OD_IOW( 'f', 5, LED_IN )
78#define FLITE_ON OD_IOW( 'f', 7, FLITE_IN ) 78#define FLITE_ON OD_IOW( 'f', 7, FLITE_IN )
79 79
80using namespace Opie::Core::Private; 80using namespace Opie::Core::Internal;
81 81
82void Jornada::init() 82void Jornada::init()
83{ 83{
84 d->m_vendorstr = "HP"; 84 d->m_vendorstr = "HP";
85 d->m_vendor = Vendor_HP; 85 d->m_vendor = Vendor_HP;
86 d->m_modelstr = "Jornada 56x"; 86 d->m_modelstr = "Jornada 56x";
87 d->m_model = Model_Jornada_56x; 87 d->m_model = Model_Jornada_56x;
88 d->m_systemstr = "Familiar"; 88 d->m_systemstr = "Familiar";
89 d->m_system = System_Familiar; 89 d->m_system = System_Familiar;
90 d->m_rotation = Rot0; 90 d->m_rotation = Rot0;
91 91
92 QFile f ( "/etc/familiar-version" ); 92 QFile f ( "/etc/familiar-version" );
93 f.setName ( "/etc/familiar-version" ); 93 f.setName ( "/etc/familiar-version" );
94 if ( f.open ( IO_ReadOnly )) { 94 if ( f.open ( IO_ReadOnly )) {
95 95
96 QTextStream ts ( &f ); 96 QTextStream ts ( &f );
97 d->m_sysverstr = ts.readLine().mid( 10 ); 97 d->m_sysverstr = ts.readLine().mid( 10 );
98 98
99 f. close(); 99 f. close();
100 } 100 }
101} 101}
102 102
103 103
104int Jornada::displayBrightnessResolution() const 104int Jornada::displayBrightnessResolution() const
diff --git a/libopie2/opiecore/device/odevice_jornada.h b/libopie2/opiecore/device/odevice_jornada.h
index c37d75e..e2e67af 100644
--- a/libopie2/opiecore/device/odevice_jornada.h
+++ b/libopie2/opiecore/device/odevice_jornada.h
@@ -13,41 +13,41 @@
13    .%`+i>       _;_. 13    .%`+i>       _;_.
14    .i_,=:_.      -<s. This program is distributed in the hope that 14    .i_,=:_.      -<s. This program is distributed in the hope that
15     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY; 15     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
16    : ..    .:,     . . . without even the implied warranty of 16    : ..    .:,     . . . without even the implied warranty of
17    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A 17    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
18  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU 18  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU
19..}^=.=       =       ; Library General Public License for more 19..}^=.=       =       ; Library General Public License for more
20++=   -.     .`     .: details. 20++=   -.     .`     .: details.
21 :     =  ...= . :.=- 21 :     =  ...= . :.=-
22 -.   .:....=;==+<; You should have received a copy of the GNU 22 -.   .:....=;==+<; You should have received a copy of the GNU
23  -_. . .   )=.  = Library General Public License along with 23  -_. . .   )=.  = Library General Public License along with
24    --        :-=` this library; see the file COPYING.LIB. 24    --        :-=` this library; see the file COPYING.LIB.
25 If not, write to the Free Software Foundation, 25 If not, write to the Free Software Foundation,
26 Inc., 59 Temple Place - Suite 330, 26 Inc., 59 Temple Place - Suite 330,
27 Boston, MA 02111-1307, USA. 27 Boston, MA 02111-1307, USA.
28*/ 28*/
29 29
30#ifndef ODEVICE_JORNADA 30#ifndef ODEVICE_JORNADA
31#define ODEVICE_JORNADA 31#define ODEVICE_JORNADA
32 32
33#include <opie2/odevice.h> 33#include <opie2/odevice.h>
34 34
35namespace Opie { 35namespace Opie {
36namespace Core { 36namespace Core {
37namespace Private { 37namespace Internal {
38class Jornada : public ODevice 38class Jornada : public ODevice
39{ 39{
40 40
41 protected: 41 protected:
42 virtual void init(); 42 virtual void init();
43 43
44 public: 44 public:
45 virtual bool setSoftSuspend ( bool soft ); 45 virtual bool setSoftSuspend ( bool soft );
46 virtual bool setDisplayBrightness ( int b ); 46 virtual bool setDisplayBrightness ( int b );
47 virtual int displayBrightnessResolution() const; 47 virtual int displayBrightnessResolution() const;
48}; 48};
49} 49}
50} 50}
51} 51}
52#endif 52#endif
53 53
diff --git a/libopie2/opiecore/device/odevice_ramses.cpp b/libopie2/opiecore/device/odevice_ramses.cpp
index 77de8c5..10b7b61 100644
--- a/libopie2/opiecore/device/odevice_ramses.cpp
+++ b/libopie2/opiecore/device/odevice_ramses.cpp
@@ -33,49 +33,49 @@
33#include <qapplication.h> 33#include <qapplication.h>
34#include <qfile.h> 34#include <qfile.h>
35#include <qtextstream.h> 35#include <qtextstream.h>
36#include <qwindowsystem_qws.h> 36#include <qwindowsystem_qws.h>
37 37
38/* OPIE */ 38/* OPIE */
39#include <qpe/config.h> 39#include <qpe/config.h>
40#include <qpe/resource.h> 40#include <qpe/resource.h>
41#include <qpe/sound.h> 41#include <qpe/sound.h>
42#include <qpe/qcopenvelope_qws.h> 42#include <qpe/qcopenvelope_qws.h>
43 43
44/* STD */ 44/* STD */
45#include <fcntl.h> 45#include <fcntl.h>
46#include <math.h> 46#include <math.h>
47#include <stdlib.h> 47#include <stdlib.h>
48#include <signal.h> 48#include <signal.h>
49#include <sys/ioctl.h> 49#include <sys/ioctl.h>
50#include <sys/time.h> 50#include <sys/time.h>
51#include <unistd.h> 51#include <unistd.h>
52#ifndef QT_NO_SOUND 52#ifndef QT_NO_SOUND
53#include <linux/soundcard.h> 53#include <linux/soundcard.h>
54#endif 54#endif
55 55
56using namespace Opie::Core; 56using namespace Opie::Core;
57using namespace Opie::Core::Private; 57using namespace Opie::Core::Internal;
58 58
59struct r_button ramses_buttons [] = { 59struct r_button ramses_buttons [] = {
60 { Model_Ramses_MNCI, 60 { Model_Ramses_MNCI,
61 Qt::Key_F11, QT_TRANSLATE_NOOP("Button", "Menu Button"), 61 Qt::Key_F11, QT_TRANSLATE_NOOP("Button", "Menu Button"),
62 "devicebuttons/z_menu", 62 "devicebuttons/z_menu",
63 "QPE/TaskBar", "toggleMenu()", 63 "QPE/TaskBar", "toggleMenu()",
64 "QPE/TaskBar", "toggleStartMenu()" }, 64 "QPE/TaskBar", "toggleStartMenu()" },
65 { Model_Ramses_MNCI, 65 { Model_Ramses_MNCI,
66 Qt::Key_F12, QT_TRANSLATE_NOOP("Button", "Home Button"), 66 Qt::Key_F12, QT_TRANSLATE_NOOP("Button", "Home Button"),
67 "devicebuttons/ipaq_home", 67 "devicebuttons/ipaq_home",
68 "QPE/Launcher", "home()", 68 "QPE/Launcher", "home()",
69 "buttonsettings", "raise()" }, 69 "buttonsettings", "raise()" },
70}; 70};
71 71
72void Ramses::init() 72void Ramses::init()
73{ 73{
74 d->m_vendorstr = "M und N"; 74 d->m_vendorstr = "M und N";
75 d->m_vendor = Vendor_MundN; 75 d->m_vendor = Vendor_MundN;
76 76
77 QFile f("/proc/sys/board/ramses"); 77 QFile f("/proc/sys/board/ramses");
78 78
79 d->m_modelstr = "Ramses"; 79 d->m_modelstr = "Ramses";
80 d->m_model = Model_Ramses_MNCI; 80 d->m_model = Model_Ramses_MNCI;
81 81
diff --git a/libopie2/opiecore/device/odevice_ramses.h b/libopie2/opiecore/device/odevice_ramses.h
index e673b1a..aea9e2a 100644
--- a/libopie2/opiecore/device/odevice_ramses.h
+++ b/libopie2/opiecore/device/odevice_ramses.h
@@ -15,49 +15,49 @@
15     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY; 15     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
16    : ..    .:,     . . . without even the implied warranty of 16    : ..    .:,     . . . without even the implied warranty of
17    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A 17    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
18  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU 18  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU
19..}^=.=       =       ; Library General Public License for more 19..}^=.=       =       ; Library General Public License for more
20++=   -.     .`     .: details. 20++=   -.     .`     .: details.
21 :     =  ...= . :.=- 21 :     =  ...= . :.=-
22 -.   .:....=;==+<; You should have received a copy of the GNU 22 -.   .:....=;==+<; You should have received a copy of the GNU
23  -_. . .   )=.  = Library General Public License along with 23  -_. . .   )=.  = Library General Public License along with
24    --        :-=` this library; see the file COPYING.LIB. 24    --        :-=` this library; see the file COPYING.LIB.
25 If not, write to the Free Software Foundation, 25 If not, write to the Free Software Foundation,
26 Inc., 59 Temple Place - Suite 330, 26 Inc., 59 Temple Place - Suite 330,
27 Boston, MA 02111-1307, USA. 27 Boston, MA 02111-1307, USA.
28*/ 28*/
29 29
30#ifndef ODEVICE_RAMSES 30#ifndef ODEVICE_RAMSES
31#define ODEVICE_RAMSES 31#define ODEVICE_RAMSES
32 32
33#include <opie2/odevice.h> 33#include <opie2/odevice.h>
34/* QT */ 34/* QT */
35#include <qwindowsystem_qws.h> 35#include <qwindowsystem_qws.h>
36 36
37namespace Opie { 37namespace Opie {
38namespace Core { 38namespace Core {
39namespace Private { 39namespace Internal {
40 40
41class Ramses : public ODevice, public QWSServer::KeyboardFilter 41class Ramses : public ODevice, public QWSServer::KeyboardFilter
42{ 42{
43 protected: 43 protected:
44 virtual void init(); 44 virtual void init();
45 45
46 public: 46 public:
47 virtual bool setSoftSuspend( bool soft ); 47 virtual bool setSoftSuspend( bool soft );
48 virtual bool suspend(); 48 virtual bool suspend();
49 49
50 virtual bool setDisplayStatus( bool on ); 50 virtual bool setDisplayStatus( bool on );
51 virtual bool setDisplayBrightness( int b ); 51 virtual bool setDisplayBrightness( int b );
52 virtual int displayBrightnessResolution() const; 52 virtual int displayBrightnessResolution() const;
53 virtual bool setDisplayContrast( int b ); 53 virtual bool setDisplayContrast( int b );
54 virtual int displayContrastResolution() const; 54 virtual int displayContrastResolution() const;
55 55
56 protected: 56 protected:
57 virtual bool filter ( int unicode, int keycode, int modifiers, bool isPress, bool autoRepeat ); 57 virtual bool filter ( int unicode, int keycode, int modifiers, bool isPress, bool autoRepeat );
58 virtual void timerEvent ( QTimerEvent *te ); 58 virtual void timerEvent ( QTimerEvent *te );
59 59
60 int m_power_timer; 60 int m_power_timer;
61}; 61};
62 62
63struct r_button { 63struct r_button {
diff --git a/libopie2/opiecore/device/odevice_simpad.cpp b/libopie2/opiecore/device/odevice_simpad.cpp
index 80d40a3..7d79ef5 100644
--- a/libopie2/opiecore/device/odevice_simpad.cpp
+++ b/libopie2/opiecore/device/odevice_simpad.cpp
@@ -33,49 +33,49 @@ _;:, .> :=|. This program is free software; you can
33#include <qapplication.h> 33#include <qapplication.h>
34#include <qfile.h> 34#include <qfile.h>
35#include <qtextstream.h> 35#include <qtextstream.h>
36#include <qwindowsystem_qws.h> 36#include <qwindowsystem_qws.h>
37 37
38/* OPIE */ 38/* OPIE */
39#include <qpe/config.h> 39#include <qpe/config.h>
40#include <qpe/resource.h> 40#include <qpe/resource.h>
41#include <qpe/sound.h> 41#include <qpe/sound.h>
42#include <qpe/qcopenvelope_qws.h> 42#include <qpe/qcopenvelope_qws.h>
43 43
44/* STD */ 44/* STD */
45#include <fcntl.h> 45#include <fcntl.h>
46#include <math.h> 46#include <math.h>
47#include <stdlib.h> 47#include <stdlib.h>
48#include <signal.h> 48#include <signal.h>
49#include <sys/ioctl.h> 49#include <sys/ioctl.h>
50#include <sys/time.h> 50#include <sys/time.h>
51#include <unistd.h> 51#include <unistd.h>
52#ifndef QT_NO_SOUND 52#ifndef QT_NO_SOUND
53#include <linux/soundcard.h> 53#include <linux/soundcard.h>
54#endif 54#endif
55 55
56using namespace Opie::Core; 56using namespace Opie::Core;
57using namespace Opie::Core::Private; 57using namespace Opie::Core::Internal;
58 58
59struct s_button simpad_buttons [] = { 59struct s_button simpad_buttons [] = {
60 { Model_SIMpad_CL4 | Model_SIMpad_SL4 | Model_SIMpad_SLC | Model_SIMpad_TSinus, 60 { Model_SIMpad_CL4 | Model_SIMpad_SL4 | Model_SIMpad_SLC | Model_SIMpad_TSinus,
61 Qt::Key_F9, QT_TRANSLATE_NOOP("Button", "Lower+Up"), 61 Qt::Key_F9, QT_TRANSLATE_NOOP("Button", "Lower+Up"),
62 "devicebuttons/simpad_lower_up", 62 "devicebuttons/simpad_lower_up",
63 "datebook", "nextView()", 63 "datebook", "nextView()",
64 "today", "raise()" }, 64 "today", "raise()" },
65 { Model_SIMpad_CL4 | Model_SIMpad_SL4 | Model_SIMpad_SLC | Model_SIMpad_TSinus, 65 { Model_SIMpad_CL4 | Model_SIMpad_SL4 | Model_SIMpad_SLC | Model_SIMpad_TSinus,
66 Qt::Key_F10, QT_TRANSLATE_NOOP("Button", "Lower+Down"), 66 Qt::Key_F10, QT_TRANSLATE_NOOP("Button", "Lower+Down"),
67 "devicebuttons/simpad_lower_down", 67 "devicebuttons/simpad_lower_down",
68 "addressbook", "raise()", 68 "addressbook", "raise()",
69 "addressbook", "beamBusinessCard()" }, 69 "addressbook", "beamBusinessCard()" },
70 { Model_SIMpad_CL4 | Model_SIMpad_SL4 | Model_SIMpad_SLC | Model_SIMpad_TSinus, 70 { Model_SIMpad_CL4 | Model_SIMpad_SL4 | Model_SIMpad_SLC | Model_SIMpad_TSinus,
71 Qt::Key_F11, QT_TRANSLATE_NOOP("Button", "Lower+Right"), 71 Qt::Key_F11, QT_TRANSLATE_NOOP("Button", "Lower+Right"),
72 "devicebuttons/simpad_lower_right", 72 "devicebuttons/simpad_lower_right",
73 "QPE/TaskBar", "toggleMenu()", 73 "QPE/TaskBar", "toggleMenu()",
74 "QPE/TaskBar", "toggleStartMenu()" }, 74 "QPE/TaskBar", "toggleStartMenu()" },
75 { Model_SIMpad_CL4 | Model_SIMpad_SL4 | Model_SIMpad_SLC | Model_SIMpad_TSinus, 75 { Model_SIMpad_CL4 | Model_SIMpad_SL4 | Model_SIMpad_SLC | Model_SIMpad_TSinus,
76 Qt::Key_F13, QT_TRANSLATE_NOOP("Button", "Lower+Left"), 76 Qt::Key_F13, QT_TRANSLATE_NOOP("Button", "Lower+Left"),
77 "devicebuttons/simpad_lower_left", 77 "devicebuttons/simpad_lower_left",
78 "mail", "raise()", 78 "mail", "raise()",
79 "mail", "newMail()" }, 79 "mail", "newMail()" },
80 80
81 { Model_SIMpad_CL4 | Model_SIMpad_SL4 | Model_SIMpad_SLC | Model_SIMpad_TSinus, 81 { Model_SIMpad_CL4 | Model_SIMpad_SL4 | Model_SIMpad_SLC | Model_SIMpad_TSinus,
diff --git a/libopie2/opiecore/device/odevice_simpad.h b/libopie2/opiecore/device/odevice_simpad.h
index 1848151..3d5acb5 100644
--- a/libopie2/opiecore/device/odevice_simpad.h
+++ b/libopie2/opiecore/device/odevice_simpad.h
@@ -16,49 +16,49 @@
16    : ..    .:,     . . . without even the implied warranty of 16    : ..    .:,     . . . without even the implied warranty of
17    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A 17    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
18  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU 18  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU
19..}^=.=       =       ; Library General Public License for more 19..}^=.=       =       ; Library General Public License for more
20++=   -.     .`     .: details. 20++=   -.     .`     .: details.
21 :     =  ...= . :.=- 21 :     =  ...= . :.=-
22 -.   .:....=;==+<; You should have received a copy of the GNU 22 -.   .:....=;==+<; You should have received a copy of the GNU
23  -_. . .   )=.  = Library General Public License along with 23  -_. . .   )=.  = Library General Public License along with
24    --        :-=` this library; see the file COPYING.LIB. 24    --        :-=` this library; see the file COPYING.LIB.
25 If not, write to the Free Software Foundation, 25 If not, write to the Free Software Foundation,
26 Inc., 59 Temple Place - Suite 330, 26 Inc., 59 Temple Place - Suite 330,
27 Boston, MA 02111-1307, USA. 27 Boston, MA 02111-1307, USA.
28*/ 28*/
29 29
30#ifndef ODEVICE_SIMPAD 30#ifndef ODEVICE_SIMPAD
31#define ODEVICE_SIMPAD 31#define ODEVICE_SIMPAD
32 32
33#include <opie2/odevice.h> 33#include <opie2/odevice.h>
34 34
35/* QT */ 35/* QT */
36#include <qwindowsystem_qws.h> 36#include <qwindowsystem_qws.h>
37 37
38namespace Opie { 38namespace Opie {
39namespace Core { 39namespace Core {
40namespace Private { 40namespace Internal {
41 41
42class SIMpad : public ODevice, public QWSServer::KeyboardFilter 42class SIMpad : public ODevice, public QWSServer::KeyboardFilter
43{ 43{
44 protected: 44 protected:
45 virtual void init(); 45 virtual void init();
46 virtual void initButtons(); 46 virtual void initButtons();
47 47
48 public: 48 public:
49 virtual bool setSoftSuspend( bool soft ); 49 virtual bool setSoftSuspend( bool soft );
50 virtual bool suspend(); 50 virtual bool suspend();
51 51
52 virtual bool setDisplayStatus( bool on ); 52 virtual bool setDisplayStatus( bool on );
53 virtual bool setDisplayBrightness( int b ); 53 virtual bool setDisplayBrightness( int b );
54 virtual int displayBrightnessResolution() const; 54 virtual int displayBrightnessResolution() const;
55 55
56 virtual void playAlarmSound(); 56 virtual void playAlarmSound();
57 57
58 virtual QValueList <OLed> ledList() const; 58 virtual QValueList <OLed> ledList() const;
59 virtual QValueList <OLedState> ledStateList( OLed led ) const; 59 virtual QValueList <OLedState> ledStateList( OLed led ) const;
60 virtual OLedState ledState( OLed led ) const; 60 virtual OLedState ledState( OLed led ) const;
61 virtual bool setLedState( OLed led, OLedState st ); 61 virtual bool setLedState( OLed led, OLedState st );
62 62
63 protected: 63 protected:
64 virtual bool filter( int unicode, int keycode, int modifiers, bool isPress, bool autoRepeat ); 64 virtual bool filter( int unicode, int keycode, int modifiers, bool isPress, bool autoRepeat );
diff --git a/libopie2/opiecore/device/odevice_yopy.cpp b/libopie2/opiecore/device/odevice_yopy.cpp
index f7a4025..4e9f227 100644
--- a/libopie2/opiecore/device/odevice_yopy.cpp
+++ b/libopie2/opiecore/device/odevice_yopy.cpp
@@ -33,49 +33,49 @@ _;:,     .>    :=|. This program is free software; you can
33#include <qapplication.h> 33#include <qapplication.h>
34#include <qfile.h> 34#include <qfile.h>
35#include <qtextstream.h> 35#include <qtextstream.h>
36#include <qwindowsystem_qws.h> 36#include <qwindowsystem_qws.h>
37 37
38/* OPIE */ 38/* OPIE */
39#include <qpe/config.h> 39#include <qpe/config.h>
40#include <qpe/resource.h> 40#include <qpe/resource.h>
41#include <qpe/sound.h> 41#include <qpe/sound.h>
42#include <qpe/qcopenvelope_qws.h> 42#include <qpe/qcopenvelope_qws.h>
43 43
44/* STD */ 44/* STD */
45#include <fcntl.h> 45#include <fcntl.h>
46#include <math.h> 46#include <math.h>
47#include <stdlib.h> 47#include <stdlib.h>
48#include <signal.h> 48#include <signal.h>
49#include <sys/ioctl.h> 49#include <sys/ioctl.h>
50#include <sys/time.h> 50#include <sys/time.h>
51#include <unistd.h> 51#include <unistd.h>
52#ifndef QT_NO_SOUND 52#ifndef QT_NO_SOUND
53#include <linux/soundcard.h> 53#include <linux/soundcard.h>
54#endif 54#endif
55 55
56using namespace Opie::Core; 56using namespace Opie::Core;
57using namespace Opie::Core::Private; 57using namespace Opie::Core::Internal;
58 58
59struct yopy_button yopy_buttons [] = { 59struct yopy_button yopy_buttons [] = {
60 { Qt::Key_F10, QT_TRANSLATE_NOOP( "Button", "Action Button" ), 60 { Qt::Key_F10, QT_TRANSLATE_NOOP( "Button", "Action Button" ),
61 "devicebuttons/yopy_action", 61 "devicebuttons/yopy_action",
62 "datebook", "nextView()", 62 "datebook", "nextView()",
63 "today", "raise()" }, 63 "today", "raise()" },
64 { Qt::Key_F11, QT_TRANSLATE_NOOP( "Button", "OK Button" ), 64 { Qt::Key_F11, QT_TRANSLATE_NOOP( "Button", "OK Button" ),
65 "devicebuttons/yopy_ok", 65 "devicebuttons/yopy_ok",
66 "addressbook", "raise()", 66 "addressbook", "raise()",
67 "addressbook", "beamBusinessCard()" }, 67 "addressbook", "beamBusinessCard()" },
68 { Qt::Key_F12, QT_TRANSLATE_NOOP( "Button", "End Button" ), 68 { Qt::Key_F12, QT_TRANSLATE_NOOP( "Button", "End Button" ),
69 "devicebuttons/yopy_end", 69 "devicebuttons/yopy_end",
70 "QPE/Launcher", "home()", 70 "QPE/Launcher", "home()",
71 "buttonsettings", "raise()" }, 71 "buttonsettings", "raise()" },
72}; 72};
73 73
74void Yopy::init() 74void Yopy::init()
75{ 75{
76 d->m_vendorstr = "G.Mate"; 76 d->m_vendorstr = "G.Mate";
77 d->m_vendor = Vendor_GMate; 77 d->m_vendor = Vendor_GMate;
78 d->m_modelstr = "Yopy3700"; 78 d->m_modelstr = "Yopy3700";
79 d->m_model = Model_Yopy_3700; 79 d->m_model = Model_Yopy_3700;
80 d->m_rotation = Rot0; 80 d->m_rotation = Rot0;
81 81
diff --git a/libopie2/opiecore/device/odevice_yopy.h b/libopie2/opiecore/device/odevice_yopy.h
index 7d85479..6e1db88 100644
--- a/libopie2/opiecore/device/odevice_yopy.h
+++ b/libopie2/opiecore/device/odevice_yopy.h
@@ -13,49 +13,49 @@ _;:,     .>    :=|. This program is free software; you can
13   .%`+i>       _;_. 13   .%`+i>       _;_.
14   .i_,=:_.      -<s. This program is distributed in the hope that 14   .i_,=:_.      -<s. This program is distributed in the hope that
15    +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY; 15    +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
16   : ..    .:,     . . . without even the implied warranty of 16   : ..    .:,     . . . without even the implied warranty of
17   =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A 17   =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
18 _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU 18 _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU
19..}^=.=       =       ; Library General Public License for more 19..}^=.=       =       ; Library General Public License for more
20++=   -.     .`     .: details. 20++=   -.     .`     .: details.
21:     =  ...= . :.=- 21:     =  ...= . :.=-
22-.   .:....=;==+<; You should have received a copy of the GNU 22-.   .:....=;==+<; You should have received a copy of the GNU
23 -_. . .   )=.  = Library General Public License along with 23 -_. . .   )=.  = Library General Public License along with
24   --        :-=` this library; see the file COPYING.LIB. 24   --        :-=` this library; see the file COPYING.LIB.
25 If not, write to the Free Software Foundation, 25 If not, write to the Free Software Foundation,
26 Inc., 59 Temple Place - Suite 330, 26 Inc., 59 Temple Place - Suite 330,
27 Boston, MA 02111-1307, USA. 27 Boston, MA 02111-1307, USA.
28*/ 28*/
29 29
30#ifndef ODEVICE_YOPY 30#ifndef ODEVICE_YOPY
31#define ODEVICE_YOPY 31#define ODEVICE_YOPY
32 32
33#include <opie2/odevice.h> 33#include <opie2/odevice.h>
34 34
35namespace Opie { 35namespace Opie {
36namespace Core { 36namespace Core {
37namespace Private { 37namespace Internal {
38class Yopy : public ODevice 38class Yopy : public ODevice
39{ 39{
40 protected: 40 protected:
41 41
42 virtual void init(); 42 virtual void init();
43 virtual void initButtons(); 43 virtual void initButtons();
44 44
45 public: 45 public:
46 virtual bool suspend(); 46 virtual bool suspend();
47 47
48 virtual bool setDisplayBrightness ( int b ); 48 virtual bool setDisplayBrightness ( int b );
49 virtual int displayBrightnessResolution() const; 49 virtual int displayBrightnessResolution() const;
50}; 50};
51 51
52struct yopy_button 52struct yopy_button
53{ 53{
54 Qt::Key code; 54 Qt::Key code;
55 char *utext; 55 char *utext;
56 char *pix; 56 char *pix;
57 char *fpressedservice; 57 char *fpressedservice;
58 char *fpressedaction; 58 char *fpressedaction;
59 char *fheldservice; 59 char *fheldservice;
60 char *fheldaction; 60 char *fheldaction;
61}; 61};
diff --git a/libopie2/opiecore/device/odevice_zaurus.cpp b/libopie2/opiecore/device/odevice_zaurus.cpp
index 0d21f26..000d29c 100644
--- a/libopie2/opiecore/device/odevice_zaurus.cpp
+++ b/libopie2/opiecore/device/odevice_zaurus.cpp
@@ -33,49 +33,49 @@ _;:, .> :=|. This program is free software; you can
33#include <qapplication.h> 33#include <qapplication.h>
34#include <qfile.h> 34#include <qfile.h>
35#include <qtextstream.h> 35#include <qtextstream.h>
36#include <qwindowsystem_qws.h> 36#include <qwindowsystem_qws.h>
37 37
38/* OPIE */ 38/* OPIE */
39#include <qpe/config.h> 39#include <qpe/config.h>
40#include <qpe/resource.h> 40#include <qpe/resource.h>
41#include <qpe/sound.h> 41#include <qpe/sound.h>
42#include <qpe/qcopenvelope_qws.h> 42#include <qpe/qcopenvelope_qws.h>
43 43
44/* STD */ 44/* STD */
45#include <fcntl.h> 45#include <fcntl.h>
46#include <math.h> 46#include <math.h>
47#include <stdlib.h> 47#include <stdlib.h>
48#include <signal.h> 48#include <signal.h>
49#include <sys/ioctl.h> 49#include <sys/ioctl.h>
50#include <sys/time.h> 50#include <sys/time.h>
51#include <unistd.h> 51#include <unistd.h>
52#ifndef QT_NO_SOUND 52#ifndef QT_NO_SOUND
53#include <linux/soundcard.h> 53#include <linux/soundcard.h>
54#endif 54#endif
55 55
56using namespace Opie::Core; 56using namespace Opie::Core;
57using namespace Opie::Core::Private; 57using namespace Opie::Core::Internal;
58 58
59struct z_button z_buttons [] = { 59struct z_button z_buttons [] = {
60 { Qt::Key_F9, QT_TRANSLATE_NOOP("Button", "Calendar Button"), 60 { Qt::Key_F9, QT_TRANSLATE_NOOP("Button", "Calendar Button"),
61 "devicebuttons/z_calendar", 61 "devicebuttons/z_calendar",
62 "datebook", "nextView()", 62 "datebook", "nextView()",
63 "today", "raise()" }, 63 "today", "raise()" },
64 { Qt::Key_F10, QT_TRANSLATE_NOOP("Button", "Contacts Button"), 64 { Qt::Key_F10, QT_TRANSLATE_NOOP("Button", "Contacts Button"),
65 "devicebuttons/z_contact", 65 "devicebuttons/z_contact",
66 "addressbook", "raise()", 66 "addressbook", "raise()",
67 "addressbook", "beamBusinessCard()" }, 67 "addressbook", "beamBusinessCard()" },
68 { Qt::Key_F12, QT_TRANSLATE_NOOP("Button", "Home Button"), 68 { Qt::Key_F12, QT_TRANSLATE_NOOP("Button", "Home Button"),
69 "devicebuttons/z_home", 69 "devicebuttons/z_home",
70 "QPE/Launcher", "home()", 70 "QPE/Launcher", "home()",
71 "buttonsettings", "raise()" }, 71 "buttonsettings", "raise()" },
72 { Qt::Key_F11, QT_TRANSLATE_NOOP("Button", "Menu Button"), 72 { Qt::Key_F11, QT_TRANSLATE_NOOP("Button", "Menu Button"),
73 "devicebuttons/z_menu", 73 "devicebuttons/z_menu",
74 "QPE/TaskBar", "toggleMenu()", 74 "QPE/TaskBar", "toggleMenu()",
75 "QPE/TaskBar", "toggleStartMenu()" }, 75 "QPE/TaskBar", "toggleStartMenu()" },
76 { Qt::Key_F13, QT_TRANSLATE_NOOP("Button", "Mail Button"), 76 { Qt::Key_F13, QT_TRANSLATE_NOOP("Button", "Mail Button"),
77 "devicebuttons/z_mail", 77 "devicebuttons/z_mail",
78 "mail", "raise()", 78 "mail", "raise()",
79 "mail", "newMail()" }, 79 "mail", "newMail()" },
80}; 80};
81 81
@@ -366,57 +366,57 @@ void Zaurus::buzzer ( int sound )
366 Config cfg ( "qpe" ); 366 Config cfg ( "qpe" );
367 cfg. setGroup ( "Volume" ); 367 cfg. setGroup ( "Volume" );
368 368
369 int volalarm = cfg. readNumEntry ( "AlarmPercent", 50 ); 369 int volalarm = cfg. readNumEntry ( "AlarmPercent", 50 );
370 if ( volalarm < 0 ) 370 if ( volalarm < 0 )
371 volalarm = 0; 371 volalarm = 0;
372 else if ( volalarm > 100 ) 372 else if ( volalarm > 100 )
373 volalarm = 100; 373 volalarm = 100;
374 volalarm |= ( volalarm << 8 ); 374 volalarm |= ( volalarm << 8 );
375 375
376 if ( ::ioctl ( fd, MIXER_WRITE( 0 ), &volalarm ) >= 0 ) 376 if ( ::ioctl ( fd, MIXER_WRITE( 0 ), &volalarm ) >= 0 )
377 vol_reset = true; 377 vol_reset = true;
378 } 378 }
379 } 379 }
380 380
381 snd. play(); 381 snd. play();
382 while ( !snd. isFinished()) 382 while ( !snd. isFinished())
383 qApp->processEvents(); 383 qApp->processEvents();
384 384
385 if ( fd >= 0 ) { 385 if ( fd >= 0 ) {
386 if ( vol_reset ) 386 if ( vol_reset )
387 ::ioctl ( fd, MIXER_WRITE( 0 ), &vol ); 387 ::ioctl ( fd, MIXER_WRITE( 0 ), &vol );
388 ::close ( fd ); 388 ::close ( fd );
389 } 389 }
390 } else { 390 } else {
391 int fd = ::open ( "/dev/sharp_buz", O_WRONLY|O_NONBLOCK ); 391 int fd = ::open ( "/dev/sharp_buz", O_WRONLY|O_NONBLOCK );
392 392
393 if ( fd >= 0 ) { 393 if ( fd >= 0 ) {
394 ::ioctl ( fd, SHARP_BUZZER_MAKESOUND, sound ); 394 ::ioctl ( fd, SHARP_BUZZER_MAKESOUND, sound );
395 ::close ( fd ); 395 ::close ( fd );
396 } 396 }
397 397
398 } 398 }
399#endif 399#endif
400} 400}
401 401
402 402
403void Zaurus::playAlarmSound() 403void Zaurus::playAlarmSound()
404{ 404{
405 buzzer ( SHARP_BUZ_SCHEDULE_ALARM ); 405 buzzer ( SHARP_BUZ_SCHEDULE_ALARM );
406} 406}
407 407
408void Zaurus::playTouchSound() 408void Zaurus::playTouchSound()
409{ 409{
410 buzzer ( SHARP_BUZ_TOUCHSOUND ); 410 buzzer ( SHARP_BUZ_TOUCHSOUND );
411} 411}
412 412
413void Zaurus::playKeySound() 413void Zaurus::playKeySound()
414{ 414{
415 buzzer ( SHARP_BUZ_KEYSOUND ); 415 buzzer ( SHARP_BUZ_KEYSOUND );
416} 416}
417 417
418 418
419QValueList <OLed> Zaurus::ledList() const 419QValueList <OLed> Zaurus::ledList() const
420{ 420{
421 QValueList <OLed> vl; 421 QValueList <OLed> vl;
422 vl << Led_Mail; 422 vl << Led_Mail;
@@ -585,51 +585,51 @@ bool Zaurus::suspend()
585 ::gettimeofday ( &tvn, 0 ); 585 ::gettimeofday ( &tvn, 0 );
586 } while ((( tvn. tv_sec - tvs. tv_sec ) * 1000 + ( tvn. tv_usec - tvs. tv_usec ) / 1000 ) < 15000 ); 586 } while ((( tvn. tv_sec - tvs. tv_sec ) * 1000 + ( tvn. tv_usec - tvs. tv_usec ) / 1000 ) < 15000 );
587 } 587 }
588 588
589 QCopEnvelope ( "QPE/Rotation", "rotateDefault()" ); 589 QCopEnvelope ( "QPE/Rotation", "rotateDefault()" );
590 return res; 590 return res;
591} 591}
592 592
593 593
594Transformation Zaurus::rotation() const 594Transformation Zaurus::rotation() const
595{ 595{
596 Transformation rot; 596 Transformation rot;
597 int handle = 0; 597 int handle = 0;
598 int retval = 0; 598 int retval = 0;
599 599
600 switch ( d->m_model ) { 600 switch ( d->m_model ) {
601 case Model_Zaurus_SLC7x0: 601 case Model_Zaurus_SLC7x0:
602 handle = ::open("/dev/apm_bios", O_RDWR|O_NONBLOCK); 602 handle = ::open("/dev/apm_bios", O_RDWR|O_NONBLOCK);
603 if (handle == -1) { 603 if (handle == -1) {
604 return Rot270; 604 return Rot270;
605 } else { 605 } else {
606 retval = ::ioctl(handle, SHARP_IOCTL_GET_ROTATION); 606 retval = ::ioctl(handle, SHARP_IOCTL_GET_ROTATION);
607 ::close (handle); 607 ::close (handle);
608 608
609 if (retval == 2 ) 609 if (retval == 2 )
610 rot = Rot0; 610 rot = Rot0;
611 else 611 else
612 rot = Rot270; 612 rot = Rot270;
613 } 613 }
614 break; 614 break;
615 case Model_Zaurus_SLA300: 615 case Model_Zaurus_SLA300:
616 case Model_Zaurus_SLB600: 616 case Model_Zaurus_SLB600:
617 case Model_Zaurus_SL5500: 617 case Model_Zaurus_SL5500:
618 case Model_Zaurus_SL5000: 618 case Model_Zaurus_SL5000:
619 default: 619 default:
620 rot = d->m_rotation; 620 rot = d->m_rotation;
621 break; 621 break;
622 } 622 }
623 623
624 return rot; 624 return rot;
625} 625}
626ODirection Zaurus::direction() const 626ODirection Zaurus::direction() const
627{ 627{
628 ODirection dir; 628 ODirection dir;
629 int handle = 0; 629 int handle = 0;
630 int retval = 0; 630 int retval = 0;
631 switch ( d->m_model ) { 631 switch ( d->m_model ) {
632 case Model_Zaurus_SLC7x0: 632 case Model_Zaurus_SLC7x0:
633 handle = ::open("/dev/apm_bios", O_RDWR|O_NONBLOCK); 633 handle = ::open("/dev/apm_bios", O_RDWR|O_NONBLOCK);
634 if (handle == -1) { 634 if (handle == -1) {
635 dir = CW; 635 dir = CW;
diff --git a/libopie2/opiecore/device/odevice_zaurus.h b/libopie2/opiecore/device/odevice_zaurus.h
index ffb648f..a0b1787 100644
--- a/libopie2/opiecore/device/odevice_zaurus.h
+++ b/libopie2/opiecore/device/odevice_zaurus.h
@@ -27,49 +27,49 @@
27 Boston, MA 02111-1307, USA. 27 Boston, MA 02111-1307, USA.
28*/ 28*/
29 29
30#ifndef ODEVICE_ZAURUS 30#ifndef ODEVICE_ZAURUS
31#define ODEVICE_ZAURUS 31#define ODEVICE_ZAURUS
32 32
33#include <opie2/odevice.h> 33#include <opie2/odevice.h>
34 34
35#ifndef ARRAY_SIZE 35#ifndef ARRAY_SIZE
36#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0])) 36#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
37#endif 37#endif
38 38
39// _IO and friends are only defined in kernel headers ... 39// _IO and friends are only defined in kernel headers ...
40 40
41#define OD_IOC(dir,type,number,size) (( dir << 30 ) | ( type << 8 ) | ( number ) | ( size << 16 )) 41#define OD_IOC(dir,type,number,size) (( dir << 30 ) | ( type << 8 ) | ( number ) | ( size << 16 ))
42 42
43#define OD_IO(type,number) OD_IOC(0,type,number,0) 43#define OD_IO(type,number) OD_IOC(0,type,number,0)
44#define OD_IOW(type,number,size) OD_IOC(1,type,number,sizeof(size)) 44#define OD_IOW(type,number,size) OD_IOC(1,type,number,sizeof(size))
45#define OD_IOR(type,number,size) OD_IOC(2,type,number,sizeof(size)) 45#define OD_IOR(type,number,size) OD_IOC(2,type,number,sizeof(size))
46#define OD_IORW(type,number,size) OD_IOC(3,type,number,sizeof(size)) 46#define OD_IORW(type,number,size) OD_IOC(3,type,number,sizeof(size))
47 47
48 48
49namespace Opie { 49namespace Opie {
50namespace Core { 50namespace Core {
51namespace Private { 51namespace Internal {
52class Zaurus : public ODevice 52class Zaurus : public ODevice
53{ 53{
54 54
55 protected: 55 protected:
56 virtual void init(); 56 virtual void init();
57 virtual void initButtons(); 57 virtual void initButtons();
58 58
59 public: 59 public:
60 virtual bool setSoftSuspend ( bool soft ); 60 virtual bool setSoftSuspend ( bool soft );
61 61
62 virtual bool setDisplayBrightness ( int b ); 62 virtual bool setDisplayBrightness ( int b );
63 virtual int displayBrightnessResolution() const; 63 virtual int displayBrightnessResolution() const;
64 64
65 virtual void playAlarmSound(); 65 virtual void playAlarmSound();
66 virtual void playKeySound(); 66 virtual void playKeySound();
67 virtual void playTouchSound(); 67 virtual void playTouchSound();
68 68
69 virtual QValueList <OLed> ledList() const; 69 virtual QValueList <OLed> ledList() const;
70 virtual QValueList <OLedState> ledStateList ( OLed led ) const; 70 virtual QValueList <OLedState> ledStateList ( OLed led ) const;
71 virtual OLedState ledState( OLed led ) const; 71 virtual OLedState ledState( OLed led ) const;
72 virtual bool setLedState( OLed led, OLedState st ); 72 virtual bool setLedState( OLed led, OLedState st );
73 73
74 virtual bool hasHingeSensor() const; 74 virtual bool hasHingeSensor() const;
75 virtual OHingeStatus readHingeSensor(); 75 virtual OHingeStatus readHingeSensor();
diff --git a/libopie2/opiecore/device/odevicebutton.cpp b/libopie2/opiecore/device/odevicebutton.cpp
index a081b7f..6974b30 100644
--- a/libopie2/opiecore/device/odevicebutton.cpp
+++ b/libopie2/opiecore/device/odevicebutton.cpp
@@ -15,61 +15,61 @@
15     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY; 15     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
16    : ..    .:,     . . . without even the implied warranty of 16    : ..    .:,     . . . without even the implied warranty of
17    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A 17    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
18  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU 18  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU
19..}^=.=       =       ; Library General Public License for more 19..}^=.=       =       ; Library General Public License for more
20++=   -.     .`     .: details. 20++=   -.     .`     .: details.
21 :     =  ...= . :.=- 21 :     =  ...= . :.=-
22 -.   .:....=;==+<; You should have received a copy of the GNU 22 -.   .:....=;==+<; You should have received a copy of the GNU
23  -_. . .   )=.  = Library General Public License along with 23  -_. . .   )=.  = Library General Public License along with
24    --        :-=` this library; see the file COPYING.LIB. 24    --        :-=` this library; see the file COPYING.LIB.
25 If not, write to the Free Software Foundation, 25 If not, write to the Free Software Foundation,
26 Inc., 59 Temple Place - Suite 330, 26 Inc., 59 Temple Place - Suite 330,
27 Boston, MA 02111-1307, USA. 27 Boston, MA 02111-1307, USA.
28*/ 28*/
29 29
30#include <qpixmap.h> 30#include <qpixmap.h>
31#include <qstring.h> 31#include <qstring.h>
32 32
33#include <qpe/qcopenvelope_qws.h> 33#include <qpe/qcopenvelope_qws.h>
34#include <opie2/odevicebutton.h> 34#include <opie2/odevicebutton.h>
35 35
36 36
37namespace Opie { 37namespace Opie {
38namespace Core { 38namespace Core {
39namespace Private { 39namespace Internal {
40 40
41class OQCopMessageData 41class OQCopMessageData
42{ 42{
43 public: 43 public:
44 QCString m_channel; 44 QCString m_channel;
45 QCString m_message; 45 QCString m_message;
46 QByteArray m_data; 46 QByteArray m_data;
47}; 47};
48} 48}
49 49
50using namespace Opie::Core; 50using namespace Opie::Core;
51using namespace Opie::Core::Private; 51using Opie::Core::Internal::OQCopMessageData;
52 52
53OQCopMessage::OQCopMessage() 53OQCopMessage::OQCopMessage()
54 : d ( 0 ) 54 : d ( 0 )
55{ 55{
56 init ( QCString(), QCString(), QByteArray()); 56 init ( QCString(), QCString(), QByteArray());
57} 57}
58 58
59OQCopMessage::OQCopMessage ( const OQCopMessage &copy ) 59OQCopMessage::OQCopMessage ( const OQCopMessage &copy )
60 : d ( 0 ) 60 : d ( 0 )
61{ 61{
62 init ( copy. channel(), copy. message(), copy. data()); 62 init ( copy. channel(), copy. message(), copy. data());
63} 63}
64 64
65OQCopMessage &OQCopMessage::operator = ( const OQCopMessage &assign ) 65OQCopMessage &OQCopMessage::operator = ( const OQCopMessage &assign )
66{ 66{
67 init ( assign. channel(), assign. message(), assign. data()); 67 init ( assign. channel(), assign. message(), assign. data());
68 return *this; 68 return *this;
69} 69}
70 70
71OQCopMessage::OQCopMessage ( const QCString &ch, const QCString &m, const QByteArray &arg ) 71OQCopMessage::OQCopMessage ( const QCString &ch, const QCString &m, const QByteArray &arg )
72 : d ( 0 ) 72 : d ( 0 )
73{ 73{
74 init ( ch, m, arg ); 74 init ( ch, m, arg );
75} 75}
@@ -111,55 +111,55 @@ QByteArray OQCopMessage::data() const
111 return d->m_data; 111 return d->m_data;
112} 112}
113 113
114bool OQCopMessage::isNull() const 114bool OQCopMessage::isNull() const
115{ 115{
116 return d->m_message.isNull() || d->m_channel.isNull(); 116 return d->m_message.isNull() || d->m_channel.isNull();
117} 117}
118void OQCopMessage::setChannel ( const QCString &ch ) 118void OQCopMessage::setChannel ( const QCString &ch )
119{ 119{
120 d->m_channel = ch; 120 d->m_channel = ch;
121} 121}
122 122
123void OQCopMessage::setMessage ( const QCString &m ) 123void OQCopMessage::setMessage ( const QCString &m )
124{ 124{
125 d->m_message = m; 125 d->m_message = m;
126} 126}
127 127
128void OQCopMessage::setData ( const QByteArray &data ) 128void OQCopMessage::setData ( const QByteArray &data )
129{ 129{
130 d->m_data = data; 130 d->m_data = data;
131} 131}
132 132
133/*! \class Opie::Core::ODeviceButton 133/*! \class Opie::Core::ODeviceButton
134 \brief The Opie::Core::ODeviceButton class represents a physical user mappable button on a Qtopia device. 134 \brief The Opie::Core::ODeviceButton class represents a physical user mappable button on a Qtopia device.
135 135
136 This class represents a physical button on a Qtopia device. A 136 This class represents a physical button on a Qtopia device. A
137 device may have "user programmable" buttons. 137 device may have "user programmable" buttons.
138 The location and number of buttons will vary from device to 138 The location and number of buttons will vary from device to
139 device. userText() and pixmap() may be used to describe this button 139 device. userText() and pixmap() may be used to describe this button
140 to the user in help documentation. 140 to the user in help documentation.
141 141
142 \ingroup qtopiaemb 142 \ingroup qtopiaemb
143 \internal 143 \internal
144*/ 144*/
145 145
146ODeviceButton::ODeviceButton() 146ODeviceButton::ODeviceButton()
147{} 147{}
148 148
149ODeviceButton::~ODeviceButton() 149ODeviceButton::~ODeviceButton()
150{} 150{}
151 151
152/*! 152/*!
153Returns the button's keycode. 153Returns the button's keycode.
154*/ 154*/
155ushort ODeviceButton::keycode() const 155ushort ODeviceButton::keycode() const
156{ 156{
157 return m_Keycode; 157 return m_Keycode;
158} 158}
159 159
160 160
161/*! 161/*!
162This function returns a human readable, translated description of the button. 162This function returns a human readable, translated description of the button.
163*/ 163*/
164QString ODeviceButton::userText() const 164QString ODeviceButton::userText() const
165{ 165{
diff --git a/libopie2/opiecore/device/odevicebutton.h b/libopie2/opiecore/device/odevicebutton.h
index 4000144..e3f9ba9 100644
--- a/libopie2/opiecore/device/odevicebutton.h
+++ b/libopie2/opiecore/device/odevicebutton.h
@@ -5,77 +5,77 @@
5** 5**
6** This file may be distributed and/or modified under the terms of the 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 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 8** Foundation and appearing in the file LICENSE.GPL included in the
9** packaging of this file. 9** packaging of this file.
10** 10**
11** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 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. 12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
13** 13**
14** See http://www.trolltech.com/gpl/ for GPL licensing information. 14** See http://www.trolltech.com/gpl/ for GPL licensing information.
15** 15**
16** Contact info@trolltech.com if any conditions of this licensing are 16** Contact info@trolltech.com if any conditions of this licensing are
17** not clear to you. 17** not clear to you.
18** 18**
19**********************************************************************/ 19**********************************************************************/
20#ifndef DEVICE_BUTTON_H 20#ifndef DEVICE_BUTTON_H
21#define DEVICE_BUTTON_H 21#define DEVICE_BUTTON_H
22 22
23#include <qpixmap.h> 23#include <qpixmap.h>
24#include <qstring.h> 24#include <qstring.h>
25 25
26 26
27namespace Opie{ 27namespace Opie{
28namespace Core{ 28namespace Core{
29namespace Private { 29namespace Internal {
30class OQCopMessageData; 30class OQCopMessageData;
31} 31}
32 32
33class OQCopMessage 33class OQCopMessage
34{ 34{
35public: 35public:
36 OQCopMessage ( ); 36 OQCopMessage ( );
37 OQCopMessage ( const OQCopMessage &copy ); 37 OQCopMessage ( const OQCopMessage &copy );
38 OQCopMessage ( const QCString &m_channel, const QCString &message, const QByteArray &args = QByteArray ( )); 38 OQCopMessage ( const QCString &m_channel, const QCString &message, const QByteArray &args = QByteArray ( ));
39 39
40 OQCopMessage &operator = ( const OQCopMessage &assign ); 40 OQCopMessage &operator = ( const OQCopMessage &assign );
41 41
42 void setChannel ( const QCString &channel ); 42 void setChannel ( const QCString &channel );
43 void setMessage ( const QCString &message ); 43 void setMessage ( const QCString &message );
44 void setData ( const QByteArray &ba ); 44 void setData ( const QByteArray &ba );
45 45
46 QCString channel ( ) const; 46 QCString channel ( ) const;
47 QCString message ( ) const; 47 QCString message ( ) const;
48 QByteArray data ( ) const; 48 QByteArray data ( ) const;
49 49
50 bool isNull()const; 50 bool isNull()const;
51 51
52 bool send ( ); 52 bool send ( );
53 53
54private: 54private:
55 void init ( const QCString &m_channel, const QCString &message, const QByteArray &args ); 55 void init ( const QCString &m_channel, const QCString &message, const QByteArray &args );
56 56
57 Private::OQCopMessageData *d; 57 Internal::OQCopMessageData *d;
58 class Private; 58 class Private;
59 Private* m_data; 59 Private* m_data;
60}; 60};
61 61
62 62
63/** 63/**
64 * This class represents a physical button on a Qtopia device. A device may 64 * This class represents a physical button on a Qtopia device. A device may
65 * have n "user programmable" buttons, which are number 1..n. The location 65 * have n "user programmable" buttons, which are number 1..n. The location
66 * and number of buttons will vary from device to device. userText() and pixmap() 66 * and number of buttons will vary from device to device. userText() and pixmap()
67 * may be used to describe this button to the user in help documentation. 67 * may be used to describe this button to the user in help documentation.
68 * 68 *
69 * @version 1.0 69 * @version 1.0
70 * @author Trolltech 70 * @author Trolltech
71 * @short A representation of buttons 71 * @short A representation of buttons
72 */ 72 */
73 73
74class ODeviceButton 74class ODeviceButton
75{ 75{
76 public: 76 public:
77 ODeviceButton(); 77 ODeviceButton();
78 virtual ~ODeviceButton(); 78 virtual ~ODeviceButton();
79 79
80 ushort keycode ( ) const; 80 ushort keycode ( ) const;
81 QString userText ( ) const; 81 QString userText ( ) const;
diff --git a/libopie2/opiecore/oapplication.cpp b/libopie2/opiecore/oapplication.cpp
index e2f6e82..ac7cd5a 100644
--- a/libopie2/opiecore/oapplication.cpp
+++ b/libopie2/opiecore/oapplication.cpp
@@ -24,95 +24,95 @@
24    --        :-=` this library; see the file COPYING.LIB. 24    --        :-=` this library; see the file COPYING.LIB.
25 If not, write to the Free Software Foundation, 25 If not, write to the Free Software Foundation,
26 Inc., 59 Temple Place - Suite 330, 26 Inc., 59 Temple Place - Suite 330,
27 Boston, MA 02111-1307, USA. 27 Boston, MA 02111-1307, USA.
28*/ 28*/
29 29
30#include <opie2/oapplication.h> 30#include <opie2/oapplication.h>
31#include <opie2/oconfig.h> 31#include <opie2/oconfig.h>
32#include <opie2/odebug.h> 32#include <opie2/odebug.h>
33 33
34#include <signal.h> 34#include <signal.h>
35#include <stdio.h> 35#include <stdio.h>
36 36
37using namespace Opie::Core; 37using namespace Opie::Core;
38 38
39 39
40OApplication* OApplication::_instance = 0; 40OApplication* OApplication::_instance = 0;
41 41
42/************************************************************************************************** 42/**************************************************************************************************
43 * OApplicationPrivate 43 * OApplicationPrivate
44 **************************************************************************************************/ 44 **************************************************************************************************/
45 45
46namespace Opie { 46namespace Opie {
47namespace Core { 47namespace Core {
48namespace Private { 48namespace Internal {
49class OApplicationPrivate 49class OApplicationPrivate
50{ 50{
51 public: 51 public:
52 OApplicationPrivate() {}; 52 OApplicationPrivate() {};
53 ~OApplicationPrivate() {}; 53 ~OApplicationPrivate() {};
54}; 54};
55} 55}
56 56
57/************************************************************************************************** 57/**************************************************************************************************
58 * OApplication 58 * OApplication
59 **************************************************************************************************/ 59 **************************************************************************************************/
60 60
61 61
62OApplication::OApplication( int& argc, char** argv, const QCString& rAppName ) 62OApplication::OApplication( int& argc, char** argv, const QCString& rAppName )
63 :QPEApplication( argc, argv ), 63 :QPEApplication( argc, argv ),
64 _appname( rAppName ), 64 _appname( rAppName ),
65 _config( 0 ) 65 _config( 0 )
66{ 66{
67 init(); 67 init();
68} 68}
69 69
70 70
71OApplication::~OApplication() 71OApplication::~OApplication()
72{ 72{
73 delete d; 73 delete d;
74 if ( _config ) 74 if ( _config )
75 delete _config; 75 delete _config;
76 OApplication::_instance = 0; 76 OApplication::_instance = 0;
77 // after deconstruction of the one-and-only application object, 77 // after deconstruction of the one-and-only application object,
78 // the construction of another object is allowed 78 // the construction of another object is allowed
79} 79}
80 80
81 81
82OConfig* OApplication::config() 82OConfig* OApplication::config()
83{ 83{
84 if ( !_config ) 84 if ( !_config )
85 { 85 {
86 _config = new OConfig( _appname ); 86 _config = new OConfig( _appname );
87 } 87 }
88 return _config; 88 return _config;
89} 89}
90 90
91 91
92void OApplication::init() 92void OApplication::init()
93{ 93{
94 d = new Private::OApplicationPrivate(); 94 d = new Internal::OApplicationPrivate();
95 if ( !OApplication::_instance ) 95 if ( !OApplication::_instance )
96 { 96 {
97 OApplication::_instance = this; 97 OApplication::_instance = this;
98 98
99 /* register SIGSEGV handler to give programs an option 99 /* register SIGSEGV handler to give programs an option
100 * to exit gracefully, e.g. save or close devices or files. 100 * to exit gracefully, e.g. save or close devices or files.
101 struct sigaction sa; 101 struct sigaction sa;
102 sa.sa_handler = ( void (*)(int) ) &segv_handler; 102 sa.sa_handler = ( void (*)(int) ) &segv_handler;
103 sa.sa_flags = SA_SIGINFO | SA_RESTART; 103 sa.sa_flags = SA_SIGINFO | SA_RESTART;
104 sigemptyset(&sa.sa_mask); 104 sigemptyset(&sa.sa_mask);
105 sigaction(SIGSEGV, &sa, NULL); 105 sigaction(SIGSEGV, &sa, NULL);
106 */ 106 */
107 } 107 }
108 else 108 else
109 { 109 {
110 ofatal << "OApplication: Can't create more than one OApplication object. Aborting." << oendl; 110 ofatal << "OApplication: Can't create more than one OApplication object. Aborting." << oendl;
111 //FIXME exit gracefully ? 111 //FIXME exit gracefully ?
112 ::exit( -1 ); 112 ::exit( -1 );
113 } 113 }
114} 114}
115 115
116 116
117void OApplication::showMainWidget( QWidget* widget, bool nomax ) 117void OApplication::showMainWidget( QWidget* widget, bool nomax )
118{ 118{
diff --git a/libopie2/opiecore/oapplication.h b/libopie2/opiecore/oapplication.h
index c1e32a6..337fe5e 100644
--- a/libopie2/opiecore/oapplication.h
+++ b/libopie2/opiecore/oapplication.h
@@ -16,49 +16,49 @@
16    : ..    .:,     . . . without even the implied warranty of 16    : ..    .:,     . . . without even the implied warranty of
17    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A 17    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
18  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU 18  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU
19..}^=.=       =       ; Library General Public License for more 19..}^=.=       =       ; Library General Public License for more
20++=   -.     .`     .: details. 20++=   -.     .`     .: details.
21 :     =  ...= . :.=- 21 :     =  ...= . :.=-
22 -.   .:....=;==+<; You should have received a copy of the GNU 22 -.   .:....=;==+<; You should have received a copy of the GNU
23  -_. . .   )=.  = Library General Public License along with 23  -_. . .   )=.  = Library General Public License along with
24    --        :-=` this library; see the file COPYING.LIB. 24    --        :-=` this library; see the file COPYING.LIB.
25 If not, write to the Free Software Foundation, 25 If not, write to the Free Software Foundation,
26 Inc., 59 Temple Place - Suite 330, 26 Inc., 59 Temple Place - Suite 330,
27 Boston, MA 02111-1307, USA. 27 Boston, MA 02111-1307, USA.
28*/ 28*/
29 29
30#ifndef OAPPLICATION_H 30#ifndef OAPPLICATION_H
31#define OAPPLICATION_H 31#define OAPPLICATION_H
32 32
33#define oApp Opie::Core::OApplication::oApplication() 33#define oApp Opie::Core::OApplication::oApplication()
34 34
35 35
36#include <qpe/qpeapplication.h> 36#include <qpe/qpeapplication.h>
37 37
38namespace Opie { 38namespace Opie {
39namespace Core { 39namespace Core {
40namespace Private { 40namespace Internal {
41class OApplicationPrivate; 41class OApplicationPrivate;
42} // private class 42} // private class
43 43
44class OConfig; 44class OConfig;
45 45
46 46
47class OApplication : public QPEApplication 47class OApplication : public QPEApplication
48{ 48{
49 Q_OBJECT 49 Q_OBJECT
50 50
51 public: 51 public:
52 /** 52 /**
53 * Constructor. Parses command-line arguments and sets the window caption. 53 * Constructor. Parses command-line arguments and sets the window caption.
54 * 54 *
55 * @param rAppName application name. Will be used for finding the 55 * @param rAppName application name. Will be used for finding the
56 * associated message, icon and configuration files 56 * associated message, icon and configuration files
57 * 57 *
58 */ 58 */
59 OApplication( int& argc, char** argv, const QCString& rAppName ); 59 OApplication( int& argc, char** argv, const QCString& rAppName );
60 /** 60 /**
61 * Destructor. Destroys the application object and its children. 61 * Destructor. Destroys the application object and its children.
62 */ 62 */
63 virtual ~OApplication(); 63 virtual ~OApplication();
64 /** 64 /**
@@ -81,31 +81,31 @@ class OApplication : public QPEApplication
81 * @returns the application session config object. 81 * @returns the application session config object.
82 * 82 *
83 * @see OConfig 83 * @see OConfig
84 */ 84 */
85 OConfig* config(); 85 OConfig* config();
86 /** 86 /**
87 * Shows the main @a widget and sets the name of the application as window caption. 87 * Shows the main @a widget and sets the name of the application as window caption.
88 */ 88 */
89 virtual void showMainWidget( QWidget* widget, bool nomax = false ); 89 virtual void showMainWidget( QWidget* widget, bool nomax = false );
90 /** 90 /**
91 * Set the application title. The application title will be concatenated 91 * Set the application title. The application title will be concatenated
92 * to the application name given in the constructor. 92 * to the application name given in the constructor.
93 * 93 *
94 * @param title the title. If not given, resets caption to appname 94 * @param title the title. If not given, resets caption to appname
95 */ 95 */
96 virtual void setTitle( const QString& title = QString::null ) const; 96 virtual void setTitle( const QString& title = QString::null ) const;
97 97
98 protected: 98 protected:
99 void init(); 99 void init();
100 100
101 private: 101 private:
102 const QCString _appname; 102 const QCString _appname;
103 static OApplication* _instance; 103 static OApplication* _instance;
104 OConfig* _config; 104 OConfig* _config;
105 Private::OApplicationPrivate* d; 105 Internal::OApplicationPrivate* d;
106}; 106};
107 107
108} // Core 108} // Core
109} // Opie 109} // Opie
110 110
111#endif // OAPPLICATION_H 111#endif // OAPPLICATION_H
diff --git a/libopie2/opiecore/oconfig.h b/libopie2/opiecore/oconfig.h
index 29c1f86..8c3060c 100644
--- a/libopie2/opiecore/oconfig.h
+++ b/libopie2/opiecore/oconfig.h
@@ -46,58 +46,58 @@ namespace Core {
46/** 46/**
47 * A Configuration class based on the Qtopia @ref Config class 47 * A Configuration class based on the Qtopia @ref Config class
48 * featuring additional handling of color and font entries 48 * featuring additional handling of color and font entries
49 */ 49 */
50 50
51class OConfig : public Config 51class OConfig : public Config
52{ 52{
53 public: 53 public:
54 /** 54 /**
55 * Constructs a OConfig object with a @a name. 55 * Constructs a OConfig object with a @a name.
56 */ 56 */
57 OConfig( const QString &name, Domain domain = User ); 57 OConfig( const QString &name, Domain domain = User );
58 /** 58 /**
59 * Destructs the OConfig object. 59 * Destructs the OConfig object.
60 * 60 *
61 * Writes back any dirty configuration entries, and destroys 61 * Writes back any dirty configuration entries, and destroys
62 * dynamically created objects. 62 * dynamically created objects.
63 */ 63 */
64 virtual ~OConfig(); 64 virtual ~OConfig();
65 /** 65 /**
66 * @returns the name of the current group. 66 * @returns the name of the current group.
67 * The current group is used for searching keys and accessing entries. 67 * The current group is used for searching keys and accessing entries.
68 * @todo make const 68 * @todo make const
69 */ 69 */
70 const QString& group() { return git.key(); }; 70 const QString& group()const { return git.key(); };
71 /** 71 /**
72 * @returns a @ref QColor entry or a @a default value if the key is not found. 72 * @returns a @ref QColor entry or a @a default value if the key is not found.
73 */ 73 */
74 QColor readColorEntry( const QString& key, const QColor* pDefault ) const; 74 QColor readColorEntry( const QString& key, const QColor* pDefault ) const;
75 /** 75 /**
76 * @returns a @ref QFont value or a @a default value if the key is not found. 76 * @returns a @ref QFont value or a @a default value if the key is not found.
77 */ 77 */
78 QFont readFontEntry( const QString& key, const QFont* pDefault ) const; 78 QFont readFontEntry( const QString& key, const QFont* pDefault ) const;
79 79
80private: 80private:
81 class Private; 81 class Private;
82 Private *d; 82 Private *d;
83}; 83};
84 84
85/** 85/**
86 * @brief Helper class for easier use of OConfig groups. 86 * @brief Helper class for easier use of OConfig groups.
87 * 87 *
88 * Careful programmers always set the group of a 88 * Careful programmers always set the group of a
89 * @ref OConfig object to the group they want to read from 89 * @ref OConfig object to the group they want to read from
90 * and set it back to the old one of afterwards. This is usually 90 * and set it back to the old one of afterwards. This is usually
91 * written as: 91 * written as:
92 * <pre> 92 * <pre>
93 * 93 *
94 * QString oldgroup config()->group(); 94 * QString oldgroup config()->group();
95 * config()->setGroup( "TheGroupThatIWant" ); 95 * config()->setGroup( "TheGroupThatIWant" );
96 * ... 96 * ...
97 * config()->writeEntry( "Blah", "Blubb" ); 97 * config()->writeEntry( "Blah", "Blubb" );
98 * 98 *
99 * config()->setGroup( oldgroup ); 99 * config()->setGroup( oldgroup );
100 * </pre> 100 * </pre>
101 * 101 *
102 * In order to facilitate this task, you can use 102 * In order to facilitate this task, you can use
103 * OConfigGroupSaver. Simply construct such an object ON THE STACK 103 * OConfigGroupSaver. Simply construct such an object ON THE STACK
@@ -123,32 +123,32 @@ class OConfigGroupSaver
123 */ 123 */
124 OConfigGroupSaver( OConfig* config, QString group ) :_config(config), _oldgroup(config->group() ) 124 OConfigGroupSaver( OConfig* config, QString group ) :_config(config), _oldgroup(config->group() )
125 { _config->setGroup( group ); } 125 { _config->setGroup( group ); }
126 126
127 OConfigGroupSaver( OConfig* config, const char *group ) :_config(config), _oldgroup(config->group()) 127 OConfigGroupSaver( OConfig* config, const char *group ) :_config(config), _oldgroup(config->group())
128 { _config->setGroup( group ); } 128 { _config->setGroup( group ); }
129 129
130 OConfigGroupSaver( OConfig* config, const QCString &group ) : _config(config), _oldgroup(config->group()) 130 OConfigGroupSaver( OConfig* config, const QCString &group ) : _config(config), _oldgroup(config->group())
131 { _config->setGroup( group ); } 131 { _config->setGroup( group ); }
132 /** 132 /**
133 * Destructor. 133 * Destructor.
134 * Restores the last current group. 134 * Restores the last current group.
135 * @todo make it not inline for bc reasons. See KDE BC guide 135 * @todo make it not inline for bc reasons. See KDE BC guide
136 */ 136 */
137 ~OConfigGroupSaver() { _config->setGroup( _oldgroup ); } 137 ~OConfigGroupSaver() { _config->setGroup( _oldgroup ); }
138 138
139 OConfig* config() { return _config; }; 139 OConfig* config() { return _config; };
140 140
141 private: 141 private:
142 OConfig* _config; 142 OConfig* _config;
143 QString _oldgroup; 143 QString _oldgroup;
144 144
145 OConfigGroupSaver( const OConfigGroupSaver& ); 145 OConfigGroupSaver( const OConfigGroupSaver& );
146 OConfigGroupSaver& operator=( const OConfigGroupSaver& ); 146 OConfigGroupSaver& operator=( const OConfigGroupSaver& );
147 147
148 class Private; 148 class Private;
149 Private *d; 149 Private *d;
150}; 150};
151} 151}
152} 152}
153 153
154#endif // OCONFIG_H 154#endif // OCONFIG_H
diff --git a/libopie2/opiecore/odebug.cpp b/libopie2/opiecore/odebug.cpp
index cac985b..f258faa 100644
--- a/libopie2/opiecore/odebug.cpp
+++ b/libopie2/opiecore/odebug.cpp
@@ -46,48 +46,57 @@
46#include <opie2/oconfig.h> 46#include <opie2/oconfig.h>
47 47
48/* QT */ 48/* QT */
49 49
50#include <qfile.h> 50#include <qfile.h>
51#include <qmessagebox.h> 51#include <qmessagebox.h>
52#include <qsocketdevice.h> 52#include <qsocketdevice.h>
53 53
54/* UNIX */ 54/* UNIX */
55 55
56#include <stdlib.h> // abort 56#include <stdlib.h> // abort
57#include <unistd.h> // getpid 57#include <unistd.h> // getpid
58#include <stdarg.h> // vararg stuff 58#include <stdarg.h> // vararg stuff
59#include <ctype.h> // isprint 59#include <ctype.h> // isprint
60#include <syslog.h> 60#include <syslog.h>
61#include <errno.h> 61#include <errno.h>
62#include <string.h> 62#include <string.h>
63 63
64#ifndef OPIE_NO_BACKTRACE 64#ifndef OPIE_NO_BACKTRACE
65#include <execinfo.h> 65#include <execinfo.h>
66#endif 66#endif
67 67
68namespace Opie { 68namespace Opie {
69namespace Core { 69namespace Core {
70namespace Internal {
71class DebugBackend {
72};
73
74static DebugBackend *backEnd = 0;
75}
76static void clean_up_routine() {
77 delete Internal::backEnd;
78}
70/*====================================================================================== 79/*======================================================================================
71 * debug levels 80 * debug levels
72 *======================================================================================*/ 81 *======================================================================================*/
73 82
74enum DebugLevels { 83enum DebugLevels {
75 ODEBUG_INFO = 0, 84 ODEBUG_INFO = 0,
76 ODEBUG_WARN = 1, 85 ODEBUG_WARN = 1,
77 ODEBUG_ERROR = 2, 86 ODEBUG_ERROR = 2,
78 ODEBUG_FATAL = 3 87 ODEBUG_FATAL = 3
79}; 88};
80 89
81/*====================================================================================== 90/*======================================================================================
82 * oDebug private data 91 * oDebug private data
83 *======================================================================================*/ 92 *======================================================================================*/
84 93
85/*====================================================================================== 94/*======================================================================================
86 * the main debug function 95 * the main debug function
87 *======================================================================================*/ 96 *======================================================================================*/
88 97
89static void oDebugBackend( unsigned short level, unsigned int area, const char *data) 98static void oDebugBackend( unsigned short level, unsigned int area, const char *data)
90{ 99{
91 //qDebug( "oDebugBackend: Level=%d, Area=%d, Data=%s", level, area, data ); 100 //qDebug( "oDebugBackend: Level=%d, Area=%d, Data=%s", level, area, data );
92 101
93 // ML: OPIE doesn't use areacodes at the moment. See the KDE debug classes for an 102 // ML: OPIE doesn't use areacodes at the moment. See the KDE debug classes for an
@@ -601,25 +610,25 @@ QString odBacktrace( int levels )
601 s += QString::number(i) + 610 s += QString::number(i) +
602 QString::fromLatin1(": ") + 611 QString::fromLatin1(": ") +
603 QString::fromLatin1(strings[i]) + QString::fromLatin1("\n"); 612 QString::fromLatin1(strings[i]) + QString::fromLatin1("\n");
604 s += "]\n"; 613 s += "]\n";
605 free (strings); 614 free (strings);
606#endif 615#endif
607 return s; 616 return s;
608} 617}
609 618
610void odClearDebugConfig() 619void odClearDebugConfig()
611{ 620{
612 /* 621 /*
613 delete oDebug_data->config; 622 delete oDebug_data->config;
614 oDebug_data->config = 0; 623 oDebug_data->config = 0;
615 */ 624 */
616} 625}
617 626
618 627
619#ifdef OPIE_NO_DEBUG 628#ifdef OPIE_NO_DEBUG
620#define odDebug ondDebug 629#define odDebug ondDebug
621#define odBacktrace ondBacktrace 630#define odBacktrace ondBacktrace
622#endif 631#endif
623 632
624} 633}
625} \ No newline at end of file 634}
diff --git a/libopie2/opiecore/oprocctrl.cpp b/libopie2/opiecore/oprocctrl.cpp
index 46708ba..404e0b3 100644
--- a/libopie2/opiecore/oprocctrl.cpp
+++ b/libopie2/opiecore/oprocctrl.cpp
@@ -1,68 +1,68 @@
1/* This file is part of the KDE libraries 1/* This file is part of the KDE libraries
2 Copyright (C) 1997 Christian Czezakte (e9025461@student.tuwien.ac.at) 2 Copyright (C) 1997 Christian Czezakte (e9025461@student.tuwien.ac.at)
3 3
4 This library is free software; you can redistribute it and/or 4 This library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Library General Public 5 modify it under the terms of the GNU Library General Public
6 License as published by the Free Software Foundation; either 6 License as published by the Free Software Foundation; either
7 version 2 of the License, or (at your option) any later version. 7 version 2 of the License, or (at your option) any later version.
8 8
9 This library is distributed in the hope that it will be useful, 9 This library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of 10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Library General Public License for more details. 12 Library General Public License for more details.
13 13
14 You should have received a copy of the GNU Library General Public License 14 You should have received a copy of the GNU Library General Public License
15 along with this library; see the file COPYING.LIB. If not, write to 15 along with this library; see the file COPYING.LIB. If not, write to
16 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 16 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17 Boston, MA 02111-1307, USA. 17 Boston, MA 02111-1307, USA.
18*/ 18*/
19// 19//
20// KPROCESSCONTROLLER -- A helper class for KProcess 20// KPROCESSCONTROLLER -- A helper class for KProcess
21// 21//
22// version 0.3.1, Jan, 8th 1997 22// version 0.3.1, Jan, 8th 1997
23// 23//
24// (C) Christian Czezatke 24// (C) Christian Czezatke
25// e9025461@student.tuwien.ac.at 25// e9025461@student.tuwien.ac.at
26// Ported by Holger Freyther 26// Ported by Holger Freyther
27// 27//
28 28
29//#include <config.h> 29//#include <config.h>
30 30
31#include <sys/types.h> 31#include <sys/types.h>
32#include <sys/socket.h> 32#include <sys/socket.h>
33 33
34#include <errno.h> 34#include <errno.h>
35#include <fcntl.h> 35#include <fcntl.h>
36#include <stdio.h> 36#include <stdio.h>
37#include <string.h> 37#include <string.h>
38#include <unistd.h> 38#include <unistd.h>
39#include <assert.h> 39#include <assert.h>
40 40
41#include <qsocketnotifier.h> 41#include <qsocketnotifier.h>
42#include "oprocctrl.h" 42#include "oprocctrl.h"
43 43
44using namespace Opie::Core::Private; 44using namespace Opie::Core::Internal;
45 45
46OProcessController *OProcessController::theOProcessController = 0; 46OProcessController *OProcessController::theOProcessController = 0;
47 47
48struct sigaction OProcessController::oldChildHandlerData; 48struct sigaction OProcessController::oldChildHandlerData;
49bool OProcessController::handlerSet = false; 49bool OProcessController::handlerSet = false;
50 50
51OProcessController::OProcessController() 51OProcessController::OProcessController()
52{ 52{
53 assert( theOProcessController == 0 ); 53 assert( theOProcessController == 0 );
54 54
55 if (0 > pipe(fd)) 55 if (0 > pipe(fd))
56 printf(strerror(errno)); 56 printf(strerror(errno));
57 57
58 notifier = new QSocketNotifier(fd[0], QSocketNotifier::Read); 58 notifier = new QSocketNotifier(fd[0], QSocketNotifier::Read);
59 notifier->setEnabled(true); 59 notifier->setEnabled(true);
60 QObject::connect(notifier, SIGNAL(activated(int)), 60 QObject::connect(notifier, SIGNAL(activated(int)),
61 this, SLOT(slotDoHousekeeping(int))); 61 this, SLOT(slotDoHousekeeping(int)));
62 connect( &delayedChildrenCleanupTimer, SIGNAL( timeout()), 62 connect( &delayedChildrenCleanupTimer, SIGNAL( timeout()),
63 SLOT( delayedChildrenCleanup())); 63 SLOT( delayedChildrenCleanup()));
64 64
65 theOProcessController = this; 65 theOProcessController = this;
66 66
67 setupHandlers(); 67 setupHandlers();
68} 68}
diff --git a/libopie2/opiecore/oprocctrl.h b/libopie2/opiecore/oprocctrl.h
index 4922ba2..ea00859 100644
--- a/libopie2/opiecore/oprocctrl.h
+++ b/libopie2/opiecore/oprocctrl.h
@@ -1,66 +1,66 @@
1/* This file is part of the KDE libraries 1/* This file is part of the KDE libraries
2 Copyright (C) 1997 Christian Czezakte (e9025461@student.tuwien.ac.at) 2 Copyright (C) 1997 Christian Czezakte (e9025461@student.tuwien.ac.at)
3 3
4 This library is free software; you can redistribute it and/or 4 This library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Library General Public 5 modify it under the terms of the GNU Library General Public
6 License as published by the Free Software Foundation; either 6 License as published by the Free Software Foundation; either
7 version 2 of the License, or (at your option) any later version. 7 version 2 of the License, or (at your option) any later version.
8 8
9 This library is distributed in the hope that it will be useful, 9 This library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of 10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Library General Public License for more details. 12 Library General Public License for more details.
13 13
14 You should have received a copy of the GNU Library General Public License 14 You should have received a copy of the GNU Library General Public License
15 along with this library; see the file COPYING.LIB. If not, write to 15 along with this library; see the file COPYING.LIB. If not, write to
16 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 16 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17 Boston, MA 02111-1307, USA. 17 Boston, MA 02111-1307, USA.
18*/ 18*/
19// 19//
20// KPROCESSCONTROLLER -- A helper class for KProcess 20// KPROCESSCONTROLLER -- A helper class for KProcess
21// 21//
22// version 0.3.1, Jan 8th 1997 22// version 0.3.1, Jan 8th 1997
23// 23//
24// (C) Christian Czezatke 24// (C) Christian Czezatke
25// e9025461@student.tuwien.ac.at 25// e9025461@student.tuwien.ac.at
26// Ported by Holger Freyther 26// Ported by Holger Freyther
27// 27//
28 28
29#ifndef __KPROCCTRL_H__ 29#ifndef __KPROCCTRL_H__
30#define __KPROCCTRL_H__ 30#define __KPROCCTRL_H__
31 31
32#include <qvaluelist.h> 32#include <qvaluelist.h>
33#include <qtimer.h> 33#include <qtimer.h>
34 34
35#include "oprocess.h" 35#include "oprocess.h"
36 36
37class QSocketNotifier; 37class QSocketNotifier;
38 38
39 39
40namespace Opie { 40namespace Opie {
41namespace Core { 41namespace Core {
42namespace Private { 42namespace Internal {
43class OProcessControllerPrivate; 43class OProcessControllerPrivate;
44 44
45/** 45/**
46 * @short Used internally by @ref OProcess 46 * @short Used internally by @ref OProcess
47 * @internal 47 * @internal
48 * @author Christian Czezakte <e9025461@student.tuwien.ac.at> 48 * @author Christian Czezakte <e9025461@student.tuwien.ac.at>
49 * 49 *
50 * A class for internal use by OProcess only. -- Exactly one instance 50 * A class for internal use by OProcess only. -- Exactly one instance
51 * of this class is generated by the first instance of OProcess that is 51 * of this class is generated by the first instance of OProcess that is
52 * created (a pointer to it gets stored in @ref theOProcessController ). 52 * created (a pointer to it gets stored in @ref theOProcessController ).
53 * 53 *
54 * This class takes care of the actual (UN*X) signal handling. 54 * This class takes care of the actual (UN*X) signal handling.
55*/ 55*/
56class OProcessController : public QObject 56class OProcessController : public QObject
57{ 57{
58 Q_OBJECT 58 Q_OBJECT
59 59
60public: 60public:
61 OProcessController(); 61 OProcessController();
62 ~OProcessController(); 62 ~OProcessController();
63 //CC: WARNING! Destructor Not virtual (but you don't derive classes from this anyhow...) 63 //CC: WARNING! Destructor Not virtual (but you don't derive classes from this anyhow...)
64 64
65public: 65public:
66 66
diff --git a/libopie2/opiecore/oprocess.cpp b/libopie2/opiecore/oprocess.cpp
index dfde74a..b3f9724 100644
--- a/libopie2/opiecore/oprocess.cpp
+++ b/libopie2/opiecore/oprocess.cpp
@@ -40,53 +40,53 @@ _;:,     .>    :=|. This program is free software; you can
40#include <qmap.h> 40#include <qmap.h>
41#include <qsocketnotifier.h> 41#include <qsocketnotifier.h>
42#include <qtextstream.h> 42#include <qtextstream.h>
43 43
44/* STD */ 44/* STD */
45#include <errno.h> 45#include <errno.h>
46#include <fcntl.h> 46#include <fcntl.h>
47#include <pwd.h> 47#include <pwd.h>
48#include <stdlib.h> 48#include <stdlib.h>
49#include <signal.h> 49#include <signal.h>
50#include <stdio.h> 50#include <stdio.h>
51#include <string.h> 51#include <string.h>
52#include <sys/time.h> 52#include <sys/time.h>
53#include <sys/types.h> 53#include <sys/types.h>
54#include <sys/stat.h> 54#include <sys/stat.h>
55#include <sys/socket.h> 55#include <sys/socket.h>
56#include <unistd.h> 56#include <unistd.h>
57#ifdef HAVE_SYS_SELECT_H 57#ifdef HAVE_SYS_SELECT_H
58#include <sys/select.h> 58#include <sys/select.h>
59#endif 59#endif
60#ifdef HAVE_INITGROUPS 60#ifdef HAVE_INITGROUPS
61#include <grp.h> 61#include <grp.h>
62#endif 62#endif
63 63
64using namespace Opie::Core::Private; 64using namespace Opie::Core::Internal;
65 65
66namespace Opie { 66namespace Opie {
67namespace Core { 67namespace Core {
68namespace Private { 68namespace Internal {
69class OProcessPrivate 69class OProcessPrivate
70{ 70{
71public: 71public:
72 OProcessPrivate() : useShell( false ) 72 OProcessPrivate() : useShell( false )
73 { } 73 { }
74 74
75 bool useShell; 75 bool useShell;
76 QMap<QString, QString> env; 76 QMap<QString, QString> env;
77 QString wd; 77 QString wd;
78 QCString shell; 78 QCString shell;
79}; 79};
80} 80}
81 81
82OProcess::OProcess( QObject *parent, const char *name ) 82OProcess::OProcess( QObject *parent, const char *name )
83 : QObject( parent, name ) 83 : QObject( parent, name )
84{ 84{
85 init ( ); 85 init ( );
86} 86}
87 87
88OProcess::OProcess( const QString &arg0, QObject *parent, const char *name ) 88OProcess::OProcess( const QString &arg0, QObject *parent, const char *name )
89 : QObject( parent, name ) 89 : QObject( parent, name )
90{ 90{
91 init ( ); 91 init ( );
92 *this << arg0; 92 *this << arg0;
diff --git a/libopie2/opiecore/oprocess.h b/libopie2/opiecore/oprocess.h
index e23f98c..be1436c 100644
--- a/libopie2/opiecore/oprocess.h
+++ b/libopie2/opiecore/oprocess.h
@@ -25,49 +25,49 @@ _;:,     .>    :=|. This program is free software; you can
25   --        :-=` this library; see the file COPYING.LIB. 25   --        :-=` this library; see the file COPYING.LIB.
26 If not, write to the Free Software Foundation, 26 If not, write to the Free Software Foundation,
27 Inc., 59 Temple Place - Suite 330, 27 Inc., 59 Temple Place - Suite 330,
28 Boston, MA 02111-1307, USA. 28 Boston, MA 02111-1307, USA.
29*/ 29*/
30 30
31#ifndef OPROCESS_H 31#ifndef OPROCESS_H
32#define OPROCESS_H 32#define OPROCESS_H
33 33
34/* QT */ 34/* QT */
35#include <qcstring.h> 35#include <qcstring.h>
36#include <qobject.h> 36#include <qobject.h>
37#include <qvaluelist.h> 37#include <qvaluelist.h>
38 38
39/* STD */ 39/* STD */
40#include <sys/types.h> // for pid_t 40#include <sys/types.h> // for pid_t
41#include <sys/wait.h> 41#include <sys/wait.h>
42#include <signal.h> 42#include <signal.h>
43#include <unistd.h> 43#include <unistd.h>
44 44
45class QSocketNotifier; 45class QSocketNotifier;
46 46
47namespace Opie { 47namespace Opie {
48namespace Core { 48namespace Core {
49namespace Private { 49namespace Internal {
50class OProcessController; 50class OProcessController;
51class OProcessPrivate; 51class OProcessPrivate;
52} 52}
53 53
54/** 54/**
55 * Child process invocation, monitoring and control. 55 * Child process invocation, monitoring and control.
56 * 56 *
57 * @sect General usage and features 57 * @sect General usage and features
58 * 58 *
59 *This class allows a KDE and OPIE application to start child processes without having 59 *This class allows a KDE and OPIE application to start child processes without having
60 *to worry about UN*X signal handling issues and zombie process reaping. 60 *to worry about UN*X signal handling issues and zombie process reaping.
61 * 61 *
62 *@see KProcIO 62 *@see KProcIO
63 * 63 *
64 *Basically, this class distinguishes three different ways of running 64 *Basically, this class distinguishes three different ways of running
65 *child processes: 65 *child processes:
66 * 66 *
67 *@li OProcess::DontCare -- The child process is invoked and both the child 67 *@li OProcess::DontCare -- The child process is invoked and both the child
68 *process and the parent process continue concurrently. 68 *process and the parent process continue concurrently.
69 * 69 *
70 *Starting a DontCare child process means that the application is 70 *Starting a DontCare child process means that the application is
71 *not interested in any notification to determine whether the 71 *not interested in any notification to determine whether the
72 *child process has already exited or not. 72 *child process has already exited or not.
73 * 73 *
@@ -702,60 +702,60 @@ protected:
702 /** 702 /**
703 * Called by "slotChildOutput" this function copies data arriving from the 703 * Called by "slotChildOutput" this function copies data arriving from the
704 * child process's stdout to the respective buffer and emits the signal 704 * child process's stdout to the respective buffer and emits the signal
705 * "@ref receivedStderr". 705 * "@ref receivedStderr".
706 */ 706 */
707 int childOutput( int fdno ); 707 int childOutput( int fdno );
708 708
709 /** 709 /**
710 * Called by "slotChildOutput" this function copies data arriving from the 710 * Called by "slotChildOutput" this function copies data arriving from the
711 * child process's stdout to the respective buffer and emits the signal 711 * child process's stdout to the respective buffer and emits the signal
712 * "@ref receivedStderr" 712 * "@ref receivedStderr"
713 */ 713 */
714 int childError( int fdno ); 714 int childError( int fdno );
715 715
716 // information about the data that has to be sent to the child: 716 // information about the data that has to be sent to the child:
717 717
718 const char *input_data; // the buffer holding the data 718 const char *input_data; // the buffer holding the data
719 int input_sent; // # of bytes already transmitted 719 int input_sent; // # of bytes already transmitted
720 int input_total; // total length of input_data 720 int input_total; // total length of input_data
721 721
722 /** 722 /**
723 * @ref OProcessController is a friend of OProcess because it has to have 723 * @ref OProcessController is a friend of OProcess because it has to have
724 * access to various data members. 724 * access to various data members.
725 */ 725 */
726 friend class Private::OProcessController; 726 friend class Internal::OProcessController;
727 727
728private: 728private:
729 /** 729 /**
730 * Searches for a valid shell. 730 * Searches for a valid shell.
731 * Here is the algorithm used for finding an executable shell: 731 * Here is the algorithm used for finding an executable shell:
732 * 732 *
733 * @li Try the executable pointed to by the "SHELL" environment 733 * @li Try the executable pointed to by the "SHELL" environment
734 * variable with white spaces stripped off 734 * variable with white spaces stripped off
735 * 735 *
736 * @li If your process runs with uid != euid or gid != egid, a shell 736 * @li If your process runs with uid != euid or gid != egid, a shell
737 * not listed in /etc/shells will not used. 737 * not listed in /etc/shells will not used.
738 * 738 *
739 * @li If no valid shell could be found, "/bin/sh" is used as a last resort. 739 * @li If no valid shell could be found, "/bin/sh" is used as a last resort.
740 */ 740 */
741 QCString searchShell(); 741 QCString searchShell();
742 742
743 /** 743 /**
744 * Used by @ref searchShell in order to find out whether the shell found 744 * Used by @ref searchShell in order to find out whether the shell found
745 * is actually executable at all. 745 * is actually executable at all.
746 */ 746 */
747 bool isExecutable( const QCString &filename ); 747 bool isExecutable( const QCString &filename );
748 748
749 // Disallow assignment and copy-construction 749 // Disallow assignment and copy-construction
750 OProcess( const OProcess& ); 750 OProcess( const OProcess& );
751 OProcess& operator= ( const OProcess& ); 751 OProcess& operator= ( const OProcess& );
752 752
753private: 753private:
754 void init ( ); 754 void init ( );
755 Private::OProcessPrivate *d; 755 Internal::OProcessPrivate *d;
756}; 756};
757} 757}
758} 758}
759 759
760#endif 760#endif
761 761
diff --git a/libopie2/opiedb/osqlitedriver.cpp b/libopie2/opiedb/osqlitedriver.cpp
index 47bc250..2c53248 100644
--- a/libopie2/opiedb/osqlitedriver.cpp
+++ b/libopie2/opiedb/osqlitedriver.cpp
@@ -20,49 +20,49 @@
20++=   -.     .`     .: details. 20++=   -.     .`     .: details.
21 :     =  ...= . :.=- 21 :     =  ...= . :.=-
22 -.   .:....=;==+<; You should have received a copy of the GNU 22 -.   .:....=;==+<; You should have received a copy of the GNU
23  -_. . .   )=.  = Library General Public License along with 23  -_. . .   )=.  = Library General Public License along with
24    --        :-=` this library; see the file COPYING.LIB. 24    --        :-=` this library; see the file COPYING.LIB.
25 If not, write to the Free Software Foundation, 25 If not, write to the Free Software Foundation,
26 Inc., 59 Temple Place - Suite 330, 26 Inc., 59 Temple Place - Suite 330,
27 Boston, MA 02111-1307, USA. 27 Boston, MA 02111-1307, USA.
28 28
29*/ 29*/
30 30
31#include "osqlquery.h" 31#include "osqlquery.h"
32#include "osqlitedriver.h" 32#include "osqlitedriver.h"
33 33
34#include <opie2/odebug.h> 34#include <opie2/odebug.h>
35 35
36#include <stdlib.h> 36#include <stdlib.h>
37 37
38// fromLocal8Bit() does not work as expected. Thus it 38// fromLocal8Bit() does not work as expected. Thus it
39// is replaced by fromLatin1() (eilers) 39// is replaced by fromLatin1() (eilers)
40#define __BUGGY_LOCAL8BIT_ 40#define __BUGGY_LOCAL8BIT_
41 41
42 42
43using namespace Opie::DB; 43using namespace Opie::DB;
44using namespace Opie::DB::Private; 44using namespace Opie::DB::Internal;
45 45
46namespace { 46namespace {
47 struct Query { 47 struct Query {
48 OSQLError::ValueList errors; 48 OSQLError::ValueList errors;
49 OSQLResultItem::ValueList items; 49 OSQLResultItem::ValueList items;
50 OSQLiteDriver *driver; 50 OSQLiteDriver *driver;
51 }; 51 };
52} 52}
53 53
54 54
55OSQLiteDriver::OSQLiteDriver( QLibrary *lib ) 55OSQLiteDriver::OSQLiteDriver( QLibrary *lib )
56 : OSQLDriver( lib ) 56 : OSQLDriver( lib )
57{ 57{
58 m_sqlite = 0l; 58 m_sqlite = 0l;
59} 59}
60 60
61 61
62OSQLiteDriver::~OSQLiteDriver() { 62OSQLiteDriver::~OSQLiteDriver() {
63 close(); 63 close();
64} 64}
65 65
66 66
67QString OSQLiteDriver::id()const { 67QString OSQLiteDriver::id()const {
68 return QString::fromLatin1("SQLite"); 68 return QString::fromLatin1("SQLite");
diff --git a/libopie2/opiedb/osqlitedriver.h b/libopie2/opiedb/osqlitedriver.h
index 3e1325b..9064e52 100644
--- a/libopie2/opiedb/osqlitedriver.h
+++ b/libopie2/opiedb/osqlitedriver.h
@@ -1,36 +1,36 @@
1#ifndef OSQL_LITE_DRIVER_H 1#ifndef OSQL_LITE_DRIVER_H
2#define OSQL_LITE_DRIVER_H 2#define OSQL_LITE_DRIVER_H
3 3
4#include <sqlite.h> 4#include <sqlite.h>
5 5
6#include "osqldriver.h" 6#include "osqldriver.h"
7#include "osqlerror.h" 7#include "osqlerror.h"
8#include "osqlresult.h" 8#include "osqlresult.h"
9 9
10namespace Opie { 10namespace Opie {
11namespace DB { 11namespace DB {
12namespace Private { 12namespace Internal {
13 13
14class OSQLiteDriver : public OSQLDriver { 14class OSQLiteDriver : public OSQLDriver {
15 Q_OBJECT 15 Q_OBJECT
16public: 16public:
17 OSQLiteDriver( QLibrary *lib = 0l ); 17 OSQLiteDriver( QLibrary *lib = 0l );
18 ~OSQLiteDriver(); 18 ~OSQLiteDriver();
19 QString id()const; 19 QString id()const;
20 void setUserName( const QString& ); 20 void setUserName( const QString& );
21 void setPassword( const QString& ); 21 void setPassword( const QString& );
22 void setUrl( const QString& url ); 22 void setUrl( const QString& url );
23 void setOptions( const QStringList& ); 23 void setOptions( const QStringList& );
24 bool open(); 24 bool open();
25 bool close(); 25 bool close();
26 OSQLError lastError(); 26 OSQLError lastError();
27 OSQLResult query( OSQLQuery* ); 27 OSQLResult query( OSQLQuery* );
28 OSQLTable::ValueList tables()const; 28 OSQLTable::ValueList tables()const;
29private: 29private:
30 OSQLError m_lastE; 30 OSQLError m_lastE;
31 OSQLResult m_result; 31 OSQLResult m_result;
32 OSQLResultItem m_items; 32 OSQLResultItem m_items;
33 int handleCallBack( int, char**, char** ); 33 int handleCallBack( int, char**, char** );
34 static int call_back( void*, int, char**, char** ); 34 static int call_back( void*, int, char**, char** );
35 QString m_url; 35 QString m_url;
36 sqlite *m_sqlite; 36 sqlite *m_sqlite;
diff --git a/libopie2/opiedb/osqlmanager.cpp b/libopie2/opiedb/osqlmanager.cpp
index 990d258..a6498df 100644
--- a/libopie2/opiedb/osqlmanager.cpp
+++ b/libopie2/opiedb/osqlmanager.cpp
@@ -12,60 +12,60 @@ OSQLManager::OSQLManager() {
12OSQLBackEnd::ValueList OSQLManager::queryBackEnd() { 12OSQLBackEnd::ValueList OSQLManager::queryBackEnd() {
13 m_list.clear(); 13 m_list.clear();
14 QString opie = QString::fromLatin1( getenv("OPIEDIR") ); 14 QString opie = QString::fromLatin1( getenv("OPIEDIR") );
15 QString qpe = QString::fromLatin1( getenv("QPEDIR") ); 15 QString qpe = QString::fromLatin1( getenv("QPEDIR") );
16 16
17 if ( !m_path.contains(opie) && !opie.isEmpty() ) 17 if ( !m_path.contains(opie) && !opie.isEmpty() )
18 m_path << opie; 18 m_path << opie;
19 if ( !m_path.contains(qpe) && !qpe.isEmpty() ) 19 if ( !m_path.contains(qpe) && !qpe.isEmpty() )
20 m_path << qpe; 20 m_path << qpe;
21 21
22 OSQLBackEndManager mng( m_path ); 22 OSQLBackEndManager mng( m_path );
23 m_list = mng.scan(); 23 m_list = mng.scan();
24 m_list += builtIn(); 24 m_list += builtIn();
25 25
26 return m_list; 26 return m_list;
27} 27}
28/* 28/*
29 * loading dso's is currently not enabled due problems with QLibrary 29 * loading dso's is currently not enabled due problems with QLibrary
30 * beeing in libqpe and not libqte 30 * beeing in libqpe and not libqte
31 */ 31 */
32OSQLDriver* OSQLManager::load( const QString& name ) { 32OSQLDriver* OSQLManager::load( const QString& name ) {
33 OSQLDriver* driver = 0l; 33 OSQLDriver* driver = 0l;
34 34
35 if ( name == "SQLite" ) { 35 if ( name == "SQLite" ) {
36 driver = new Opie::DB::Private::OSQLiteDriver; 36 driver = new Opie::DB::Internal::OSQLiteDriver;
37 } 37 }
38 return driver; 38 return driver;
39} 39}
40/* 40/*
41 * same as above 41 * same as above
42 */ 42 */
43OSQLDriver* OSQLManager::load( const OSQLBackEnd& end) { 43OSQLDriver* OSQLManager::load( const OSQLBackEnd& end) {
44 OSQLDriver *driver = 0l; 44 OSQLDriver *driver = 0l;
45 if ( end.library() == "builtin" && 45 if ( end.library() == "builtin" &&
46 end.name() == "SQLite" ) 46 end.name() == "SQLite" )
47 driver = new Opie::DB::Private::OSQLiteDriver; 47 driver = new Opie::DB::Internal::OSQLiteDriver;
48 48
49 return driver; 49 return driver;
50} 50}
51/* 51/*
52 * let's find the a default with the highes preference 52 * let's find the a default with the highes preference
53 */ 53 */
54OSQLDriver* OSQLManager::standard() { 54OSQLDriver* OSQLManager::standard() {
55 OSQLDriver* driver =0l; 55 OSQLDriver* driver =0l;
56 if ( m_list.isEmpty() ) queryBackEnd(); 56 if ( m_list.isEmpty() ) queryBackEnd();
57 OSQLBackEnd::ValueList::Iterator it; 57 OSQLBackEnd::ValueList::Iterator it;
58 OSQLBackEnd back; 58 OSQLBackEnd back;
59 for ( it = m_list.begin(); it != m_list.end(); ++it ) { 59 for ( it = m_list.begin(); it != m_list.end(); ++it ) {
60 if ( (*it).isDefault() && 60 if ( (*it).isDefault() &&
61 back.preference() < (*it).preference() ) { 61 back.preference() < (*it).preference() ) {
62 back = (*it); 62 back = (*it);
63 } 63 }
64 } 64 }
65 driver = load( back ); 65 driver = load( back );
66 return driver; 66 return driver;
67} 67}
68void OSQLManager::registerPath( const QString& path ) { 68void OSQLManager::registerPath( const QString& path ) {
69 m_path << path; 69 m_path << path;
70} 70}
71bool OSQLManager::unregisterPath( const QString& path ) { 71bool OSQLManager::unregisterPath( const QString& path ) {
diff --git a/libopie2/opienet/odebugmapper.cpp b/libopie2/opienet/odebugmapper.cpp
index f679afb..0de1247 100644
--- a/libopie2/opienet/odebugmapper.cpp
+++ b/libopie2/opienet/odebugmapper.cpp
@@ -1,38 +1,38 @@
1 1
2/* 2/*
3 * debug value mapper - generated by regen.py - (C) Michael 'Mickey' Lauer <mickey@vanille.de> 3 * debug value mapper - generated by regen.py - (C) Michael 'Mickey' Lauer <mickey@vanille.de>
4 */ 4 */
5 5
6#include <opie2/odebug.h> 6#include <opie2/odebug.h>
7 7
8#include "odebugmapper.h" 8#include "odebugmapper.h"
9 9
10using namespace Opie::Core; 10using namespace Opie::Core;
11 11
12namespace Opie { 12namespace Opie {
13namespace Net { 13namespace Net {
14namespace Private { 14namespace Internal {
15 15
16DebugMapper::DebugMapper() 16DebugMapper::DebugMapper()
17{ 17{
18 odebug << "DebugMapper::DebugMapper()" << oendl; 18 odebug << "DebugMapper::DebugMapper()" << oendl;
19 19
20 20
21 _map.insert( 0x8902, new QString("SIOCSPGRP") ); 21 _map.insert( 0x8902, new QString("SIOCSPGRP") );
22 _map.insert( 0x8904, new QString("SIOCGPGRP") ); 22 _map.insert( 0x8904, new QString("SIOCGPGRP") );
23 _map.insert( 0x8905, new QString("SIOCATMARK") ); 23 _map.insert( 0x8905, new QString("SIOCATMARK") );
24 _map.insert( 0x8906, new QString("SIOCGSTAMP") ); 24 _map.insert( 0x8906, new QString("SIOCGSTAMP") );
25 _map.insert( 0x890B, new QString("SIOCADDRT") ); 25 _map.insert( 0x890B, new QString("SIOCADDRT") );
26 _map.insert( 0x890C, new QString("SIOCDELRT") ); 26 _map.insert( 0x890C, new QString("SIOCDELRT") );
27 _map.insert( 0x890D, new QString("SIOCRTMSG") ); 27 _map.insert( 0x890D, new QString("SIOCRTMSG") );
28 _map.insert( 0x8910, new QString("SIOCGIFNAME") ); 28 _map.insert( 0x8910, new QString("SIOCGIFNAME") );
29 _map.insert( 0x8911, new QString("SIOCSIFLINK") ); 29 _map.insert( 0x8911, new QString("SIOCSIFLINK") );
30 _map.insert( 0x8912, new QString("SIOCGIFCONF") ); 30 _map.insert( 0x8912, new QString("SIOCGIFCONF") );
31 _map.insert( 0x8913, new QString("SIOCGIFFLAGS") ); 31 _map.insert( 0x8913, new QString("SIOCGIFFLAGS") );
32 _map.insert( 0x8914, new QString("SIOCSIFFLAGS") ); 32 _map.insert( 0x8914, new QString("SIOCSIFFLAGS") );
33 _map.insert( 0x8915, new QString("SIOCGIFADDR") ); 33 _map.insert( 0x8915, new QString("SIOCGIFADDR") );
34 _map.insert( 0x8916, new QString("SIOCSIFADDR") ); 34 _map.insert( 0x8916, new QString("SIOCSIFADDR") );
35 _map.insert( 0x8917, new QString("SIOCGIFDSTADDR") ); 35 _map.insert( 0x8917, new QString("SIOCGIFDSTADDR") );
36 _map.insert( 0x8918, new QString("SIOCSIFDSTADDR") ); 36 _map.insert( 0x8918, new QString("SIOCSIFDSTADDR") );
37 _map.insert( 0x8919, new QString("SIOCGIFBRDADDR") ); 37 _map.insert( 0x8919, new QString("SIOCGIFBRDADDR") );
38 _map.insert( 0x891a, new QString("SIOCSIFBRDADDR") ); 38 _map.insert( 0x891a, new QString("SIOCSIFBRDADDR") );
diff --git a/libopie2/opienet/odebugmapper.h b/libopie2/opienet/odebugmapper.h
index f47db47..79fb42e 100644
--- a/libopie2/opienet/odebugmapper.h
+++ b/libopie2/opienet/odebugmapper.h
@@ -1,36 +1,36 @@
1 1
2/* 2/*
3 * debug value mapper - generated by regen.py - (C) Michael 'Mickey' Lauer <mickey@vanille.de> 3 * debug value mapper - generated by regen.py - (C) Michael 'Mickey' Lauer <mickey@vanille.de>
4 */ 4 */
5 5
6#ifndef DEBUGMAPPER_H 6#ifndef DEBUGMAPPER_H
7#define DEBUGMAPPER_H 7#define DEBUGMAPPER_H
8 8
9#include <qstring.h> 9#include <qstring.h>
10#include <qintdict.h> 10#include <qintdict.h>
11 11
12namespace Opie { 12namespace Opie {
13namespace Net { 13namespace Net {
14namespace Private { 14namespace Internal {
15 15
16typedef QIntDict<QString> IntStringMap; 16typedef QIntDict<QString> IntStringMap;
17 17
18class DebugMapper 18class DebugMapper
19{ 19{
20 public: 20 public:
21 DebugMapper(); 21 DebugMapper();
22 ~DebugMapper(); 22 ~DebugMapper();
23 23
24 const QString& map( int value ) const; 24 const QString& map( int value ) const;
25 private: 25 private:
26 IntStringMap _map; 26 IntStringMap _map;
27 class Private; 27 class Private;
28 Private *d; 28 Private *d;
29}; 29};
30 30
31} 31}
32} 32}
33} 33}
34 34
35#endif 35#endif
36 36
diff --git a/libopie2/opienet/onetutils.cpp b/libopie2/opienet/onetutils.cpp
index 7794334..c185805 100644
--- a/libopie2/opienet/onetutils.cpp
+++ b/libopie2/opienet/onetutils.cpp
@@ -169,49 +169,49 @@ int OPrivateIOCTL::numberSetArgs() const
169 return _setargs & IW_PRIV_SIZE_MASK; 169 return _setargs & IW_PRIV_SIZE_MASK;
170} 170}
171 171
172 172
173int OPrivateIOCTL::typeSetArgs() const 173int OPrivateIOCTL::typeSetArgs() const
174{ 174{
175 return _setargs & IW_PRIV_TYPE_MASK >> 12; 175 return _setargs & IW_PRIV_TYPE_MASK >> 12;
176} 176}
177 177
178 178
179void OPrivateIOCTL::invoke() const 179void OPrivateIOCTL::invoke() const
180{ 180{
181 ( (OWirelessNetworkInterface*) parent() )->wioctl( _ioctl ); 181 ( (OWirelessNetworkInterface*) parent() )->wioctl( _ioctl );
182} 182}
183 183
184 184
185void OPrivateIOCTL::setParameter( int num, u_int32_t value ) 185void OPrivateIOCTL::setParameter( int num, u_int32_t value )
186{ 186{
187 u_int32_t* arglist = (u_int32_t*) &( (OWirelessNetworkInterface*) parent() )->_iwr.u.name; 187 u_int32_t* arglist = (u_int32_t*) &( (OWirelessNetworkInterface*) parent() )->_iwr.u.name;
188 arglist[num] = value; 188 arglist[num] = value;
189} 189}
190 190
191 191
192 192
193namespace Private { 193namespace Internal {
194/*====================================================================================== 194/*======================================================================================
195 * assorted functions 195 * assorted functions
196 *======================================================================================*/ 196 *======================================================================================*/
197 197
198void dumpBytes( const unsigned char* data, int num ) 198void dumpBytes( const unsigned char* data, int num )
199{ 199{
200 printf( "Dumping %d bytes @ %0x", num, data ); 200 printf( "Dumping %d bytes @ %0x", num, data );
201 printf( "-------------------------------------------\n" ); 201 printf( "-------------------------------------------\n" );
202 202
203 for ( int i = 0; i < num; ++i ) 203 for ( int i = 0; i < num; ++i )
204 { 204 {
205 printf( "%02x ", data[i] ); 205 printf( "%02x ", data[i] );
206 if ( !((i+1) % 32) ) printf( "\n" ); 206 if ( !((i+1) % 32) ) printf( "\n" );
207 } 207 }
208 printf( "\n\n" ); 208 printf( "\n\n" );
209} 209}
210 210
211 211
212int stringToMode( const QString& mode ) 212int stringToMode( const QString& mode )
213{ 213{
214 if ( mode == "auto" ) return IW_MODE_AUTO; 214 if ( mode == "auto" ) return IW_MODE_AUTO;
215 else if ( mode == "adhoc" ) return IW_MODE_ADHOC; 215 else if ( mode == "adhoc" ) return IW_MODE_ADHOC;
216 else if ( mode == "managed" ) return IW_MODE_INFRA; 216 else if ( mode == "managed" ) return IW_MODE_INFRA;
217 else if ( mode == "master" ) return IW_MODE_MASTER; 217 else if ( mode == "master" ) return IW_MODE_MASTER;
diff --git a/libopie2/opienet/onetutils.h b/libopie2/opienet/onetutils.h
index ca6815d..4a09426 100644
--- a/libopie2/opienet/onetutils.h
+++ b/libopie2/opienet/onetutils.h
@@ -111,49 +111,49 @@ class OPrivateIOCTL : public QObject
111 ~OPrivateIOCTL(); 111 ~OPrivateIOCTL();
112 112
113 int numberGetArgs() const; 113 int numberGetArgs() const;
114 int typeGetArgs() const; 114 int typeGetArgs() const;
115 int numberSetArgs() const; 115 int numberSetArgs() const;
116 int typeSetArgs() const; 116 int typeSetArgs() const;
117 117
118 // FIXME return int? as ::ioctl does? -zecke 118 // FIXME return int? as ::ioctl does? -zecke
119 void invoke() const; 119 void invoke() const;
120 void setParameter( int, u_int32_t ); 120 void setParameter( int, u_int32_t );
121 121
122 private: 122 private:
123 u_int32_t _ioctl; 123 u_int32_t _ioctl;
124 u_int16_t _getargs; 124 u_int16_t _getargs;
125 u_int16_t _setargs; 125 u_int16_t _setargs;
126 126
127 class Private; 127 class Private;
128 Private *d; 128 Private *d;
129}; 129};
130 130
131 /*====================================================================================== 131 /*======================================================================================
132 * Miscellaneous 132 * Miscellaneous
133 *======================================================================================*/ 133 *======================================================================================*/
134 134
135namespace Private { 135namespace Internal {
136void dumpBytes( const unsigned char* data, int num ); 136void dumpBytes( const unsigned char* data, int num );
137QString modeToString( int ); 137QString modeToString( int );
138int stringToMode( const QString& ); 138int stringToMode( const QString& );
139} 139}
140} 140}
141} 141}
142 142
143#define IW_PRIV_TYPE_MASK 0x7000 143#define IW_PRIV_TYPE_MASK 0x7000
144#define IW_PRIV_TYPE_NONE 0x0000 144#define IW_PRIV_TYPE_NONE 0x0000
145#define IW_PRIV_TYPE_BYTE 0x1000 145#define IW_PRIV_TYPE_BYTE 0x1000
146#define IW_PRIV_TYPE_CHAR 0x2000 146#define IW_PRIV_TYPE_CHAR 0x2000
147#define IW_PRIV_TYPE_INT 0x4000 147#define IW_PRIV_TYPE_INT 0x4000
148#define IW_PRIV_TYPE_FLOAT 0x5000 148#define IW_PRIV_TYPE_FLOAT 0x5000
149#define IW_PRIV_TYPE_ADDR 0x6000 149#define IW_PRIV_TYPE_ADDR 0x6000
150#define IW_PRIV_SIZE_FIXED 0x0800 150#define IW_PRIV_SIZE_FIXED 0x0800
151#define IW_PRIV_SIZE_MASK 0x07FF 151#define IW_PRIV_SIZE_MASK 0x07FF
152 152
153#ifndef ARPHRD_IEEE80211 153#ifndef ARPHRD_IEEE80211
154#define ARPHRD_IEEE80211 801 154#define ARPHRD_IEEE80211 801
155#endif 155#endif
156#ifndef ARPHRD_IEEE80211_PRISM 156#ifndef ARPHRD_IEEE80211_PRISM
157#define ARPHRD_IEEE80211_PRISM 802 157#define ARPHRD_IEEE80211_PRISM 802
158#endif 158#endif
159 159
diff --git a/libopie2/opienet/onetwork.cpp b/libopie2/opienet/onetwork.cpp
index 26a6c81..b6c9876 100644
--- a/libopie2/opienet/onetwork.cpp
+++ b/libopie2/opienet/onetwork.cpp
@@ -39,92 +39,92 @@
39#include <qfile.h> 39#include <qfile.h>
40#include <qtextstream.h> 40#include <qtextstream.h>
41 41
42/* UNIX */ 42/* UNIX */
43 43
44#include <assert.h> 44#include <assert.h>
45#include <arpa/inet.h> 45#include <arpa/inet.h>
46#include <errno.h> 46#include <errno.h>
47#include <string.h> 47#include <string.h>
48#include <stdlib.h> 48#include <stdlib.h>
49#include <math.h> 49#include <math.h>
50#include <sys/ioctl.h> 50#include <sys/ioctl.h>
51#include <sys/socket.h> 51#include <sys/socket.h>
52#include <sys/types.h> 52#include <sys/types.h>
53#include <unistd.h> 53#include <unistd.h>
54#include <linux/sockios.h> 54#include <linux/sockios.h>
55#include <net/if_arp.h> 55#include <net/if_arp.h>
56#include <stdarg.h> 56#include <stdarg.h>
57 57
58#ifndef NODEBUG 58#ifndef NODEBUG
59#include <opie2/odebugmapper.h> 59#include <opie2/odebugmapper.h>
60 60
61 61
62using namespace Opie::Core; 62using namespace Opie::Core;
63using namespace Opie::Net::Private; 63using namespace Opie::Net::Internal;
64DebugMapper* debugmapper = new DebugMapper(); 64DebugMapper* debugmapper = new DebugMapper();
65#endif 65#endif
66 66
67/*====================================================================================== 67/*======================================================================================
68 * ONetwork 68 * ONetwork
69 *======================================================================================*/ 69 *======================================================================================*/
70 70
71namespace Opie { 71namespace Opie {
72namespace Net { 72namespace Net {
73ONetwork* ONetwork::_instance = 0; 73ONetwork* ONetwork::_instance = 0;
74 74
75ONetwork::ONetwork() 75ONetwork::ONetwork()
76{ 76{
77 odebug << "ONetwork::ONetwork()" << oendl; 77 odebug << "ONetwork::ONetwork()" << oendl;
78 odebug << "ONetwork: This code has been compiled against Wireless Extensions V" << WIRELESS_EXT << oendl; 78 odebug << "ONetwork: This code has been compiled against Wireless Extensions V" << WIRELESS_EXT << oendl;
79 synchronize(); 79 synchronize();
80} 80}
81 81
82void ONetwork::synchronize() 82void ONetwork::synchronize()
83{ 83{
84 // gather available interfaces by inspecting /proc/net/dev 84 // gather available interfaces by inspecting /proc/net/dev
85 //FIXME: we could use SIOCGIFCONF here, but we aren't interested in virtual (e.g. eth0:0) devices 85 //FIXME: we could use SIOCGIFCONF here, but we aren't interested in virtual (e.g. eth0:0) devices
86 //FIXME: Use SIOCGIFCONF anway, because we can disable listing of aliased devices 86 //FIXME: Use SIOCGIFCONF anway, because we can disable listing of aliased devices
87 //FIXME: Best is use SIOCGIFCONF and if this doesn't work (result=-1), then fallback to parsing /proc/net/dev 87 //FIXME: Best is use SIOCGIFCONF and if this doesn't work (result=-1), then fallback to parsing /proc/net/dev
88 88
89 _interfaces.clear(); 89 _interfaces.clear();
90 QString str; 90 QString str;
91 QFile f( "/proc/net/dev" ); 91 QFile f( "/proc/net/dev" );
92 bool hasFile = f.open( IO_ReadOnly ); 92 bool hasFile = f.open( IO_ReadOnly );
93 if ( !hasFile ) 93 if ( !hasFile )
94 { 94 {
95 odebug << "ONetwork: /proc/net/dev not existing. No network devices available" << oendl; 95 odebug << "ONetwork: /proc/net/dev not existing. No network devices available" << oendl;
96 return; 96 return;
97 } 97 }
98 QTextStream s( &f ); 98 QTextStream s( &f );
99 s.readLine(); 99 s.readLine();
100 s.readLine(); 100 s.readLine();
101 while ( !s.atEnd() ) 101 while ( !s.atEnd() )
102 { 102 {
103 s >> str; 103 s >> str;
104 str.truncate( str.find( ':' ) ); 104 str.truncate( str.find( ':' ) );
105 odebug << "ONetwork: found interface '" << str << "'" << oendl; 105 odebug << "ONetwork: found interface '" << str << "'" << oendl;
106 ONetworkInterface* iface; 106 ONetworkInterface* iface = 0;
107 if ( isWirelessInterface( str ) ) 107 if ( isWirelessInterface( str ) )
108 { 108 {
109 iface = new OWirelessNetworkInterface( this, (const char*) str ); 109 iface = new OWirelessNetworkInterface( this, (const char*) str );
110 odebug << "ONetwork: interface '" << str << "' has Wireless Extensions" << oendl; 110 odebug << "ONetwork: interface '" << str << "' has Wireless Extensions" << oendl;
111 } 111 }
112 else 112 else
113 { 113 {
114 iface = new ONetworkInterface( this, (const char*) str ); 114 iface = new ONetworkInterface( this, (const char*) str );
115 } 115 }
116 _interfaces.insert( str, iface ); 116 _interfaces.insert( str, iface );
117 s.readLine(); 117 s.readLine();
118 } 118 }
119} 119}
120 120
121 121
122short ONetwork::wirelessExtensionVersion() 122short ONetwork::wirelessExtensionVersion()
123{ 123{
124 return WIRELESS_EXT; 124 return WIRELESS_EXT;
125} 125}
126 126
127 127
128int ONetwork::count() const 128int ONetwork::count() const
129{ 129{
130 return _interfaces.count(); 130 return _interfaces.count();
diff --git a/libopie2/opieui/big-screen/obigscreen_p.h b/libopie2/opieui/big-screen/obigscreen_p.h
index a85a56c..baa2bbc 100644
--- a/libopie2/opieui/big-screen/obigscreen_p.h
+++ b/libopie2/opieui/big-screen/obigscreen_p.h
@@ -1,31 +1,31 @@
1#ifndef OPIE_BIG_SCREEN_PRIVATE 1#ifndef OPIE_BIG_SCREEN_PRIVATE
2#define OPIE_BIG_SCREEN_PRIVATE 2#define OPIE_BIG_SCREEN_PRIVATE
3 3
4/* QT */ 4/* QT */
5#include <qstring.h> 5#include <qstring.h>
6 6
7class QWidget; 7class QWidget;
8 8
9namespace Opie { 9namespace Opie {
10namespace Ui { 10namespace Ui {
11namespace Private{ 11namespace Internal{
12 12
13struct OSplitterContainer 13struct OSplitterContainer
14{ 14{
15 bool operator==( const OSplitterContainer& o) const 15 bool operator==( const OSplitterContainer& o) const
16 { 16 {
17 if (widget != o.widget ) return false; 17 if (widget != o.widget ) return false;
18 if (icon != o.icon ) return false; 18 if (icon != o.icon ) return false;
19 if (name != o.name ) return false; 19 if (name != o.name ) return false;
20 return true; 20 return true;
21 } 21 }
22 QWidget* widget; 22 QWidget* widget;
23 QString icon; 23 QString icon;
24 QString name; 24 QString name;
25}; 25};
26 26
27} 27}
28} 28}
29} 29}
30 30
31#endif 31#endif
diff --git a/libopie2/opieui/big-screen/osplitter.cpp b/libopie2/opieui/big-screen/osplitter.cpp
index bcfd3a6..f0287ed 100644
--- a/libopie2/opieui/big-screen/osplitter.cpp
+++ b/libopie2/opieui/big-screen/osplitter.cpp
@@ -15,49 +15,49 @@
15    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A 15    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
16  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU 16  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU
17..}^=.=       =       ; Library General Public License for more 17..}^=.=       =       ; Library General Public License for more
18++=   -.     .`     .: details. 18++=   -.     .`     .: details.
19 :     =  ...= . :.=- 19 :     =  ...= . :.=-
20 -.   .:....=;==+<; You should have received a copy of the GNU 20 -.   .:....=;==+<; You should have received a copy of the GNU
21  -_. . .   )=.  = Library General Public License along with 21  -_. . .   )=.  = Library General Public License along with
22    --        :-=` this library; see the file COPYING.LIB. 22    --        :-=` this library; see the file COPYING.LIB.
23 If not, write to the Free Software Foundation, 23 If not, write to the Free Software Foundation,
24 Inc., 59 Temple Place - Suite 330, 24 Inc., 59 Temple Place - Suite 330,
25 Boston, MA 02111-1307, USA. 25 Boston, MA 02111-1307, USA.
26 26
27*/ 27*/
28 28
29#include "osplitter.h" 29#include "osplitter.h"
30 30
31/* OPIE */ 31/* OPIE */
32#include <opie2/otabwidget.h> 32#include <opie2/otabwidget.h>
33 33
34/* QT */ 34/* QT */
35#include <qvaluelist.h> 35#include <qvaluelist.h>
36#include <qvbox.h> 36#include <qvbox.h>
37 37
38using namespace Opie::Ui; 38using namespace Opie::Ui;
39using namespace Opie::Ui::Private; 39using namespace Opie::Ui::Internal;
40 40
41/** 41/**
42 * 42 *
43 * This is the constructor of OSplitter 43 * This is the constructor of OSplitter
44 * You might want to call setSizeChange to tell 44 * You might want to call setSizeChange to tell
45 * OSplitter to change its layout when a specefic 45 * OSplitter to change its layout when a specefic
46 * mark was crossed. OSplitter sets a default value. 46 * mark was crossed. OSplitter sets a default value.
47 * 47 *
48 * You cann add widget with addWidget to the OSplitter. 48 * You cann add widget with addWidget to the OSplitter.
49 * OSplitter supports also grouping of Splitters where they 49 * OSplitter supports also grouping of Splitters where they
50 * can share one OTabBar in small screen mode. This can be used 50 * can share one OTabBar in small screen mode. This can be used
51 * for email clients like vies but see the example. 51 * for email clients like vies but see the example.
52 * 52 *
53 * @param orient The orientation wether to layout horizontal or vertical 53 * @param orient The orientation wether to layout horizontal or vertical
54 * @param parent The parent of this widget 54 * @param parent The parent of this widget
55 * @param name The name passed on to QObject 55 * @param name The name passed on to QObject
56 * @param fl Additional widgets flags passed to QWidget 56 * @param fl Additional widgets flags passed to QWidget
57 * 57 *
58 * @short single c'tor of the OSplitter 58 * @short single c'tor of the OSplitter
59 */ 59 */
60OSplitter::OSplitter( Orientation orient, QWidget* parent, const char* name, WFlags fl ) 60OSplitter::OSplitter( Orientation orient, QWidget* parent, const char* name, WFlags fl )
61 : QFrame( parent, name, fl ) 61 : QFrame( parent, name, fl )
62{ 62{
63 m_orient = orient; 63 m_orient = orient;
@@ -376,63 +376,63 @@ void OSplitter::resizeEvent( QResizeEvent* res )
376 mode = false; 376 mode = false;
377 } 377 }
378 else if ( (res->size().width() <= m_size_policy && 378 else if ( (res->size().width() <= m_size_policy &&
379 m_orient == Horizontal ) || 379 m_orient == Horizontal ) ||
380 (res->size().height() <= m_size_policy && 380 (res->size().height() <= m_size_policy &&
381 m_orient == Vertical ) ) 381 m_orient == Vertical ) )
382 { 382 {
383 changeTab(); 383 changeTab();
384 } 384 }
385 else if ( res->size().height() > m_size_policy && 385 else if ( res->size().height() > m_size_policy &&
386 m_orient == Vertical ) 386 m_orient == Vertical )
387 { 387 {
388 qWarning("Changng to vbox %s", name() ); 388 qWarning("Changng to vbox %s", name() );
389 changeVBox(); 389 changeVBox();
390 mode = false; 390 mode = false;
391 } 391 }
392 392
393 emit sizeChanged(mode, m_orient ); 393 emit sizeChanged(mode, m_orient );
394} 394}
395 395
396/* 396/*
397 * Adds a container to a tab either the parent tab 397 * Adds a container to a tab either the parent tab
398 * or our own 398 * or our own
399 */ 399 */
400void OSplitter::addToTab( const Opie::Ui::Private::OSplitterContainer& con ) 400void OSplitter::addToTab( const Opie::Ui::Internal::OSplitterContainer& con )
401{ 401{
402 QWidget *wid = con.widget; 402 QWidget *wid = con.widget;
403 // not needed widgetstack will reparent as well wid.reparent(m_tabWidget, wid->getWFlags(), QPoint(0, 0) ); 403 // not needed widgetstack will reparent as well wid.reparent(m_tabWidget, wid->getWFlags(), QPoint(0, 0) );
404 if (m_parentTab ) 404 if (m_parentTab )
405 m_parentTab->addTab( wid, con.icon, con.name ); 405 m_parentTab->addTab( wid, con.icon, con.name );
406 else 406 else
407 m_tabWidget->addTab( wid, con.icon, con.name ); 407 m_tabWidget->addTab( wid, con.icon, con.name );
408} 408}
409 409
410 410
411/* 411/*
412 * adds a container to the box 412 * adds a container to the box
413 */ 413 */
414void OSplitter::addToBox( const Opie::Ui::Private::OSplitterContainer& con ) 414void OSplitter::addToBox( const Opie::Ui::Internal::OSplitterContainer& con )
415{ 415{
416 QWidget* wid = con.widget; 416 QWidget* wid = con.widget;
417 wid->reparent(m_hbox, 0, QPoint(0, 0) ); 417 wid->reparent(m_hbox, 0, QPoint(0, 0) );
418} 418}
419 419
420 420
421/* 421/*
422 * Removes a widget from the tab 422 * Removes a widget from the tab
423 */ 423 */
424void OSplitter::removeFromTab( QWidget* wid ) 424void OSplitter::removeFromTab( QWidget* wid )
425{ 425{
426 if (m_parentTab ) 426 if (m_parentTab )
427 m_parentTab->removePage( wid ); 427 m_parentTab->removePage( wid );
428 else 428 else
429 m_tabWidget->removePage( wid ); 429 m_tabWidget->removePage( wid );
430} 430}
431 431
432/* 432/*
433 * switches over to a OTabWidget layout 433 * switches over to a OTabWidget layout
434 * it is recursive 434 * it is recursive
435 */ 435 */
436void OSplitter::changeTab() 436void OSplitter::changeTab()
437{ 437{
438 /* if we're the owner of the tab widget */ 438 /* if we're the owner of the tab widget */
diff --git a/libopie2/opieui/big-screen/osplitter.h b/libopie2/opieui/big-screen/osplitter.h
index 7b5ea53..46dad05 100644
--- a/libopie2/opieui/big-screen/osplitter.h
+++ b/libopie2/opieui/big-screen/osplitter.h
@@ -52,49 +52,49 @@ namespace Opie{
52namespace Ui { 52namespace Ui {
53class OTabWidget; 53class OTabWidget;
54 54
55/** 55/**
56 * 56 *
57 * If you've widgets that could be placed side by side but you think 57 * If you've widgets that could be placed side by side but you think
58 * on small resolutions is not enough place but it would really make sense 58 * on small resolutions is not enough place but it would really make sense
59 * on bigger resolutions this class will help you. 59 * on bigger resolutions this class will help you.
60 * You can add as many widgets you want to it. Set a poliy on which width/height it 60 * You can add as many widgets you want to it. Set a poliy on which width/height it
61 * should switch the layout. 61 * should switch the layout.
62 * You can either say to place widgets vertical or horizontal. 62 * You can either say to place widgets vertical or horizontal.
63 * This class uses QHBox, QVBox and QTAbWidget internally. 63 * This class uses QHBox, QVBox and QTAbWidget internally.
64 * OSplitter takes ownership of the widgets 64 * OSplitter takes ownership of the widgets
65 * 65 *
66 * @since 1.2 66 * @since 1.2
67 * 67 *
68 * @short a small dynamically changing its layout to store two or more widgets side by side 68 * @short a small dynamically changing its layout to store two or more widgets side by side
69 * @version 0.1 69 * @version 0.1
70 * @author zecke 70 * @author zecke
71 */ 71 */
72class OSplitter : public QFrame 72class OSplitter : public QFrame
73{ 73{
74 Q_OBJECT 74 Q_OBJECT
75public: 75public:
76 typedef QValueList<Opie::Ui::Private::OSplitterContainer> ContainerList; 76 typedef QValueList<Opie::Ui::Internal::OSplitterContainer> ContainerList;
77 OSplitter( Qt::Orientation = Horizontal, QWidget *parent = 0, 77 OSplitter( Qt::Orientation = Horizontal, QWidget *parent = 0,
78 const char* name = 0, WFlags fl = 0 ); 78 const char* name = 0, WFlags fl = 0 );
79 ~OSplitter(); 79 ~OSplitter();
80 80
81 void setLabel( const QString& name ); 81 void setLabel( const QString& name );
82 void setIconName( const QString& name ); 82 void setIconName( const QString& name );
83 QString label()const; 83 QString label()const;
84 QString iconName()const; 84 QString iconName()const;
85 85
86 void setSizeChange( int width_height ); 86 void setSizeChange( int width_height );
87 87
88 void addWidget( OSplitter* splitter ); 88 void addWidget( OSplitter* splitter );
89 void addWidget( QWidget* wid, const QString& icon, const QString& label ); 89 void addWidget( QWidget* wid, const QString& icon, const QString& label );
90 void removeWidget( QWidget* ); 90 void removeWidget( QWidget* );
91 void removeWidget( OSplitter* ); 91 void removeWidget( OSplitter* );
92 92
93 void setCurrentWidget( QWidget* ); 93 void setCurrentWidget( QWidget* );
94 void setCurrentWidget( const QString& label ); 94 void setCurrentWidget( const QString& label );
95 void setCurrentWidget( int ); 95 void setCurrentWidget( int );
96 QWidget* currentWidget()const; 96 QWidget* currentWidget()const;
97 97
98 98
99signals: 99signals:
100 /** 100 /**
@@ -103,49 +103,49 @@ signals:
103 */ 103 */
104 void currentChanged( QWidget* ); 104 void currentChanged( QWidget* );
105 105
106 /** 106 /**
107 * emitted whenever a border is crossed 107 * emitted whenever a border is crossed
108 * true if in small screen mode 108 * true if in small screen mode
109 * false if in bigscreen 109 * false if in bigscreen
110 * this signal is emitted after the layout switch 110 * this signal is emitted after the layout switch
111 * @param b The layout mode 111 * @param b The layout mode
112 * @param ori The orientation 112 * @param ori The orientation
113 */ 113 */
114 void sizeChanged( bool b, Orientation ori); 114 void sizeChanged( bool b, Orientation ori);
115public: 115public:
116 // QSize sizeHint()const; 116 // QSize sizeHint()const;
117 // QSize minimumSizeHint()const; 117 // QSize minimumSizeHint()const;
118 118
119protected: 119protected:
120 void resizeEvent( QResizeEvent* ); 120 void resizeEvent( QResizeEvent* );
121 121
122private: 122private:
123 /* true if OTabMode */ 123 /* true if OTabMode */
124 bool layoutMode()const; 124 bool layoutMode()const;
125 // void reparentAll(); 125 // void reparentAll();
126 void setTabWidget( OTabWidget*); 126 void setTabWidget( OTabWidget*);
127 void addToTab( const Opie::Ui::Private::OSplitterContainer& ); 127 void addToTab( const Opie::Ui::Internal::OSplitterContainer& );
128 void addToBox( const Opie::Ui::Private::OSplitterContainer& ); 128 void addToBox( const Opie::Ui::Internal::OSplitterContainer& );
129 void removeFromTab( QWidget* ); 129 void removeFromTab( QWidget* );
130 void changeTab(); 130 void changeTab();
131 void changeHBox(); 131 void changeHBox();
132 void changeVBox(); 132 void changeVBox();
133 void commonChangeBox(); 133 void commonChangeBox();
134 QHBox *m_hbox; 134 QHBox *m_hbox;
135 OTabWidget *m_tabWidget; 135 OTabWidget *m_tabWidget;
136 OTabWidget *m_parentTab; 136 OTabWidget *m_parentTab;
137 Orientation m_orient; 137 Orientation m_orient;
138 int m_size_policy; 138 int m_size_policy;
139 139
140 ContainerList m_container; 140 ContainerList m_container;
141 QList<OSplitter> m_splitter; 141 QList<OSplitter> m_splitter;
142 142
143 QString m_icon, m_name; 143 QString m_icon, m_name;
144 144
145 struct Private; 145 struct Private;
146 Private *d; 146 Private *d;
147}; 147};
148} 148}
149} 149}
150 150
151#endif 151#endif
diff --git a/libopie2/opieui/fileselector/ofileselector.cpp b/libopie2/opieui/fileselector/ofileselector.cpp
index c4d5033..a9ec8c4 100644
--- a/libopie2/opieui/fileselector/ofileselector.cpp
+++ b/libopie2/opieui/fileselector/ofileselector.cpp
@@ -1,24 +1,25 @@
1
1/* 2/*
2               =. This file is part of the OPIE Project 3               =. This file is part of the OPIE Project
3             .=l. Copyright (C) 2002,2003 Holger Freyther <zecke@handhelds.org> 4             .=l. Copyright (C) 2002,2003 Holger Freyther <zecke@handhelds.org>
4           .>+-= 5           .>+-=
5 _;:,     .>    :=|. This library is free software; you can 6 _;:,     .>    :=|. This library is free software; you can
6.> <`_,   >  .   <= redistribute it and/or modify it under 7.> <`_,   >  .   <= redistribute it and/or modify it under
7:`=1 )Y*s>-.--   : the terms of the GNU Library General Public 8:`=1 )Y*s>-.--   : the terms of the GNU Library General Public
8.="- .-=="i,     .._ License as published by the Free Software 9.="- .-=="i,     .._ License as published by the Free Software
9 - .   .-<_>     .<> Foundation; either version 2 of the License, 10 - .   .-<_>     .<> Foundation; either version 2 of the License,
10     ._= =}       : or (at your option) any later version. 11     ._= =}       : or (at your option) any later version.
11    .%`+i>       _;_. 12    .%`+i>       _;_.
12    .i_,=:_.      -<s. This library is distributed in the hope that 13    .i_,=:_.      -<s. This library is distributed in the hope that
13     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY; 14     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
14    : ..    .:,     . . . without even the implied warranty of 15    : ..    .:,     . . . without even the implied warranty of
15    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A 16    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
16  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU 17  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU
17..}^=.=       =       ; Library General Public License for more 18..}^=.=       =       ; Library General Public License for more
18++=   -.     .`     .: details. 19++=   -.     .`     .: details.
19 :     =  ...= . :.=- 20 :     =  ...= . :.=-
20 -.   .:....=;==+<; You should have received a copy of the GNU 21 -.   .:....=;==+<; You should have received a copy of the GNU
21  -_. . .   )=.  = Library General Public License along with 22  -_. . .   )=.  = Library General Public License along with
22    --        :-=` this library; see the file COPYING.LIB. 23    --        :-=` this library; see the file COPYING.LIB.
23 If not, write to the Free Software Foundation, 24 If not, write to the Free Software Foundation,
24 Inc., 59 Temple Place - Suite 330, 25 Inc., 59 Temple Place - Suite 330,
@@ -34,53 +35,53 @@
34#include "ofileselector_p.h" 35#include "ofileselector_p.h"
35 36
36/* OPIE */ 37/* OPIE */
37#include <opie2/ofileselector.h> 38#include <opie2/ofileselector.h>
38 39
39#include <qpe/qpeapplication.h> 40#include <qpe/qpeapplication.h>
40#include <qpe/mimetype.h> 41#include <qpe/mimetype.h>
41#include <qpe/resource.h> 42#include <qpe/resource.h>
42#include <qpe/storage.h> 43#include <qpe/storage.h>
43 44
44/* QT */ 45/* QT */
45#include <qcombobox.h> 46#include <qcombobox.h>
46#include <qdir.h> 47#include <qdir.h>
47#include <qhbox.h> 48#include <qhbox.h>
48#include <qheader.h> 49#include <qheader.h>
49#include <qlabel.h> 50#include <qlabel.h>
50#include <qlayout.h> 51#include <qlayout.h>
51#include <qlineedit.h> 52#include <qlineedit.h>
52#include <qlistview.h> 53#include <qlistview.h>
53#include <qpopupmenu.h> 54#include <qpopupmenu.h>
54#include <qwidgetstack.h> 55#include <qwidgetstack.h>
55#include <qregexp.h> 56#include <qregexp.h>
56#include <qobjectlist.h> 57#include <qobjectlist.h>
57 58
58using namespace Opie::Ui::Private; 59using namespace Opie::Ui::Internal;
59 60
60namespace Opie { 61namespace Opie {
61namespace Ui { 62namespace Ui {
62namespace Private { 63namespace Internal {
63OFileViewInterface::OFileViewInterface( OFileSelector* selector ) 64OFileViewInterface::OFileViewInterface( OFileSelector* selector )
64 : m_selector( selector ) 65 : m_selector( selector )
65{} 66{}
66 67
67OFileViewInterface::~OFileViewInterface() 68OFileViewInterface::~OFileViewInterface()
68{} 69{}
69 70
70QString OFileViewInterface::name()const 71QString OFileViewInterface::name()const
71{ 72{
72 return m_name; 73 return m_name;
73} 74}
74 75
75void OFileViewInterface::setName( const QString& name ) 76void OFileViewInterface::setName( const QString& name )
76{ 77{
77 m_name = name; 78 m_name = name;
78} 79}
79 80
80OFileSelector* OFileViewInterface::selector()const 81OFileSelector* OFileViewInterface::selector()const
81{ 82{
82 return m_selector; 83 return m_selector;
83} 84}
84 85
85DocLnk OFileViewInterface::selectedDocument()const 86DocLnk OFileViewInterface::selectedDocument()const
86{ 87{
diff --git a/libopie2/opieui/fileselector/ofileselector.h b/libopie2/opieui/fileselector/ofileselector.h
index 2205963..8bcd9ee 100644
--- a/libopie2/opieui/fileselector/ofileselector.h
+++ b/libopie2/opieui/fileselector/ofileselector.h
@@ -34,70 +34,70 @@
34 34
35#ifndef OFILESELECTOR_H 35#ifndef OFILESELECTOR_H
36#define OFILESELECTOR_H 36#define OFILESELECTOR_H
37 37
38/* OPIE */ 38/* OPIE */
39#include <qpe/applnk.h> 39#include <qpe/applnk.h>
40 40
41/* QT */ 41/* QT */
42#include <qlist.h> 42#include <qlist.h>
43#include <qwidget.h> 43#include <qwidget.h>
44#include <qmap.h> 44#include <qmap.h>
45#include <qvaluelist.h> 45#include <qvaluelist.h>
46#include <qstringlist.h> 46#include <qstringlist.h>
47 47
48class QLineEdit; 48class QLineEdit;
49class QComboBox; 49class QComboBox;
50class QWidgetStack; 50class QWidgetStack;
51class QHBox; 51class QHBox;
52 52
53typedef QMap<QString, QStringList> MimeTypes; 53typedef QMap<QString, QStringList> MimeTypes;
54 54
55namespace Opie { 55namespace Opie {
56namespace Ui { 56namespace Ui {
57 57
58namespace Private { 58namespace Internal {
59class OFileViewInterface; 59class OFileViewInterface;
60class OFileViewFileListView; 60class OFileViewFileListView;
61} 61}
62 62
63 63
64/** 64/**
65 * @short a dropin replacement for the FileSelector 65 * @short a dropin replacement for the FileSelector
66 * 66 *
67 * This class is first used insert the OFileDialog. 67 * This class is first used insert the OFileDialog.
68 * It supports multiple view and mimetype filtering for now. 68 * It supports multiple view and mimetype filtering for now.
69 * 69 *
70 * @see OFileDialog 70 * @see OFileDialog
71 * @see FileSelector 71 * @see FileSelector
72 * @author zecke 72 * @author zecke
73 * @version 0.1 73 * @version 0.1
74 */ 74 */
75class OFileSelector : public QWidget 75class OFileSelector : public QWidget
76{ 76{
77 Q_OBJECT 77 Q_OBJECT
78 friend class Private::OFileViewInterface; 78 friend class Internal::OFileViewInterface;
79 friend class Private::OFileViewFileListView; 79 friend class Internal::OFileViewFileListView;
80 80
81public: 81public:
82 /** 82 /**
83 * The Mode of the Fileselector 83 * The Mode of the Fileselector
84 * Open = Open A File 84 * Open = Open A File
85 * Save = Save a File 85 * Save = Save a File
86 * FILESELECTOR = As A GUI in a screen to select a file 86 * FILESELECTOR = As A GUI in a screen to select a file
87 */ 87 */
88 enum Mode { Open=1, Save=2, FileSelector=4, OPEN=1, SAVE=2, FILESELECTOR=4 }; 88 enum Mode { Open=1, Save=2, FileSelector=4, OPEN=1, SAVE=2, FILESELECTOR=4 };
89 // enum OldMode { OPEN=1, SAVE=2, FILESELECTOR = 4 }; 89 // enum OldMode { OPEN=1, SAVE=2, FILESELECTOR = 4 };
90 /** 90 /**
91 * Normal = The old FileSelector 91 * Normal = The old FileSelector
92 * Extended = Dir View 92 * Extended = Dir View
93 * ExtendedAll = Dir View with all hidden files 93 * ExtendedAll = Dir View with all hidden files
94 * Default = What the vendor considers best 94 * Default = What the vendor considers best
95 */ 95 */
96 enum Selector { Normal = 0, Extended=1, ExtendedAll =2, Default=3, NORMAL=0,EXTENDED=1, EXTENDED_ALL =2, DEFAULT=3 }; 96 enum Selector { Normal = 0, Extended=1, ExtendedAll =2, Default=3, NORMAL=0,EXTENDED=1, EXTENDED_ALL =2, DEFAULT=3 };
97 // enum OldSelector { NORMAL = 0, EXTENDED =1, EXTENDED_ALL = 2}; 97 // enum OldSelector { NORMAL = 0, EXTENDED =1, EXTENDED_ALL = 2};
98 98
99 OFileSelector(QWidget* parent, int mode, int selector, 99 OFileSelector(QWidget* parent, int mode, int selector,
100 const QString& dirName, 100 const QString& dirName,
101 const QString& fileName, 101 const QString& fileName,
102 const MimeTypes& mimetypes = MimeTypes(), 102 const MimeTypes& mimetypes = MimeTypes(),
103 bool newVisible = FALSE, bool closeVisible = FALSE ); 103 bool newVisible = FALSE, bool closeVisible = FALSE );
@@ -166,55 +166,55 @@ signals:
166 * in the line edit 166 * in the line edit
167 */ 167 */
168 void ok(); 168 void ok();
169 void cancel(); 169 void cancel();
170 170
171 /* used by the ViewInterface */ 171 /* used by the ViewInterface */
172private: 172private:
173 bool showNew()const; 173 bool showNew()const;
174 bool showClose()const; 174 bool showClose()const;
175 MimeTypes mimeTypes()const; 175 MimeTypes mimeTypes()const;
176 QStringList currentMimeType()const; 176 QStringList currentMimeType()const;
177 177
178private: 178private:
179 /* inits the Widgets */ 179 /* inits the Widgets */
180 void initUI(); 180 void initUI();
181 /* inits the MimeType ComboBox content + connects signals and slots */ 181 /* inits the MimeType ComboBox content + connects signals and slots */
182 void initMime(); 182 void initMime();
183 /* init the Views :) */ 183 /* init the Views :) */
184 void initViews(); 184 void initViews();
185 185
186private: 186private:
187 QLineEdit* m_lneEdit; // the LineEdit for the Name 187 QLineEdit* m_lneEdit; // the LineEdit for the Name
188 QComboBox *m_cmbView, *m_cmbMime; // two ComboBoxes to select the View and MimeType 188 QComboBox *m_cmbView, *m_cmbMime; // two ComboBoxes to select the View and MimeType
189 QWidgetStack* m_stack; // our widget stack which will contain the views 189 QWidgetStack* m_stack; // our widget stack which will contain the views
190 Private::OFileViewInterface* currentView() const; // returns the currentView 190 Internal::OFileViewInterface* currentView() const; // returns the currentView
191 Private::OFileViewInterface* m_current; // here is the view saved 191 Internal::OFileViewInterface* m_current; // here is the view saved
192 bool m_shNew : 1; // should we show New? 192 bool m_shNew : 1; // should we show New?
193 bool m_shClose : 1; // should we show Close? 193 bool m_shClose : 1; // should we show Close?
194 MimeTypes m_mimeType; // list of mimetypes 194 MimeTypes m_mimeType; // list of mimetypes
195 195
196 QMap<QString, Private::OFileViewInterface*> m_views; // QString translated view name + ViewInterface Ptr 196 QMap<QString, Internal::OFileViewInterface*> m_views; // QString translated view name + ViewInterface Ptr
197 QHBox* m_nameBox; // the LineEdit + Label is hold here 197 QHBox* m_nameBox; // the LineEdit + Label is hold here
198 QHBox* m_cmbBox; // this holds the two combo boxes 198 QHBox* m_cmbBox; // this holds the two combo boxes
199 199
200 QString m_startDir; 200 QString m_startDir;
201 int m_mode; 201 int m_mode;
202 int m_selector; 202 int m_selector;
203 203
204 struct Data; // used for future versions 204 struct Data; // used for future versions
205 Data *d; 205 Data *d;
206 206
207private slots: 207private slots:
208 void slotMimeTypeChanged(); 208 void slotMimeTypeChanged();
209 209
210 /* will set the text of the lineedit and emit a fileChanged signal */ 210 /* will set the text of the lineedit and emit a fileChanged signal */
211 void slotDocLnkBridge( const DocLnk& ); 211 void slotDocLnkBridge( const DocLnk& );
212 void slotFileBridge( const QString& ); 212 void slotFileBridge( const QString& );
213 void slotViewChange( const QString& ); 213 void slotViewChange( const QString& );
214 214
215 bool eventFilter (QObject *o, QEvent *e); 215 bool eventFilter (QObject *o, QEvent *e);
216 216
217}; 217};
218 218
219} 219}
220} 220}
diff --git a/libopie2/opieui/fileselector/ofileselector_p.h b/libopie2/opieui/fileselector/ofileselector_p.h
index 376dc98..a3ef8e2 100644
--- a/libopie2/opieui/fileselector/ofileselector_p.h
+++ b/libopie2/opieui/fileselector/ofileselector_p.h
@@ -38,49 +38,49 @@
38#include <qstringlist.h> 38#include <qstringlist.h>
39#include <qwidget.h> 39#include <qwidget.h>
40#include <qlistview.h> 40#include <qlistview.h>
41 41
42/* 42/*
43 * How to avoid having really two different objects 43 * How to avoid having really two different objects
44 * for Extended and ExtendedAll 44 * for Extended and ExtendedAll
45 * The only difference is the Lister... 45 * The only difference is the Lister...
46 * a) static object? 46 * a) static object?
47 * b) leave some object inside the OFileSelector which can be used? 47 * b) leave some object inside the OFileSelector which can be used?
48 * c) when switching views tell which view we want o have.. internally we can switch then 48 * c) when switching views tell which view we want o have.. internally we can switch then
49 * 49 *
50 * I'll take c) -zecke 50 * I'll take c) -zecke
51 */ 51 */
52 52
53typedef QMap<QString, QStringList> MimeTypes; 53typedef QMap<QString, QStringList> MimeTypes;
54 54
55/* the View Interface */ 55/* the View Interface */
56class QFileInfo; 56class QFileInfo;
57class QToolButton; 57class QToolButton;
58 58
59namespace Opie{ 59namespace Opie{
60namespace Ui{ 60namespace Ui{
61class OFileSelector; 61class OFileSelector;
62namespace Private { 62namespace Internal {
63 63
64class OFileViewInterface 64class OFileViewInterface
65{ 65{
66public: 66public:
67 OFileViewInterface( OFileSelector* selector ); 67 OFileViewInterface( OFileSelector* selector );
68 virtual ~OFileViewInterface(); 68 virtual ~OFileViewInterface();
69 virtual QString selectedName()const = 0; 69 virtual QString selectedName()const = 0;
70 virtual QString selectedPath()const = 0; 70 virtual QString selectedPath()const = 0;
71 virtual QString directory()const = 0; 71 virtual QString directory()const = 0;
72 virtual void reread() = 0; 72 virtual void reread() = 0;
73 virtual int fileCount()const = 0; 73 virtual int fileCount()const = 0;
74 virtual DocLnk selectedDocument()const; 74 virtual DocLnk selectedDocument()const;
75 virtual QWidget* widget( QWidget* parent) = 0; 75 virtual QWidget* widget( QWidget* parent) = 0;
76 virtual void activate( const QString& ); 76 virtual void activate( const QString& );
77 QString name()const; 77 QString name()const;
78protected: 78protected:
79 OFileSelector* selector()const; 79 OFileSelector* selector()const;
80 void setName( const QString& ); 80 void setName( const QString& );
81 bool showNew()const; 81 bool showNew()const;
82 bool showClose()const; 82 bool showClose()const;
83 MimeTypes mimeTypes()const; 83 MimeTypes mimeTypes()const;
84 QStringList currentMimeType()const; 84 QStringList currentMimeType()const;
85 QString startDirectory()const; 85 QString startDirectory()const;
86protected: 86protected:
diff --git a/libopie2/opieui/ofontselector.cpp b/libopie2/opieui/ofontselector.cpp
index b19c26e..6763ee6 100644
--- a/libopie2/opieui/ofontselector.cpp
+++ b/libopie2/opieui/ofontselector.cpp
@@ -20,49 +20,49 @@
20++=   -.     .`     .: details. 20++=   -.     .`     .: details.
21 :     =  ...= . :.=- 21 :     =  ...= . :.=-
22 -.   .:....=;==+<; You should have received a copy of the GNU 22 -.   .:....=;==+<; You should have received a copy of the GNU
23  -_. . .   )=.  = Library General Public License along with 23  -_. . .   )=.  = Library General Public License along with
24    --        :-=` this library; see the file COPYING.LIB. 24    --        :-=` this library; see the file COPYING.LIB.
25 If not, write to the Free Software Foundation, 25 If not, write to the Free Software Foundation,
26 Inc., 59 Temple Place - Suite 330, 26 Inc., 59 Temple Place - Suite 330,
27 Boston, MA 02111-1307, USA. 27 Boston, MA 02111-1307, USA.
28*/ 28*/
29 29
30/* OPIE */ 30/* OPIE */
31#include <opie2/ofontselector.h> 31#include <opie2/ofontselector.h>
32#include <qpe/fontdatabase.h> 32#include <qpe/fontdatabase.h>
33 33
34/* QT */ 34/* QT */
35#include <qlayout.h> 35#include <qlayout.h>
36#include <qlistbox.h> 36#include <qlistbox.h>
37#include <qcombobox.h> 37#include <qcombobox.h>
38#include <qlabel.h> 38#include <qlabel.h>
39#include <qmultilineedit.h> 39#include <qmultilineedit.h>
40 40
41 41
42namespace Opie { 42namespace Opie {
43namespace Ui { 43namespace Ui {
44namespace Private { 44namespace Internal {
45 45
46class OFontSelectorPrivate 46class OFontSelectorPrivate
47{ 47{
48public: 48public:
49 QListBox * m_font_family_list; 49 QListBox * m_font_family_list;
50 QComboBox * m_font_style_list; 50 QComboBox * m_font_style_list;
51 QComboBox * m_font_size_list; 51 QComboBox * m_font_size_list;
52 QMultiLineEdit *m_preview; 52 QMultiLineEdit *m_preview;
53 53
54 bool m_pointbug : 1; 54 bool m_pointbug : 1;
55 55
56 FontDatabase m_fdb; 56 FontDatabase m_fdb;
57}; 57};
58 58
59class FontListItem : public QListBoxText 59class FontListItem : public QListBoxText
60{ 60{
61public: 61public:
62 FontListItem ( const QString &t, const QStringList &styles, const QValueList<int> &sizes ) : QListBoxText() 62 FontListItem ( const QString &t, const QStringList &styles, const QValueList<int> &sizes ) : QListBoxText()
63 { 63 {
64 m_name = t; 64 m_name = t;
65 m_styles = styles; 65 m_styles = styles;
66 m_sizes = sizes; 66 m_sizes = sizes;
67 67
68 QString str = t; 68 QString str = t;
@@ -75,49 +75,49 @@ public:
75 return m_name; 75 return m_name;
76 } 76 }
77 77
78 const QStringList &styles() const 78 const QStringList &styles() const
79 { 79 {
80 return m_styles; 80 return m_styles;
81 } 81 }
82 82
83 const QValueList<int> &sizes() const 83 const QValueList<int> &sizes() const
84 { 84 {
85 return m_sizes; 85 return m_sizes;
86 } 86 }
87 87
88private: 88private:
89 QStringList m_styles; 89 QStringList m_styles;
90 QValueList<int> m_sizes; 90 QValueList<int> m_sizes;
91 QString m_name; 91 QString m_name;
92}; 92};
93} 93}
94} 94}
95} 95}
96 96
97 97
98using namespace Opie::Ui; 98using namespace Opie::Ui;
99using namespace Opie::Ui::Private; 99using namespace Opie::Ui::Internal;
100 100
101static int findItemCB( QComboBox *box, const QString &str ) 101static int findItemCB( QComboBox *box, const QString &str )
102{ 102{
103 for ( int i = 0; i < box->count(); i++ ) 103 for ( int i = 0; i < box->count(); i++ )
104 { 104 {
105 if ( box->text ( i ) == str ) 105 if ( box->text ( i ) == str )
106 return i; 106 return i;
107 } 107 }
108 return -1; 108 return -1;
109} 109}
110 110
111/* static same as anon. namespace */ 111/* static same as anon. namespace */
112static int qt_version() 112static int qt_version()
113{ 113{
114 const char *qver = qVersion(); 114 const char *qver = qVersion();
115 115
116 return ( qver [0] - '0' ) * 100 + ( qver [2] - '0' ) * 10 + ( qver [4] - '0' ); 116 return ( qver [0] - '0' ) * 100 + ( qver [2] - '0' ) * 10 + ( qver [4] - '0' );
117} 117}
118 118
119/** 119/**
120 * Constructs the Selector object 120 * Constructs the Selector object
121 * @param withpreview If a font preview should be given 121 * @param withpreview If a font preview should be given
122 * @param parent The parent of the Font Selector 122 * @param parent The parent of the Font Selector
123 * @param name The name of the object 123 * @param name The name of the object
diff --git a/libopie2/opieui/ofontselector.h b/libopie2/opieui/ofontselector.h
index 1d97233..cd134f4 100644
--- a/libopie2/opieui/ofontselector.h
+++ b/libopie2/opieui/ofontselector.h
@@ -16,49 +16,49 @@
16    : ..    .:,     . . . without even the implied warranty of 16    : ..    .:,     . . . without even the implied warranty of
17    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A 17    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
18  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU 18  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU
19..}^=.=       =       ; Library General Public License for more 19..}^=.=       =       ; Library General Public License for more
20++=   -.     .`     .: details. 20++=   -.     .`     .: details.
21 :     =  ...= . :.=- 21 :     =  ...= . :.=-
22 -.   .:....=;==+<; You should have received a copy of the GNU 22 -.   .:....=;==+<; You should have received a copy of the GNU
23  -_. . .   )=.  = Library General Public License along with 23  -_. . .   )=.  = Library General Public License along with
24    --        :-=` this library; see the file COPYING.LIB. 24    --        :-=` this library; see the file COPYING.LIB.
25 If not, write to the Free Software Foundation, 25 If not, write to the Free Software Foundation,
26 Inc., 59 Temple Place - Suite 330, 26 Inc., 59 Temple Place - Suite 330,
27 Boston, MA 02111-1307, USA. 27 Boston, MA 02111-1307, USA.
28*/ 28*/
29 29
30#ifndef OFONTSELECTOR_H 30#ifndef OFONTSELECTOR_H
31#define OFONTSELECTOR_H 31#define OFONTSELECTOR_H
32 32
33/* QT */ 33/* QT */
34#include <qwidget.h> 34#include <qwidget.h>
35 35
36class QListBox; 36class QListBox;
37 37
38namespace Opie { 38namespace Opie {
39namespace Ui { 39namespace Ui {
40namespace Private { 40namespace Internal {
41class OFontSelectorPrivate; 41class OFontSelectorPrivate;
42} 42}
43 43
44/** 44/**
45 * This class lets you chose a Font out of a list of Fonts. 45 * This class lets you chose a Font out of a list of Fonts.
46 * It can show a preview too. This selector will use all available 46 * It can show a preview too. This selector will use all available
47 * fonts 47 * fonts
48 * 48 *
49 * 49 *
50 * @short A widget to select a font 50 * @short A widget to select a font
51 * @see QWidget 51 * @see QWidget
52 * @see QFont 52 * @see QFont
53 * @author Rober Griebl 53 * @author Rober Griebl
54 */ 54 */
55class OFontSelector : public QWidget 55class OFontSelector : public QWidget
56{ 56{
57 Q_OBJECT 57 Q_OBJECT
58 58
59public: 59public:
60 OFontSelector ( bool withpreview, QWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); 60 OFontSelector ( bool withpreview, QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
61 virtual ~OFontSelector ( ); 61 virtual ~OFontSelector ( );
62 62
63 bool selectedFont ( QString &family, QString &style, int &size ); 63 bool selectedFont ( QString &family, QString &style, int &size );
64 bool selectedFont ( QString &family, QString &style, int &size, QString &charset ); 64 bool selectedFont ( QString &family, QString &style, int &size, QString &charset );
@@ -75,32 +75,32 @@ public:
75 75
76signals: 76signals:
77 /** 77 /**
78 * This signal gets emitted when a font got chosen 78 * This signal gets emitted when a font got chosen
79 */ 79 */
80 void fontSelected ( const QFont & ); 80 void fontSelected ( const QFont & );
81 81
82protected slots: 82protected slots:
83 /** @internal */ 83 /** @internal */
84 virtual void fontFamilyClicked ( int ); 84 virtual void fontFamilyClicked ( int );
85 /** @internal */ 85 /** @internal */
86 virtual void fontStyleClicked ( int ); 86 virtual void fontStyleClicked ( int );
87 /** @internal */ 87 /** @internal */
88 virtual void fontSizeClicked ( int ); 88 virtual void fontSizeClicked ( int );
89 89
90protected: 90protected:
91 virtual void resizeEvent ( QResizeEvent *re ); 91 virtual void resizeEvent ( QResizeEvent *re );
92 92
93private: 93private:
94 void loadFonts ( QListBox * ); 94 void loadFonts ( QListBox * );
95 95
96 void changeFont ( ); 96 void changeFont ( );
97 97
98private: 98private:
99 Private::OFontSelectorPrivate *d; 99 Internal::OFontSelectorPrivate *d;
100}; 100};
101 101
102} 102}
103} 103}
104 104
105#endif 105#endif
106 106
diff --git a/libopie2/opieui/okeyconfigwidget.cpp b/libopie2/opieui/okeyconfigwidget.cpp
index ef6d713..eb7acbd 100644
--- a/libopie2/opieui/okeyconfigwidget.cpp
+++ b/libopie2/opieui/okeyconfigwidget.cpp
@@ -453,119 +453,120 @@ bool OKeyConfigItem::operator!=( const OKeyConfigItem& conf )const {
453OKeyConfigManager::OKeyConfigManager( Opie::Core::OConfig* conf, 453OKeyConfigManager::OKeyConfigManager( Opie::Core::OConfig* conf,
454 const QString& group, 454 const QString& group,
455 const OKeyPair::List& black, 455 const OKeyPair::List& black,
456 bool grabkeyboard, QObject* par, 456 bool grabkeyboard, QObject* par,
457 const char* name) 457 const char* name)
458 : QObject( par, name ), m_conf( conf ), m_group( group ), 458 : QObject( par, name ), m_conf( conf ), m_group( group ),
459 m_blackKeys( black ), m_grab( grabkeyboard ), m_map( 0 ){ 459 m_blackKeys( black ), m_grab( grabkeyboard ), m_map( 0 ){
460 if ( m_grab ) 460 if ( m_grab )
461 QPEApplication::grabKeyboard(); 461 QPEApplication::grabKeyboard();
462} 462}
463 463
464 464
465/** 465/**
466 * Destructor 466 * Destructor
467 */ 467 */
468OKeyConfigManager::~OKeyConfigManager() { 468OKeyConfigManager::~OKeyConfigManager() {
469 if ( m_grab ) 469 if ( m_grab )
470 QPEApplication::ungrabKeyboard(); 470 QPEApplication::ungrabKeyboard();
471} 471}
472 472
473/** 473/**
474 * Load the Configuration from the OConfig 474 * Load the Configuration from the OConfig
475 * If a Key is restricted but was in the config we will 475 * If a Key is restricted but was in the config we will
476 * make it be the empty key paur 476 * make it be the empty key paur
477 * We will change the group of the OConfig Item! 477 * We will change the group but restore to the previous.
478 * 478 *
479 * @see OKeyPair::emptyKey 479 * @see OKeyPair::emptyKey
480 */ 480 */
481void OKeyConfigManager::load() { 481void OKeyConfigManager::load() {
482 m_conf->setGroup( m_group ); 482 Opie::Core::OConfigGroupSaver( m_conf, m_group );
483 483
484 /* 484 /*
485 * Read each item 485 * Read each item
486 */ 486 */
487 int key, mod; 487 int key, mod;
488 for( OKeyConfigItem::List::Iterator it = m_keys.begin(); it != m_keys.end(); ++it ) { 488 for( OKeyConfigItem::List::Iterator it = m_keys.begin(); it != m_keys.end(); ++it ) {
489 key = m_conf->readNumEntry( (*it).configKey()+"key", (*it).defaultKeyPair().keycode() ); 489 key = m_conf->readNumEntry( (*it).configKey()+"key", (*it).defaultKeyPair().keycode() );
490 mod = m_conf->readNumEntry( (*it).configKey()+"mod", (*it).defaultKeyPair().modifier() ); 490 mod = m_conf->readNumEntry( (*it).configKey()+"mod", (*it).defaultKeyPair().modifier() );
491 OKeyPair okey( key, mod ); 491 OKeyPair okey( key, mod );
492 492
493 if ( !m_blackKeys.contains( okey ) && key != -1 && mod != -1 ) 493 if ( !m_blackKeys.contains( okey ) && key != -1 && mod != -1 )
494 (*it).setKeyPair( OKeyPair(key, mod) ); 494 (*it).setKeyPair( OKeyPair(key, mod) );
495 else 495 else
496 (*it).setKeyPair( OKeyPair::emptyKey() ); 496 (*it).setKeyPair( OKeyPair::emptyKey() );
497 } 497 }
498 delete m_map; m_map = 0; 498 delete m_map; m_map = 0;
499} 499}
500 500
501/** 501/**
502 * We will save the current configuration 502 * We will save the current configuration
503 * to the OConfig. We will change the group. 503 * to the OConfig. We will change the group but restore
504 * to the previous
504 */ 505 */
505void OKeyConfigManager::save() { 506void OKeyConfigManager::save() {
506 m_conf->setGroup( m_group ); 507 Opie::Core::OConfigGroupSaver( m_conf, m_group );
507 508
508 /* 509 /*
509 * Write each item 510 * Write each item
510 */ 511 */
511 for( OKeyConfigItem::List::Iterator it = m_keys.begin();it != m_keys.end(); ++it ) { 512 for( OKeyConfigItem::List::Iterator it = m_keys.begin();it != m_keys.end(); ++it ) {
512 /* skip empty items */ 513 /* skip empty items */
513 if ( (*it).isEmpty() ) 514 if ( (*it).isEmpty() )
514 continue; 515 continue;
515 OKeyPair pair = (*it).keyPair(); 516 OKeyPair pair = (*it).keyPair();
516 OKeyPair deft = (*it).defaultKeyPair(); 517 OKeyPair deft = (*it).defaultKeyPair();
517 /* 518 /*
518 * don't write if it is the default setting 519 * don't write if it is the default setting
519 * FIXME allow to remove Keys from config 520 * FIXME allow to remove Keys from config
520 if ( (pair.keycode() == deft.keycode()) && 521 if ( (pair.keycode() == deft.keycode()) &&
521 (pair.modifier()== deft.modifier() ) ) 522 (pair.modifier()== deft.modifier() ) )
522 return; 523 return;
523 */ 524 */
524 525
525 m_conf->writeEntry((*it).configKey()+"key", pair.keycode() ); 526 m_conf->writeEntry((*it).configKey()+"key", pair.keycode() );
526 m_conf->writeEntry((*it).configKey()+"mod", pair.modifier() ); 527 m_conf->writeEntry((*it).configKey()+"mod", pair.modifier() );
527 } 528 }
528} 529}
529 530
530/** 531/**
531 * This is function uses a QMap internally but you can have the same keycode 532 * This is function uses a QMap internally but you can have the same keycode
532 * with different modifier key. The behaviour is undefined if you add a OKeyConfigItem 533 * with different modifier key. The behaviour is undefined if you add a OKeyConfigItem
533 * with same keycode and modifier key. The GUI takes care that a user can't 534 * with same keycode and modifier key. The GUI takes care that a user can't
534 * cofigure two keys. 535 * cofigure two keys.
535 * 536 *
536 * Make sure you call e->ignore if you don't want to handle this event 537 * Make sure you call e->ignore if you don't want to handle this event
537 */ 538 */
538OKeyConfigItem OKeyConfigManager::handleKeyEvent( QKeyEvent* e ) { 539OKeyConfigItem OKeyConfigManager::handleKeyEvent( QKeyEvent* e ) {
539 /* 540 /*
540 * Fix Up issues with Qt/E, my keybard, and virtual input 541 * Fix Up issues with Qt/E, my keybard, and virtual input
541 * methods 542 * methods
542 * First my Keyboard delivers 256,512,1024 for shift/ctrl/alt instead of the button state 543 * First my Keyboard delivers 256,512,1024 for shift/ctrl/alt instead of the button state
543 * Also key() on virtual inputmethods are zero and only ascii. We need to fix upper and lower 544 * Also key() on virtual inputmethods are zero and only ascii. We need to fix upper and lower
544 * case ascii 545 * case ascii
545 */ 546 */
546 int key, mod; 547 int key, mod;
547 Opie::Ui::Private::fixupKeys( key, mod, e ); 548 Opie::Ui::Internal::fixupKeys( key, mod, e );
548 549
549 OKeyConfigItem::List _keyList = keyList( key ); 550 OKeyConfigItem::List _keyList = keyList( key );
550 if ( _keyList.isEmpty() ) 551 if ( _keyList.isEmpty() )
551 return OKeyConfigItem(); 552 return OKeyConfigItem();
552 553
553 OKeyConfigItem item; 554 OKeyConfigItem item;
554 for ( OKeyConfigItem::List::Iterator it = _keyList.begin(); it != _keyList.end(); 555 for ( OKeyConfigItem::List::Iterator it = _keyList.begin(); it != _keyList.end();
555 ++it ) { 556 ++it ) {
556 if ( (*it).keyPair().modifier() == mod ) { 557 if ( (*it).keyPair().modifier() == mod ) {
557 item = *it; 558 item = *it;
558 break; 559 break;
559 } 560 }
560 561
561 } 562 }
562 563
563 return item; 564 return item;
564} 565}
565 566
566/** 567/**
567 * Return the associated id of the item or -1 if no item 568 * Return the associated id of the item or -1 if no item
568 * matched the key 569 * matched the key
569 * 570 *
570 * @see handleKeyEvent 571 * @see handleKeyEvent
571 */ 572 */
@@ -695,49 +696,49 @@ OKeyConfigItem::List OKeyConfigManager::keyList( int keycode) {
695 it!= m_keys.end(); ++it ) { 696 it!= m_keys.end(); ++it ) {
696 697
697 bool add = true; 698 bool add = true;
698 /* see if this key is blocked */ 699 /* see if this key is blocked */
699 OKeyPair pair = (*it).keyPair(); 700 OKeyPair pair = (*it).keyPair();
700 for ( OKeyPair::List::Iterator pairIt = m_blackKeys.begin(); 701 for ( OKeyPair::List::Iterator pairIt = m_blackKeys.begin();
701 pairIt != m_blackKeys.end(); ++pairIt ) { 702 pairIt != m_blackKeys.end(); ++pairIt ) {
702 if ( (*pairIt).keycode() == pair.keycode() && 703 if ( (*pairIt).keycode() == pair.keycode() &&
703 (*pairIt).modifier() == pair.modifier() ) { 704 (*pairIt).modifier() == pair.modifier() ) {
704 add = false; 705 add = false;
705 break; 706 break;
706 } 707 }
707 } 708 }
708 /* check if we added it */ 709 /* check if we added it */
709 if ( add ) 710 if ( add )
710 (*m_map)[pair.keycode()].append( *it ); 711 (*m_map)[pair.keycode()].append( *it );
711 } 712 }
712 } 713 }
713 return (*m_map)[keycode]; 714 return (*m_map)[keycode];
714} 715}
715 716
716 717
717namespace Opie { 718namespace Opie {
718namespace Ui { 719namespace Ui {
719namespace Private { 720namespace Internal {
720 721
721 OKeyListViewItem::OKeyListViewItem( const OKeyConfigItem& item, OKeyConfigManager* man, OListViewItem* parent) 722 OKeyListViewItem::OKeyListViewItem( const OKeyConfigItem& item, OKeyConfigManager* man, OListViewItem* parent)
722 : Opie::Ui::OListViewItem( parent ), m_manager( man ) { 723 : Opie::Ui::OListViewItem( parent ), m_manager( man ) {
723 m_origItem = item; 724 m_origItem = item;
724 setItem( item ); 725 setItem( item );
725 } 726 }
726 OKeyListViewItem::~OKeyListViewItem() {} 727 OKeyListViewItem::~OKeyListViewItem() {}
727 OKeyConfigItem &OKeyListViewItem::item(){ 728 OKeyConfigItem &OKeyListViewItem::item(){
728 return m_item; 729 return m_item;
729 } 730 }
730 OKeyConfigItem OKeyListViewItem::origItem() const{ 731 OKeyConfigItem OKeyListViewItem::origItem() const{
731 return m_origItem; 732 return m_origItem;
732 } 733 }
733 OKeyConfigManager* OKeyListViewItem::manager() { 734 OKeyConfigManager* OKeyListViewItem::manager() {
734 return m_manager; 735 return m_manager;
735 } 736 }
736 void OKeyListViewItem::setItem( const OKeyConfigItem& item ) { 737 void OKeyListViewItem::setItem( const OKeyConfigItem& item ) {
737 m_item = item; 738 m_item = item;
738 setPixmap( 0, m_item.pixmap() ); 739 setPixmap( 0, m_item.pixmap() );
739 setText ( 1, m_item.text() ); 740 setText ( 1, m_item.text() );
740 m_item.keyPair().isEmpty() ? setText( 2, QObject::tr( "None" ) ) : 741 m_item.keyPair().isEmpty() ? setText( 2, QObject::tr( "None" ) ) :
741 setText( 2, keyToString( m_item.keyPair() ) ); 742 setText( 2, keyToString( m_item.keyPair() ) );
742 743
743 m_item.defaultKeyPair().isEmpty() ? setText( 3, QObject::tr( "None" ) ) : 744 m_item.defaultKeyPair().isEmpty() ? setText( 3, QObject::tr( "None" ) ) :
@@ -917,214 +918,214 @@ void OKeyConfigWidget::initUi() {
917 918
918/** 919/**
919 * Set the ChangeMode. 920 * Set the ChangeMode.
920 * You need to call this function prior to load 921 * You need to call this function prior to load
921 * If you call this function past load the behaviour is undefined 922 * If you call this function past load the behaviour is undefined
922 * But caling load again is safe 923 * But caling load again is safe
923 */ 924 */
924void OKeyConfigWidget::setChangeMode( enum ChangeMode mode) { 925void OKeyConfigWidget::setChangeMode( enum ChangeMode mode) {
925 m_mode = mode; 926 m_mode = mode;
926} 927}
927 928
928 929
929/** 930/**
930 * return the current mode 931 * return the current mode
931 */ 932 */
932OKeyConfigWidget::ChangeMode OKeyConfigWidget::changeMode()const { 933OKeyConfigWidget::ChangeMode OKeyConfigWidget::changeMode()const {
933 return m_mode; 934 return m_mode;
934} 935}
935 936
936 937
937/** 938/**
938 * insert these items before calling load 939 * insert these items before calling load
939 */ 940 */
940void OKeyConfigWidget::insert( const QString& str, OKeyConfigManager* man ) { 941void OKeyConfigWidget::insert( const QString& str, OKeyConfigManager* man ) {
941 Opie::Ui::Private::OKeyConfigWidgetPrivate root( str, man ); 942 Opie::Ui::Internal::OKeyConfigWidgetPrivate root( str, man );
942 m_list.append(root); 943 m_list.append(root);
943} 944}
944 945
945 946
946/** 947/**
947 * loads the items and allows editing them 948 * loads the items and allows editing them
948 */ 949 */
949void OKeyConfigWidget::load() { 950void OKeyConfigWidget::load() {
950 Opie::Ui::Private::OKeyConfigWidgetPrivateList::Iterator it; 951 Opie::Ui::Internal::OKeyConfigWidgetPrivateList::Iterator it;
951 for ( it = m_list.begin(); it != m_list.end(); ++it ) { 952 for ( it = m_list.begin(); it != m_list.end(); ++it ) {
952 OListViewItem *item = new OListViewItem( m_view, (*it).name ); 953 OListViewItem *item = new OListViewItem( m_view, (*it).name );
953 OKeyConfigItem::List list = (*it).manager->keyConfigList(); 954 OKeyConfigItem::List list = (*it).manager->keyConfigList();
954 for (OKeyConfigItem::List::Iterator keyIt = list.begin(); keyIt != list.end();++keyIt ) 955 for (OKeyConfigItem::List::Iterator keyIt = list.begin(); keyIt != list.end();++keyIt )
955 (void )new Opie::Ui::Private::OKeyListViewItem(*keyIt, (*it).manager, item ); 956 (void )new Opie::Ui::Internal::OKeyListViewItem(*keyIt, (*it).manager, item );
956 957
957 } 958 }
958} 959}
959 960
960/** 961/**
961 * Saves if in Queue Mode. It'll update the supplied 962 * Saves if in Queue Mode. It'll update the supplied
962 * OKeyConfigManager objects. 963 * OKeyConfigManager objects.
963 * If in Queue mode it'll just return 964 * If in Queue mode it'll just return
964 */ 965 */
965void OKeyConfigWidget::save() { 966void OKeyConfigWidget::save() {
966 /* 967 /*
967 * Iterate over all config items 968 * Iterate over all config items
968 */ 969 */
969 QListViewItemIterator it( m_view ); 970 QListViewItemIterator it( m_view );
970 while ( it.current() ) { 971 while ( it.current() ) {
971 if (it.current()->parent() ) { 972 if (it.current()->parent() ) {
972 Opie::Ui::Private::OKeyListViewItem *item = static_cast<Opie::Ui::Private::OKeyListViewItem*>( it.current() ); 973 Opie::Ui::Internal::OKeyListViewItem *item = static_cast<Opie::Ui::Internal::OKeyListViewItem*>( it.current() );
973 OKeyConfigManager *man = item->manager(); 974 OKeyConfigManager *man = item->manager();
974 man->removeKeyConfig( item->origItem() ); 975 man->removeKeyConfig( item->origItem() );
975 man->addKeyConfig( item->item() ); 976 man->addKeyConfig( item->item() );
976 } 977 }
977 ++it; 978 ++it;
978 } 979 }
979 980
980 981
981} 982}
982 983
983 984
984/** 985/**
985 * @internal 986 * @internal
986 */ 987 */
987void OKeyConfigWidget::slotListViewItem( QListViewItem* _item) { 988void OKeyConfigWidget::slotListViewItem( QListViewItem* _item) {
988 if ( !_item || !_item->parent() ) { 989 if ( !_item || !_item->parent() ) {
989 m_box->setEnabled( false ); 990 m_box->setEnabled( false );
990 m_none->setChecked( true ); 991 m_none->setChecked( true );
991 m_btn ->setEnabled( false ); 992 m_btn ->setEnabled( false );
992 m_def ->setChecked( false ); 993 m_def ->setChecked( false );
993 m_cus ->setChecked( false ); 994 m_cus ->setChecked( false );
994 }else{ 995 }else{
995 m_box->setEnabled( true ); 996 m_box->setEnabled( true );
996 Opie::Ui::Private::OKeyListViewItem *item = static_cast<Opie::Ui::Private::OKeyListViewItem*>( _item ); 997 Opie::Ui::Internal::OKeyListViewItem *item = static_cast<Opie::Ui::Internal::OKeyListViewItem*>( _item );
997 OKeyConfigItem keyItem= item->item(); 998 OKeyConfigItem keyItem= item->item();
998 m_lbl->setText( tr("Default: " )+ item->text( 3 ) ); 999 m_lbl->setText( tr("Default: " )+ item->text( 3 ) );
999 if ( keyItem.keyPair().isEmpty() ) { 1000 if ( keyItem.keyPair().isEmpty() ) {
1000 m_none->setChecked( true ); 1001 m_none->setChecked( true );
1001 m_btn ->setEnabled( false ); 1002 m_btn ->setEnabled( false );
1002 m_def ->setChecked( false ); 1003 m_def ->setChecked( false );
1003 m_cus ->setChecked( false ); 1004 m_cus ->setChecked( false );
1004 }else { 1005 }else {
1005 m_none->setChecked( false ); 1006 m_none->setChecked( false );
1006 m_cus ->setChecked( true ); 1007 m_cus ->setChecked( true );
1007 m_btn ->setEnabled( true ); 1008 m_btn ->setEnabled( true );
1008 m_def ->setChecked( false ); 1009 m_def ->setChecked( false );
1009 } 1010 }
1010 } 1011 }
1011} 1012}
1012 1013
1013void OKeyConfigWidget::slotNoKey() { 1014void OKeyConfigWidget::slotNoKey() {
1014 m_none->setChecked( true ); 1015 m_none->setChecked( true );
1015 m_cus ->setChecked( false ); 1016 m_cus ->setChecked( false );
1016 m_btn ->setEnabled( false ); 1017 m_btn ->setEnabled( false );
1017 m_def ->setChecked( false ); 1018 m_def ->setChecked( false );
1018 1019
1019 if ( !m_view->currentItem() || !m_view->currentItem()->parent() ) 1020 if ( !m_view->currentItem() || !m_view->currentItem()->parent() )
1020 return; 1021 return;
1021 1022
1022 1023
1023 1024
1024 /* 1025 /*
1025 * If immediate we need to remove and readd the key 1026 * If immediate we need to remove and readd the key
1026 */ 1027 */
1027 Opie::Ui::Private::OKeyListViewItem *item = static_cast<Opie::Ui::Private::OKeyListViewItem*>(m_view->currentItem()); 1028 Opie::Ui::Internal::OKeyListViewItem *item = static_cast<Opie::Ui::Internal::OKeyListViewItem*>(m_view->currentItem());
1028 updateItem( item, OKeyPair::emptyKey() ); 1029 updateItem( item, OKeyPair::emptyKey() );
1029} 1030}
1030 1031
1031void OKeyConfigWidget::slotDefaultKey() { 1032void OKeyConfigWidget::slotDefaultKey() {
1032 m_none->setChecked( false ); 1033 m_none->setChecked( false );
1033 m_cus ->setChecked( false ); 1034 m_cus ->setChecked( false );
1034 m_btn ->setEnabled( false ); 1035 m_btn ->setEnabled( false );
1035 m_def ->setChecked( true ); 1036 m_def ->setChecked( true );
1036 1037
1037 if ( !m_view->currentItem() || !m_view->currentItem()->parent() ) 1038 if ( !m_view->currentItem() || !m_view->currentItem()->parent() )
1038 return; 1039 return;
1039 1040
1040 Opie::Ui::Private::OKeyListViewItem *item = static_cast<Opie::Ui::Private::OKeyListViewItem*>(m_view->currentItem()); 1041 Opie::Ui::Internal::OKeyListViewItem *item = static_cast<Opie::Ui::Internal::OKeyListViewItem*>(m_view->currentItem());
1041 updateItem( item, item->item().defaultKeyPair() ); 1042 updateItem( item, item->item().defaultKeyPair() );
1042} 1043}
1043 1044
1044void OKeyConfigWidget::slotCustomKey() { 1045void OKeyConfigWidget::slotCustomKey() {
1045 m_cus ->setChecked( true ); 1046 m_cus ->setChecked( true );
1046 m_btn ->setEnabled( true ); 1047 m_btn ->setEnabled( true );
1047 m_def ->setChecked( false ); 1048 m_def ->setChecked( false );
1048 m_none->setChecked( false ); 1049 m_none->setChecked( false );
1049 1050
1050 if ( !m_view->currentItem() || !m_view->currentItem()->parent() ) 1051 if ( !m_view->currentItem() || !m_view->currentItem()->parent() )
1051 return; 1052 return;
1052 1053
1053 1054
1054} 1055}
1055 1056
1056void OKeyConfigWidget::slotConfigure() { 1057void OKeyConfigWidget::slotConfigure() {
1057 if ( !m_view->currentItem() || !m_view->currentItem()->parent() ) 1058 if ( !m_view->currentItem() || !m_view->currentItem()->parent() )
1058 return; 1059 return;
1059 1060
1060 /* FIXME make use of OModalHelper */ 1061 /* FIXME make use of OModalHelper */
1061 OKeyChooserConfigDialog dlg( this, "Dialog Name", true ); 1062 OKeyChooserConfigDialog dlg( this, "Dialog Name", true );
1062 dlg.setCaption(tr("Configure Key")); 1063 dlg.setCaption(tr("Configure Key"));
1063 connect(&dlg, SIGNAL(keyCaptured()), &dlg, SLOT(accept()) ); 1064 connect(&dlg, SIGNAL(keyCaptured()), &dlg, SLOT(accept()) );
1064 1065
1065 if ( QPEApplication::execDialog( &dlg ) == QDialog::Accepted ) { 1066 if ( QPEApplication::execDialog( &dlg ) == QDialog::Accepted ) {
1066 Opie::Ui::Private::OKeyListViewItem *item = static_cast<Opie::Ui::Private::OKeyListViewItem*>(m_view->currentItem()); 1067 Opie::Ui::Internal::OKeyListViewItem *item = static_cast<Opie::Ui::Internal::OKeyListViewItem*>(m_view->currentItem());
1067 updateItem( item, dlg.keyPair() ); 1068 updateItem( item, dlg.keyPair() );
1068 } 1069 }
1069 1070
1070 1071
1071} 1072}
1072 1073
1073bool OKeyConfigWidget::sanityCheck( Opie::Ui::Private::OKeyListViewItem* item, 1074bool OKeyConfigWidget::sanityCheck( Opie::Ui::Internal::OKeyListViewItem* item,
1074 const OKeyPair& newItem ) { 1075 const OKeyPair& newItem ) {
1075 OKeyPair::List bList = item->manager()->blackList(); 1076 OKeyPair::List bList = item->manager()->blackList();
1076 for ( OKeyPair::List::Iterator it = bList.begin(); it != bList.end(); ++it ) { 1077 for ( OKeyPair::List::Iterator it = bList.begin(); it != bList.end(); ++it ) {
1077 /* black list matched */ 1078 /* black list matched */
1078 if ( *it == newItem ) { 1079 if ( *it == newItem ) {
1079 QMessageBox::warning( 0, tr("Key is on BlackList" ), 1080 QMessageBox::warning( 0, tr("Key is on BlackList" ),
1080 tr("<qt>The Key you choose is on the black list " 1081 tr("<qt>The Key you choose is on the black list "
1081 "and may not be used with this manager. Please " 1082 "and may not be used with this manager. Please "
1082 "use a different key.</qt>" ) ); 1083 "use a different key.</qt>" ) );
1083 return false; 1084 return false;
1084 } 1085 }
1085 } 1086 }
1086 /* no we need to check the other items which is dog slow */ 1087 /* no we need to check the other items which is dog slow */
1087 QListViewItemIterator it( item->parent() ); 1088 QListViewItemIterator it( item->parent() );
1088 while ( it.current() ) { 1089 while ( it.current() ) {
1089 /* if not our parent and not us */ 1090 /* if not our parent and not us */
1090 if (it.current()->parent() && it.current() != item) { 1091 if (it.current()->parent() && it.current() != item) {
1091 /* damn already given away*/ 1092 /* damn already given away*/
1092 if ( newItem == static_cast<Opie::Ui::Private::OKeyListViewItem*>(it.current() )->item().keyPair() ) { 1093 if ( newItem == static_cast<Opie::Ui::Internal::OKeyListViewItem*>(it.current() )->item().keyPair() ) {
1093 QMessageBox::warning( 0, tr("Key is already assigned" ), 1094 QMessageBox::warning( 0, tr("Key is already assigned" ),
1094 tr("<qt>The Key you choose is already taken by " 1095 tr("<qt>The Key you choose is already taken by "
1095 "a different Item of your config. Please try" 1096 "a different Item of your config. Please try"
1096 "using a different key.</qt>" ) ); 1097 "using a different key.</qt>" ) );
1097 return false; 1098 return false;
1098 } 1099 }
1099 } 1100 }
1100 ++it; 1101 ++it;
1101 } 1102 }
1102 1103
1103 return true; 1104 return true;
1104} 1105}
1105 1106
1106void OKeyConfigWidget::updateItem( Opie::Ui::Private::OKeyListViewItem *item, 1107void OKeyConfigWidget::updateItem( Opie::Ui::Internal::OKeyListViewItem *item,
1107 const OKeyPair& newItem) { 1108 const OKeyPair& newItem) {
1108 /* sanity check 1109 /* sanity check
1109 * check against the blacklist of the manager 1110 * check against the blacklist of the manager
1110 * check if another item uses this key which is o(n) at least 1111 * check if another item uses this key which is o(n) at least
1111 */ 1112 */
1112 if ( !newItem.isEmpty() && !sanityCheck(item, newItem )) 1113 if ( !newItem.isEmpty() && !sanityCheck(item, newItem ))
1113 return; 1114 return;
1114 1115
1115 1116
1116 1117
1117 /* 1118 /*
1118 * If immediate we need to remove and readd the key 1119 * If immediate we need to remove and readd the key
1119 */ 1120 */
1120 if ( m_mode == Imediate ) 1121 if ( m_mode == Imediate )
1121 item->manager()->removeKeyConfig( item->item() ); 1122 item->manager()->removeKeyConfig( item->item() );
1122 1123
1123 item->item().setKeyPair( newItem ); 1124 item->item().setKeyPair( newItem );
1124 item->updateText(); 1125 item->updateText();
1125 1126
1126 if ( m_mode == Imediate ) 1127 if ( m_mode == Imediate )
1127 item->manager()->addKeyConfig( item->item() ); 1128 item->manager()->addKeyConfig( item->item() );
1128} 1129}
1129 1130
1130 1131
@@ -1144,104 +1145,104 @@ OKeyChooserConfigDialog::OKeyChooserConfigDialog( QWidget* par, const char* nam,
1144 1145
1145 m_lbl = new QLabel( this ); 1146 m_lbl = new QLabel( this );
1146 lay->addWidget( m_lbl ); 1147 lay->addWidget( m_lbl );
1147 m_lbl->setFocusPolicy( NoFocus ); 1148 m_lbl->setFocusPolicy( NoFocus );
1148 1149
1149 m_timer = new QTimer( this ); 1150 m_timer = new QTimer( this );
1150 connect(m_timer, SIGNAL(timeout()), 1151 connect(m_timer, SIGNAL(timeout()),
1151 this, SLOT(slotTimeUp()) ); 1152 this, SLOT(slotTimeUp()) );
1152} 1153}
1153 1154
1154OKeyChooserConfigDialog::~OKeyChooserConfigDialog() { 1155OKeyChooserConfigDialog::~OKeyChooserConfigDialog() {
1155} 1156}
1156 1157
1157Opie::Ui::OKeyPair OKeyChooserConfigDialog::keyPair()const{ 1158Opie::Ui::OKeyPair OKeyChooserConfigDialog::keyPair()const{
1158 return m_keyPair; 1159 return m_keyPair;
1159} 1160}
1160 1161
1161void OKeyChooserConfigDialog::keyPressEvent( QKeyEvent* ev ) { 1162void OKeyChooserConfigDialog::keyPressEvent( QKeyEvent* ev ) {
1162 QDialog::keyPressEvent( ev ); 1163 QDialog::keyPressEvent( ev );
1163 1164
1164 if ( ev->isAutoRepeat() ) 1165 if ( ev->isAutoRepeat() )
1165 return; 1166 return;
1166 1167
1167 int mod, key; 1168 int mod, key;
1168 Opie::Ui::Private::fixupKeys( key,mod, ev ); 1169 Opie::Ui::Internal::fixupKeys( key,mod, ev );
1169 1170
1170 /* either we used software keyboard 1171 /* either we used software keyboard
1171 * or we've true support 1172 * or we've true support
1172 */ 1173 */
1173 if ( !m_virtKey && !ev->key()) { 1174 if ( !m_virtKey && !ev->key()) {
1174 m_virtKey = true; 1175 m_virtKey = true;
1175 m_keyPair = OKeyPair( key, mod ); 1176 m_keyPair = OKeyPair( key, mod );
1176 }else{ 1177 }else{
1177 mod = 0; 1178 mod = 0;
1178 switch( key ) { 1179 switch( key ) {
1179 case Qt::Key_Control: 1180 case Qt::Key_Control:
1180 mod = Qt::ControlButton; 1181 mod = Qt::ControlButton;
1181 break; 1182 break;
1182 case Qt::Key_Shift: 1183 case Qt::Key_Shift:
1183 mod = Qt::ShiftButton; 1184 mod = Qt::ShiftButton;
1184 break; 1185 break;
1185 case Qt::Key_Alt: 1186 case Qt::Key_Alt:
1186 mod = Qt::AltButton; 1187 mod = Qt::AltButton;
1187 break; 1188 break;
1188 default: 1189 default:
1189 break; 1190 break;
1190 } 1191 }
1191 if (mod ) { 1192 if (mod ) {
1192 m_mod |= mod; 1193 m_mod |= mod;
1193 key = 0; 1194 key = 0;
1194 }else 1195 }else
1195 m_key = key; 1196 m_key = key;
1196 1197
1197 if ( ( !mod || m_key || key ) && !m_timer->isActive() ) 1198 if ( ( !mod || m_key || key ) && !m_timer->isActive() )
1198 m_timer->start( 150, true ); 1199 m_timer->start( 150, true );
1199 1200
1200 m_keyPair = OKeyPair( m_key, m_mod ); 1201 m_keyPair = OKeyPair( m_key, m_mod );
1201 } 1202 }
1202 1203
1203 m_lbl->setText( Opie::Ui::Private::keyToString( m_keyPair ) ); 1204 m_lbl->setText( Opie::Ui::Internal::keyToString( m_keyPair ) );
1204 1205
1205} 1206}
1206 1207
1207void OKeyChooserConfigDialog::keyReleaseEvent( QKeyEvent* ev ) { 1208void OKeyChooserConfigDialog::keyReleaseEvent( QKeyEvent* ev ) {
1208 m_timer->stop(); 1209 m_timer->stop();
1209 QDialog::keyPressEvent( ev ); 1210 QDialog::keyPressEvent( ev );
1210 1211
1211 if ( ev->isAutoRepeat() ) 1212 if ( ev->isAutoRepeat() )
1212 return; 1213 return;
1213 1214
1214 1215
1215 if ( m_virtKey && !ev->key()) { 1216 if ( m_virtKey && !ev->key()) {
1216 m_virtKey = false; 1217 m_virtKey = false;
1217 slotTimeUp(); 1218 slotTimeUp();
1218 }else { 1219 }else {
1219 int mod = 0; 1220 int mod = 0;
1220 int key = ev->key(); 1221 int key = ev->key();
1221 switch( key ) { 1222 switch( key ) {
1222 case Qt::Key_Control: 1223 case Qt::Key_Control:
1223 mod = Qt::ControlButton; 1224 mod = Qt::ControlButton;
1224 break; 1225 break;
1225 case Qt::Key_Shift: 1226 case Qt::Key_Shift:
1226 mod = Qt::ShiftButton; 1227 mod = Qt::ShiftButton;
1227 break; 1228 break;
1228 case Qt::Key_Alt: 1229 case Qt::Key_Alt:
1229 mod = Qt::AltButton; 1230 mod = Qt::AltButton;
1230 break; 1231 break;
1231 default: 1232 default:
1232 break; 1233 break;
1233 } 1234 }
1234 if (mod ) 1235 if (mod )
1235 m_mod &= ~mod; 1236 m_mod &= ~mod;
1236 else 1237 else
1237 m_key = key; 1238 m_key = key;
1238 m_keyPair = OKeyPair( m_key, m_mod ); 1239 m_keyPair = OKeyPair( m_key, m_mod );
1239 m_lbl->setText( Opie::Ui::Private::keyToString( m_keyPair ) ); 1240 m_lbl->setText( Opie::Ui::Internal::keyToString( m_keyPair ) );
1240 } 1241 }
1241} 1242}
1242 1243
1243 1244
1244void OKeyChooserConfigDialog::slotTimeUp() { 1245void OKeyChooserConfigDialog::slotTimeUp() {
1245 m_mod = m_key = 0; 1246 m_mod = m_key = 0;
1246 QTimer::singleShot(0, this, SIGNAL(keyCaptured()) ); 1247 QTimer::singleShot(0, this, SIGNAL(keyCaptured()) );
1247} 1248}
diff --git a/libopie2/opieui/okeyconfigwidget.h b/libopie2/opieui/okeyconfigwidget.h
index f75ed99..bb8eb6c 100644
--- a/libopie2/opieui/okeyconfigwidget.h
+++ b/libopie2/opieui/okeyconfigwidget.h
@@ -4,49 +4,49 @@
4 */ 4 */
5 5
6 6
7#ifndef ODP_KEY_CONFIG_WIDGET_H 7#ifndef ODP_KEY_CONFIG_WIDGET_H
8#define ODP_KEY_CONFIG_WIDGET_H 8#define ODP_KEY_CONFIG_WIDGET_H
9 9
10#include <opie2/oconfig.h> 10#include <opie2/oconfig.h>
11#include <opie2/odevice.h> 11#include <opie2/odevice.h>
12 12
13#include <qstring.h> 13#include <qstring.h>
14#include <qpixmap.h> 14#include <qpixmap.h>
15#include <qcstring.h> 15#include <qcstring.h>
16#include <qhbox.h> 16#include <qhbox.h>
17#include <qvaluelist.h> 17#include <qvaluelist.h>
18 18
19class QKeyEvent; 19class QKeyEvent;
20class QLabel; 20class QLabel;
21class QPushButton; 21class QPushButton;
22class QListViewItem; 22class QListViewItem;
23class QRadioButton; 23class QRadioButton;
24class QTimer; 24class QTimer;
25 25
26namespace Opie { 26namespace Opie {
27namespace Ui { 27namespace Ui {
28namespace Private { 28namespace Internal {
29 class OKeyConfigWidgetPrivate; 29 class OKeyConfigWidgetPrivate;
30 typedef QValueList<OKeyConfigWidgetPrivate> OKeyConfigWidgetPrivateList; 30 typedef QValueList<OKeyConfigWidgetPrivate> OKeyConfigWidgetPrivateList;
31 class OKeyListViewItem; 31 class OKeyListViewItem;
32} 32}
33 class OListViewItem; 33 class OListViewItem;
34 class OListView; 34 class OListView;
35 35
36/** 36/**
37 * \brief small class representing a Key with possible modifiers 37 * \brief small class representing a Key with possible modifiers
38 * This class holds information about key code and possible 38 * This class holds information about key code and possible
39 * modifier state. That is the lowest level of the key input 39 * modifier state. That is the lowest level of the key input
40 * functions. 40 * functions.
41 * There are also static methods to get special keys. 41 * There are also static methods to get special keys.
42 * OKeyPair will be used with \see OKeyConfigItem 42 * OKeyPair will be used with \see OKeyConfigItem
43 * 43 *
44 * @since 1.2 44 * @since 1.2
45 */ 45 */
46class OKeyPair { 46class OKeyPair {
47public: 47public:
48 typedef QValueList<OKeyPair> List; 48 typedef QValueList<OKeyPair> List;
49 OKeyPair( int key = -1, int modifier = -1); 49 OKeyPair( int key = -1, int modifier = -1);
50 ~OKeyPair(); 50 ~OKeyPair();
51 51
52 bool operator==( const OKeyPair& )const; 52 bool operator==( const OKeyPair& )const;
@@ -232,55 +232,55 @@ public:
232 /** 232 /**
233 * Immediate Apply the change directly to the underlying OKeyConfigManager 233 * Immediate Apply the change directly to the underlying OKeyConfigManager
234 * Queue Save all items and then apply when you save() 234 * Queue Save all items and then apply when you save()
235 */ 235 */
236 enum ChangeMode { Imediate, Queue }; 236 enum ChangeMode { Imediate, Queue };
237 OKeyConfigWidget( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); 237 OKeyConfigWidget( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
238 ~OKeyConfigWidget(); 238 ~OKeyConfigWidget();
239 239
240 void setChangeMode( enum ChangeMode ); 240 void setChangeMode( enum ChangeMode );
241 ChangeMode changeMode()const; 241 ChangeMode changeMode()const;
242 242
243 void insert( const QString& name, OKeyConfigManager* ); 243 void insert( const QString& name, OKeyConfigManager* );
244 244
245 void load(); 245 void load();
246 void save(); 246 void save();
247 247
248private slots: 248private slots:
249 void slotListViewItem( QListViewItem* ); 249 void slotListViewItem( QListViewItem* );
250 void slotNoKey(); 250 void slotNoKey();
251 void slotDefaultKey(); 251 void slotDefaultKey();
252 void slotCustomKey(); 252 void slotCustomKey();
253 void slotConfigure(); 253 void slotConfigure();
254 254
255private: 255private:
256 static bool sanityCheck( Opie::Ui::Private::OKeyListViewItem* man, 256 static bool sanityCheck( Opie::Ui::Internal::OKeyListViewItem* man,
257 const OKeyPair& newItem ); 257 const OKeyPair& newItem );
258 void updateItem( Opie::Ui::Private::OKeyListViewItem* man, 258 void updateItem( Opie::Ui::Internal::OKeyListViewItem* man,
259 const OKeyPair& newItem); 259 const OKeyPair& newItem);
260 void initUi(); 260 void initUi();
261 Opie::Ui::OListView *m_view; 261 Opie::Ui::OListView *m_view;
262 Opie::Ui::Private::OKeyConfigWidgetPrivateList m_list; 262 Opie::Ui::Internal::OKeyConfigWidgetPrivateList m_list;
263 QLabel *m_lbl; 263 QLabel *m_lbl;
264 QPushButton *m_btn; 264 QPushButton *m_btn;
265 QRadioButton *m_def, *m_cus, *m_none; 265 QRadioButton *m_def, *m_cus, *m_none;
266 QWidget* m_box; 266 QWidget* m_box;
267 ChangeMode m_mode; 267 ChangeMode m_mode;
268 class Private; 268 class Private;
269 Private *d; 269 Private *d;
270}; 270};
271 271
272 272
273/** 273/**
274 * This is a small dialog that allows you to 274 * This is a small dialog that allows you to
275 * capture a key sequence. 275 * capture a key sequence.
276 * If you want it to close after a key was captured you 276 * If you want it to close after a key was captured you
277 * can use this code snippet. 277 * can use this code snippet.
278 * 278 *
279 * \code 279 * \code
280 * OKeyChooserConfigDialog diag(0,0,true); 280 * OKeyChooserConfigDialog diag(0,0,true);
281 * connect(&diag,SIGNAL(keyCaptured()), 281 * connect(&diag,SIGNAL(keyCaptured()),
282 * this,SLOT(accept())); 282 * this,SLOT(accept()));
283 * if( QPEApplication::execDialog(&diag) == QDialog::Accept ){ 283 * if( QPEApplication::execDialog(&diag) == QDialog::Accept ){
284 * take_the_key_and_do_something 284 * take_the_key_and_do_something
285 * } 285 * }
286 * 286 *
diff --git a/libopie2/opieui/okeyconfigwidget_p.h b/libopie2/opieui/okeyconfigwidget_p.h
index e7eaba6..7690846 100644
--- a/libopie2/opieui/okeyconfigwidget_p.h
+++ b/libopie2/opieui/okeyconfigwidget_p.h
@@ -1,33 +1,33 @@
1/* 1/*
2 * Only Internal implemented in the same .cpp file anyway 2 * Only Internal implemented in the same .cpp file anyway
3 */ 3 */
4#include <opie2/olistview.h> 4#include <opie2/olistview.h>
5 5
6 6
7namespace Opie { 7namespace Opie {
8namespace Ui { 8namespace Ui {
9namespace Private { 9namespace Internal {
10 static QString keyToString( const OKeyPair& ); 10 static QString keyToString( const OKeyPair& );
11 static void fixupKeys( int&, int&, QKeyEvent* ); 11 static void fixupKeys( int&, int&, QKeyEvent* );
12 class OKeyListViewItem : public Opie::Ui::OListViewItem { 12 class OKeyListViewItem : public Opie::Ui::OListViewItem {
13 public: 13 public:
14 OKeyListViewItem( const OKeyConfigItem& item, OKeyConfigManager*, Opie::Ui::OListViewItem* parent); 14 OKeyListViewItem( const OKeyConfigItem& item, OKeyConfigManager*, Opie::Ui::OListViewItem* parent);
15 ~OKeyListViewItem(); 15 ~OKeyListViewItem();
16 16
17 void setDefault(); 17 void setDefault();
18 18
19 OKeyConfigItem& item(); 19 OKeyConfigItem& item();
20 OKeyConfigItem origItem()const; 20 OKeyConfigItem origItem()const;
21 void setItem( const OKeyConfigItem& item ); 21 void setItem( const OKeyConfigItem& item );
22 void updateText(); 22 void updateText();
23 23
24 OKeyConfigManager *manager(); 24 OKeyConfigManager *manager();
25 private: 25 private:
26 OKeyConfigItem m_item; 26 OKeyConfigItem m_item;
27 OKeyConfigItem m_origItem; 27 OKeyConfigItem m_origItem;
28 OKeyConfigManager* m_manager; 28 OKeyConfigManager* m_manager;
29 29
30 }; 30 };
31} 31}
32} 32}
33} 33}
diff --git a/libopie2/opieui/otaskbarapplet.h b/libopie2/opieui/otaskbarapplet.h
index 0c85ee7..ec7b9c4 100644
--- a/libopie2/opieui/otaskbarapplet.h
+++ b/libopie2/opieui/otaskbarapplet.h
@@ -20,49 +20,49 @@
20..}^=.=       =       ; Library General Public License for more 20..}^=.=       =       ; Library General Public License for more
21++=   -.     .`     .: details. 21++=   -.     .`     .: details.
22 :     =  ...= . :.=- 22 :     =  ...= . :.=-
23 -.   .:....=;==+<; You should have received a copy of the GNU 23 -.   .:....=;==+<; You should have received a copy of the GNU
24  -_. . .   )=.  = Library General Public License along with 24  -_. . .   )=.  = Library General Public License along with
25    --        :-=` this library; see the file COPYING.LIB. 25    --        :-=` this library; see the file COPYING.LIB.
26 If not, write to the Free Software Foundation, 26 If not, write to the Free Software Foundation,
27 Inc., 59 Temple Place - Suite 330, 27 Inc., 59 Temple Place - Suite 330,
28 Boston, MA 02111-1307, USA. 28 Boston, MA 02111-1307, USA.
29 29
30*/ 30*/
31 31
32#ifndef OTASKBARAPPLET_H 32#ifndef OTASKBARAPPLET_H
33#define OTASKBARAPPLET_H 33#define OTASKBARAPPLET_H
34 34
35#include <qpe/taskbarappletinterface.h> 35#include <qpe/taskbarappletinterface.h>
36#include <qpe/qcom.h> 36#include <qpe/qcom.h>
37 37
38#include <qwidget.h> 38#include <qwidget.h>
39 39
40class QMouseEvent; 40class QMouseEvent;
41 41
42namespace Opie { 42namespace Opie {
43namespace Ui { 43namespace Ui {
44namespace Private { 44namespace Internal {
45/*====================================================================================== 45/*======================================================================================
46 * OTaskbarAppletWrapper 46 * OTaskbarAppletWrapper
47 *======================================================================================*/ 47 *======================================================================================*/
48 48
49class OTaskbarAppletWrapperPrivate; 49class OTaskbarAppletWrapperPrivate;
50template<class T> class OTaskbarAppletWrapper : public TaskbarAppletInterface 50template<class T> class OTaskbarAppletWrapper : public TaskbarAppletInterface
51{ 51{
52 public: 52 public:
53 OTaskbarAppletWrapper():_applet( 0 ) 53 OTaskbarAppletWrapper():_applet( 0 )
54 { 54 {
55 } 55 }
56 56
57 virtual ~OTaskbarAppletWrapper() 57 virtual ~OTaskbarAppletWrapper()
58 { 58 {
59 delete _applet; 59 delete _applet;
60 } 60 }
61 61
62 QRESULT queryInterface( const QUuid& uuid, QUnknownInterface** iface ) 62 QRESULT queryInterface( const QUuid& uuid, QUnknownInterface** iface )
63 { 63 {
64 qDebug( "OTaskbarAppletWrapper::queryInterface()" ); 64 qDebug( "OTaskbarAppletWrapper::queryInterface()" );
65 *iface = 0; 65 *iface = 0;
66 if ( uuid == IID_QUnknown ) 66 if ( uuid == IID_QUnknown )
67 *iface = this; 67 *iface = this;
68 else if ( uuid == IID_TaskbarApplet ) 68 else if ( uuid == IID_TaskbarApplet )
@@ -101,29 +101,29 @@ template<class T> class OTaskbarAppletWrapper : public TaskbarAppletInterface
101 101
102// Having OTaskBarApplet reside in libopieui2 is not possible 102// Having OTaskBarApplet reside in libopieui2 is not possible
103// until we link the launcher binary against libopieui2 - 103// until we link the launcher binary against libopieui2 -
104// otherwise the necessary symbols are not present, when 104// otherwise the necessary symbols are not present, when
105// the dynamic loader [dlopen] tries to resolve an applet which 105// the dynamic loader [dlopen] tries to resolve an applet which
106// inherits OTaskbarApplet 106// inherits OTaskbarApplet
107 107
108class OTaskbarApplet : public QWidget 108class OTaskbarApplet : public QWidget
109{ 109{
110 public: 110 public:
111 OTaskbarApplet( QWidget* parent, const char* name = 0 ); 111 OTaskbarApplet( QWidget* parent, const char* name = 0 );
112 virtual ~OTaskbarApplet(); 112 virtual ~OTaskbarApplet();
113 113
114 protected: 114 protected:
115 virtual void popup( QWidget* widget ); 115 virtual void popup( QWidget* widget );
116private: 116private:
117 class Private; 117 class Private;
118 Private *d; 118 Private *d;
119}; 119};
120} 120}
121} 121}
122 122
123#define EXPORT_OPIE_APPLET_v1( AppLet ) \ 123#define EXPORT_OPIE_APPLET_v1( AppLet ) \
124 Q_EXPORT_INTERFACE() { \ 124 Q_EXPORT_INTERFACE() { \
125 Q_CREATE_INSTANCE( Opie::Ui::Private::OTaskbarAppletWrapper<AppLet> ) \ 125 Q_CREATE_INSTANCE( Opie::Ui::Internal::OTaskbarAppletWrapper<AppLet> ) \
126 } 126 }
127 127
128#endif 128#endif
129 129