author | eilers <eilers> | 2003-11-03 16:52:18 (UTC) |
---|---|---|
committer | eilers <eilers> | 2003-11-03 16:52:18 (UTC) |
commit | d34dc773591a2d467c68875a68a671d6a809f861 (patch) (unidiff) | |
tree | b57e5ae15c51e3d87ca95d57aedfd1ca3db57bfe /libopie/odevice.cpp | |
parent | ce84f2d8bdd65c438821f0457cdad6bbbfa73380 (diff) | |
download | opie-d34dc773591a2d467c68875a68a671d6a809f861.zip opie-d34dc773591a2d467c68875a68a671d6a809f861.tar.gz opie-d34dc773591a2d467c68875a68a671d6a809f861.tar.bz2 |
Porting Opie to MacOS-X.
The base system and all platform independent applications and platforms
should work.
Please see $OPIEDIR/development/macosx for details
-rw-r--r-- | libopie/odevice.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/libopie/odevice.cpp b/libopie/odevice.cpp index 3edf8e7..fef623a 100644 --- a/libopie/odevice.cpp +++ b/libopie/odevice.cpp | |||
@@ -1,90 +1,92 @@ | |||
1 | /* This file is part of the OPIE libraries | 1 | /* This file is part of the OPIE libraries |
2 | Copyright (C) 2002 Robert Griebl (sandman@handhelds.org) | 2 | Copyright (C) 2002 Robert Griebl (sandman@handhelds.org) |
3 | 3 | ||
4 | This library is free software; you can redistribute it and/or | 4 | This library is free software; you can redistribute it and/or |
5 | modify it under the terms of the GNU Library General Public | 5 | modify it under the terms of the GNU Library General Public |
6 | License as published by the Free Software Foundation; either | 6 | License as published by the Free Software Foundation; either |
7 | version 2 of the License, or (at your option) any later version. | 7 | version 2 of the License, or (at your option) any later version. |
8 | 8 | ||
9 | This library is distributed in the hope that it will be useful, | 9 | This library is distributed in the hope that it will be useful, |
10 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
12 | Library General Public License for more details. | 12 | Library General Public License for more details. |
13 | 13 | ||
14 | You should have received a copy of the GNU Library General Public License | 14 | You should have received a copy of the GNU Library General Public License |
15 | along with this library; see the file COPYING.LIB. If not, write to | 15 | along with this library; see the file COPYING.LIB. If not, write to |
16 | the Free Software Foundation, Inc., 59 Temple Place - Suite 330, | 16 | the Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
17 | Boston, MA 02111-1307, USA. | 17 | Boston, MA 02111-1307, USA. |
18 | */ | 18 | */ |
19 | 19 | ||
20 | #include <stdlib.h> | 20 | #include <stdlib.h> |
21 | #include <unistd.h> | 21 | #include <unistd.h> |
22 | #include <fcntl.h> | 22 | #include <fcntl.h> |
23 | #include <sys/ioctl.h> | 23 | #include <sys/ioctl.h> |
24 | #include <signal.h> | 24 | #include <signal.h> |
25 | #include <sys/time.h> | 25 | #include <sys/time.h> |
26 | #ifndef QT_NO_SOUND | ||
26 | #include <linux/soundcard.h> | 27 | #include <linux/soundcard.h> |
28 | #endif | ||
27 | #include <math.h> | 29 | #include <math.h> |
28 | 30 | ||
29 | #include <qapplication.h> | 31 | #include <qapplication.h> |
30 | 32 | ||
31 | #include <qfile.h> | 33 | #include <qfile.h> |
32 | #include <qtextstream.h> | 34 | #include <qtextstream.h> |
33 | #include <qpe/sound.h> | 35 | #include <qpe/sound.h> |
34 | #include <qpe/resource.h> | 36 | #include <qpe/resource.h> |
35 | #include <qpe/config.h> | 37 | #include <qpe/config.h> |
36 | #include <qpe/qcopenvelope_qws.h> | 38 | #include <qpe/qcopenvelope_qws.h> |
37 | 39 | ||
38 | #include "odevice.h" | 40 | #include "odevice.h" |
39 | 41 | ||
40 | #include <qwindowsystem_qws.h> | 42 | #include <qwindowsystem_qws.h> |
41 | 43 | ||
42 | #ifndef ARRAY_SIZE | 44 | #ifndef ARRAY_SIZE |
43 | #define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0])) | 45 | #define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0])) |
44 | #endif | 46 | #endif |
45 | 47 | ||
46 | // _IO and friends are only defined in kernel headers ... | 48 | // _IO and friends are only defined in kernel headers ... |
47 | 49 | ||
48 | #define OD_IOC(dir,type,number,size) (( dir << 30 ) | ( type << 8 ) | ( number ) | ( size << 16 )) | 50 | #define OD_IOC(dir,type,number,size) (( dir << 30 ) | ( type << 8 ) | ( number ) | ( size << 16 )) |
49 | 51 | ||
50 | #define OD_IO(type,number) OD_IOC(0,type,number,0) | 52 | #define OD_IO(type,number) OD_IOC(0,type,number,0) |
51 | #define OD_IOW(type,number,size) OD_IOC(1,type,number,sizeof(size)) | 53 | #define OD_IOW(type,number,size) OD_IOC(1,type,number,sizeof(size)) |
52 | #define OD_IOR(type,number,size) OD_IOC(2,type,number,sizeof(size)) | 54 | #define OD_IOR(type,number,size) OD_IOC(2,type,number,sizeof(size)) |
53 | #define OD_IORW(type,number,size) OD_IOC(3,type,number,sizeof(size)) | 55 | #define OD_IORW(type,number,size) OD_IOC(3,type,number,sizeof(size)) |
54 | 56 | ||
55 | using namespace Opie; | 57 | using namespace Opie; |
56 | 58 | ||
57 | class ODeviceData { | 59 | class ODeviceData { |
58 | public: | 60 | public: |
59 | QString m_vendorstr; | 61 | QString m_vendorstr; |
60 | OVendor m_vendor; | 62 | OVendor m_vendor; |
61 | 63 | ||
62 | QString m_modelstr; | 64 | QString m_modelstr; |
63 | OModel m_model; | 65 | OModel m_model; |
64 | 66 | ||
65 | QString m_systemstr; | 67 | QString m_systemstr; |
66 | OSystem m_system; | 68 | OSystem m_system; |
67 | 69 | ||
68 | QString m_sysverstr; | 70 | QString m_sysverstr; |
69 | 71 | ||
70 | Transformation m_rotation; | 72 | Transformation m_rotation; |
71 | ODirection m_direction; | 73 | ODirection m_direction; |
72 | 74 | ||
73 | QValueList <ODeviceButton> *m_buttons; | 75 | QValueList <ODeviceButton> *m_buttons; |
74 | uint m_holdtime; | 76 | uint m_holdtime; |
75 | QStrList *m_cpu_frequencies; | 77 | QStrList *m_cpu_frequencies; |
76 | }; | 78 | }; |
77 | 79 | ||
78 | class iPAQ : public ODevice, public QWSServer::KeyboardFilter { | 80 | class iPAQ : public ODevice, public QWSServer::KeyboardFilter { |
79 | protected: | 81 | protected: |
80 | virtual void init ( ); | 82 | virtual void init ( ); |
81 | virtual void initButtons ( ); | 83 | virtual void initButtons ( ); |
82 | 84 | ||
83 | public: | 85 | public: |
84 | virtual bool setSoftSuspend ( bool soft ); | 86 | virtual bool setSoftSuspend ( bool soft ); |
85 | 87 | ||
86 | virtual bool setDisplayBrightness ( int b ); | 88 | virtual bool setDisplayBrightness ( int b ); |
87 | virtual int displayBrightnessResolution ( ) const; | 89 | virtual int displayBrightnessResolution ( ) const; |
88 | 90 | ||
89 | virtual void alarmSound ( ); | 91 | virtual void alarmSound ( ); |
90 | 92 | ||