author | alwin <alwin> | 2004-08-01 19:54:59 (UTC) |
---|---|---|
committer | alwin <alwin> | 2004-08-01 19:54:59 (UTC) |
commit | 9084969d2d4fa39d4d2c185695f0c88739a0f95c (patch) (unidiff) | |
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 | 53 | ||||
-rw-r--r-- | libopie2/opiecore/device/odevice.h | 45 | ||||
-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, 59 insertions, 52 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 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of the Opie Project | 2 | This file is part of the Opie Project |
3 | Copyright (C) The Opie Team <opie-devel@handhelds.org> | 3 | Copyright (C) The Opie Team <opie-devel@handhelds.org> |
4 | =. | 4 | =. |
5 | .=l. | 5 | .=l. |
6 | .>+-= | 6 | .>+-= |
7 | _;:, .> :=|. This program is free software; you can | 7 | _;:, .> :=|. This program is free software; you can |
8 | .> <`_, > . <= redistribute it and/or modify it under | 8 | .> <`_, > . <= redistribute it and/or modify it under |
9 | :`=1 )Y*s>-.-- : the terms of the GNU Library General Public | 9 | :`=1 )Y*s>-.-- : the terms of the GNU Library General Public |
10 | .="- .-=="i, .._ License as published by the Free Software | 10 | .="- .-=="i, .._ License as published by the Free Software |
11 | - . .-<_> .<> Foundation; either version 2 of the License, | 11 | - . .-<_> .<> Foundation; either version 2 of the License, |
12 | ._= =} : or (at your option) any later version. | 12 | ._= =} : or (at your option) any later version. |
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. |
@@ -45,6 +45,7 @@ | |||
45 | #include <qpe/resource.h> | 45 | #include <qpe/resource.h> |
46 | #include <qpe/sound.h> | 46 | #include <qpe/sound.h> |
47 | #include <qpe/qcopenvelope_qws.h> | 47 | #include <qpe/qcopenvelope_qws.h> |
48 | #include <opie2/okeyfilter.h> | ||
48 | 49 | ||
49 | /* STD */ | 50 | /* STD */ |
50 | #include <fcntl.h> | 51 | #include <fcntl.h> |
@@ -712,6 +713,16 @@ void ODevice::sendSuspendmsg() | |||
712 | QCopEnvelope ( "QPE/System", "aboutToSuspend()" ); | 713 | QCopEnvelope ( "QPE/System", "aboutToSuspend()" ); |
713 | } | 714 | } |
714 | 715 | ||
716 | void ODevice::addPreHandler(QWSServer::KeyboardFilter*aFilter) | ||
717 | { | ||
718 | Opie::Core::OKeyFilter::inst()->addPreHandler(aFilter); | ||
719 | } | ||
720 | |||
721 | void ODevice::remPreHandler(QWSServer::KeyboardFilter*aFilter) | ||
722 | { | ||
723 | Opie::Core::OKeyFilter::inst()->remPreHandler(aFilter); | ||
724 | } | ||
725 | |||
715 | 726 | ||
716 | } | 727 | } |
717 | } | 728 | } |
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 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of the Opie Project | 2 | This file is part of the Opie Project |
3 | Copyright (C) The Opie Team <opie-devel@handhelds.org> | 3 | Copyright (C) The Opie Team <opie-devel@handhelds.org> |
4 | =. | 4 | =. |
5 | .=l. | 5 | .=l. |
6 | .>+-= | 6 | .>+-= |
7 | _;:, .> :=|. This program is free software; you can | 7 | _;:, .> :=|. This program is free software; you can |
8 | .> <`_, > . <= redistribute it and/or modify it under | 8 | .> <`_, > . <= redistribute it and/or modify it under |
9 | :`=1 )Y*s>-.-- : the terms of the GNU Library General Public | 9 | :`=1 )Y*s>-.-- : the terms of the GNU Library General Public |
10 | .="- .-=="i, .._ License as published by the Free Software | 10 | .="- .-=="i, .._ License as published by the Free Software |
11 | - . .-<_> .<> Foundation; either version 2 of the License, | 11 | - . .-<_> .<> Foundation; either version 2 of the License, |
12 | ._= =} : or (at your option) any later version. | 12 | ._= =} : or (at your option) any later version. |
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. |
@@ -39,6 +39,7 @@ | |||
39 | #include <qobject.h> | 39 | #include <qobject.h> |
40 | #include <qstring.h> | 40 | #include <qstring.h> |
41 | #include <qstrlist.h> | 41 | #include <qstrlist.h> |
42 | #include <qwindowsystem_qws.h> | ||
42 | 43 | ||
43 | namespace Opie{ | 44 | namespace Opie{ |
44 | namespace Core{ | 45 | namespace Core{ |
@@ -319,6 +320,8 @@ private slots: | |||
319 | void systemMessage ( const QCString &, const QByteArray & ); | 320 | void systemMessage ( const QCString &, const QByteArray & ); |
320 | 321 | ||
321 | protected: | 322 | protected: |
323 | void addPreHandler(QWSServer::KeyboardFilter*aFilter); | ||
324 | void remPreHandler(QWSServer::KeyboardFilter*aFilter); | ||
322 | void reloadButtonMapping(); | 325 | void reloadButtonMapping(); |
323 | /* ugly virtual hook */ | 326 | /* ugly virtual hook */ |
324 | virtual void virtual_hook( int id, void* data ); | 327 | 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() | |||
169 | return; | 169 | return; |
170 | 170 | ||
171 | if ( isQWS( ) ) { | 171 | if ( isQWS( ) ) { |
172 | Opie::Core::OKeyFilter::inst()->addPreHandler(this); | 172 | addPreHandler(this); |
173 | //QWSServer::setKeyboardFilter ( this ); | ||
174 | } | 173 | } |
175 | 174 | ||
176 | d->m_buttons = new QValueList <ODeviceButton>; | 175 | 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() | |||
147 | return; | 147 | return; |
148 | 148 | ||
149 | if ( isQWS( ) ) { | 149 | if ( isQWS( ) ) { |
150 | Opie::Core::OKeyFilter::inst()->addPreHandler(this); | 150 | addPreHandler(this); |
151 | // QWSServer::setKeyboardFilter ( this ); | ||
152 | } | 151 | } |
153 | 152 | ||
154 | 153 | ||
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 | |||
33 | namespace Opie { | 33 | namespace Opie { |
34 | namespace Core { | 34 | namespace Core { |
35 | class ODevice; | 35 | class ODevice; |
36 | namespace Internal { | 36 | |
37 | class iPAQ; | ||
38 | class SIMpad; | ||
39 | } | ||
40 | 37 | ||
41 | /** | 38 | /** |
42 | * A singleton which will manage all possible keyboard filters inside opie. | 39 | * A singleton which will manage all possible keyboard filters inside opie. |
@@ -50,8 +47,6 @@ namespace Internal { | |||
50 | class OKeyFilter | 47 | class OKeyFilter |
51 | { | 48 | { |
52 | friend class Opie::Core::ODevice; | 49 | friend class Opie::Core::ODevice; |
53 | friend class Opie::Core::Internal::iPAQ; | ||
54 | friend class Opie::Core::Internal::SIMpad; | ||
55 | 50 | ||
56 | protected: | 51 | protected: |
57 | /** | 52 | /** |