]>
git.saurik.com Git - wxWidgets.git/blob - src/cocoa/utils.cpp
9451eb06c1e8cebd65ef396a8ca682130465a360
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 // Return TRUE if we have a colour display
48 bool wxColourDisplay()
54 void wxGetMousePosition( int* x
, int* y
)
59 // Returns depth of screen
73 // DFE: These aren't even implemented by wxGTK, and no wxWindows code calls
74 // them. If someone needs them, then they'll get a link error
76 // Consume all events until no more left
81 // Check whether this window wants to process messages, e.g. Stop button
82 // in long calculations.
83 bool wxCheckForInterrupt(wxWindow
*wnd
)
91 // Reading and writing resources (eg WIN.INI, .Xdefaults)
93 bool wxWriteResource(const wxString
& section
, const wxString
& entry
, const wxString
& value
, const wxString
& file
)
99 bool wxWriteResource(const wxString
& section
, const wxString
& entry
, float value
, const wxString
& file
)
102 sprintf(buf
, "%.4f", value
);
103 return wxWriteResource(section
, entry
, buf
, file
);
106 bool wxWriteResource(const wxString
& section
, const wxString
& entry
, long value
, const wxString
& file
)
109 sprintf(buf
, "%ld", value
);
110 return wxWriteResource(section
, entry
, buf
, file
);
113 bool wxWriteResource(const wxString
& section
, const wxString
& entry
, int value
, const wxString
& file
)
116 sprintf(buf
, "%d", value
);
117 return wxWriteResource(section
, entry
, buf
, file
);
120 bool wxGetResource(const wxString
& section
, const wxString
& entry
, char **value
, const wxString
& file
)
126 bool wxGetResource(const wxString
& section
, const wxString
& entry
, float *value
, const wxString
& file
)
129 bool succ
= wxGetResource(section
, entry
, (char **)&s
, file
);
132 *value
= (float)strtod(s
, NULL
);
139 bool wxGetResource(const wxString
& section
, const wxString
& entry
, long *value
, const wxString
& file
)
142 bool succ
= wxGetResource(section
, entry
, (char **)&s
, file
);
145 *value
= strtol(s
, NULL
, 10);
152 bool wxGetResource(const wxString
& section
, const wxString
& entry
, int *value
, const wxString
& file
)
155 bool succ
= wxGetResource(section
, entry
, (char **)&s
, file
);
158 *value
= (int)strtol(s
, NULL
, 10);
164 #endif // wxUSE_RESOURCES