]> git.saurik.com Git - wxWidgets.git/commitdiff
Massive code changes and cleanup to allow wxPython to be split into
authorRobin Dunn <robin@alldunn.com>
Fri, 22 Dec 2000 00:06:04 +0000 (00:06 +0000)
committerRobin Dunn <robin@alldunn.com>
Fri, 22 Dec 2000 00:06:04 +0000 (00:06 +0000)
multiple extension modules again.  A Python CObject is used to allow
the "export" of SWIG and other common helper functions from the wxc
module to other modules, even if they are in separate shared
libraries.  Should also be usable from 3rd party code, just include
wxPython/src/export.h

Changed the default setup so the following are built as separate
extension modules:  calendar, glcanvas, grid, html, ogl, stc, and
utils.  Will probably add more later.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@8984 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

41 files changed:
wxPython/CHANGES.txt
wxPython/contrib/glcanvas/glcanvas.i
wxPython/contrib/glcanvas/msw/glcanvas.cpp
wxPython/contrib/glcanvas/stub.cpp [deleted file]
wxPython/contrib/ogl/ogl.cpp
wxPython/contrib/ogl/ogl.i
wxPython/contrib/ogl/oglbasic.cpp
wxPython/contrib/ogl/oglbasic.i
wxPython/contrib/ogl/oglcanvas.cpp
wxPython/contrib/ogl/oglcanvas.i
wxPython/contrib/ogl/oglhelpers.cpp [deleted file]
wxPython/contrib/ogl/oglshapes.cpp
wxPython/contrib/ogl/oglshapes.i
wxPython/contrib/ogl/oglshapes2.cpp
wxPython/contrib/ogl/oglshapes2.i
wxPython/contrib/ogl/stub.cpp [deleted file]
wxPython/contrib/stc/stc_.cpp
wxPython/contrib/stc/stc_.i
wxPython/contrib/stc/stub.cpp [deleted file]
wxPython/demo/data/echo.py
wxPython/my_distutils.py
wxPython/setup.py
wxPython/src/__version__.py
wxPython/src/calendar.i
wxPython/src/export.h [new file with mode: 0644]
wxPython/src/grid.i
wxPython/src/helpers.cpp
wxPython/src/helpers.h
wxPython/src/html.i
wxPython/src/htmlhelp.i
wxPython/src/misc2.i
wxPython/src/msw/calendar.cpp
wxPython/src/msw/grid.cpp
wxPython/src/msw/html.cpp
wxPython/src/msw/htmlhelp.cpp
wxPython/src/msw/misc2.cpp
wxPython/src/msw/misc2.py
wxPython/src/msw/utils.cpp
wxPython/src/msw/wx.cpp
wxPython/src/utils.i
wxPython/src/wx.i

index 22775ca5c63629529bc8e16a4942ba524cdffc63..9b96d8c58aebf9fe93638a3425d7f3c722d465ff 100644 (file)
@@ -2,7 +2,7 @@ CHANGES.txt for wxPython
 
 ----------------------------------------------------------------------
 
-2.3b1
+2.3b2
 -----
 
 New typemaps for wxString when compiling for Python 2.0 and beyond
@@ -15,7 +15,7 @@ Fixed the generic buttons so tool tips work for them.
 Fixed a bug in the demo's tree control.
 
 Added a listbox to the listbox demo that shows how to find items with
-a patching prefix as keys are typed.
+a matching prefix as keys are typed.
 
 Added code to the wxListCtrl demo to show how to get text from a
 column in report mode.
@@ -33,6 +33,17 @@ Added wxNotifyEvent.Allow()
 
 Fixed GOBS of reference leaks.
 
+Massive code changes and cleanup to allow wxPython to be split into
+multiple extension modules again.  A Python CObject is used to allow
+the "export" of SWIG and other common helper functions from the wxc
+module to other modules, even if they are in separate shared
+libraries.  Should also be usable from 3rd party code, just include
+wxPython/src/export.h
+
+Changed the default setup so the following are built as separate
+extension modules:  calendar, glcanvas, grid, html, ogl, stc, and
+utils.  Will probably add more later.
+
 
 
 New in 2.2.2
index 247137b5a17b9afe21b375b2e73ee5a6dba74b26..96f19eb0655a209b13bb84d862ef5294712f782e 100644 (file)
@@ -14,7 +14,7 @@
 %module glcanvas
 
 %{
-#include "helpers.h"
+#include "export.h"
 #include <wx/glcanvas.h>
 %}
 
 %extern events.i
 
 
-%{
-#if defined(__WXMSW__)
-    static wxString wxPyEmptyStr("");
-    static wxPoint  wxPyDefaultPosition(-1, -1);
-    static wxSize   wxPyDefaultSize(-1, -1);
-#endif
-%}
-
 %pragma(python) code = "import wx"
 
 //---------------------------------------------------------------------------
