From 9084969d2d4fa39d4d2c185695f0c88739a0f95c Mon Sep 17 00:00:00 2001 From: alwin Date: Sun, 01 Aug 2004 19:54:59 +0000 Subject: cleanup - odevice is now and for future the one and only friend class --- (limited to 'libopie2/opiecore') 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 + This file is part of the Opie Project + Copyright (C) The Opie Team =. .=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_,=:_.      -`: 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_,=:_. -`: 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 #include #include +#include /* STD */ #include @@ -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 + This file is part of the Opie Project + Copyright (C) The Opie Team =. .=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_,=:_.      -`: 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_,=:_. -`: 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 #include #include +#include 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 ; 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: /** -- cgit v0.9.0.2