X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/655719367ac5e131d9642e5783f3ecf64d1a3385..ababa106ae015f05e14cd2487100954ef50ca694:/include/wx/utils.h diff --git a/include/wx/utils.h b/include/wx/utils.h index 15684985fb..a7aba4285c 100644 --- a/include/wx/utils.h +++ b/include/wx/utils.h @@ -18,7 +18,7 @@ #if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) && !defined(__EMX__) // Some older compilers (such as EMX) cannot handle -// #pragma interface/implementation correctly, iff +// #pragma interface/implementation correctly, iff // #pragma implementation is used in _two_ translation // units (as created by e.g. event.cpp compiled for // libwx_base and event.cpp compiled for libwx_gui_core). @@ -48,11 +48,11 @@ class WXDLLIMPEXP_BASE wxArrayString; // Forward declaration // ---------------------------------------------------------------------------- -class WXDLLIMPEXP_BASE wxProcess; -class WXDLLIMPEXP_BASE wxFrame; -class WXDLLIMPEXP_BASE wxWindow; -class WXDLLIMPEXP_BASE wxWindowList; -class WXDLLIMPEXP_BASE wxPoint; +class WXDLLIMPEXP_CORE wxProcess; +class WXDLLIMPEXP_CORE wxFrame; +class WXDLLIMPEXP_CORE wxWindow; +class WXDLLIMPEXP_CORE wxWindowList; +class WXDLLIMPEXP_CORE wxPoint; // ---------------------------------------------------------------------------- // Macros @@ -156,7 +156,7 @@ WXDLLIMPEXP_BASE wxString wxDecToHex(int dec); // Process management // ---------------------------------------------------------------------------- -// NB: for backwars compatibility reasons the values of wxEXEC_[A]SYNC *must* +// NB: for backwards compatibility reasons the values of wxEXEC_[A]SYNC *must* // be 0 and 1, don't change! enum @@ -171,8 +171,8 @@ enum // is done by default) wxEXEC_NOHIDE = 2, - // under Unix, if the process is the group leader then killing -pid kills - // all children as well as pid + // under Unix, if the process is the group leader then passing wxKILL_CHILDREN to wxKill + // kills all children as well as pid wxEXEC_MAKE_GROUP_LEADER = 4 }; @@ -228,6 +228,12 @@ enum wxKillError wxKILL_ERROR // another, unspecified error }; +enum wxKillFlags +{ + wxKILL_NOCHILDREN = 0, // don't kill children + wxKILL_CHILDREN = 1 // kill children +}; + enum wxShutdownFlags { wxSHUTDOWN_POWEROFF, // power off the computer @@ -243,7 +249,8 @@ WXDLLIMPEXP_BASE bool wxShutdown(wxShutdownFlags wFlags); // return detailed error in rc if not NULL WXDLLIMPEXP_BASE int wxKill(long pid, wxSignal sig = wxSIGTERM, - wxKillError *rc = NULL); + wxKillError *rc = NULL, + int flags = wxKILL_NOCHILDREN); // Execute a command in an interactive shell window (always synchronously) // If no command then just the shell @@ -257,7 +264,13 @@ WXDLLIMPEXP_BASE bool wxShell(const wxString& command, wxArrayString& output); WXDLLIMPEXP_BASE void wxSleep(int nSecs); // Sleep for a given amount of milliseconds -WXDLLIMPEXP_BASE void wxUsleep(unsigned long milliseconds); +WXDLLIMPEXP_BASE void wxMilliSleep(unsigned long milliseconds); + +// Sleep for a given amount of microseconds +WXDLLIMPEXP_BASE void wxMicroSleep(unsigned long microseconds); + +// Sleep for a given amount of milliseconds (old, bad name), use wxMilliSleep +wxDEPRECATED( WXDLLIMPEXP_BASE void wxUsleep(unsigned long milliseconds) ); // Get the process id of the current process WXDLLIMPEXP_BASE unsigned long wxGetProcessId(); @@ -266,17 +279,17 @@ WXDLLIMPEXP_BASE unsigned long wxGetProcessId(); WXDLLIMPEXP_BASE long wxGetFreeMemory(); // should wxApp::OnFatalException() be called? -WXDLLIMPEXP_BASE bool wxHandleFatalExceptions(bool doit = TRUE); +WXDLLIMPEXP_BASE bool wxHandleFatalExceptions(bool doit = true); // ---------------------------------------------------------------------------- // Environment variables // ---------------------------------------------------------------------------- -// returns TRUE if variable exists (value may be NULL if you just want to check +// returns true if variable exists (value may be NULL if you just want to check // for this) WXDLLIMPEXP_BASE bool wxGetEnv(const wxString& var, wxString *value); -// set the env var name to the given value, return TRUE on success +// set the env var name to the given value, return true on success WXDLLIMPEXP_BASE bool wxSetEnv(const wxString& var, const wxChar *value); // remove the env var from environment @@ -343,7 +356,7 @@ WXDLLEXPORT wxAcceleratorEntry *wxGetAccelFromString(const wxString& label); // Window search // ---------------------------------------------------------------------------- -// Returns menu item id or -1 if none. +// Returns menu item id or wxNOT_FOUND if none. WXDLLEXPORT int wxFindMenuItemId(wxFrame *frame, const wxString& menuString, const wxString& itemString); // Find the wxWindow at the given point. wxGenericFindWindowAtPoint @@ -368,10 +381,10 @@ WXDLLEXPORT wxWindow* wxFindWindowByName(const wxString& name, wxWindow *parent // ---------------------------------------------------------------------------- // Yield to other apps/messages and disable user input -WXDLLEXPORT bool wxSafeYield(wxWindow *win = NULL, bool onlyIfNeeded = FALSE); +WXDLLEXPORT bool wxSafeYield(wxWindow *win = NULL, bool onlyIfNeeded = false); // Enable or disable input to all top level windows -WXDLLEXPORT void wxEnableTopLevelWindows(bool enable = TRUE); +WXDLLEXPORT void wxEnableTopLevelWindows(bool enable = true); // Check whether this window wants to process messages, e.g. Stop button // in long calculations. @@ -406,7 +419,7 @@ WXDLLEXPORT void wxBeginBusyCursor(wxCursor *cursor = wxHOURGLASS_CURSOR); // Restore cursor to normal WXDLLEXPORT void wxEndBusyCursor(); -// TRUE if we're between the above two calls +// true if we're between the above two calls WXDLLEXPORT bool wxIsBusy(); // Convenience class so we can just create a wxBusyCursor object on the stack