]>
git.saurik.com Git - wxWidgets.git/blob - src/cocoa/utils.cpp
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: Various utilities
8 // Copyright: (c) AUTHOR
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
15 #include "wx/apptrait.h"
16 #include "wx/display.h"
25 void wxDisplaySize(int *width
, int *height
)
34 void wxDisplaySizeMM(int*,int*)
39 void wxClientDisplayRect(int *x
,int *y
,int *width
,int *height
)
52 wxToolkitInfo
& wxGUIAppTraits::GetToolkitInfo()
54 static wxToolkitInfo info
;
55 info
.shortName
= _T("cocoa");
56 info
.name
= _T("wxCocoa");
61 wxWindow
* wxFindWindowAtPoint(const wxPoint
& pt
)
63 return wxGenericFindWindowAtPoint(pt
);
66 // Return true if we have a colour display
67 bool wxColourDisplay()
73 void wxGetMousePosition( int* x
, int* y
)
78 // Returns depth of screen
92 // DFE: These aren't even implemented by wxGTK, and no wxWidgets code calls
93 // them. If someone needs them, then they'll get a link error
95 // Consume all events until no more left
100 // Check whether this window wants to process messages, e.g. Stop button
101 // in long calculations.
102 bool wxCheckForInterrupt(wxWindow
*wnd
)
110 // Reading and writing resources (eg WIN.INI, .Xdefaults)
112 bool wxWriteResource(const wxString
& section
, const wxString
& entry
, const wxString
& value
, const wxString
& file
)
118 bool wxWriteResource(const wxString
& section
, const wxString
& entry
, float value
, const wxString
& file
)
121 sprintf(buf
, "%.4f", value
);
122 return wxWriteResource(section
, entry
, buf
, file
);
125 bool wxWriteResource(const wxString
& section
, const wxString
& entry
, long value
, const wxString
& file
)
128 sprintf(buf
, "%ld", value
);
129 return wxWriteResource(section
, entry
, buf
, file
);
132 bool wxWriteResource(const wxString
& section
, const wxString
& entry
, int value
, const wxString
& file
)
135 sprintf(buf
, "%d", value
);
136 return wxWriteResource(section
, entry
, buf
, file
);
139 bool wxGetResource(const wxString
& section
, const wxString
& entry
, char **value
, const wxString
& file
)
145 bool wxGetResource(const wxString
& section
, const wxString
& entry
, float *value
, const wxString
& file
)
148 bool succ
= wxGetResource(section
, entry
, (char **)&s
, file
);
151 *value
= (float)strtod(s
, NULL
);
158 bool wxGetResource(const wxString
& section
, const wxString
& entry
, long *value
, const wxString
& file
)
161 bool succ
= wxGetResource(section
, entry
, (char **)&s
, file
);
164 *value
= strtol(s
, NULL
, 10);
171 bool wxGetResource(const wxString
& section
, const wxString
& entry
, int *value
, const wxString
& file
)
174 bool succ
= wxGetResource(section
, entry
, (char **)&s
, file
);
177 *value
= (int)strtol(s
, NULL
, 10);
183 #endif // wxUSE_RESOURCES