author | zcarsten <zcarsten> | 2003-08-14 07:19:50 (UTC) |
---|---|---|
committer | zcarsten <zcarsten> | 2003-08-14 07:19:50 (UTC) |
commit | bbe788821dd43351b96c7a8826f1b7d904f33fdb (patch) (unidiff) | |
tree | bdb188bf21b37c88a245a1f180c68283ababa67d | |
parent | 1ff9232b95b7f8ea0d841a3b9219eaa7e82f1d62 (diff) | |
download | opie-bbe788821dd43351b96c7a8826f1b7d904f33fdb.zip opie-bbe788821dd43351b96c7a8826f1b7d904f33fdb.tar.gz opie-bbe788821dd43351b96c7a8826f1b7d904f33fdb.tar.bz2 |
changes for japanese C7x0 support
-rw-r--r-- | noncore/apps/zsafe/main.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/noncore/apps/zsafe/main.cpp b/noncore/apps/zsafe/main.cpp index e225775..7ff549b 100644 --- a/noncore/apps/zsafe/main.cpp +++ b/noncore/apps/zsafe/main.cpp | |||
@@ -1,106 +1,112 @@ | |||
1 | /* | 1 | /* |
2 | ** Author: Carsten Schneider <zcarsten@gmx.net> | 2 | ** Author: Carsten Schneider <CarstenSchneider@t-online.de> |
3 | ** | 3 | ** |
4 | ** $Id$ | 4 | ** $Id$ |
5 | ** | 5 | ** |
6 | ** Homepage: http://z-soft.z-portal.info/zsafe/index.html | 6 | ** Homepage: http://home.t-online.de/home/CarstenSchneider/zsafe/index.html |
7 | */ | 7 | */ |
8 | 8 | ||
9 | 9 | ||
10 | #include "zsafe.h" | 10 | #include "zsafe.h" |
11 | #ifdef DESKTOP | 11 | #ifdef DESKTOP |
12 | #include <qapplication.h> | 12 | #include <qapplication.h> |
13 | #else | 13 | #else |
14 | #include <qpe/qpeapplication.h> | 14 | #include <qpe/qpeapplication.h> |
15 | #endif | 15 | #endif |
16 | #include <stdio.h> | 16 | #include <stdio.h> |
17 | #include <signal.h> | 17 | #include <signal.h> |
18 | #include "qsettings.h" | 18 | #include "qsettings.h" |
19 | 19 | ||
20 | ZSafe *zs; | 20 | ZSafe *zs; |
21 | #ifdef DESKTOP | 21 | #ifdef DESKTOP |
22 | QApplication *appl; | 22 | QApplication *appl; |
23 | #else | 23 | #else |
24 | QPEApplication *appl; | 24 | QPEApplication *appl; |
25 | #endif | 25 | #endif |
26 | 26 | ||
27 | int DeskW; | 27 | int DeskW; |
28 | int DeskH; | 28 | int DeskH; |
29 | 29 | ||
30 | void suspend (int signum) | 30 | void suspend (int signum) |
31 | { | 31 | { |
32 | printf ("Suspend signal %d received\n", signum); | 32 | printf ("Suspend signal %d received\n", signum); |
33 | } | 33 | } |
34 | 34 | ||
35 | void resume (int signum) | 35 | void resume (int signum) |
36 | { | 36 | { |
37 | printf ("Resume signal %d received\n", signum); | 37 | printf ("Resume signal %d received\n", signum); |
38 | zs->resume(signum); | 38 | zs->resume(signum); |
39 | } | 39 | } |
40 | 40 | ||
41 | int main( int argc, char ** argv ) | 41 | int main( int argc, char ** argv ) |
42 | { | 42 | { |
43 | #ifndef WIN32 | 43 | #ifndef WIN32 |
44 | // install signal handler | 44 | // install signal handler |
45 | signal (SIGSTOP, suspend); | 45 | signal (SIGSTOP, suspend); |
46 | #endif | 46 | #endif |
47 | 47 | ||
48 | #ifdef DESKTOP | 48 | #ifdef DESKTOP |
49 | QApplication a( argc, argv ); | 49 | QApplication a( argc, argv ); |
50 | #else | 50 | #else |
51 | QPEApplication a( argc, argv ); | 51 | QPEApplication a( argc, argv ); |
52 | #endif | 52 | #endif |
53 | appl = &a; | 53 | appl = &a; |
54 | 54 | ||
55 | #ifdef DESKTOP | 55 | #ifdef DESKTOP |
56 | if (argc >= 3) | 56 | if (argc >= 3) |
57 | { | 57 | { |
58 | #ifndef WIN32 | 58 | #ifndef WIN32 |
59 | DeskW = atoi(argv[1]); | 59 | DeskW = atoi(argv[1]); |
60 | DeskH = atoi(argv[2]); | 60 | DeskH = atoi(argv[2]); |
61 | #else | 61 | #else |
62 | int w, h; | 62 | int w, h; |
63 | sscanf (argv[1], "%d", &w); | 63 | sscanf (argv[1], "%d", &w); |
64 | sscanf (argv[2], "%d", &h); | 64 | sscanf (argv[2], "%d", &h); |
65 | DeskW = w; | 65 | DeskW = w; |
66 | DeskH = h; | 66 | DeskH = h; |
67 | #endif | 67 | #endif |
68 | } | 68 | } |
69 | else | 69 | else |
70 | { | 70 | { |
71 | DeskW = 600; | 71 | DeskW = 600; |
72 | DeskH = 400; | 72 | DeskH = 400; |
73 | } | 73 | } |
74 | #else | 74 | #else |
75 | DeskW = a.desktop()->width(); | 75 | DeskW = a.desktop()->width(); |
76 | DeskH = a.desktop()->height(); | 76 | DeskH = a.desktop()->height(); |
77 | 77 | ||
78 | char buf[128]; | 78 | char buf[128]; |
79 | sprintf (buf, "Width: %d Height: %d\n", DeskW, DeskH); | 79 | sprintf (buf, "Width: %d Height: %d\n", DeskW, DeskH); |
80 | qWarning (buf); | 80 | qWarning (buf); |
81 | |||
82 | #ifdef JPATCH_HDE | ||
83 | // nothings | ||
84 | #else | ||
81 | if (DeskW > 240) | 85 | if (DeskW > 240) |
82 | { | 86 | { |
83 | DeskW -= 20; | 87 | DeskW -= 20; |
84 | DeskH += 25; | 88 | DeskH += 25; |
85 | sprintf (buf, "Changed width: %d Height: %d\n", DeskW, DeskH); | 89 | sprintf (buf, "Changed width: %d Height: %d\n", DeskW, DeskH); |
86 | qWarning (buf); | 90 | qWarning (buf); |
87 | } | 91 | } |
88 | #endif | 92 | #endif |
89 | 93 | ||
94 | #endif | ||
95 | |||
90 | ZSafe mw; | 96 | ZSafe mw; |
91 | zs = &mw; | 97 | zs = &mw; |
92 | 98 | ||
93 | #ifndef WIN32 | 99 | #ifndef WIN32 |
94 | signal (SIGCONT, resume); | 100 | signal (SIGCONT, resume); |
95 | #endif | 101 | #endif |
96 | #ifdef DESKTOP | 102 | #ifdef DESKTOP |
97 | a.setMainWidget(&mw); | 103 | a.setMainWidget(&mw); |
98 | mw.show(); | 104 | mw.show(); |
99 | #else | 105 | #else |
100 | // a.showMainWidget( &mw ); | 106 | // a.showMainWidget( &mw ); |
101 | a.showMainDocumentWidget( &mw ); | 107 | a.showMainDocumentWidget( &mw ); |
102 | #endif | 108 | #endif |
103 | int ret = a.exec(); | 109 | int ret = a.exec(); |
104 | 110 | ||
105 | return ret; | 111 | return ret; |
106 | } | 112 | } |