X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/50a2e26fd717e510a1beae2e1da2f93742907eba..55410bb4f67febe1ca20654f078ea4fb9a6223ae:/src/unix/utilsunx.cpp?ds=sidebyside diff --git a/src/unix/utilsunx.cpp b/src/unix/utilsunx.cpp index 543792c83a..f4918245fb 100644 --- a/src/unix/utilsunx.cpp +++ b/src/unix/utilsunx.cpp @@ -1,6 +1,6 @@ ///////////////////////////////////////////////////////////////////////////// // Name: src/unix/utilsunx.cpp -// Purpose: generic Unix implementation of many wx functions +// Purpose: generic Unix implementation of many wx functions (for wxBase) // Author: Vadim Zeitlin // Id: $Id$ // Copyright: (c) 1998 Robert Roebling, Vadim Zeitlin @@ -202,7 +202,7 @@ void wxMicroSleep(unsigned long microseconds) tmReq.tv_nsec = (microseconds % 1000000) * 1000; // we're not interested in remaining time nor in return value - (void)nanosleep(&tmReq, (timespec *)NULL); + (void)nanosleep(&tmReq, NULL); #elif defined(HAVE_USLEEP) // uncomment this if you feel brave or if you are sure that your version // of Solaris has a safe usleep() function but please notice that usleep() @@ -429,92 +429,11 @@ private: int m_argc; char **m_argv; - DECLARE_NO_COPY_CLASS(ArgsArray) + wxDECLARE_NO_COPY_CLASS(ArgsArray); }; } // anonymous namespace -// these functions are in src/osx/carbon/utils.cpp for wxMac -#ifndef __WXMAC__ - -// ---------------------------------------------------------------------------- -// Launch document with default app -// ---------------------------------------------------------------------------- - -bool wxLaunchDefaultApplication(const wxString& document, int flags) -{ - wxUnusedVar(flags); - - // Our best best is to use xdg-open from freedesktop.org cross-desktop - // compatibility suite xdg-utils - // (see http://portland.freedesktop.org/wiki/) -- this is installed on - // most modern distributions and may be tweaked by them to handle - // distribution specifics. - wxString path, xdg_open; - if ( wxGetEnv("PATH", &path) && - wxFindFileInPath(&xdg_open, path, "xdg-open") ) - { - if ( wxExecute(xdg_open + " " + document) ) - return true; - } - - return false; -} - -// ---------------------------------------------------------------------------- -// Launch default browser -// ---------------------------------------------------------------------------- - -bool wxDoLaunchDefaultBrowser(const wxString& url, int flags) -{ - wxUnusedVar(flags); - - // Our best best is to use xdg-open from freedesktop.org cross-desktop - // compatibility suite xdg-utils - // (see http://portland.freedesktop.org/wiki/) -- this is installed on - // most modern distributions and may be tweaked by them to handle - // distribution specifics. Only if that fails, try to find the right - // browser ourselves. - wxString path, xdg_open; - if ( wxGetEnv("PATH", &path) && - wxFindFileInPath(&xdg_open, path, "xdg-open") ) - { - if ( wxExecute(xdg_open + " " + url) ) - return true; - } - - wxString desktop = wxTheApp->GetTraits()->GetDesktopEnvironment(); - - // GNOME and KDE desktops have some applications which should be always installed - // together with their main parts, which give us the - if (desktop == wxT("GNOME")) - { - wxArrayString errors; - wxArrayString output; - - // gconf will tell us the path of the application to use as browser - long res = wxExecute( wxT("gconftool-2 --get /desktop/gnome/applications/browser/exec"), - output, errors, wxEXEC_NODISABLE ); - if (res >= 0 && errors.GetCount() == 0) - { - wxString cmd = output[0]; - cmd << _T(' ') << url; - if (wxExecute(cmd)) - return true; - } - } - else if (desktop == wxT("KDE")) - { - // kfmclient directly opens the given URL - if (wxExecute(wxT("kfmclient openURL ") + url)) - return true; - } - - return false; -} - -#endif // __WXMAC__ - // ---------------------------------------------------------------------------- // wxExecute implementations // ---------------------------------------------------------------------------- @@ -1344,7 +1263,7 @@ public: protected: const int m_fd; - DECLARE_NO_COPY_CLASS(wxReadFDIOHandler) + wxDECLARE_NO_COPY_CLASS(wxReadFDIOHandler); }; // class for monitoring our end of the process detection pipe, simply sets a @@ -1365,7 +1284,7 @@ public: private: bool m_terminated; - DECLARE_NO_COPY_CLASS(wxEndHandler) + wxDECLARE_NO_COPY_CLASS(wxEndHandler); }; #if HAS_PIPE_INPUT_STREAM @@ -1394,7 +1313,7 @@ public: private: wxStreamTempInputBuffer * const m_buf; - DECLARE_NO_COPY_CLASS(wxRedirectedIOHandler) + wxDECLARE_NO_COPY_CLASS(wxRedirectedIOHandler); }; #endif // HAS_PIPE_INPUT_STREAM