]>
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"
24 // Get size of display
25 void wxDisplaySize(int *width
, int *height
)
30 void wxDisplaySizeMM(int*,int*)
35 void wxClientDisplayRect(int *x
,int *y
,int *width
,int *height
)
48 int wxGUIAppTraits::GetOSVersion(int *verMaj
, int *verMin
)
57 // Return TRUE if we have a colour display
58 bool wxColourDisplay()
64 void wxGetMousePosition( int* x
, int* y
)
69 // Returns depth of screen
83 // DFE: These aren't even implemented by wxGTK, and no wxWindows code calls
84 // them. If someone needs them, then they'll get a link error
86 // Consume all events until no more left
91 // Check whether this window wants to process messages, e.g. Stop button
92 // in long calculations.
93 bool wxCheckForInterrupt(wxWindow
*wnd
)
101 // Reading and writing resources (eg WIN.INI, .Xdefaults)
103 bool wxWriteResource(const wxString
& section
, const wxString
& entry
, const wxString
& value
, const wxString
& file
)
109 bool wxWriteResource(const wxString
& section
, const wxString
& entry
, float value
, const wxString
& file
)
112 sprintf(buf
, "%.4f", value
);
113 return wxWriteResource(section
, entry
, buf
, file
);
116 bool wxWriteResource(const wxString
& section
, const wxString
& entry
, long value
, const wxString
& file
)
119 sprintf(buf
, "%ld", value
);
120 return wxWriteResource(section
, entry
, buf
, file
);
123 bool wxWriteResource(const wxString
& section
, const wxString
& entry
, int value
, const wxString
& file
)
126 sprintf(buf
, "%d", value
);
127 return wxWriteResource(section
, entry
, buf
, file
);
130 bool wxGetResource(const wxString
& section
, const wxString
& entry
, char **value
, const wxString
& file
)
136 bool wxGetResource(const wxString
& section
, const wxString
& entry
, float *value
, const wxString
& file
)
139 bool succ
= wxGetResource(section
, entry
, (char **)&s
, file
);
142 *value
= (float)strtod(s
, NULL
);
149 bool wxGetResource(const wxString
& section
, const wxString
& entry
, long *value
, const wxString
& file
)
152 bool succ
= wxGetResource(section
, entry
, (char **)&s
, file
);
155 *value
= strtol(s
, NULL
, 10);
162 bool wxGetResource(const wxString
& section
, const wxString
& entry
, int *value
, const wxString
& file
)
165 bool succ
= wxGetResource(section
, entry
, (char **)&s
, file
);
168 *value
= (int)strtol(s
, NULL
, 10);
174 #endif // wxUSE_RESOURCES