]>
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 /////////////////////////////////////////////////////////////////////////////
23 // Get size of display
24 void wxDisplaySize(int *width
, int *height
)
29 void wxDisplaySizeMM(int*,int*)
34 void wxClientDisplayRect(int *x
,int *y
,int *width
,int *height
)
47 int wxGetOsVersion(int *majorVsn
, int *minorVsn
)
53 // Return TRUE if we have a colour display
54 bool wxColourDisplay()
60 void wxGetMousePosition( int* x
, int* y
)
65 // Returns depth of screen
79 // DFE: These aren't even implemented by wxGTK, and no wxWindows code calls
80 // them. If someone needs them, then they'll get a link error
82 // Consume all events until no more left
87 // Check whether this window wants to process messages, e.g. Stop button
88 // in long calculations.
89 bool wxCheckForInterrupt(wxWindow
*wnd
)
97 // Reading and writing resources (eg WIN.INI, .Xdefaults)
99 bool wxWriteResource(const wxString
& section
, const wxString
& entry
, const wxString
& value
, const wxString
& file
)
105 bool wxWriteResource(const wxString
& section
, const wxString
& entry
, float value
, const wxString
& file
)
108 sprintf(buf
, "%.4f", value
);
109 return wxWriteResource(section
, entry
, buf
, file
);
112 bool wxWriteResource(const wxString
& section
, const wxString
& entry
, long value
, const wxString
& file
)
115 sprintf(buf
, "%ld", value
);
116 return wxWriteResource(section
, entry
, buf
, file
);
119 bool wxWriteResource(const wxString
& section
, const wxString
& entry
, int value
, const wxString
& file
)
122 sprintf(buf
, "%d", value
);
123 return wxWriteResource(section
, entry
, buf
, file
);
126 bool wxGetResource(const wxString
& section
, const wxString
& entry
, char **value
, const wxString
& file
)
132 bool wxGetResource(const wxString
& section
, const wxString
& entry
, float *value
, const wxString
& file
)
135 bool succ
= wxGetResource(section
, entry
, (char **)&s
, file
);
138 *value
= (float)strtod(s
, NULL
);
145 bool wxGetResource(const wxString
& section
, const wxString
& entry
, long *value
, const wxString
& file
)
148 bool succ
= wxGetResource(section
, entry
, (char **)&s
, file
);
151 *value
= strtol(s
, NULL
, 10);
158 bool wxGetResource(const wxString
& section
, const wxString
& entry
, int *value
, const wxString
& file
)
161 bool succ
= wxGetResource(section
, entry
, (char **)&s
, file
);
164 *value
= (int)strtol(s
, NULL
, 10);
170 #endif // wxUSE_RESOURCES