X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/8498a2858b50bb96947f367b495835793107e5cc..1748289348c4c7dcc467edbf7192ade8a1b78921:/src/cocoa/utils.cpp diff --git a/src/cocoa/utils.cpp b/src/cocoa/utils.cpp index e3bb09c2fc..081d9e567f 100644 --- a/src/cocoa/utils.cpp +++ b/src/cocoa/utils.cpp @@ -12,7 +12,11 @@ #include "wx/wxprec.h" #include "wx/utils.h" -#include "wx/app.h" + +#ifndef WX_PRECOMP + #include "wx/app.h" +#endif // WX_PRECOMP + #include "wx/apptrait.h" #include "wx/display.h" @@ -50,13 +54,12 @@ void wxClientDisplayRect(int *x,int *y,int *width,int *height) *height=768; } -wxToolkitInfo& wxGUIAppTraits::GetToolkitInfo() +wxPortId wxGUIAppTraits::GetToolkitVersion(int *verMaj, int *verMin) const { - static wxToolkitInfo info; - info.shortName = _T("cocoa"); - info.name = _T("wxCocoa"); - // TODO: Finish this - return info; + // We suppose that toolkit version is the same as OS version under Mac + wxGetOsVersion(verMaj, verMin); + + return wxPORT_COCOA; } wxWindow* wxFindWindowAtPoint(const wxPoint& pt) @@ -108,77 +111,3 @@ bool wxCheckForInterrupt(wxWindow *wnd) #endif -// Reading and writing resources (eg WIN.INI, .Xdefaults) -#if wxUSE_RESOURCES -bool wxWriteResource(const wxString& section, const wxString& entry, const wxString& value, const wxString& file) -{ - // TODO - return false; -} - -bool wxWriteResource(const wxString& section, const wxString& entry, float value, const wxString& file) -{ - char buf[50]; - sprintf(buf, "%.4f", value); - return wxWriteResource(section, entry, buf, file); -} - -bool wxWriteResource(const wxString& section, const wxString& entry, long value, const wxString& file) -{ - char buf[50]; - sprintf(buf, "%ld", value); - return wxWriteResource(section, entry, buf, file); -} - -bool wxWriteResource(const wxString& section, const wxString& entry, int value, const wxString& file) -{ - char buf[50]; - sprintf(buf, "%d", value); - return wxWriteResource(section, entry, buf, file); -} - -bool wxGetResource(const wxString& section, const wxString& entry, char **value, const wxString& file) -{ - // TODO - return false; -} - -bool wxGetResource(const wxString& section, const wxString& entry, float *value, const wxString& file) -{ - char *s = NULL; - bool succ = wxGetResource(section, entry, (char **)&s, file); - if (succ) - { - *value = (float)strtod(s, NULL); - delete[] s; - return true; - } - else return false; -} - -bool wxGetResource(const wxString& section, const wxString& entry, long *value, const wxString& file) -{ - char *s = NULL; - bool succ = wxGetResource(section, entry, (char **)&s, file); - if (succ) - { - *value = strtol(s, NULL, 10); - delete[] s; - return true; - } - else return false; -} - -bool wxGetResource(const wxString& section, const wxString& entry, int *value, const wxString& file) -{ - char *s = NULL; - bool succ = wxGetResource(section, entry, (char **)&s, file); - if (succ) - { - *value = (int)strtol(s, NULL, 10); - delete[] s; - return true; - } - else return false; -} -#endif // wxUSE_RESOURCES