X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/5c6eb3a84be918dcfed2496d014549e13af0f0e9..661698e54f2bc599dc1a961ffbae08ccdd6b9b97:/include/wx/osx/core/stdpaths.h?ds=sidebyside diff --git a/include/wx/osx/core/stdpaths.h b/include/wx/osx/core/stdpaths.h index 3fcb8d5676..aed2c10a21 100644 --- a/include/wx/osx/core/stdpaths.h +++ b/include/wx/osx/core/stdpaths.h @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////////// -// Name: wx/mac/corefoundation/stdpaths.h +// Name: wx/osx/core/stdpaths.h // Purpose: wxStandardPaths for CoreFoundation systems // Author: David Elliott // Modified by: @@ -18,14 +18,23 @@ struct __CFURL; typedef const __CFURL * wxCFURLRef; typedef __CFBundle * wxCFBundleRef; +// we inherit the GUI CF-based wxStandardPaths implementation from the Unix one +// used for console programs if possible (i.e. if we're under a Unix system at +// all) +#if defined(__UNIX__) + #include "wx/unix/stdpaths.h" + #define wxStandardPathsCFBase wxStandardPaths +#else + #define wxStandardPathsCFBase wxStandardPathsBase +#endif + // ---------------------------------------------------------------------------- // wxStandardPaths // ---------------------------------------------------------------------------- -class WXDLLIMPEXP_BASE wxStandardPathsCF : public wxStandardPathsBase +class WXDLLIMPEXP_BASE wxStandardPathsCF : public wxStandardPathsCFBase { public: - wxStandardPathsCF(); virtual ~wxStandardPathsCF(); // wxMac specific: allow user to specify a different bundle @@ -47,6 +56,10 @@ public: virtual wxString GetDocumentsDir() const; protected: + // Ctor is protected, use wxStandardPaths::Get() instead of instantiating + // objects of this class directly. + wxStandardPathsCF(); + // this function can be called with any of CFBundleCopyXXXURL function // pointer as parameter wxString GetFromFunc(wxCFURLRef (*func)(wxCFBundleRef)) const; @@ -54,14 +67,4 @@ protected: wxCFBundleRef m_bundle; }; -// If using UNIX (i.e. darwin) then use UNIX standard paths -#if defined(__UNIX__) -#include "wx/unix/stdpaths.h" -#else -// If compiling wxMac for CarbonLib then we are wxStandardPaths -class WXDLLIMPEXP_BASE wxStandardPaths: public wxStandardPathsCF -{ -}; -#endif - #endif // _WX_MAC_STDPATHS_H_