]>
Commit | Line | Data |
---|---|---|
c801d85f KB |
1 | ///////////////////////////////////////////////////////////////////////////// |
2 | // Name: utils.h | |
3 | // Purpose: Miscellaneous utilities | |
4 | // Author: Julian Smart | |
5 | // Modified by: | |
6 | // Created: 29/01/98 | |
7 | // RCS-ID: $Id$ | |
8 | // Copyright: (c) 1998 Julian Smart | |
3f4a0c5b | 9 | // Licence: wxWindows license |
c801d85f KB |
10 | ///////////////////////////////////////////////////////////////////////////// |
11 | ||
34138703 JS |
12 | #ifndef _WX_UTILSH__ |
13 | #define _WX_UTILSH__ | |
c801d85f | 14 | |
d6b9496a VZ |
15 | // ---------------------------------------------------------------------------- |
16 | // headers | |
17 | // ---------------------------------------------------------------------------- | |
18 | ||
c801d85f | 19 | #ifdef __GNUG__ |
d6b9496a | 20 | #pragma interface "utils.h" |
c801d85f KB |
21 | #endif |
22 | ||
23 | #include "wx/setup.h" | |
24 | #include "wx/object.h" | |
25 | #include "wx/list.h" | |
c801d85f KB |
26 | #include "wx/filefn.h" |
27 | ||
c801d85f | 28 | #ifdef __X__ |
d6b9496a VZ |
29 | #include <dirent.h> |
30 | #include <unistd.h> | |
c801d85f KB |
31 | #endif |
32 | ||
33 | #include <stdio.h> | |
34 | ||
d6b9496a VZ |
35 | // ---------------------------------------------------------------------------- |
36 | // Forward declaration | |
37 | // ---------------------------------------------------------------------------- | |
38 | ||
39 | class WXDLLEXPORT wxProcess; | |
40 | class WXDLLEXPORT wxFrame; | |
e4b4d60e | 41 | class WXDLLEXPORT wxWindow; |
cd6ce4a9 | 42 | class WXDLLEXPORT wxWindowList; |
59a12e90 | 43 | class WXDLLEXPORT wxPoint; |
d6b9496a VZ |
44 | |
45 | // FIXME should use wxStricmp() instead | |
717b9bf2 | 46 | #if defined(__GNUWIN32__) |
d6b9496a VZ |
47 | #define stricmp strcasecmp |
48 | #define strnicmp strncasecmp | |
c801d85f KB |
49 | #endif |
50 | ||
d6b9496a VZ |
51 | // ---------------------------------------------------------------------------- |
52 | // Macros | |
53 | // ---------------------------------------------------------------------------- | |
c801d85f | 54 | |
d6b9496a VZ |
55 | #define wxMax(a,b) (((a) > (b)) ? (a) : (b)) |
56 | #define wxMin(a,b) (((a) < (b)) ? (a) : (b)) | |
c801d85f | 57 | |
d6b9496a VZ |
58 | // ---------------------------------------------------------------------------- |
59 | // String functions (deprecated, use wxString) | |
60 | // ---------------------------------------------------------------------------- | |
61 | ||
62 | // Useful buffer (FIXME VZ: yeah, that is. To be removed!) | |
9d2f3c71 | 63 | WXDLLEXPORT_DATA(extern wxChar*) wxBuffer; |
c801d85f KB |
64 | |
65 | // Make a copy of this string using 'new' | |
9d2f3c71 | 66 | WXDLLEXPORT wxChar* copystring(const wxChar *s); |
c801d85f | 67 | |
d6b9496a | 68 | // Matches string one within string two regardless of case |
9d2f3c71 | 69 | WXDLLEXPORT bool StringMatch(wxChar *one, wxChar *two, bool subString = TRUE, bool exact = FALSE); |
d6b9496a VZ |
70 | |
71 | // A shorter way of using strcmp | |
9d2f3c71 | 72 | #define wxStringEq(s1, s2) (s1 && s2 && (wxStrcmp(s1, s2) == 0)) |
d6b9496a VZ |
73 | |
74 | // ---------------------------------------------------------------------------- | |
75 | // Miscellaneous functions | |
76 | // ---------------------------------------------------------------------------- | |
77 | ||
78 | // Sound the bell | |
e90c1d2a | 79 | WXDLLEXPORT void wxBell(); |
d6b9496a | 80 | |
bdc72a22 VZ |
81 | // Get OS description as a user-readable string |
82 | WXDLLEXPORT wxString wxGetOsDescription(); | |
83 | ||
d6b9496a | 84 | // Get OS version |
bdc72a22 VZ |
85 | WXDLLEXPORT int wxGetOsVersion(int *majorVsn = (int *) NULL, |
86 | int *minorVsn = (int *) NULL); | |
d6b9496a VZ |
87 | |
88 | // Return a string with the current date/time | |
89 | WXDLLEXPORT wxString wxNow(); | |
90 | ||
e90c1d2a | 91 | #if wxUSE_GUI |
63cc5d9d RR |
92 | // Don't synthesize KeyUp events holding down a key and producing |
93 | // KeyDown events with autorepeat. On by default and always on | |
94 | // in wxMSW. | |
f0492f7d RR |
95 | WXDLLEXPORT bool wxSetDetectableAutoRepeat( bool flag ); |
96 | ||
d6b9496a VZ |
97 | // ---------------------------------------------------------------------------- |
98 | // Window ID management | |
99 | // ---------------------------------------------------------------------------- | |
100 | ||
c801d85f | 101 | // Generate a unique ID |
afb74891 | 102 | WXDLLEXPORT long wxNewId(); |
d6b9496a VZ |
103 | #if !defined(NewId) && defined(WXWIN_COMPATIBILITY) |
104 | #define NewId wxNewId | |
105 | #endif | |
c801d85f KB |
106 | |
107 | // Ensure subsequent IDs don't clash with this one | |
184b5d99 | 108 | WXDLLEXPORT void wxRegisterId(long id); |
d6b9496a VZ |
109 | #if !defined(RegisterId) && defined(WXWIN_COMPATIBILITY) |
110 | #define RegisterId wxRegisterId | |
111 | #endif | |
c801d85f KB |
112 | |
113 | // Return the current ID | |
afb74891 | 114 | WXDLLEXPORT long wxGetCurrentId(); |
c801d85f | 115 | |
e90c1d2a VZ |
116 | #endif // wxUSE_GUI |
117 | ||
d6b9496a VZ |
118 | // ---------------------------------------------------------------------------- |
119 | // Various conversions | |
120 | // ---------------------------------------------------------------------------- | |
c801d85f | 121 | |
9d2f3c71 OK |
122 | WXDLLEXPORT_DATA(extern const wxChar*) wxFloatToStringStr; |
123 | WXDLLEXPORT_DATA(extern const wxChar*) wxDoubleToStringStr; | |
c801d85f | 124 | |
9d2f3c71 OK |
125 | WXDLLEXPORT void StringToFloat(wxChar *s, float *number); |
126 | WXDLLEXPORT wxChar* FloatToString(float number, const wxChar *fmt = wxFloatToStringStr); | |
127 | WXDLLEXPORT void StringToDouble(wxChar *s, double *number); | |
128 | WXDLLEXPORT wxChar* DoubleToString(double number, const wxChar *fmt = wxDoubleToStringStr); | |
129 | WXDLLEXPORT void StringToInt(wxChar *s, int *number); | |
130 | WXDLLEXPORT void StringToLong(wxChar *s, long *number); | |
131 | WXDLLEXPORT wxChar* IntToString(int number); | |
132 | WXDLLEXPORT wxChar* LongToString(long number); | |
c801d85f | 133 | |
c801d85f | 134 | // Convert 2-digit hex number to decimal |
184b5d99 | 135 | WXDLLEXPORT int wxHexToDec(const wxString& buf); |
c801d85f KB |
136 | |
137 | // Convert decimal integer to 2-character hex string | |
9d2f3c71 | 138 | WXDLLEXPORT void wxDecToHex(int dec, wxChar *buf); |
184b5d99 | 139 | WXDLLEXPORT wxString wxDecToHex(int dec); |
c801d85f | 140 | |
d6b9496a VZ |
141 | // ---------------------------------------------------------------------------- |
142 | // Process management | |
143 | // ---------------------------------------------------------------------------- | |
144 | ||
c801d85f | 145 | // Execute another program. Returns 0 if there was an error, a PID otherwise. |
9d2f3c71 | 146 | WXDLLEXPORT long wxExecute(wxChar **argv, bool sync = FALSE, |
c67daf87 | 147 | wxProcess *process = (wxProcess *) NULL); |
184b5d99 | 148 | WXDLLEXPORT long wxExecute(const wxString& command, bool sync = FALSE, |
c67daf87 | 149 | wxProcess *process = (wxProcess *) NULL); |
c801d85f | 150 | |
cd6ce4a9 | 151 | // execute the command capturing its output into an array line by line |
f6bcfd97 BP |
152 | WXDLLEXPORT long wxExecute(const wxString& command, |
153 | wxArrayString& output); | |
154 | ||
155 | // also capture stderr | |
156 | WXDLLEXPORT long wxExecute(const wxString& command, | |
157 | wxArrayString& output, | |
158 | wxArrayString& error); | |
cd6ce4a9 | 159 | |
d6b9496a VZ |
160 | enum wxSignal |
161 | { | |
162 | wxSIGNONE = 0, // verify if the process exists under Unix | |
163 | wxSIGHUP, | |
164 | wxSIGINT, | |
165 | wxSIGQUIT, | |
166 | wxSIGILL, | |
167 | wxSIGTRAP, | |
168 | wxSIGABRT, | |
169 | wxSIGIOT = wxSIGABRT, // another name | |
170 | wxSIGEMT, | |
171 | wxSIGFPE, | |
172 | wxSIGKILL, | |
173 | wxSIGBUS, | |
174 | wxSIGSEGV, | |
175 | wxSIGSYS, | |
176 | wxSIGPIPE, | |
177 | wxSIGALRM, | |
178 | wxSIGTERM | |
179 | ||
180 | // further signals are different in meaning between different Unix systems | |
181 | }; | |
c801d85f | 182 | |
d6b9496a VZ |
183 | // the argument is ignored under Windows - the process is always killed |
184 | WXDLLEXPORT int wxKill(long pid, wxSignal sig = wxSIGTERM); | |
c801d85f | 185 | |
2c8e4738 | 186 | // Execute a command in an interactive shell window (always synchronously) |
c801d85f | 187 | // If no command then just the shell |
62448488 | 188 | WXDLLEXPORT bool wxShell(const wxString& command = wxEmptyString); |
c801d85f | 189 | |
2c8e4738 VZ |
190 | // As wxShell(), but must give a (non interactive) command and its output will |
191 | // be returned in output array | |
192 | WXDLLEXPORT bool wxShell(const wxString& command, wxArrayString& output); | |
193 | ||
b568d04f | 194 | // Sleep for nSecs seconds |
184b5d99 | 195 | WXDLLEXPORT void wxSleep(int nSecs); |
c801d85f | 196 | |
afb74891 VZ |
197 | // Sleep for a given amount of milliseconds |
198 | WXDLLEXPORT void wxUsleep(unsigned long milliseconds); | |
199 | ||
c801d85f | 200 | // Get free memory in bytes, or -1 if cannot determine amount (e.g. on UNIX) |
afb74891 | 201 | WXDLLEXPORT long wxGetFreeMemory(); |
c801d85f | 202 | |
a37a5a73 VZ |
203 | // should wxApp::OnFatalException() be called? |
204 | WXDLLEXPORT bool wxHandleFatalExceptions(bool doit = TRUE); | |
205 | ||
d6b9496a VZ |
206 | // ---------------------------------------------------------------------------- |
207 | // Network and username functions. | |
208 | // ---------------------------------------------------------------------------- | |
c801d85f | 209 | |
d6b9496a | 210 | // NB: "char *" functions are deprecated, use wxString ones! |
c801d85f KB |
211 | |
212 | // Get eMail address | |
9d2f3c71 | 213 | WXDLLEXPORT bool wxGetEmailAddress(wxChar *buf, int maxSize); |
d6b9496a | 214 | WXDLLEXPORT wxString wxGetEmailAddress(); |
c801d85f KB |
215 | |
216 | // Get hostname. | |
9d2f3c71 | 217 | WXDLLEXPORT bool wxGetHostName(wxChar *buf, int maxSize); |
d6b9496a VZ |
218 | WXDLLEXPORT wxString wxGetHostName(); |
219 | ||
220 | // Get FQDN | |
221 | WXDLLEXPORT wxString wxGetFullHostName(); | |
96c5bd7f | 222 | WXDLLEXPORT bool wxGetFullHostName(wxChar *buf, int maxSize); |
c801d85f | 223 | |
d6b9496a | 224 | // Get user ID e.g. jacs (this is known as login name under Unix) |
9d2f3c71 | 225 | WXDLLEXPORT bool wxGetUserId(wxChar *buf, int maxSize); |
d6b9496a | 226 | WXDLLEXPORT wxString wxGetUserId(); |
c801d85f KB |
227 | |
228 | // Get user name e.g. Julian Smart | |
9d2f3c71 | 229 | WXDLLEXPORT bool wxGetUserName(wxChar *buf, int maxSize); |
d6b9496a VZ |
230 | WXDLLEXPORT wxString wxGetUserName(); |
231 | ||
232 | // Get current Home dir and copy to dest (returns pstr->c_str()) | |
c51deffc | 233 | WXDLLEXPORT wxString wxGetHomeDir(); |
9d2f3c71 | 234 | WXDLLEXPORT const wxChar* wxGetHomeDir(wxString *pstr); |
d6b9496a VZ |
235 | |
236 | // Get the user's home dir (caller must copy --- volatile) | |
237 | // returns NULL is no HOME dir is known | |
61ef57fc OK |
238 | #if defined(__UNIX__) && wxUSE_UNICODE |
239 | WXDLLEXPORT const wxMB2WXbuf wxGetUserHome(const wxString& user = wxEmptyString); | |
240 | #else | |
9d2f3c71 | 241 | WXDLLEXPORT wxChar* wxGetUserHome(const wxString& user = wxEmptyString); |
61ef57fc | 242 | #endif |
d6b9496a | 243 | |
e90c1d2a VZ |
244 | #if wxUSE_GUI // GUI only things from now on |
245 | ||
d6b9496a | 246 | // ---------------------------------------------------------------------------- |
974e8d94 | 247 | // Menu accelerators related things |
d6b9496a | 248 | // ---------------------------------------------------------------------------- |
c801d85f | 249 | |
9d2f3c71 | 250 | WXDLLEXPORT wxChar* wxStripMenuCodes(wxChar *in, wxChar *out = (wxChar *) NULL); |
184b5d99 | 251 | WXDLLEXPORT wxString wxStripMenuCodes(const wxString& str); |
c801d85f | 252 | |
974e8d94 VZ |
253 | #if wxUSE_ACCEL |
254 | class WXDLLEXPORT wxAcceleratorEntry; | |
255 | WXDLLEXPORT wxAcceleratorEntry *wxGetAccelFromString(const wxString& label); | |
256 | #endif // wxUSE_ACCEL | |
257 | ||
d6b9496a VZ |
258 | // ---------------------------------------------------------------------------- |
259 | // Window search | |
260 | // ---------------------------------------------------------------------------- | |
261 | ||
c801d85f KB |
262 | // Find the window/widget with the given title or label. |
263 | // Pass a parent to begin the search from, or NULL to look through | |
264 | // all windows. | |
184b5d99 | 265 | WXDLLEXPORT wxWindow* wxFindWindowByLabel(const wxString& title, wxWindow *parent = (wxWindow *) NULL); |
c801d85f KB |
266 | |
267 | // Find window by name, and if that fails, by label. | |
184b5d99 | 268 | WXDLLEXPORT wxWindow* wxFindWindowByName(const wxString& name, wxWindow *parent = (wxWindow *) NULL); |
c801d85f KB |
269 | |
270 | // Returns menu item id or -1 if none. | |
184b5d99 | 271 | WXDLLEXPORT int wxFindMenuItemId(wxFrame *frame, const wxString& menuString, const wxString& itemString); |
c801d85f | 272 | |
57591e0e JS |
273 | // Find the wxWindow at the given point. wxGenericFindWindowAtPoint |
274 | // is always present but may be less reliable than a native version. | |
275 | WXDLLEXPORT wxWindow* wxGenericFindWindowAtPoint(const wxPoint& pt); | |
59a12e90 JS |
276 | WXDLLEXPORT wxWindow* wxFindWindowAtPoint(const wxPoint& pt); |
277 | ||
d6b9496a VZ |
278 | // ---------------------------------------------------------------------------- |
279 | // Message/event queue helpers | |
280 | // ---------------------------------------------------------------------------- | |
c801d85f KB |
281 | |
282 | // Yield to other apps/messages | |
afb74891 | 283 | WXDLLEXPORT bool wxYield(); |
c801d85f | 284 | |
ead7ce10 KB |
285 | // Yield to other apps/messages and disable user input |
286 | WXDLLEXPORT bool wxSafeYield(wxWindow *win = NULL); | |
287 | ||
95dee651 KB |
288 | // Enable or disable input to all top level windows |
289 | WXDLLEXPORT void wxEnableTopLevelWindows(bool enable = TRUE); | |
290 | ||
d6b9496a VZ |
291 | // Check whether this window wants to process messages, e.g. Stop button |
292 | // in long calculations. | |
293 | WXDLLEXPORT bool wxCheckForInterrupt(wxWindow *wnd); | |
294 | ||
295 | // Consume all events until no more left | |
296 | WXDLLEXPORT void wxFlushEvents(); | |
297 | ||
cd6ce4a9 VZ |
298 | // a class which disables all windows (except, may be, thegiven one) in its |
299 | // ctor and enables them back in its dtor | |
300 | class WXDLLEXPORT wxWindowDisabler | |
301 | { | |
302 | public: | |
303 | wxWindowDisabler(wxWindow *winToSkip = (wxWindow *)NULL); | |
304 | ~wxWindowDisabler(); | |
305 | ||
306 | private: | |
307 | wxWindowList *m_winDisabled; | |
5e1febfa VZ |
308 | |
309 | #ifdef __WXMSW__ | |
310 | wxWindow *m_winTop; | |
311 | #endif // MSW | |
cd6ce4a9 VZ |
312 | }; |
313 | ||
d6b9496a VZ |
314 | // ---------------------------------------------------------------------------- |
315 | // Cursors | |
316 | // ---------------------------------------------------------------------------- | |
c801d85f KB |
317 | |
318 | // Set the cursor to the busy cursor for all windows | |
319 | class WXDLLEXPORT wxCursor; | |
320 | WXDLLEXPORT_DATA(extern wxCursor*) wxHOURGLASS_CURSOR; | |
184b5d99 | 321 | WXDLLEXPORT void wxBeginBusyCursor(wxCursor *cursor = wxHOURGLASS_CURSOR); |
e2a6f233 | 322 | |
c801d85f | 323 | // Restore cursor to normal |
afb74891 | 324 | WXDLLEXPORT void wxEndBusyCursor(); |
d6b9496a | 325 | |
c801d85f | 326 | // TRUE if we're between the above two calls |
afb74891 | 327 | WXDLLEXPORT bool wxIsBusy(); |
c801d85f | 328 | |
e2a6f233 JS |
329 | // Convenience class so we can just create a wxBusyCursor object on the stack |
330 | class WXDLLEXPORT wxBusyCursor | |
331 | { | |
afb74891 VZ |
332 | public: |
333 | wxBusyCursor(wxCursor* cursor = wxHOURGLASS_CURSOR) | |
334 | { wxBeginBusyCursor(cursor); } | |
f6bcfd97 | 335 | ~wxBusyCursor() |
afb74891 | 336 | { wxEndBusyCursor(); } |
e2a6f233 | 337 | |
f6bcfd97 BP |
338 | // FIXME: These two methods are currently only implemented (and needed?) |
339 | // in wxGTK. BusyCursor handling should probably be moved to | |
340 | // common code since the wxGTK and wxMSW implementations are very | |
341 | // similar except for wxMSW using HCURSOR directly instead of | |
342 | // wxCursor.. -- RL. | |
343 | static const wxCursor &GetStoredCursor(); | |
344 | static const wxCursor GetBusyCursor(); | |
345 | }; | |
c801d85f | 346 | |
c801d85f | 347 | |
d6b9496a | 348 | // ---------------------------------------------------------------------------- |
c801d85f | 349 | // Reading and writing resources (eg WIN.INI, .Xdefaults) |
d6b9496a VZ |
350 | // ---------------------------------------------------------------------------- |
351 | ||
47d67540 | 352 | #if wxUSE_RESOURCES |
62448488 JS |
353 | WXDLLEXPORT bool wxWriteResource(const wxString& section, const wxString& entry, const wxString& value, const wxString& file = wxEmptyString); |
354 | WXDLLEXPORT bool wxWriteResource(const wxString& section, const wxString& entry, float value, const wxString& file = wxEmptyString); | |
355 | WXDLLEXPORT bool wxWriteResource(const wxString& section, const wxString& entry, long value, const wxString& file = wxEmptyString); | |
356 | WXDLLEXPORT bool wxWriteResource(const wxString& section, const wxString& entry, int value, const wxString& file = wxEmptyString); | |
357 | ||
9d2f3c71 | 358 | WXDLLEXPORT bool wxGetResource(const wxString& section, const wxString& entry, wxChar **value, const wxString& file = wxEmptyString); |
62448488 JS |
359 | WXDLLEXPORT bool wxGetResource(const wxString& section, const wxString& entry, float *value, const wxString& file = wxEmptyString); |
360 | WXDLLEXPORT bool wxGetResource(const wxString& section, const wxString& entry, long *value, const wxString& file = wxEmptyString); | |
361 | WXDLLEXPORT bool wxGetResource(const wxString& section, const wxString& entry, int *value, const wxString& file = wxEmptyString); | |
47d67540 | 362 | #endif // wxUSE_RESOURCES |
c801d85f | 363 | |
c801d85f KB |
364 | void WXDLLEXPORT wxGetMousePosition( int* x, int* y ); |
365 | ||
366 | // MSW only: get user-defined resource from the .res file. | |
367 | // Returns NULL or newly-allocated memory, so use delete[] to clean up. | |
2049ba38 | 368 | #ifdef __WXMSW__ |
9d2f3c71 OK |
369 | WXDLLEXPORT extern const wxChar* wxUserResourceStr; |
370 | WXDLLEXPORT wxChar* wxLoadUserResource(const wxString& resourceName, const wxString& resourceType = wxUserResourceStr); | |
c030b70f JS |
371 | |
372 | // Implemented in utils.cpp: VC++, Win95 only. Sets up a console for standard | |
373 | // input/output | |
374 | WXDLLEXPORT void wxRedirectIOToConsole(); | |
375 | ||
d6b9496a VZ |
376 | #endif // MSW |
377 | ||
378 | // ---------------------------------------------------------------------------- | |
379 | // Display and colorss (X only) | |
380 | // ---------------------------------------------------------------------------- | |
c801d85f | 381 | |
d111a89a VZ |
382 | #ifdef __WXGTK__ |
383 | void *wxGetDisplay(); | |
384 | #endif | |
385 | ||
c801d85f | 386 | #ifdef __X__ |
d6b9496a VZ |
387 | WXDisplay *wxGetDisplay(); |
388 | bool wxSetDisplay(const wxString& display_name); | |
389 | wxString wxGetDisplayName(); | |
d111a89a | 390 | #endif // X or GTK+ |
c801d85f KB |
391 | |
392 | #ifdef __X__ | |
393 | ||
338dd992 JJ |
394 | #ifdef __VMS__ // Xlib.h for VMS is not (yet) compatible with C++ |
395 | // The resulting warnings are switched off here | |
396 | #pragma message disable nosimpint | |
397 | #endif | |
c801d85f | 398 | #include <X11/Xlib.h> |
338dd992 JJ |
399 | #ifdef __VMS__ |
400 | #pragma message enable nosimpint | |
401 | #endif | |
c801d85f KB |
402 | |
403 | #define wxMAX_RGB 0xff | |
404 | #define wxMAX_SV 1000 | |
405 | #define wxSIGN(x) ((x < 0) ? -x : x) | |
406 | #define wxH_WEIGHT 4 | |
407 | #define wxS_WEIGHT 1 | |
408 | #define wxV_WEIGHT 2 | |
409 | ||
410 | typedef struct wx_hsv { | |
411 | int h,s,v; | |
412 | } wxHSV; | |
d6b9496a | 413 | |
c801d85f KB |
414 | #define wxMax3(x,y,z) ((x > y) ? ((x > z) ? x : z) : ((y > z) ? y : z)) |
415 | #define wxMin3(x,y,z) ((x < y) ? ((x < z) ? x : z) : ((y < z) ? y : z)) | |
416 | ||
c801d85f KB |
417 | void wxHSVToXColor(wxHSV *hsv,XColor *xcolor); |
418 | void wxXColorToHSV(wxHSV *hsv,XColor *xcolor); | |
419 | void wxAllocNearestColor(Display *display,Colormap colormap,XColor *xcolor); | |
420 | void wxAllocColor(Display *display,Colormap colormap,XColor *xcolor); | |
421 | ||
422 | #endif //__X__ | |
423 | ||
e90c1d2a VZ |
424 | #endif // wxUSE_GUI |
425 | ||
f6bcfd97 BP |
426 | // ---------------------------------------------------------------------------- |
427 | // Error message functions used by wxWindows (deprecated, use wxLog) | |
428 | // ---------------------------------------------------------------------------- | |
429 | ||
430 | // Format a message on the standard error (UNIX) or the debugging | |
431 | // stream (Windows) | |
432 | WXDLLEXPORT void wxDebugMsg(const wxChar *fmt ...); | |
433 | ||
434 | // Non-fatal error (continues) | |
435 | WXDLLEXPORT_DATA(extern const wxChar*) wxInternalErrorStr; | |
436 | WXDLLEXPORT void wxError(const wxString& msg, const wxString& title = wxInternalErrorStr); | |
437 | ||
438 | // Fatal error (exits) | |
439 | WXDLLEXPORT_DATA(extern const wxChar*) wxFatalErrorStr; | |
440 | WXDLLEXPORT void wxFatalError(const wxString& msg, const wxString& title = wxFatalErrorStr); | |
441 | ||
442 | ||
c801d85f | 443 | #endif |
34138703 | 444 | // _WX_UTILSH__ |