]> git.saurik.com Git - wxWidgets.git/blobdiff - src/mac/corefoundation/stdpaths_cf.cpp
If using the system Window menu on OS X, integrate any Window wxMenu items into the...
[wxWidgets.git] / src / mac / corefoundation / stdpaths_cf.cpp
index d4068cc2fa448431fbb7329822eae81f1d84c18a..925d220ecffb3e2e1342000bccc2be7cd2c5a25d 100644 (file)
@@ -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 <CoreFoundation/CFBundle.h>
@@ -152,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__