Aquire the GIL before raising the NotImplementedError exception

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@24944 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robin Dunn
2003-12-20 19:54:10 +00:00
parent 2678dd26fb
commit 81cfe5e13e
13 changed files with 32 additions and 23 deletions

View File

@@ -145,7 +145,8 @@ void wxPyEndBlockThreads();
#endif // wxPyUSE_EXPORTED_API
#define wxPyBLOCK_THREADS(stmt) wxPyBeginBlockThreads(); stmt; wxPyEndBlockThreads()
#define wxPyBLOCK_THREADS(stmt) { wxPyBeginBlockThreads(); stmt; wxPyEndBlockThreads(); }
#define wxPyRaiseNotImplemented() wxPyBLOCK_THREADS(PyErr_SetNone(PyExc_NotImplementedError))
//---------------------------------------------------------------------------
// These are helpers used by the typemaps

View File

@@ -257,7 +257,7 @@ public:
#else
%extend {
static int GetComCtl32Version()
{ PyErr_SetNone(PyExc_NotImplementedError); return 0; }
{ wxPyRaiseNotImplemented(); return 0; }
}
#endif
};

View File

@@ -445,7 +445,7 @@ public:
class wxMetafileDataObject : public wxDataObjectSimple
{
public:
wxMetafileDataObject() { PyErr_SetNone(PyExc_NotImplementedError); }
wxMetafileDataObject() { wxPyRaiseNotImplemented(); }
};
%}

View File

@@ -705,13 +705,13 @@ public:
class wxMetaFile : public wxObject {
public:
wxMetaFile(const wxString&)
{ PyErr_SetNone(PyExc_NotImplementedError); }
{ wxPyRaiseNotImplemented(); }
};
class wxMetaFileDC : public wxClientDC {
public:
wxMetaFileDC(const wxString&, int, int, const wxString&)
{ PyErr_SetNone(PyExc_NotImplementedError); }
{ wxPyRaiseNotImplemented(); }
};
%}
@@ -751,10 +751,10 @@ public:
class wxPrinterDC : public wxClientDC {
public:
wxPrinterDC(const wxPrintData&)
{ PyErr_SetNone(PyExc_NotImplementedError); }
{ wxPyRaiseNotImplemented(); }
// wxPrinterDC(const wxString&, const wxString&, const wxString&, bool, int)
// { PyErr_SetNone(PyExc_NotImplementedError); }
// { wxPyRaiseNotImplemented(); }
};
%}

View File

@@ -268,10 +268,10 @@ bool wxTestFontEncoding(const wxNativeEncodingInfo& info);
%inline %{
wxNativeEncodingInfo* wxGetNativeFontEncoding(wxFontEncoding encoding)
{ PyErr_SetNone(PyExc_NotImplementedError); return NULL; }
{ wxPyRaiseNotImplemented(); return NULL; }
bool wxTestFontEncoding(const wxNativeEncodingInfo& info)
{ PyErr_SetNone(PyExc_NotImplementedError); return False; }
{ wxPyRaiseNotImplemented(); return False; }
%}
#endif

View File

@@ -52,7 +52,7 @@ long wxGetFreeMemory();
#else
%inline %{
long wxGetFreeMemory()
{ PyErr_SetNone(PyExc_NotImplementedError); return 0; }
{ wxPyRaiseNotImplemented(); return 0; }
%}
#endif
@@ -214,6 +214,11 @@ wxWindow* wxGetTopLevelParent(wxWindow *win);
// This is generally most useful getting the state of
// Caps Lock, Num Lock and Scroll Lock...
bool wxGetKeyState(wxKeyCode key);
#else
%inline %{
bool wxGetKeyState(wxKeyCode key)
{ wxPyRaiseNotImplemented(); return False; }
%}
#endif

View File

