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