]>
Commit | Line | Data |
---|---|---|
0e320a79 | 1 | ///////////////////////////////////////////////////////////////////////////// |
0e2a14e5 | 2 | // Name: src/os2/utils.cpp |
0e320a79 | 3 | // Purpose: Various utilities |
45fcbf3b | 4 | // Author: David Webster |
0e320a79 | 5 | // Modified by: |
45fcbf3b | 6 | // Created: 09/17/99 |
0e320a79 | 7 | // RCS-ID: $Id$ |
45fcbf3b | 8 | // Copyright: (c) David Webster |
65571936 | 9 | // Licence: wxWindows licence |
0e320a79 DW |
10 | ///////////////////////////////////////////////////////////////////////////// |
11 | ||
45fcbf3b DW |
12 | // For compilers that support precompilation, includes "wx.h". |
13 | #include "wx/wxprec.h" | |
14 | ||
e4db172a WS |
15 | #include "wx/utils.h" |
16 | ||
45fcbf3b | 17 | #ifndef WX_PRECOMP |
88a7a4e1 | 18 | #include "wx/intl.h" |
e4db172a | 19 | #include "wx/log.h" |
45fcbf3b DW |
20 | #endif //WX_PRECOMP |
21 | ||
22 | #include "wx/os2/private.h" | |
cd478a95 | 23 | #include "wx/apptrait.h" |
45fcbf3b | 24 | |
0e320a79 | 25 | #include <ctype.h> |
06298235 SN |
26 | #ifdef __EMX__ |
27 | #include <dirent.h> | |
06298235 | 28 | #endif |
45fcbf3b | 29 | |
45fcbf3b DW |
30 | |
31 | #include <io.h> | |
0e320a79 DW |
32 | |
33 | #include <stdio.h> | |
34 | #include <stdlib.h> | |
35 | #include <string.h> | |
45fcbf3b | 36 | #include <errno.h> |
0e320a79 DW |
37 | #include <stdarg.h> |
38 | ||
d90895ac | 39 | #define PURE_32 |
468e327a | 40 | |
6670f564 WS |
41 | #if defined(__WATCOMC__) |
42 | extern "C" | |
43 | { | |
44 | #include <upm.h> | |
45 | } | |
46 | #elif !defined(__EMX__) | |
47 | #include <upm.h> | |
48 | #include <netcons.h> | |
49 | #include <netbios.h> | |
06298235 | 50 | #endif |
45fcbf3b | 51 | |
77ffb593 | 52 | static const wxChar WX_SECTION[] = _T("wxWidgets"); |
86de7616 | 53 | static const wxChar eHOSTNAME[] = _T("HostName"); |
45fcbf3b DW |
54 | |
55 | // For the following functions we SHOULD fill in support | |
56 | // for Windows-NT (which I don't know) as I assume it begin | |
57 | // a POSIX Unix (so claims MS) that it has some special | |
58 | // functions beyond those provided by WinSock | |
59 | ||
0e320a79 | 60 | // Get full hostname (eg. DoDo.BSn-Germany.crg.de) |
63a3cd7a | 61 | bool wxGetHostName( wxChar* zBuf, int nMaxSize ) |
0e320a79 | 62 | { |
63a3cd7a WS |
63 | if (!zBuf) return false; |
64 | ||
65 | #if defined(wxUSE_NET_API) && wxUSE_NET_API | |
66 | char zServer[256]; | |
67 | char zComputer[256]; | |
68 | unsigned long ulLevel = 0; | |
69 | unsigned char* zBuffer = NULL; | |
70 | unsigned long ulBuffer = 256; | |
71 | unsigned long* pulTotalAvail = NULL; | |
10e5b930 | 72 | |
dde11e60 DW |
73 | NetBios32GetInfo( (const unsigned char*)zServer |
74 | ,(const unsigned char*)zComputer | |
909b4f08 | 75 | ,ulLevel |
dde11e60 | 76 | ,zBuffer |
909b4f08 DW |
77 | ,ulBuffer |
78 | ,pulTotalAvail | |
dde11e60 | 79 | ); |
10e5b930 | 80 | strcpy(zBuf, zServer); |
45fcbf3b | 81 | #else |
63a3cd7a WS |
82 | wxChar* zSysname; |
83 | const wxChar* zDefaultHost = _T("noname"); | |
45fcbf3b | 84 | |
10e5b930 DW |
85 | if ((zSysname = wxGetenv(_T("SYSTEM_NAME"))) == NULL) |
86 | { | |
9923c37d DW |
87 | ::PrfQueryProfileString( HINI_PROFILE |
88 | ,(PSZ)WX_SECTION | |
89 | ,(PSZ)eHOSTNAME | |
90 | ,(PSZ)zDefaultHost | |
91 | ,(void*)zBuf | |
92 | ,(ULONG)nMaxSize - 1 | |
93 | ); | |
10e5b930 DW |
94 | } |
95 | else | |
63a3cd7a | 96 | { |
10e5b930 | 97 | wxStrncpy(zBuf, zSysname, nMaxSize - 1); |
63a3cd7a WS |
98 | } |
99 | ||
10e5b930 | 100 | zBuf[nMaxSize] = _T('\0'); |
45fcbf3b | 101 | #endif |
63a3cd7a | 102 | |
9d8aca48 | 103 | return *zBuf ? true : false; |
0e320a79 DW |
104 | } |
105 | ||
106 | // Get user ID e.g. jacs | |
6670f564 | 107 | bool wxGetUserId(wxChar* zBuf, int nType) |
0e320a79 | 108 | { |
6670f564 | 109 | #if defined(__VISAGECPP__) || defined(__WATCOMC__) |
2bd5bbc9 | 110 | // UPM procs return 0 on success |
6670f564 | 111 | long lrc = U32ELOCU((PUCHAR)zBuf, (PULONG)&nType); |
9d8aca48 | 112 | if (lrc == 0) return true; |
06298235 | 113 | #endif |
9d8aca48 | 114 | return false; |
0e320a79 DW |
115 | } |
116 | ||
6670f564 | 117 | bool wxGetUserName( wxChar* zBuf, int nMaxSize ) |
0e320a79 | 118 | { |
45fcbf3b | 119 | #ifdef USE_NET_API |
6670f564 | 120 | wxGetUserId( zBuf, nMaxSize ); |
45fcbf3b | 121 | #else |
10e5b930 | 122 | wxStrncpy(zBuf, _T("Unknown User"), nMaxSize); |
45fcbf3b | 123 | #endif |
9d8aca48 | 124 | return true; |
0e320a79 DW |
125 | } |
126 | ||
6670f564 WS |
127 | int wxKill(long lPid, |
128 | wxSignal WXUNUSED(eSig), | |
129 | wxKillError* WXUNUSED(peError), | |
130 | int WXUNUSED(flags)) | |
0e320a79 | 131 | { |
10e5b930 | 132 | return((int)::DosKillProcess(0, (PID)lPid)); |
0e320a79 DW |
133 | } |
134 | ||
135 | // | |
136 | // Execute a program in an Interactive Shell | |
137 | // | |
e4db172a | 138 | bool wxShell( const wxString& rCommand ) |
0e320a79 | 139 | { |
e4db172a WS |
140 | wxChar* zShell = _T("CMD.EXE"); |
141 | wxString sInputs; | |
142 | STARTDATA SData = {0}; | |
143 | PSZ PgmTitle = "Command Shell"; | |
144 | APIRET rc; | |
145 | PID vPid = 0; | |
146 | ULONG ulSessID = 0; | |
147 | UCHAR achObjBuf[256] = {0}; //error data if DosStart fails | |
148 | RESULTCODES vResult; | |
c5fb56c0 DW |
149 | |
150 | SData.Length = sizeof(STARTDATA); | |
151 | SData.Related = SSF_RELATED_INDEPENDENT; | |
152 | SData.FgBg = SSF_FGBG_FORE; | |
153 | SData.TraceOpt = SSF_TRACEOPT_NONE; | |
154 | SData.PgmTitle = PgmTitle; | |
0fba44b4 | 155 | SData.PgmName = (char*)zShell; |
c5fb56c0 | 156 | |
0fba44b4 | 157 | sInputs = _T("/C ") + rCommand; |
9ac6ff7b | 158 | SData.PgmInputs = (BYTE*)sInputs.c_str(); |
c5fb56c0 DW |
159 | SData.TermQ = 0; |
160 | SData.Environment = 0; | |
161 | SData.InheritOpt = SSF_INHERTOPT_SHELL; | |
162 | SData.SessionType = SSF_TYPE_WINDOWABLEVIO; | |
163 | SData.IconFile = 0; | |
164 | SData.PgmHandle = 0; | |
165 | SData.PgmControl = SSF_CONTROL_VISIBLE | SSF_CONTROL_MAXIMIZE; | |
166 | SData.InitXPos = 30; | |
167 | SData.InitYPos = 40; | |
168 | SData.InitXSize = 200; | |
169 | SData.InitYSize = 140; | |
170 | SData.Reserved = 0; | |
171 | SData.ObjectBuffer = (char*)achObjBuf; | |
172 | SData.ObjectBuffLen = (ULONG)sizeof(achObjBuf); | |
173 | ||
174 | rc = ::DosStartSession(&SData, &ulSessID, &vPid); | |
9ac6ff7b | 175 | if (rc == 0 || rc == 457) // NO_ERROR or SMG_START_IN_BACKGROUND |
c5fb56c0 DW |
176 | { |
177 | PTIB ptib; | |
178 | PPIB ppib; | |
10e5b930 | 179 | |
c5fb56c0 | 180 | ::DosGetInfoBlocks(&ptib, &ppib); |
10e5b930 | 181 | |
c5fb56c0 DW |
182 | ::DosWaitChild( DCWA_PROCESS |
183 | ,DCWW_WAIT | |
184 | ,&vResult | |
185 | ,&ppib->pib_ulpid | |
186 | ,vPid | |
187 | ); | |
188 | } | |
189 | return (rc != 0); | |
0e320a79 DW |
190 | } |
191 | ||
a23692f0 | 192 | // Shutdown or reboot the PC |
6670f564 | 193 | bool wxShutdown(wxShutdownFlags WXUNUSED(wFlags)) |
f6ba47d9 VZ |
194 | { |
195 | // TODO | |
9d8aca48 | 196 | return false; |
f6ba47d9 VZ |
197 | } |
198 | ||
0e320a79 | 199 | // Get free memory in bytes, or -1 if cannot determine amount (e.g. on UNIX) |
9d8aca48 | 200 | wxMemorySize wxGetFreeMemory() |
0e320a79 | 201 | { |
5a23a495 WS |
202 | void* pMemptr = NULL; |
203 | LONG lSize; | |
204 | ULONG lMemFlags; | |
205 | APIRET rc; | |
78d50441 DW |
206 | |
207 | lMemFlags = PAG_FREE; | |
0d598bae | 208 | rc = ::DosQueryMem(pMemptr, (PULONG)&lSize, &lMemFlags); |
78d50441 | 209 | if (rc != 0) |
9d8aca48 WS |
210 | lSize = -1L; |
211 | return (wxMemorySize)lSize; | |
45fcbf3b DW |
212 | } |
213 | ||
264f00e7 SN |
214 | // Get Process ID |
215 | unsigned long wxGetProcessId() | |
216 | { | |
217 | return (unsigned long)getpid(); | |
218 | } | |
219 | ||
8269a903 SN |
220 | // ---------------------------------------------------------------------------- |
221 | // env vars | |
222 | // ---------------------------------------------------------------------------- | |
223 | ||
224 | bool wxGetEnv(const wxString& var, wxString *value) | |
225 | { | |
226 | // wxGetenv is defined as getenv() | |
227 | wxChar *p = wxGetenv(var); | |
228 | if ( !p ) | |
9d8aca48 | 229 | return false; |
8269a903 SN |
230 | |
231 | if ( value ) | |
232 | { | |
233 | *value = p; | |
234 | } | |
235 | ||
9d8aca48 | 236 | return true; |
8269a903 SN |
237 | } |
238 | ||
239 | bool wxSetEnv(const wxString& variable, const wxChar *value) | |
240 | { | |
241 | #if defined(HAVE_SETENV) | |
242 | return setenv(variable.mb_str(), value ? wxString(value).mb_str().data() | |
243 | : NULL, 1 /* overwrite */) == 0; | |
244 | #elif defined(HAVE_PUTENV) | |
245 | wxString s = variable; | |
246 | if ( value ) | |
247 | s << _T('=') << value; | |
248 | ||
249 | // transform to ANSI | |
250 | const char *p = s.mb_str(); | |
251 | ||
252 | // the string will be free()d by libc | |
253 | char *buf = (char *)malloc(strlen(p) + 1); | |
254 | strcpy(buf, p); | |
255 | ||
256 | return putenv(buf) == 0; | |
257 | #else // no way to set an env var | |
6670f564 WS |
258 | wxUnusedVar(variable); |
259 | wxUnusedVar(value); | |
9d8aca48 | 260 | return false; |
8269a903 SN |
261 | #endif |
262 | } | |
263 | ||
d3a919bd | 264 | void wxMilliSleep( |
10e5b930 DW |
265 | unsigned long ulMilliseconds |
266 | ) | |
45fcbf3b | 267 | { |
f53a0d32 | 268 | ::DosSleep(ulMilliseconds); |
0e320a79 DW |
269 | } |
270 | ||
d3a919bd SN |
271 | void wxMicroSleep( |
272 | unsigned long ulMicroseconds | |
273 | ) | |
274 | { | |
275 | ::DosSleep(ulMicroseconds/1000); | |
276 | } | |
277 | ||
10e5b930 DW |
278 | void wxSleep( |
279 | int nSecs | |
280 | ) | |
0e320a79 | 281 | { |
10e5b930 | 282 | ::DosSleep(1000 * nSecs); |
0e320a79 DW |
283 | } |
284 | ||
285 | // Consume all events until no more left | |
286 | void wxFlushEvents() | |
287 | { | |
45fcbf3b | 288 | // wxYield(); |
0e320a79 DW |
289 | } |
290 | ||
0e320a79 DW |
291 | // Emit a beeeeeep |
292 | void wxBell() | |
293 | { | |
45fcbf3b | 294 | DosBeep(1000,1000); // 1kHz during 1 sec. |
0e320a79 | 295 | } |
621ccd8a | 296 | |
5a23a495 WS |
297 | wxString wxGetOsDescription() |
298 | { | |
299 | wxString strVer(_T("OS/2")); | |
300 | ULONG ulSysInfo[QSV_MAX] = {0}; | |
301 | ||
302 | if (::DosQuerySysInfo( 1L, | |
303 | QSV_MAX, | |
304 | (PVOID)ulSysInfo, | |
305 | sizeof(ULONG) * QSV_MAX | |
306 | ) == 0L ) | |
307 | { | |
308 | wxString ver; | |
309 | ver.Printf( _T(" ver. %d.%d rev. %c"), | |
310 | int(ulSysInfo[QSV_VERSION_MAJOR] / 10), | |
311 | int(ulSysInfo[QSV_VERSION_MINOR]), | |
312 | char(ulSysInfo[QSV_VERSION_REVISION]) | |
313 | ); | |
314 | strVer += ver; | |
315 | } | |
316 | ||
317 | return strVer; | |
318 | } | |
8329e6c7 | 319 | |
4cc49137 SN |
320 | bool wxIsPlatform64Bit() |
321 | { | |
322 | // FIXME: No idea how to test for 64 bit processor | |
323 | // (Probably irrelevant anyhow, though). | |
324 | return false; | |
325 | } | |
326 | ||
6670f564 | 327 | void wxAppTraits::InitializeGui(unsigned long &WXUNUSED(ulHab)) |
8329e6c7 SN |
328 | { |
329 | } | |
330 | ||
6670f564 | 331 | void wxAppTraits::TerminateGui(unsigned long WXUNUSED(ulHab)) |
8329e6c7 SN |
332 | { |
333 | } | |
334 | ||
8bb6b2c0 | 335 | wxOperatingSystemId wxGetOsVersion(int *verMaj, int *verMin) |
10e5b930 | 336 | { |
9d8aca48 WS |
337 | ULONG ulSysInfo[QSV_MAX] = {0}; |
338 | APIRET ulrc; | |
5d4b632b DW |
339 | |
340 | ulrc = ::DosQuerySysInfo( 1L | |
341 | ,QSV_MAX | |
342 | ,(PVOID)ulSysInfo | |
343 | ,sizeof(ULONG) * QSV_MAX | |
344 | ); | |
8bb6b2c0 | 345 | |
5d4b632b | 346 | if (ulrc == 0L) |
10e5b930 | 347 | { |
8bb6b2c0 VZ |
348 | if ( verMaj ) |
349 | *verMaj = ulSysInfo[QSV_VERSION_MAJOR] / 10; | |
350 | if ( verMin ) | |
351 | *verMin = ulSysInfo[QSV_VERSION_MINOR]; | |
10e5b930 | 352 | } |
8bb6b2c0 VZ |
353 | |
354 | return wxOS_OS2; | |
0e320a79 | 355 | } |
621ccd8a | 356 | |
8bb6b2c0 | 357 | |
45fcbf3b | 358 | // --------------------------------------------------------------------------- |
1be7f92a DW |
359 | const wxChar* wxGetHomeDir( |
360 | wxString* pStr | |
361 | ) | |
45fcbf3b | 362 | { |
1be7f92a | 363 | wxString& rStrDir = *pStr; |
0e320a79 | 364 | |
1be7f92a | 365 | // OS/2 has no idea about home, |
b08c90ca SN |
366 | // so use the working directory instead. |
367 | // However, we might have a valid HOME directory, | |
368 | // as is used on many machines that have unix utilities | |
369 | // on them, so we should use that, if available. | |
45fcbf3b | 370 | |
1be7f92a | 371 | // 256 was taken from os2def.h |
45fcbf3b DW |
372 | #ifndef MAX_PATH |
373 | # define MAX_PATH 256 | |
374 | #endif | |
375 | ||
0fba44b4 | 376 | const wxChar *szHome = wxGetenv((wxChar*)"HOME"); |
b08c90ca SN |
377 | if ( szHome == NULL ) { |
378 | // we're homeless, use current directory. | |
379 | rStrDir = wxT("."); | |
380 | } | |
381 | else | |
382 | rStrDir = szHome; | |
45fcbf3b | 383 | |
1be7f92a | 384 | return rStrDir.c_str(); |
45fcbf3b DW |
385 | } |
386 | ||
10e5b930 | 387 | // Hack for OS/2 |
2173b18f SN |
388 | #if wxUSE_UNICODE |
389 | const wxMB2WXbuf wxGetUserHome( const wxString &rUser ) | |
390 | #else // just for binary compatibility -- there is no 'const' here | |
391 | wxChar* wxGetUserHome ( const wxString &rUser ) | |
392 | #endif | |
1be7f92a | 393 | { |
5a23a495 WS |
394 | wxChar* zHome; |
395 | wxString sUser1(rUser); | |
1be7f92a | 396 | |
0fba44b4 | 397 | wxChar *wxBuffer = new wxChar[256]; |
06298235 | 398 | #ifndef __EMX__ |
27b2dd53 | 399 | if (!sUser1.empty()) |
45fcbf3b | 400 | { |
1be7f92a DW |
401 | wxChar zTmp[64]; |
402 | ||
403 | if (wxGetUserId( zTmp | |
404 | ,sizeof(zTmp)/sizeof(char) | |
405 | )) | |
406 | { | |
407 | // Guests belong in the temp dir | |
408 | if (wxStricmp(zTmp, _T("annonymous")) == 0) | |
409 | { | |
410 | if ((zHome = wxGetenv(_T("TMP"))) != NULL || | |
411 | (zHome = wxGetenv(_T("TMPDIR"))) != NULL || | |
412 | (zHome = wxGetenv(_T("TEMP"))) != NULL) | |
13a4ea8d | 413 | delete[] wxBuffer; |
1be7f92a DW |
414 | return *zHome ? zHome : (wxChar*)_T("\\"); |
415 | } | |
416 | if (wxStricmp(zTmp, WXSTRINGCAST sUser1) == 0) | |
5a23a495 | 417 | sUser1 = wxEmptyString; |
1be7f92a | 418 | } |
45fcbf3b | 419 | } |
06298235 | 420 | #endif |
27b2dd53 | 421 | if (sUser1.empty()) |
13a4ea8d | 422 | { |
1be7f92a DW |
423 | if ((zHome = wxGetenv(_T("HOME"))) != NULL) |
424 | { | |
425 | wxStrcpy(wxBuffer, zHome); | |
2b5f62a0 | 426 | wxUnix2DosFilename(wxBuffer); |
2173b18f | 427 | #if wxUSE_UNICODE |
6670f564 | 428 | wxWCharBuffer retBuffer (wxBuffer); |
2173b18f SN |
429 | delete[] wxBuffer; |
430 | return retBuffer; | |
6670f564 | 431 | #else |
13a4ea8d DW |
432 | wxStrcpy(zHome, wxBuffer); |
433 | delete[] wxBuffer; | |
434 | return zHome; | |
2173b18f | 435 | #endif |
1be7f92a | 436 | } |
13a4ea8d DW |
437 | } |
438 | delete[] wxBuffer; | |
0fba44b4 | 439 | return (wxChar*)wxEmptyString; // No home known! |
0e320a79 DW |
440 | } |
441 | ||
0e2a14e5 | 442 | wxString wxPMErrorToStr(ERRORID vError) |
914589c2 | 443 | { |
0e2a14e5 | 444 | wxString sError; |
914589c2 DW |
445 | |
446 | // | |
447 | // Remove the high order byte -- it is useless | |
448 | // | |
449 | vError &= 0x0000ffff; | |
450 | switch(vError) | |
451 | { | |
452 | case PMERR_INVALID_HWND: | |
453 | sError = wxT("Invalid window handle specified"); | |
454 | break; | |
455 | ||
456 | case PMERR_INVALID_FLAG: | |
457 | sError = wxT("Invalid flag bit set"); | |
458 | break; | |
459 | ||
460 | case PMERR_NO_MSG_QUEUE: | |
461 | sError = wxT("No message queue available"); | |
462 | break; | |
463 | ||
464 | case PMERR_INVALID_PARM: | |
465 | sError = wxT("Parameter contained invalid data"); | |
466 | break; | |
467 | ||
468 | case PMERR_INVALID_PARAMETERS: | |
469 | sError = wxT("Parameter value is out of range"); | |
470 | break; | |
471 | ||
472 | case PMERR_PARAMETER_OUT_OF_RANGE: | |
473 | sError = wxT("Parameter value is out of range"); | |
474 | break; | |
475 | ||
476 | case PMERR_INVALID_INTEGER_ATOM: | |
477 | sError = wxT("Not a valid atom"); | |
478 | break; | |
479 | ||
480 | case PMERR_INVALID_HATOMTBL: | |
481 | sError = wxT("Atom table handle is invalid"); | |
482 | break; | |
483 | ||
484 | case PMERR_INVALID_ATOM_NAME: | |
485 | sError = wxT("Not a valid atom name"); | |
486 | break; | |
487 | ||
488 | case PMERR_ATOM_NAME_NOT_FOUND: | |
489 | sError = wxT("Valid name format, but cannot find name in atom table"); | |
490 | break; | |
491 | ||
da51aebe SN |
492 | case PMERR_INV_HPS: |
493 | sError = wxT("PMERR_INV_HPS"); | |
494 | break; | |
495 | ||
496 | case PMERR_PS_BUSY: | |
497 | sError = wxT("PMERR_PS_BUSY"); | |
498 | break; | |
499 | ||
500 | case PMERR_INV_PRIMITIVE_TYPE: | |
501 | sError = wxT("PMERR_INV_PRIMITIVE_TYPE"); | |
502 | break; | |
503 | ||
504 | case PMERR_UNSUPPORTED_ATTR: | |
505 | sError = wxT("PMERR_UNSUPPORTED_ATTR"); | |
506 | break; | |
507 | ||
508 | case PMERR_INV_COLOR_ATTR: | |
509 | sError = wxT("PMERR_INV_COLOR_ATTR"); | |
510 | break; | |
511 | ||
512 | case PMERR_INV_BACKGROUND_COL_ATTR: | |
513 | sError = wxT("PMERR_INV_BACKGROUND_COL_ATTR"); | |
514 | break; | |
515 | ||
516 | case PMERR_INV_MIX_ATTR: | |
517 | sError = wxT("PMERR_INV_MIX_ATTR"); | |
518 | break; | |
519 | ||
520 | case PMERR_INV_LINE_WIDTH_ATTR: | |
521 | sError = wxT("PMERR_INV_LINE_WIDTH_ATTR"); | |
522 | break; | |
523 | ||
524 | case PMERR_INV_GEOM_LINE_WIDTH_ATTR: | |
525 | sError = wxT("PMERR_INV_GEOM_LINE_WIDTH_ATTR"); | |
526 | break; | |
527 | ||
528 | case PMERR_INV_LINE_TYPE_ATTR: | |
529 | sError = wxT("PMERR_INV_LINE_TYPE_ATTR"); | |
530 | break; | |
531 | ||
532 | case PMERR_INV_LINE_END_ATTR: | |
533 | sError = wxT("PMERR_INV_LINE_END_ATTR"); | |
534 | break; | |
535 | ||
536 | case PMERR_INV_LINE_JOIN_ATTR: | |
537 | sError = wxT("PMERR_INV_LINE_JOIN_ATTR"); | |
538 | break; | |
539 | ||
540 | case PMERR_INV_CHAR_SET_ATTR: | |
541 | sError = wxT("PMERR_INV_CHAR_SET_ATTR"); | |
542 | break; | |
543 | ||
544 | case PMERR_INV_CHAR_MODE_ATTR: | |
545 | sError = wxT("PMERR_INV_CHAR_MODE_ATTR"); | |
546 | break; | |
547 | ||
548 | case PMERR_INV_CHAR_DIRECTION_ATTR: | |
549 | sError = wxT("PMERR_INV_CHAR_DIRECTION_ATTR"); | |
550 | break; | |
551 | ||
552 | case PMERR_INV_CHAR_SHEAR_ATTR: | |
553 | sError = wxT("PMERR_INV_CHAR_SHEAR_ATTR"); | |
554 | break; | |
555 | ||
556 | case PMERR_INV_CHAR_ANGLE_ATTR: | |
557 | sError = wxT("PMERR_INV_CHAR_ANGLE_ATTR"); | |
558 | break; | |
559 | ||
560 | case PMERR_INV_MARKER_SET_ATTR: | |
561 | sError = wxT("PMERR_INV_MARKER_SET_ATTR"); | |
562 | break; | |
563 | ||
564 | case PMERR_INV_MARKER_SYMBOL_ATTR: | |
565 | sError = wxT("PMERR_INV_MARKER_SYMBOL_ATTR"); | |
566 | break; | |
567 | ||
568 | case PMERR_INV_PATTERN_SET_ATTR: | |
569 | sError = wxT("PMERR_INV_PATTERN_SET_ATTR"); | |
570 | break; | |
571 | ||
572 | case PMERR_INV_PATTERN_ATTR: | |
573 | sError = wxT("PMERR_INV_PATTERN_ATTR"); | |
574 | break; | |
575 | ||
576 | case PMERR_INV_COORDINATE: | |
577 | sError = wxT("PMERR_INV_COORDINATE"); | |
578 | break; | |
579 | ||
580 | case PMERR_UNSUPPORTED_ATTR_VALUE: | |
581 | sError = wxT("PMERR_UNSUPPORTED_ATTR_VALUE"); | |
582 | break; | |
583 | ||
584 | case PMERR_INV_PATTERN_SET_FONT: | |
585 | sError = wxT("PMERR_INV_PATTERN_SET_FONT"); | |
586 | break; | |
587 | ||
588 | case PMERR_HUGE_FONTS_NOT_SUPPORTED: | |
589 | sError = wxT("PMERR_HUGE_FONTS_NOT_SUPPORTED"); | |
590 | break; | |
591 | ||
914589c2 DW |
592 | default: |
593 | sError = wxT("Unknown error"); | |
594 | } | |
0e2a14e5 | 595 | return sError; |
914589c2 | 596 | } // end of wxPMErrorToStr |
621ccd8a SN |
597 | |
598 | // replacement for implementation in unix/utilsunx.cpp, | |
599 | // to be used by all X11 based ports. | |
600 | struct wxEndProcessData; | |
601 | ||
6670f564 | 602 | void wxHandleProcessTermination(wxEndProcessData *WXUNUSED(proc_data)) |
621ccd8a SN |
603 | { |
604 | // For now, just do nothing. To be filled in as needed. | |
605 | } |