]>
git.saurik.com Git - wxWidgets.git/blob - src/cocoa/utils.cpp
320091fbb0daed46595a37b69e9effc59d8674c9
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: Various utilities
8 // Copyright: (c) AUTHOR
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
15 #include "wx/apptrait.h"
24 // Get size of display
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 // Return TRUE if we have a colour display
62 bool wxColourDisplay()
68 void wxGetMousePosition( int* x
, int* y
)
73 // Returns depth of screen
87 // DFE: These aren't even implemented by wxGTK, and no wxWindows code calls
88 // them. If someone needs them, then they'll get a link error
90 // Consume all events until no more left
95 // Check whether this window wants to process messages, e.g. Stop button
96 // in long calculations.
97 bool wxCheckForInterrupt(wxWindow
*wnd
)
105 // Reading and writing resources (eg WIN.INI, .Xdefaults)
107 bool wxWriteResource(const wxString
& section
, const wxString
& entry
, const wxString
& value
, const wxString
& file
)
113 bool wxWriteResource(const wxString
& section
, const wxString
& entry
, float value
, const wxString
& file
)
116 sprintf(buf
, "%.4f", value
);
117 return wxWriteResource(section
, entry
, buf
, file
);
120 bool wxWriteResource(const wxString
& section
, const wxString
& entry
, long value
, const wxString
& file
)
123 sprintf(buf
, "%ld", value
);
124 return wxWriteResource(section
, entry
, buf
, file
);
127 bool wxWriteResource(const wxString
& section
, const wxString
& entry
, int value
, const wxString
& file
)
130 sprintf(buf
, "%d", value
);
131 return wxWriteResource(section
, entry
, buf
, file
);
134 bool wxGetResource(const wxString
& section
, const wxString
& entry
, char **value
, const wxString
& file
)
140 bool wxGetResource(const wxString
& section
, const wxString
& entry
, float *value
, const wxString
& file
)
143 bool succ
= wxGetResource(section
, entry
, (char **)&s
, file
);
146 *value
= (float)strtod(s
, NULL
);
153 bool wxGetResource(const wxString
& section
, const wxString
& entry
, long *value
, const wxString
& file
)
156 bool succ
= wxGetResource(section
, entry
, (char **)&s
, file
);
159 *value
= strtol(s
, NULL
, 10);
166 bool wxGetResource(const wxString
& section
, const wxString
& entry
, int *value
, const wxString
& file
)
169 bool succ
= wxGetResource(section
, entry
, (char **)&s
, file
);
172 *value
= (int)strtol(s
, NULL
, 10);
178 #endif // wxUSE_RESOURCES