-rw-r--r-- | noncore/apps/zsafe/main.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/noncore/apps/zsafe/main.cpp b/noncore/apps/zsafe/main.cpp index 5f48f77..c187520 100644 --- a/noncore/apps/zsafe/main.cpp +++ b/noncore/apps/zsafe/main.cpp | |||
@@ -1,116 +1,118 @@ | |||
1 | /* | 1 | /* |
2 | ** Author: Carsten Schneider <CarstenSchneider@t-online.de> | 2 | ** Author: Carsten Schneider <CarstenSchneider@t-online.de> |
3 | ** | 3 | ** |
4 | ** $Id$ | 4 | ** $Id$ |
5 | ** | 5 | ** |
6 | ** Homepage: http://home.t-online.de/home/CarstenSchneider/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 | 11 | ||
12 | #ifndef NO_OPIE | ||
12 | /* OPIE */ | 13 | /* OPIE */ |
13 | #include <opie2/odebug.h> | 14 | #include <opie2/odebug.h> |
14 | using namespace Opie::Core; | 15 | using namespace Opie::Core; |
16 | #endif | ||
15 | 17 | ||
16 | /* QT */ | 18 | /* QT */ |
17 | #ifdef DESKTOP | 19 | #ifdef DESKTOP |
18 | #include <qapplication.h> | 20 | #include <qapplication.h> |
19 | #else | 21 | #else |
20 | #include <qpe/qpeapplication.h> | 22 | #include <qpe/qpeapplication.h> |
21 | #endif | 23 | #endif |
22 | 24 | ||
23 | /* STD */ | 25 | /* STD */ |
24 | #include <stdio.h> | 26 | #include <stdio.h> |
25 | #include <signal.h> | 27 | #include <signal.h> |
26 | 28 | ||
27 | ZSafe *zs; | 29 | ZSafe *zs; |
28 | #ifdef DESKTOP | 30 | #ifdef DESKTOP |
29 | QApplication *appl; | 31 | QApplication *appl; |
30 | #else | 32 | #else |
31 | QPEApplication *appl; | 33 | QPEApplication *appl; |
32 | #endif | 34 | #endif |
33 | 35 | ||
34 | int DeskW; | 36 | int DeskW; |
35 | int DeskH; | 37 | int DeskH; |
36 | 38 | ||
37 | void suspend (int signum) | 39 | void suspend (int signum) |
38 | { | 40 | { |
39 | printf ("Suspend signal %d received\n", signum); | 41 | printf ("Suspend signal %d received\n", signum); |
40 | } | 42 | } |
41 | 43 | ||
42 | void resume (int signum) | 44 | void resume (int signum) |
43 | { | 45 | { |
44 | printf ("Resume signal %d received\n", signum); | 46 | printf ("Resume signal %d received\n", signum); |
45 | zs->resume(signum); | 47 | zs->resume(signum); |
46 | } | 48 | } |
47 | 49 | ||
48 | int main( int argc, char ** argv ) | 50 | int main( int argc, char ** argv ) |
49 | { | 51 | { |
50 | #ifndef WIN32 | 52 | #ifndef WIN32 |
51 | // install signal handler | 53 | // install signal handler |
52 | signal (SIGSTOP, suspend); | 54 | signal (SIGSTOP, suspend); |
53 | #endif | 55 | #endif |
54 | 56 | ||
55 | #ifdef DESKTOP | 57 | #ifdef DESKTOP |
56 | QApplication a( argc, argv ); | 58 | QApplication a( argc, argv ); |
57 | #else | 59 | #else |
58 | QPEApplication a( argc, argv ); | 60 | QPEApplication a( argc, argv ); |
59 | #endif | 61 | #endif |
60 | appl = &a; | 62 | appl = &a; |
61 | 63 | ||
62 | #ifdef DESKTOP | 64 | #ifdef DESKTOP |
63 | if (argc >= 3) | 65 | if (argc >= 3) |
64 | { | 66 | { |
65 | #ifndef WIN32 | 67 | #ifndef WIN32 |
66 | DeskW = atoi(argv[1]); | 68 | DeskW = atoi(argv[1]); |
67 | DeskH = atoi(argv[2]); | 69 | DeskH = atoi(argv[2]); |
68 | #else | 70 | #else |
69 | int w, h; | 71 | int w, h; |
70 | sscanf (argv[1], "%d", &w); | 72 | sscanf (argv[1], "%d", &w); |
71 | sscanf (argv[2], "%d", &h); | 73 | sscanf (argv[2], "%d", &h); |
72 | DeskW = w; | 74 | DeskW = w; |
73 | DeskH = h; | 75 | DeskH = h; |
74 | #endif | 76 | #endif |
75 | } | 77 | } |
76 | else | 78 | else |
77 | { | 79 | { |
78 | DeskW = 600; | 80 | DeskW = 600; |
79 | DeskH = 400; | 81 | DeskH = 400; |
80 | } | 82 | } |
81 | #else | 83 | #else |
82 | DeskW = a.desktop()->width(); | 84 | DeskW = a.desktop()->width(); |
83 | DeskH = a.desktop()->height(); | 85 | DeskH = a.desktop()->height(); |
84 | 86 | ||
85 | owarn << "Width: " << DeskW << " Height: " << DeskH << oendl; | 87 | owarn << "Width: " << DeskW << " Height: " << DeskH << oendl; |
86 | 88 | ||
87 | #ifdef JPATCH_HDE | 89 | #ifdef JPATCH_HDE |
88 | // nothings | 90 | // nothings |
89 | #else | 91 | #else |
90 | if (DeskW > 240) | 92 | if (DeskW > 240) |
91 | { | 93 | { |
92 | DeskW -= 20; | 94 | DeskW -= 20; |
93 | DeskH += 25; | 95 | DeskH += 25; |
94 | owarn << "Changed width: " << DeskW << " Height: " << DeskH << oendl; | 96 | owarn << "Changed width: " << DeskW << " Height: " << DeskH << oendl; |
95 | } | 97 | } |
96 | #endif | 98 | #endif |
97 | 99 | ||
98 | #endif | 100 | #endif |
99 | 101 | ||
100 | ZSafe mw; | 102 | ZSafe mw; |
101 | zs = &mw; | 103 | zs = &mw; |
102 | 104 | ||
103 | #ifndef WIN32 | 105 | #ifndef WIN32 |
104 | signal (SIGCONT, resume); | 106 | signal (SIGCONT, resume); |
105 | #endif | 107 | #endif |
106 | #ifdef DESKTOP | 108 | #ifdef DESKTOP |
107 | a.setMainWidget(&mw); | 109 | a.setMainWidget(&mw); |
108 | mw.show(); | 110 | mw.show(); |
109 | #else | 111 | #else |
110 | // a.showMainWidget( &mw ); | 112 | // a.showMainWidget( &mw ); |
111 | a.showMainDocumentWidget( &mw ); | 113 | a.showMainDocumentWidget( &mw ); |
112 | #endif | 114 | #endif |
113 | int ret = a.exec(); | 115 | int ret = a.exec(); |
114 | 116 | ||
115 | return ret; | 117 | return ret; |
116 | } | 118 | } |