-rw-r--r-- | examples/opiecore/oinputsystemdemo/oinputsystemdemo.cpp | 68 |
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 | |||
32 | using 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 | |||
42 | int 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 | ||