]>
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 wxPortId
wxGUIAppTraits::GetToolkitVersion(int *verMaj
, int *verMin
) const
59 // We suppose that toolkit version is the same as OS version under Mac
60 wxGetOsVersion(verMaj
, verMin
);
65 wxWindow
* wxFindWindowAtPoint(const wxPoint
& pt
)
67 return wxGenericFindWindowAtPoint(pt
);
70 // Return true if we have a colour display
71 bool wxColourDisplay()
77 void wxGetMousePosition( int* x
, int* y
)
82 // Returns depth of screen
96 // DFE: These aren't even implemented by wxGTK, and no wxWidgets code calls
97 // them. If someone needs them, then they'll get a link error
99 // Consume all events until no more left
104 // Check whether this window wants to process messages, e.g. Stop button
105 // in long calculations.
106 bool wxCheckForInterrupt(wxWindow
*wnd
)
114 // Reading and writing resources (eg WIN.INI, .Xdefaults)
116 bool wxWriteResource(const wxString
& section
, const wxString
& entry
, const wxString
& value
, const wxString
& file
)
122 bool wxWriteResource(const wxString
& section
, const wxString
& entry
, float value
, const wxString
& file
)
125 sprintf(buf
, "%.4f", value
);
126 return wxWriteResource(section
, entry
, buf
, file
);
129 bool wxWriteResource(const wxString
& section
, const wxString
& entry
, long value
, const wxString
& file
)
132 sprintf(buf
, "%ld", value
);
133 return wxWriteResource(section
, entry
, buf
, file
);
136 bool wxWriteResource(const wxString
& section
, const wxString
& entry
, int value
, const wxString
& file
)
139 sprintf(buf
, "%d", value
);
140 return wxWriteResource(section
, entry
, buf
, file
);
143 bool wxGetResource(const wxString
& section
, const wxString
& entry
, char **value
, const wxString
& file
)
149 bool wxGetResource(const wxString
& section
, const wxString
& entry
, float *value
, const wxString
& file
)
152 bool succ
= wxGetResource(section
, entry
, (char **)&s
, file
);
155 *value
= (float)strtod(s
, NULL
);
162 bool wxGetResource(const wxString
& section
, const wxString
& entry
, long *value
, const wxString
& file
)
165 bool succ
= wxGetResource(section
, entry
, (char **)&s
, file
);
168 *value
= strtol(s
, NULL
, 10);
175 bool wxGetResource(const wxString
& section
, const wxString
& entry
, int *value
, const wxString
& file
)
178 bool succ
= wxGetResource(section
, entry
, (char **)&s
, file
);
181 *value
= (int)strtol(s
, NULL
, 10);
187 #endif // wxUSE_RESOURCES