/////////////////////////////////////////////////////////////////////////////
// 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
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()
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
// ----------------------------------------------------------------------------
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
private:
bool m_terminated;
- DECLARE_NO_COPY_CLASS(wxEndHandler)
+ wxDECLARE_NO_COPY_CLASS(wxEndHandler);
};
#if HAS_PIPE_INPUT_STREAM
private:
wxStreamTempInputBuffer * const m_buf;
- DECLARE_NO_COPY_CLASS(wxRedirectedIOHandler)
+ wxDECLARE_NO_COPY_CLASS(wxRedirectedIOHandler);
};
#endif // HAS_PIPE_INPUT_STREAM