X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/f5158fa61f150b8a11f175588f2c6afe455ff7fe..277ccdafe111a97a22431a4acc81b9e9ef7c2f8a:/src/mac/corefoundation/stdpaths_cf.cpp?ds=sidebyside diff --git a/src/mac/corefoundation/stdpaths_cf.cpp b/src/mac/corefoundation/stdpaths_cf.cpp index eb6e0367bf..925d220ecf 100644 --- a/src/mac/corefoundation/stdpaths_cf.cpp +++ b/src/mac/corefoundation/stdpaths_cf.cpp @@ -106,6 +106,24 @@ wxString wxStandardPathsCF::GetFromFunc(wxCFURLRef (*func)(wxCFBundleRef)) const return ret; } +wxString wxStandardPathsCF::GetDocumentsDir() const +{ +#ifdef __WXMAC__ + return wxMacFindFolderNoSeparator + ( +#if TARGET_API_MAC_OSX + kUserDomain, +#else + kOnSystemDisk, +#endif + kDocumentsFolderType, + kCreateFolder + ); +#else + return wxFileName::GetHomeDir() + wxT("/Documents"); +#endif +} + // ---------------------------------------------------------------------------- // wxStandardPathsCF public API // ---------------------------------------------------------------------------- @@ -133,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__