]>
git.saurik.com Git - wxWidgets.git/blob - src/cocoa/utils.cpp
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: src/cocoa/utils.cpp
3 // Purpose: Various utilities
8 // Copyright: (c) AUTHOR
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
12 #include "wx/wxprec.h"
16 #include "wx/apptrait.h"
17 #include "wx/display.h"
26 void wxDisplaySize(int *width
, int *height
)
35 void wxDisplaySizeMM(int*,int*)
40 void wxClientDisplayRect(int *x
,int *y
,int *width
,int *height
)
53 wxToolkitInfo
& wxGUIAppTraits::GetToolkitInfo()
55 static wxToolkitInfo info
;
56 info
.shortName
= _T("cocoa");
57 info
.name
= _T("wxCocoa");
62 wxWindow
* wxFindWindowAtPoint(const wxPoint
& pt
)
64 return wxGenericFindWindowAtPoint(pt
);
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