]> git.saurik.com Git - wxWidgets.git/commitdiff
Made the wxInputStream typemap useable outside the core wxc module
authorRobin Dunn <robin@alldunn.com>
Sat, 20 Jul 2002 00:10:46 +0000 (00:10 +0000)
committerRobin Dunn <robin@alldunn.com>
Sat, 20 Jul 2002 00:10:46 +0000 (00:10 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@16222 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

wxPython/src/helpers.cpp
wxPython/src/helpers.h
wxPython/src/streams.i
wxPython/src/wx.i
wxPython/src/wxPython.h

index 6ccc4303667e1c43d694c17f00bc1cf8f52c531b..dee8d45844e5a906c20b2d92160fb0ac48a59774 100644 (file)
@@ -326,8 +326,15 @@ PyObject* __wxSetDictionary(PyObject* /* self */, PyObject* args)
 #define wxPlatform "__WXMAC__"
 #endif
 
 #define wxPlatform "__WXMAC__"
 #endif
 
+#ifdef __WXDEBUG__
+    int wxdebug = 1;
+#else
+    int wxdebug = 0;
+#endif
+
     PyDict_SetItemString(wxPython_dict, "wxPlatform", PyString_FromString(wxPlatform));
     PyDict_SetItemString(wxPython_dict, "wxUSE_UNICODE", PyInt_FromLong(wxUSE_UNICODE));
     PyDict_SetItemString(wxPython_dict, "wxPlatform", PyString_FromString(wxPlatform));
     PyDict_SetItemString(wxPython_dict, "wxUSE_UNICODE", PyInt_FromLong(wxUSE_UNICODE));
+    PyDict_SetItemString(wxPython_dict, "__WXDEBUG__", PyInt_FromLong(wxdebug));
 
     Py_INCREF(Py_None);
     return Py_None;
 
     Py_INCREF(Py_None);
     return Py_None;
@@ -826,6 +833,11 @@ wxPyCBInputStream* wxPyCBInputStream::create(PyObject *py, bool block) {
     return new wxPyCBInputStream(read, seek, tell, block);
 }
 
     return new wxPyCBInputStream(read, seek, tell, block);
 }
 
+
+wxPyCBInputStream* wxPyCBInputStream_create(PyObject *py, bool block) {
+    return wxPyCBInputStream::create(py, block);
+}
+
 PyObject* wxPyCBInputStream::getMethod(PyObject* py, char* name) {
     if (!PyObject_HasAttrString(py, name))
         return NULL;
 PyObject* wxPyCBInputStream::getMethod(PyObject* py, char* name) {
     if (!PyObject_HasAttrString(py, name))
         return NULL;
index 3ad0d236a71dcddb10412805b7e1be8f0078531c..acc450dce6130b118c92a2750dae16d7ccc315f0 100644 (file)
@@ -210,10 +210,12 @@ public:
 class wxPyClientData;
 class wxPyUserData;
 class wxPyOORClientData;
 class wxPyClientData;
 class wxPyUserData;
 class wxPyOORClientData;
+class wxPyCBInputStream;
 
 void wxPyClientData_dtor(wxPyClientData* self);
 void wxPyUserData_dtor(wxPyUserData* self);
 void wxPyOORClientData_dtor(wxPyOORClientData* self);
 
 void wxPyClientData_dtor(wxPyClientData* self);
 void wxPyUserData_dtor(wxPyUserData* self);
 void wxPyOORClientData_dtor(wxPyOORClientData* self);
+wxPyCBInputStream* wxPyCBInputStream_create(PyObject *py, bool block);
 
 
 //---------------------------------------------------------------------------
 
 
 //---------------------------------------------------------------------------
@@ -285,6 +287,9 @@ struct wxPyCoreAPI {
     void        (*p_wxPyClientData_dtor)(wxPyClientData*);
     void        (*p_wxPyUserData_dtor)(wxPyUserData*);
     void        (*p_wxPyOORClientData_dtor)(wxPyOORClientData*);
     void        (*p_wxPyClientData_dtor)(wxPyClientData*);
     void        (*p_wxPyUserData_dtor)(wxPyUserData*);
     void        (*p_wxPyOORClientData_dtor)(wxPyOORClientData*);
+
+    wxPyCBInputStream* (*p_wxPyCBInputStream_create)(PyObject *py, bool block);
+
 };
 
 #ifdef wxPyUSE_EXPORT
 };
 
 #ifdef wxPyUSE_EXPORT
index ee087b4f9699b3c110988683450cc2d0bb7d3ab9..9e4feb153793978229f40a79b75a4cc70c2267a4 100644 (file)
@@ -39,7 +39,7 @@
         $target = temp->m_wxis;
         created = FALSE;
     } else {
         $target = temp->m_wxis;
         created = FALSE;
     } else {
-        $target = wxPyCBInputStream::create($source, FALSE);
+        $target = wxPyCBInputStream_create($source, FALSE);
         if ($target == NULL) {
             PyErr_SetString(PyExc_TypeError,"Expected _wxInputStream_p or Python file-like object.");
             return NULL;
         if ($target == NULL) {
             PyErr_SetString(PyExc_TypeError,"Expected _wxInputStream_p or Python file-like object.");
             return NULL;
index bca4da78209f22ca5ddff1c7af47f654e39d9e4f..3925c11c679acc91cf51c032c647e93b9404633f 100644 (file)
@@ -207,7 +207,9 @@ static wxPyCoreAPI API = {
 
     wxPyClientData_dtor,
     wxPyUserData_dtor,
 
     wxPyClientData_dtor,
     wxPyUserData_dtor,
-    wxPyOORClientData_dtor
+    wxPyOORClientData_dtor,
+
+    wxPyCBInputStream_create
 };
 
 
 };
 
 
index 934894b2a7a4a3842fb2a362023331a839b205cf..67fb55da52c527b6c4adf8cf76d7c148e809f977 100644 (file)
@@ -90,6 +90,9 @@ static void wxPyCoreAPI_IMPORT() {
 #define wxPyUserData_dtor(a)                (wxPyCoreAPIPtr->p_wxPyUserData_dtor(a))
 #define wxPyOORClientData_dtor(a)           (wxPyCoreAPIPtr->p_wxPyOORClientData_dtor(a))
 
 #define wxPyUserData_dtor(a)                (wxPyCoreAPIPtr->p_wxPyUserData_dtor(a))
 #define wxPyOORClientData_dtor(a)           (wxPyCoreAPIPtr->p_wxPyOORClientData_dtor(a))
 
+#define wxPyCBInputStream_create(a, b)      (wxPyCoreAPIPtr->p_wxPyCBInputStream_create(a, b))
+
+
 // This one is special.  It's the first function called in SWIG generated
 // modules, so we'll use it to also import the API.
 #define SWIG_newvarlink()     (wxPyCoreAPI_IMPORT(), wxPyCoreAPIPtr->p_SWIG_newvarlink())
 // This one is special.  It's the first function called in SWIG generated
 // modules, so we'll use it to also import the API.
 #define SWIG_newvarlink()     (wxPyCoreAPI_IMPORT(), wxPyCoreAPIPtr->p_SWIG_newvarlink())