@@ -99,8 +91,8 @@ public:
 class wxGLCanvas : public wxScrolledWindow {
 public:
     wxGLCanvas(wxWindow *parent, wxWindowID id = -1,
-               const wxPoint& pos = wxPyDefaultPosition,
-               const wxSize& size = wxPyDefaultSize, long style = 0,
+               const wxPoint& pos = wxDefaultPosition,
+               const wxSize& size = wxDefaultSize, long style = 0,
                const char* name = "GLCanvas",
                int *attribList = NULL,
                const wxPalette& palette = wxNullPalette);
@@ -119,8 +111,8 @@ public:
 
 %init %{
 
-    wxClassInfo::CleanUpClasses();
-    wxClassInfo::InitializeClasses();
+//    wxClassInfo::CleanUpClasses();
+//    wxClassInfo::InitializeClasses();
 
 %}
 
index d1d8ab9a5d74ae436f08e4b6fab19929f2735c6e..8d38980275e7eee21483cc6a135ef7f250b596b0 100644 (file)
@@ -55,7 +55,7 @@ extern PyObject *SWIG_newvarlink(void);
 
 #define SWIG_name    "glcanvasc"
 
-#include "helpers.h"
+#include "export.h"
 #include <wx/glcanvas.h>
 
 static PyObject* l_output_helper(PyObject* target, PyObject* o) {
@@ -105,12 +105,6 @@ static PyObject* t_output_helper(PyObject* target, PyObject* o) {
 }
 
 static char* wxStringErrorMsg = "string type is required for parameter";
-
-#if defined(__WXMSW__)
-    static wxString wxPyEmptyStr("");
-    static wxPoint  wxPyDefaultPosition(-1, -1);
-    static wxSize   wxPyDefaultSize(-1, -1);
-#endif
 #ifdef __cplusplus
 extern "C" {
 #endif
@@ -341,8 +335,8 @@ static PyObject *_wrap_new_wxGLCanvas(PyObject *self, PyObject *args, PyObject *
     wxGLCanvas * _result;
     wxWindow * _arg0;
     wxWindowID  _arg1 = (wxWindowID ) -1;
-    wxPoint * _arg2 = (wxPoint *) &wxPyDefaultPosition;
-    wxSize * _arg3 = (wxSize *) &wxPyDefaultSize;
+    wxPoint * _arg2 = (wxPoint *) &wxDefaultPosition;
+    wxSize * _arg3 = (wxSize *) &wxDefaultSize;
     long  _arg4 = (long ) 0;
     char * _arg5 = (char *) "GLCanvas";
     int * _arg6 = (int *) NULL;
@@ -1102,8 +1096,8 @@ SWIGEXPORT(void) initglcanvasc() {
         d = PyModule_GetDict(m);
 
 
-    wxClassInfo::CleanUpClasses();
-    wxClassInfo::InitializeClasses();
+//    wxClassInfo::CleanUpClasses();
+//    wxClassInfo::InitializeClasses();
 
 {
    int i;
diff --git a/wxPython/contrib/glcanvas/stub.cpp b/wxPython/contrib/glcanvas/stub.cpp
deleted file mode 100644 (file)
index b675bd2..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-/* Definitions for Windows/Unix exporting */
-#if defined(__WIN32__)
-#   if defined(_MSC_VER)
-#      define SWIGEXPORT(a) __declspec(dllexport) a
-#   else
-#      if defined(__BORLANDC__)
-#          define SWIGEXPORT(a) a _export
-#      else
-#          define SWIGEXPORT(a) a
-#      endif
-#   endif
-#else
-#   define SWIGEXPORT(a) a
-#endif
-
-
-
-#ifdef __cplusplus
-extern "C"
-#endif
-SWIGEXPORT(void) initglcanvasc() {
-}
-
-
index 964cc44d8a46f7d042495a5f6155c6ed72688e96..70f8829ada800da68488fd64b8d82455c1abd218 100644 (file)
@@ -55,7 +55,7 @@ extern PyObject *SWIG_newvarlink(void);
 
 #define SWIG_name    "oglc"
 
-#include "helpers.h"
+#include "export.h"
 #include "oglhelpers.h"
 
 static PyObject* l_output_helper(PyObject* target, PyObject* o) {
@@ -106,6 +106,87 @@ static PyObject* t_output_helper(PyObject* target, PyObject* o) {
 
 static char* wxStringErrorMsg = "string type is required for parameter";
 
+//---------------------------------------------------------------------------
+// This one will work for any class for the VERY generic cases, but beyond that
+// the helper needs to know more about the type.
+
+wxList* wxPy_wxListHelper(PyObject* pyList, char* className) {
+    bool doSave = wxPyRestoreThread();
+    if (!PyList_Check(pyList)) {
+        PyErr_SetString(PyExc_TypeError, "Expected a list object.");
+        wxPySaveThread(doSave);
+        return NULL;
+    }
+    int count = PyList_Size(pyList);
+    wxList* list = new wxList;
+    if (! list) {
+        PyErr_SetString(PyExc_MemoryError, "Unable to allocate wxList object");
+        wxPySaveThread(doSave);
+        return NULL;
+    }
+    for (int x=0; x<count; x++) {
+        PyObject* pyo = PyList_GetItem(pyList, x);
+        wxObject* wxo = NULL;
+
+        if (SWIG_GetPtrObj(pyo, (void **)&wxo, className)) {
+            char errmsg[1024];
+            sprintf(errmsg, "Type error, expected list of %s objects", className);
+            PyErr_SetString(PyExc_TypeError, errmsg);
+            wxPySaveThread(doSave);
+            return NULL;
+        }
+        list->Append(wxo);
+    }
+    wxPySaveThread(doSave);
+    return list;
+}
+
+//---------------------------------------------------------------------------
+
+wxList* wxPy_wxRealPoint_ListHelper(PyObject* pyList) {
+    bool doSave = wxPyRestoreThread();
+    if (!PyList_Check(pyList)) {
+        PyErr_SetString(PyExc_TypeError, "Expected a list object.");
+        wxPySaveThread(doSave);
+        return NULL;
+    }
+    int count = PyList_Size(pyList);
+    wxList* list = new wxList;
+    if (! list) {
+        PyErr_SetString(PyExc_MemoryError, "Unable to allocate wxList object");
+        wxPySaveThread(doSave);
+        return NULL;
+    }
+    for (int x=0; x<count; x++) {
+        PyObject* pyo = PyList_GetItem(pyList, x);
+
+        if (PyTuple_Check(pyo)) {
+            PyObject* o1 = PyNumber_Float(PyTuple_GetItem(pyo, 0));
+            PyObject* o2 = PyNumber_Float(PyTuple_GetItem(pyo, 1));
+
+            double val1 = (o1 ? PyFloat_AsDouble(o1) : 0.0);
+            double val2 = (o2 ? PyFloat_AsDouble(o2) : 0.0);
+
+            list->Append((wxObject*) new wxRealPoint(val1, val2));
+
+        } else {
+            wxRealPoint* wxo = NULL;
+            if (SWIG_GetPtrObj(pyo, (void **)&wxo, "_wxRealPoint_p")) {
+                PyErr_SetString(PyExc_TypeError, "Type error, expected list of wxRealPoint objects or 2-tuples");
+                wxPySaveThread(doSave);
+                return NULL;
+            }
+            list->Append((wxObject*) new wxRealPoint(*wxo));
+        }
+    }
+    wxPySaveThread(doSave);
+    return list;
+}
+
+
+//---------------------------------------------------------------------------
+
+
 extern "C" SWIGEXPORT(void) initoglbasicc();
 extern "C" SWIGEXPORT(void) initoglshapesc();
 extern "C" SWIGEXPORT(void) initoglshapes2c();
@@ -268,6 +349,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
     { "_class_wxRealPoint","_wxRealPoint",0},
     { "_wxNavigationKeyEvent","_class_wxNavigationKeyEvent",0},
     { "_wxPNMHandler","_class_wxPNMHandler",0},
+    { "_wxPrinterDC","_class_wxPrinterDC",0},
     { "_wxWindowCreateEvent","_class_wxWindowCreateEvent",0},
     { "_wxLogGui","_class_wxLogGui",0},
     { "_class_wxPyShapeEvtHandler","_wxPyShapeEvtHandler",0},
@@ -279,7 +361,6 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
     { "_class_wxPySizer","_wxPySizer",0},
     { "_class_wxPyCompositeShape","_wxPyCompositeShape",0},
     { "_wxPyPolygonShape","_class_wxPyPolygonShape",0},
-    { "_class_wxPostScriptDC","_wxPostScriptDC",0},
     { "_wxPanel","_class_wxPanel",0},
     { "_wxInitDialogEvent","_class_wxInitDialogEvent",0},
     { "_wxCheckBox","_class_wxCheckBox",0},
@@ -345,6 +426,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
     { "_class_wxZipFSHandler","_wxZipFSHandler",0},
     { "_char","_wxChar",0},
     { "_wxBitmap","_class_wxBitmap",0},
+    { "_wxTaskBarIcon","_class_wxTaskBarIcon",0},
     { "_wxPrintDialog","_class_wxPrintDialog",0},
     { "_wxPyControlPoint","_class_wxPyControlPoint",0},
     { "_wxWindowDC","_class_wxWindowDC",0},
@@ -436,6 +518,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
     { "_class_wxTextCtrl","_wxTextCtrl",0},
     { "_class_wxListItemAttr","_wxListItemAttr",0},
     { "_wxLayoutConstraints","_class_wxLayoutConstraints",0},
+    { "_wxMetaFileDC","_class_wxMetaFileDC",0},
     { "_class_wxTextDataObject","_wxTextDataObject",0},
     { "_wxMenu","_class_wxMenu",0},
     { "_class_wxMoveEvent","_wxMoveEvent",0},
@@ -489,6 +572,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
     { "_signed_short","_short",0},
     { "_wxMemoryDC","_class_wxMemoryDC",0},
     { "_wxPyTextDataObject","_class_wxPyTextDataObject",0},
+    { "_class_wxTaskBarIcon","_wxTaskBarIcon",0},
     { "_class_wxPrintDialog","_wxPrintDialog",0},
     { "_wxPyFileSystemHandler","_class_wxPyFileSystemHandler",0},
     { "_class_wxPyControlPoint","_wxPyControlPoint",0},
@@ -499,7 +583,6 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
     { "_wxStatusBar","_class_wxStatusBar",0},
     { "_class_wxAcceleratorEntry","_wxAcceleratorEntry",0},
     { "_class_wxCursor","_wxCursor",0},
-    { "_wxPostScriptDC","_class_wxPostScriptDC",0},
     { "_wxPyFileDropTarget","_class_wxPyFileDropTarget",0},
     { "_class_wxPyProcess","_wxPyProcess",0},
     { "_class_wxImageHandler","_wxImageHandler",0},
@@ -508,6 +591,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
     { "_class_wxLog","_wxLog",0},
     { "_wxTreeItemId","_class_wxTreeItemId",0},
     { "_unsigned_char","_byte",0},
+    { "_class_wxMetaFileDC","_wxMetaFileDC",0},
     { "_class_wxMenu","_wxMenu",0},
     { "_wxControl","_class_wxControl",0},
     { "_class_wxListBox","_wxListBox",0},
@@ -595,6 +679,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
     { "_class_wxPyApp","_wxPyApp",0},
     { "_wxSize","_class_wxSize",0},
     { "_wxRegionIterator","_class_wxRegionIterator",0},
+    { "_class_wxPrinterDC","_wxPrinterDC",0},
     { "_class_wxPyTextDataObject","_wxPyTextDataObject",0},
     { "_class_wxLogTextCtrl","_wxLogTextCtrl",0},
     { "_class_wxLogGui","_wxLogGui",0},
@@ -790,8 +875,8 @@ SWIGEXPORT(void) initoglc() {
     initoglcanvasc();
 
 
-    wxClassInfo::CleanUpClasses();
-    wxClassInfo::InitializeClasses();
+//    wxClassInfo::CleanUpClasses();
+//    wxClassInfo::InitializeClasses();
 
 {
    int i;
index 78fc0229e1a3496cd7bd6e953f77daf634f80ab4..ed49855716b71bb4dfe42abbdbe8d63d9bb2641d 100644 (file)
@@ -14,7 +14,7 @@
 %module ogl
 
 %{
-#include "helpers.h"
+#include "export.h"
 #include "oglhelpers.h"
 %}
 
@@ -133,10 +133,88 @@ void wxOGLInitialize();
 void wxOGLCleanUp();
 
 
+%{
 //---------------------------------------------------------------------------
+// This one will work for any class for the VERY generic cases, but beyond that
+// the helper needs to know more about the type.
+
+wxList* wxPy_wxListHelper(PyObject* pyList, char* className) {
+    bool doSave = wxPyRestoreThread();
+    if (!PyList_Check(pyList)) {
+        PyErr_SetString(PyExc_TypeError, "Expected a list object.");
+        wxPySaveThread(doSave);
+        return NULL;
+    }
+    int count = PyList_Size(pyList);
+    wxList* list = new wxList;
+    if (! list) {
+        PyErr_SetString(PyExc_MemoryError, "Unable to allocate wxList object");
+        wxPySaveThread(doSave);
+        return NULL;
+    }
+    for (int x=0; x<count; x++) {
+        PyObject* pyo = PyList_GetItem(pyList, x);
+        wxObject* wxo = NULL;
+
+        if (SWIG_GetPtrObj(pyo, (void **)&wxo, className)) {
+            char errmsg[1024];
+            sprintf(errmsg, "Type error, expected list of %s objects", className);
+            PyErr_SetString(PyExc_TypeError, errmsg);
+            wxPySaveThread(doSave);
+            return NULL;
+        }
+        list->Append(wxo);
+    }
+    wxPySaveThread(doSave);
+    return list;
+}
+
 //---------------------------------------------------------------------------
+
+wxList* wxPy_wxRealPoint_ListHelper(PyObject* pyList) {
+    bool doSave = wxPyRestoreThread();
+    if (!PyList_Check(pyList)) {
+        PyErr_SetString(PyExc_TypeError, "Expected a list object.");
+        wxPySaveThread(doSave);
+        return NULL;
+    }
+    int count = PyList_Size(pyList);
+    wxList* list = new wxList;
+    if (! list) {
+        PyErr_SetString(PyExc_MemoryError, "Unable to allocate wxList object");
+        wxPySaveThread(doSave);
+        return NULL;
+    }
+    for (int x=0; x<count; x++) {
+        PyObject* pyo = PyList_GetItem(pyList, x);
+
+        if (PyTuple_Check(pyo)) {
+            PyObject* o1 = PyNumber_Float(PyTuple_GetItem(pyo, 0));
+            PyObject* o2 = PyNumber_Float(PyTuple_GetItem(pyo, 1));
+
+            double val1 = (o1 ? PyFloat_AsDouble(o1) : 0.0);
+            double val2 = (o2 ? PyFloat_AsDouble(o2) : 0.0);
+
+            list->Append((wxObject*) new wxRealPoint(val1, val2));
+
+        } else {
+            wxRealPoint* wxo = NULL;
+            if (SWIG_GetPtrObj(pyo, (void **)&wxo, "_wxRealPoint_p")) {
+                PyErr_SetString(PyExc_TypeError, "Type error, expected list of wxRealPoint objects or 2-tuples");
+                wxPySaveThread(doSave);
+                return NULL;
+            }
+            list->Append((wxObject*) new wxRealPoint(*wxo));
+        }
+    }
+    wxPySaveThread(doSave);
+    return list;
+}
+
+
 //---------------------------------------------------------------------------
-%{
+
+
 extern "C" SWIGEXPORT(void) initoglbasicc();
 extern "C" SWIGEXPORT(void) initoglshapesc();
 extern "C" SWIGEXPORT(void) initoglshapes2c();
@@ -152,8 +230,8 @@ extern "C" SWIGEXPORT(void) initoglcanvasc();
     initoglcanvasc();
 
 
-    wxClassInfo::CleanUpClasses();
-    wxClassInfo::InitializeClasses();
+//    wxClassInfo::CleanUpClasses();
+//    wxClassInfo::InitializeClasses();
 
 %}
 
index 4730152f5d8a334f07d120548d0f1fac687d799f..e201df629c57ca4cdd705a2d3d4d984020d7703e 100644 (file)
@@ -55,7 +55,7 @@ extern PyObject *SWIG_newvarlink(void);
 
 #define SWIG_name    "oglbasicc"
 
-#include "helpers.h"
+#include "export.h"
 #include "oglhelpers.h"
 
 static PyObject* l_output_helper(PyObject* target, PyObject* o) {
@@ -8464,6 +8464,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
     { "_class_wxRealPoint","_wxRealPoint",0},
     { "_wxNavigationKeyEvent","_class_wxNavigationKeyEvent",0},
     { "_wxPNMHandler","_class_wxPNMHandler",0},
+    { "_wxPrinterDC","_class_wxPrinterDC",0},
     { "_wxWindowCreateEvent","_class_wxWindowCreateEvent",0},
     { "_wxLogGui","_class_wxLogGui",0},
     { "_class_wxPyShapeEvtHandler","_class_wxPyShape",SwigwxPyShapeTowxPyShapeEvtHandler},
@@ -8475,7 +8476,6 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
     { "_class_wxStatusBar","_wxStatusBar",0},
     { "_class_wxGIFHandler","_wxGIFHandler",0},
     { "_class_wxPySizer","_wxPySizer",0},
-    { "_class_wxPostScriptDC","_wxPostScriptDC",0},
     { "_wxPanel","_class_wxPanel",0},
     { "_wxInitDialogEvent","_class_wxInitDialogEvent",0},
     { "_wxCheckBox","_class_wxCheckBox",0},
@@ -8538,6 +8538,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
     { "_class_wxZipFSHandler","_wxZipFSHandler",0},
     { "_char","_wxChar",0},
     { "_wxBitmap","_class_wxBitmap",0},
+    { "_wxTaskBarIcon","_class_wxTaskBarIcon",0},
     { "_wxPrintDialog","_class_wxPrintDialog",0},
     { "_wxWindowDC","_class_wxWindowDC",0},
     { "_wxTimerEvent","_class_wxTimerEvent",0},
@@ -8622,6 +8623,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
     { "_class_wxTextCtrl","_wxTextCtrl",0},
     { "_class_wxListItemAttr","_wxListItemAttr",0},
     { "_wxLayoutConstraints","_class_wxLayoutConstraints",0},
+    { "_wxMetaFileDC","_class_wxMetaFileDC",0},
     { "_class_wxTextDataObject","_wxTextDataObject",0},
     { "_wxMenu","_class_wxMenu",0},
     { "_class_wxMoveEvent","_wxMoveEvent",0},
@@ -8672,6 +8674,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
     { "_signed_short","_short",0},
     { "_wxMemoryDC","_class_wxMemoryDC",0},
     { "_wxPyTextDataObject","_class_wxPyTextDataObject",0},
+    { "_class_wxTaskBarIcon","_wxTaskBarIcon",0},
     { "_class_wxPrintDialog","_wxPrintDialog",0},
     { "_wxPyFileSystemHandler","_class_wxPyFileSystemHandler",0},
     { "_wxPaintDC","_class_wxPaintDC",0},
@@ -8681,7 +8684,6 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
     { "_wxStatusBar","_class_wxStatusBar",0},
     { "_class_wxAcceleratorEntry","_wxAcceleratorEntry",0},
     { "_class_wxCursor","_wxCursor",0},
-    { "_wxPostScriptDC","_class_wxPostScriptDC",0},
     { "_wxPyFileDropTarget","_class_wxPyFileDropTarget",0},
     { "_class_wxPyProcess","_wxPyProcess",0},
     { "_class_wxImageHandler","_wxImageHandler",0},
@@ -8690,6 +8692,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
     { "_class_wxLog","_wxLog",0},
     { "_wxTreeItemId","_class_wxTreeItemId",0},
     { "_unsigned_char","_byte",0},
+    { "_class_wxMetaFileDC","_wxMetaFileDC",0},
     { "_class_wxMenu","_wxMenu",0},
     { "_wxControl","_class_wxControl",0},
     { "_class_wxListBox","_wxListBox",0},
@@ -8775,6 +8778,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
     { "_class_wxPyApp","_wxPyApp",0},
     { "_wxSize","_class_wxSize",0},
     { "_wxRegionIterator","_class_wxRegionIterator",0},
+    { "_class_wxPrinterDC","_wxPrinterDC",0},
     { "_class_wxPyTextDataObject","_wxPyTextDataObject",0},
     { "_class_wxLogTextCtrl","_wxLogTextCtrl",0},
     { "_class_wxLogGui","_wxLogGui",0},
index 1df3cc74eecf15b7124bce65f55b838811c28aaf..43418c3833019757fbd3056232fac78226cca77b 100644 (file)
@@ -14,7 +14,7 @@
 %module oglbasic
 
 %{
-#include "helpers.h"
+#include "export.h"
 #include "oglhelpers.h"
 %}
 
index a296edeb6d914c8fa3a060a8ed320dff8158a9a4..1d655bced804fa56e191f79323e9db6964b397b0 100644 (file)
@@ -55,7 +55,7 @@ extern PyObject *SWIG_newvarlink(void);
 
 #define SWIG_name    "oglcanvasc"
 
-#include "helpers.h"
+#include "export.h"
 #include "oglhelpers.h"
 
 static PyObject* l_output_helper(PyObject* target, PyObject* o) {
@@ -1201,8 +1201,8 @@ static PyObject *_wrap_new_wxPyShapeCanvas(PyObject *self, PyObject *args, PyObj
     wxPyShapeCanvas * _result;
     wxWindow * _arg0 = (wxWindow *) NULL;
     wxWindowID  _arg1 = (wxWindowID ) -1;
-    wxPoint * _arg2 = (wxPoint *) &wxPyDefaultPosition;
-    wxSize * _arg3 = (wxSize *) &wxPyDefaultSize;
+    wxPoint * _arg2 = (wxPoint *) &wxDefaultPosition;
+    wxSize * _arg3 = (wxSize *) &wxDefaultSize;
     long  _arg4 = (long ) wxBORDER;
     PyObject * _argo0 = 0;
     wxPoint  temp;
@@ -2105,6 +2105,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
     { "_class_wxRealPoint","_wxRealPoint",0},
     { "_wxNavigationKeyEvent","_class_wxNavigationKeyEvent",0},
     { "_wxPNMHandler","_class_wxPNMHandler",0},
+    { "_wxPrinterDC","_class_wxPrinterDC",0},
     { "_wxWindowCreateEvent","_class_wxWindowCreateEvent",0},
     { "_wxLogGui","_class_wxLogGui",0},
     { "_class_wxPyShapeEvtHandler","_wxPyShapeEvtHandler",0},
@@ -2114,7 +2115,6 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
     { "_class_wxStatusBar","_wxStatusBar",0},
     { "_class_wxGIFHandler","_wxGIFHandler",0},
     { "_class_wxPySizer","_wxPySizer",0},
-    { "_class_wxPostScriptDC","_wxPostScriptDC",0},
     { "_wxPanel","_class_wxPyShapeCanvas",SwigwxPyShapeCanvasTowxPanel},
     { "_wxPanel","_wxPyShapeCanvas",SwigwxPyShapeCanvasTowxPanel},
     { "_wxPanel","_class_wxPanel",0},
@@ -2180,6 +2180,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
     { "_class_wxZipFSHandler","_wxZipFSHandler",0},
     { "_char","_wxChar",0},
     { "_wxBitmap","_class_wxBitmap",0},
+    { "_wxTaskBarIcon","_class_wxTaskBarIcon",0},
     { "_wxPrintDialog","_class_wxPrintDialog",0},
     { "_wxWindowDC","_class_wxWindowDC",0},
     { "_wxTimerEvent","_class_wxTimerEvent",0},
@@ -2267,6 +2268,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
     { "_class_wxTextCtrl","_wxTextCtrl",0},
     { "_class_wxListItemAttr","_wxListItemAttr",0},
     { "_wxLayoutConstraints","_class_wxLayoutConstraints",0},
+    { "_wxMetaFileDC","_class_wxMetaFileDC",0},
     { "_class_wxTextDataObject","_wxTextDataObject",0},
     { "_wxMenu","_class_wxMenu",0},
     { "_class_wxMoveEvent","_wxMoveEvent",0},
@@ -2319,6 +2321,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
     { "_signed_short","_short",0},
     { "_wxMemoryDC","_class_wxMemoryDC",0},
     { "_wxPyTextDataObject","_class_wxPyTextDataObject",0},
+    { "_class_wxTaskBarIcon","_wxTaskBarIcon",0},
     { "_class_wxPrintDialog","_wxPrintDialog",0},
     { "_wxPyFileSystemHandler","_class_wxPyFileSystemHandler",0},
     { "_wxPaintDC","_class_wxPaintDC",0},
@@ -2328,7 +2331,6 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
     { "_wxStatusBar","_class_wxStatusBar",0},
     { "_class_wxAcceleratorEntry","_wxAcceleratorEntry",0},
     { "_class_wxCursor","_wxCursor",0},
-    { "_wxPostScriptDC","_class_wxPostScriptDC",0},
     { "_wxPyFileDropTarget","_class_wxPyFileDropTarget",0},
     { "_class_wxPyProcess","_wxPyProcess",0},
     { "_class_wxImageHandler","_wxImageHandler",0},
@@ -2339,6 +2341,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
     { "_class_wxLog","_wxLog",0},
     { "_wxTreeItemId","_class_wxTreeItemId",0},
     { "_unsigned_char","_byte",0},
+    { "_class_wxMetaFileDC","_wxMetaFileDC",0},
     { "_class_wxMenu","_wxMenu",0},
     { "_wxControl","_class_wxControl",0},
     { "_class_wxListBox","_wxListBox",0},
@@ -2424,6 +2427,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
     { "_class_wxPyApp","_wxPyApp",0},
     { "_wxSize","_class_wxSize",0},
     { "_wxRegionIterator","_class_wxRegionIterator",0},
+    { "_class_wxPrinterDC","_wxPrinterDC",0},
     { "_class_wxPyTextDataObject","_wxPyTextDataObject",0},
     { "_class_wxLogTextCtrl","_wxLogTextCtrl",0},
     { "_class_wxLogGui","_wxLogGui",0},
index bf96d849c04b0b8d05cbb67e456b47ba41607320..88ed4a4345034989dfb2cf53b17f4341bcb6ee74 100644 (file)
@@ -14,7 +14,7 @@
 %module oglcanvas
 
 %{
-#include "helpers.h"
+#include "export.h"
 #include "oglhelpers.h"
 %}
 
@@ -112,8 +112,8 @@ public:
 class wxPyShapeCanvas : public wxScrolledWindow {
 public:
     wxPyShapeCanvas(wxWindow* parent = NULL, wxWindowID id = -1,
-                    const wxPoint& pos = wxPyDefaultPosition,
-                    const wxSize& size = wxPyDefaultSize,
+                    const wxPoint& pos = wxDefaultPosition,
+                    const wxSize& size = wxDefaultSize,
                     long style = wxBORDER);
 
     void _setSelf(PyObject* self, PyObject* _class);
diff --git a/wxPython/contrib/ogl/oglhelpers.cpp b/wxPython/contrib/ogl/oglhelpers.cpp
deleted file mode 100644 (file)
index ab21522..0000000
+++ /dev/null
@@ -1,103 +0,0 @@
-/////////////////////////////////////////////////////////////////////////////
-// Name:        oglhelpers.cpp
-// Purpose:     Some Helper functions to help in data conversions in OGL
-//
-// Author:      Robin Dunn
-//
-// Created:     3-Sept-1999
-// RCS-ID:      $Id$
-// Copyright:   (c) 1998 by Total Control Software
-// Licence:     wxWindows license
-/////////////////////////////////////////////////////////////////////////////
-
-#include <Python.h>
-#include "helpers.h"
-
-//---------------------------------------------------------------------------
-// This one will work for any class for the VERY generic cases, but beyond that
-// the helper needs to know more about the type.
-
-wxList* wxPy_wxListHelper(PyObject* pyList, char* className) {
-    bool doSave = wxPyRestoreThread();
-    if (!PyList_Check(pyList)) {
-        PyErr_SetString(PyExc_TypeError, "Expected a list object.");
-        wxPySaveThread(doSave);
-        return NULL;
-    }
-    int count = PyList_Size(pyList);
-    wxList* list = new wxList;
-    if (! list) {
-        PyErr_SetString(PyExc_MemoryError, "Unable to allocate wxList object");
-        wxPySaveThread(doSave);
-        return NULL;
-    }
-    for (int x=0; x<count; x++) {
-        PyObject* pyo = PyList_GetItem(pyList, x);
-        wxObject* wxo = NULL;
-
-        if (SWIG_GetPtrObj(pyo, (void **)&wxo, className)) {
-            char errmsg[1024];
-            sprintf(errmsg, "Type error, expected list of %s objects", className);
-            PyErr_SetString(PyExc_TypeError, errmsg);
-            wxPySaveThread(doSave);
-            return NULL;
-        }
-        list->Append(wxo);
-    }
-    wxPySaveThread(doSave);
-    return list;
-}
-
-//---------------------------------------------------------------------------
-
-wxList* wxPy_wxRealPoint_ListHelper(PyObject* pyList) {
-    bool doSave = wxPyRestoreThread();
-    if (!PyList_Check(pyList)) {
-        PyErr_SetString(PyExc_TypeError, "Expected a list object.");
-        wxPySaveThread(doSave);
-        return NULL;
-    }
-    int count = PyList_Size(pyList);
-    wxList* list = new wxList;
-    if (! list) {
-        PyErr_SetString(PyExc_MemoryError, "Unable to allocate wxList object");
-        wxPySaveThread(doSave);
-        return NULL;
-    }
-    for (int x=0; x<count; x++) {
-        PyObject* pyo = PyList_GetItem(pyList, x);
-
-        if (PyTuple_Check(pyo)) {
-            PyObject* o1 = PyNumber_Float(PyTuple_GetItem(pyo, 0));
-            PyObject* o2 = PyNumber_Float(PyTuple_GetItem(pyo, 1));
-
-            double val1 = (o1 ? PyFloat_AsDouble(o1) : 0.0);
-            double val2 = (o2 ? PyFloat_AsDouble(o2) : 0.0);
-
-            list->Append((wxObject*) new wxRealPoint(val1, val2));
-
-        } else {
-            wxRealPoint* wxo = NULL;
-            if (SWIG_GetPtrObj(pyo, (void **)&wxo, "_wxRealPoint_p")) {
-                PyErr_SetString(PyExc_TypeError, "Type error, expected list of wxRealPoint objects or 2-tuples");
-                wxPySaveThread(doSave);
-                return NULL;
-            }
-            list->Append((wxObject*) new wxRealPoint(*wxo));
-        }
-    }
-    wxPySaveThread(doSave);
-    return list;
-}
-
-
-//---------------------------------------------------------------------------
-
-
-
-
-
-
-
-
-
index 7c7be0f89af0d50d985c7d4d1c780816564f3449..2916429c2430266bc4a49170530b17cad6c3862e 100644 (file)
@@ -55,7 +55,7 @@ extern PyObject *SWIG_newvarlink(void);
 
 #define SWIG_name    "oglshapesc"
 
-#include "helpers.h"
+#include "export.h"
 #include "oglhelpers.h"
 
 static PyObject* l_output_helper(PyObject* target, PyObject* o) {
@@ -12661,6 +12661,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
     { "_class_wxRealPoint","_wxRealPoint",0},
     { "_wxNavigationKeyEvent","_class_wxNavigationKeyEvent",0},
     { "_wxPNMHandler","_class_wxPNMHandler",0},
+    { "_wxPrinterDC","_class_wxPrinterDC",0},
     { "_wxWindowCreateEvent","_class_wxWindowCreateEvent",0},
     { "_wxLogGui","_class_wxLogGui",0},
     { "_class_wxPyShapeEvtHandler","_class_wxPyDivisionShape",SwigwxPyDivisionShapeTowxPyShapeEvtHandler},
@@ -12687,7 +12688,6 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
     { "_class_wxPyCompositeShape","_class_wxPyDivisionShape",SwigwxPyDivisionShapeTowxPyCompositeShape},
     { "_class_wxPyCompositeShape","_wxPyDivisionShape",SwigwxPyDivisionShapeTowxPyCompositeShape},
     { "_class_wxPyCompositeShape","_wxPyCompositeShape",0},
-    { "_class_wxPostScriptDC","_wxPostScriptDC",0},
     { "_wxPanel","_class_wxPanel",0},
     { "_wxInitDialogEvent","_class_wxInitDialogEvent",0},
     { "_wxCheckBox","_class_wxCheckBox",0},
@@ -12752,6 +12752,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
     { "_class_wxZipFSHandler","_wxZipFSHandler",0},
     { "_char","_wxChar",0},
     { "_wxBitmap","_class_wxBitmap",0},
+    { "_wxTaskBarIcon","_class_wxTaskBarIcon",0},
     { "_wxPrintDialog","_class_wxPrintDialog",0},
     { "_wxPyControlPoint","_class_wxPyControlPoint",0},
     { "_wxWindowDC","_class_wxWindowDC",0},
@@ -12839,6 +12840,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
     { "_class_wxTextCtrl","_wxTextCtrl",0},
     { "_class_wxListItemAttr","_wxListItemAttr",0},
     { "_wxLayoutConstraints","_class_wxLayoutConstraints",0},
+    { "_wxMetaFileDC","_class_wxMetaFileDC",0},
     { "_class_wxTextDataObject","_wxTextDataObject",0},
     { "_wxMenu","_class_wxMenu",0},
     { "_class_wxMoveEvent","_wxMoveEvent",0},
@@ -12890,6 +12892,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
     { "_signed_short","_short",0},
     { "_wxMemoryDC","_class_wxMemoryDC",0},
     { "_wxPyTextDataObject","_class_wxPyTextDataObject",0},
+    { "_class_wxTaskBarIcon","_wxTaskBarIcon",0},
     { "_class_wxPrintDialog","_wxPrintDialog",0},
     { "_wxPyFileSystemHandler","_class_wxPyFileSystemHandler",0},
     { "_class_wxPyControlPoint","_wxPyControlPoint",0},
@@ -12900,7 +12903,6 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
     { "_wxStatusBar","_class_wxStatusBar",0},
     { "_class_wxAcceleratorEntry","_wxAcceleratorEntry",0},
     { "_class_wxCursor","_wxCursor",0},
-    { "_wxPostScriptDC","_class_wxPostScriptDC",0},
     { "_wxPyFileDropTarget","_class_wxPyFileDropTarget",0},
     { "_class_wxPyProcess","_wxPyProcess",0},
     { "_class_wxImageHandler","_wxImageHandler",0},
@@ -12923,6 +12925,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
     { "_class_wxLog","_wxLog",0},
     { "_wxTreeItemId","_class_wxTreeItemId",0},
     { "_unsigned_char","_byte",0},
+    { "_class_wxMetaFileDC","_wxMetaFileDC",0},
     { "_class_wxMenu","_wxMenu",0},
     { "_wxControl","_class_wxControl",0},
     { "_class_wxListBox","_wxListBox",0},
@@ -13009,6 +13012,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
     { "_class_wxPyApp","_wxPyApp",0},
     { "_wxSize","_class_wxSize",0},
     { "_wxRegionIterator","_class_wxRegionIterator",0},
+    { "_class_wxPrinterDC","_wxPrinterDC",0},
     { "_class_wxPyTextDataObject","_wxPyTextDataObject",0},
     { "_class_wxLogTextCtrl","_wxLogTextCtrl",0},
     { "_class_wxLogGui","_wxLogGui",0},
index 2b2f94e40f2497ed583db8d991cfe6e7a2237bab..6beaa08a41065f42a5b1e31a4e86e26d3d209dd7 100644 (file)
@@ -14,7 +14,7 @@
 %module oglshapes
 
 %{
-#include "helpers.h"
+#include "export.h"
 #include "oglhelpers.h"
 %}
 
index 08143318969ff48d766085bdeead33fb60b54dc8..474d070107e71a51fcc59a3cb602c68e918c6c89 100644 (file)
@@ -55,7 +55,7 @@ extern PyObject *SWIG_newvarlink(void);
 
 #define SWIG_name    "oglshapes2c"
 
-#include "helpers.h"
+#include "export.h"
 #include "oglhelpers.h"
 
 static PyObject* l_output_helper(PyObject* target, PyObject* o) {
@@ -8002,6 +8002,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
     { "_class_wxRealPoint","_wxRealPoint",0},
     { "_wxNavigationKeyEvent","_class_wxNavigationKeyEvent",0},
     { "_wxPNMHandler","_class_wxPNMHandler",0},
+    { "_wxPrinterDC","_class_wxPrinterDC",0},
     { "_wxWindowCreateEvent","_class_wxWindowCreateEvent",0},
     { "_wxLogGui","_class_wxLogGui",0},
     { "_class_wxPyShapeEvtHandler","_class_wxPyTextShape",SwigwxPyTextShapeTowxPyShapeEvtHandler},
@@ -8023,7 +8024,6 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
     { "_class_wxPySizer","_wxPySizer",0},
     { "_class_wxPyCompositeShape","_wxPyCompositeShape",0},
     { "_wxPyPolygonShape","_class_wxPyPolygonShape",0},
-    { "_class_wxPostScriptDC","_wxPostScriptDC",0},
     { "_wxPanel","_class_wxPanel",0},
     { "_wxInitDialogEvent","_class_wxInitDialogEvent",0},
     { "_wxCheckBox","_class_wxCheckBox",0},
@@ -8088,6 +8088,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
     { "_class_wxZipFSHandler","_wxZipFSHandler",0},
     { "_char","_wxChar",0},
     { "_wxBitmap","_class_wxBitmap",0},
+    { "_wxTaskBarIcon","_class_wxTaskBarIcon",0},
     { "_wxPrintDialog","_class_wxPrintDialog",0},
     { "_wxPyControlPoint","_class_wxPyControlPoint",0},
     { "_wxWindowDC","_class_wxWindowDC",0},
@@ -8178,6 +8179,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
     { "_class_wxTextCtrl","_wxTextCtrl",0},
     { "_class_wxListItemAttr","_wxListItemAttr",0},
     { "_wxLayoutConstraints","_class_wxLayoutConstraints",0},
+    { "_wxMetaFileDC","_class_wxMetaFileDC",0},
     { "_class_wxTextDataObject","_wxTextDataObject",0},
     { "_wxMenu","_class_wxMenu",0},
     { "_class_wxMoveEvent","_wxMoveEvent",0},
@@ -8231,6 +8233,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
     { "_signed_short","_short",0},
     { "_wxMemoryDC","_class_wxMemoryDC",0},
     { "_wxPyTextDataObject","_class_wxPyTextDataObject",0},
+    { "_class_wxTaskBarIcon","_wxTaskBarIcon",0},
     { "_class_wxPrintDialog","_wxPrintDialog",0},
     { "_wxPyFileSystemHandler","_class_wxPyFileSystemHandler",0},
     { "_class_wxPyControlPoint","_wxPyControlPoint",0},
@@ -8241,7 +8244,6 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
     { "_wxStatusBar","_class_wxStatusBar",0},
     { "_class_wxAcceleratorEntry","_wxAcceleratorEntry",0},
     { "_class_wxCursor","_wxCursor",0},
-    { "_wxPostScriptDC","_class_wxPostScriptDC",0},
     { "_wxPyFileDropTarget","_class_wxPyFileDropTarget",0},
     { "_class_wxPyProcess","_wxPyProcess",0},
     { "_class_wxImageHandler","_wxImageHandler",0},
@@ -8260,6 +8262,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
     { "_class_wxLog","_wxLog",0},
     { "_wxTreeItemId","_class_wxTreeItemId",0},
     { "_unsigned_char","_byte",0},
+    { "_class_wxMetaFileDC","_wxMetaFileDC",0},
     { "_class_wxMenu","_wxMenu",0},
     { "_wxControl","_class_wxControl",0},
     { "_class_wxListBox","_wxListBox",0},
@@ -8347,6 +8350,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
     { "_class_wxPyApp","_wxPyApp",0},
     { "_wxSize","_class_wxSize",0},
     { "_wxRegionIterator","_class_wxRegionIterator",0},
+    { "_class_wxPrinterDC","_wxPrinterDC",0},
     { "_class_wxPyTextDataObject","_wxPyTextDataObject",0},
     { "_class_wxLogTextCtrl","_wxLogTextCtrl",0},
     { "_class_wxLogGui","_wxLogGui",0},
index ef2a7189587cefe501006054f0aa9d4135f337ab..2b90a48590eac0575d2d47100908d8b19f80370a 100644 (file)
@@ -14,7 +14,7 @@
 %module oglshapes2
 
 %{
-#include "helpers.h"
+#include "export.h"
 #include "oglhelpers.h"
 %}
 
diff --git a/wxPython/contrib/ogl/stub.cpp b/wxPython/contrib/ogl/stub.cpp
deleted file mode 100644 (file)
index 45305e7..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-/* Definitions for Windows/Unix exporting */
-#if defined(__WIN32__)
-#   if defined(_MSC_VER)
-#      define SWIGEXPORT(a) __declspec(dllexport) a
-#   else
-#      if defined(__BORLANDC__)
-#          define SWIGEXPORT(a) a _export
-#      else
-#          define SWIGEXPORT(a) a
-#      endif
-#   endif
-#else
-#   define SWIGEXPORT(a) a
-#endif
-
-
-
-#ifdef __cplusplus
-extern "C"
-#endif
-SWIGEXPORT(void) initoglc() {
-}
-
-
index 010be449b485a2792008e5f18120cef6fa676d8b..f31e053805d2043dbb1f62088017ed9c59a4cb98 100644 (file)
@@ -55,7 +55,7 @@ extern PyObject *SWIG_newvarlink(void);
 
 #define SWIG_name    "stc_c"
 
-#include "helpers.h"
+#include "export.h"
 #include "wx/stc/stc.h"
 
 static PyObject* l_output_helper(PyObject* target, PyObject* o) {
@@ -8626,6 +8626,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
     { "_class_wxRealPoint","_wxRealPoint",0},
     { "_wxNavigationKeyEvent","_class_wxNavigationKeyEvent",0},
     { "_wxPNMHandler","_class_wxPNMHandler",0},
+    { "_wxPrinterDC","_class_wxPrinterDC",0},
     { "_wxWindowCreateEvent","_class_wxWindowCreateEvent",0},
     { "_wxLogGui","_class_wxLogGui",0},
     { "_class_wxMenuItem","_wxMenuItem",0},
@@ -8634,7 +8635,6 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
     { "_class_wxStatusBar","_wxStatusBar",0},
     { "_class_wxGIFHandler","_wxGIFHandler",0},
     { "_class_wxPySizer","_wxPySizer",0},
-    { "_class_wxPostScriptDC","_wxPostScriptDC",0},
     { "_wxPanel","_class_wxPanel",0},
     { "_wxInitDialogEvent","_class_wxInitDialogEvent",0},
     { "_wxCheckBox","_class_wxCheckBox",0},
@@ -8701,6 +8701,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
     { "_class_wxZipFSHandler","_wxZipFSHandler",0},
     { "_char","_wxChar",0},
     { "_wxBitmap","_class_wxBitmap",0},
+    { "_wxTaskBarIcon","_class_wxTaskBarIcon",0},
     { "_wxPrintDialog","_class_wxPrintDialog",0},
     { "_wxWindowDC","_class_wxWindowDC",0},
     { "_wxTimerEvent","_class_wxTimerEvent",0},
@@ -8784,6 +8785,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
     { "_class_wxTextCtrl","_wxTextCtrl",0},
     { "_class_wxListItemAttr","_wxListItemAttr",0},
     { "_wxLayoutConstraints","_class_wxLayoutConstraints",0},
+    { "_wxMetaFileDC","_class_wxMetaFileDC",0},
     { "_class_wxTextDataObject","_wxTextDataObject",0},
     { "_wxMenu","_class_wxMenu",0},
     { "_class_wxMoveEvent","_wxMoveEvent",0},
@@ -8837,6 +8839,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
     { "_signed_short","_short",0},
     { "_wxMemoryDC","_class_wxMemoryDC",0},
     { "_wxPyTextDataObject","_class_wxPyTextDataObject",0},
+    { "_class_wxTaskBarIcon","_wxTaskBarIcon",0},
     { "_class_wxPrintDialog","_wxPrintDialog",0},
     { "_wxPyFileSystemHandler","_class_wxPyFileSystemHandler",0},
     { "_wxPaintDC","_class_wxPaintDC",0},
@@ -8846,7 +8849,6 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
     { "_wxStatusBar","_class_wxStatusBar",0},
     { "_class_wxAcceleratorEntry","_wxAcceleratorEntry",0},
     { "_class_wxCursor","_wxCursor",0},
-    { "_wxPostScriptDC","_class_wxPostScriptDC",0},
     { "_wxPyFileDropTarget","_class_wxPyFileDropTarget",0},
     { "_class_wxPyProcess","_wxPyProcess",0},
     { "_class_wxImageHandler","_wxImageHandler",0},
@@ -8854,6 +8856,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
     { "_class_wxLog","_wxLog",0},
     { "_wxTreeItemId","_class_wxTreeItemId",0},
     { "_unsigned_char","_byte",0},
+    { "_class_wxMetaFileDC","_wxMetaFileDC",0},
     { "_class_wxMenu","_wxMenu",0},
     { "_wxControl","_class_wxStyledTextCtrl",SwigwxStyledTextCtrlTowxControl},
     { "_wxControl","_wxStyledTextCtrl",SwigwxStyledTextCtrlTowxControl},
@@ -8941,6 +8944,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
     { "_class_wxPyApp","_wxPyApp",0},
     { "_wxSize","_class_wxSize",0},
     { "_wxRegionIterator","_class_wxRegionIterator",0},
+    { "_class_wxPrinterDC","_wxPrinterDC",0},
     { "_class_wxPyTextDataObject","_wxPyTextDataObject",0},
     { "_class_wxLogTextCtrl","_wxLogTextCtrl",0},
     { "_class_wxLogGui","_wxLogGui",0},
@@ -9431,8 +9435,8 @@ SWIGEXPORT(void) initstc_c() {
         PyDict_SetItemString(d,"wxEVT_STC_POSCHANGED", PyInt_FromLong((long) wxEVT_STC_POSCHANGED));
 
 
-    wxClassInfo::CleanUpClasses();
-    wxClassInfo::InitializeClasses();
+//    wxClassInfo::CleanUpClasses();
+//    wxClassInfo::InitializeClasses();
 
 {
    int i;
index 53d586bb9cbc50498a3b787c226fb7bc2042fd12..62ce47e23df3b2ad6ae331064372593fecfc8577 100644 (file)
@@ -14,7 +14,7 @@
 
 
 %{
-#include "helpers.h"
+#include "export.h"
 #include "wx/stc/stc.h"
 %}
 
@@ -34,7 +34,6 @@
 // Get all our defs from the REAL header file.
 
 %include stc.h
-//%include SciLexer.h
 
 //----------------------------------------------------------------------
 // Python functions to act like the event macros
@@ -89,8 +88,8 @@ def EVT_STC_POSCHANGED(win, id, fn):
 
 %init %{
 
-    wxClassInfo::CleanUpClasses();
-    wxClassInfo::InitializeClasses();
+//    wxClassInfo::CleanUpClasses();
+//    wxClassInfo::InitializeClasses();
 
 %}
 
diff --git a/wxPython/contrib/stc/stub.cpp b/wxPython/contrib/stc/stub.cpp
deleted file mode 100644 (file)
index 4f696dc..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-/* Definitions for Windows/Unix exporting */
-#if defined(__WIN32__)
-#   if defined(_MSC_VER)
-#      define SWIGEXPORT(a) __declspec(dllexport) a
-#   else
-#      if defined(__BORLANDC__)
-#          define SWIGEXPORT(a) a _export
-#      else
-#          define SWIGEXPORT(a) a
-#      endif
-#   endif
-#else
-#   define SWIGEXPORT(a) a
-#endif
-
-
-#ifdef __cplusplus
-extern "C"
-#endif
-SWIGEXPORT(void) initstc_c() {
-}
-
-
index 46e5fa761e6697a790a42e8ec87909780070b5cc..d40a9f19885fba701007feae6743706eb2c5a4bd 100644 (file)
@@ -20,6 +20,8 @@ while line:
     line = line[:-1]
     sys.stdout.write('\nYou typed "%s"\n' % line)
     sys.stdout.flush()
+    #sys.stderr.write('\nTyped you "%s" Yoda say...\n' % line)
+    #sys.stderr.flush()
     line = sys.stdin.readline()
 
 
index 9d66065ff0c602013d9667ab78e08fdcedebea3e..a40ff6f66e2dd11b003306b8892833f8c238a89f 100644 (file)
@@ -115,97 +115,6 @@ class MyMSVCCompiler(MSVCCompiler):
 
 
 
-    ##------------------------------------------------------------
-    ## Now override the link() method to change where the import
-    ## library is placed.  Hopefully distutils will be updated
-    ## someday to make this configurable...
-    ##------------------------------------------------------------
-
-    def link (self,
-              target_desc,
-              objects,
-              output_filename,
-              output_dir=None,
-              libraries=None,
-              library_dirs=None,
-              runtime_library_dirs=None,
-              export_symbols=None,
-              debug=0,
-              extra_preargs=None,
-              extra_postargs=None,
-              build_temp=None):
-
-        (objects, output_dir) = self._fix_object_args (objects, output_dir)
-        (libraries, library_dirs, runtime_library_dirs) = \
-            self._fix_lib_args (libraries, library_dirs, runtime_library_dirs)
-
-        if runtime_library_dirs:
-            self.warn ("I don't know what to do with 'runtime_library_dirs': "
-                       + str (runtime_library_dirs))
-
-        lib_opts = gen_lib_options (self,
-                                    library_dirs, runtime_library_dirs,
-                                    libraries)
-        if output_dir is not None:
-            output_filename = os.path.join (output_dir, output_filename)
-
-        if self._need_link (objects, output_filename):
-
-            if target_desc == CCompiler.EXECUTABLE:
-                if debug:
-                    ldflags = self.ldflags_shared_debug[1:]
-                else:
-                    ldflags = self.ldflags_shared[1:]
-            else:
-                if debug:
-                    ldflags = self.ldflags_shared_debug
-                else:
-                    ldflags = self.ldflags_shared
-
-            export_opts = []
-            for sym in (export_symbols or []):
-                export_opts.append("/EXPORT:" + sym)
-
-            ld_args = (ldflags + lib_opts + export_opts +
-                       objects + ['/OUT:' + output_filename])
-
-            # The MSVC linker generates .lib and .exp files, which cannot be
-            # suppressed by any linker switches. The .lib files may even be
-            # needed! Make sure they are generated in the temporary build
-            # directory. Since they have different names for debug and release
-            # builds, they can go into the same directory.
-            if export_symbols is not None:
-                (dll_name, dll_ext) = os.path.splitext(
-                    os.path.basename(output_filename))
-
-                ## The old code
-                ##implib_file = os.path.join(
-                ##    os.path.dirname(objects[0]),
-                ##    self.library_filename(dll_name))
-
-                ## The new
-                implib_file = os.path.join('build', 'ilib',
-                                           self.library_filename(dll_name))
-                self.mkpath(os.path.dirname(implib_file))
-
-                ld_args.append ('/IMPLIB:' + implib_file)
-
-            if extra_preargs:
-                ld_args[:0] = extra_preargs
-            if extra_postargs:
-                ld_args.extend(extra_postargs)
-
-            self.mkpath (os.path.dirname (output_filename))
-            try:
-                self.spawn ([self.linker] + ld_args)
-            except DistutilsExecError, msg:
-                raise LinkError, msg
-
-        else:
-            self.announce ("skipping %s (up-to-date)" % output_filename)
-
-    # link ()
-
 
 
 #----------------------------------------------------------------------
index f440d5e3d345f25f477a041c5b621f8a56dce085..64f8b2496906564fd772f6f3db61515346d8a216 100755 (executable)
@@ -13,7 +13,7 @@ from my_distutils import run_swig, contrib_copy_tree
 # flags and values that affect this script
 #----------------------------------------------------------------------
 
-VERSION          = "2.3b1"
+VERSION          = "2.3b2"
 DESCRIPTION      = "Cross platform GUI toolkit for Python"
 AUTHOR           = "Robin Dunn"
 AUTHOR_EMAIL     = "robin@alldunn.com"
@@ -102,8 +102,6 @@ if os.name == 'nt':
     WXPLAT = '__WXMSW__'
     GENDIR = 'msw'
 
-
-
     if debug:
         FINAL  = 0
         HYBRID = 0
@@ -111,7 +109,6 @@ if os.name == 'nt':
     if HYBRID:
         FINAL = 0
 
-
     includes = ['src',
                 os.path.join(WXDIR, 'include'),
                 ]
@@ -144,14 +141,13 @@ if os.name == 'nt':
     else:
         wxdll = 'wx' + WXDLLVER + 'd'
 
-    #print 'Linking with ', wxdll
 
     libs = [wxdll, 'kernel32', 'user32', 'gdi32', 'comdlg32',
             'winspool', 'winmm', 'shell32', 'oldnames', 'comctl32',
             'ctl3d32', 'odbc32', 'ole32', 'oleaut32', 'uuid', 'rpcrt4',
             'advapi32', 'wsock32']
 
-    cflags = ['/GX-']  # workaround for internal compiler error in MSVC
+    cflags = ['/GX-']  # workaround for internal compiler error in MSVC 5
     lflags = None
 
     if not FINAL and HYBRID:
@@ -204,10 +200,11 @@ swig_args = ['-c++', '-shadow', '-python', '-keyword', '-dnone', #'-dascii',
 swig_deps = ['src/my_typemaps.i']
 
 swig_files = [ 'wx.i', 'windows.i', 'windows2.i', 'windows3.i', 'events.i',
-               'misc.i', 'misc2.i', 'utils.i', 'gdi.i', 'mdi.i', 'controls.i',
+               'misc.i', 'misc2.i', 'gdi.i', 'mdi.i', 'controls.i',
                'controls2.i', 'cmndlgs.i', 'stattool.i', 'frames.i', 'image.i',
-               'printfw.i', 'sizers.i', 'clip_dnd.i', 'grid.i', 'html.i',
-               'htmlhelp.i', 'calendar.i', 'filesys.i', 'streams.i'
+               'printfw.i', 'sizers.i', 'clip_dnd.i',
+               'filesys.i', 'streams.i',
+#               'grid.i', 'html.i', 'htmlhelp.i', 'calendar.i', 'utils.i',
                ]
 
 swig_sources = run_swig(swig_files, 'src', GENDIR, PKGDIR,
@@ -229,7 +226,7 @@ else:
     rc_file = []
 
 
-wxext = ext = Extension('wxc', ['src/helpers.cpp',
+ext = Extension('wxc', ['src/helpers.cpp',
                         'src/libpy.c',
                         ] + rc_file + swig_sources,
 
@@ -242,30 +239,76 @@ wxext = ext = Extension('wxc', ['src/helpers.cpp',
                 extra_compile_args = cflags,
                 extra_link_args = lflags,
                 )
+wxpExtensions.append(ext)
 
 
+# Extension for the grid module
+swig_sources = run_swig(['grid.i'], 'src', GENDIR, PKGDIR,
+                        USE_SWIG, swig_force, swig_args, swig_deps)
+ext = Extension('gridc', swig_sources,
+                include_dirs =  includes,
+                define_macros = defines,
+                library_dirs = libdirs,
+                libraries = libs,
+                extra_compile_args = cflags,
+                extra_link_args = lflags,
+                )
+wxpExtensions.append(ext)
+
+
+# Extension for the html modules
+swig_sources = run_swig(['html.i', 'htmlhelp.i'], 'src', GENDIR, PKGDIR,
+                        USE_SWIG, swig_force, swig_args, swig_deps)
+ext = Extension('htmlc', swig_sources,
+                include_dirs =  includes,
+                define_macros = defines,
+                library_dirs = libdirs,
+                libraries = libs,
+                extra_compile_args = cflags,
+                extra_link_args = lflags,
+                )
+wxpExtensions.append(ext)
+
+
+# Extension for the utils module
+swig_sources = run_swig(['utils.i'], 'src', GENDIR, PKGDIR,
+                        USE_SWIG, swig_force, swig_args, swig_deps)
+ext = Extension('utilsc', swig_sources,
+                include_dirs =  includes,
+                define_macros = defines,
+                library_dirs = libdirs,
+                libraries = libs,
+                extra_compile_args = cflags,
+                extra_link_args = lflags,
+                )
+wxpExtensions.append(ext)
+
+
+# Extension for the calendar module
+swig_sources = run_swig(['calendar.i'], 'src', GENDIR, PKGDIR,
+                        USE_SWIG, swig_force, swig_args, swig_deps)
+ext = Extension('calendarc', swig_sources,
+                include_dirs =  includes,
+                define_macros = defines,
+                library_dirs = libdirs,
+                libraries = libs,
+                extra_compile_args = cflags,
+                extra_link_args = lflags,
+                )
 wxpExtensions.append(ext)
 
-if os.name == 'nt':
-    libs = libs[:]
-    if debug:
-        libs.insert(0, 'wxc_d')
-    else:
-        libs.insert(0, 'wxc')
 
 #----------------------------------------------------------------------
 # Define the GLCanvas extension module
 #----------------------------------------------------------------------
 
-if not BUILD_GLCANVAS:
-    wxext.sources = wxext.sources + ['contrib/glcanvas/stub.cpp']
-else:
+if BUILD_GLCANVAS:
     print 'Preparing GLCANVAS...'
     location = 'contrib/glcanvas'
     swig_files = ['glcanvas.i']
 
     swig_sources = run_swig(swig_files, location, GENDIR, PKGDIR,
-                            USE_SWIG, swig_force, swig_args, swig_deps)
+                            USE_SWIG, swig_force, swig_args)
 
     gl_libs = []
     if os.name == 'posix':
@@ -274,8 +317,20 @@ else:
         else:
             gl_libs = ['wx_gtk_gl', 'GL', 'GLU']
 
-    wxext.sources = wxext.sources + swig_sources
-    wxext.libraries = wxext.libraries + gl_libs
+    ext = Extension('glcanvasc',
+                    swig_sources,
+
+                    include_dirs = includes,
+                    define_macros = defines,
+
+                    library_dirs = libdirs,
+                    libraries = libs + gl_libs,
+
+                    extra_compile_args = cflags,
+                    extra_link_args = lflags,
+                    )
+
+    wxpExtensions.append(ext)
 
 
 #----------------------------------------------------------------------
@@ -283,9 +338,7 @@ else:
 #----------------------------------------------------------------------
 
 
-if not BUILD_OGL:
-    wxext.sources = wxext.sources + ['contrib/ogl/stub.cpp']
-else:
+if BUILD_OGL:
     print 'Preparing OGL...'
     location = 'contrib/ogl'
     OGLLOC = location + '/contrib/src/ogl'
@@ -295,39 +348,46 @@ else:
                   'oglcanvas.i']
 
     swig_sources = run_swig(swig_files, location, '', PKGDIR,
-                            USE_SWIG, swig_force, swig_args, swig_deps)
+                            USE_SWIG, swig_force, swig_args)
 
     # make sure local copy of contrib files are up to date
     if IN_CVS_TREE:
         contrib_copy_tree(WXDIR + '/contrib/include/wx/ogl', OGLINC+'/wx/ogl')
         contrib_copy_tree(WXDIR + '/contrib/src/ogl', OGLLOC)
 
-    # add items to the core extension module definition
-    wxext.sources = wxext.sources + [location + '/oglhelpers.cpp',
-                                     '%s/basic.cpp' % OGLLOC,
-                                     '%s/bmpshape.cpp' % OGLLOC,
-                                     '%s/composit.cpp' % OGLLOC,
-                                     '%s/divided.cpp' % OGLLOC,
-                                     '%s/lines.cpp' % OGLLOC,
-                                     '%s/misc.cpp' % OGLLOC,
-                                     '%s/basic2.cpp' % OGLLOC,
-                                     '%s/canvas.cpp' % OGLLOC,
-                                     '%s/constrnt.cpp' % OGLLOC,
-                                     '%s/drawn.cpp' % OGLLOC,
-                                     '%s/mfutils.cpp' % OGLLOC,
-                                     '%s/ogldiag.cpp' % OGLLOC,
-                                     ] + swig_sources
-
-    wxext.include_dirs = wxext.include_dirs + [OGLINC]
+    ext = Extension('oglc', ['%s/basic.cpp' % OGLLOC,
+                             '%s/bmpshape.cpp' % OGLLOC,
+                             '%s/composit.cpp' % OGLLOC,
+                             '%s/divided.cpp' % OGLLOC,
+                             '%s/lines.cpp' % OGLLOC,
+                             '%s/misc.cpp' % OGLLOC,
+                             '%s/basic2.cpp' % OGLLOC,
+                             '%s/canvas.cpp' % OGLLOC,
+                             '%s/constrnt.cpp' % OGLLOC,
+                             '%s/drawn.cpp' % OGLLOC,
+                             '%s/mfutils.cpp' % OGLLOC,
+                             '%s/ogldiag.cpp' % OGLLOC,
+                             ] + swig_sources,
+
+                    include_dirs =  [OGLINC] + includes,
+                    define_macros = defines,
+
+                    library_dirs = libdirs,
+                    libraries = libs,
+
+                    extra_compile_args = cflags,
+                    extra_link_args = lflags,
+                    )
+
+    wxpExtensions.append(ext)
+
+
 
 #----------------------------------------------------------------------
 # Define the STC extension module
 #----------------------------------------------------------------------
 
-
-if not BUILD_STC:
-    wxext.sources = wxext.sources + ['contrib/stc/stub.cpp']
-else:
+if BUILD_STC:
     print 'Preparing STC...'
     location = 'contrib/stc'
     STCLOC = location + '/contrib/src/stc'
@@ -344,24 +404,25 @@ else:
     swig_sources = run_swig(swig_files, location, '', PKGDIR,
                             USE_SWIG, swig_force,
                             swig_args + ['-I'+STC_H, '-I'+location],
-                            swig_deps + [STC_H+'/stc.h'])
+                            [STC_H+'/stc.h'])
 
     # copy a project specific py module to the main package dir
     copy_file(location+'/stc.py', PKGDIR, update=1, verbose=1)
 
     # add some include dirs to the standard set
-    stc_includes = [ '%s/scintilla/include' % STCLOC,
-                     '%s/scintilla/src' % STCLOC,
-                     STCINC ]
+    stc_includes = includes[:]
+    stc_includes.append('%s/scintilla/include' % STCLOC)
+    stc_includes.append('%s/scintilla/src' % STCLOC)
+    stc_includes.append(STCINC)
 
     # and some macro definitions
-    stc_defines = [ ('__WX__', None),
-                    ('SCI_LEXER', None) ]
+    stc_defines = defines[:]
+    stc_defines.append( ('__WX__', None) )
+    stc_defines.append( ('SCI_LEXER', None) )
 
 
-    # add items to the core extension module definition
-    wxext.sources = wxext.sources +  [
-                     '%s/scintilla/src/AutoComplete.cxx' % STCLOC,
+    ext = Extension('stc_c',
+                    ['%s/scintilla/src/AutoComplete.cxx' % STCLOC,
                      '%s/scintilla/src/CallTip.cxx' % STCLOC,
                      '%s/scintilla/src/CellBuffer.cxx' % STCLOC,
                      '%s/scintilla/src/ContractionState.cxx' % STCLOC,
@@ -391,10 +452,19 @@ else:
                      '%s/PlatWX.cpp' % STCLOC,
                      '%s/ScintillaWX.cpp' % STCLOC,
                      '%s/stc.cpp' % STCLOC,
-                     ] + swig_sources
+                     ] + swig_sources,
+
+                    include_dirs = stc_includes,
+                    define_macros = stc_defines,
+
+                    library_dirs = libdirs,
+                    libraries = libs,
 
-    wxext.include_dirs = wxext.include_dirs + stc_includes
-    wxext.define_macros = wxext.define_macros + stc_defines
+                    extra_compile_args = cflags,
+                    extra_link_args = lflags,
+                    )
+
+    wxpExtensions.append(ext)
 
 
 
@@ -461,20 +531,15 @@ setup(name             = PKGDIR,
 #----------------------------------------------------------------------
 #----------------------------------------------------------------------
 #----------------------------------------------------------------------
-
-# Originally I was building separate extension module .so's for the
-# CORE and the various contribs.  Because of shared library issues I've
-# decided to combine things into one .so as implemented above, but as
-# I'm still not entirely convinced that this is the right thing to do
-# I will keep the old code around for a while, but commented out below.
-
-## if BUILD_GLCANVAS:
+## if not BUILD_GLCANVAS:
+##     wxext.sources = wxext.sources + ['contrib/glcanvas/stub.cpp']
+## else:
 ##     print 'Preparing GLCANVAS...'
 ##     location = 'contrib/glcanvas'
 ##     swig_files = ['glcanvas.i']
 
 ##     swig_sources = run_swig(swig_files, location, GENDIR, PKGDIR,
-##                             USE_SWIG, swig_force, swig_args)
+##                             USE_SWIG, swig_force, swig_args, swig_deps)
 
 ##     gl_libs = []
 ##     if os.name == 'posix':
@@ -483,24 +548,13 @@ setup(name             = PKGDIR,
 ##         else:
 ##             gl_libs = ['wx_gtk_gl', 'GL', 'GLU']
 
-##     ext = Extension('glcanvasc',
-##                     swig_sources,
-
-##                     include_dirs = includes,
-##                     define_macros = defines,
-
-##                     library_dirs = libdirs,
-##                     libraries = libs + gl_libs,
-
-##                     extra_compile_args = cflags,
-##                     extra_link_args = lflags,
-##                     )
+##     wxext.sources = wxext.sources + swig_sources
+##     wxext.libraries = wxext.libraries + gl_libs
 
-##     wxpExtensions.append(ext)
 
-
-
-## if BUILD_OGL:
+## if not BUILD_OGL:
+##     wxext.sources = wxext.sources + ['contrib/ogl/stub.cpp']
+## else:
 ##     print 'Preparing OGL...'
 ##     location = 'contrib/ogl'
 ##     OGLLOC = location + '/contrib/src/ogl'
@@ -510,43 +564,37 @@ setup(name             = PKGDIR,
 ##                   'oglcanvas.i']
 
 ##     swig_sources = run_swig(swig_files, location, '', PKGDIR,
-##                             USE_SWIG, swig_force, swig_args)
+##                             USE_SWIG, swig_force, swig_args, swig_deps)
 
 ##     # make sure local copy of contrib files are up to date
 ##     if IN_CVS_TREE:
 ##         contrib_copy_tree(WXDIR + '/contrib/include/wx/ogl', OGLINC+'/wx/ogl')
 ##         contrib_copy_tree(WXDIR + '/contrib/src/ogl', OGLLOC)
 
-##     ext = Extension('oglc', [location + '/oglhelpers.cpp',
-##                              '%s/basic.cpp' % OGLLOC,
-##                              '%s/bmpshape.cpp' % OGLLOC,
-##                              '%s/composit.cpp' % OGLLOC,
-##                              '%s/divided.cpp' % OGLLOC,
-##                              '%s/lines.cpp' % OGLLOC,
-##                              '%s/misc.cpp' % OGLLOC,
-##                              '%s/basic2.cpp' % OGLLOC,
-##                              '%s/canvas.cpp' % OGLLOC,
-##                              '%s/constrnt.cpp' % OGLLOC,
-##                              '%s/drawn.cpp' % OGLLOC,
-##                              '%s/mfutils.cpp' % OGLLOC,
-##                              '%s/ogldiag.cpp' % OGLLOC,
-##                              ] + swig_sources,
-
-##                     include_dirs =  [OGLINC] + includes,
-##                     define_macros = defines,
+##     # add items to the core extension module definition
+##     wxext.sources = wxext.sources + [location + '/oglhelpers.cpp',
+##                                      '%s/basic.cpp' % OGLLOC,
+##                                      '%s/bmpshape.cpp' % OGLLOC,
+##                                      '%s/composit.cpp' % OGLLOC,
+##                                      '%s/divided.cpp' % OGLLOC,
+##                                      '%s/lines.cpp' % OGLLOC,
+##                                      '%s/misc.cpp' % OGLLOC,
+##                                      '%s/basic2.cpp' % OGLLOC,
+##                                      '%s/canvas.cpp' % OGLLOC,
+##                                      '%s/constrnt.cpp' % OGLLOC,
+##                                      '%s/drawn.cpp' % OGLLOC,
+##                                      '%s/mfutils.cpp' % OGLLOC,
+##                                      '%s/ogldiag.cpp' % OGLLOC,
+##                                      ] + swig_sources
 
-##                     library_dirs = libdirs,
-##                     libraries = libs,
+##     wxext.include_dirs = wxext.include_dirs + [OGLINC]
 
-##                     extra_compile_args = cflags,
-##                     extra_link_args = lflags,
-##                     )
 
-##     wxpExtensions.append(ext)
 
 
-
-## if BUILD_STC:
+## if not BUILD_STC:
+##     wxext.sources = wxext.sources + ['contrib/stc/stub.cpp']
+## else:
 ##     print 'Preparing STC...'
 ##     location = 'contrib/stc'
 ##     STCLOC = location + '/contrib/src/stc'
@@ -563,25 +611,24 @@ setup(name             = PKGDIR,
 ##     swig_sources = run_swig(swig_files, location, '', PKGDIR,
 ##                             USE_SWIG, swig_force,
 ##                             swig_args + ['-I'+STC_H, '-I'+location],
-##                             [STC_H+'/stc.h'])
+##                             swig_deps + [STC_H+'/stc.h'])
 
 ##     # copy a project specific py module to the main package dir
 ##     copy_file(location+'/stc.py', PKGDIR, update=1, verbose=1)
 
 ##     # add some include dirs to the standard set
-##     stc_includes = includes[:]
-##     stc_includes.append('%s/scintilla/include' % STCLOC)
-##     stc_includes.append('%s/scintilla/src' % STCLOC)
-##     stc_includes.append(STCINC)
+##     stc_includes = [ '%s/scintilla/include' % STCLOC,
+##                      '%s/scintilla/src' % STCLOC,
+##                      STCINC ]
 
 ##     # and some macro definitions
-##     stc_defines = defines[:]
-##     stc_defines.append( ('__WX__', None) )
-##     stc_defines.append( ('SCI_LEXER', None) )
+##     stc_defines = [ ('__WX__', None),
+##                     ('SCI_LEXER', None) ]
 
 
-##     ext = Extension('stc_c',
-##                     ['%s/scintilla/src/AutoComplete.cxx' % STCLOC,
+##     # add items to the core extension module definition
+##     wxext.sources = wxext.sources +  [
+##                      '%s/scintilla/src/AutoComplete.cxx' % STCLOC,
 ##                      '%s/scintilla/src/CallTip.cxx' % STCLOC,
 ##                      '%s/scintilla/src/CellBuffer.cxx' % STCLOC,
 ##                      '%s/scintilla/src/ContractionState.cxx' % STCLOC,
@@ -611,18 +658,7 @@ setup(name             = PKGDIR,
 ##                      '%s/PlatWX.cpp' % STCLOC,
 ##                      '%s/ScintillaWX.cpp' % STCLOC,
 ##                      '%s/stc.cpp' % STCLOC,
-##                      ] + swig_sources,
-
-##                     include_dirs = stc_includes,
-##                     define_macros = stc_defines,
-
-##                     library_dirs = libdirs,
-##                     libraries = libs,
-
-##                     extra_compile_args = cflags,
-##                     extra_link_args = lflags,
-##                     )
-
-##     wxpExtensions.append(ext)
-
+##                      ] + swig_sources
 
+##     wxext.include_dirs = wxext.include_dirs + stc_includes
+##     wxext.define_macros = wxext.define_macros + stc_defines
index d814eaf09c2028e58c68ce530932a88e5029074f..d1b8c358b265c7bb547e3fdc2d4e0a4bad06ab69 100644 (file)
@@ -1 +1 @@
-ver = '2.3b1'
+ver = '2.3b2'
index 73fc6bd66a1f35420eb597d4b4a4e22d7189be86..120e372b07ffcecd844aec2e46833cbd3f44b4e6 100644 (file)
@@ -14,7 +14,7 @@
 
 
 %{
-#include "helpers.h"
+#include "export.h"
 #include <wx/calctrl.h>
 %}
 
diff --git a/wxPython/src/export.h b/wxPython/src/export.h
new file mode 100644 (file)
index 0000000..e674a8a
--- /dev/null
@@ -0,0 +1,66 @@
+////////////////////////////////////////////////////////////////////////////
+// Name:        export.h
+// Purpose:     To be used from modules that are not part of the core
+//              wxPython extension in order to get access to some helper
+//              functions that live in wxc.
+//
+// Author:      Robin Dunn
+//
+// Created:     14-Dec-2000
+// RCS-ID:      $Id$
+// Copyright:   (c) 2000 by Total Control Software
+// Licence:     wxWindows license
+/////////////////////////////////////////////////////////////////////////////
+
+#ifndef __wxp_export__
+#define __wxp_export__
+
+//----------------------------------------------------------------------
+
+#define wxPyUSE_EXPORT
+#include "helpers.h"
+
+
+#define wxPyCoreAPI_IMPORT()     \
+    wxPyCoreAPIPtr = (wxPyCoreAPI*)PyCObject_Import("wxPython.wxc", "wxPyCoreAPI")
+
+
+#define SWIG_MakePtr(a, b, c)           (wxPyCoreAPIPtr->p_SWIG_MakePtr(a, b, c))
+#define SWIG_GetPtr(a, b, c)            (wxPyCoreAPIPtr->p_SWIG_GetPtr(a, b, c))
+#define SWIG_GetPtrObj(a, b, c)         (wxPyCoreAPIPtr->p_SWIG_GetPtrObj(a, b, c))
+#define SWIG_RegisterMapping(a, b, c)   (wxPyCoreAPIPtr->p_SWIG_RegisterMapping(a, b, c))
+#define SWIG_addvarlink(a, b, c, d)     (wxPyCoreAPIPtr->p_SWIG_addvarlink(a, b, c, d))
+
+#define wxPyRestoreThread()             (wxPyCoreAPIPtr->p_wxPyRestoreThread())
+#define wxPySaveThread(a)               (wxPyCoreAPIPtr->p_wxPySaveThread(a))
+#define wxPyConstructObject(a,b,c)      (wxPyCoreAPIPtr->p_wxPyConstructObject(a,b,c))
+#define wxPy_ConvertList(a,b)           (wxPyCoreAPIPtr->p_wxPy_ConvertList(a,b))
+#define byte_LIST_helper(a)             (wxPyCoreAPIPtr->p_byte_LIST_helper(a))
+#define int_LIST_helper(a)              (wxPyCoreAPIPtr->p_int_LIST_helper(a))
+#define long_LIST_helper(a)             (wxPyCoreAPIPtr->p_long_LIST_helper(a))
+#define string_LIST_helper(a)           (wxPyCoreAPIPtr->p_string_LIST_helper(a))
+#define wxPoint_LIST_helper(a)          (wxPyCoreAPIPtr->p_wxPoint_LIST_helper(a))
+#define wxBitmap_LIST_helper(a)         (wxPyCoreAPIPtr->p_wxBitmap_LIST_helper(a))
+#define wxString_LIST_helper(a)         (wxPyCoreAPIPtr->p_wxString_LIST_helper(a))
+#define wxAcceleratorEntry_LIST_helper(a) (wxPyCoreAPIPtr->p_wxAcceleratorEntry_LIST_helper(a))
+
+#define wxSize_helper(a,b)              (wxPyCoreAPIPtr->p_wxSize_helper(a,b))
+#define wxPoint_helper(a,b)             (wxPyCoreAPIPtr->p_wxPoint_helper(a,b))
+#define wxRealPoint_helper(a,b)         (wxPyCoreAPIPtr->p_wxRealPoint_helper(a,b))
+#define wxRect_helper(a,b)              (wxPyCoreAPIPtr->p_wxRect_helper(a,b))
+#define wxColour_helper(a,b)            (wxPyCoreAPIPtr->p_wxColour_helper(a,b))
+
+#define wxPyCBH_setSelf(a, b, c, d)     (wxPyCoreAPIPtr->p_wxPyCBH_setSelf(a,b,c,d))
+#define wxPyCBH_findCallback(a, b)      (wxPyCoreAPIPtr->p_wxPyCBH_findCallback(a, b))
+#define wxPyCBH_callCallback(a, b)      (wxPyCoreAPIPtr->p_wxPyCBH_callCallback(a, b))
+#define wxPyCBH_callCallbackObj(a, b)   (wxPyCoreAPIPtr->p_wxPyCBH_callCallbackObj(a, b))
+#define wxPyCBH_delete(a)               (wxPyCoreAPIPtr->p_wxPyCBH_delete(a))
+
+
+// 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())
+
+
+//----------------------------------------------------------------------
+#endif
index 5e0971123d82239465512a21ee0f8140aa07f9da..31c6c7338781cd73fd011466ebbf5c8433723afd 100644 (file)
@@ -15,7 +15,7 @@
 #ifndef OLD_GRID
 
 %{
-#include "helpers.h"
+#include "export.h"
 #include <wx/grid.h>
 %}
 
     wxGridCellAttr* CBNAME(int a, int b) {                              \
         wxGridCellAttr* rval = NULL;                                    \
         bool doSave = wxPyRestoreThread();                              \
-        if (m_myInst.findCallback(#CBNAME)) {                           \
+        if (wxPyCBH_findCallback(m_myInst, #CBNAME)) {                           \
             PyObject* ro;                                               \
             wxGridCellAttr* ptr;                                        \
-            ro = m_myInst.callCallbackObj(Py_BuildValue("(ii)", a, b)); \
+            ro = wxPyCBH_callCallbackObj(m_myInst, Py_BuildValue("(ii)", a, b)); \
             if (ro) {                                                   \
                 if (!SWIG_GetPtrObj(ro, (void **)&ptr, "_wxGridCellAttr_p"))    \
                     rval = ptr;                                         \
@@ -71,9 +71,9 @@
 #define PYCALLBACK__GCAINTINT(PCLASS, CBNAME)                           \
     void CBNAME(wxGridCellAttr *attr, int a, int b) {                   \
         bool doSave = wxPyRestoreThread();                              \
-        if (m_myInst.findCallback(#CBNAME)) {                           \
-            PyObject* obj = wxPyConstructObject((void*)attr, "wxGridCellAttr");\
-            m_myInst.callCallback(Py_BuildValue("(Oii)", obj, a, b));   \
+        if (wxPyCBH_findCallback(m_myInst, #CBNAME)) {                           \
+            PyObject* obj = wxPyConstructObject((void*)attr, "wxGridCellAttr", 0);\
+            wxPyCBH_callCallback(m_myInst, Py_BuildValue("(Oii)", obj, a, b));   \
             Py_DECREF(obj);                                             \
         }                                                               \
         else                                                            \
@@ -89,9 +89,9 @@
 #define PYCALLBACK__GCAINT(PCLASS, CBNAME)                              \
     void CBNAME(wxGridCellAttr *attr, int val) {                        \
         bool doSave = wxPyRestoreThread();                              \
-        if (m_myInst.findCallback(#CBNAME)) {                           \
-            PyObject* obj = wxPyConstructObject((void*)attr, "wxGridCellAttr");\
-            m_myInst.callCallback(Py_BuildValue("(Oi)", obj, val));     \
+        if (wxPyCBH_findCallback(m_myInst, #CBNAME)) {                           \
+            PyObject* obj = wxPyConstructObject((void*)attr, "wxGridCellAttr", 0);\
+            wxPyCBH_callCallback(m_myInst, Py_BuildValue("(Oi)", obj, val));     \
             Py_DECREF(obj);                                             \
         }                                                               \
         else                                                            \
     int  CBNAME() {                                                     \
         bool doSave = wxPyRestoreThread();                              \
         int rval = 0;                                                   \
-        if (m_myInst.findCallback(#CBNAME))                             \
-            rval = m_myInst.callCallback(Py_BuildValue("()"));          \
+        if (wxPyCBH_findCallback(m_myInst, #CBNAME))                             \
+            rval = wxPyCBH_callCallback(m_myInst, Py_BuildValue("()"));          \
         wxPySaveThread(doSave);                                         \
         return rval;                                                    \
     }
     bool CBNAME(int a, int b) {                                         \
         bool doSave = wxPyRestoreThread();                              \
         bool rval = 0;                                                  \
-        if (m_myInst.findCallback(#CBNAME))                             \
-            rval = m_myInst.callCallback(Py_BuildValue("(ii)",a,b));    \
+        if (wxPyCBH_findCallback(m_myInst, #CBNAME))                             \
+            rval = wxPyCBH_callCallback(m_myInst, Py_BuildValue("(ii)",a,b));    \
         wxPySaveThread(doSave);                                         \
         return rval;                                                    \
     }
     wxString CBNAME(int a, int b) {                                     \
         bool doSave = wxPyRestoreThread();                              \
         wxString rval;                                                  \
-        if (m_myInst.findCallback(#CBNAME)) {                           \
+        if (wxPyCBH_findCallback(m_myInst, #CBNAME)) {                           \
             PyObject* ro;                                               \
-            ro = m_myInst.callCallbackObj(Py_BuildValue("(ii)",a,b));   \
+            ro = wxPyCBH_callCallbackObj(m_myInst, Py_BuildValue("(ii)",a,b));   \
             if (ro) {                                                   \
                 PyObject* str = PyObject_Str(ro);                       \
                 rval = PyString_AsString(str);                          \
 #define PYCALLBACK__INTINTSTRING_pure(CBNAME)                           \
     void CBNAME(int a, int b, const wxString& c) {                      \
         bool doSave = wxPyRestoreThread();                              \
-        if (m_myInst.findCallback(#CBNAME))                             \
-            m_myInst.callCallback(Py_BuildValue("(iis)",a,b,c.c_str()));    \
+        if (wxPyCBH_findCallback(m_myInst, #CBNAME))                             \
+            wxPyCBH_callCallback(m_myInst, Py_BuildValue("(iis)",a,b,c.c_str()));    \
         wxPySaveThread(doSave);                                         \
     }
 
     wxString CBNAME(int a, int b) {                                     \
         bool doSave = wxPyRestoreThread();                              \
         wxString rval;                                                  \
-        if (m_myInst.findCallback(#CBNAME)) {                           \
+        if (wxPyCBH_findCallback(m_myInst, #CBNAME)) {                           \
             PyObject* ro;                                               \
-            ro = m_myInst.callCallbackObj(Py_BuildValue("(ii)",a,b));   \
+            ro = wxPyCBH_callCallbackObj(m_myInst, Py_BuildValue("(ii)",a,b));   \
             if (ro) {                                                   \
                 PyObject* str = PyObject_Str(ro);                       \
                 rval = PyString_AsString(str);                          \
     bool CBNAME(int a, int b, const wxString& c)  {                     \
         bool rval;                                                      \
         bool doSave = wxPyRestoreThread();                              \
-        if (m_myInst.findCallback(#CBNAME))                             \
-            rval = m_myInst.callCallback(Py_BuildValue("(iis)", a,b,c.c_str()));   \
+        if (wxPyCBH_findCallback(m_myInst, #CBNAME))                             \
+            rval = wxPyCBH_callCallback(m_myInst, Py_BuildValue("(iis)", a,b,c.c_str()));   \
         else                                                            \
             rval = PCLASS::CBNAME(a,b,c);                               \
         wxPySaveThread(doSave);                                         \
     long CBNAME(int a, int b)  {                                        \
         long rval;                                                      \
         bool doSave = wxPyRestoreThread();                              \
-        if (m_myInst.findCallback(#CBNAME))                             \
-            rval = m_myInst.callCallback(Py_BuildValue("(ii)", a,b));   \
+        if (wxPyCBH_findCallback(m_myInst, #CBNAME))                             \
+            rval = wxPyCBH_callCallback(m_myInst, Py_BuildValue("(ii)", a,b));   \
         else                                                            \
             rval = PCLASS::CBNAME(a,b);                                 \
         wxPySaveThread(doSave);                                         \
     bool CBNAME(int a, int b)  {                                        \
         bool rval;                                                      \
         bool doSave = wxPyRestoreThread();                              \
-        if (m_myInst.findCallback(#CBNAME))                             \
-            rval = m_myInst.callCallback(Py_BuildValue("(ii)", a,b));   \
+        if (wxPyCBH_findCallback(m_myInst, #CBNAME))                             \
+            rval = wxPyCBH_callCallback(m_myInst, Py_BuildValue("(ii)", a,b));   \
         else                                                            \
             rval = PCLASS::CBNAME(a,b);                                 \
         wxPySaveThread(doSave);                                         \
     double CBNAME(int a, int b) {                                       \
         bool doSave = wxPyRestoreThread();                              \
         double rval;                                                    \
-        if (m_myInst.findCallback(#CBNAME)) {                           \
+        if (wxPyCBH_findCallback(m_myInst, #CBNAME)) {                           \
             PyObject* ro;                                               \
-            ro = m_myInst.callCallbackObj(Py_BuildValue("(ii)",a,b));   \
+            ro = wxPyCBH_callCallbackObj(m_myInst, Py_BuildValue("(ii)",a,b));   \
             if (ro) {                                                   \
                 PyObject* str = PyObject_Str(ro);                       \
                 rval = PyFloat_AsDouble(str);                           \
 #define PYCALLBACK__(PCLASS, CBNAME)                                    \
     void CBNAME()  {                                                    \
         bool doSave = wxPyRestoreThread();                              \
-        if (m_myInst.findCallback(#CBNAME))                             \
-            m_myInst.callCallback(Py_BuildValue("()"));                 \
+        if (wxPyCBH_findCallback(m_myInst, #CBNAME))                             \
+            wxPyCBH_callCallback(m_myInst, Py_BuildValue("()"));                 \
         else                                                            \
             PCLASS::CBNAME();                                           \
         wxPySaveThread(doSave);                                         \
     bool CBNAME(size_t a, size_t b)  {                                  \
         bool rval;                                                      \
         bool doSave = wxPyRestoreThread();                              \
-        if (m_myInst.findCallback(#CBNAME))                             \
-            rval = m_myInst.callCallback(Py_BuildValue("(ii)", a,b));   \
+        if (wxPyCBH_findCallback(m_myInst, #CBNAME))                             \
+            rval = wxPyCBH_callCallback(m_myInst, Py_BuildValue("(ii)", a,b));   \
         else                                                            \
             rval = PCLASS::CBNAME(a,b);                                 \
         wxPySaveThread(doSave);                                         \
     bool CBNAME(size_t a)  {                                            \
         bool rval;                                                      \
         bool doSave = wxPyRestoreThread();                              \
-        if (m_myInst.findCallback(#CBNAME))                             \
-            rval = m_myInst.callCallback(Py_BuildValue("(i)", a));      \
+        if (wxPyCBH_findCallback(m_myInst, #CBNAME))                             \
+            rval = wxPyCBH_callCallback(m_myInst, Py_BuildValue("(i)", a));      \
         else                                                            \
             rval = PCLASS::CBNAME(a);                                   \
         wxPySaveThread(doSave);                                         \
     wxString CBNAME(int a) {                                            \
         bool doSave = wxPyRestoreThread();                              \
         wxString rval;                                                  \
-        if (m_myInst.findCallback(#CBNAME)) {                           \
+        if (wxPyCBH_findCallback(m_myInst, #CBNAME)) {                           \
             PyObject* ro;                                               \
-            ro = m_myInst.callCallbackObj(Py_BuildValue("(i)",a));      \
+            ro = wxPyCBH_callCallbackObj(m_myInst, Py_BuildValue("(i)",a));      \
             if (ro) {                                                   \
                 PyObject* str = PyObject_Str(ro);                       \
                 rval = PyString_AsString(str);                          \
 #define PYCALLBACK__INTSTRING(PCLASS, CBNAME)                           \
     void CBNAME(int a, const wxString& c)  {                            \
         bool doSave = wxPyRestoreThread();                              \
-        if (m_myInst.findCallback(#CBNAME))                             \
-            m_myInst.callCallback(Py_BuildValue("(is)", a,c.c_str()));  \
+        if (wxPyCBH_findCallback(m_myInst, #CBNAME))                             \
+            wxPyCBH_callCallback(m_myInst, Py_BuildValue("(is)", a,c.c_str()));  \
         else                                                            \
             PCLASS::CBNAME(a,c);                                        \
         wxPySaveThread(doSave);                                         \
     bool CBNAME()  {                                                    \
         bool rval;                                                      \
         bool doSave = wxPyRestoreThread();                              \
-        if (m_myInst.findCallback(#CBNAME))                             \
-            rval = m_myInst.callCallback(Py_BuildValue("()"));          \
+        if (wxPyCBH_findCallback(m_myInst, #CBNAME))                             \
+            rval = wxPyCBH_callCallback(m_myInst, Py_BuildValue("()"));          \
         else                                                            \
             rval = PCLASS::CBNAME();                                    \
         wxPySaveThread(doSave);                                         \
 #define PYCALLBACK__SIZETINT(PCLASS, CBNAME)                            \
     void CBNAME(size_t a, int b)  {                                     \
         bool doSave = wxPyRestoreThread();                              \
-        if (m_myInst.findCallback(#CBNAME))                             \
-            m_myInst.callCallback(Py_BuildValue("(ii)", a,b));          \
+        if (wxPyCBH_findCallback(m_myInst, #CBNAME))                             \
+            wxPyCBH_callCallback(m_myInst, Py_BuildValue("(ii)", a,b));          \
         else                                                            \
             PCLASS::CBNAME(a,b);                                        \
         wxPySaveThread(doSave);                                         \
 #define PYCALLBACK__INTINTLONG(PCLASS, CBNAME)                          \
     void CBNAME(int a, int b, long c)  {                                \
         bool doSave = wxPyRestoreThread();                              \
-        if (m_myInst.findCallback(#CBNAME))                             \
-            m_myInst.callCallback(Py_BuildValue("(iii)", a,b,c));       \
+        if (wxPyCBH_findCallback(m_myInst, #CBNAME))                             \
+            wxPyCBH_callCallback(m_myInst, Py_BuildValue("(iii)", a,b,c));       \
         else                                                            \
             PCLASS::CBNAME(a,b,c);                                      \
         wxPySaveThread(doSave);                                         \
 #define PYCALLBACK__INTINTDOUBLE(PCLASS, CBNAME)                        \
     void CBNAME(int a, int b, double c)  {                              \
         bool doSave = wxPyRestoreThread();                              \
-        if (m_myInst.findCallback(#CBNAME))                             \
-            m_myInst.callCallback(Py_BuildValue("(iif)", a,b,c));       \
+        if (wxPyCBH_findCallback(m_myInst, #CBNAME))                             \
+            wxPyCBH_callCallback(m_myInst, Py_BuildValue("(iif)", a,b,c));       \
         else                                                            \
             PCLASS::CBNAME(a,b,c);                                      \
         wxPySaveThread(doSave);                                         \
 #define PYCALLBACK__INTINTBOOL(PCLASS, CBNAME)                          \
     void CBNAME(int a, int b, bool c)  {                                \
         bool doSave = wxPyRestoreThread();                              \
-        if (m_myInst.findCallback(#CBNAME))                             \
-            m_myInst.callCallback(Py_BuildValue("(iii)", a,b,c));       \
+        if (wxPyCBH_findCallback(m_myInst, #CBNAME))                             \
+            wxPyCBH_callCallback(m_myInst, Py_BuildValue("(iii)", a,b,c));       \
         else                                                            \
             PCLASS::CBNAME(a,b,c);                                      \
         wxPySaveThread(doSave);                                         \
@@ -484,13 +484,13 @@ public:
               wxDC& dc, const wxRect& rect,
               int row, int col, bool isSelected) {
         bool doSave = wxPyRestoreThread();
-        if (m_myInst.findCallback("Draw")) {
-            m_myInst.callCallback(
+        if (wxPyCBH_findCallback(m_myInst, "Draw")) {
+            wxPyCBH_callCallback(m_myInst,
                 Py_BuildValue("(OOOOiii)",
-                              wxPyConstructObject((void*)&grid, "wxGrid"),
-                              wxPyConstructObject((void*)&attr, "wxGridCellAttr"),
-                              wxPyConstructObject((void*)&dc,   "wxDC"),
-                              wxPyConstructObject((void*)&rect, "wxRect"),
+                              wxPyConstructObject((void*)&grid, "wxGrid", 0),
+                              wxPyConstructObject((void*)&attr, "wxGridCellAttr", 0),
+                              wxPyConstructObject((void*)&dc,   "wxDC", 0),
+                              wxPyConstructObject((void*)&rect, "wxRect", 0),
                               row, col, isSelected));
         }
         wxPySaveThread(doSave);
@@ -500,14 +500,14 @@ public:
                        int row, int col) {
         wxSize rval;
         bool doSave = wxPyRestoreThread();
-        if (m_myInst.findCallback("GetBestSize")) {
+        if (wxPyCBH_findCallback(m_myInst, "GetBestSize")) {
             PyObject* ro;
             wxSize*   ptr;
-            ro = m_myInst.callCallbackObj(
+            ro = wxPyCBH_callCallbackObj(m_myInst,
                 Py_BuildValue("(OOOii)",
-                              wxPyConstructObject((void*)&grid, "wxGrid"),
-                              wxPyConstructObject((void*)&attr, "wxGridCellAttr"),
-                              wxPyConstructObject((void*)&dc,   "wxDC"),
+                              wxPyConstructObject((void*)&grid, "wxGrid", 0),
+                              wxPyConstructObject((void*)&attr, "wxGridCellAttr", 0),
+                              wxPyConstructObject((void*)&dc,   "wxDC", 0),
                               row, col));
             if (ro) {
                 if (!SWIG_GetPtrObj(ro, (void **)&ptr, "_wxSize_p"))
@@ -523,10 +523,10 @@ public:
     wxGridCellRenderer *Clone() const {
         wxGridCellRenderer* rval = NULL;
         bool doSave = wxPyRestoreThread();
-        if (m_myInst.findCallback("Clone")) {
+        if (wxPyCBH_findCallback(m_myInst, "Clone")) {
             PyObject* ro;
             wxGridCellRenderer* ptr;
-            ro = m_myInst.callCallbackObj(Py_BuildValue("()"));
+            ro = wxPyCBH_callCallbackObj(m_myInst, Py_BuildValue("()"));
             if (ro) {
                 if (!SWIG_GetPtrObj(ro, (void **)&ptr, "_wxGridCellRenderer_p"))
                     rval = ptr;
@@ -638,12 +638,12 @@ public:
 
     void Create(wxWindow* parent, wxWindowID id, wxEvtHandler* evtHandler) {
         bool doSave = wxPyRestoreThread();
-        if (m_myInst.findCallback("Create")) {
-            m_myInst.callCallback(
+        if (wxPyCBH_findCallback(m_myInst, "Create")) {
+            wxPyCBH_callCallback(m_myInst,
                 Py_BuildValue("(OiO)",
-                              wxPyConstructObject((void*)parent, "wxWindow"),
+                              wxPyConstructObject((void*)parent, "wxWindow", 0),
                               id,
-                              wxPyConstructObject((void*)evtHandler, "wxEvtHandler")));
+                              wxPyConstructObject((void*)evtHandler, "wxEvtHandler", 0)));
         }
         wxPySaveThread(doSave);
     }
@@ -651,10 +651,10 @@ public:
 
     void BeginEdit(int row, int col, wxGrid* grid) {
         bool doSave = wxPyRestoreThread();
-        if (m_myInst.findCallback("BeginEdit")) {
-            m_myInst.callCallback(
+        if (wxPyCBH_findCallback(m_myInst, "BeginEdit")) {
+            wxPyCBH_callCallback(m_myInst,
                 Py_BuildValue("(iiO)", row, col,
-                              wxPyConstructObject((void*)grid, "wxGrid")));
+                              wxPyConstructObject((void*)grid, "wxGrid", 0)));
         }
         wxPySaveThread(doSave);
     }
@@ -663,10 +663,10 @@ public:
     bool EndEdit(int row, int col, wxGrid* grid) {
         bool rv = FALSE;
         bool doSave = wxPyRestoreThread();
-        if (m_myInst.findCallback("EndEdit")) {
-            rv = m_myInst.callCallback(
+        if (wxPyCBH_findCallback(m_myInst, "EndEdit")) {
+            rv = wxPyCBH_callCallback(m_myInst,
                 Py_BuildValue("(iiO)", row, col,
-                              wxPyConstructObject((void*)grid, "wxGrid")));
+                              wxPyConstructObject((void*)grid, "wxGrid", 0)));
         }
         wxPySaveThread(doSave);
         return rv;
@@ -676,10 +676,10 @@ public:
     wxGridCellEditor*Clone() const {
         wxGridCellEditor* rval = NULL;
         bool doSave = wxPyRestoreThread();
-        if (m_myInst.findCallback("Clone")) {
+        if (wxPyCBH_findCallback(m_myInst, "Clone")) {
             PyObject* ro;
             wxGridCellEditor* ptr;
-            ro = m_myInst.callCallbackObj(Py_BuildValue("()"));
+            ro = wxPyCBH_callCallbackObj(m_myInst, Py_BuildValue("()"));
             if (ro) {
                 if (!SWIG_GetPtrObj(ro, (void **)&ptr, "_wxGridCellEditor_p"))
                     rval = ptr;
@@ -693,10 +693,10 @@ public:
 
     void Show(bool show, wxGridCellAttr *attr) {
         bool doSave = wxPyRestoreThread();
-        if (m_myInst.findCallback("Show"))
-            m_myInst.callCallback(
+        if (wxPyCBH_findCallback(m_myInst, "Show"))
+            wxPyCBH_callCallback(m_myInst,
                 Py_BuildValue("(iO)", show,
-                              wxPyConstructObject((void*)attr, "wxGridCellAttr")));
+                              wxPyConstructObject((void*)attr, "wxGridCellAttr", 0)));
         else
             wxGridCellEditor::Show(show, attr);
         wxPySaveThread(doSave);
@@ -708,11 +708,11 @@ public:
 
     void PaintBackground(const wxRect& rectCell, wxGridCellAttr *attr) {
         bool doSave = wxPyRestoreThread();
-        if (m_myInst.findCallback("PaintBackground"))
-            m_myInst.callCallback(
+        if (wxPyCBH_findCallback(m_myInst, "PaintBackground"))
+            wxPyCBH_callCallback(m_myInst,
                 Py_BuildValue("(OO)",
-                              wxPyConstructObject((void*)&rectCell, "wxRect"),
-                              wxPyConstructObject((void*)attr, "wxGridCellAttr")));
+                              wxPyConstructObject((void*)&rectCell, "wxRect", 0),
+                              wxPyConstructObject((void*)attr, "wxGridCellAttr", 0)));
         else
             wxGridCellEditor::PaintBackground(rectCell, attr);
         wxPySaveThread(doSave);
@@ -989,9 +989,9 @@ public:
     wxString GetValue(int row, int col) {
         bool doSave = wxPyRestoreThread();
         wxString rval;
-        if (m_myInst.findCallback("GetValue")) {
+        if (wxPyCBH_findCallback(m_myInst, "GetValue")) {
             PyObject* ro;
-            ro = m_myInst.callCallbackObj(Py_BuildValue("(ii)",row,col));
+            ro = wxPyCBH_callCallbackObj(m_myInst, Py_BuildValue("(ii)",row,col));
             if (ro) {
                 PyObject* str = PyObject_Str(ro);
                 rval = PyString_AsString(str);
@@ -1005,8 +1005,8 @@ public:
 
     void SetValue(int row, int col, const wxString& val) {
         bool doSave = wxPyRestoreThread();
-        if (m_myInst.findCallback("SetValue"))
-            m_myInst.callCallback(Py_BuildValue("(iis)",row,col,val.c_str()));
+        if (wxPyCBH_findCallback(m_myInst, "SetValue"))
+            wxPyCBH_callCallback(m_myInst, Py_BuildValue("(iis)",row,col,val.c_str()));
         wxPySaveThread(doSave);
     }
 
@@ -1016,10 +1016,10 @@ public:
     long GetValueAsLong( int row, int col ) {
         long rval = 0;
         bool doSave = wxPyRestoreThread();
-        if (m_myInst.findCallback("GetValue")) {
+        if (wxPyCBH_findCallback(m_myInst, "GetValue")) {
             PyObject* ro;
             PyObject* num;
-            ro = m_myInst.callCallbackObj(Py_BuildValue("(ii)", row, col));
+            ro = wxPyCBH_callCallbackObj(m_myInst, Py_BuildValue("(ii)", row, col));
             if (ro && PyNumber_Check(ro)) {
                 num = PyNumber_Int(ro);
                 if (num) {
@@ -1036,10 +1036,10 @@ public:
     double GetValueAsDouble( int row, int col ) {
         double rval = 0.0;
         bool doSave = wxPyRestoreThread();
-        if (m_myInst.findCallback("GetValue")) {
+        if (wxPyCBH_findCallback(m_myInst, "GetValue")) {
             PyObject* ro;
             PyObject* num;
-            ro = m_myInst.callCallbackObj(Py_BuildValue("(ii)", row, col));
+            ro = wxPyCBH_callCallbackObj(m_myInst, Py_BuildValue("(ii)", row, col));
             if (ro && PyNumber_Check(ro)) {
                 num = PyNumber_Float(ro);
                 if (num) {
@@ -1059,16 +1059,16 @@ public:
 
     void SetValueAsLong( int row, int col, long value ) {
         bool doSave = wxPyRestoreThread();
-        if (m_myInst.findCallback("SetValue")) {
-            m_myInst.callCallback(Py_BuildValue("(iii)", row, col, value));
+        if (wxPyCBH_findCallback(m_myInst, "SetValue")) {
+            wxPyCBH_callCallback(m_myInst, Py_BuildValue("(iii)", row, col, value));
         }
         wxPySaveThread(doSave);
     }
 
     void SetValueAsDouble( int row, int col, double value ) {
         bool doSave = wxPyRestoreThread();
-        if (m_myInst.findCallback("SetValue")) {
-            m_myInst.callCallback(Py_BuildValue("(iid)", row, col, value));
+        if (wxPyCBH_findCallback(m_myInst, "SetValue")) {
+            wxPyCBH_callCallback(m_myInst, Py_BuildValue("(iid)", row, col, value));
         }
         wxPySaveThread(doSave);
     }
index 4495879274c95ffd9e6a9a5036046aead26d5875..d979802917d158d0d2e5f1080d302b1ef4535e8b 100644 (file)
@@ -257,8 +257,8 @@ PyObject* __wxSetDictionary(PyObject* /* self */, PyObject* args)
 //---------------------------------------------------------------------------
 
 PyObject* wxPyConstructObject(void* ptr,
-                                 const char* className,
-                                 int setThisOwn) {
+                              const char* className,
+                              int setThisOwn) {
     PyObject* obj;
     PyObject* arg;
 
@@ -301,8 +301,6 @@ PyObject* wxPyConstructObject(void* ptr,
 
 //---------------------------------------------------------------------------
 
-static unsigned int _wxPyNestCount = 0;
-
 static PyThreadState* myPyThreadState_Get() {
     PyThreadState* current;
     current = PyThreadState_Swap(NULL);
@@ -320,7 +318,6 @@ HELPEREXPORT bool wxPyRestoreThread() {
     // already have the lock.  (I hope!)
     //
 #ifdef WXP_WITH_THREAD
-    _wxPyNestCount += 1;
     if (wxPyEventThreadState != myPyThreadState_Get()) {
         PyEval_RestoreThread(wxPyEventThreadState);
         return TRUE;
@@ -336,7 +333,6 @@ HELPEREXPORT void wxPySaveThread(bool doSave) {
     if (doSave) {
         wxPyEventThreadState = PyEval_SaveThread();
     }
-    _wxPyNestCount -= 1;
 #endif
 }
 
@@ -398,23 +394,6 @@ void wxPyCallback::EventThunker(wxEvent& event) {
 
 //----------------------------------------------------------------------
 
-wxPyCallbackHelper::wxPyCallbackHelper() {
-    m_class = NULL;
-    m_self = NULL;
-    m_lastFound = NULL;
-    m_incRef = FALSE;
-}
-
-
-wxPyCallbackHelper::~wxPyCallbackHelper() {
-    bool doSave = wxPyRestoreThread();
-    if (m_incRef) {
-        Py_XDECREF(m_self);
-        Py_XDECREF(m_class);
-    }
-    wxPySaveThread(doSave);
-}
-
 wxPyCallbackHelper::wxPyCallbackHelper(const wxPyCallbackHelper& other) {
       m_lastFound = NULL;
       m_self = other.m_self;
@@ -495,6 +474,31 @@ PyObject* wxPyCallbackHelper::callCallbackObj(PyObject* argTuple) const {
 }
 
 
+void wxPyCBH_setSelf(wxPyCallbackHelper& cbh, PyObject* self, PyObject* klass, int incref) {
+    cbh.setSelf(self, klass, incref);
+}
+
+bool wxPyCBH_findCallback(const wxPyCallbackHelper& cbh, const char* name) {
+    return cbh.findCallback(name);
+}
+
+int  wxPyCBH_callCallback(const wxPyCallbackHelper& cbh, PyObject* argTuple) {
+    return cbh.callCallback(argTuple);
+}
+
+PyObject* wxPyCBH_callCallbackObj(const wxPyCallbackHelper& cbh, PyObject* argTuple) {
+    return cbh.callCallbackObj(argTuple);
+}
+
+
+void wxPyCBH_delete(wxPyCallbackHelper* cbh) {
+    bool doSave = wxPyRestoreThread();
+    if (cbh->m_incRef) {
+        Py_XDECREF(cbh->m_self);
+        Py_XDECREF(cbh->m_class);
+    }
+    wxPySaveThread(doSave);
+}
 
 //---------------------------------------------------------------------------
 //---------------------------------------------------------------------------
index 63f9c255a2a63feec882a898a9425afd5be6542c..f53092e220ef5c496b3015fc33bd0ebc1d6865cb 100644 (file)
 
 //---------------------------------------------------------------------------
 
-#if defined(__WXMSW__)
-#       define HELPEREXPORT __declspec(dllexport)
-#else
-#       define HELPEREXPORT
-#endif
-
 typedef unsigned char byte;
 
-//----------------------------------------------------------------------
 
 class wxPyApp: public wxApp
 {
@@ -50,9 +43,7 @@ public:
     ~wxPyApp();
     int  MainLoop(void);
     bool OnInit(void);
-//#    void AfterMainLoop(void);
 };
-
 extern wxPyApp *wxPythonApp;
 
 //----------------------------------------------------------------------
@@ -66,26 +57,15 @@ PyObject* __wxSetDictionary(PyObject*, PyObject* args);
 
 void wxPyEventThunker(wxObject*, wxEvent& event);
 
-HELPEREXPORT PyObject* wxPyConstructObject(void* ptr,
-                                           const char* className,
-                                           int setThisOwn=0);
-HELPEREXPORT bool wxPyRestoreThread();
-HELPEREXPORT void wxPySaveThread(bool doSave);
-HELPEREXPORT PyObject* wxPy_ConvertList(wxListBase* list, const char* className);
-HELPEREXPORT long wxPyGetWinHandle(wxWindow* win);
+PyObject* wxPyConstructObject(void* ptr,
+                              const char* className,
+                              int setThisOwn=0);
+bool wxPyRestoreThread();
+void wxPySaveThread(bool doSave);
+PyObject* wxPy_ConvertList(wxListBase* list, const char* className);
+long wxPyGetWinHandle(wxWindow* win);
 
-//----------------------------------------------------------------------
 
-class wxPyUserData : public wxObject {
-public:
-    wxPyUserData(PyObject* obj) { m_obj = obj; Py_INCREF(m_obj); }
-    ~wxPyUserData() {
-        bool doSave = wxPyRestoreThread();
-        Py_DECREF(m_obj);
-        wxPySaveThread(doSave);
-    }
-    PyObject* m_obj;
-};
 
 //----------------------------------------------------------------------
 // Handle wxInputStreams by Joerg Baumann
@@ -97,7 +77,7 @@ WX_DECLARE_LIST(wxString, wxStringPtrList);
 
 // C++ class wxPyInputStream to act as base for python class wxInputStream
 // Use it in python like a python file object
-class wxPyInputStream{
+class wxPyInputStream {
 public:
     // underlying wxInputStream
     wxInputStream* wxi;
@@ -128,20 +108,20 @@ public:
 //----------------------------------------------------------------------
 // These are helpers used by the typemaps
 
-HELPEREXPORT byte* byte_LIST_helper(PyObject* source);
-HELPEREXPORT int* int_LIST_helper(PyObject* source);
-HELPEREXPORT long* long_LIST_helper(PyObject* source);
-HELPEREXPORT char** string_LIST_helper(PyObject* source);
-HELPEREXPORT wxPoint* wxPoint_LIST_helper(PyObject* source);
-HELPEREXPORT wxBitmap** wxBitmap_LIST_helper(PyObject* source);
-HELPEREXPORT wxString* wxString_LIST_helper(PyObject* source);
-HELPEREXPORT wxAcceleratorEntry* wxAcceleratorEntry_LIST_helper(PyObject* source);
-
-HELPEREXPORT bool wxSize_helper(PyObject* source, wxSize** obj);
-HELPEREXPORT bool wxPoint_helper(PyObject* source, wxPoint** obj);
-HELPEREXPORT bool wxRealPoint_helper(PyObject* source, wxRealPoint** obj);
-HELPEREXPORT bool wxRect_helper(PyObject* source, wxRect** obj);
-HELPEREXPORT bool wxColour_helper(PyObject* source, wxColour** obj);
+byte* byte_LIST_helper(PyObject* source);
+int* int_LIST_helper(PyObject* source);
+long* long_LIST_helper(PyObject* source);
+char** string_LIST_helper(PyObject* source);
+wxPoint* wxPoint_LIST_helper(PyObject* source);
+wxBitmap** wxBitmap_LIST_helper(PyObject* source);
+wxString* wxString_LIST_helper(PyObject* source);
+wxAcceleratorEntry* wxAcceleratorEntry_LIST_helper(PyObject* source);
+
+bool wxSize_helper(PyObject* source, wxSize** obj);
+bool wxPoint_helper(PyObject* source, wxPoint** obj);
+bool wxRealPoint_helper(PyObject* source, wxRealPoint** obj);
+bool wxRect_helper(PyObject* source, wxRect** obj);
+bool wxColour_helper(PyObject* source, wxColour** obj);
 
 //----------------------------------------------------------------------
 
@@ -192,42 +172,6 @@ private:
 };
 
 //---------------------------------------------------------------------------
-
-
-
-
-//---------------------------------------------------------------------------
-// This class holds an instance of a Python Shadow Class object and assists
-// with looking up and invoking Python callback methods from C++ virtual
-// method redirections.  For all classes which have virtuals which should be
-// overridable in wxPython, a new subclass is created that contains a
-// wxPyCallbackHelper.
-//
-// TODO: This class should be combined with wxPyCallback defined above.
-//
-
-class HELPEREXPORT wxPyCallbackHelper {
-public:
-    wxPyCallbackHelper();
-    ~wxPyCallbackHelper();
-
-    wxPyCallbackHelper(const wxPyCallbackHelper& other);
-
-    void        setSelf(PyObject* self, PyObject* klass, int incref=TRUE);
-
-    bool        findCallback(const char* name) const;
-    int         callCallback(PyObject* argTuple) const;
-    PyObject*   callCallbackObj(PyObject* argTuple) const;
-
-private:
-    PyObject*   m_self;
-    PyObject*   m_class;
-    PyObject*   m_lastFound;
-    int         m_incRef;
-};
-
-
-//---------------------------------------------------------------------------
 //---------------------------------------------------------------------------
 // These Event classes can be derived from in Python and passed through the
 // event system without loosing anything.  They do this by keeping a reference
@@ -268,6 +212,134 @@ public:
 };
 
 
+//---------------------------------------------------------------------------
+// Export a C API in a struct.  Other modules will be able to load this from
+// the wxc module and will then have safe access to these functions, even if
+// in another shared library.
+
+class wxPyCallbackHelper;
+
+struct wxPyCoreAPI {
+
+    void        (*p_SWIG_MakePtr)(char*, void*, char*);
+    char*       (*p_SWIG_GetPtr)(char*, void**, char*);
+    char*       (*p_SWIG_GetPtrObj)(PyObject*, void**, char*);
+    void        (*p_SWIG_RegisterMapping)(char*, char*, void *(*cast)(void *));
+    void        (*p_SWIG_addvarlink)(PyObject*, char*, PyObject *(*get_attr)(void), int (*set_attr)(PyObject *p));
+    PyObject*   (*p_SWIG_newvarlink)(void);
+
+    void        (*p_wxPySaveThread)(bool);
+    bool        (*p_wxPyRestoreThread)();
+    PyObject*   (*p_wxPyConstructObject)(void *, const char *, int);
+    PyObject*   (*p_wxPy_ConvertList)(wxListBase* list, const char* className);
+
+    byte*       (*p_byte_LIST_helper)(PyObject* source);
+    int*        (*p_int_LIST_helper)(PyObject* source);
+    long*       (*p_long_LIST_helper)(PyObject* source);
+    char**      (*p_string_LIST_helper)(PyObject* source);
+    wxPoint*    (*p_wxPoint_LIST_helper)(PyObject* source);
+    wxBitmap**  (*p_wxBitmap_LIST_helper)(PyObject* source);
+    wxString*   (*p_wxString_LIST_helper)(PyObject* source);
+    wxAcceleratorEntry*   (*p_wxAcceleratorEntry_LIST_helper)(PyObject* source);
+
+    bool        (*p_wxSize_helper)(PyObject* source, wxSize** obj);
+    bool        (*p_wxPoint_helper)(PyObject* source, wxPoint** obj);
+    bool        (*p_wxRealPoint_helper)(PyObject* source, wxRealPoint** obj);
+    bool        (*p_wxRect_helper)(PyObject* source, wxRect** obj);
+    bool        (*p_wxColour_helper)(PyObject* source, wxColour** obj);
+
+    void        (*p_wxPyCBH_setSelf)(wxPyCallbackHelper& cbh, PyObject* self, PyObject* klass, int incref);
+    bool        (*p_wxPyCBH_findCallback)(const wxPyCallbackHelper& cbh, const char* name);
+    int         (*p_wxPyCBH_callCallback)(const wxPyCallbackHelper& cbh, PyObject* argTuple);
+    PyObject*   (*p_wxPyCBH_callCallbackObj)(const wxPyCallbackHelper& cbh, PyObject* argTuple);
+    void        (*p_wxPyCBH_delete)(wxPyCallbackHelper* cbh);
+
+};
+
+#ifdef wxPyUSE_EXPORT
+static wxPyCoreAPI* wxPyCoreAPIPtr = NULL;  // Each module needs one, but may not use it.
+#endif
+
+//---------------------------------------------------------------------------
+// This class holds an instance of a Python Shadow Class object and assists
+// with looking up and invoking Python callback methods from C++ virtual
+// method redirections.  For all classes which have virtuals which should be
+// overridable in wxPython, a new subclass is created that contains a
+// wxPyCallbackHelper.
+//
+
+class wxPyCallbackHelper {
+public:
+    wxPyCallbackHelper(const wxPyCallbackHelper& other);
+
+    wxPyCallbackHelper() {
+        m_class = NULL;
+        m_self = NULL;
+        m_lastFound = NULL;
+        m_incRef = FALSE;
+    }
+
+    ~wxPyCallbackHelper() {
+#ifdef wxPyUSE_EXPORT
+        wxPyCoreAPIPtr->p_wxPyCBH_delete(this);
+#else
+        wxPyCBH_delete(this);
+#endif
+    }
+
+    void        setSelf(PyObject* self, PyObject* klass, int incref=TRUE);
+    bool        findCallback(const char* name) const;
+    int         callCallback(PyObject* argTuple) const;
+    PyObject*   callCallbackObj(PyObject* argTuple) const;
+
+private:
+    PyObject*   m_self;
+    PyObject*   m_class;
+    PyObject*   m_lastFound;
+    int         m_incRef;
+
+    friend      void wxPyCBH_delete(wxPyCallbackHelper* cbh);
+};
+
+
+void wxPyCBH_setSelf(wxPyCallbackHelper& cbh, PyObject* self, PyObject* klass, int incref);
+bool wxPyCBH_findCallback(const wxPyCallbackHelper& cbh, const char* name);
+int  wxPyCBH_callCallback(const wxPyCallbackHelper& cbh, PyObject* argTuple);
+PyObject* wxPyCBH_callCallbackObj(const wxPyCallbackHelper& cbh, PyObject* argTuple);
+void wxPyCBH_delete(wxPyCallbackHelper* cbh);
+
+
+
+//----------------------------------------------------------------------
+
+class wxPyUserData : public wxObject {
+public:
+    wxPyUserData(PyObject* obj) {
+        m_obj = obj;
+        Py_INCREF(m_obj);
+    }
+
+    ~wxPyUserData() {
+        bool doSave;
+#ifdef wxPyUSE_EXPORT
+        doSave = wxPyCoreAPIPtr->p_wxPyRestoreThread();
+#else
+        doSave = wxPyRestoreThread();
+#endif
+
+        Py_DECREF(m_obj);
+
+#ifdef wxPyUSE_EXPORT
+        wxPyCoreAPIPtr->p_wxPySaveThread(doSave);
+#else
+        wxPySaveThread(doSave);
+#endif
+    }
+    PyObject* m_obj;
+};
+
+
+
 //---------------------------------------------------------------------------
 // These macros are used to implement the virtual methods that should
 // redirect to a Python method if one exists.  The names designate the
@@ -276,7 +348,7 @@ public:
 
 #define PYPRIVATE                                                       \
     void _setSelf(PyObject* self, PyObject* _class, int incref=1) {     \
-        m_myInst.setSelf(self, _class, incref);                         \
+        wxPyCBH_setSelf(m_myInst, self, _class, incref);                \
     }                                                                   \
     private: wxPyCallbackHelper m_myInst
 
@@ -290,8 +362,8 @@ public:
 #define IMP_PYCALLBACK__(CLASS, PCLASS, CBNAME)         \
     void CLASS::CBNAME() {                              \
         bool doSave = wxPyRestoreThread();              \
-        if (m_myInst.findCallback(#CBNAME))             \
-            m_myInst.callCallback(Py_BuildValue("()")); \
+        if (wxPyCBH_findCallback(m_myInst, #CBNAME))             \
+            wxPyCBH_callCallback(m_myInst, Py_BuildValue("()")); \
         else                                            \
             PCLASS::CBNAME();                           \
         wxPySaveThread(doSave);                         \
@@ -311,8 +383,8 @@ public:
     bool CLASS::CBNAME(int a, int b) {                                  \
         bool rval;                                                      \
         bool doSave = wxPyRestoreThread();                              \
-        if (m_myInst.findCallback(#CBNAME))                             \
-            rval = m_myInst.callCallback(Py_BuildValue("(ii)",a,b));    \
+        if (wxPyCBH_findCallback(m_myInst, #CBNAME))                             \
+            rval = wxPyCBH_callCallback(m_myInst, Py_BuildValue("(ii)",a,b));    \
         else                                                            \
             rval = PCLASS::CBNAME(a,b);                                 \
         wxPySaveThread(doSave);                                         \
@@ -332,8 +404,8 @@ public:
 #define IMP_PYCALLBACK_VOID_INTINT(CLASS, PCLASS, CBNAME)               \
     void CLASS::CBNAME(int a, int b) {                                  \
         bool doSave = wxPyRestoreThread();                              \
-        if (m_myInst.findCallback(#CBNAME))                             \
-            m_myInst.callCallback(Py_BuildValue("(ii)",a,b));           \
+        if (wxPyCBH_findCallback(m_myInst, #CBNAME))                             \
+            wxPyCBH_callCallback(m_myInst, Py_BuildValue("(ii)",a,b));           \
         else                                                            \
             PCLASS::CBNAME(a,b);                                        \
         wxPySaveThread(doSave);                                         \
@@ -353,8 +425,8 @@ public:
     bool CLASS::CBNAME(int a) {                                         \
         bool rval;                                                      \
         bool doSave = wxPyRestoreThread();                              \
-        if (m_myInst.findCallback(#CBNAME))                             \
-            rval = m_myInst.callCallback(Py_BuildValue("(i)",a));       \
+        if (wxPyCBH_findCallback(m_myInst, #CBNAME))                             \
+            rval = wxPyCBH_callCallback(m_myInst, Py_BuildValue("(i)",a));       \
         else                                                            \
             rval = PCLASS::CBNAME(a);                                   \
         wxPySaveThread(doSave);                                         \
@@ -374,8 +446,8 @@ public:
     bool CLASS::CBNAME(int a) {                                         \
         bool rval;                                                      \
         bool doSave = wxPyRestoreThread();                              \
-        if (m_myInst.findCallback(#CBNAME))                             \
-            rval = m_myInst.callCallback(Py_BuildValue("(i)",a));       \
+        if (wxPyCBH_findCallback(m_myInst, #CBNAME))                             \
+            rval = wxPyCBH_callCallback(m_myInst, Py_BuildValue("(i)",a));       \
         else rval = FALSE;                                              \
         wxPySaveThread(doSave);                                         \
         return rval;                                                    \
@@ -392,9 +464,9 @@ public:
 #define IMP_PYCALLBACK__DC(CLASS, PCLASS, CBNAME)               \
     void CLASS::CBNAME(wxDC& a) {                               \
         bool doSave = wxPyRestoreThread();                      \
-        if (m_myInst.findCallback(#CBNAME)) {                   \
-            PyObject* obj = wxPyConstructObject(&a, "wxDC");    \
-            m_myInst.callCallback(Py_BuildValue("(O)", obj));   \
+        if (wxPyCBH_findCallback(m_myInst, #CBNAME)) {                   \
+            PyObject* obj = wxPyConstructObject(&a, "wxDC", 0); \
+            wxPyCBH_callCallback(m_myInst, Py_BuildValue("(O)", obj));   \
             Py_DECREF(obj);                                     \
         }                                                       \
         else                                                    \
@@ -417,9 +489,9 @@ public:
 #define IMP_PYCALLBACK__DCBOOL(CLASS, PCLASS, CBNAME)                   \
     void CLASS::CBNAME(wxDC& a, bool b) {                               \
         bool doSave = wxPyRestoreThread();                              \
-        if (m_myInst.findCallback(#CBNAME)) {                           \
-            PyObject* obj = wxPyConstructObject(&a, "wxDC");            \
-            m_myInst.callCallback(Py_BuildValue("(Oi)", obj, (int)b));  \
+        if (wxPyCBH_findCallback(m_myInst, #CBNAME)) {                           \
+            PyObject* obj = wxPyConstructObject(&a, "wxDC", 0);         \
+            wxPyCBH_callCallback(m_myInst, Py_BuildValue("(Oi)", obj, (int)b));  \
             Py_DECREF(obj);                                             \
         }                                                               \
         else                                                            \
@@ -440,9 +512,9 @@ public:
 #define IMP_PYCALLBACK__DCBOOL(CLASS, PCLASS, CBNAME)                   \
     void CLASS::CBNAME(wxDC& a, bool b) {                               \
         bool doSave = wxPyRestoreThread();                              \
-        if (m_myInst.findCallback(#CBNAME)) {                           \
-            PyObject* obj = wxPyConstructObject(&a, "wxDC");            \
-            m_myInst.callCallback(Py_BuildValue("(Oi)", obj, (int)b));  \
+        if (wxPyCBH_findCallback(m_myInst, #CBNAME)) {                           \
+            PyObject* obj = wxPyConstructObject(&a, "wxDC", 0);         \
+            wxPyCBH_callCallback(m_myInst, Py_BuildValue("(Oi)", obj, (int)b));  \
             Py_DECREF(obj);                                             \
         }                                                               \
         else                                                            \
@@ -463,8 +535,8 @@ public:
 #define IMP_PYCALLBACK__2DBL(CLASS, PCLASS, CBNAME)             \
     void CLASS::CBNAME(double a, double b) {                    \
         bool doSave = wxPyRestoreThread();                      \
-        if (m_myInst.findCallback(#CBNAME))                     \
-            m_myInst.callCallback(Py_BuildValue("(dd)",a,b));   \
+        if (wxPyCBH_findCallback(m_myInst, #CBNAME))                     \
+            wxPyCBH_callCallback(m_myInst, Py_BuildValue("(dd)",a,b));   \
         else                                                    \
             PCLASS::CBNAME(a, b);                               \
         wxPySaveThread(doSave);                                 \
@@ -483,8 +555,8 @@ public:
 #define IMP_PYCALLBACK__2DBL2INT(CLASS, PCLASS, CBNAME)                 \
     void CLASS::CBNAME(double a, double b, int c, int d) {              \
         bool doSave = wxPyRestoreThread();                              \
-        if (m_myInst.findCallback(#CBNAME))                             \
-            m_myInst.callCallback(Py_BuildValue("(ddii)",               \
+        if (wxPyCBH_findCallback(m_myInst, #CBNAME))                             \
+            wxPyCBH_callCallback(m_myInst, Py_BuildValue("(ddii)",               \
                                                        a,b,c,d));       \
         else                                                            \
             PCLASS::CBNAME(a, b, c, d);                                 \
@@ -504,9 +576,9 @@ public:
 #define IMP_PYCALLBACK__DC4DBLBOOL(CLASS, PCLASS, CBNAME)                               \
     void CLASS::CBNAME(wxDC& a, double b, double c, double d, double e, bool f) {       \
         bool doSave = wxPyRestoreThread();                                              \
-        if (m_myInst.findCallback(#CBNAME)) {                                           \
-            PyObject* obj = wxPyConstructObject(&a, "wxDC");                            \
-            m_myInst.callCallback(Py_BuildValue("(Oddddi)", obj, b, c, d, e, (int)f));  \
+        if (wxPyCBH_findCallback(m_myInst, #CBNAME)) {                                           \
+            PyObject* obj = wxPyConstructObject(&a, "wxDC", 0);                         \
+            wxPyCBH_callCallback(m_myInst, Py_BuildValue("(Oddddi)", obj, b, c, d, e, (int)f));  \
             Py_DECREF(obj);                                                             \
         }                                                                               \
         else                                                                            \
@@ -528,9 +600,9 @@ public:
     bool CLASS::CBNAME(wxDC& a, double b, double c, double d, double e, bool f) {       \
         bool doSave = wxPyRestoreThread();                                              \
         bool rval;                                                                      \
-        if (m_myInst.findCallback(#CBNAME)) {                                           \
-            PyObject* obj = wxPyConstructObject(&a, "wxDC");                            \
-            rval = m_myInst.callCallback(Py_BuildValue("(Oddddi)", obj, b, c, d, e, (int)f));\
+        if (wxPyCBH_findCallback(m_myInst, #CBNAME)) {                                           \
+            PyObject* obj = wxPyConstructObject(&a, "wxDC", 0);                         \
+            rval = wxPyCBH_callCallback(m_myInst, Py_BuildValue("(Oddddi)", obj, b, c, d, e, (int)f));\
             Py_DECREF(obj);                                                             \
         }                                                                               \
         else                                                                            \
@@ -552,8 +624,8 @@ public:
 #define IMP_PYCALLBACK__BOOL2DBL2INT(CLASS, PCLASS, CBNAME)                     \
     void CLASS::CBNAME(bool a, double b, double c, int d, int e) {              \
         bool doSave = wxPyRestoreThread();                                      \
-        if (m_myInst.findCallback(#CBNAME))                                     \
-            m_myInst.callCallback(Py_BuildValue("(idii)",                       \
+        if (wxPyCBH_findCallback(m_myInst, #CBNAME))                                     \
+            wxPyCBH_callCallback(m_myInst, Py_BuildValue("(idii)",                       \
                                                 (int)a,b,c,d,e));               \
         else                                                                    \
             PCLASS::CBNAME(a, b, c, d, e);                                      \
@@ -573,9 +645,9 @@ public:
 #define IMP_PYCALLBACK__DC4DBL(CLASS, PCLASS, CBNAME)                           \
     void CLASS::CBNAME(wxDC& a, double b, double c, double d, double e) {       \
         bool doSave = wxPyRestoreThread();                                      \
-        if (m_myInst.findCallback(#CBNAME)) {                                   \
-            PyObject* obj = wxPyConstructObject(&a, "wxDC");                    \
-            m_myInst.callCallback(Py_BuildValue("(Odddd)", obj, b, c, d, e));   \
+        if (wxPyCBH_findCallback(m_myInst, #CBNAME)) {                                   \
+            PyObject* obj = wxPyConstructObject(&a, "wxDC", 0);                 \
+            wxPyCBH_callCallback(m_myInst, Py_BuildValue("(Odddd)", obj, b, c, d, e));   \
             Py_DECREF(obj);                                                     \
         }                                                                       \
         else                                                                    \
@@ -596,9 +668,9 @@ public:
 #define IMP_PYCALLBACK__DCBOOL(CLASS, PCLASS, CBNAME)                   \
     void CLASS::CBNAME(wxDC& a, bool b) {                               \
         bool doSave = wxPyRestoreThread();                              \
-        if (m_myInst.findCallback(#CBNAME)) {                           \
-            PyObject* obj = wxPyConstructObject(&a, "wxDC");            \
-            m_myInst.callCallback(Py_BuildValue("(Oi)", obj, (int)b));  \
+        if (wxPyCBH_findCallback(m_myInst, #CBNAME)) {                           \
+            PyObject* obj = wxPyConstructObject(&a, "wxDC", 0);         \
+            wxPyCBH_callCallback(m_myInst, Py_BuildValue("(Oi)", obj, (int)b));  \
             Py_DECREF(obj);                                             \
         }                                                               \
         else                                                            \
@@ -620,9 +692,9 @@ public:
     void CLASS::CBNAME(wxControlPoint* a, bool b, double c, double d,           \
                 int e, int f) {                                                 \
         bool doSave = wxPyRestoreThread();                                      \
-        if (m_myInst.findCallback(#CBNAME)) {                                   \
-            PyObject* obj = wxPyConstructObject(a, "wxPyControlPoint");         \
-            m_myInst.callCallback(Py_BuildValue("(Oiddii)", obj, (int)b, c, d, e, f));\
+        if (wxPyCBH_findCallback(m_myInst, #CBNAME)) {                                   \
+            PyObject* obj = wxPyConstructObject(a, "wxPyControlPoint", 0);      \
+            wxPyCBH_callCallback(m_myInst, Py_BuildValue("(Oiddii)", obj, (int)b, c, d, e, f));\
             Py_DECREF(obj);                                                     \
         }                                                                       \
         else                                                                    \
@@ -644,9 +716,9 @@ public:
 #define IMP_PYCALLBACK__WXCP2DBL2INT(CLASS, PCLASS, CBNAME)                     \
     void CLASS::CBNAME(wxControlPoint* a, double b, double c, int d, int e) {   \
         bool doSave = wxPyRestoreThread();                                      \
-        if (m_myInst.findCallback(#CBNAME)) {                                   \
-            PyObject* obj = wxPyConstructObject(a, "wxPyControlPoint");         \
-            m_myInst.callCallback(Py_BuildValue("(Oddii)", obj, b, c, d, e));   \
+        if (wxPyCBH_findCallback(m_myInst, #CBNAME)) {                                   \
+            PyObject* obj = wxPyConstructObject(a, "wxPyControlPoint", 0);      \
+            wxPyCBH_callCallback(m_myInst, Py_BuildValue("(Oddii)", obj, b, c, d, e));   \
             Py_DECREF(obj);                                                     \
         }                                                                       \
         else                                                                    \
@@ -668,8 +740,8 @@ public:
 #define IMP_PYCALLBACK__2DBLINT(CLASS, PCLASS, CBNAME)                  \
     void CLASS::CBNAME(double a, double b, int c) {                     \
         bool doSave = wxPyRestoreThread();                              \
-        if (m_myInst.findCallback(#CBNAME))                             \
-            m_myInst.callCallback(Py_BuildValue("(ddi)", a,b,c));       \
+        if (wxPyCBH_findCallback(m_myInst, #CBNAME))                             \
+            wxPyCBH_callCallback(m_myInst, Py_BuildValue("(ddi)", a,b,c));       \
         else                                                            \
             PCLASS::CBNAME(a, b, c);                                    \
         wxPySaveThread(doSave);                                         \
@@ -688,8 +760,8 @@ public:
 #define IMP_PYCALLBACK__BOOL2DBLINT(CLASS, PCLASS, CBNAME)                      \
     void CLASS::CBNAME(bool a, double b, double c, int d) {                     \
         bool doSave = wxPyRestoreThread();                                      \
-        if (m_myInst.findCallback(#CBNAME))                                     \
-            m_myInst.callCallback(Py_BuildValue("(iddi)", (int)a,b,c,d));       \
+        if (wxPyCBH_findCallback(m_myInst, #CBNAME))                                     \
+            wxPyCBH_callCallback(m_myInst, Py_BuildValue("(iddi)", (int)a,b,c,d));       \
         else                                                                    \
             PCLASS::CBNAME(a, b, c, d);                                         \
         wxPySaveThread(doSave);                                                 \
@@ -709,8 +781,8 @@ public:
 #define IMP_PYCALLBACK__STRING(CLASS, PCLASS, CBNAME)                   \
     void CLASS::CBNAME(const wxString& a)  {                            \
         bool doSave = wxPyRestoreThread();                              \
-        if (m_myInst.findCallback(#CBNAME))                             \
-            m_myInst.callCallback(Py_BuildValue("(s)", a.c_str()));     \
+        if (wxPyCBH_findCallback(m_myInst, #CBNAME))                             \
+            wxPyCBH_callCallback(m_myInst, Py_BuildValue("(s)", a.c_str()));     \
         else                                                            \
             PCLASS::CBNAME(a);                                          \
         wxPySaveThread(doSave);                                         \
@@ -730,8 +802,8 @@ public:
     bool CLASS::CBNAME(const wxString& a)  {                                    \
         bool rval;                                                              \
         bool doSave = wxPyRestoreThread();                                      \
-        if (m_myInst.findCallback(#CBNAME))                                     \
-            rval = m_myInst.callCallback(Py_BuildValue("(s)", a.c_str()));      \
+        if (wxPyCBH_findCallback(m_myInst, #CBNAME))                                     \
+            rval = wxPyCBH_callCallback(m_myInst, Py_BuildValue("(s)", a.c_str()));      \
         else                                                                    \
             rval = PCLASS::CBNAME(a);                                           \
         wxPySaveThread(doSave);                                                 \
@@ -750,8 +822,8 @@ public:
     bool CLASS::CBNAME(const wxString& a)  {                                    \
         bool rval;                                                              \
         bool doSave = wxPyRestoreThread();                                      \
-        if (m_myInst.findCallback(#CBNAME))                                     \
-            rval = m_myInst.callCallback(Py_BuildValue("(s)", a.c_str()));      \
+        if (wxPyCBH_findCallback(m_myInst, #CBNAME))                                     \
+            rval = wxPyCBH_callCallback(m_myInst, Py_BuildValue("(s)", a.c_str()));      \
         wxPySaveThread(doSave);                                                 \
         return rval;                                                            \
     }                                                                           \
@@ -765,9 +837,9 @@ public:
     wxString CLASS::CBNAME(const wxString& a)  {                                \
         wxString rval;                                                          \
         bool doSave = wxPyRestoreThread();                                      \
-        if (m_myInst.findCallback(#CBNAME)) {                                   \
+        if (wxPyCBH_findCallback(m_myInst, #CBNAME)) {                                   \
             PyObject* ro;                                                       \
-            ro = m_myInst.callCallbackObj(Py_BuildValue("(s)", a.c_str()));     \
+            ro = wxPyCBH_callCallbackObj(m_myInst, Py_BuildValue("(s)", a.c_str()));     \
             if (ro) {                                                           \
                 PyObject* str = PyObject_Str(ro);                               \
                 rval = PyString_AsString(str);                                  \
@@ -787,9 +859,9 @@ public:
     wxString CLASS::CBNAME(const wxString& a,int b)  {                          \
         wxString rval;                                                          \
         bool doSave = wxPyRestoreThread();                                      \
-        if (m_myInst.findCallback(#CBNAME)) {                                   \
+        if (wxPyCBH_findCallback(m_myInst, #CBNAME)) {                                   \
             PyObject* ro;                                                       \
-            ro = m_myInst.callCallbackObj(Py_BuildValue("(si)", a.c_str(),b));  \
+            ro = wxPyCBH_callCallbackObj(m_myInst, Py_BuildValue("(si)", a.c_str(),b));  \
             if (ro) {                                                           \
                 PyObject* str = PyObject_Str(ro);                               \
                 rval = PyString_AsString(str);                                  \
@@ -811,8 +883,8 @@ public:
     bool CLASS::CBNAME(const wxString& a, const wxString& b) {                  \
         bool rval;                                                              \
         bool doSave = wxPyRestoreThread();                                      \
-        if (m_myInst.findCallback(#CBNAME))                                     \
-            rval = m_myInst.callCallback(Py_BuildValue("(ss)",                  \
+        if (wxPyCBH_findCallback(m_myInst, #CBNAME))                                     \
+            rval = wxPyCBH_callCallback(m_myInst, Py_BuildValue("(ss)",                  \
                                                        a.c_str(), b.c_str()));  \
         else                                                                    \
             rval = PCLASS::CBNAME(a, b);                                        \
@@ -834,9 +906,9 @@ public:
     wxString CLASS::CBNAME() {                                                  \
         wxString rval;                                                          \
         bool doSave = wxPyRestoreThread();                                      \
-        if (m_myInst.findCallback(#CBNAME)) {                                   \
+        if (wxPyCBH_findCallback(m_myInst, #CBNAME)) {                                   \
             PyObject* ro;                                                       \
-            ro = m_myInst.callCallbackObj(Py_BuildValue("()"));                 \
+            ro = wxPyCBH_callCallbackObj(m_myInst, Py_BuildValue("()"));                 \
             if (ro) {                                                           \
                 PyObject* str = PyObject_Str(ro);                               \
                 rval = PyString_AsString(str);                                  \
@@ -862,9 +934,9 @@ public:
     wxString CLASS::CBNAME() {                                                  \
         wxString rval;                                                          \
         bool doSave = wxPyRestoreThread();                                      \
-        if (m_myInst.findCallback(#CBNAME)) {                                   \
+        if (wxPyCBH_findCallback(m_myInst, #CBNAME)) {                                   \
             PyObject* ro;                                                       \
-            ro = m_myInst.callCallbackObj(Py_BuildValue("()"));                 \
+            ro = wxPyCBH_callCallbackObj(m_myInst, Py_BuildValue("()"));                 \
             if (ro) {                                                           \
                 PyObject* str = PyObject_Str(ro);                               \
                 rval = PyString_AsString(str);                                  \
@@ -885,9 +957,9 @@ public:
     bool CLASS::CBNAME(const wxHtmlTag& a)  {                                   \
         bool rval = FALSE;                                                      \
         bool doSave = wxPyRestoreThread();                                      \
-        if (m_myInst.findCallback(#CBNAME)) {                                   \
-            PyObject* obj = wxPyConstructObject((void*)&a,"wxHtmlTag");         \
-            rval = m_myInst.callCallback(Py_BuildValue("(O)", obj));            \
+        if (wxPyCBH_findCallback(m_myInst, #CBNAME)) {                                   \
+            PyObject* obj = wxPyConstructObject((void*)&a,"wxHtmlTag", 0);      \
+            rval = wxPyCBH_callCallback(m_myInst, Py_BuildValue("(O)", obj));            \
             Py_DECREF(obj);                                                     \
         }                                                                       \
         wxPySaveThread(doSave);                                                 \
@@ -903,8 +975,8 @@ public:
 #define IMP_PYCALLBACK___pure(CLASS, PCLASS, CBNAME)                            \
     void CLASS::CBNAME() {                                                      \
         bool doSave = wxPyRestoreThread();                                      \
-        if (m_myInst.findCallback(#CBNAME))                                     \
-            m_myInst.callCallback(Py_BuildValue("()"));                         \
+        if (wxPyCBH_findCallback(m_myInst, #CBNAME))                                     \
+            wxPyCBH_callCallback(m_myInst, Py_BuildValue("()"));                         \
         wxPySaveThread(doSave);                                                 \
     }
 
@@ -918,10 +990,10 @@ public:
     wxSize CLASS::CBNAME() {                                                    \
         wxSize rval(0,0);                                                       \
         bool doSave = wxPyRestoreThread();                                      \
-        if (m_myInst.findCallback(#CBNAME)) {                                   \
+        if (wxPyCBH_findCallback(m_myInst, #CBNAME)) {                                   \
             PyObject* ro;                                                       \
             wxSize*   ptr;                                                      \
-            ro = m_myInst.callCallbackObj(Py_BuildValue("()"));                 \
+            ro = wxPyCBH_callCallbackObj(m_myInst, Py_BuildValue("()"));                 \
             if (ro) {                                                           \
                 if (! SWIG_GetPtrObj(ro, (void **)&ptr, "_wxSize_p"))           \
                     rval = *ptr;                                                \
@@ -943,9 +1015,9 @@ public:
     bool CLASS::CBNAME(wxWindow* a) {                                   \
         bool rval;                                                      \
         bool doSave = wxPyRestoreThread();                              \
-        if (m_myInst.findCallback(#CBNAME)) {                           \
-            PyObject* obj = wxPyConstructObject((void*)a,"wxWindow");   \
-            rval = m_myInst.callCallback(Py_BuildValue("(O)", obj));    \
+        if (wxPyCBH_findCallback(m_myInst, #CBNAME)) {                           \
+            PyObject* obj = wxPyConstructObject((void*)a,"wxWindow", 0);\
+            rval = wxPyCBH_callCallback(m_myInst, Py_BuildValue("(O)", obj));    \
             Py_DECREF(obj);                                             \
         }                                                               \
         else                                                            \
@@ -968,8 +1040,8 @@ public:
     bool CLASS::CBNAME() {                                              \
         bool rval;                                                      \
         bool doSave = wxPyRestoreThread();                              \
-        if (m_myInst.findCallback(#CBNAME))                             \
-            rval = m_myInst.callCallback(Py_BuildValue("()"));          \
+        if (wxPyCBH_findCallback(m_myInst, #CBNAME))                             \
+            rval = wxPyCBH_callCallback(m_myInst, Py_BuildValue("()"));          \
         else                                                            \
             rval = PCLASS::CBNAME();                                    \
         wxPySaveThread(doSave);                                         \
@@ -990,8 +1062,8 @@ public:
     wxDragResult CLASS::CBNAME(wxCoord a, wxCoord b, wxDragResult c) {  \
         bool doSave = wxPyRestoreThread();                              \
         int rval;                                                       \
-        if (m_myInst.findCallback(#CBNAME))                             \
-            rval = m_myInst.callCallback(Py_BuildValue("(iii)", a,b,c));\
+        if (wxPyCBH_findCallback(m_myInst, #CBNAME))                             \
+            rval = wxPyCBH_callCallback(m_myInst, Py_BuildValue("(iii)", a,b,c));\
         else                                                            \
             rval = PCLASS::CBNAME(a, b, c);                             \
         wxPySaveThread(doSave);                                         \
@@ -1010,10 +1082,10 @@ public:
     wxFSFile* CLASS::CBNAME(wxFileSystem& a,const wxString& b) {        \
         bool doSave = wxPyRestoreThread();                              \
         wxFSFile* rval=0;                                               \
-        if (m_myInst.findCallback(#CBNAME)) {                           \
+        if (wxPyCBH_findCallback(m_myInst, #CBNAME)) {                           \
             PyObject* ro;                                               \
-            PyObject* obj = wxPyConstructObject(&a, "(wxFileSystem");   \
-            ro = m_myInst.callCallbackObj(Py_BuildValue("(Os)",         \
+            PyObject* obj = wxPyConstructObject(&a, "wxFileSystem", 0); \
+            ro = wxPyCBH_callCallbackObj(m_myInst, Py_BuildValue("(Os)",         \
                                           obj, b.c_str()));             \
             if (ro) {                                                   \
                 SWIG_GetPtrObj(ro, (void **)&rval, "_wxFSFILE_p");      \
@@ -1036,8 +1108,8 @@ public:
     bool CLASS::CBNAME(wxDragResult a) {                                \
         bool doSave = wxPyRestoreThread();                              \
         bool rval;                                                      \
-        if (m_myInst.findCallback(#CBNAME))                             \
-            rval = m_myInst.callCallback(Py_BuildValue("(i)", a));      \
+        if (wxPyCBH_findCallback(m_myInst, #CBNAME))                             \
+            rval = wxPyCBH_callCallback(m_myInst, Py_BuildValue("(i)", a));      \
         else                                                            \
             rval = PCLASS::CBNAME(a);                                   \
         wxPySaveThread(doSave);                                         \
@@ -1057,8 +1129,8 @@ public:
     wxDragResult CLASS::CBNAME(wxCoord a, wxCoord b, wxDragResult c) {  \
         bool doSave = wxPyRestoreThread();                              \
         int rval;                                                       \
-        if (m_myInst.findCallback(#CBNAME))                             \
-            rval = m_myInst.callCallback(Py_BuildValue("(iii)", a,b,c));\
+        if (wxPyCBH_findCallback(m_myInst, #CBNAME))                             \
+            rval = wxPyCBH_callCallback(m_myInst, Py_BuildValue("(iii)", a,b,c));\
         wxPySaveThread(doSave);                                         \
         return (wxDragResult)rval;                                      \
     }                                                                   \
@@ -1073,8 +1145,8 @@ public:
     bool CLASS::CBNAME(int a, int b, const wxString& c) {               \
         bool rval;                                                      \
         bool doSave = wxPyRestoreThread();                              \
-        if (m_myInst.findCallback(#CBNAME))                             \
-            rval = m_myInst.callCallback(Py_BuildValue("(iis)",a,b,c.c_str()));\
+        if (wxPyCBH_findCallback(m_myInst, #CBNAME))                             \
+            rval = wxPyCBH_callCallback(m_myInst, Py_BuildValue("(iis)",a,b,c.c_str()));\
         wxPySaveThread(doSave);                                         \
         return rval;                                                    \
     }                                                                   \
@@ -1090,8 +1162,8 @@ public:
     size_t CLASS::CBNAME() {                                                    \
         size_t rval;                                                            \
         bool doSave = wxPyRestoreThread();                                      \
-        if (m_myInst.findCallback(#CBNAME))                                     \
-            rval = m_myInst.callCallback(Py_BuildValue("()"));                  \
+        if (wxPyCBH_findCallback(m_myInst, #CBNAME))                                     \
+            rval = wxPyCBH_callCallback(m_myInst, Py_BuildValue("()"));                  \
         else                                                                    \
             rval = PCLASS::CBNAME();                                            \
         wxPySaveThread(doSave);                                                 \
@@ -1112,10 +1184,10 @@ public:
     wxDataFormat CLASS::CBNAME(size_t a) {                                      \
         wxDataFormat rval;                                                      \
         bool doSave = wxPyRestoreThread();                                      \
-        if (m_myInst.findCallback(#CBNAME)) {                                   \
+        if (wxPyCBH_findCallback(m_myInst, #CBNAME)) {                                   \
             PyObject* ro;                                                       \
             wxDataFormat* ptr;                                                  \
-            ro = m_myInst.callCallbackObj(Py_BuildValue("(i)", a));             \
+            ro = wxPyCBH_callCallbackObj(m_myInst, Py_BuildValue("(i)", a));             \
             if (ro) {                                                           \
                 if (! SWIG_GetPtrObj(ro, (void **)&ptr, "_wxDataFormat_p"))     \
                     rval = *ptr;                                                \
@@ -1141,9 +1213,9 @@ public:
 #define IMP_PYCALLBACK__constany(CLASS, PCLASS, CBNAME, Type)           \
     void CLASS::CBNAME(const Type& a) {                                 \
         bool doSave = wxPyRestoreThread();                              \
-        if (m_myInst.findCallback(#CBNAME)) {                           \
-            PyObject* obj = wxPyConstructObject((void*)&a, #Type);      \
-            m_myInst.callCallback(Py_BuildValue("(O)", obj));           \
+        if (wxPyCBH_findCallback(m_myInst, #CBNAME)) {                           \
+            PyObject* obj = wxPyConstructObject((void*)&a, #Type, 0);   \
+            wxPyCBH_callCallback(m_myInst, Py_BuildValue("(O)", obj));           \
             Py_DECREF(obj);                                             \
         }                                                               \
         else                                                            \
@@ -1165,9 +1237,9 @@ public:
 #define IMP_PYCALLBACK__any(CLASS, PCLASS, CBNAME, Type)                \
     void CLASS::CBNAME(Type& a) {                                       \
         bool doSave = wxPyRestoreThread();                              \
-        if (m_myInst.findCallback(#CBNAME)) {                           \
-            PyObject* obj = wxPyConstructObject((void*)&a, #Type);      \
-            m_myInst.callCallback(Py_BuildValue("(O)", obj));           \
+        if (wxPyCBH_findCallback(m_myInst, #CBNAME)) {                           \
+            PyObject* obj = wxPyConstructObject((void*)&a, #Type, 0);   \
+            wxPyCBH_callCallback(m_myInst, Py_BuildValue("(O)", obj));           \
             Py_DECREF(obj);                                             \
         }                                                               \
         else                                                            \
@@ -1189,9 +1261,9 @@ public:
     bool CLASS::CBNAME(Type& a) {                                       \
         bool rv;                                                        \
         bool doSave = wxPyRestoreThread();                              \
-        if (m_myInst.findCallback(#CBNAME)) {                           \
-            PyObject* obj = wxPyConstructObject((void*)&a, #Type);      \
-            rv = m_myInst.callCallback(Py_BuildValue("(O)", obj));      \
+        if (wxPyCBH_findCallback(m_myInst, #CBNAME)) {                           \
+            PyObject* obj = wxPyConstructObject((void*)&a, #Type, 0);   \
+            rv = wxPyCBH_callCallback(m_myInst, Py_BuildValue("(O)", obj));      \
             Py_DECREF(obj);                                             \
         }                                                               \
         else                                                            \
index 5ec1deae66f43dd8c0aff498453f5136df2fc9fc..12ece75e6d9f5eedd54186abe43b0a2456c387d2 100644 (file)
@@ -14,7 +14,7 @@
 %module html
 
 %{
-#include "helpers.h"
+#include "export.h"
 #include <wx/html/htmlwin.h>
 #include <wx/html/htmprint.h>
 #include <wx/image.h>
 
 %extern utils.i
 
-//---------------------------------------------------------------------------
-
-%{
-//  #ifdef __WXMSW__
-//  wxString wxPyEmptyStr("");
-//  wxPoint wxPyDefaultPosition(wxDefaultPosition);
-//  wxSize wxPyDefaultSize(wxDefaultSize);
-//  #endif
-%}
-
 %pragma(python) code = "import wx"
 
 
@@ -433,9 +423,9 @@ IMP_PYCALLBACK__STRING(wxPyHtmlWindow, wxHtmlWindow, OnSetTitle);
 
  void wxPyHtmlWindow::OnLinkClicked(const wxHtmlLinkInfo& link) {
     bool doSave = wxPyRestoreThread();
-    if (m_myInst.findCallback("OnLinkClicked")) {
-        PyObject* obj = wxPyConstructObject((void*)&link, "wxHtmlLinkInfo");
-        m_myInst.callCallback(Py_BuildValue("(O)", obj));
+    if (wxPyCBH_findCallback(m_myInst, "OnLinkClicked")) {
+        PyObject* obj = wxPyConstructObject((void*)&link, "wxHtmlLinkInfo", 0);
+        wxPyCBH_callCallback(m_myInst, Py_BuildValue("(O)", obj));
         Py_DECREF(obj);
     }
     else
@@ -452,8 +442,8 @@ void wxPyHtmlWindow::base_OnLinkClicked(const wxHtmlLinkInfo& link) {
 %name(wxHtmlWindow) class wxPyHtmlWindow : public wxScrolledWindow {
 public:
     wxPyHtmlWindow(wxWindow *parent, int id = -1,
-                 wxPoint& pos = wxPyDefaultPosition,
-                 wxSize& size = wxPyDefaultSize,
+                 wxPoint& pos = wxDefaultPosition,
+                 wxSize& size = wxDefaultSize,
                  int flags=wxHW_SCROLLBAR_AUTO,
                  char* name = "htmlWindow");
 
index f3540613248c55051bd14a4fdb72edd461fe57b1..0715d1ae0b35f03918495021a1e9c08827fa0d78 100644 (file)
@@ -14,7 +14,7 @@
 %module htmlhelp
 
 %{
-#include "helpers.h"
+#include "export.h"
 #include <wx/html/htmlwin.h>
 #include <wx/html/helpctrl.h>
 #include <wx/image.h>
index 97ba79ccd99f42c22667640a6ddb9d2ca593521e..68ed499ae7201ac6d9fbe7aa81f734738586b3ad 100644 (file)
@@ -99,7 +99,15 @@ long wxGetNumberFromUser(const wxString& message,
 // GDI Functions
 
 bool wxColourDisplay();
+
 int wxDisplayDepth();
+int wxGetDisplayDepth();
+
+void wxDisplaySize(int* OUTPUT, int* OUTPUT);
+wxSize wxGetDisplaySize();
+void wxDisplaySizeMM(int* OUTPUT, int* OUTPUT);
+wxSize wxGetDisplaySizeMM();
+
 void wxSetCursor(wxCursor& cursor);
 
 //----------------------------------------------------------------------
index 4a4e2b714cdb181cdedd76546f2efa2ec8b8ce19..6ffbca6e3a6d91dfed0f2089f4e9799c95bedba2 100644 (file)
@@ -55,7 +55,7 @@ extern PyObject *SWIG_newvarlink(void);
 
 #define SWIG_name    "calendarc"
 
-#include "helpers.h"
+#include "export.h"
 #include <wx/calctrl.h>
 
 static PyObject* l_output_helper(PyObject* target, PyObject* o) {
index 636d9c0c46b2bd29ff9259c73791a6e1e2e9976b..d5e0a2105ede32b15b18d4676f57204aaec2ae10 100644 (file)
@@ -55,7 +55,7 @@ extern PyObject *SWIG_newvarlink(void);
 
 #define SWIG_name    "gridc"
 
-#include "helpers.h"
+#include "export.h"
 #include <wx/grid.h>
 
 static PyObject* l_output_helper(PyObject* target, PyObject* o) {
@@ -110,10 +110,10 @@ static char* wxStringErrorMsg = "string type is required for parameter";
     wxGridCellAttr* CBNAME(int a, int b) {                              \
         wxGridCellAttr* rval = NULL;                                    \
         bool doSave = wxPyRestoreThread();                              \
-        if (m_myInst.findCallback(#CBNAME)) {                           \
+        if (wxPyCBH_findCallback(m_myInst, #CBNAME)) {                           \
             PyObject* ro;                                               \
             wxGridCellAttr* ptr;                                        \
-            ro = m_myInst.callCallbackObj(Py_BuildValue("(ii)", a, b)); \
+            ro = wxPyCBH_callCallbackObj(m_myInst, Py_BuildValue("(ii)", a, b)); \
             if (ro) {                                                   \
                 if (!SWIG_GetPtrObj(ro, (void **)&ptr, "_wxGridCellAttr_p"))    \
                     rval = ptr;                                         \
@@ -134,9 +134,9 @@ static char* wxStringErrorMsg = "string type is required for parameter";
 #define PYCALLBACK__GCAINTINT(PCLASS, CBNAME)                           \
     void CBNAME(wxGridCellAttr *attr, int a, int b) {                   \
         bool doSave = wxPyRestoreThread();                              \
-        if (m_myInst.findCallback(#CBNAME)) {                           \
-            PyObject* obj = wxPyConstructObject((void*)attr, "wxGridCellAttr");\
-            m_myInst.callCallback(Py_BuildValue("(Oii)", obj, a, b));   \
+        if (wxPyCBH_findCallback(m_myInst, #CBNAME)) {                           \
+            PyObject* obj = wxPyConstructObject((void*)attr, "wxGridCellAttr", 0);\
+            wxPyCBH_callCallback(m_myInst, Py_BuildValue("(Oii)", obj, a, b));   \
             Py_DECREF(obj);                                             \
         }                                                               \
         else                                                            \
@@ -152,9 +152,9 @@ static char* wxStringErrorMsg = "string type is required for parameter";
 #define PYCALLBACK__GCAINT(PCLASS, CBNAME)                              \
     void CBNAME(wxGridCellAttr *attr, int val) {                        \
         bool doSave = wxPyRestoreThread();                              \
-        if (m_myInst.findCallback(#CBNAME)) {                           \
-            PyObject* obj = wxPyConstructObject((void*)attr, "wxGridCellAttr");\
-            m_myInst.callCallback(Py_BuildValue("(Oi)", obj, val));     \
+        if (wxPyCBH_findCallback(m_myInst, #CBNAME)) {                           \
+            PyObject* obj = wxPyConstructObject((void*)attr, "wxGridCellAttr", 0);\
+            wxPyCBH_callCallback(m_myInst, Py_BuildValue("(Oi)", obj, val));     \
             Py_DECREF(obj);                                             \
         }                                                               \
         else                                                            \
@@ -171,8 +171,8 @@ static char* wxStringErrorMsg = "string type is required for parameter";
     int  CBNAME() {                                                     \
         bool doSave = wxPyRestoreThread();                              \
         int rval = 0;                                                   \
-        if (m_myInst.findCallback(#CBNAME))                             \
-            rval = m_myInst.callCallback(Py_BuildValue("()"));          \
+        if (wxPyCBH_findCallback(m_myInst, #CBNAME))                             \
+            rval = wxPyCBH_callCallback(m_myInst, Py_BuildValue("()"));          \
         wxPySaveThread(doSave);                                         \
         return rval;                                                    \
     }
@@ -183,8 +183,8 @@ static char* wxStringErrorMsg = "string type is required for parameter";
     bool CBNAME(int a, int b) {                                         \
         bool doSave = wxPyRestoreThread();                              \
         bool rval = 0;                                                  \
-        if (m_myInst.findCallback(#CBNAME))                             \
-            rval = m_myInst.callCallback(Py_BuildValue("(ii)",a,b));    \
+        if (wxPyCBH_findCallback(m_myInst, #CBNAME))                             \
+            rval = wxPyCBH_callCallback(m_myInst, Py_BuildValue("(ii)",a,b));    \
         wxPySaveThread(doSave);                                         \
         return rval;                                                    \
     }
@@ -195,9 +195,9 @@ static char* wxStringErrorMsg = "string type is required for parameter";
     wxString CBNAME(int a, int b) {                                     \
         bool doSave = wxPyRestoreThread();                              \
         wxString rval;                                                  \
-        if (m_myInst.findCallback(#CBNAME)) {                           \
+        if (wxPyCBH_findCallback(m_myInst, #CBNAME)) {                           \
             PyObject* ro;                                               \
-            ro = m_myInst.callCallbackObj(Py_BuildValue("(ii)",a,b));   \
+            ro = wxPyCBH_callCallbackObj(m_myInst, Py_BuildValue("(ii)",a,b));   \
             if (ro) {                                                   \
                 PyObject* str = PyObject_Str(ro);                       \
                 rval = PyString_AsString(str);                          \
@@ -213,8 +213,8 @@ static char* wxStringErrorMsg = "string type is required for parameter";
 #define PYCALLBACK__INTINTSTRING_pure(CBNAME)                           \
     void CBNAME(int a, int b, const wxString& c) {                      \
         bool doSave = wxPyRestoreThread();                              \
-        if (m_myInst.findCallback(#CBNAME))                             \
-            m_myInst.callCallback(Py_BuildValue("(iis)",a,b,c.c_str()));    \
+        if (wxPyCBH_findCallback(m_myInst, #CBNAME))                             \
+            wxPyCBH_callCallback(m_myInst, Py_BuildValue("(iis)",a,b,c.c_str()));    \
         wxPySaveThread(doSave);                                         \
     }
 
@@ -223,9 +223,9 @@ static char* wxStringErrorMsg = "string type is required for parameter";
     wxString CBNAME(int a, int b) {                                     \
         bool doSave = wxPyRestoreThread();                              \
         wxString rval;                                                  \
-        if (m_myInst.findCallback(#CBNAME)) {                           \
+        if (wxPyCBH_findCallback(m_myInst, #CBNAME)) {                           \
             PyObject* ro;                                               \
-            ro = m_myInst.callCallbackObj(Py_BuildValue("(ii)",a,b));   \
+            ro = wxPyCBH_callCallbackObj(m_myInst, Py_BuildValue("(ii)",a,b));   \
             if (ro) {                                                   \
                 PyObject* str = PyObject_Str(ro);                       \
                 rval = PyString_AsString(str);                          \
@@ -246,8 +246,8 @@ static char* wxStringErrorMsg = "string type is required for parameter";
     bool CBNAME(int a, int b, const wxString& c)  {                     \
         bool rval;                                                      \
         bool doSave = wxPyRestoreThread();                              \
-        if (m_myInst.findCallback(#CBNAME))                             \
-            rval = m_myInst.callCallback(Py_BuildValue("(iis)", a,b,c.c_str()));   \
+        if (wxPyCBH_findCallback(m_myInst, #CBNAME))                             \
+            rval = wxPyCBH_callCallback(m_myInst, Py_BuildValue("(iis)", a,b,c.c_str()));   \
         else                                                            \
             rval = PCLASS::CBNAME(a,b,c);                               \
         wxPySaveThread(doSave);                                         \
@@ -264,8 +264,8 @@ static char* wxStringErrorMsg = "string type is required for parameter";
     long CBNAME(int a, int b)  {                                        \
         long rval;                                                      \
         bool doSave = wxPyRestoreThread();                              \
-        if (m_myInst.findCallback(#CBNAME))                             \
-            rval = m_myInst.callCallback(Py_BuildValue("(ii)", a,b));   \
+        if (wxPyCBH_findCallback(m_myInst, #CBNAME))                             \
+            rval = wxPyCBH_callCallback(m_myInst, Py_BuildValue("(ii)", a,b));   \
         else                                                            \
             rval = PCLASS::CBNAME(a,b);                                 \
         wxPySaveThread(doSave);                                         \
@@ -281,8 +281,8 @@ static char* wxStringErrorMsg = "string type is required for parameter";
     bool CBNAME(int a, int b)  {                                        \
         bool rval;                                                      \
         bool doSave = wxPyRestoreThread();                              \
-        if (m_myInst.findCallback(#CBNAME))                             \
-            rval = m_myInst.callCallback(Py_BuildValue("(ii)", a,b));   \
+        if (wxPyCBH_findCallback(m_myInst, #CBNAME))                             \
+            rval = wxPyCBH_callCallback(m_myInst, Py_BuildValue("(ii)", a,b));   \
         else                                                            \
             rval = PCLASS::CBNAME(a,b);                                 \
         wxPySaveThread(doSave);                                         \
@@ -298,9 +298,9 @@ static char* wxStringErrorMsg = "string type is required for parameter";
     double CBNAME(int a, int b) {                                       \
         bool doSave = wxPyRestoreThread();                              \
         double rval;                                                    \
-        if (m_myInst.findCallback(#CBNAME)) {                           \
+        if (wxPyCBH_findCallback(m_myInst, #CBNAME)) {                           \
             PyObject* ro;                                               \
-            ro = m_myInst.callCallbackObj(Py_BuildValue("(ii)",a,b));   \
+            ro = wxPyCBH_callCallbackObj(m_myInst, Py_BuildValue("(ii)",a,b));   \
             if (ro) {                                                   \
                 PyObject* str = PyObject_Str(ro);                       \
                 rval = PyFloat_AsDouble(str);                           \
@@ -320,8 +320,8 @@ static char* wxStringErrorMsg = "string type is required for parameter";
 #define PYCALLBACK__(PCLASS, CBNAME)                                    \
     void CBNAME()  {                                                    \
         bool doSave = wxPyRestoreThread();                              \
-        if (m_myInst.findCallback(#CBNAME))                             \
-            m_myInst.callCallback(Py_BuildValue("()"));                 \
+        if (wxPyCBH_findCallback(m_myInst, #CBNAME))                             \
+            wxPyCBH_callCallback(m_myInst, Py_BuildValue("()"));                 \
         else                                                            \
             PCLASS::CBNAME();                                           \
         wxPySaveThread(doSave);                                         \
@@ -337,8 +337,8 @@ static char* wxStringErrorMsg = "string type is required for parameter";
     bool CBNAME(size_t a, size_t b)  {                                  \
         bool rval;                                                      \
         bool doSave = wxPyRestoreThread();                              \
-        if (m_myInst.findCallback(#CBNAME))                             \
-            rval = m_myInst.callCallback(Py_BuildValue("(ii)", a,b));   \
+        if (wxPyCBH_findCallback(m_myInst, #CBNAME))                             \
+            rval = wxPyCBH_callCallback(m_myInst, Py_BuildValue("(ii)", a,b));   \
         else                                                            \
             rval = PCLASS::CBNAME(a,b);                                 \
         wxPySaveThread(doSave);                                         \
@@ -354,8 +354,8 @@ static char* wxStringErrorMsg = "string type is required for parameter";
     bool CBNAME(size_t a)  {                                            \
         bool rval;                                                      \
         bool doSave = wxPyRestoreThread();                              \
-        if (m_myInst.findCallback(#CBNAME))                             \
-            rval = m_myInst.callCallback(Py_BuildValue("(i)", a));      \
+        if (wxPyCBH_findCallback(m_myInst, #CBNAME))                             \
+            rval = wxPyCBH_callCallback(m_myInst, Py_BuildValue("(i)", a));      \
         else                                                            \
             rval = PCLASS::CBNAME(a);                                   \
         wxPySaveThread(doSave);                                         \
@@ -371,9 +371,9 @@ static char* wxStringErrorMsg = "string type is required for parameter";
     wxString CBNAME(int a) {                                            \
         bool doSave = wxPyRestoreThread();                              \
         wxString rval;                                                  \
-        if (m_myInst.findCallback(#CBNAME)) {                           \
+        if (wxPyCBH_findCallback(m_myInst, #CBNAME)) {                           \
             PyObject* ro;                                               \
-            ro = m_myInst.callCallbackObj(Py_BuildValue("(i)",a));      \
+            ro = wxPyCBH_callCallbackObj(m_myInst, Py_BuildValue("(i)",a));      \
             if (ro) {                                                   \
                 PyObject* str = PyObject_Str(ro);                       \
                 rval = PyString_AsString(str);                          \
@@ -393,8 +393,8 @@ static char* wxStringErrorMsg = "string type is required for parameter";
 #define PYCALLBACK__INTSTRING(PCLASS, CBNAME)                           \
     void CBNAME(int a, const wxString& c)  {                            \
         bool doSave = wxPyRestoreThread();                              \
-        if (m_myInst.findCallback(#CBNAME))                             \
-            m_myInst.callCallback(Py_BuildValue("(is)", a,c.c_str()));  \
+        if (wxPyCBH_findCallback(m_myInst, #CBNAME))                             \
+            wxPyCBH_callCallback(m_myInst, Py_BuildValue("(is)", a,c.c_str()));  \
         else                                                            \
             PCLASS::CBNAME(a,c);                                        \
         wxPySaveThread(doSave);                                         \
@@ -410,8 +410,8 @@ static char* wxStringErrorMsg = "string type is required for parameter";
     bool CBNAME()  {                                                    \
         bool rval;                                                      \
         bool doSave = wxPyRestoreThread();                              \
-        if (m_myInst.findCallback(#CBNAME))                             \
-            rval = m_myInst.callCallback(Py_BuildValue("()"));          \
+        if (wxPyCBH_findCallback(m_myInst, #CBNAME))                             \
+            rval = wxPyCBH_callCallback(m_myInst, Py_BuildValue("()"));          \
         else                                                            \
             rval = PCLASS::CBNAME();                                    \
         wxPySaveThread(doSave);                                         \
@@ -426,8 +426,8 @@ static char* wxStringErrorMsg = "string type is required for parameter";
 #define PYCALLBACK__SIZETINT(PCLASS, CBNAME)                            \
     void CBNAME(size_t a, int b)  {                                     \
         bool doSave = wxPyRestoreThread();                              \
-        if (m_myInst.findCallback(#CBNAME))                             \
-            m_myInst.callCallback(Py_BuildValue("(ii)", a,b));          \
+        if (wxPyCBH_findCallback(m_myInst, #CBNAME))                             \
+            wxPyCBH_callCallback(m_myInst, Py_BuildValue("(ii)", a,b));          \
         else                                                            \
             PCLASS::CBNAME(a,b);                                        \
         wxPySaveThread(doSave);                                         \
@@ -442,8 +442,8 @@ static char* wxStringErrorMsg = "string type is required for parameter";
 #define PYCALLBACK__INTINTLONG(PCLASS, CBNAME)                          \
     void CBNAME(int a, int b, long c)  {                                \
         bool doSave = wxPyRestoreThread();                              \
-        if (m_myInst.findCallback(#CBNAME))                             \
-            m_myInst.callCallback(Py_BuildValue("(iii)", a,b,c));       \
+        if (wxPyCBH_findCallback(m_myInst, #CBNAME))                             \
+            wxPyCBH_callCallback(m_myInst, Py_BuildValue("(iii)", a,b,c));       \
         else                                                            \
             PCLASS::CBNAME(a,b,c);                                      \
         wxPySaveThread(doSave);                                         \
@@ -458,8 +458,8 @@ static char* wxStringErrorMsg = "string type is required for parameter";
 #define PYCALLBACK__INTINTDOUBLE(PCLASS, CBNAME)                        \
     void CBNAME(int a, int b, double c)  {                              \
         bool doSave = wxPyRestoreThread();                              \
-        if (m_myInst.findCallback(#CBNAME))                             \
-            m_myInst.callCallback(Py_BuildValue("(iif)", a,b,c));       \
+        if (wxPyCBH_findCallback(m_myInst, #CBNAME))                             \
+            wxPyCBH_callCallback(m_myInst, Py_BuildValue("(iif)", a,b,c));       \
         else                                                            \
             PCLASS::CBNAME(a,b,c);                                      \
         wxPySaveThread(doSave);                                         \
@@ -473,8 +473,8 @@ static char* wxStringErrorMsg = "string type is required for parameter";
 #define PYCALLBACK__INTINTBOOL(PCLASS, CBNAME)                          \
     void CBNAME(int a, int b, bool c)  {                                \
         bool doSave = wxPyRestoreThread();                              \
-        if (m_myInst.findCallback(#CBNAME))                             \
-            m_myInst.callCallback(Py_BuildValue("(iii)", a,b,c));       \
+        if (wxPyCBH_findCallback(m_myInst, #CBNAME))                             \
+            wxPyCBH_callCallback(m_myInst, Py_BuildValue("(iii)", a,b,c));       \
         else                                                            \
             PCLASS::CBNAME(a,b,c);                                      \
         wxPySaveThread(doSave);                                         \
@@ -497,13 +497,13 @@ public:
               wxDC& dc, const wxRect& rect,
               int row, int col, bool isSelected) {
         bool doSave = wxPyRestoreThread();
-        if (m_myInst.findCallback("Draw")) {
-            m_myInst.callCallback(
+        if (wxPyCBH_findCallback(m_myInst, "Draw")) {
+            wxPyCBH_callCallback(m_myInst,
                 Py_BuildValue("(OOOOiii)",
-                              wxPyConstructObject((void*)&grid, "wxGrid"),
-                              wxPyConstructObject((void*)&attr, "wxGridCellAttr"),
-                              wxPyConstructObject((void*)&dc,   "wxDC"),
-                              wxPyConstructObject((void*)&rect, "wxRect"),
+                              wxPyConstructObject((void*)&grid, "wxGrid", 0),
+                              wxPyConstructObject((void*)&attr, "wxGridCellAttr", 0),
+                              wxPyConstructObject((void*)&dc,   "wxDC", 0),
+                              wxPyConstructObject((void*)&rect, "wxRect", 0),
                               row, col, isSelected));
         }
         wxPySaveThread(doSave);
@@ -513,14 +513,14 @@ public:
                        int row, int col) {
         wxSize rval;
         bool doSave = wxPyRestoreThread();
-        if (m_myInst.findCallback("GetBestSize")) {
+        if (wxPyCBH_findCallback(m_myInst, "GetBestSize")) {
             PyObject* ro;
             wxSize*   ptr;
-            ro = m_myInst.callCallbackObj(
+            ro = wxPyCBH_callCallbackObj(m_myInst,
                 Py_BuildValue("(OOOii)",
-                              wxPyConstructObject((void*)&grid, "wxGrid"),
-                              wxPyConstructObject((void*)&attr, "wxGridCellAttr"),
-                              wxPyConstructObject((void*)&dc,   "wxDC"),
+                              wxPyConstructObject((void*)&grid, "wxGrid", 0),
+                              wxPyConstructObject((void*)&attr, "wxGridCellAttr", 0),
+                              wxPyConstructObject((void*)&dc,   "wxDC", 0),
                               row, col));
             if (ro) {
                 if (!SWIG_GetPtrObj(ro, (void **)&ptr, "_wxSize_p"))
@@ -536,10 +536,10 @@ public:
     wxGridCellRenderer *Clone() const {
         wxGridCellRenderer* rval = NULL;
         bool doSave = wxPyRestoreThread();
-        if (m_myInst.findCallback("Clone")) {
+        if (wxPyCBH_findCallback(m_myInst, "Clone")) {
             PyObject* ro;
             wxGridCellRenderer* ptr;
-            ro = m_myInst.callCallbackObj(Py_BuildValue("()"));
+            ro = wxPyCBH_callCallbackObj(m_myInst, Py_BuildValue("()"));
             if (ro) {
                 if (!SWIG_GetPtrObj(ro, (void **)&ptr, "_wxGridCellRenderer_p"))
                     rval = ptr;
@@ -565,12 +565,12 @@ public:
 
     void Create(wxWindow* parent, wxWindowID id, wxEvtHandler* evtHandler) {
         bool doSave = wxPyRestoreThread();
-        if (m_myInst.findCallback("Create")) {
-            m_myInst.callCallback(
+        if (wxPyCBH_findCallback(m_myInst, "Create")) {
+            wxPyCBH_callCallback(m_myInst,
                 Py_BuildValue("(OiO)",
-                              wxPyConstructObject((void*)parent, "wxWindow"),
+                              wxPyConstructObject((void*)parent, "wxWindow", 0),
                               id,
-                              wxPyConstructObject((void*)evtHandler, "wxEvtHandler")));
+                              wxPyConstructObject((void*)evtHandler, "wxEvtHandler", 0)));
         }
         wxPySaveThread(doSave);
     }
@@ -578,10 +578,10 @@ public:
 
     void BeginEdit(int row, int col, wxGrid* grid) {
         bool doSave = wxPyRestoreThread();
-        if (m_myInst.findCallback("BeginEdit")) {
-            m_myInst.callCallback(
+        if (wxPyCBH_findCallback(m_myInst, "BeginEdit")) {
+            wxPyCBH_callCallback(m_myInst,
                 Py_BuildValue("(iiO)", row, col,
-                              wxPyConstructObject((void*)grid, "wxGrid")));
+                              wxPyConstructObject((void*)grid, "wxGrid", 0)));
         }
         wxPySaveThread(doSave);
     }
@@ -590,10 +590,10 @@ public:
     bool EndEdit(int row, int col, wxGrid* grid) {
         bool rv = FALSE;
         bool doSave = wxPyRestoreThread();
-        if (m_myInst.findCallback("EndEdit")) {
-            rv = m_myInst.callCallback(
+        if (wxPyCBH_findCallback(m_myInst, "EndEdit")) {
+            rv = wxPyCBH_callCallback(m_myInst,
                 Py_BuildValue("(iiO)", row, col,
-                              wxPyConstructObject((void*)grid, "wxGrid")));
+                              wxPyConstructObject((void*)grid, "wxGrid", 0)));
         }
         wxPySaveThread(doSave);
         return rv;
@@ -603,10 +603,10 @@ public:
     wxGridCellEditor*Clone() const {
         wxGridCellEditor* rval = NULL;
         bool doSave = wxPyRestoreThread();
-        if (m_myInst.findCallback("Clone")) {
+        if (wxPyCBH_findCallback(m_myInst, "Clone")) {
             PyObject* ro;
             wxGridCellEditor* ptr;
-            ro = m_myInst.callCallbackObj(Py_BuildValue("()"));
+            ro = wxPyCBH_callCallbackObj(m_myInst, Py_BuildValue("()"));
             if (ro) {
                 if (!SWIG_GetPtrObj(ro, (void **)&ptr, "_wxGridCellEditor_p"))
                     rval = ptr;
@@ -620,10 +620,10 @@ public:
 
     void Show(bool show, wxGridCellAttr *attr) {
         bool doSave = wxPyRestoreThread();
-        if (m_myInst.findCallback("Show"))
-            m_myInst.callCallback(
+        if (wxPyCBH_findCallback(m_myInst, "Show"))
+            wxPyCBH_callCallback(m_myInst,
                 Py_BuildValue("(iO)", show,
-                              wxPyConstructObject((void*)attr, "wxGridCellAttr")));
+                              wxPyConstructObject((void*)attr, "wxGridCellAttr", 0)));
         else
             wxGridCellEditor::Show(show, attr);
         wxPySaveThread(doSave);
@@ -635,11 +635,11 @@ public:
 
     void PaintBackground(const wxRect& rectCell, wxGridCellAttr *attr) {
         bool doSave = wxPyRestoreThread();
-        if (m_myInst.findCallback("PaintBackground"))
-            m_myInst.callCallback(
+        if (wxPyCBH_findCallback(m_myInst, "PaintBackground"))
+            wxPyCBH_callCallback(m_myInst,
                 Py_BuildValue("(OO)",
-                              wxPyConstructObject((void*)&rectCell, "wxRect"),
-                              wxPyConstructObject((void*)attr, "wxGridCellAttr")));
+                              wxPyConstructObject((void*)&rectCell, "wxRect", 0),
+                              wxPyConstructObject((void*)attr, "wxGridCellAttr", 0)));
         else
             wxGridCellEditor::PaintBackground(rectCell, attr);
         wxPySaveThread(doSave);
@@ -717,9 +717,9 @@ public:
     wxString GetValue(int row, int col) {
         bool doSave = wxPyRestoreThread();
         wxString rval;
-        if (m_myInst.findCallback("GetValue")) {
+        if (wxPyCBH_findCallback(m_myInst, "GetValue")) {
             PyObject* ro;
-            ro = m_myInst.callCallbackObj(Py_BuildValue("(ii)",row,col));
+            ro = wxPyCBH_callCallbackObj(m_myInst, Py_BuildValue("(ii)",row,col));
             if (ro) {
                 PyObject* str = PyObject_Str(ro);
                 rval = PyString_AsString(str);
@@ -733,8 +733,8 @@ public:
 
     void SetValue(int row, int col, const wxString& val) {
         bool doSave = wxPyRestoreThread();
-        if (m_myInst.findCallback("SetValue"))
-            m_myInst.callCallback(Py_BuildValue("(iis)",row,col,val.c_str()));
+        if (wxPyCBH_findCallback(m_myInst, "SetValue"))
+            wxPyCBH_callCallback(m_myInst, Py_BuildValue("(iis)",row,col,val.c_str()));
         wxPySaveThread(doSave);
     }
 
@@ -744,10 +744,10 @@ public:
     long GetValueAsLong( int row, int col ) {
         long rval = 0;
         bool doSave = wxPyRestoreThread();
-        if (m_myInst.findCallback("GetValue")) {
+        if (wxPyCBH_findCallback(m_myInst, "GetValue")) {
             PyObject* ro;
             PyObject* num;
-            ro = m_myInst.callCallbackObj(Py_BuildValue("(ii)", row, col));
+            ro = wxPyCBH_callCallbackObj(m_myInst, Py_BuildValue("(ii)", row, col));
             if (ro && PyNumber_Check(ro)) {
                 num = PyNumber_Int(ro);
                 if (num) {
@@ -764,10 +764,10 @@ public:
     double GetValueAsDouble( int row, int col ) {
         double rval = 0.0;
         bool doSave = wxPyRestoreThread();
-        if (m_myInst.findCallback("GetValue")) {
+        if (wxPyCBH_findCallback(m_myInst, "GetValue")) {
             PyObject* ro;
             PyObject* num;
-            ro = m_myInst.callCallbackObj(Py_BuildValue("(ii)", row, col));
+            ro = wxPyCBH_callCallbackObj(m_myInst, Py_BuildValue("(ii)", row, col));
             if (ro && PyNumber_Check(ro)) {
                 num = PyNumber_Float(ro);
                 if (num) {
@@ -787,16 +787,16 @@ public:
 
     void SetValueAsLong( int row, int col, long value ) {
         bool doSave = wxPyRestoreThread();
-        if (m_myInst.findCallback("SetValue")) {
-            m_myInst.callCallback(Py_BuildValue("(iii)", row, col, value));
+        if (wxPyCBH_findCallback(m_myInst, "SetValue")) {
+            wxPyCBH_callCallback(m_myInst, Py_BuildValue("(iii)", row, col, value));
         }
         wxPySaveThread(doSave);
     }
 
     void SetValueAsDouble( int row, int col, double value ) {
         bool doSave = wxPyRestoreThread();
-        if (m_myInst.findCallback("SetValue")) {
-            m_myInst.callCallback(Py_BuildValue("(iid)", row, col, value));
+        if (wxPyCBH_findCallback(m_myInst, "SetValue")) {
+            wxPyCBH_callCallback(m_myInst, Py_BuildValue("(iid)", row, col, value));
         }
         wxPySaveThread(doSave);
     }
index 9c04d9602e51f092c7c8ed145ccfc293c2f86647..e19ad698ea860e0ef7c227653b8e4e9c989b4d06 100644 (file)
@@ -55,7 +55,7 @@ extern PyObject *SWIG_newvarlink(void);
 
 #define SWIG_name    "htmlc"
 
-#include "helpers.h"
+#include "export.h"
 #include <wx/html/htmlwin.h>
 #include <wx/html/htmprint.h>
 #include <wx/image.h>
@@ -113,12 +113,6 @@ static PyObject* t_output_helper(PyObject* target, PyObject* o) {
 
 static char* wxStringErrorMsg = "string type is required for parameter";
 
-//  #ifdef __WXMSW__
-//  wxString wxPyEmptyStr("");
-//  wxPoint wxPyDefaultPosition(wxDefaultPosition);
-//  wxSize wxPyDefaultSize(wxDefaultSize);
-//  #endif
-
 class wxPyHtmlTagHandler : public wxHtmlTagHandler {
 public:
     wxPyHtmlTagHandler() : wxHtmlTagHandler() {};
@@ -228,9 +222,9 @@ IMP_PYCALLBACK__STRING(wxPyHtmlWindow, wxHtmlWindow, OnSetTitle);
 
  void wxPyHtmlWindow::OnLinkClicked(const wxHtmlLinkInfo& link) {
     bool doSave = wxPyRestoreThread();
-    if (m_myInst.findCallback("OnLinkClicked")) {
-        PyObject* obj = wxPyConstructObject((void*)&link, "wxHtmlLinkInfo");
-        m_myInst.callCallback(Py_BuildValue("(O)", obj));
+    if (wxPyCBH_findCallback(m_myInst, "OnLinkClicked")) {
+        PyObject* obj = wxPyConstructObject((void*)&link, "wxHtmlLinkInfo", 0);
+        wxPyCBH_callCallback(m_myInst, Py_BuildValue("(O)", obj));
         Py_DECREF(obj);
     }
     else
@@ -3954,8 +3948,8 @@ static PyObject *_wrap_new_wxHtmlWindow(PyObject *self, PyObject *args, PyObject
     wxPyHtmlWindow * _result;
     wxWindow * _arg0;
     int  _arg1 = (int ) -1;
-    wxPoint * _arg2 = (wxPoint *) &wxPyDefaultPosition;
-    wxSize * _arg3 = (wxSize *) &wxPyDefaultSize;
+    wxPoint * _arg2 = (wxPoint *) &wxDefaultPosition;
+    wxSize * _arg3 = (wxSize *) &wxDefaultSize;
     int  _arg4 = (int ) wxHW_SCROLLBAR_AUTO;
     char * _arg5 = (char *) "htmlWindow";
     PyObject * _argo0 = 0;
index 62f601e4ad7809e48d6ba82f528278183623d979..c9831ae331051fd14ddca2e8449ae0888c8b44f9 100644 (file)
@@ -55,7 +55,7 @@ extern PyObject *SWIG_newvarlink(void);
 
 #define SWIG_name    "htmlhelpc"
 
-#include "helpers.h"
+#include "export.h"
 #include <wx/html/htmlwin.h>
 #include <wx/html/helpctrl.h>
 #include <wx/image.h>
index 55aba98c86bb8e7123e1d3272de4ef67d83897cb..f20e09cbc5b2657106d7d0fda8a29ca83d44d328 100644 (file)
@@ -790,6 +790,135 @@ static PyObject *_wrap_wxDisplayDepth(PyObject *self, PyObject *args, PyObject *
     return _resultobj;
 }
 
+static PyObject *_wrap_wxGetDisplayDepth(PyObject *self, PyObject *args, PyObject *kwargs) {
+    PyObject * _resultobj;
+    int  _result;
+    char *_kwnames[] = {  NULL };
+
+    self = self;
+    if(!PyArg_ParseTupleAndKeywords(args,kwargs,":wxGetDisplayDepth",_kwnames)) 
+        return NULL;
+{
+    wxPy_BEGIN_ALLOW_THREADS;
+        _result = (int )wxGetDisplayDepth();
+
+    wxPy_END_ALLOW_THREADS;
+}    _resultobj = Py_BuildValue("i",_result);
+    return _resultobj;
+}
+
+static PyObject *_wrap_wxDisplaySize(PyObject *self, PyObject *args, PyObject *kwargs) {
+    PyObject * _resultobj;
+    int * _arg0;
+    int  temp;
+    int * _arg1;
+    int  temp0;
+    char *_kwnames[] = {  NULL };
+
+    self = self;
+{
+  _arg0 = &temp;
+}
+{
+  _arg1 = &temp0;
+}
+    if(!PyArg_ParseTupleAndKeywords(args,kwargs,":wxDisplaySize",_kwnames)) 
+        return NULL;
+{
+    wxPy_BEGIN_ALLOW_THREADS;
+        wxDisplaySize(_arg0,_arg1);
+
+    wxPy_END_ALLOW_THREADS;
+}    Py_INCREF(Py_None);
+    _resultobj = Py_None;
+{
+    PyObject *o;
+    o = PyInt_FromLong((long) (*_arg0));
+    _resultobj = t_output_helper(_resultobj, o);
+}
+{
+    PyObject *o;
+    o = PyInt_FromLong((long) (*_arg1));
+    _resultobj = t_output_helper(_resultobj, o);
+}
+    return _resultobj;
+}
+
+static PyObject *_wrap_wxGetDisplaySize(PyObject *self, PyObject *args, PyObject *kwargs) {
+    PyObject * _resultobj;
+    wxSize * _result;
+    char *_kwnames[] = {  NULL };
+    char _ptemp[128];
+
+    self = self;
+    if(!PyArg_ParseTupleAndKeywords(args,kwargs,":wxGetDisplaySize",_kwnames)) 
+        return NULL;
+{
+    wxPy_BEGIN_ALLOW_THREADS;
+        _result = new wxSize (wxGetDisplaySize());
+
+    wxPy_END_ALLOW_THREADS;
+}    SWIG_MakePtr(_ptemp, (void *) _result,"_wxSize_p");
+    _resultobj = Py_BuildValue("s",_ptemp);
+    return _resultobj;
+}
+
+static PyObject *_wrap_wxDisplaySizeMM(PyObject *self, PyObject *args, PyObject *kwargs) {
+    PyObject * _resultobj;
+    int * _arg0;
+    int  temp;
+    int * _arg1;
+    int  temp0;
+    char *_kwnames[] = {  NULL };
+
+    self = self;
+{
+  _arg0 = &temp;
+}
+{
+  _arg1 = &temp0;
+}
+    if(!PyArg_ParseTupleAndKeywords(args,kwargs,":wxDisplaySizeMM",_kwnames)) 
+        return NULL;
+{
+    wxPy_BEGIN_ALLOW_THREADS;
+        wxDisplaySizeMM(_arg0,_arg1);
+
+    wxPy_END_ALLOW_THREADS;
+}    Py_INCREF(Py_None);
+    _resultobj = Py_None;
+{
+    PyObject *o;
+    o = PyInt_FromLong((long) (*_arg0));
+    _resultobj = t_output_helper(_resultobj, o);
+}
+{
+    PyObject *o;
+    o = PyInt_FromLong((long) (*_arg1));
+    _resultobj = t_output_helper(_resultobj, o);
+}
+    return _resultobj;
+}
+
+static PyObject *_wrap_wxGetDisplaySizeMM(PyObject *self, PyObject *args, PyObject *kwargs) {
+    PyObject * _resultobj;
+    wxSize * _result;
+    char *_kwnames[] = {  NULL };
+    char _ptemp[128];
+
+    self = self;
+    if(!PyArg_ParseTupleAndKeywords(args,kwargs,":wxGetDisplaySizeMM",_kwnames)) 
+        return NULL;
+{
+    wxPy_BEGIN_ALLOW_THREADS;
+        _result = new wxSize (wxGetDisplaySizeMM());
+
+    wxPy_END_ALLOW_THREADS;
+}    SWIG_MakePtr(_ptemp, (void *) _result,"_wxSize_p");
+    _resultobj = Py_BuildValue("s",_ptemp);
+    return _resultobj;
+}
+
 static PyObject *_wrap_wxSetCursor(PyObject *self, PyObject *args, PyObject *kwargs) {
     PyObject * _resultobj;
     wxCursor * _arg0;
@@ -6452,6 +6581,11 @@ static PyMethodDef misc2cMethods[] = {
         { "wxFindWindowByName", (PyCFunction) _wrap_wxFindWindowByName, METH_VARARGS | METH_KEYWORDS },
         { "wxFindWindowByLabel", (PyCFunction) _wrap_wxFindWindowByLabel, METH_VARARGS | METH_KEYWORDS },
         { "wxSetCursor", (PyCFunction) _wrap_wxSetCursor, METH_VARARGS | METH_KEYWORDS },
+        { "wxGetDisplaySizeMM", (PyCFunction) _wrap_wxGetDisplaySizeMM, METH_VARARGS | METH_KEYWORDS },
+        { "wxDisplaySizeMM", (PyCFunction) _wrap_wxDisplaySizeMM, METH_VARARGS | METH_KEYWORDS },
+        { "wxGetDisplaySize", (PyCFunction) _wrap_wxGetDisplaySize, METH_VARARGS | METH_KEYWORDS },
+        { "wxDisplaySize", (PyCFunction) _wrap_wxDisplaySize, METH_VARARGS | METH_KEYWORDS },
+        { "wxGetDisplayDepth", (PyCFunction) _wrap_wxGetDisplayDepth, METH_VARARGS | METH_KEYWORDS },
         { "wxDisplayDepth", (PyCFunction) _wrap_wxDisplayDepth, METH_VARARGS | METH_KEYWORDS },
         { "wxColourDisplay", (PyCFunction) _wrap_wxColourDisplay, METH_VARARGS | METH_KEYWORDS },
         { "wxGetNumberFromUser", (PyCFunction) _wrap_wxGetNumberFromUser, METH_VARARGS | METH_KEYWORDS },
index ea88f93e61a6b1532252f953b41f772224d1a9f4..dd70b6014f8d973b3f06bfdaafee0f002e0523b1 100644 (file)
@@ -632,6 +632,22 @@ wxColourDisplay = misc2c.wxColourDisplay
 
 wxDisplayDepth = misc2c.wxDisplayDepth
 
+wxGetDisplayDepth = misc2c.wxGetDisplayDepth
+
+wxDisplaySize = misc2c.wxDisplaySize
+
+def wxGetDisplaySize(*_args, **_kwargs):
+    val = apply(misc2c.wxGetDisplaySize,_args,_kwargs)
+    if val: val = wxSizePtr(val); val.thisown = 1
+    return val
+
+wxDisplaySizeMM = misc2c.wxDisplaySizeMM
+
+def wxGetDisplaySizeMM(*_args, **_kwargs):
+    val = apply(misc2c.wxGetDisplaySizeMM,_args,_kwargs)
+    if val: val = wxSizePtr(val); val.thisown = 1
+    return val
+
 wxSetCursor = misc2c.wxSetCursor
 
 def wxFindWindowByLabel(*_args, **_kwargs):
index 03558621affaafecd410cbc5d57c435033ae609d..c869ce2ebf2cc324b02a1b910094e8ee1c163cdc 100644 (file)
@@ -55,7 +55,7 @@ extern PyObject *SWIG_newvarlink(void);
 
 #define SWIG_name    "utilsc"
 
-#include "helpers.h"
+#include "export.h"
 #include <wx/config.h>
 #include <wx/fileconf.h>
 #include <wx/datetime.h>
@@ -108,6 +108,8 @@ static PyObject* t_output_helper(PyObject* target, PyObject* o) {
 
 static char* wxStringErrorMsg = "string type is required for parameter";
 
+    static wxString wxPyEmptyStr("");
+
     static PyObject* __EnumerationHelper(bool flag, wxString& str, long index) {
         PyObject* ret = PyTuple_New(3);
         if (ret) {
index 0b7f33e6faca4c9d789bd8a6c37a9c78a4667504..cabfca1b1db9f94ed900b4073c1d23164a61758b 100644 (file)
@@ -623,6 +623,8 @@ PyObject *ptrfree(PyObject *_PTRVALUE) {
         __wxCleanup();
     }
 
+
+
 extern "C" SWIGEXPORT(void) initwindowsc();
 extern "C" SWIGEXPORT(void) initwindows2c();
 extern "C" SWIGEXPORT(void) initeventsc();
@@ -640,17 +642,49 @@ extern "C" SWIGEXPORT(void) initimagec();
 extern "C" SWIGEXPORT(void) initprintfwc();
 extern "C" SWIGEXPORT(void) initsizersc();
 extern "C" SWIGEXPORT(void) initclip_dndc();
-extern "C" SWIGEXPORT(void) initgridc();
-extern "C" SWIGEXPORT(void) initutilsc();
-extern "C" SWIGEXPORT(void) inithtmlc();
-extern "C" SWIGEXPORT(void) inithtmlhelpc();
-extern "C" SWIGEXPORT(void) initcalendarc();
 extern "C" SWIGEXPORT(void) initstreamsc();
 extern "C" SWIGEXPORT(void) initfilesysc();
 
-extern "C" SWIGEXPORT(void) initglcanvasc();
-extern "C" SWIGEXPORT(void) initoglc();
-extern "C" SWIGEXPORT(void) initstc_c();
+
+
+// Export a C API in a struct.  Other modules will be able to load this from
+// the wxc module and will then have safe access to these functions, even if
+// in another shared library.
+static wxPyCoreAPI API = {
+    SWIG_MakePtr,
+    SWIG_GetPtr,
+    SWIG_GetPtrObj,
+    SWIG_RegisterMapping,
+    SWIG_addvarlink,
+    SWIG_newvarlink,
+
+    wxPySaveThread,
+    wxPyRestoreThread,
+    wxPyConstructObject,
+    wxPy_ConvertList,
+
+    byte_LIST_helper,
+    int_LIST_helper,
+    long_LIST_helper,
+    string_LIST_helper,
+    wxPoint_LIST_helper,
+    wxBitmap_LIST_helper,
+    wxString_LIST_helper,
+    wxAcceleratorEntry_LIST_helper,
+
+    wxSize_helper,
+    wxPoint_helper,
+    wxRealPoint_helper,
+    wxRect_helper,
+    wxColour_helper,
+
+    wxPyCBH_setSelf,
+    wxPyCBH_findCallback,
+    wxPyCBH_callCallback,
+    wxPyCBH_callCallbackObj,
+    wxPyCBH_delete,
+};
+
 #ifdef __cplusplus
 extern "C" {
 #endif
@@ -2981,6 +3015,12 @@ SWIGEXPORT(void) initwxc() {
         SWIG_addvarlink(SWIG_globals,"wxPyDefaultPosition",_wrap_wxPyDefaultPosition_get, _wrap_wxPyDefaultPosition_set);
         SWIG_addvarlink(SWIG_globals,"wxPyDefaultSize",_wrap_wxPyDefaultSize_get, _wrap_wxPyDefaultSize_set);
 
+    // Make our API structure a CObject so other modules can import it
+    // from this module.
+    PyObject* v = PyCObject_FromVoidPtr(&API, NULL);
+    PyDict_SetItemString(d,"wxPyCoreAPI", v);
+    Py_XDECREF(v);
+
 
     __wxPreStart();     // initialize the GUI toolkit, if needed.
 
@@ -3008,15 +3048,6 @@ SWIGEXPORT(void) initwxc() {
     initstreamsc();
     initfilesysc();
 
-    initgridc();
-    initutilsc();
-    inithtmlc();
-    inithtmlhelpc();
-    initcalendarc();
-
-    initglcanvasc();
-    initoglc();
-    initstc_c();
 {
    int i;
    for (i = 0; _swig_mapping[i].n1; i++)
index 7566f336c7527a947caa25f915fa4c61988216bf..a7646992a49d741177479d841c21fe208edf3cd0 100644 (file)
@@ -14,7 +14,7 @@
 %module utils
 
 %{
-#include "helpers.h"
+#include "export.h"
 #include <wx/config.h>
 #include <wx/fileconf.h>
 #include <wx/datetime.h>
@@ -34,6 +34,8 @@
 //---------------------------------------------------------------------------
 
 %{
+    static wxString wxPyEmptyStr("");
+
     static PyObject* __EnumerationHelper(bool flag, wxString& str, long index) {
         PyObject* ret = PyTuple_New(3);
         if (ret) {
index 41e0f7f90d9de1d729402cf2892d83513c4b8426..a9078d9b448d3ef7ee3c1eb60fb572ad6f67cacc 100644 (file)
@@ -124,6 +124,8 @@ public:
 //----------------------------------------------------------------------
 
 %{
+
+
 extern "C" SWIGEXPORT(void) initwindowsc();
 extern "C" SWIGEXPORT(void) initwindows2c();
 extern "C" SWIGEXPORT(void) initeventsc();
@@ -141,22 +143,60 @@ extern "C" SWIGEXPORT(void) initimagec();
 extern "C" SWIGEXPORT(void) initprintfwc();
 extern "C" SWIGEXPORT(void) initsizersc();
 extern "C" SWIGEXPORT(void) initclip_dndc();
-extern "C" SWIGEXPORT(void) initgridc();
-extern "C" SWIGEXPORT(void) initutilsc();
-extern "C" SWIGEXPORT(void) inithtmlc();
-extern "C" SWIGEXPORT(void) inithtmlhelpc();
-extern "C" SWIGEXPORT(void) initcalendarc();
 extern "C" SWIGEXPORT(void) initstreamsc();
 extern "C" SWIGEXPORT(void) initfilesysc();
 
-extern "C" SWIGEXPORT(void) initglcanvasc();
-extern "C" SWIGEXPORT(void) initoglc();
-extern "C" SWIGEXPORT(void) initstc_c();
+
+
+// Export a C API in a struct.  Other modules will be able to load this from
+// the wxc module and will then have safe access to these functions, even if
+// in another shared library.
+static wxPyCoreAPI API = {
+    SWIG_MakePtr,
+    SWIG_GetPtr,
+    SWIG_GetPtrObj,
+    SWIG_RegisterMapping,
+    SWIG_addvarlink,
+    SWIG_newvarlink,
+
+    wxPySaveThread,
+    wxPyRestoreThread,
+    wxPyConstructObject,
+    wxPy_ConvertList,
+
+    byte_LIST_helper,
+    int_LIST_helper,
+    long_LIST_helper,
+    string_LIST_helper,
+    wxPoint_LIST_helper,
+    wxBitmap_LIST_helper,
+    wxString_LIST_helper,
+    wxAcceleratorEntry_LIST_helper,
+
+    wxSize_helper,
+    wxPoint_helper,
+    wxRealPoint_helper,
+    wxRect_helper,
+    wxColour_helper,
+
+    wxPyCBH_setSelf,
+    wxPyCBH_findCallback,
+    wxPyCBH_callCallback,
+    wxPyCBH_callCallbackObj,
+    wxPyCBH_delete,
+};
+
 %}
 
 
 
 %init %{
+    // Make our API structure a CObject so other modules can import it
+    // from this module.
+    PyObject* v = PyCObject_FromVoidPtr(&API, NULL);
+    PyDict_SetItemString(d,"wxPyCoreAPI", v);
+    Py_XDECREF(v);
+
 
     __wxPreStart();     // initialize the GUI toolkit, if needed.
 
@@ -184,15 +224,6 @@ extern "C" SWIGEXPORT(void) initstc_c();
     initstreamsc();
     initfilesysc();
 
-    initgridc();
-    initutilsc();
-    inithtmlc();
-    inithtmlhelpc();
-    initcalendarc();
-
-    initglcanvasc();
-    initoglc();
-    initstc_c();
 %}
 
 //----------------------------------------------------------------------