]>
git.saurik.com Git - wxWidgets.git/blob - src/cocoa/utils.cpp
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: src/cocoa/utils.cpp
3 // Purpose: Various utilities
8 // Copyright: (c) AUTHOR
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
12 #include "wx/wxprec.h"
20 #include "wx/apptrait.h"
21 #include "wx/display.h"
30 void wxDisplaySize(int *width
, int *height
)
39 void wxDisplaySizeMM(int*,int*)
44 void wxClientDisplayRect(int *x
,int *y
,int *width
,int *height
)
57 wxToolkitInfo
& wxGUIAppTraits::GetToolkitInfo()
59 static wxToolkitInfo info
;
60 info
.shortName
= _T("cocoa");
61 info
.name
= _T("wxCocoa");
66 wxWindow
* wxFindWindowAtPoint(const wxPoint
& pt
)
68 return wxGenericFindWindowAtPoint(pt
);
71 // Return true if we have a colour display
72 bool wxColourDisplay()
78 void wxGetMousePosition( int* x
, int* y
)
83 // Returns depth of screen
97 // DFE: These aren't even implemented by wxGTK, and no wxWidgets code calls
98 // them. If someone needs them, then they'll get a link error
100 // Consume all events until no more left
105 // Check whether this window wants to process messages, e.g. Stop button
106 // in long calculations.
107 bool wxCheckForInterrupt(wxWindow
*wnd
)
115 // Reading and writing resources (eg WIN.INI, .Xdefaults)
117 bool wxWriteResource(const wxString
& section
, const wxString
& entry
, const wxString
& value
, const wxString
& file
)
123 bool wxWriteResource(const wxString
& section
, const wxString
& entry
, float value
, const wxString
& file
)
126 sprintf(buf
, "%.4f", value
);
127 return wxWriteResource(section
, entry
, buf
, file
);
130 bool wxWriteResource(const wxString
& section
, const wxString
& entry
, long value
, const wxString
& file
)
133 sprintf(buf
, "%ld", value
);
134 return wxWriteResource(section
, entry
, buf
, file
);
137 bool wxWriteResource(const wxString
& section
, const wxString
& entry
, int value
, const wxString
& file
)
140 sprintf(buf
, "%d", value
);
141 return wxWriteResource(section
, entry
, buf
, file
);
144 bool wxGetResource(const wxString
& section
, const wxString
& entry
, char **value
, const wxString
& file
)
150 bool wxGetResource(const wxString
& section
, const wxString
& entry
, float *value
, const wxString
& file
)
153 bool succ
= wxGetResource(section
, entry
, (char **)&s
, file
);
156 *value
= (float)strtod(s
, NULL
);
163 bool wxGetResource(const wxString
& section
, const wxString
& entry
, long *value
, const wxString
& file
)
166 bool succ
= wxGetResource(section
, entry
, (char **)&s
, file
);
169 *value
= strtol(s
, NULL
, 10);
176 bool wxGetResource(const wxString
& section
, const wxString
& entry
, int *value
, const wxString
& file
)
179 bool succ
= wxGetResource(section
, entry
, (char **)&s
, file
);
182 *value
= (int)strtol(s
, NULL
, 10);
188 #endif // wxUSE_RESOURCES