author | alwin <alwin> | 2004-08-01 19:54:59 (UTC) |
---|---|---|
committer | alwin <alwin> | 2004-08-01 19:54:59 (UTC) |
commit | 9084969d2d4fa39d4d2c185695f0c88739a0f95c (patch) (side-by-side diff) | |
tree | 4c76ee5bf61e9f0a883381d2ac68291075cfd541 | |
parent | 3d67a6ef781f59f9db936442a5b44329a0d5c70b (diff) | |
download | opie-9084969d2d4fa39d4d2c185695f0c88739a0f95c.zip opie-9084969d2d4fa39d4d2c185695f0c88739a0f95c.tar.gz opie-9084969d2d4fa39d4d2c185695f0c88739a0f95c.tar.bz2 |
cleanup - odevice is now and for future the one and only friend class
-rw-r--r-- | libopie2/opiecore/device/odevice.cpp | 57 | ||||
-rw-r--r-- | libopie2/opiecore/device/odevice.h | 49 | ||||
-rw-r--r-- | libopie2/opiecore/device/odevice_ipaq.cpp | 3 | ||||
-rw-r--r-- | libopie2/opiecore/device/odevice_simpad.cpp | 3 | ||||
-rw-r--r-- | libopie2/opiecore/okeyfilter.h | 7 |
5 files changed, 63 insertions, 56 deletions
diff --git a/libopie2/opiecore/device/odevice.cpp b/libopie2/opiecore/device/odevice.cpp index 0068d88..cd3a84c 100644 --- a/libopie2/opiecore/device/odevice.cpp +++ b/libopie2/opiecore/device/odevice.cpp @@ -1,27 +1,27 @@ /* - This file is part of the Opie Project - Copyright (C) The Opie Team <opie-devel@handhelds.org> + This file is part of the Opie Project + Copyright (C) The Opie Team <opie-devel@handhelds.org> =. .=l. - .>+-= - _;:, .> :=|. This program 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 program is distributed in the hope that - + . -:. = it will be useful, but WITHOUT ANY WARRANTY; - : .. .:, . . . without even the implied warranty of - =_ + =;=|` MERCHANTABILITY or FITNESS FOR A - _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU -..}^=.= = ; Library General Public License for more -++= -. .` .: details. - : = ...= . :.=- - -. .:....=;==+<; You should have received a copy of the GNU - -_. . . )=. = Library General Public License along with - -- :-=` this library; see the file COPYING.LIB. + .>+-= +_;:, .> :=|. This program 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 program is distributed in the hope that + + . -:. = it will be useful, but WITHOUT ANY WARRANTY; + : .. .:, . . . without even the implied warranty of + =_ + =;=|` MERCHANTABILITY or FITNESS FOR A + _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU +..}^=.= = ; Library General Public License for more +++= -. .` .: details. +: = ...= . :.=- +-. .:....=;==+<; You should have received a copy of the GNU + -_. . . )=. = Library General Public License along with + -- :-=` this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. @@ -45,6 +45,7 @@ #include <qpe/resource.h> #include <qpe/sound.h> #include <qpe/qcopenvelope_qws.h> +#include <opie2/okeyfilter.h> /* STD */ #include <fcntl.h> @@ -676,7 +677,7 @@ void ODevice::remapPressedAction ( int button, const OQCopMessage &action ) buttonFile. writeEntry ( "PressedActionChannel", (const char*) mb_chan); buttonFile. writeEntry ( "PressedActionMessage", (const char*) b. pressedAction(). message()); -// buttonFile. writeEntry ( "PressedActionArgs", encodeBase64 ( b. pressedAction(). data())); +// buttonFile. writeEntry ( "PressedActionArgs", encodeBase64 ( b. pressedAction(). data())); QCopEnvelope ( "QPE/System", "deviceButtonMappingChanged()" ); } @@ -696,7 +697,7 @@ void ODevice::remapHeldAction ( int button, const OQCopMessage &action ) buttonFile. writeEntry ( "HeldActionChannel", (const char *) b. heldAction(). channel()); buttonFile. writeEntry ( "HeldActionMessage", (const char *) b. heldAction(). message()); -// buttonFile. writeEntry ( "HeldActionArgs", decodeBase64 ( b. heldAction(). data())); +// buttonFile. writeEntry ( "HeldActionArgs", decodeBase64 ( b. heldAction(). data())); QCopEnvelope ( "QPE/System", "deviceButtonMappingChanged()" ); } @@ -712,6 +713,16 @@ void ODevice::sendSuspendmsg() QCopEnvelope ( "QPE/System", "aboutToSuspend()" ); } +void ODevice::addPreHandler(QWSServer::KeyboardFilter*aFilter) +{ + Opie::Core::OKeyFilter::inst()->addPreHandler(aFilter); +} + +void ODevice::remPreHandler(QWSServer::KeyboardFilter*aFilter) +{ + Opie::Core::OKeyFilter::inst()->remPreHandler(aFilter); +} + } } diff --git a/libopie2/opiecore/device/odevice.h b/libopie2/opiecore/device/odevice.h index 0465d7e..762d3f1 100644 --- a/libopie2/opiecore/device/odevice.h +++ b/libopie2/opiecore/device/odevice.h @@ -1,27 +1,27 @@ /* - This file is part of the Opie Project - Copyright (C) The Opie Team <opie-devel@handhelds.org> + This file is part of the Opie Project + Copyright (C) The Opie Team <opie-devel@handhelds.org> =. .=l. - .>+-= - _;:, .> :=|. This program 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 program is distributed in the hope that - + . -:. = it will be useful, but WITHOUT ANY WARRANTY; - : .. .:, . . . without even the implied warranty of - =_ + =;=|` MERCHANTABILITY or FITNESS FOR A - _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU -..}^=.= = ; Library General Public License for more -++= -. .` .: details. - : = ...= . :.=- - -. .:....=;==+<; You should have received a copy of the GNU - -_. . . )=. = Library General Public License along with - -- :-=` this library; see the file COPYING.LIB. + .>+-= +_;:, .> :=|. This program 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 program is distributed in the hope that + + . -:. = it will be useful, but WITHOUT ANY WARRANTY; + : .. .:, . . . without even the implied warranty of + =_ + =;=|` MERCHANTABILITY or FITNESS FOR A + _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU +..}^=.= = ; Library General Public License for more +++= -. .` .: details. +: = ...= . :.=- +-. .:....=;==+<; You should have received a copy of the GNU + -_. . . )=. = Library General Public License along with + -- :-=` this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. @@ -39,6 +39,7 @@ #include <qobject.h> #include <qstring.h> #include <qstrlist.h> +#include <qwindowsystem_qws.h> namespace Opie{ namespace Core{ @@ -253,9 +254,9 @@ public: virtual int displayContrastResolution() const; // don't add new virtual methods, use this: - // /*virtual */ void boo(int i ) { return virtual_hook(1,&i); }; + // /*virtual */ void boo(int i ) { return virtual_hook(1,&i); }; // and in your subclass do do overwrite - // protected virtual int virtual_hook(int, void *) + // protected virtual int virtual_hook(int, void *) // which is defined below // input / output @@ -319,6 +320,8 @@ private slots: void systemMessage ( const QCString &, const QByteArray & ); protected: + void addPreHandler(QWSServer::KeyboardFilter*aFilter); + void remPreHandler(QWSServer::KeyboardFilter*aFilter); void reloadButtonMapping(); /* ugly virtual hook */ virtual void virtual_hook( int id, void* data ); diff --git a/libopie2/opiecore/device/odevice_ipaq.cpp b/libopie2/opiecore/device/odevice_ipaq.cpp index 791e409..21fed99 100644 --- a/libopie2/opiecore/device/odevice_ipaq.cpp +++ b/libopie2/opiecore/device/odevice_ipaq.cpp @@ -169,8 +169,7 @@ void iPAQ::initButtons() return; if ( isQWS( ) ) { - Opie::Core::OKeyFilter::inst()->addPreHandler(this); - //QWSServer::setKeyboardFilter ( this ); + addPreHandler(this); } d->m_buttons = new QValueList <ODeviceButton>; diff --git a/libopie2/opiecore/device/odevice_simpad.cpp b/libopie2/opiecore/device/odevice_simpad.cpp index 6c3253c..bf46e43 100644 --- a/libopie2/opiecore/device/odevice_simpad.cpp +++ b/libopie2/opiecore/device/odevice_simpad.cpp @@ -147,8 +147,7 @@ void SIMpad::initButtons() return; if ( isQWS( ) ) { - Opie::Core::OKeyFilter::inst()->addPreHandler(this); -// QWSServer::setKeyboardFilter ( this ); + addPreHandler(this); } diff --git a/libopie2/opiecore/okeyfilter.h b/libopie2/opiecore/okeyfilter.h index a65bc48..d183641 100644 --- a/libopie2/opiecore/okeyfilter.h +++ b/libopie2/opiecore/okeyfilter.h @@ -33,10 +33,7 @@ _;:, .> :=|. This program is free software; you can namespace Opie { namespace Core { class ODevice; -namespace Internal { - class iPAQ; - class SIMpad; -} + /** * A singleton which will manage all possible keyboard filters inside opie. @@ -50,8 +47,6 @@ namespace Internal { class OKeyFilter { friend class Opie::Core::ODevice; - friend class Opie::Core::Internal::iPAQ; - friend class Opie::Core::Internal::SIMpad; protected: /** |