summaryrefslogtreecommitdiff
path: root/examples
authormickeyl <mickeyl>2005-02-02 15:23:01 (UTC)
committer mickeyl <mickeyl>2005-02-02 15:23:01 (UTC)
commit227d06128b74ef78b8268e18dabe454469b65cc8 (patch) (unidiff)
tree64632ebff3bb6df1ba81ce1e70638cbce15de33c /examples
parent1a5dc271114432e0e598af499c076bfbf69ff972 (diff)
downloadopie-227d06128b74ef78b8268e18dabe454469b65cc8.zip
opie-227d06128b74ef78b8268e18dabe454469b65cc8.tar.gz
opie-227d06128b74ef78b8268e18dabe454469b65cc8.tar.bz2
first work on input system abstractions
Diffstat (limited to 'examples') (more/less context) (ignore whitespace changes)
-rw-r--r--examples/opiecore/oinputsystemdemo/oinputsystemdemo.cpp68
1 files changed, 68 insertions, 0 deletions
diff --git a/examples/opiecore/oinputsystemdemo/oinputsystemdemo.cpp b/examples/opiecore/oinputsystemdemo/oinputsystemdemo.cpp
index 89209a7..5450966 100644
--- a/examples/opiecore/oinputsystemdemo/oinputsystemdemo.cpp
+++ b/examples/opiecore/oinputsystemdemo/oinputsystemdemo.cpp
@@ -1,3 +1,70 @@
1/*
2                 This file is part of the Opie Project
3 =. (C) 2005 Michael 'Mickey' Lauer <mickey@Vanille.de>
4 .=l.
5           .>+-=
6 _;:,     .>    :=|. This program is free software; you can
7.> <`_,   >  .   <= redistribute it and/or modify it under
8:`=1 )Y*s>-.--   : the terms of the GNU Library General Public
9.="- .-=="i,     .._ License as published by the Free Software
10 - .   .-<_>     .<> Foundation; either version 2 of the License,
11     ._= =}       : or (at your option) any later version.
12    .%`+i>       _;_.
13    .i_,=:_.      -<s. This program is distributed in the hope that
14     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
15    : ..    .:,     . . . without even the implied warranty of
16    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
17  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU
18..}^=.=       =       ; Library General Public License for more
19++=   -.     .`     .: details.
20 :     =  ...= . :.=-
21 -.   .:....=;==+<; You should have received a copy of the GNU
22  -_. . .   )=.  = Library General Public License along with
23    --        :-=` this library; see the file COPYING.LIB.
24 If not, write to the Free Software Foundation,
25 Inc., 59 Temple Place - Suite 330,
26 Boston, MA 02111-1307, USA.
27*/
28
29#include <opie2/odebug.h>
30#include <opie2/oinputsystem.h>
31
32using namespace Opie::Core;
33
34#include <stdlib.h>
35#include <stdio.h>
36#include <unistd.h>
37#include <sys/ioctl.h>
38#include <sys/fcntl.h>
39
40#if 1
41
42int main( int argc, char** argv )
43{
44 OInputSystem* sys = OInputSystem::instance();
45 OInputSystem::DeviceIterator it = sys->iterator();
46
47 OInputDevice* dev = 0;
48
49 while ( it.current() )
50 {
51 odebug << "DEMO: OInputSystem contains Device '" << it.current()->name() << "'" << oendl;
52
53 dev = it.current();
54
55 odebug << "========================================"
56 << "\nDevice: " << dev->name()
57 << "\nName: " << dev->identity()
58 << "\nPath: " << dev->path()
59 << "\nUniq: " << dev->uniq()
60 << oendl;
61
62 ++it;
63 }
64}
65
66#else
67
1#include <fcntl.h> 68#include <fcntl.h>
2#include <unistd.h> 69#include <unistd.h>
3#include <cstdlib> 70#include <cstdlib>
@@ -248,3 +315,4 @@ hell:
248 exit( EXIT_FAILURE ); 315 exit( EXIT_FAILURE );
249} 316}
250 317
318#endif \ No newline at end of file