]>
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"
16 #include "wx/display.h"
25 // Get size of display
26 size_t wxDisplayBase::GetCount()
31 void wxDisplaySize(int *width
, int *height
)
40 void wxDisplaySizeMM(int*,int*)
45 void wxClientDisplayRect(int *x
,int *y
,int *width
,int *height
)
58 wxToolkitInfo
& wxGUIAppTraits::GetToolkitInfo()
60 static wxToolkitInfo info
;
61 info
.shortName
= _T("cocoa");
62 info
.name
= _T("wxCocoa");
67 // Return TRUE if we have a colour display
68 bool wxColourDisplay()
74 void wxGetMousePosition( int* x
, int* y
)
79 // Returns depth of screen
93 // DFE: These aren't even implemented by wxGTK, and no wxWidgets code calls
94 // them. If someone needs them, then they'll get a link error
96 // Consume all events until no more left
101 // Check whether this window wants to process messages, e.g. Stop button
102 // in long calculations.
103 bool wxCheckForInterrupt(wxWindow
*wnd
)
111 // Reading and writing resources (eg WIN.INI, .Xdefaults)
113 bool wxWriteResource(const wxString
& section
, const wxString
& entry
, const wxString
& value
, const wxString
& file
)
119 bool wxWriteResource(const wxString
& section
, const wxString
& entry
, float value
, const wxString
& file
)
122 sprintf(buf
, "%.4f", value
);
123 return wxWriteResource(section
, entry
, buf
, file
);
126 bool wxWriteResource(const wxString
& section
, const wxString
& entry
, long value
, const wxString
& file
)
129 sprintf(buf
, "%ld", value
);
130 return wxWriteResource(section
, entry
, buf
, file
);
133 bool wxWriteResource(const wxString
& section
, const wxString
& entry
, int value
, const wxString
& file
)
136 sprintf(buf
, "%d", value
);
137 return wxWriteResource(section
, entry
, buf
, file
);
140 bool wxGetResource(const wxString
& section
, const wxString
& entry
, char **value
, const wxString
& file
)
146 bool wxGetResource(const wxString
& section
, const wxString
& entry
, float *value
, const wxString
& file
)
149 bool succ
= wxGetResource(section
, entry
, (char **)&s
, file
);
152 *value
= (float)strtod(s
, NULL
);
159 bool wxGetResource(const wxString
& section
, const wxString
& entry
, long *value
, const wxString
& file
)
162 bool succ
= wxGetResource(section
, entry
, (char **)&s
, file
);
165 *value
= strtol(s
, NULL
, 10);
172 bool wxGetResource(const wxString
& section
, const wxString
& entry
, int *value
, const wxString
& file
)
175 bool succ
= wxGetResource(section
, entry
, (char **)&s
, file
);
178 *value
= (int)strtol(s
, NULL
, 10);
184 #endif // wxUSE_RESOURCES