]> git.saurik.com Git - wxWidgets.git/blobdiff - src/mac/corefoundation/stdpaths_cf.cpp
Each book control should say what its default orientation. Use this info
[wxWidgets.git] / src / mac / corefoundation / stdpaths_cf.cpp
index 62725328e3d8d0e55aa5f960b608a345ed41c10b..2b2cf9cba0061427f41435224d0a63663e71d045 100644 (file)
 
 #include "wx/stdpaths.h"
 #include "wx/filename.h"
+#ifdef __WXMAC__
+#include "wx/mac/private.h"
+#endif
 #include "wx/mac/corefoundation/cfstring.h"
+#include "wx/mac/private.h"
 
 #if defined(__DARWIN__)
 #include <CoreFoundation/CFBundle.h>
@@ -103,20 +107,40 @@ wxString wxStandardPathsCF::GetFromFunc(wxCFURLRef (*func)(wxCFBundleRef)) const
     return ret;
 }
 
+wxString wxStandardPathsCF::GetDocumentsDir() const
+{
+    return wxMacFindFolderNoSeparator
+        (
+#if TARGET_API_MAC_OSX
+        kUserDomain,
+#else
+        kOnSystemDisk,
+#endif
+        kDocumentsFolderType,
+        kCreateFolder
+        );
+}
+
 // ----------------------------------------------------------------------------
 // wxStandardPathsCF public API
 // ----------------------------------------------------------------------------
 
 wxString wxStandardPathsCF::GetConfigDir() const
 {
-    // TODO: What do we do for pure Carbon?
+#ifdef __WXMAC__
+    return wxMacFindFolder((short)kLocalDomain, kPreferencesFolderType, kCreateFolder);
+#else
     return wxT("/Library/Preferences");
+#endif
 }
 
 wxString wxStandardPathsCF::GetUserConfigDir() const
 {
-    // TODO: What do we do for pure Carbon?
+#ifdef __WXMAC__
+    return wxMacFindFolder((short)kUserDomain, kPreferencesFolderType, kCreateFolder);
+#else
     return wxFileName::GetHomeDir() + wxT("/Library/Preferences");
+#endif
 }
 
 wxString wxStandardPathsCF::GetDataDir() const
@@ -126,12 +150,20 @@ wxString wxStandardPathsCF::GetDataDir() const
 
 wxString wxStandardPathsCF::GetLocalDataDir() const
 {
+#ifdef __WXMAC__
+    return AppendAppName(wxMacFindFolder((short)kLocalDomain, kApplicationSupportFolderType, kCreateFolder));
+#else
     return AppendAppName(wxT("/Library/Application Support"));
+#endif
 }
 
 wxString wxStandardPathsCF::GetUserDataDir() const
 {
+#ifdef __WXMAC__
+    return AppendAppName(wxMacFindFolder((short)kUserDomain, kApplicationSupportFolderType, kCreateFolder));
+#else
     return AppendAppName(wxFileName::GetHomeDir() + _T("/Library/Application Support"));
+#endif
 }
 
 wxString wxStandardPathsCF::GetPluginsDir() const