@@ -49,7 +49,8 @@ class wxJoystick : public wxObject {
public:
wxJoystick(int joystick = wxJOYSTICK1) {
wxPyBeginBlockThreads();
PyErr_SetString(PyExc_NotImplementedError, "wxJoystick is not available on this platform.");
PyErr_SetString(PyExc_NotImplementedError,
"wxJoystick is not available on this platform.");
wxPyEndBlockThreads();
}
wxPoint GetPosition() { return wxPoint(-1,-1); }

View File

@@ -103,15 +103,15 @@ public:
%{
class wxPopupWindow : public wxWindow {
public:
wxPopupWindow(wxWindow *, int) { PyErr_SetNone(PyExc_NotImplementedError); }
wxPopupWindow() { PyErr_SetNone(PyExc_NotImplementedError); }
wxPopupWindow(wxWindow *, int) { wxPyRaiseNotImplemented(); }
wxPopupWindow() { wxPyRaiseNotImplemented(); }
};
class wxPyPopupTransientWindow : public wxPopupWindow
{
public:
wxPyPopupTransientWindow(wxWindow *, int) { PyErr_SetNone(PyExc_NotImplementedError); }
wxPyPopupTransientWindow() { PyErr_SetNone(PyExc_NotImplementedError); }
wxPyPopupTransientWindow(wxWindow *, int) { wxPyRaiseNotImplemented(); }
wxPyPopupTransientWindow() { wxPyRaiseNotImplemented(); }
};
%}

View File

@@ -54,7 +54,7 @@ public:
%extend {
%name(RegionFromPoints)wxRegion(int points, wxPoint* points_array,
int fillStyle = wxWINDING_RULE) {
PyErr_SetNone(PyExc_NotImplementedError);
wxPyRaiseNotImplemented();
return NULL;
}
}

View File

@@ -29,7 +29,7 @@
class wxTaskBarIcon : public wxEvtHandler
{
public:
wxTaskBarIcon() { PyErr_SetNone(PyExc_NotImplementedError); }
wxTaskBarIcon() { wxPyRaiseNotImplemented(); }
};
@@ -37,7 +37,7 @@ class wxTaskBarIconEvent : public wxEvent
{
public:
wxTaskBarIconEvent(wxEventType, wxTaskBarIcon *)
{ PyErr_SetNone(PyExc_NotImplementedError); }
{ wxPyRaiseNotImplemented(); }
virtual wxEvent* Clone() const { return NULL; }
};

View File

@@ -33,10 +33,10 @@ public:
wxToggleButton(wxWindow *, wxWindowID, const wxString&,
const wxPoint&, const wxSize&, long,
const wxValidator&, const wxString&)
{ PyErr_SetNone(PyExc_NotImplementedError); }
{ wxPyRaiseNotImplemented(); }
wxToggleButton()
{ PyErr_SetNone(PyExc_NotImplementedError); }
{ wxPyRaiseNotImplemented(); }
};
#endif
%}

View File

@@ -30,12 +30,14 @@ class wxWave : public wxObject
public:
wxWave(const wxString& fileName, bool isResource = False) {
wxPyBeginBlockThreads();
PyErr_SetString(PyExc_NotImplementedError, "wxWave is not available on this platform.");
PyErr_SetString(PyExc_NotImplementedError,
"wxWave is not available on this platform.");
wxPyEndBlockThreads();
}
wxWave(int size, const wxByte* data) {
wxPyBeginBlockThreads();
PyErr_SetString(PyExc_NotImplementedError, "wxWave is not available on this platform.");
PyErr_SetString(PyExc_NotImplementedError,
"wxWave is not available on this platform.");
wxPyEndBlockThreads();
}

View File

@@ -807,7 +807,7 @@ wxWindow* wxFindWindowByLabel( const wxString& label,
win->SubclassWin(hWnd);
return win;
#else
PyErr_SetNone(PyExc_NotImplementedError);
wxPyRaiseNotImplemented();
return NULL;
#endif
}