]> git.saurik.com Git - wxWidgets.git/blame - include/wx/utils.h
added CanConvert()
[wxWidgets.git] / include / wx / utils.h
CommitLineData
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
371a5b4e 9// Licence: wxWindows licence
c801d85f
KB
10/////////////////////////////////////////////////////////////////////////////
11
34138703
JS
12#ifndef _WX_UTILSH__
13#define _WX_UTILSH__
c801d85f 14
d6b9496a
VZ
15// ----------------------------------------------------------------------------
16// headers
17// ----------------------------------------------------------------------------
18
e4844687
SN
19#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) && !defined(__EMX__)
20// Some older compilers (such as EMX) cannot handle
21// #pragma interface/implementation correctly, iff
22// #pragma implementation is used in _two_ translation
23// units (as created by e.g. event.cpp compiled for
24// libwx_base and event.cpp compiled for libwx_gui_core).
25// So we must not use those pragmas for those compilers in
26// such files.
d6b9496a 27 #pragma interface "utils.h"
c801d85f
KB
28#endif
29
c801d85f
KB
30#include "wx/object.h"
31#include "wx/list.h"
c801d85f 32#include "wx/filefn.h"
2da2f941
MB
33
34class WXDLLIMPEXP_BASE wxArrayString;
c801d85f 35
eadd7bd2
VZ
36// need this for wxGetDiskSpace() as we can't, unfortunately, forward declare
37// wxLongLong
38#include "wx/longlong.h"
39
c801d85f 40#ifdef __X__
d6b9496a
VZ
41 #include <dirent.h>
42 #include <unistd.h>
c801d85f
KB
43#endif
44
45#include <stdio.h>
46
d6b9496a
VZ
47// ----------------------------------------------------------------------------
48// Forward declaration
49// ----------------------------------------------------------------------------
50
bddd7a8d
VZ
51class WXDLLIMPEXP_BASE wxProcess;
52class WXDLLIMPEXP_BASE wxFrame;
53class WXDLLIMPEXP_BASE wxWindow;
54class WXDLLIMPEXP_BASE wxWindowList;
55class WXDLLIMPEXP_BASE wxPoint;
d6b9496a 56
d6b9496a
VZ
57// ----------------------------------------------------------------------------
58// Macros
59// ----------------------------------------------------------------------------
c801d85f 60
d6b9496a
VZ
61#define wxMax(a,b) (((a) > (b)) ? (a) : (b))
62#define wxMin(a,b) (((a) < (b)) ? (a) : (b))
c801d85f 63
d6b9496a
VZ
64// ----------------------------------------------------------------------------
65// String functions (deprecated, use wxString)
66// ----------------------------------------------------------------------------
67
c801d85f 68// Make a copy of this string using 'new'
f526f752 69#if WXWIN_COMPATIBILITY_2_4
bddd7a8d 70WXDLLIMPEXP_BASE wxChar* copystring(const wxChar *s);
f526f752 71#endif
c801d85f 72
d6b9496a 73// A shorter way of using strcmp
9d2f3c71 74#define wxStringEq(s1, s2) (s1 && s2 && (wxStrcmp(s1, s2) == 0))
d6b9496a
VZ
75
76// ----------------------------------------------------------------------------
77// Miscellaneous functions
78// ----------------------------------------------------------------------------
79
80// Sound the bell
bddd7a8d 81WXDLLIMPEXP_BASE void wxBell();
d6b9496a 82
bdc72a22 83// Get OS description as a user-readable string
bddd7a8d 84WXDLLIMPEXP_BASE wxString wxGetOsDescription();
bdc72a22 85
d6b9496a 86// Get OS version
bddd7a8d 87WXDLLIMPEXP_BASE int wxGetOsVersion(int *majorVsn = (int *) NULL,
bdc72a22 88 int *minorVsn = (int *) NULL);
d6b9496a
VZ
89
90// Return a string with the current date/time
bddd7a8d 91WXDLLIMPEXP_BASE wxString wxNow();
d6b9496a 92
134677bd 93// Return path where wxWindows is installed (mostly useful in Unices)
bddd7a8d 94WXDLLIMPEXP_BASE const wxChar *wxGetInstallPrefix();
2c18f21d 95// Return path to wxWin data (/usr/share/wx/%{version}) (Unices)
bddd7a8d 96WXDLLIMPEXP_BASE wxString wxGetDataDir();
134677bd
VS
97
98
e90c1d2a 99#if wxUSE_GUI
63cc5d9d
RR
100// Don't synthesize KeyUp events holding down a key and producing
101// KeyDown events with autorepeat. On by default and always on
102// in wxMSW.
f0492f7d
RR
103WXDLLEXPORT bool wxSetDetectableAutoRepeat( bool flag );
104
d6b9496a
VZ
105// ----------------------------------------------------------------------------
106// Window ID management
107// ----------------------------------------------------------------------------
108
c801d85f 109// Generate a unique ID
afb74891 110WXDLLEXPORT long wxNewId();
c801d85f
KB
111
112// Ensure subsequent IDs don't clash with this one
184b5d99 113WXDLLEXPORT void wxRegisterId(long id);
c801d85f
KB
114
115// Return the current ID
afb74891 116WXDLLEXPORT long wxGetCurrentId();
c801d85f 117
e90c1d2a
VZ
118#endif // wxUSE_GUI
119
d6b9496a
VZ
120// ----------------------------------------------------------------------------
121// Various conversions
122// ----------------------------------------------------------------------------
c801d85f 123
e12c92c2
VZ
124// these functions are deprecated, use wxString methods instead!
125#if WXWIN_COMPATIBILITY_2_4
126
bddd7a8d
VZ
127WXDLLIMPEXP_DATA_BASE(extern const wxChar*) wxFloatToStringStr;
128WXDLLIMPEXP_DATA_BASE(extern const wxChar*) wxDoubleToStringStr;
c801d85f 129
bddd7a8d
VZ
130WXDLLIMPEXP_BASE void StringToFloat(const wxChar *s, float *number);
131WXDLLIMPEXP_BASE wxChar* FloatToString(float number, const wxChar *fmt = wxFloatToStringStr);
132WXDLLIMPEXP_BASE void StringToDouble(const wxChar *s, double *number);
133WXDLLIMPEXP_BASE wxChar* DoubleToString(double number, const wxChar *fmt = wxDoubleToStringStr);
134WXDLLIMPEXP_BASE void StringToInt(const wxChar *s, int *number);
135WXDLLIMPEXP_BASE void StringToLong(const wxChar *s, long *number);
136WXDLLIMPEXP_BASE wxChar* IntToString(int number);
137WXDLLIMPEXP_BASE wxChar* LongToString(long number);
c801d85f 138
e12c92c2
VZ
139#endif // WXWIN_COMPATIBILITY_2_4
140
c801d85f 141// Convert 2-digit hex number to decimal
bddd7a8d 142WXDLLIMPEXP_BASE int wxHexToDec(const wxString& buf);
c801d85f
KB
143
144// Convert decimal integer to 2-character hex string
bddd7a8d
VZ
145WXDLLIMPEXP_BASE void wxDecToHex(int dec, wxChar *buf);
146WXDLLIMPEXP_BASE wxString wxDecToHex(int dec);
c801d85f 147
d6b9496a
VZ
148// ----------------------------------------------------------------------------
149// Process management
150// ----------------------------------------------------------------------------
151
fbf456aa
VZ
152// NB: for backwars compatibility reasons the values of wxEXEC_[A]SYNC *must*
153// be 0 and 1, don't change!
154
155enum
156{
e1082c9f
VZ
157 // execute the process asynchronously
158 wxEXEC_ASYNC = 0,
159
160 // execute it synchronously, i.e. wait until it finishes
161 wxEXEC_SYNC = 1,
162
163 // under Windows, don't hide the child even if it's IO is redirected (this
164 // is done by default)
165 wxEXEC_NOHIDE = 2,
166
167 // under Unix, if the process is the group leader then killing -pid kills
168 // all children as well as pid
169 wxEXEC_MAKE_GROUP_LEADER = 4
fbf456aa
VZ
170};
171
172// Execute another program.
173//
174// If flags contain wxEXEC_SYNC, return -1 on failure and the exit code of the
175// process if everything was ok. Otherwise (i.e. if wxEXEC_ASYNC), return 0 on
176// failure and the PID of the launched process if ok.
bddd7a8d 177WXDLLIMPEXP_BASE long wxExecute(wxChar **argv, int flags = wxEXEC_ASYNC,
c67daf87 178 wxProcess *process = (wxProcess *) NULL);
bddd7a8d 179WXDLLIMPEXP_BASE long wxExecute(const wxString& command, int flags = wxEXEC_ASYNC,
c67daf87 180 wxProcess *process = (wxProcess *) NULL);
c801d85f 181
fbf456aa
VZ
182// execute the command capturing its output into an array line by line, this is
183// always synchronous
bddd7a8d 184WXDLLIMPEXP_BASE long wxExecute(const wxString& command,
f6bcfd97
BP
185 wxArrayString& output);
186
fbf456aa 187// also capture stderr (also synchronous)
bddd7a8d 188WXDLLIMPEXP_BASE long wxExecute(const wxString& command,
f6bcfd97
BP
189 wxArrayString& output,
190 wxArrayString& error);
cd6ce4a9 191
d6b9496a
VZ
192enum wxSignal
193{
194 wxSIGNONE = 0, // verify if the process exists under Unix
195 wxSIGHUP,
196 wxSIGINT,
197 wxSIGQUIT,
198 wxSIGILL,
199 wxSIGTRAP,
200 wxSIGABRT,
201 wxSIGIOT = wxSIGABRT, // another name
202 wxSIGEMT,
203 wxSIGFPE,
204 wxSIGKILL,
205 wxSIGBUS,
206 wxSIGSEGV,
207 wxSIGSYS,
208 wxSIGPIPE,
209 wxSIGALRM,
210 wxSIGTERM
211
212 // further signals are different in meaning between different Unix systems
213};
c801d85f 214
50567b69
VZ
215enum wxKillError
216{
217 wxKILL_OK, // no error
218 wxKILL_BAD_SIGNAL, // no such signal
219 wxKILL_ACCESS_DENIED, // permission denied
220 wxKILL_NO_PROCESS, // no such process
221 wxKILL_ERROR // another, unspecified error
222};
223
f6ba47d9
VZ
224enum wxShutdownFlags
225{
226 wxSHUTDOWN_POWEROFF, // power off the computer
227 wxSHUTDOWN_REBOOT // shutdown and reboot
228};
229
c1cb4153 230// Shutdown or reboot the PC
bddd7a8d 231WXDLLIMPEXP_BASE bool wxShutdown(wxShutdownFlags wFlags);
f6ba47d9 232
50567b69
VZ
233// send the given signal to the process (only NONE and KILL are supported under
234// Windows, all others mean TERM), return 0 if ok and -1 on error
235//
236// return detailed error in rc if not NULL
bddd7a8d 237WXDLLIMPEXP_BASE int wxKill(long pid,
50567b69
VZ
238 wxSignal sig = wxSIGTERM,
239 wxKillError *rc = NULL);
c801d85f 240
2c8e4738 241// Execute a command in an interactive shell window (always synchronously)
c801d85f 242// If no command then just the shell
bddd7a8d 243WXDLLIMPEXP_BASE bool wxShell(const wxString& command = wxEmptyString);
c801d85f 244
2c8e4738
VZ
245// As wxShell(), but must give a (non interactive) command and its output will
246// be returned in output array
bddd7a8d 247WXDLLIMPEXP_BASE bool wxShell(const wxString& command, wxArrayString& output);
2c8e4738 248
b568d04f 249// Sleep for nSecs seconds
bddd7a8d 250WXDLLIMPEXP_BASE void wxSleep(int nSecs);
c801d85f 251
afb74891 252// Sleep for a given amount of milliseconds
bddd7a8d 253WXDLLIMPEXP_BASE void wxUsleep(unsigned long milliseconds);
afb74891 254
c1cb4153 255// Get the process id of the current process
bddd7a8d 256WXDLLIMPEXP_BASE unsigned long wxGetProcessId();
c1cb4153 257
c801d85f 258// Get free memory in bytes, or -1 if cannot determine amount (e.g. on UNIX)
bddd7a8d 259WXDLLIMPEXP_BASE long wxGetFreeMemory();
c801d85f 260
a37a5a73 261// should wxApp::OnFatalException() be called?
bddd7a8d 262WXDLLIMPEXP_BASE bool wxHandleFatalExceptions(bool doit = TRUE);
a37a5a73 263
8fd0d89b
VZ
264// ----------------------------------------------------------------------------
265// Environment variables
266// ----------------------------------------------------------------------------
267
308978f6
VZ
268// returns TRUE if variable exists (value may be NULL if you just want to check
269// for this)
bddd7a8d 270WXDLLIMPEXP_BASE bool wxGetEnv(const wxString& var, wxString *value);
8fd0d89b
VZ
271
272// set the env var name to the given value, return TRUE on success
bddd7a8d 273WXDLLIMPEXP_BASE bool wxSetEnv(const wxString& var, const wxChar *value);
8fd0d89b
VZ
274
275// remove the env var from environment
276inline bool wxUnsetEnv(const wxString& var) { return wxSetEnv(var, NULL); }
277
d6b9496a
VZ
278// ----------------------------------------------------------------------------
279// Network and username functions.
280// ----------------------------------------------------------------------------
c801d85f 281
d6b9496a 282// NB: "char *" functions are deprecated, use wxString ones!
c801d85f
KB
283
284// Get eMail address
bddd7a8d
VZ
285WXDLLIMPEXP_BASE bool wxGetEmailAddress(wxChar *buf, int maxSize);
286WXDLLIMPEXP_BASE wxString wxGetEmailAddress();
c801d85f
KB
287
288// Get hostname.
bddd7a8d
VZ
289WXDLLIMPEXP_BASE bool wxGetHostName(wxChar *buf, int maxSize);
290WXDLLIMPEXP_BASE wxString wxGetHostName();
d6b9496a
VZ
291
292// Get FQDN
bddd7a8d
VZ
293WXDLLIMPEXP_BASE wxString wxGetFullHostName();
294WXDLLIMPEXP_BASE bool wxGetFullHostName(wxChar *buf, int maxSize);
c801d85f 295
d6b9496a 296// Get user ID e.g. jacs (this is known as login name under Unix)
bddd7a8d
VZ
297WXDLLIMPEXP_BASE bool wxGetUserId(wxChar *buf, int maxSize);
298WXDLLIMPEXP_BASE wxString wxGetUserId();
c801d85f
KB
299
300// Get user name e.g. Julian Smart
bddd7a8d
VZ
301WXDLLIMPEXP_BASE bool wxGetUserName(wxChar *buf, int maxSize);
302WXDLLIMPEXP_BASE wxString wxGetUserName();
d6b9496a
VZ
303
304// Get current Home dir and copy to dest (returns pstr->c_str())
bddd7a8d
VZ
305WXDLLIMPEXP_BASE wxString wxGetHomeDir();
306WXDLLIMPEXP_BASE const wxChar* wxGetHomeDir(wxString *pstr);
d6b9496a
VZ
307
308// Get the user's home dir (caller must copy --- volatile)
309// returns NULL is no HOME dir is known
61ef57fc 310#if defined(__UNIX__) && wxUSE_UNICODE
bddd7a8d 311WXDLLIMPEXP_BASE const wxMB2WXbuf wxGetUserHome(const wxString& user = wxEmptyString);
61ef57fc 312#else
bddd7a8d 313WXDLLIMPEXP_BASE wxChar* wxGetUserHome(const wxString& user = wxEmptyString);
61ef57fc 314#endif
d6b9496a 315
eadd7bd2 316// get number of total/free bytes on the disk where path belongs
bddd7a8d 317WXDLLIMPEXP_BASE bool wxGetDiskSpace(const wxString& path,
eadd7bd2
VZ
318 wxLongLong *pTotal = NULL,
319 wxLongLong *pFree = NULL);
320
e90c1d2a
VZ
321#if wxUSE_GUI // GUI only things from now on
322
d6b9496a 323// ----------------------------------------------------------------------------
974e8d94 324// Menu accelerators related things
d6b9496a 325// ----------------------------------------------------------------------------
c801d85f 326
bc87fd68 327WXDLLEXPORT wxChar* wxStripMenuCodes(const wxChar *in, wxChar *out = (wxChar *) NULL);
184b5d99 328WXDLLEXPORT wxString wxStripMenuCodes(const wxString& str);
c801d85f 329
974e8d94
VZ
330#if wxUSE_ACCEL
331class WXDLLEXPORT wxAcceleratorEntry;
332WXDLLEXPORT wxAcceleratorEntry *wxGetAccelFromString(const wxString& label);
333#endif // wxUSE_ACCEL
334
d6b9496a
VZ
335// ----------------------------------------------------------------------------
336// Window search
337// ----------------------------------------------------------------------------
338
c801d85f 339// Returns menu item id or -1 if none.
184b5d99 340WXDLLEXPORT int wxFindMenuItemId(wxFrame *frame, const wxString& menuString, const wxString& itemString);
c801d85f 341
57591e0e
JS
342// Find the wxWindow at the given point. wxGenericFindWindowAtPoint
343// is always present but may be less reliable than a native version.
344WXDLLEXPORT wxWindow* wxGenericFindWindowAtPoint(const wxPoint& pt);
59a12e90
JS
345WXDLLEXPORT wxWindow* wxFindWindowAtPoint(const wxPoint& pt);
346
146ba0fe
VZ
347// NB: this function is obsolete, use wxWindow::FindWindowByLabel() instead
348//
349// Find the window/widget with the given title or label.
350// Pass a parent to begin the search from, or NULL to look through
351// all windows.
352WXDLLEXPORT wxWindow* wxFindWindowByLabel(const wxString& title, wxWindow *parent = (wxWindow *) NULL);
353
354// NB: this function is obsolete, use wxWindow::FindWindowByName() instead
355//
356// Find window by name, and if that fails, by label.
357WXDLLEXPORT wxWindow* wxFindWindowByName(const wxString& name, wxWindow *parent = (wxWindow *) NULL);
358
d6b9496a
VZ
359// ----------------------------------------------------------------------------
360// Message/event queue helpers
361// ----------------------------------------------------------------------------
c801d85f 362
ead7ce10 363// Yield to other apps/messages and disable user input
b829bf55 364WXDLLEXPORT bool wxSafeYield(wxWindow *win = NULL, bool onlyIfNeeded = FALSE);
ead7ce10 365
95dee651
KB
366// Enable or disable input to all top level windows
367WXDLLEXPORT void wxEnableTopLevelWindows(bool enable = TRUE);
368
d6b9496a
VZ
369// Check whether this window wants to process messages, e.g. Stop button
370// in long calculations.
371WXDLLEXPORT bool wxCheckForInterrupt(wxWindow *wnd);
372
373// Consume all events until no more left
374WXDLLEXPORT void wxFlushEvents();
375
cd6ce4a9
VZ
376// a class which disables all windows (except, may be, thegiven one) in its
377// ctor and enables them back in its dtor
378class WXDLLEXPORT wxWindowDisabler
379{
380public:
381 wxWindowDisabler(wxWindow *winToSkip = (wxWindow *)NULL);
382 ~wxWindowDisabler();
383
384private:
385 wxWindowList *m_winDisabled;
c1cb4153
VZ
386
387 DECLARE_NO_COPY_CLASS(wxWindowDisabler)
cd6ce4a9
VZ
388};
389
d6b9496a
VZ
390// ----------------------------------------------------------------------------
391// Cursors
392// ----------------------------------------------------------------------------
c801d85f
KB
393
394// Set the cursor to the busy cursor for all windows
395class WXDLLEXPORT wxCursor;
396WXDLLEXPORT_DATA(extern wxCursor*) wxHOURGLASS_CURSOR;
184b5d99 397WXDLLEXPORT void wxBeginBusyCursor(wxCursor *cursor = wxHOURGLASS_CURSOR);
e2a6f233 398
c801d85f 399// Restore cursor to normal
afb74891 400WXDLLEXPORT void wxEndBusyCursor();
d6b9496a 401
c801d85f 402// TRUE if we're between the above two calls
afb74891 403WXDLLEXPORT bool wxIsBusy();
c801d85f 404
e2a6f233
JS
405// Convenience class so we can just create a wxBusyCursor object on the stack
406class WXDLLEXPORT wxBusyCursor
407{
afb74891
VZ
408public:
409 wxBusyCursor(wxCursor* cursor = wxHOURGLASS_CURSOR)
410 { wxBeginBusyCursor(cursor); }
f6bcfd97 411 ~wxBusyCursor()
afb74891 412 { wxEndBusyCursor(); }
e2a6f233 413
f6bcfd97
BP
414 // FIXME: These two methods are currently only implemented (and needed?)
415 // in wxGTK. BusyCursor handling should probably be moved to
416 // common code since the wxGTK and wxMSW implementations are very
417 // similar except for wxMSW using HCURSOR directly instead of
418 // wxCursor.. -- RL.
419 static const wxCursor &GetStoredCursor();
420 static const wxCursor GetBusyCursor();
421};
c801d85f 422
c801d85f 423
d6b9496a 424// ----------------------------------------------------------------------------
c801d85f 425// Reading and writing resources (eg WIN.INI, .Xdefaults)
d6b9496a
VZ
426// ----------------------------------------------------------------------------
427
47d67540 428#if wxUSE_RESOURCES
62448488
JS
429WXDLLEXPORT bool wxWriteResource(const wxString& section, const wxString& entry, const wxString& value, const wxString& file = wxEmptyString);
430WXDLLEXPORT bool wxWriteResource(const wxString& section, const wxString& entry, float value, const wxString& file = wxEmptyString);
431WXDLLEXPORT bool wxWriteResource(const wxString& section, const wxString& entry, long value, const wxString& file = wxEmptyString);
432WXDLLEXPORT bool wxWriteResource(const wxString& section, const wxString& entry, int value, const wxString& file = wxEmptyString);
433
9d2f3c71 434WXDLLEXPORT bool wxGetResource(const wxString& section, const wxString& entry, wxChar **value, const wxString& file = wxEmptyString);
62448488
JS
435WXDLLEXPORT bool wxGetResource(const wxString& section, const wxString& entry, float *value, const wxString& file = wxEmptyString);
436WXDLLEXPORT bool wxGetResource(const wxString& section, const wxString& entry, long *value, const wxString& file = wxEmptyString);
437WXDLLEXPORT bool wxGetResource(const wxString& section, const wxString& entry, int *value, const wxString& file = wxEmptyString);
47d67540 438#endif // wxUSE_RESOURCES
c801d85f 439
c801d85f
KB
440void WXDLLEXPORT wxGetMousePosition( int* x, int* y );
441
442// MSW only: get user-defined resource from the .res file.
443// Returns NULL or newly-allocated memory, so use delete[] to clean up.
2049ba38 444#ifdef __WXMSW__
373658eb
VZ
445 WXDLLEXPORT extern const wxChar* wxUserResourceStr;
446 WXDLLEXPORT wxChar* wxLoadUserResource(const wxString& resourceName, const wxString& resourceType = wxUserResourceStr);
d6b9496a
VZ
447#endif // MSW
448
449// ----------------------------------------------------------------------------
450// Display and colorss (X only)
451// ----------------------------------------------------------------------------
c801d85f 452
d111a89a
VZ
453#ifdef __WXGTK__
454 void *wxGetDisplay();
455#endif
456
c801d85f 457#ifdef __X__
d6b9496a
VZ
458 WXDisplay *wxGetDisplay();
459 bool wxSetDisplay(const wxString& display_name);
460 wxString wxGetDisplayName();
d111a89a 461#endif // X or GTK+
c801d85f
KB
462
463#ifdef __X__
464
338dd992
JJ
465#ifdef __VMS__ // Xlib.h for VMS is not (yet) compatible with C++
466 // The resulting warnings are switched off here
467#pragma message disable nosimpint
468#endif
7266b672 469// #include <X11/Xlib.h>
338dd992
JJ
470#ifdef __VMS__
471#pragma message enable nosimpint
472#endif
c801d85f 473
c801d85f
KB
474#endif //__X__
475
e90c1d2a
VZ
476#endif // wxUSE_GUI
477
886dd7d2
VZ
478// ----------------------------------------------------------------------------
479// wxYield(): these functions are obsolete, please use wxApp methods instead!
480// ----------------------------------------------------------------------------
481
482// Yield to other apps/messages
bddd7a8d 483WXDLLIMPEXP_BASE bool wxYield();
886dd7d2
VZ
484
485// Like wxYield, but fails silently if the yield is recursive.
bddd7a8d 486WXDLLIMPEXP_BASE bool wxYieldIfNeeded();
886dd7d2 487
f6bcfd97
BP
488// ----------------------------------------------------------------------------
489// Error message functions used by wxWindows (deprecated, use wxLog)
490// ----------------------------------------------------------------------------
491
73deed44
VZ
492#if WXWIN_COMPATIBILITY_2_2
493
f6bcfd97
BP
494// Format a message on the standard error (UNIX) or the debugging
495// stream (Windows)
bddd7a8d 496WXDLLIMPEXP_BASE void wxDebugMsg(const wxChar *fmt ...) ATTRIBUTE_PRINTF_1;
f6bcfd97
BP
497
498// Non-fatal error (continues)
bddd7a8d
VZ
499WXDLLIMPEXP_DATA_BASE(extern const wxChar*) wxInternalErrorStr;
500WXDLLIMPEXP_BASE void wxError(const wxString& msg, const wxString& title = wxInternalErrorStr);
f6bcfd97
BP
501
502// Fatal error (exits)
bddd7a8d
VZ
503WXDLLIMPEXP_DATA_BASE(extern const wxChar*) wxFatalErrorStr;
504WXDLLIMPEXP_BASE void wxFatalError(const wxString& msg, const wxString& title = wxFatalErrorStr);
f6bcfd97 505
73deed44 506#endif // WXWIN_COMPATIBILITY_2_2
f6bcfd97 507
c801d85f 508#endif
34138703 509 // _WX_UTILSH__