X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/1f360a2db7cf095b87923ac7673d61f97fcd342c..9fd8f2dd3df305448a0c2d56508c04e26385a76d:/src/cocoa/utils.cpp diff --git a/src/cocoa/utils.cpp b/src/cocoa/utils.cpp index ef9413bec6..c2112fc552 100644 --- a/src/cocoa/utils.cpp +++ b/src/cocoa/utils.cpp @@ -1,17 +1,22 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: utils.cpp +// Name: src/cocoa/utils.cpp // Purpose: Various utilities // Author: AUTHOR // Modified by: // Created: 2003/??/?? -// RCS-ID: $Id: +// RCS-ID: $Id$ // Copyright: (c) AUTHOR -// Licence: wxWindows licence +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// -#include "wx/setup.h" +#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" @@ -22,12 +27,6 @@ #include #include -// Get size of display -size_t wxDisplayBase::GetCount() -{ - return 1; -} - void wxDisplaySize(int *width, int *height) { // TODO @@ -55,20 +54,24 @@ void wxClientDisplayRect(int *x,int *y,int *width,int *height) *height=768; } -wxToolkitInfo& wxGUIAppTraits::GetToolkitInfo() +wxPortId wxGUIAppTraits::GetToolkitVersion(int *verMaj, int *verMin) const +{ + // We suppose that toolkit version is the same as OS version under Mac + wxGetOsVersion(verMaj, verMin); + + return wxPORT_COCOA; +} + +wxWindow* wxFindWindowAtPoint(const wxPoint& pt) { - static wxToolkitInfo info; - info.shortName = _T("cocoa"); - info.name = _T("wxCocoa"); - // TODO: Finish this - return info; + return wxGenericFindWindowAtPoint(pt); } -// Return TRUE if we have a colour display +// Return true if we have a colour display bool wxColourDisplay() { // TODO - return TRUE; + return true; } void wxGetMousePosition( int* x, int* y ) @@ -103,7 +106,7 @@ void wxFlushEvents() bool wxCheckForInterrupt(wxWindow *wnd) { // TODO - return FALSE; + return false; } #endif @@ -113,72 +116,72 @@ bool wxCheckForInterrupt(wxWindow *wnd) bool wxWriteResource(const wxString& section, const wxString& entry, const wxString& value, const wxString& file) { // TODO - return FALSE; + 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); + 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); + 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); + 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; + 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; + 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; + 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; + 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