author | zecke <zecke> | 2004-04-04 21:27:42 (UTC) |
---|---|---|
committer | zecke <zecke> | 2004-04-04 21:27:42 (UTC) |
commit | f664b509b5e622ab74560fb74093175e50b2790c (patch) (side-by-side diff) | |
tree | d46acaa8dd49ab2de70aebcdcf57bce1276c6fd1 | |
parent | eb2831b5c94c4c27b8282842c9709234f5365e01 (diff) | |
download | opie-f664b509b5e622ab74560fb74093175e50b2790c.zip opie-f664b509b5e622ab74560fb74093175e50b2790c.tar.gz opie-f664b509b5e622ab74560fb74093175e50b2790c.tar.bz2 |
Opie::XYZ::Private -> Opie::XYZ::Internal
43 files changed, 101 insertions, 90 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 @@ -72,29 +72,29 @@ ODevice *ODevice::inst() { QFile f( PATH_PROC_CPUINFO ); if ( f.open( IO_ReadOnly ) ) { QTextStream s( &f ); while ( !s.atEnd() ) { QString line; line = s.readLine(); if ( line.startsWith( "Hardware" ) ) { qDebug( "ODevice() - found '%s'", (const char*) line ); - if ( line.contains( "sharp", false ) ) dev = new Private::Zaurus(); - else if ( line.contains( "ipaq", false ) ) dev = new Private::iPAQ(); - else if ( line.contains( "simpad", false ) ) dev = new Private::SIMpad(); - else if ( line.contains( "jornada", false ) ) dev = new Private::Jornada(); - else if ( line.contains( "ramses", false ) ) dev = new Private::Ramses(); + if ( line.contains( "sharp", false ) ) dev = new Internal::Zaurus(); + else if ( line.contains( "ipaq", false ) ) dev = new Internal::iPAQ(); + else if ( line.contains( "simpad", false ) ) dev = new Internal::SIMpad(); + else if ( line.contains( "jornada", false ) ) dev = new Internal::Jornada(); + else if ( line.contains( "ramses", false ) ) dev = new Internal::Ramses(); else qWarning( "ODevice() - unknown hardware - using default." ); break; } } } else { qWarning( "ODevice() - can't open '%s' - unknown hardware - using default.", PATH_PROC_CPUINFO ); } if ( !dev ) dev = new ODevice(); dev->init(); } 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 @@ -46,25 +46,25 @@ #include <math.h> #include <stdlib.h> #include <signal.h> #include <sys/ioctl.h> #include <sys/time.h> #include <unistd.h> #ifndef QT_NO_SOUND #include <linux/soundcard.h> #endif using namespace Opie::Core; -using namespace Opie::Core::Private; +using namespace Opie::Core::Internal; /* KERNEL */ #define OD_IOC(dir,type,number,size) (( dir << 30 ) | ( type << 8 ) | ( number ) | ( size << 16 )) #define OD_IO(type,number) OD_IOC(0,type,number,0) #define OD_IOW(type,number,size) OD_IOC(1,type,number,sizeof(size)) #define OD_IOR(type,number,size) OD_IOC(2,type,number,sizeof(size)) #define OD_IORW(type,number,size) OD_IOC(3,type,number,sizeof(size)) typedef struct { unsigned char OffOnBlink; /* 0=off 1=on 2=Blink */ unsigned char TotalTime; /* Units of 5 seconds */ 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 @@ -28,25 +28,25 @@ */ #ifndef ODEVICE_IPAQ #define ODEVICE_IPAQ #include "odevice.h" /* QT */ #include <qwindowsystem_qws.h> namespace Opie { namespace Core { -namespace Private { +namespace Internal { class iPAQ : public ODevice, public QWSServer::KeyboardFilter { protected: virtual void init(); virtual void initButtons(); public: virtual bool setSoftSuspend( bool soft ); virtual bool setDisplayBrightness( int b ); 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 @@ -68,25 +68,25 @@ typedef struct { unsigned char OffTime; /* units of 100m/s */ } LED_IN; typedef struct { unsigned char mode; unsigned char pwr; unsigned char brightness; } FLITE_IN; #define LED_ON OD_IOW( 'f', 5, LED_IN ) #define FLITE_ON OD_IOW( 'f', 7, FLITE_IN ) -using namespace Opie::Core::Private; +using namespace Opie::Core::Internal; void Jornada::init() { d->m_vendorstr = "HP"; d->m_vendor = Vendor_HP; d->m_modelstr = "Jornada 56x"; d->m_model = Model_Jornada_56x; d->m_systemstr = "Familiar"; d->m_system = System_Familiar; d->m_rotation = Rot0; QFile f ( "/etc/familiar-version" ); 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 @@ -25,25 +25,25 @@ If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef ODEVICE_JORNADA #define ODEVICE_JORNADA #include <opie2/odevice.h> namespace Opie { namespace Core { -namespace Private { +namespace Internal { class Jornada : public ODevice { protected: virtual void init(); public: virtual bool setSoftSuspend ( bool soft ); virtual bool setDisplayBrightness ( int b ); virtual int displayBrightnessResolution() const; }; } 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 @@ -45,25 +45,25 @@ #include <fcntl.h> #include <math.h> #include <stdlib.h> #include <signal.h> #include <sys/ioctl.h> #include <sys/time.h> #include <unistd.h> #ifndef QT_NO_SOUND #include <linux/soundcard.h> #endif using namespace Opie::Core; -using namespace Opie::Core::Private; +using namespace Opie::Core::Internal; struct r_button ramses_buttons [] = { { Model_Ramses_MNCI, Qt::Key_F11, QT_TRANSLATE_NOOP("Button", "Menu Button"), "devicebuttons/z_menu", "QPE/TaskBar", "toggleMenu()", "QPE/TaskBar", "toggleStartMenu()" }, { Model_Ramses_MNCI, Qt::Key_F12, QT_TRANSLATE_NOOP("Button", "Home Button"), "devicebuttons/ipaq_home", "QPE/Launcher", "home()", "buttonsettings", "raise()" }, 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 @@ -27,25 +27,25 @@ Boston, MA 02111-1307, USA. */ #ifndef ODEVICE_RAMSES #define ODEVICE_RAMSES #include <opie2/odevice.h> /* QT */ #include <qwindowsystem_qws.h> namespace Opie { namespace Core { -namespace Private { +namespace Internal { class Ramses : public ODevice, public QWSServer::KeyboardFilter { protected: virtual void init(); public: virtual bool setSoftSuspend( bool soft ); virtual bool suspend(); virtual bool setDisplayStatus( bool on ); virtual bool setDisplayBrightness( int b ); 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 @@ -45,25 +45,25 @@ _;:, .> :=|. This program is free software; you can #include <fcntl.h> #include <math.h> #include <stdlib.h> #include <signal.h> #include <sys/ioctl.h> #include <sys/time.h> #include <unistd.h> #ifndef QT_NO_SOUND #include <linux/soundcard.h> #endif using namespace Opie::Core; -using namespace Opie::Core::Private; +using namespace Opie::Core::Internal; struct s_button simpad_buttons [] = { { Model_SIMpad_CL4 | Model_SIMpad_SL4 | Model_SIMpad_SLC | Model_SIMpad_TSinus, Qt::Key_F9, QT_TRANSLATE_NOOP("Button", "Lower+Up"), "devicebuttons/simpad_lower_up", "datebook", "nextView()", "today", "raise()" }, { Model_SIMpad_CL4 | Model_SIMpad_SL4 | Model_SIMpad_SLC | Model_SIMpad_TSinus, Qt::Key_F10, QT_TRANSLATE_NOOP("Button", "Lower+Down"), "devicebuttons/simpad_lower_down", "addressbook", "raise()", "addressbook", "beamBusinessCard()" }, 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 @@ -28,25 +28,25 @@ */ #ifndef ODEVICE_SIMPAD #define ODEVICE_SIMPAD #include <opie2/odevice.h> /* QT */ #include <qwindowsystem_qws.h> namespace Opie { namespace Core { -namespace Private { +namespace Internal { class SIMpad : public ODevice, public QWSServer::KeyboardFilter { protected: virtual void init(); virtual void initButtons(); public: virtual bool setSoftSuspend( bool soft ); virtual bool suspend(); virtual bool setDisplayStatus( bool on ); 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 @@ -45,25 +45,25 @@ _;:, .> :=|. This program is free software; you can #include <fcntl.h> #include <math.h> #include <stdlib.h> #include <signal.h> #include <sys/ioctl.h> #include <sys/time.h> #include <unistd.h> #ifndef QT_NO_SOUND #include <linux/soundcard.h> #endif using namespace Opie::Core; -using namespace Opie::Core::Private; +using namespace Opie::Core::Internal; struct yopy_button yopy_buttons [] = { { Qt::Key_F10, QT_TRANSLATE_NOOP( "Button", "Action Button" ), "devicebuttons/yopy_action", "datebook", "nextView()", "today", "raise()" }, { Qt::Key_F11, QT_TRANSLATE_NOOP( "Button", "OK Button" ), "devicebuttons/yopy_ok", "addressbook", "raise()", "addressbook", "beamBusinessCard()" }, { Qt::Key_F12, QT_TRANSLATE_NOOP( "Button", "End Button" ), "devicebuttons/yopy_end", 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 @@ -25,25 +25,25 @@ _;:, .> :=|. This program is free software; you can If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef ODEVICE_YOPY #define ODEVICE_YOPY #include <opie2/odevice.h> namespace Opie { namespace Core { -namespace Private { +namespace Internal { class Yopy : public ODevice { protected: virtual void init(); virtual void initButtons(); public: virtual bool suspend(); virtual bool setDisplayBrightness ( int b ); virtual int displayBrightnessResolution() const; 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 @@ -45,25 +45,25 @@ _;:, .> :=|. This program is free software; you can #include <fcntl.h> #include <math.h> #include <stdlib.h> #include <signal.h> #include <sys/ioctl.h> #include <sys/time.h> #include <unistd.h> #ifndef QT_NO_SOUND #include <linux/soundcard.h> #endif using namespace Opie::Core; -using namespace Opie::Core::Private; +using namespace Opie::Core::Internal; struct z_button z_buttons [] = { { Qt::Key_F9, QT_TRANSLATE_NOOP("Button", "Calendar Button"), "devicebuttons/z_calendar", "datebook", "nextView()", "today", "raise()" }, { Qt::Key_F10, QT_TRANSLATE_NOOP("Button", "Contacts Button"), "devicebuttons/z_contact", "addressbook", "raise()", "addressbook", "beamBusinessCard()" }, { Qt::Key_F12, QT_TRANSLATE_NOOP("Button", "Home Button"), "devicebuttons/z_home", 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 @@ -39,25 +39,25 @@ // _IO and friends are only defined in kernel headers ... #define OD_IOC(dir,type,number,size) (( dir << 30 ) | ( type << 8 ) | ( number ) | ( size << 16 )) #define OD_IO(type,number) OD_IOC(0,type,number,0) #define OD_IOW(type,number,size) OD_IOC(1,type,number,sizeof(size)) #define OD_IOR(type,number,size) OD_IOC(2,type,number,sizeof(size)) #define OD_IORW(type,number,size) OD_IOC(3,type,number,sizeof(size)) namespace Opie { namespace Core { -namespace Private { +namespace Internal { class Zaurus : public ODevice { protected: virtual void init(); virtual void initButtons(); public: virtual bool setSoftSuspend ( bool soft ); virtual bool setDisplayBrightness ( int b ); virtual int displayBrightnessResolution() const; 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 @@ -27,37 +27,37 @@ Boston, MA 02111-1307, USA. */ #include <qpixmap.h> #include <qstring.h> #include <qpe/qcopenvelope_qws.h> #include <opie2/odevicebutton.h> namespace Opie { namespace Core { -namespace Private { +namespace Internal { class OQCopMessageData { public: QCString m_channel; QCString m_message; QByteArray m_data; }; } using namespace Opie::Core; -using namespace Opie::Core::Private; +using Opie::Core::Internal::OQCopMessageData; OQCopMessage::OQCopMessage() : d ( 0 ) { init ( QCString(), QCString(), QByteArray()); } OQCopMessage::OQCopMessage ( const OQCopMessage © ) : d ( 0 ) { init ( copy. channel(), copy. message(), copy. data()); } 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 @@ -17,25 +17,25 @@ ** not clear to you. ** **********************************************************************/ #ifndef DEVICE_BUTTON_H #define DEVICE_BUTTON_H #include <qpixmap.h> #include <qstring.h> namespace Opie{ namespace Core{ -namespace Private { +namespace Internal { class OQCopMessageData; } class OQCopMessage { public: OQCopMessage ( ); OQCopMessage ( const OQCopMessage © ); OQCopMessage ( const QCString &m_channel, const QCString &message, const QByteArray &args = QByteArray ( )); OQCopMessage &operator = ( const OQCopMessage &assign ); @@ -45,25 +45,25 @@ public: QCString channel ( ) const; QCString message ( ) const; QByteArray data ( ) const; bool isNull()const; bool send ( ); private: void init ( const QCString &m_channel, const QCString &message, const QByteArray &args ); - Private::OQCopMessageData *d; + Internal::OQCopMessageData *d; class Private; Private* m_data; }; /** * This class represents a physical button on a Qtopia device. A device may * have n "user programmable" buttons, which are number 1..n. The location * and number of buttons will vary from device to device. userText() and pixmap() * may be used to describe this button to the user in help documentation. * * @version 1.0 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 @@ -36,25 +36,25 @@ using namespace Opie::Core; OApplication* OApplication::_instance = 0; /************************************************************************************************** * OApplicationPrivate **************************************************************************************************/ namespace Opie { namespace Core { -namespace Private { +namespace Internal { class OApplicationPrivate { public: OApplicationPrivate() {}; ~OApplicationPrivate() {}; }; } /************************************************************************************************** * OApplication **************************************************************************************************/ @@ -82,25 +82,25 @@ OApplication::~OApplication() OConfig* OApplication::config() { if ( !_config ) { _config = new OConfig( _appname ); } return _config; } void OApplication::init() { - d = new Private::OApplicationPrivate(); + d = new Internal::OApplicationPrivate(); if ( !OApplication::_instance ) { OApplication::_instance = this; /* register SIGSEGV handler to give programs an option * to exit gracefully, e.g. save or close devices or files. struct sigaction sa; sa.sa_handler = ( void (*)(int) ) &segv_handler; sa.sa_flags = SA_SIGINFO | SA_RESTART; sigemptyset(&sa.sa_mask); sigaction(SIGSEGV, &sa, NULL); */ 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 @@ -28,25 +28,25 @@ */ #ifndef OAPPLICATION_H #define OAPPLICATION_H #define oApp Opie::Core::OApplication::oApplication() #include <qpe/qpeapplication.h> namespace Opie { namespace Core { -namespace Private { +namespace Internal { class OApplicationPrivate; } // private class class OConfig; class OApplication : public QPEApplication { Q_OBJECT public: /** @@ -93,19 +93,19 @@ class OApplication : public QPEApplication * * @param title the title. If not given, resets caption to appname */ virtual void setTitle( const QString& title = QString::null ) const; protected: void init(); private: const QCString _appname; static OApplication* _instance; OConfig* _config; - Private::OApplicationPrivate* d; + Internal::OApplicationPrivate* d; }; } // Core } // Opie #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 @@ -58,25 +58,25 @@ class OConfig : public Config /** * Destructs the OConfig object. * * Writes back any dirty configuration entries, and destroys * dynamically created objects. */ virtual ~OConfig(); /** * @returns the name of the current group. * The current group is used for searching keys and accessing entries. * @todo make const */ - const QString& group() { return git.key(); }; + const QString& group()const { return git.key(); }; /** * @returns a @ref QColor entry or a @a default value if the key is not found. */ QColor readColorEntry( const QString& key, const QColor* pDefault ) const; /** * @returns a @ref QFont value or a @a default value if the key is not found. */ QFont readFontEntry( const QString& key, const QFont* pDefault ) const; private: class Private; Private *d; 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 @@ -58,24 +58,33 @@ #include <stdarg.h> // vararg stuff #include <ctype.h> // isprint #include <syslog.h> #include <errno.h> #include <string.h> #ifndef OPIE_NO_BACKTRACE #include <execinfo.h> #endif namespace Opie { namespace Core { +namespace Internal { +class DebugBackend { +}; + +static DebugBackend *backEnd = 0; +} +static void clean_up_routine() { + delete Internal::backEnd; +} /*====================================================================================== * debug levels *======================================================================================*/ enum DebugLevels { ODEBUG_INFO = 0, ODEBUG_WARN = 1, ODEBUG_ERROR = 2, ODEBUG_FATAL = 3 }; /*====================================================================================== 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 @@ -32,25 +32,25 @@ #include <sys/socket.h> #include <errno.h> #include <fcntl.h> #include <stdio.h> #include <string.h> #include <unistd.h> #include <assert.h> #include <qsocketnotifier.h> #include "oprocctrl.h" -using namespace Opie::Core::Private; +using namespace Opie::Core::Internal; OProcessController *OProcessController::theOProcessController = 0; struct sigaction OProcessController::oldChildHandlerData; bool OProcessController::handlerSet = false; OProcessController::OProcessController() { assert( theOProcessController == 0 ); if (0 > pipe(fd)) printf(strerror(errno)); 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 @@ -30,25 +30,25 @@ #define __KPROCCTRL_H__ #include <qvaluelist.h> #include <qtimer.h> #include "oprocess.h" class QSocketNotifier; namespace Opie { namespace Core { -namespace Private { +namespace Internal { class OProcessControllerPrivate; /** * @short Used internally by @ref OProcess * @internal * @author Christian Czezakte <e9025461@student.tuwien.ac.at> * * A class for internal use by OProcess only. -- Exactly one instance * of this class is generated by the first instance of OProcess that is * created (a pointer to it gets stored in @ref theOProcessController ). * * This class takes care of the actual (UN*X) signal handling. 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 @@ -52,29 +52,29 @@ _;:, .> :=|. This program is free software; you can #include <sys/time.h> #include <sys/types.h> #include <sys/stat.h> #include <sys/socket.h> #include <unistd.h> #ifdef HAVE_SYS_SELECT_H #include <sys/select.h> #endif #ifdef HAVE_INITGROUPS #include <grp.h> #endif -using namespace Opie::Core::Private; +using namespace Opie::Core::Internal; namespace Opie { namespace Core { -namespace Private { +namespace Internal { class OProcessPrivate { public: OProcessPrivate() : useShell( false ) { } bool useShell; QMap<QString, QString> env; QString wd; QCString shell; }; } 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 @@ -37,25 +37,25 @@ _;:, .> :=|. This program is free software; you can #include <qvaluelist.h> /* STD */ #include <sys/types.h> // for pid_t #include <sys/wait.h> #include <signal.h> #include <unistd.h> class QSocketNotifier; namespace Opie { namespace Core { -namespace Private { +namespace Internal { class OProcessController; class OProcessPrivate; } /** * Child process invocation, monitoring and control. * * @sect General usage and features * *This class allows a KDE and OPIE application to start child processes without having *to worry about UN*X signal handling issues and zombie process reaping. * @@ -714,25 +714,25 @@ protected: int childError( int fdno ); // information about the data that has to be sent to the child: const char *input_data; // the buffer holding the data int input_sent; // # of bytes already transmitted int input_total; // total length of input_data /** * @ref OProcessController is a friend of OProcess because it has to have * access to various data members. */ - friend class Private::OProcessController; + friend class Internal::OProcessController; private: /** * Searches for a valid shell. * Here is the algorithm used for finding an executable shell: * * @li Try the executable pointed to by the "SHELL" environment * variable with white spaces stripped off * * @li If your process runs with uid != euid or gid != egid, a shell * not listed in /etc/shells will not used. * @@ -743,19 +743,19 @@ private: /** * Used by @ref searchShell in order to find out whether the shell found * is actually executable at all. */ bool isExecutable( const QCString &filename ); // Disallow assignment and copy-construction OProcess( const OProcess& ); OProcess& operator= ( const OProcess& ); private: void init ( ); - Private::OProcessPrivate *d; + Internal::OProcessPrivate *d; }; } } #endif 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 @@ -32,25 +32,25 @@ #include "osqlitedriver.h" #include <opie2/odebug.h> #include <stdlib.h> // fromLocal8Bit() does not work as expected. Thus it // is replaced by fromLatin1() (eilers) #define __BUGGY_LOCAL8BIT_ using namespace Opie::DB; -using namespace Opie::DB::Private; +using namespace Opie::DB::Internal; namespace { struct Query { OSQLError::ValueList errors; OSQLResultItem::ValueList items; OSQLiteDriver *driver; }; } OSQLiteDriver::OSQLiteDriver( QLibrary *lib ) : OSQLDriver( lib ) 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,24 +1,24 @@ #ifndef OSQL_LITE_DRIVER_H #define OSQL_LITE_DRIVER_H #include <sqlite.h> #include "osqldriver.h" #include "osqlerror.h" #include "osqlresult.h" namespace Opie { namespace DB { -namespace Private { +namespace Internal { class OSQLiteDriver : public OSQLDriver { Q_OBJECT public: OSQLiteDriver( QLibrary *lib = 0l ); ~OSQLiteDriver(); QString id()const; void setUserName( const QString& ); void setPassword( const QString& ); void setUrl( const QString& url ); void setOptions( const QStringList& ); bool open(); 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 @@ -24,36 +24,36 @@ OSQLBackEnd::ValueList OSQLManager::queryBackEnd() { m_list += builtIn(); return m_list; } /* * loading dso's is currently not enabled due problems with QLibrary * beeing in libqpe and not libqte */ OSQLDriver* OSQLManager::load( const QString& name ) { OSQLDriver* driver = 0l; if ( name == "SQLite" ) { - driver = new Opie::DB::Private::OSQLiteDriver; + driver = new Opie::DB::Internal::OSQLiteDriver; } return driver; } /* * same as above */ OSQLDriver* OSQLManager::load( const OSQLBackEnd& end) { OSQLDriver *driver = 0l; if ( end.library() == "builtin" && end.name() == "SQLite" ) - driver = new Opie::DB::Private::OSQLiteDriver; + driver = new Opie::DB::Internal::OSQLiteDriver; return driver; } /* * let's find the a default with the highes preference */ OSQLDriver* OSQLManager::standard() { OSQLDriver* driver =0l; if ( m_list.isEmpty() ) queryBackEnd(); OSQLBackEnd::ValueList::Iterator it; OSQLBackEnd back; for ( it = m_list.begin(); it != m_list.end(); ++it ) { 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 @@ -2,25 +2,25 @@ /* * debug value mapper - generated by regen.py - (C) Michael 'Mickey' Lauer <mickey@vanille.de> */ #include <opie2/odebug.h> #include "odebugmapper.h" using namespace Opie::Core; namespace Opie { namespace Net { -namespace Private { +namespace Internal { DebugMapper::DebugMapper() { odebug << "DebugMapper::DebugMapper()" << oendl; _map.insert( 0x8902, new QString("SIOCSPGRP") ); _map.insert( 0x8904, new QString("SIOCGPGRP") ); _map.insert( 0x8905, new QString("SIOCATMARK") ); _map.insert( 0x8906, new QString("SIOCGSTAMP") ); _map.insert( 0x890B, new QString("SIOCADDRT") ); _map.insert( 0x890C, new QString("SIOCDELRT") ); 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 @@ -2,25 +2,25 @@ /* * debug value mapper - generated by regen.py - (C) Michael 'Mickey' Lauer <mickey@vanille.de> */ #ifndef DEBUGMAPPER_H #define DEBUGMAPPER_H #include <qstring.h> #include <qintdict.h> namespace Opie { namespace Net { -namespace Private { +namespace Internal { typedef QIntDict<QString> IntStringMap; class DebugMapper { public: DebugMapper(); ~DebugMapper(); const QString& map( int value ) const; private: IntStringMap _map; 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 @@ -181,25 +181,25 @@ void OPrivateIOCTL::invoke() const ( (OWirelessNetworkInterface*) parent() )->wioctl( _ioctl ); } void OPrivateIOCTL::setParameter( int num, u_int32_t value ) { u_int32_t* arglist = (u_int32_t*) &( (OWirelessNetworkInterface*) parent() )->_iwr.u.name; arglist[num] = value; } -namespace Private { +namespace Internal { /*====================================================================================== * assorted functions *======================================================================================*/ void dumpBytes( const unsigned char* data, int num ) { printf( "Dumping %d bytes @ %0x", num, data ); printf( "-------------------------------------------\n" ); for ( int i = 0; i < num; ++i ) { printf( "%02x ", data[i] ); 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 @@ -123,25 +123,25 @@ class OPrivateIOCTL : public QObject u_int32_t _ioctl; u_int16_t _getargs; u_int16_t _setargs; class Private; Private *d; }; /*====================================================================================== * Miscellaneous *======================================================================================*/ -namespace Private { +namespace Internal { void dumpBytes( const unsigned char* data, int num ); QString modeToString( int ); int stringToMode( const QString& ); } } } #define IW_PRIV_TYPE_MASK 0x7000 #define IW_PRIV_TYPE_NONE 0x0000 #define IW_PRIV_TYPE_BYTE 0x1000 #define IW_PRIV_TYPE_CHAR 0x2000 #define IW_PRIV_TYPE_INT 0x4000 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 @@ -51,25 +51,25 @@ #include <sys/socket.h>
#include <sys/types.h>
#include <unistd.h>
#include <linux/sockios.h>
#include <net/if_arp.h>
#include <stdarg.h>
#ifndef NODEBUG
#include <opie2/odebugmapper.h>
using namespace Opie::Core;
-using namespace Opie::Net::Private;
+using namespace Opie::Net::Internal;
DebugMapper* debugmapper = new DebugMapper();
#endif
/*======================================================================================
* ONetwork
*======================================================================================*/
namespace Opie {
namespace Net {
ONetwork* ONetwork::_instance = 0;
ONetwork::ONetwork()
@@ -94,25 +94,25 @@ void ONetwork::synchronize() {
odebug << "ONetwork: /proc/net/dev not existing. No network devices available" << oendl;
return;
}
QTextStream s( &f );
s.readLine();
s.readLine();
while ( !s.atEnd() )
{
s >> str;
str.truncate( str.find( ':' ) );
odebug << "ONetwork: found interface '" << str << "'" << oendl;
- ONetworkInterface* iface;
+ ONetworkInterface* iface = 0;
if ( isWirelessInterface( str ) )
{
iface = new OWirelessNetworkInterface( this, (const char*) str );
odebug << "ONetwork: interface '" << str << "' has Wireless Extensions" << oendl;
}
else
{
iface = new ONetworkInterface( this, (const char*) str );
}
_interfaces.insert( str, iface );
s.readLine();
}
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,23 +1,23 @@ #ifndef OPIE_BIG_SCREEN_PRIVATE #define OPIE_BIG_SCREEN_PRIVATE /* QT */ #include <qstring.h> class QWidget; namespace Opie { namespace Ui { -namespace Private{ +namespace Internal{ struct OSplitterContainer { bool operator==( const OSplitterContainer& o) const { if (widget != o.widget ) return false; if (icon != o.icon ) return false; if (name != o.name ) return false; return true; } QWidget* widget; QString icon; 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 @@ -27,25 +27,25 @@ */ #include "osplitter.h" /* OPIE */ #include <opie2/otabwidget.h> /* QT */ #include <qvaluelist.h> #include <qvbox.h> using namespace Opie::Ui; -using namespace Opie::Ui::Private; +using namespace Opie::Ui::Internal; /** * * This is the constructor of OSplitter * You might want to call setSizeChange to tell * OSplitter to change its layout when a specefic * mark was crossed. OSplitter sets a default value. * * You cann add widget with addWidget to the OSplitter. * OSplitter supports also grouping of Splitters where they * can share one OTabBar in small screen mode. This can be used * for email clients like vies but see the example. @@ -388,39 +388,39 @@ void OSplitter::resizeEvent( QResizeEvent* res ) qWarning("Changng to vbox %s", name() ); changeVBox(); mode = false; } emit sizeChanged(mode, m_orient ); } /* * Adds a container to a tab either the parent tab * or our own */ -void OSplitter::addToTab( const Opie::Ui::Private::OSplitterContainer& con ) +void OSplitter::addToTab( const Opie::Ui::Internal::OSplitterContainer& con ) { QWidget *wid = con.widget; // not needed widgetstack will reparent as well wid.reparent(m_tabWidget, wid->getWFlags(), QPoint(0, 0) ); if (m_parentTab ) m_parentTab->addTab( wid, con.icon, con.name ); else m_tabWidget->addTab( wid, con.icon, con.name ); } /* * adds a container to the box */ -void OSplitter::addToBox( const Opie::Ui::Private::OSplitterContainer& con ) +void OSplitter::addToBox( const Opie::Ui::Internal::OSplitterContainer& con ) { QWidget* wid = con.widget; wid->reparent(m_hbox, 0, QPoint(0, 0) ); } /* * Removes a widget from the tab */ void OSplitter::removeFromTab( QWidget* wid ) { if (m_parentTab ) 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 @@ -64,25 +64,25 @@ class OTabWidget; * OSplitter takes ownership of the widgets * * @since 1.2 * * @short a small dynamically changing its layout to store two or more widgets side by side * @version 0.1 * @author zecke */ class OSplitter : public QFrame { Q_OBJECT public: - typedef QValueList<Opie::Ui::Private::OSplitterContainer> ContainerList; + typedef QValueList<Opie::Ui::Internal::OSplitterContainer> ContainerList; OSplitter( Qt::Orientation = Horizontal, QWidget *parent = 0, const char* name = 0, WFlags fl = 0 ); ~OSplitter(); void setLabel( const QString& name ); void setIconName( const QString& name ); QString label()const; QString iconName()const; void setSizeChange( int width_height ); void addWidget( OSplitter* splitter ); @@ -115,26 +115,26 @@ signals: public: // QSize sizeHint()const; // QSize minimumSizeHint()const; protected: void resizeEvent( QResizeEvent* ); private: /* true if OTabMode */ bool layoutMode()const; // void reparentAll(); void setTabWidget( OTabWidget*); - void addToTab( const Opie::Ui::Private::OSplitterContainer& ); - void addToBox( const Opie::Ui::Private::OSplitterContainer& ); + void addToTab( const Opie::Ui::Internal::OSplitterContainer& ); + void addToBox( const Opie::Ui::Internal::OSplitterContainer& ); void removeFromTab( QWidget* ); void changeTab(); void changeHBox(); void changeVBox(); void commonChangeBox(); QHBox *m_hbox; OTabWidget *m_tabWidget; OTabWidget *m_parentTab; Orientation m_orient; int m_size_policy; ContainerList m_container; 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,12 +1,13 @@ + /* =. This file is part of the OPIE Project .=l. Copyright (C) 2002,2003 Holger Freyther <zecke@handhelds.org> .>+-= _;:, .> :=|. This library is free software; you can .> <`_, > . <= redistribute it and/or modify it under :`=1 )Y*s>-.-- : the terms of the GNU Library General Public .="- .-=="i, .._ License as published by the Free Software - . .-<_> .<> Foundation; either version 2 of the License, ._= =} : or (at your option) any later version. .%`+i> _;_. .i_,=:_. -<s. This library is distributed in the hope that @@ -46,29 +47,29 @@ #include <qdir.h> #include <qhbox.h> #include <qheader.h> #include <qlabel.h> #include <qlayout.h> #include <qlineedit.h> #include <qlistview.h> #include <qpopupmenu.h> #include <qwidgetstack.h> #include <qregexp.h> #include <qobjectlist.h> -using namespace Opie::Ui::Private; +using namespace Opie::Ui::Internal; namespace Opie { namespace Ui { -namespace Private { +namespace Internal { OFileViewInterface::OFileViewInterface( OFileSelector* selector ) : m_selector( selector ) {} OFileViewInterface::~OFileViewInterface() {} QString OFileViewInterface::name()const { return m_name; } 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 @@ -46,46 +46,46 @@ #include <qstringlist.h> class QLineEdit; class QComboBox; class QWidgetStack; class QHBox; typedef QMap<QString, QStringList> MimeTypes; namespace Opie { namespace Ui { -namespace Private { +namespace Internal { class OFileViewInterface; class OFileViewFileListView; } /** * @short a dropin replacement for the FileSelector * * This class is first used insert the OFileDialog. * It supports multiple view and mimetype filtering for now. * * @see OFileDialog * @see FileSelector * @author zecke * @version 0.1 */ class OFileSelector : public QWidget { Q_OBJECT - friend class Private::OFileViewInterface; - friend class Private::OFileViewFileListView; + friend class Internal::OFileViewInterface; + friend class Internal::OFileViewFileListView; public: /** * The Mode of the Fileselector * Open = Open A File * Save = Save a File * FILESELECTOR = As A GUI in a screen to select a file */ enum Mode { Open=1, Save=2, FileSelector=4, OPEN=1, SAVE=2, FILESELECTOR=4 }; // enum OldMode { OPEN=1, SAVE=2, FILESELECTOR = 4 }; /** * Normal = The old FileSelector @@ -178,31 +178,31 @@ private: private: /* inits the Widgets */ void initUI(); /* inits the MimeType ComboBox content + connects signals and slots */ void initMime(); /* init the Views :) */ void initViews(); private: QLineEdit* m_lneEdit; // the LineEdit for the Name QComboBox *m_cmbView, *m_cmbMime; // two ComboBoxes to select the View and MimeType QWidgetStack* m_stack; // our widget stack which will contain the views - Private::OFileViewInterface* currentView() const; // returns the currentView - Private::OFileViewInterface* m_current; // here is the view saved + Internal::OFileViewInterface* currentView() const; // returns the currentView + Internal::OFileViewInterface* m_current; // here is the view saved bool m_shNew : 1; // should we show New? bool m_shClose : 1; // should we show Close? MimeTypes m_mimeType; // list of mimetypes - QMap<QString, Private::OFileViewInterface*> m_views; // QString translated view name + ViewInterface Ptr + QMap<QString, Internal::OFileViewInterface*> m_views; // QString translated view name + ViewInterface Ptr QHBox* m_nameBox; // the LineEdit + Label is hold here QHBox* m_cmbBox; // this holds the two combo boxes QString m_startDir; int m_mode; int m_selector; struct Data; // used for future versions Data *d; private slots: void slotMimeTypeChanged(); 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 @@ -50,25 +50,25 @@ * I'll take c) -zecke */ typedef QMap<QString, QStringList> MimeTypes; /* the View Interface */ class QFileInfo; class QToolButton; namespace Opie{ namespace Ui{ class OFileSelector; -namespace Private { +namespace Internal { class OFileViewInterface { public: OFileViewInterface( OFileSelector* selector ); virtual ~OFileViewInterface(); virtual QString selectedName()const = 0; virtual QString selectedPath()const = 0; virtual QString directory()const = 0; virtual void reread() = 0; virtual int fileCount()const = 0; virtual DocLnk selectedDocument()const; 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 @@ -32,25 +32,25 @@ #include <qpe/fontdatabase.h> /* QT */ #include <qlayout.h> #include <qlistbox.h> #include <qcombobox.h> #include <qlabel.h> #include <qmultilineedit.h> namespace Opie { namespace Ui { -namespace Private { +namespace Internal { class OFontSelectorPrivate { public: QListBox * m_font_family_list; QComboBox * m_font_style_list; QComboBox * m_font_size_list; QMultiLineEdit *m_preview; bool m_pointbug : 1; FontDatabase m_fdb; @@ -87,25 +87,25 @@ public: private: QStringList m_styles; QValueList<int> m_sizes; QString m_name; }; } } } using namespace Opie::Ui; -using namespace Opie::Ui::Private; +using namespace Opie::Ui::Internal; static int findItemCB( QComboBox *box, const QString &str ) { for ( int i = 0; i < box->count(); i++ ) { if ( box->text ( i ) == str ) return i; } return -1; } /* static same as anon. namespace */ 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 @@ -28,25 +28,25 @@ */ #ifndef OFONTSELECTOR_H #define OFONTSELECTOR_H /* QT */ #include <qwidget.h> class QListBox; namespace Opie { namespace Ui { -namespace Private { +namespace Internal { class OFontSelectorPrivate; } /** * This class lets you chose a Font out of a list of Fonts. * It can show a preview too. This selector will use all available * fonts * * * @short A widget to select a font * @see QWidget * @see QFont @@ -87,20 +87,20 @@ protected slots: /** @internal */ virtual void fontSizeClicked ( int ); protected: virtual void resizeEvent ( QResizeEvent *re ); private: void loadFonts ( QListBox * ); void changeFont ( ); private: - Private::OFontSelectorPrivate *d; + Internal::OFontSelectorPrivate *d; }; } } #endif 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 @@ -465,54 +465,55 @@ OKeyConfigManager::OKeyConfigManager( Opie::Core::OConfig* conf, /** * Destructor */ OKeyConfigManager::~OKeyConfigManager() { if ( m_grab ) QPEApplication::ungrabKeyboard(); } /** * Load the Configuration from the OConfig * If a Key is restricted but was in the config we will * make it be the empty key paur - * We will change the group of the OConfig Item! + * We will change the group but restore to the previous. * * @see OKeyPair::emptyKey */ void OKeyConfigManager::load() { - m_conf->setGroup( m_group ); + Opie::Core::OConfigGroupSaver( m_conf, m_group ); /* * Read each item */ int key, mod; for( OKeyConfigItem::List::Iterator it = m_keys.begin(); it != m_keys.end(); ++it ) { key = m_conf->readNumEntry( (*it).configKey()+"key", (*it).defaultKeyPair().keycode() ); mod = m_conf->readNumEntry( (*it).configKey()+"mod", (*it).defaultKeyPair().modifier() ); OKeyPair okey( key, mod ); if ( !m_blackKeys.contains( okey ) && key != -1 && mod != -1 ) (*it).setKeyPair( OKeyPair(key, mod) ); else (*it).setKeyPair( OKeyPair::emptyKey() ); } delete m_map; m_map = 0; } /** * We will save the current configuration - * to the OConfig. We will change the group. + * to the OConfig. We will change the group but restore + * to the previous */ void OKeyConfigManager::save() { - m_conf->setGroup( m_group ); + Opie::Core::OConfigGroupSaver( m_conf, m_group ); /* * Write each item */ for( OKeyConfigItem::List::Iterator it = m_keys.begin();it != m_keys.end(); ++it ) { /* skip empty items */ if ( (*it).isEmpty() ) continue; OKeyPair pair = (*it).keyPair(); OKeyPair deft = (*it).defaultKeyPair(); /* * don't write if it is the default setting @@ -535,25 +536,25 @@ void OKeyConfigManager::save() { * * Make sure you call e->ignore if you don't want to handle this event */ OKeyConfigItem OKeyConfigManager::handleKeyEvent( QKeyEvent* e ) { /* * Fix Up issues with Qt/E, my keybard, and virtual input * methods * First my Keyboard delivers 256,512,1024 for shift/ctrl/alt instead of the button state * Also key() on virtual inputmethods are zero and only ascii. We need to fix upper and lower * case ascii */ int key, mod; - Opie::Ui::Private::fixupKeys( key, mod, e ); + Opie::Ui::Internal::fixupKeys( key, mod, e ); OKeyConfigItem::List _keyList = keyList( key ); if ( _keyList.isEmpty() ) return OKeyConfigItem(); OKeyConfigItem item; for ( OKeyConfigItem::List::Iterator it = _keyList.begin(); it != _keyList.end(); ++it ) { if ( (*it).keyPair().modifier() == mod ) { item = *it; break; } @@ -707,25 +708,25 @@ OKeyConfigItem::List OKeyConfigManager::keyList( int keycode) { } /* check if we added it */ if ( add ) (*m_map)[pair.keycode()].append( *it ); } } return (*m_map)[keycode]; } namespace Opie { namespace Ui { -namespace Private { +namespace Internal { OKeyListViewItem::OKeyListViewItem( const OKeyConfigItem& item, OKeyConfigManager* man, OListViewItem* parent) : Opie::Ui::OListViewItem( parent ), m_manager( man ) { m_origItem = item; setItem( item ); } OKeyListViewItem::~OKeyListViewItem() {} OKeyConfigItem &OKeyListViewItem::item(){ return m_item; } OKeyConfigItem OKeyListViewItem::origItem() const{ return m_origItem; @@ -929,80 +930,80 @@ void OKeyConfigWidget::setChangeMode( enum ChangeMode mode) { /** * return the current mode */ OKeyConfigWidget::ChangeMode OKeyConfigWidget::changeMode()const { return m_mode; } /** * insert these items before calling load */ void OKeyConfigWidget::insert( const QString& str, OKeyConfigManager* man ) { - Opie::Ui::Private::OKeyConfigWidgetPrivate root( str, man ); + Opie::Ui::Internal::OKeyConfigWidgetPrivate root( str, man ); m_list.append(root); } /** * loads the items and allows editing them */ void OKeyConfigWidget::load() { - Opie::Ui::Private::OKeyConfigWidgetPrivateList::Iterator it; + Opie::Ui::Internal::OKeyConfigWidgetPrivateList::Iterator it; for ( it = m_list.begin(); it != m_list.end(); ++it ) { OListViewItem *item = new OListViewItem( m_view, (*it).name ); OKeyConfigItem::List list = (*it).manager->keyConfigList(); for (OKeyConfigItem::List::Iterator keyIt = list.begin(); keyIt != list.end();++keyIt ) - (void )new Opie::Ui::Private::OKeyListViewItem(*keyIt, (*it).manager, item ); + (void )new Opie::Ui::Internal::OKeyListViewItem(*keyIt, (*it).manager, item ); } } /** * Saves if in Queue Mode. It'll update the supplied * OKeyConfigManager objects. * If in Queue mode it'll just return */ void OKeyConfigWidget::save() { /* * Iterate over all config items */ QListViewItemIterator it( m_view ); while ( it.current() ) { if (it.current()->parent() ) { - Opie::Ui::Private::OKeyListViewItem *item = static_cast<Opie::Ui::Private::OKeyListViewItem*>( it.current() ); + Opie::Ui::Internal::OKeyListViewItem *item = static_cast<Opie::Ui::Internal::OKeyListViewItem*>( it.current() ); OKeyConfigManager *man = item->manager(); man->removeKeyConfig( item->origItem() ); man->addKeyConfig( item->item() ); } ++it; } } /** * @internal */ void OKeyConfigWidget::slotListViewItem( QListViewItem* _item) { if ( !_item || !_item->parent() ) { m_box->setEnabled( false ); m_none->setChecked( true ); m_btn ->setEnabled( false ); m_def ->setChecked( false ); m_cus ->setChecked( false ); }else{ m_box->setEnabled( true ); - Opie::Ui::Private::OKeyListViewItem *item = static_cast<Opie::Ui::Private::OKeyListViewItem*>( _item ); + Opie::Ui::Internal::OKeyListViewItem *item = static_cast<Opie::Ui::Internal::OKeyListViewItem*>( _item ); OKeyConfigItem keyItem= item->item(); m_lbl->setText( tr("Default: " )+ item->text( 3 ) ); if ( keyItem.keyPair().isEmpty() ) { m_none->setChecked( true ); m_btn ->setEnabled( false ); m_def ->setChecked( false ); m_cus ->setChecked( false ); }else { m_none->setChecked( false ); m_cus ->setChecked( true ); m_btn ->setEnabled( true ); m_def ->setChecked( false ); @@ -1015,38 +1016,38 @@ void OKeyConfigWidget::slotNoKey() { m_cus ->setChecked( false ); m_btn ->setEnabled( false ); m_def ->setChecked( false ); if ( !m_view->currentItem() || !m_view->currentItem()->parent() ) return; /* * If immediate we need to remove and readd the key */ - Opie::Ui::Private::OKeyListViewItem *item = static_cast<Opie::Ui::Private::OKeyListViewItem*>(m_view->currentItem()); + Opie::Ui::Internal::OKeyListViewItem *item = static_cast<Opie::Ui::Internal::OKeyListViewItem*>(m_view->currentItem()); updateItem( item, OKeyPair::emptyKey() ); } void OKeyConfigWidget::slotDefaultKey() { m_none->setChecked( false ); m_cus ->setChecked( false ); m_btn ->setEnabled( false ); m_def ->setChecked( true ); if ( !m_view->currentItem() || !m_view->currentItem()->parent() ) return; - Opie::Ui::Private::OKeyListViewItem *item = static_cast<Opie::Ui::Private::OKeyListViewItem*>(m_view->currentItem()); + Opie::Ui::Internal::OKeyListViewItem *item = static_cast<Opie::Ui::Internal::OKeyListViewItem*>(m_view->currentItem()); updateItem( item, item->item().defaultKeyPair() ); } void OKeyConfigWidget::slotCustomKey() { m_cus ->setChecked( true ); m_btn ->setEnabled( true ); m_def ->setChecked( false ); m_none->setChecked( false ); if ( !m_view->currentItem() || !m_view->currentItem()->parent() ) return; @@ -1054,65 +1055,65 @@ void OKeyConfigWidget::slotCustomKey() { } void OKeyConfigWidget::slotConfigure() { if ( !m_view->currentItem() || !m_view->currentItem()->parent() ) return; /* FIXME make use of OModalHelper */ OKeyChooserConfigDialog dlg( this, "Dialog Name", true ); dlg.setCaption(tr("Configure Key")); connect(&dlg, SIGNAL(keyCaptured()), &dlg, SLOT(accept()) ); if ( QPEApplication::execDialog( &dlg ) == QDialog::Accepted ) { - Opie::Ui::Private::OKeyListViewItem *item = static_cast<Opie::Ui::Private::OKeyListViewItem*>(m_view->currentItem()); + Opie::Ui::Internal::OKeyListViewItem *item = static_cast<Opie::Ui::Internal::OKeyListViewItem*>(m_view->currentItem()); updateItem( item, dlg.keyPair() ); } } -bool OKeyConfigWidget::sanityCheck( Opie::Ui::Private::OKeyListViewItem* item, +bool OKeyConfigWidget::sanityCheck( Opie::Ui::Internal::OKeyListViewItem* item, const OKeyPair& newItem ) { OKeyPair::List bList = item->manager()->blackList(); for ( OKeyPair::List::Iterator it = bList.begin(); it != bList.end(); ++it ) { /* black list matched */ if ( *it == newItem ) { QMessageBox::warning( 0, tr("Key is on BlackList" ), tr("<qt>The Key you choose is on the black list " "and may not be used with this manager. Please " "use a different key.</qt>" ) ); return false; } } /* no we need to check the other items which is dog slow */ QListViewItemIterator it( item->parent() ); while ( it.current() ) { /* if not our parent and not us */ if (it.current()->parent() && it.current() != item) { /* damn already given away*/ - if ( newItem == static_cast<Opie::Ui::Private::OKeyListViewItem*>(it.current() )->item().keyPair() ) { + if ( newItem == static_cast<Opie::Ui::Internal::OKeyListViewItem*>(it.current() )->item().keyPair() ) { QMessageBox::warning( 0, tr("Key is already assigned" ), tr("<qt>The Key you choose is already taken by " "a different Item of your config. Please try" "using a different key.</qt>" ) ); return false; } } ++it; } return true; } -void OKeyConfigWidget::updateItem( Opie::Ui::Private::OKeyListViewItem *item, +void OKeyConfigWidget::updateItem( Opie::Ui::Internal::OKeyListViewItem *item, const OKeyPair& newItem) { /* sanity check * check against the blacklist of the manager * check if another item uses this key which is o(n) at least */ if ( !newItem.isEmpty() && !sanityCheck(item, newItem )) return; /* * If immediate we need to remove and readd the key @@ -1156,25 +1157,25 @@ OKeyChooserConfigDialog::~OKeyChooserConfigDialog() { Opie::Ui::OKeyPair OKeyChooserConfigDialog::keyPair()const{ return m_keyPair; } void OKeyChooserConfigDialog::keyPressEvent( QKeyEvent* ev ) { QDialog::keyPressEvent( ev ); if ( ev->isAutoRepeat() ) return; int mod, key; - Opie::Ui::Private::fixupKeys( key,mod, ev ); + Opie::Ui::Internal::fixupKeys( key,mod, ev ); /* either we used software keyboard * or we've true support */ if ( !m_virtKey && !ev->key()) { m_virtKey = true; m_keyPair = OKeyPair( key, mod ); }else{ mod = 0; switch( key ) { case Qt::Key_Control: mod = Qt::ControlButton; @@ -1191,25 +1192,25 @@ void OKeyChooserConfigDialog::keyPressEvent( QKeyEvent* ev ) { if (mod ) { m_mod |= mod; key = 0; }else m_key = key; if ( ( !mod || m_key || key ) && !m_timer->isActive() ) m_timer->start( 150, true ); m_keyPair = OKeyPair( m_key, m_mod ); } - m_lbl->setText( Opie::Ui::Private::keyToString( m_keyPair ) ); + m_lbl->setText( Opie::Ui::Internal::keyToString( m_keyPair ) ); } void OKeyChooserConfigDialog::keyReleaseEvent( QKeyEvent* ev ) { m_timer->stop(); QDialog::keyPressEvent( ev ); if ( ev->isAutoRepeat() ) return; if ( m_virtKey && !ev->key()) { @@ -1227,21 +1228,21 @@ void OKeyChooserConfigDialog::keyReleaseEvent( QKeyEvent* ev ) { break; case Qt::Key_Alt: mod = Qt::AltButton; break; default: break; } if (mod ) m_mod &= ~mod; else m_key = key; m_keyPair = OKeyPair( m_key, m_mod ); - m_lbl->setText( Opie::Ui::Private::keyToString( m_keyPair ) ); + m_lbl->setText( Opie::Ui::Internal::keyToString( m_keyPair ) ); } } void OKeyChooserConfigDialog::slotTimeUp() { m_mod = m_key = 0; QTimer::singleShot(0, this, SIGNAL(keyCaptured()) ); } 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 @@ -16,25 +16,25 @@ #include <qhbox.h> #include <qvaluelist.h> class QKeyEvent; class QLabel; class QPushButton; class QListViewItem; class QRadioButton; class QTimer; namespace Opie { namespace Ui { -namespace Private { +namespace Internal { class OKeyConfigWidgetPrivate; typedef QValueList<OKeyConfigWidgetPrivate> OKeyConfigWidgetPrivateList; class OKeyListViewItem; } class OListViewItem; class OListView; /** * \brief small class representing a Key with possible modifiers * This class holds information about key code and possible * modifier state. That is the lowest level of the key input * functions. @@ -244,31 +244,31 @@ public: void load(); void save(); private slots: void slotListViewItem( QListViewItem* ); void slotNoKey(); void slotDefaultKey(); void slotCustomKey(); void slotConfigure(); private: - static bool sanityCheck( Opie::Ui::Private::OKeyListViewItem* man, + static bool sanityCheck( Opie::Ui::Internal::OKeyListViewItem* man, const OKeyPair& newItem ); - void updateItem( Opie::Ui::Private::OKeyListViewItem* man, + void updateItem( Opie::Ui::Internal::OKeyListViewItem* man, const OKeyPair& newItem); void initUi(); Opie::Ui::OListView *m_view; - Opie::Ui::Private::OKeyConfigWidgetPrivateList m_list; + Opie::Ui::Internal::OKeyConfigWidgetPrivateList m_list; QLabel *m_lbl; QPushButton *m_btn; QRadioButton *m_def, *m_cus, *m_none; QWidget* m_box; ChangeMode m_mode; class Private; Private *d; }; /** * This is a small dialog that allows you to 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,21 +1,21 @@ /* * Only Internal implemented in the same .cpp file anyway */ #include <opie2/olistview.h> namespace Opie { namespace Ui { -namespace Private { +namespace Internal { static QString keyToString( const OKeyPair& ); static void fixupKeys( int&, int&, QKeyEvent* ); class OKeyListViewItem : public Opie::Ui::OListViewItem { public: OKeyListViewItem( const OKeyConfigItem& item, OKeyConfigManager*, Opie::Ui::OListViewItem* parent); ~OKeyListViewItem(); void setDefault(); OKeyConfigItem& item(); OKeyConfigItem origItem()const; void setItem( const OKeyConfigItem& item ); 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 @@ -32,25 +32,25 @@ #ifndef OTASKBARAPPLET_H #define OTASKBARAPPLET_H #include <qpe/taskbarappletinterface.h> #include <qpe/qcom.h> #include <qwidget.h> class QMouseEvent; namespace Opie { namespace Ui { -namespace Private { +namespace Internal { /*====================================================================================== * OTaskbarAppletWrapper *======================================================================================*/ class OTaskbarAppletWrapperPrivate; template<class T> class OTaskbarAppletWrapper : public TaskbarAppletInterface { public: OTaskbarAppletWrapper():_applet( 0 ) { } @@ -113,17 +113,17 @@ class OTaskbarApplet : public QWidget protected: virtual void popup( QWidget* widget ); private: class Private; Private *d; }; } } #define EXPORT_OPIE_APPLET_v1( AppLet ) \ Q_EXPORT_INTERFACE() { \ - Q_CREATE_INSTANCE( Opie::Ui::Private::OTaskbarAppletWrapper<AppLet> ) \ + Q_CREATE_INSTANCE( Opie::Ui::Internal::OTaskbarAppletWrapper<AppLet> ) \ } #endif |