X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/c7b296c2f9d9b6dc15be3bbb4d9217829b0a2e32..4d931bcca003e3616204c1eebc218ec6cd5b7029:/src/cocoa/utils.cpp diff --git a/src/cocoa/utils.cpp b/src/cocoa/utils.cpp index 9451eb06c1..ba082d0a32 100644 --- a/src/cocoa/utils.cpp +++ b/src/cocoa/utils.cpp @@ -4,14 +4,16 @@ // 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/utils.h" #include "wx/app.h" +#include "wx/apptrait.h" +#include "wx/display.h" #include @@ -20,10 +22,13 @@ #include #include -// Get size of display void wxDisplaySize(int *width, int *height) { // TODO + if(width) + *width = 1024; + if(height) + *height = 768; } void wxDisplaySizeMM(int*,int*) @@ -44,11 +49,25 @@ void wxClientDisplayRect(int *x,int *y,int *width,int *height) *height=768; } -// Return TRUE if we have a colour display +wxToolkitInfo& wxGUIAppTraits::GetToolkitInfo() +{ + static wxToolkitInfo info; + info.shortName = _T("cocoa"); + info.name = _T("wxCocoa"); + // TODO: Finish this + return info; +} + +wxWindow* wxFindWindowAtPoint(const wxPoint& pt) +{ + return wxGenericFindWindowAtPoint(pt); +} + +// Return true if we have a colour display bool wxColourDisplay() { // TODO - return TRUE; + return true; } void wxGetMousePosition( int* x, int* y ) @@ -70,7 +89,7 @@ void wxBell() } #if 0 -// DFE: These aren't even implemented by wxGTK, and no wxWindows code calls +// DFE: These aren't even implemented by wxGTK, and no wxWidgets code calls // them. If someone needs them, then they'll get a link error // Consume all events until no more left @@ -83,7 +102,7 @@ void wxFlushEvents() bool wxCheckForInterrupt(wxWindow *wnd) { // TODO - return FALSE; + return false; } #endif @@ -93,72 +112,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