]> git.saurik.com Git - wxWidgets.git/commitdiff
Aquire the GIL before raising the NotImplementedError exception
authorRobin Dunn <robin@alldunn.com>
Sat, 20 Dec 2003 19:54:10 +0000 (19:54 +0000)
committerRobin Dunn <robin@alldunn.com>
Sat, 20 Dec 2003 19:54:10 +0000 (19:54 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@24944 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

13 files changed:
wxPython/include/wx/wxPython/wxPython_int.h
wxPython/src/_app.i
wxPython/src/_dataobj.i
wxPython/src/_dc.i
wxPython/src/_font.i
wxPython/src/_functions.i
wxPython/src/_joystick.i
wxPython/src/_popupwin.i
wxPython/src/_region.i
wxPython/src/_taskbar.i
wxPython/src/_tglbtn.i
wxPython/src/_wave.i
wxPython/src/_window.i

index 2d42ea5e51772e62f24ad4431055839ce39c2e27..fd0cb3478d3fdeca0c8c1fb245909ef19ca29273 100644 (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
index e2efaa1c1a5aaebcc1bc1344d49e1362c79f2e51..b938ac52ef5ed84fcbcfde6a20bf58461068aa7e 100644 (file)
@@ -257,7 +257,7 @@ public:
 #else
     %extend {
         static int GetComCtl32Version()
-            { PyErr_SetNone(PyExc_NotImplementedError); return 0; }
+            { wxPyRaiseNotImplemented(); return 0; }
     }
 #endif
 };
index 56aaaa09b9afc91b99fcf5e9324a6e9ee27b824f..191ca7a74bfbbd05de8e47bd6e60c16cabc82b09 100644 (file)
@@ -445,7 +445,7 @@ public:
 class wxMetafileDataObject : public wxDataObjectSimple
 {
 public:
-    wxMetafileDataObject() { PyErr_SetNone(PyExc_NotImplementedError); }
+    wxMetafileDataObject() { wxPyRaiseNotImplemented(); }
 };    
 %}
 
index 4b4034bcb31a3d6602db3b35fae2691fadee522e..d394706e8b5c3e951e28a667c15f4440c5ff92ef 100644 (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(); }
 };
 %}
  
index 997d2ede8c0fd15e97ba60887eafc583d6c4501b..13823a26fd1595c5abce602040cea4547d91a8e9 100644 (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
 
index 8abf2a31c877f95a1ea1cacd698a0ac093d88678..aa33a105b9fe51395ec9e05306aa946231777417 100644 (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
 
 
index 092bc34c169842d28dea8b887e0c47d1ee76d0ba..fe2da5c0fda332e5d40f27745144c4698b5683f6 100644 (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); }
index bf382364525ec4ebfc3c94a93ad4c09f1c02e5be..330b1dc3cb15f7ecbeb6fef98e48267546d4a60f 100644 (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(); }
 };
 %}
 
index 714aba481bf1425fb5a5d056379e0859bdddad1d..55a9cc4834a38dde4b67b6b92c5c089cdd14f53f 100644 (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;
         }
     }
index 24a1d4abd93fc952ae328f1ada3c1fc938ee9ea6..3b37db21b28529baa1084f06b9872f25169313a6 100644 (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; }
 };
 
index 1d736f9c38cac15593454e4c5cb315fe34a1cb9a..2cf934ce844f42779c588451893bce4801a9b12f 100644 (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
 %}
index acf94593a6e4d1ce871b289b76266a99ce450df9..a55857dc3b2d4a66c5975f10d6ced07ee2157fba 100644 (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();
     }
 
index 9dec8acb3583f0ac207871a32893fa5109605850..34c35b37035aee9f247ca30da07769905447fcd8 100644 (file)
@@ -807,7 +807,7 @@ wxWindow* wxFindWindowByLabel( const wxString& label,
         win->SubclassWin(hWnd);
         return win;
 #else
-        PyErr_SetNone(PyExc_NotImplementedError);
+        wxPyRaiseNotImplemented();
         return NULL;
 #endif
     }