X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/17af82fb4c8f830f202567259472645c27724c32..4e1fd51de7349097a30b3b994e5c6e9b074de77c:/src/mac/corefoundation/stdpaths_cf.cpp diff --git a/src/mac/corefoundation/stdpaths_cf.cpp b/src/mac/corefoundation/stdpaths_cf.cpp index 2b2cf9cba0..925d220ecf 100644 --- a/src/mac/corefoundation/stdpaths_cf.cpp +++ b/src/mac/corefoundation/stdpaths_cf.cpp @@ -31,7 +31,6 @@ #include "wx/mac/private.h" #endif #include "wx/mac/corefoundation/cfstring.h" -#include "wx/mac/private.h" #if defined(__DARWIN__) #include @@ -109,6 +108,7 @@ wxString wxStandardPathsCF::GetFromFunc(wxCFURLRef (*func)(wxCFBundleRef)) const wxString wxStandardPathsCF::GetDocumentsDir() const { +#ifdef __WXMAC__ return wxMacFindFolderNoSeparator ( #if TARGET_API_MAC_OSX @@ -119,6 +119,9 @@ wxString wxStandardPathsCF::GetDocumentsDir() const kDocumentsFolderType, kCreateFolder ); +#else + return wxFileName::GetHomeDir() + wxT("/Documents"); +#endif } // ---------------------------------------------------------------------------- @@ -148,6 +151,27 @@ wxString wxStandardPathsCF::GetDataDir() const return GetFromFunc(CFBundleCopySharedSupportURL); } +// TODO: implement this using real CoreFoundation API instead of Carbon API +wxString wxStandardPathsCF::GetExecutablePath() const +{ +#ifdef __WXMAC__ + ProcessInfoRec processinfo; + ProcessSerialNumber procno ; + FSSpec fsSpec; + + procno.highLongOfPSN = 0 ; + procno.lowLongOfPSN = kCurrentProcess ; + processinfo.processInfoLength = sizeof(ProcessInfoRec); + processinfo.processName = NULL; + processinfo.processAppSpec = &fsSpec; + + GetProcessInformation( &procno , &processinfo ) ; + return wxMacFSSpec2MacFilename(&fsSpec); +#else + return wxStandardPathsBase::GetExecutablePath(); +#endif +} + wxString wxStandardPathsCF::GetLocalDataDir() const { #ifdef __WXMAC__