wxPyEndBlockThreads(blocked);
}
+void wxPyApp::MacOpenURL(const wxString &url)
+{
+ wxPyBlock_t blocked = wxPyBeginBlockThreads();
+ if (wxPyCBH_findCallback(m_myInst, "MacOpenURL")) {
+ PyObject* s = wx2PyString(url);
+ wxPyCBH_callCallback(m_myInst, Py_BuildValue("(O)", s));
+ Py_DECREF(s);
+ }
+ wxPyEndBlockThreads(blocked);
+}
+
void wxPyApp::MacPrintFile(const wxString &fileName)
{
wxPyBlock_t blocked = wxPyBeginBlockThreads();
wxPyCBInputStream::~wxPyCBInputStream() {
- wxPyBlock_t blocked;
+ wxPyBlock_t blocked = wxPyBlock_t_default;
if (m_block) blocked = wxPyBeginBlockThreads();
Py_XDECREF(m_read);
Py_XDECREF(m_seek);
wxPyCBInputStream* wxPyCBInputStream::create(PyObject *py, bool block) {
- wxPyBlock_t blocked;
+ wxPyBlock_t blocked = wxPyBlock_t_default;
if (block) blocked = wxPyBeginBlockThreads();
PyObject* read = getMethod(py, "read");
void wxPyCBH_delete(wxPyCallbackHelper* cbh) {
- if (cbh->m_incRef) {
+ if (cbh->m_incRef && Py_IsInitialized()) {
wxPyBlock_t blocked = wxPyBeginBlockThreads();
Py_XDECREF(cbh->m_self);
Py_XDECREF(cbh->m_class);
target = new wxString();
size_t len = PyUnicode_GET_SIZE(uni);
if (len) {
- PyUnicode_AsWideChar((PyUnicodeObject*)uni, target->GetWriteBuf(len), len);
- target->UngetWriteBuf(len);
+ PyUnicode_AsWideChar((PyUnicodeObject*)uni, wxStringBuffer(*target, len), len);
}
if (PyString_Check(source))
}
size_t len = PyUnicode_GET_SIZE(uni);
if (len) {
- PyUnicode_AsWideChar((PyUnicodeObject*)uni, target.GetWriteBuf(len), len);
- target.UngetWriteBuf();
+ PyUnicode_AsWideChar((PyUnicodeObject*)uni, wxStringBuffer(target, len), len);
}
if (!PyUnicode_Check(source))
+bool wxPosition_helper(PyObject* source, wxPosition** obj)
+{
+ if (source == Py_None) {
+ **obj = wxPosition(-1,-1);
+ return true;
+ }
+ return wxPyTwoIntItem_helper(source, obj, wxT("wxPosition"));
+}
+
+
+
bool wxRealPoint_helper(PyObject* source, wxRealPoint** obj) {
if (source == Py_None) {