From c5f0d1f9039558df37b506643d05d6cb5ebfd6fd Mon Sep 17 00:00:00 2001 From: David Elliott Date: Tue, 8 May 2007 19:13:49 +0000 Subject: [PATCH] Move wxLaunchDefaultBrowser from BASE to CORE per wx-dev discussion. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@45889 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/utils.h | 22 ++++++----- src/common/utilscmn.cpp | 88 ++++++++++++++++++++--------------------- 2 files changed, 57 insertions(+), 53 deletions(-) diff --git a/include/wx/utils.h b/include/wx/utils.h index ea2630239c..af924c4be7 100644 --- a/include/wx/utils.h +++ b/include/wx/utils.h @@ -447,15 +447,6 @@ WXDLLIMPEXP_BASE bool wxHandleFatalExceptions(bool doit = true); #endif // wxUSE_ON_FATAL_EXCEPTION -// flags for wxLaunchDefaultBrowser -enum -{ - wxBROWSER_NEW_WINDOW = 1 -}; - -// Launch url in the user's default internet browser -WXDLLIMPEXP_BASE bool wxLaunchDefaultBrowser(const wxString& url, int flags = 0); - // ---------------------------------------------------------------------------- // Environment variables // ---------------------------------------------------------------------------- @@ -521,6 +512,19 @@ WXDLLIMPEXP_BASE bool wxGetDiskSpace(const wxString& path, #if wxUSE_GUI // GUI only things from now on +// ---------------------------------------------------------------------------- +// Launch default browser +// ---------------------------------------------------------------------------- + +// flags for wxLaunchDefaultBrowser +enum +{ + wxBROWSER_NEW_WINDOW = 1 +}; + +// Launch url in the user's default internet browser +WXDLLIMPEXP_CORE bool wxLaunchDefaultBrowser(const wxString& url, int flags = 0); + // ---------------------------------------------------------------------------- // Menu accelerators related things // ---------------------------------------------------------------------------- diff --git a/src/common/utilscmn.cpp b/src/common/utilscmn.cpp index 0b2f8a28d3..abc3d00ecf 100644 --- a/src/common/utilscmn.cpp +++ b/src/common/utilscmn.cpp @@ -630,6 +630,50 @@ long wxExecute(const wxString& command, return wxDoExecuteWithCapture(command, output, &error, flags); } +// ---------------------------------------------------------------------------- +// wxApp::Yield() wrappers for backwards compatibility +// ---------------------------------------------------------------------------- + +bool wxYield() +{ + return wxTheApp && wxTheApp->Yield(); +} + +bool wxYieldIfNeeded() +{ + return wxTheApp && wxTheApp->Yield(true); +} + +// Id generation +static long wxCurrentId = 100; + +long wxNewId() +{ + // skip the part of IDs space that contains hard-coded values: + if (wxCurrentId == wxID_LOWEST) + wxCurrentId = wxID_HIGHEST + 1; + + return wxCurrentId++; +} + +long +wxGetCurrentId(void) { return wxCurrentId; } + +void +wxRegisterId (long id) +{ + if (id >= wxCurrentId) + wxCurrentId = id + 1; +} + +#endif // wxUSE_BASE + +// ============================================================================ +// GUI-only functions from now on +// ============================================================================ + +#if wxUSE_GUI + // ---------------------------------------------------------------------------- // Launch default browser // ---------------------------------------------------------------------------- @@ -834,50 +878,6 @@ bool wxLaunchDefaultBrowser(const wxString& urlOrig, int flags) return false; } -// ---------------------------------------------------------------------------- -// wxApp::Yield() wrappers for backwards compatibility -// ---------------------------------------------------------------------------- - -bool wxYield() -{ - return wxTheApp && wxTheApp->Yield(); -} - -bool wxYieldIfNeeded() -{ - return wxTheApp && wxTheApp->Yield(true); -} - -// Id generation -static long wxCurrentId = 100; - -long wxNewId() -{ - // skip the part of IDs space that contains hard-coded values: - if (wxCurrentId == wxID_LOWEST) - wxCurrentId = wxID_HIGHEST + 1; - - return wxCurrentId++; -} - -long -wxGetCurrentId(void) { return wxCurrentId; } - -void -wxRegisterId (long id) -{ - if (id >= wxCurrentId) - wxCurrentId = id + 1; -} - -#endif // wxUSE_BASE - -// ============================================================================ -// GUI-only functions from now on -// ============================================================================ - -#if wxUSE_GUI - // ---------------------------------------------------------------------------- // Menu accelerators related functions // ---------------------------------------------------------------------------- -- 2.47.2