1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: Miscellaneous utilities
4 // Author: Julian Smart
8 // Copyright: (c) 1998 Julian Smart
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
15 // ----------------------------------------------------------------------------
17 // ----------------------------------------------------------------------------
19 #include "wx/object.h"
21 #include "wx/filefn.h"
23 class WXDLLIMPEXP_BASE wxArrayString
;
24 class WXDLLIMPEXP_BASE wxArrayInt
;
26 // need this for wxGetDiskSpace() as we can't, unfortunately, forward declare
28 #include "wx/longlong.h"
39 // ----------------------------------------------------------------------------
40 // Forward declaration
41 // ----------------------------------------------------------------------------
43 class WXDLLIMPEXP_CORE wxProcess
;
44 class WXDLLIMPEXP_CORE wxFrame
;
45 class WXDLLIMPEXP_CORE wxWindow
;
46 class WXDLLIMPEXP_CORE wxWindowList
;
47 class WXDLLIMPEXP_CORE wxPoint
;
49 // ----------------------------------------------------------------------------
51 // ----------------------------------------------------------------------------
53 #define wxMax(a,b) (((a) > (b)) ? (a) : (b))
54 #define wxMin(a,b) (((a) < (b)) ? (a) : (b))
56 // wxGetFreeMemory can return huge amount of memory on 32-bit platforms as well
57 // so to always use long long for its result type on all platforms which
60 typedef wxLongLong wxMemorySize
;
62 typedef long wxMemorySize
;
65 // ----------------------------------------------------------------------------
66 // String functions (deprecated, use wxString)
67 // ----------------------------------------------------------------------------
69 // Make a copy of this string using 'new'
70 #if WXWIN_COMPATIBILITY_2_4
71 wxDEPRECATED( WXDLLIMPEXP_BASE wxChar
* copystring(const wxChar
*s
) );
74 // A shorter way of using strcmp
75 #define wxStringEq(s1, s2) (s1 && s2 && (wxStrcmp(s1, s2) == 0))
77 // ----------------------------------------------------------------------------
78 // Miscellaneous functions
79 // ----------------------------------------------------------------------------
82 #if !defined __EMX__ && \
83 (defined __WXMOTIF__ || defined __WXGTK__ || defined __WXX11__)
84 WXDLLIMPEXP_CORE
void wxBell();
86 WXDLLIMPEXP_BASE
void wxBell();
89 // Get OS description as a user-readable string
90 WXDLLIMPEXP_BASE wxString
wxGetOsDescription();
93 WXDLLIMPEXP_BASE
int wxGetOsVersion(int *majorVsn
= (int *) NULL
,
94 int *minorVsn
= (int *) NULL
);
96 // Return a string with the current date/time
97 WXDLLIMPEXP_BASE wxString
wxNow();
99 // Return path where wxWidgets is installed (mostly useful in Unices)
100 WXDLLIMPEXP_BASE
const wxChar
*wxGetInstallPrefix();
101 // Return path to wxWin data (/usr/share/wx/%{version}) (Unices)
102 WXDLLIMPEXP_BASE wxString
wxGetDataDir();
105 * Class to make it easier to specify platform-dependent values
108 * long val = wxPlatform(3).Is(wxMac, 1).Is(wxGTK, 2).Is(stPDA, 5);
109 * wxString strVal = wxPlatform(wxT("Hello")).Is(wxMac, wxT("Mac")).Is(wxMSW, wxT("MSW"));
111 * A custom platform symbol:
115 * wxPlatform::AddPlatform(stPDA);
118 * long windowStyle = wxCAPTION | (long) wxPlatform().IsNot(stPDA, wxRESIZE_BORDER);
122 class WXDLLIMPEXP_BASE wxPlatform
125 wxPlatform() { m_longValue
= 0; m_doubleValue
= 0.0; }
127 // Specify an optional default value
128 wxPlatform(long defValue
) { m_longValue
= defValue
; m_doubleValue
= 0.0; }
129 wxPlatform(const wxString
& defValue
) { m_stringValue
= defValue
; m_longValue
= 0; m_doubleValue
= 0.0; }
130 wxPlatform(double defValue
) { m_longValue
= 0; m_doubleValue
= defValue
; }
132 wxPlatform
& Is(int platform
, long value
);
133 wxPlatform
& IsNot(int platform
, long value
);
135 wxPlatform
& Is(int platform
, int value
) { return Is(platform
, (long) value
); }
136 wxPlatform
& IsNot(int platform
, int value
) { return IsNot(platform
, (long) value
); }
138 wxPlatform
& Is(int platform
, const wxString
& value
);
139 wxPlatform
& IsNot(int platform
, const wxString
& value
);
141 wxPlatform
& Is(int platform
, double value
);
142 wxPlatform
& IsNot(int platform
, double value
);
144 // This should be specified first to set the default value, or simply
145 // pass the value to the constructor
146 wxPlatform
& Default(long value
);
147 wxPlatform
& Default(const wxString
& value
);
148 wxPlatform
& Default(double value
);
150 long GetInteger() const { return m_longValue
; }
151 const wxString
& GetString() const { return m_stringValue
; }
152 double GetDouble() const { return m_doubleValue
; }
154 operator int() const { return (int) GetInteger(); }
155 operator long() const { return GetInteger(); }
156 operator double() const { return GetDouble(); }
157 operator const wxString() const { return GetString(); }
158 operator const wxChar
*() const { return (const wxChar
*) GetString(); }
160 static void AddPlatform(int platform
);
161 static bool PlatformIs(int platform
);
162 static void ClearPlatforms();
166 double m_doubleValue
;
167 wxString m_stringValue
;
168 static wxArrayInt
* sm_customPlatforms
;
171 /// Function for testing current platform
172 inline bool wxPlatformIs(int platform
) { return wxPlatform::PlatformIs(platform
); }
176 // Get the state of a key (true if pressed, false if not)
177 // This is generally most useful getting the state of
178 // the modifier or toggle keys.
179 WXDLLEXPORT
bool wxGetKeyState(wxKeyCode key
);
182 // Don't synthesize KeyUp events holding down a key and producing
183 // KeyDown events with autorepeat. On by default and always on
185 WXDLLEXPORT
bool wxSetDetectableAutoRepeat( bool flag
);
188 // wxMouseState is used to hold information about button and modifier state
189 // and is what is returned from wxGetMouseState.
190 class WXDLLEXPORT wxMouseState
195 m_leftDown(false), m_middleDown(false), m_rightDown(false),
196 m_controlDown(false), m_shiftDown(false), m_altDown(false),
200 wxCoord
GetX() { return m_x
; }
201 wxCoord
GetY() { return m_y
; }
203 bool LeftDown() { return m_leftDown
; }
204 bool MiddleDown() { return m_middleDown
; }
205 bool RightDown() { return m_rightDown
; }
207 bool ControlDown() { return m_controlDown
; }
208 bool ShiftDown() { return m_shiftDown
; }
209 bool AltDown() { return m_altDown
; }
210 bool MetaDown() { return m_metaDown
; }
213 #if defined(__WXMAC__) || defined(__WXCOCOA__)
216 return ControlDown();
220 void SetX(wxCoord x
) { m_x
= x
; }
221 void SetY(wxCoord y
) { m_y
= y
; }
223 void SetLeftDown(bool down
) { m_leftDown
= down
; }
224 void SetMiddleDown(bool down
) { m_middleDown
= down
; }
225 void SetRightDown(bool down
) { m_rightDown
= down
; }
227 void SetControlDown(bool down
) { m_controlDown
= down
; }
228 void SetShiftDown(bool down
) { m_shiftDown
= down
; }
229 void SetAltDown(bool down
) { m_altDown
= down
; }
230 void SetMetaDown(bool down
) { m_metaDown
= down
; }
247 // Returns the current state of the mouse position, buttons and modifers
248 WXDLLEXPORT wxMouseState
wxGetMouseState();
251 // ----------------------------------------------------------------------------
252 // Window ID management
253 // ----------------------------------------------------------------------------
255 // Generate a unique ID
256 WXDLLEXPORT
long wxNewId();
258 // Ensure subsequent IDs don't clash with this one
259 WXDLLEXPORT
void wxRegisterId(long id
);
261 // Return the current ID
262 WXDLLEXPORT
long wxGetCurrentId();
266 // ----------------------------------------------------------------------------
267 // Various conversions
268 // ----------------------------------------------------------------------------
270 // these functions are deprecated, use wxString methods instead!
271 #if WXWIN_COMPATIBILITY_2_4
273 extern WXDLLIMPEXP_DATA_BASE(const wxChar
*) wxFloatToStringStr
;
274 extern WXDLLIMPEXP_DATA_BASE(const wxChar
*) wxDoubleToStringStr
;
276 wxDEPRECATED( WXDLLIMPEXP_BASE
void StringToFloat(const wxChar
*s
, float *number
) );
277 wxDEPRECATED( WXDLLIMPEXP_BASE wxChar
* FloatToString(float number
, const wxChar
*fmt
= wxFloatToStringStr
) );
278 wxDEPRECATED( WXDLLIMPEXP_BASE
void StringToDouble(const wxChar
*s
, double *number
) );
279 wxDEPRECATED( WXDLLIMPEXP_BASE wxChar
* DoubleToString(double number
, const wxChar
*fmt
= wxDoubleToStringStr
) );
280 wxDEPRECATED( WXDLLIMPEXP_BASE
void StringToInt(const wxChar
*s
, int *number
) );
281 wxDEPRECATED( WXDLLIMPEXP_BASE
void StringToLong(const wxChar
*s
, long *number
) );
282 wxDEPRECATED( WXDLLIMPEXP_BASE wxChar
* IntToString(int number
) );
283 wxDEPRECATED( WXDLLIMPEXP_BASE wxChar
* LongToString(long number
) );
285 #endif // WXWIN_COMPATIBILITY_2_4
287 // Convert 2-digit hex number to decimal
288 WXDLLIMPEXP_BASE
int wxHexToDec(const wxString
& buf
);
290 // Convert decimal integer to 2-character hex string
291 WXDLLIMPEXP_BASE
void wxDecToHex(int dec
, wxChar
*buf
);
292 WXDLLIMPEXP_BASE wxString
wxDecToHex(int dec
);
294 // ----------------------------------------------------------------------------
295 // Process management
296 // ----------------------------------------------------------------------------
298 // NB: for backwards compatibility reasons the values of wxEXEC_[A]SYNC *must*
299 // be 0 and 1, don't change!
303 // execute the process asynchronously
306 // execute it synchronously, i.e. wait until it finishes
309 // under Windows, don't hide the child even if it's IO is redirected (this
310 // is done by default)
313 // under Unix, if the process is the group leader then passing wxKILL_CHILDREN to wxKill
314 // kills all children as well as pid
315 wxEXEC_MAKE_GROUP_LEADER
= 4,
317 // by default synchronous execution disables all program windows to avoid
318 // that the user interacts with the program while the child process is
319 // running, you can use this flag to prevent this from happening
323 // Execute another program.
325 // If flags contain wxEXEC_SYNC, return -1 on failure and the exit code of the
326 // process if everything was ok. Otherwise (i.e. if wxEXEC_ASYNC), return 0 on
327 // failure and the PID of the launched process if ok.
328 WXDLLIMPEXP_BASE
long wxExecute(wxChar
**argv
, int flags
= wxEXEC_ASYNC
,
329 wxProcess
*process
= (wxProcess
*) NULL
);
330 WXDLLIMPEXP_BASE
long wxExecute(const wxString
& command
, int flags
= wxEXEC_ASYNC
,
331 wxProcess
*process
= (wxProcess
*) NULL
);
333 // execute the command capturing its output into an array line by line, this is
334 // always synchronous
335 WXDLLIMPEXP_BASE
long wxExecute(const wxString
& command
,
336 wxArrayString
& output
,
339 // also capture stderr (also synchronous)
340 WXDLLIMPEXP_BASE
long wxExecute(const wxString
& command
,
341 wxArrayString
& output
,
342 wxArrayString
& error
,
345 #if defined(__WXMSW__) && wxUSE_IPC
346 // ask a DDE server to execute the DDE request with given parameters
347 WXDLLIMPEXP_BASE
bool wxExecuteDDE(const wxString
& ddeServer
,
348 const wxString
& ddeTopic
,
349 const wxString
& ddeCommand
);
350 #endif // __WXMSW__ && wxUSE_IPC
354 wxSIGNONE
= 0, // verify if the process exists under Unix
361 wxSIGIOT
= wxSIGABRT
, // another name
372 // further signals are different in meaning between different Unix systems
377 wxKILL_OK
, // no error
378 wxKILL_BAD_SIGNAL
, // no such signal
379 wxKILL_ACCESS_DENIED
, // permission denied
380 wxKILL_NO_PROCESS
, // no such process
381 wxKILL_ERROR
// another, unspecified error
386 wxKILL_NOCHILDREN
= 0, // don't kill children
387 wxKILL_CHILDREN
= 1 // kill children
392 wxSHUTDOWN_POWEROFF
, // power off the computer
393 wxSHUTDOWN_REBOOT
// shutdown and reboot
396 // Shutdown or reboot the PC
397 WXDLLIMPEXP_BASE
bool wxShutdown(wxShutdownFlags wFlags
);
406 WXDLLIMPEXP_BASE wxPowerType
wxGetPowerType();
410 wxBATTERY_NORMAL_STATE
, // system is fully usable
411 wxBATTERY_LOW_STATE
, // start to worry
412 wxBATTERY_CRITICAL_STATE
, // save quickly
413 wxBATTERY_SHUTDOWN_STATE
, // too late
414 wxBATTERY_UNKNOWN_STATE
417 WXDLLIMPEXP_BASE wxBatteryState
wxGetBatteryState();
419 // send the given signal to the process (only NONE and KILL are supported under
420 // Windows, all others mean TERM), return 0 if ok and -1 on error
422 // return detailed error in rc if not NULL
423 WXDLLIMPEXP_BASE
int wxKill(long pid
,
424 wxSignal sig
= wxSIGTERM
,
425 wxKillError
*rc
= NULL
,
426 int flags
= wxKILL_NOCHILDREN
);
428 // Execute a command in an interactive shell window (always synchronously)
429 // If no command then just the shell
430 WXDLLIMPEXP_BASE
bool wxShell(const wxString
& command
= wxEmptyString
);
432 // As wxShell(), but must give a (non interactive) command and its output will
433 // be returned in output array
434 WXDLLIMPEXP_BASE
bool wxShell(const wxString
& command
, wxArrayString
& output
);
436 // Sleep for nSecs seconds
437 WXDLLIMPEXP_BASE
void wxSleep(int nSecs
);
439 // Sleep for a given amount of milliseconds
440 WXDLLIMPEXP_BASE
void wxMilliSleep(unsigned long milliseconds
);
442 // Sleep for a given amount of microseconds
443 WXDLLIMPEXP_BASE
void wxMicroSleep(unsigned long microseconds
);
445 // Sleep for a given amount of milliseconds (old, bad name), use wxMilliSleep
446 wxDEPRECATED( WXDLLIMPEXP_BASE
void wxUsleep(unsigned long milliseconds
) );
448 // Get the process id of the current process
449 WXDLLIMPEXP_BASE
unsigned long wxGetProcessId();
451 // Get free memory in bytes, or -1 if cannot determine amount (e.g. on UNIX)
452 WXDLLIMPEXP_BASE wxMemorySize
wxGetFreeMemory();
454 #if wxUSE_ON_FATAL_EXCEPTION
456 // should wxApp::OnFatalException() be called?
457 WXDLLIMPEXP_BASE
bool wxHandleFatalExceptions(bool doit
= true);
459 #endif // wxUSE_ON_FATAL_EXCEPTION
461 // flags for wxLaunchDefaultBrowser
464 wxBROWSER_NEW_WINDOW
= 1
467 // Launch url in the user's default internet browser
468 WXDLLIMPEXP_BASE
bool wxLaunchDefaultBrowser(const wxString
& url
, int flags
= 0);
470 // ----------------------------------------------------------------------------
471 // Environment variables
472 // ----------------------------------------------------------------------------
474 // returns true if variable exists (value may be NULL if you just want to check
476 WXDLLIMPEXP_BASE
bool wxGetEnv(const wxString
& var
, wxString
*value
);
478 // set the env var name to the given value, return true on success
479 WXDLLIMPEXP_BASE
bool wxSetEnv(const wxString
& var
, const wxChar
*value
);
481 // remove the env var from environment
482 inline bool wxUnsetEnv(const wxString
& var
) { return wxSetEnv(var
, NULL
); }
484 // ----------------------------------------------------------------------------
485 // Network and username functions.
486 // ----------------------------------------------------------------------------
488 // NB: "char *" functions are deprecated, use wxString ones!
491 WXDLLIMPEXP_BASE
bool wxGetEmailAddress(wxChar
*buf
, int maxSize
);
492 WXDLLIMPEXP_BASE wxString
wxGetEmailAddress();
495 WXDLLIMPEXP_BASE
bool wxGetHostName(wxChar
*buf
, int maxSize
);
496 WXDLLIMPEXP_BASE wxString
wxGetHostName();
499 WXDLLIMPEXP_BASE wxString
wxGetFullHostName();
500 WXDLLIMPEXP_BASE
bool wxGetFullHostName(wxChar
*buf
, int maxSize
);
502 // Get user ID e.g. jacs (this is known as login name under Unix)
503 WXDLLIMPEXP_BASE
bool wxGetUserId(wxChar
*buf
, int maxSize
);
504 WXDLLIMPEXP_BASE wxString
wxGetUserId();
506 // Get user name e.g. Julian Smart
507 WXDLLIMPEXP_BASE
bool wxGetUserName(wxChar
*buf
, int maxSize
);
508 WXDLLIMPEXP_BASE wxString
wxGetUserName();
510 // Get current Home dir and copy to dest (returns pstr->c_str())
511 WXDLLIMPEXP_BASE wxString
wxGetHomeDir();
512 WXDLLIMPEXP_BASE
const wxChar
* wxGetHomeDir(wxString
*pstr
);
514 // Get the user's home dir (caller must copy --- volatile)
515 // returns NULL is no HOME dir is known
516 #if defined(__UNIX__) && wxUSE_UNICODE
517 WXDLLIMPEXP_BASE
const wxMB2WXbuf
wxGetUserHome(const wxString
& user
= wxEmptyString
);
519 WXDLLIMPEXP_BASE wxChar
* wxGetUserHome(const wxString
& user
= wxEmptyString
);
523 typedef wxLongLong wxDiskspaceSize_t
;
525 typedef long wxDiskspaceSize_t
;
528 // get number of total/free bytes on the disk where path belongs
529 WXDLLIMPEXP_BASE
bool wxGetDiskSpace(const wxString
& path
,
530 wxDiskspaceSize_t
*pTotal
= NULL
,
531 wxDiskspaceSize_t
*pFree
= NULL
);
533 #if wxUSE_GUI // GUI only things from now on
535 // ----------------------------------------------------------------------------
536 // Menu accelerators related things
537 // ----------------------------------------------------------------------------
539 WXDLLEXPORT wxChar
* wxStripMenuCodes(const wxChar
*in
, wxChar
*out
= (wxChar
*) NULL
);
540 WXDLLEXPORT wxString
wxStripMenuCodes(const wxString
& str
);
543 class WXDLLEXPORT wxAcceleratorEntry
;
544 WXDLLEXPORT wxAcceleratorEntry
*wxGetAccelFromString(const wxString
& label
);
545 #endif // wxUSE_ACCEL
547 // ----------------------------------------------------------------------------
549 // ----------------------------------------------------------------------------
551 // Returns menu item id or wxNOT_FOUND if none.
552 WXDLLEXPORT
int wxFindMenuItemId(wxFrame
*frame
, const wxString
& menuString
, const wxString
& itemString
);
554 // Find the wxWindow at the given point. wxGenericFindWindowAtPoint
555 // is always present but may be less reliable than a native version.
556 WXDLLEXPORT wxWindow
* wxGenericFindWindowAtPoint(const wxPoint
& pt
);
557 WXDLLEXPORT wxWindow
* wxFindWindowAtPoint(const wxPoint
& pt
);
559 // NB: this function is obsolete, use wxWindow::FindWindowByLabel() instead
561 // Find the window/widget with the given title or label.
562 // Pass a parent to begin the search from, or NULL to look through
564 WXDLLEXPORT wxWindow
* wxFindWindowByLabel(const wxString
& title
, wxWindow
*parent
= (wxWindow
*) NULL
);
566 // NB: this function is obsolete, use wxWindow::FindWindowByName() instead
568 // Find window by name, and if that fails, by label.
569 WXDLLEXPORT wxWindow
* wxFindWindowByName(const wxString
& name
, wxWindow
*parent
= (wxWindow
*) NULL
);
571 // ----------------------------------------------------------------------------
572 // Message/event queue helpers
573 // ----------------------------------------------------------------------------
575 // Yield to other apps/messages and disable user input
576 WXDLLEXPORT
bool wxSafeYield(wxWindow
*win
= NULL
, bool onlyIfNeeded
= false);
578 // Enable or disable input to all top level windows
579 WXDLLEXPORT
void wxEnableTopLevelWindows(bool enable
= true);
581 // Check whether this window wants to process messages, e.g. Stop button
582 // in long calculations.
583 WXDLLEXPORT
bool wxCheckForInterrupt(wxWindow
*wnd
);
585 // Consume all events until no more left
586 WXDLLEXPORT
void wxFlushEvents();
588 // a class which disables all windows (except, may be, thegiven one) in its
589 // ctor and enables them back in its dtor
590 class WXDLLEXPORT wxWindowDisabler
593 wxWindowDisabler(wxWindow
*winToSkip
= (wxWindow
*)NULL
);
597 wxWindowList
*m_winDisabled
;
599 DECLARE_NO_COPY_CLASS(wxWindowDisabler
)
602 // ----------------------------------------------------------------------------
604 // ----------------------------------------------------------------------------
606 // Set the cursor to the busy cursor for all windows
607 class WXDLLEXPORT wxCursor
;
608 extern WXDLLEXPORT_DATA(wxCursor
*) wxHOURGLASS_CURSOR
;
609 WXDLLEXPORT
void wxBeginBusyCursor(wxCursor
*cursor
= wxHOURGLASS_CURSOR
);
611 // Restore cursor to normal
612 WXDLLEXPORT
void wxEndBusyCursor();
614 // true if we're between the above two calls
615 WXDLLEXPORT
bool wxIsBusy();
617 // Convenience class so we can just create a wxBusyCursor object on the stack
618 class WXDLLEXPORT wxBusyCursor
621 wxBusyCursor(wxCursor
* cursor
= wxHOURGLASS_CURSOR
)
622 { wxBeginBusyCursor(cursor
); }
624 { wxEndBusyCursor(); }
626 // FIXME: These two methods are currently only implemented (and needed?)
627 // in wxGTK. BusyCursor handling should probably be moved to
628 // common code since the wxGTK and wxMSW implementations are very
629 // similar except for wxMSW using HCURSOR directly instead of
631 static const wxCursor
&GetStoredCursor();
632 static const wxCursor
GetBusyCursor();
636 // ----------------------------------------------------------------------------
637 // Reading and writing resources (eg WIN.INI, .Xdefaults)
638 // ----------------------------------------------------------------------------
641 WXDLLEXPORT
bool wxWriteResource(const wxString
& section
, const wxString
& entry
, const wxString
& value
, const wxString
& file
= wxEmptyString
);
642 WXDLLEXPORT
bool wxWriteResource(const wxString
& section
, const wxString
& entry
, float value
, const wxString
& file
= wxEmptyString
);
643 WXDLLEXPORT
bool wxWriteResource(const wxString
& section
, const wxString
& entry
, long value
, const wxString
& file
= wxEmptyString
);
644 WXDLLEXPORT
bool wxWriteResource(const wxString
& section
, const wxString
& entry
, int value
, const wxString
& file
= wxEmptyString
);
646 WXDLLEXPORT
bool wxGetResource(const wxString
& section
, const wxString
& entry
, wxChar
**value
, const wxString
& file
= wxEmptyString
);
647 WXDLLEXPORT
bool wxGetResource(const wxString
& section
, const wxString
& entry
, float *value
, const wxString
& file
= wxEmptyString
);
648 WXDLLEXPORT
bool wxGetResource(const wxString
& section
, const wxString
& entry
, long *value
, const wxString
& file
= wxEmptyString
);
649 WXDLLEXPORT
bool wxGetResource(const wxString
& section
, const wxString
& entry
, int *value
, const wxString
& file
= wxEmptyString
);
650 #endif // wxUSE_RESOURCES
652 void WXDLLEXPORT
wxGetMousePosition( int* x
, int* y
);
654 // MSW only: get user-defined resource from the .res file.
655 // Returns NULL or newly-allocated memory, so use delete[] to clean up.
657 extern WXDLLEXPORT
const wxChar
* wxUserResourceStr
;
658 WXDLLEXPORT wxChar
* wxLoadUserResource(const wxString
& resourceName
, const wxString
& resourceType
= wxUserResourceStr
);
661 // ----------------------------------------------------------------------------
662 // Display and colorss (X only)
663 // ----------------------------------------------------------------------------
666 void *wxGetDisplay();
670 WXDLLIMPEXP_CORE WXDisplay
*wxGetDisplay();
671 WXDLLIMPEXP_CORE
bool wxSetDisplay(const wxString
& display_name
);
672 WXDLLIMPEXP_CORE wxString
wxGetDisplayName();
677 #ifdef __VMS__ // Xlib.h for VMS is not (yet) compatible with C++
678 // The resulting warnings are switched off here
679 #pragma message disable nosimpint
681 // #include <X11/Xlib.h>
683 #pragma message enable nosimpint
690 // ----------------------------------------------------------------------------
691 // wxYield(): these functions are obsolete, please use wxApp methods instead!
692 // ----------------------------------------------------------------------------
694 // Yield to other apps/messages
695 WXDLLIMPEXP_BASE
bool wxYield();
697 // Like wxYield, but fails silently if the yield is recursive.
698 WXDLLIMPEXP_BASE
bool wxYieldIfNeeded();
700 // ----------------------------------------------------------------------------
701 // Error message functions used by wxWidgets (deprecated, use wxLog)
702 // ----------------------------------------------------------------------------