]>
git.saurik.com Git - wxWidgets.git/blob - src/cocoa/utils.cpp
2670e8e7385a0ba02824855fe4b0d647b4e5facd
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 // Return TRUE if we have a colour display
53 bool wxColourDisplay()
59 void wxGetMousePosition( int* x
, int* y
)
64 // Returns depth of screen
78 // DFE: These aren't even implemented by wxGTK, and no wxWindows code calls
79 // them. If someone needs them, then they'll get a link error
81 // Consume all events until no more left
86 // Check whether this window wants to process messages, e.g. Stop button
87 // in long calculations.
88 bool wxCheckForInterrupt(wxWindow
*wnd
)
96 // Reading and writing resources (eg WIN.INI, .Xdefaults)
98 bool wxWriteResource(const wxString
& section
, const wxString
& entry
, const wxString
& value
, const wxString
& file
)
104 bool wxWriteResource(const wxString
& section
, const wxString
& entry
, float value
, const wxString
& file
)
107 sprintf(buf
, "%.4f", value
);
108 return wxWriteResource(section
, entry
, buf
, file
);
111 bool wxWriteResource(const wxString
& section
, const wxString
& entry
, long value
, const wxString
& file
)
114 sprintf(buf
, "%ld", value
);
115 return wxWriteResource(section
, entry
, buf
, file
);
118 bool wxWriteResource(const wxString
& section
, const wxString
& entry
, int value
, const wxString
& file
)
121 sprintf(buf
, "%d", value
);
122 return wxWriteResource(section
, entry
, buf
, file
);
125 bool wxGetResource(const wxString
& section
, const wxString
& entry
, char **value
, const wxString
& file
)
131 bool wxGetResource(const wxString
& section
, const wxString
& entry
, float *value
, const wxString
& file
)
134 bool succ
= wxGetResource(section
, entry
, (char **)&s
, file
);
137 *value
= (float)strtod(s
, NULL
);
144 bool wxGetResource(const wxString
& section
, const wxString
& entry
, long *value
, const wxString
& file
)
147 bool succ
= wxGetResource(section
, entry
, (char **)&s
, file
);
150 *value
= strtol(s
, NULL
, 10);
157 bool wxGetResource(const wxString
& section
, const wxString
& entry
, int *value
, const wxString
& file
)
160 bool succ
= wxGetResource(section
, entry
, (char **)&s
, file
);
163 *value
= (int)strtol(s
, NULL
, 10);
169 #endif // wxUSE_RESOURCES