summaryrefslogtreecommitdiff
authoralwin <alwin>2004-08-01 19:54:59 (UTC)
committer alwin <alwin>2004-08-01 19:54:59 (UTC)
commit9084969d2d4fa39d4d2c185695f0c88739a0f95c (patch) (side-by-side diff)
tree4c76ee5bf61e9f0a883381d2ac68291075cfd541
parent3d67a6ef781f59f9db936442a5b44329a0d5c70b (diff)
downloadopie-9084969d2d4fa39d4d2c185695f0c88739a0f95c.zip
opie-9084969d2d4fa39d4d2c185695f0c88739a0f95c.tar.gz
opie-9084969d2d4fa39d4d2c185695f0c88739a0f95c.tar.bz2
cleanup - odevice is now and for future the one and only friend class
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/opiecore/device/odevice.cpp57
-rw-r--r--libopie2/opiecore/device/odevice.h49
-rw-r--r--libopie2/opiecore/device/odevice_ipaq.cpp3
-rw-r--r--libopie2/opiecore/device/odevice_simpad.cpp3
-rw-r--r--libopie2/opiecore/okeyfilter.h7
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,25 +1,25 @@
/*
-                 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,
@@ -47,2 +47,3 @@
#include <qpe/qcopenvelope_qws.h>
+#include <opie2/okeyfilter.h>
@@ -678,3 +679,3 @@ void ODevice::remapPressedAction ( int button, const OQCopMessage &action )
-// buttonFile. writeEntry ( "PressedActionArgs", encodeBase64 ( b. pressedAction(). data()));
+// buttonFile. writeEntry ( "PressedActionArgs", encodeBase64 ( b. pressedAction(). data()));
@@ -698,3 +699,3 @@ void ODevice::remapHeldAction ( int button, const OQCopMessage &action )
-// buttonFile. writeEntry ( "HeldActionArgs", decodeBase64 ( b. heldAction(). data()));
+// buttonFile. writeEntry ( "HeldActionArgs", decodeBase64 ( b. heldAction(). data()));
@@ -714,2 +715,12 @@ void ODevice::sendSuspendmsg()
+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,25 +1,25 @@
/*
-                 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,
@@ -41,2 +41,3 @@
#include <qstrlist.h>
+#include <qwindowsystem_qws.h>
@@ -255,5 +256,5 @@ public:
// 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
@@ -321,2 +322,4 @@ private slots:
protected:
+ void addPreHandler(QWSServer::KeyboardFilter*aFilter);
+ void remPreHandler(QWSServer::KeyboardFilter*aFilter);
void reloadButtonMapping();
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
@@ -171,4 +171,3 @@ void iPAQ::initButtons()
if ( isQWS( ) ) {
- Opie::Core::OKeyFilter::inst()->addPreHandler(this);
- //QWSServer::setKeyboardFilter ( this );
+ addPreHandler(this);
}
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
@@ -149,4 +149,3 @@ void SIMpad::initButtons()
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
@@ -35,6 +35,3 @@ namespace Core {
class ODevice;
-namespace Internal {
- class iPAQ;
- class SIMpad;
-}
+
@@ -52,4 +49,2 @@ class OKeyFilter
friend class Opie::Core::ODevice;
- friend class Opie::Core::Internal::iPAQ;
- friend class Opie::Core::Internal::SIMpad;