X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/5fde6fcc9b551340a194ae4c726db5ab64b5c594..80a779275ae04443c568dca919adb26cf6f5002c:/src/mac/carbon/utilsexc.cpp diff --git a/src/mac/carbon/utilsexc.cpp b/src/mac/carbon/utilsexc.cpp index 624a9c0524..6c82d0ca87 100644 --- a/src/mac/carbon/utilsexc.cpp +++ b/src/mac/carbon/utilsexc.cpp @@ -1,41 +1,43 @@ ///////////////////////////////////////////////////////////////////////////// // Name: utilsexec.cpp // Purpose: Execution-related utilities -// Author: AUTHOR -// Modified by: -// Created: ??/??/98 +// Author: Stefan Csomor +// Modified by: +// Created: 1998-01-01 // RCS-ID: $Id$ -// Copyright: (c) AUTHOR -// Licence: wxWindows licence +// Copyright: (c) Stefan Csomor +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// -#ifdef __GNUG__ -#pragma implementation -#endif +#include "wx/wxprec.h" +#ifndef WX_PRECOMP + #include "wx/log.h" + #include "wx/utils.h" +#endif //ndef WX_PRECOMP -#include "wx/utils.h" -#ifdef __UNIX__ -#include "wx/unix/execute.h" -#endif +#ifndef __DARWIN__ -#include -#include -#include +#include "wx/mac/private.h" +#include "LaunchServices.h" -#ifndef __UNIX__ -#define wxEXECUTE_WIN_MESSAGE 10000 - -long wxExecute(const wxString& command, bool sync, wxProcess *handler) +long wxExecute(const wxString& command, int flags, wxProcess *WXUNUSED(handler)) { - // TODO - return 0; -} -#endif + wxASSERT_MSG( flags == wxEXEC_ASYNC, + wxT("wxExecute: Only wxEXEC_ASYNC is supported") ); -#ifdef __UNIX__ -int wxAddProcessCallback(wxEndProcessData *proc_data, int fd) -{ - wxFAIL_MSG(wxT("wxAddProcessCallback() function not ready")); - return 0; + FSRef fsRef ; + OSErr err = noErr ; + err = wxMacPathToFSRef( command , &fsRef ) ; + if ( noErr == err ) + { + err = LSOpenFSRef( &fsRef , NULL ) ; + } + + // 0 means execution failed. Returning non-zero is a PID, but not + // on Mac where PIDs are 64 bits and won't fit in a long, so we + // return a dummy value for now. + return ( err == noErr ) ? -1 : 0; } -#endif \ No newline at end of file + +#endif //ndef __DARWIN__ +