From 6e2129f90f06ac57918023898392a8f3020b2a22 Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Thu, 2 May 2002 02:46:14 +0000 Subject: [PATCH] Changed the name of export.h to wxPython.h so it wouldn't be so generic. This is the header that should be included by 3rd party stuff that is embedding wxPython or making a new wxPython extension module. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@15327 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- wxPython/contrib/dllwidget/dllwidget_.cpp | 2 +- wxPython/contrib/dllwidget/dllwidget_.i | 2 +- wxPython/contrib/gizmos/gizmos.cpp | 2 +- wxPython/contrib/gizmos/gizmos.i | 2 +- wxPython/contrib/glcanvas/glcanvas.i | 2 +- wxPython/contrib/glcanvas/msw/glcanvas.cpp | 2 +- wxPython/contrib/ogl/ogl.cpp | 2 +- wxPython/contrib/ogl/ogl.i | 2 +- wxPython/contrib/ogl/oglbasic.cpp | 2 +- wxPython/contrib/ogl/oglbasic.i | 2 +- wxPython/contrib/ogl/oglcanvas.cpp | 2 +- wxPython/contrib/ogl/oglcanvas.i | 2 +- wxPython/contrib/ogl/oglshapes.cpp | 2 +- wxPython/contrib/ogl/oglshapes.i | 2 +- wxPython/contrib/ogl/oglshapes2.cpp | 2 +- wxPython/contrib/ogl/oglshapes2.i | 2 +- wxPython/contrib/stc/msw/stc_.cpp | 2 +- wxPython/contrib/stc/stc_.i | 2 +- wxPython/contrib/xrc/xrc.cpp | 2 +- wxPython/contrib/xrc/xrc.i | 2 +- wxPython/src/calendar.i | 2 +- wxPython/src/grid.i | 2 +- wxPython/src/help.i | 2 +- wxPython/src/html.i | 2 +- wxPython/src/htmlhelp.i | 2 +- wxPython/src/msw/calendar.cpp | 2 +- wxPython/src/msw/grid.cpp | 2 +- wxPython/src/msw/help.cpp | 2 +- wxPython/src/msw/html.cpp | 2 +- wxPython/src/msw/htmlhelp.cpp | 2 +- wxPython/src/msw/wx.cpp | 2 +- wxPython/src/{export.h => wxPython.h} | 18 +++++++++++++++--- 32 files changed, 46 insertions(+), 34 deletions(-) rename wxPython/src/{export.h => wxPython.h} (87%) diff --git a/wxPython/contrib/dllwidget/dllwidget_.cpp b/wxPython/contrib/dllwidget/dllwidget_.cpp index a9da25d14b..9137b4dab8 100644 --- a/wxPython/contrib/dllwidget/dllwidget_.cpp +++ b/wxPython/contrib/dllwidget/dllwidget_.cpp @@ -55,7 +55,7 @@ extern PyObject *SWIG_newvarlink(void); #define SWIG_name "dllwidget_c" -#include "export.h" +#include "wxPython.h" #include "dllwidget.h" diff --git a/wxPython/contrib/dllwidget/dllwidget_.i b/wxPython/contrib/dllwidget/dllwidget_.i index e2e486942c..28b39290ad 100644 --- a/wxPython/contrib/dllwidget/dllwidget_.i +++ b/wxPython/contrib/dllwidget/dllwidget_.i @@ -14,7 +14,7 @@ %{ -#include "export.h" +#include "wxPython.h" #include "dllwidget.h" %} diff --git a/wxPython/contrib/gizmos/gizmos.cpp b/wxPython/contrib/gizmos/gizmos.cpp index ed145eed3b..75b392e578 100644 --- a/wxPython/contrib/gizmos/gizmos.cpp +++ b/wxPython/contrib/gizmos/gizmos.cpp @@ -55,7 +55,7 @@ extern PyObject *SWIG_newvarlink(void); #define SWIG_name "gizmosc" -#include "export.h" +#include "wxPython.h" #include #include #include diff --git a/wxPython/contrib/gizmos/gizmos.i b/wxPython/contrib/gizmos/gizmos.i index 239a195b03..b5348751cc 100644 --- a/wxPython/contrib/gizmos/gizmos.i +++ b/wxPython/contrib/gizmos/gizmos.i @@ -14,7 +14,7 @@ %{ -#include "export.h" +#include "wxPython.h" #include #include #include diff --git a/wxPython/contrib/glcanvas/glcanvas.i b/wxPython/contrib/glcanvas/glcanvas.i index b51b3fb5f1..3b15de59f9 100644 --- a/wxPython/contrib/glcanvas/glcanvas.i +++ b/wxPython/contrib/glcanvas/glcanvas.i @@ -14,7 +14,7 @@ %module glcanvas %{ -#include "export.h" +#include "wxPython.h" #ifdef __WXMSW__ #include "myglcanvas.h" #else diff --git a/wxPython/contrib/glcanvas/msw/glcanvas.cpp b/wxPython/contrib/glcanvas/msw/glcanvas.cpp index c103574fff..5d7ac821aa 100644 --- a/wxPython/contrib/glcanvas/msw/glcanvas.cpp +++ b/wxPython/contrib/glcanvas/msw/glcanvas.cpp @@ -55,7 +55,7 @@ extern PyObject *SWIG_newvarlink(void); #define SWIG_name "glcanvasc" -#include "export.h" +#include "wxPython.h" #ifdef __WXMSW__ #include "myglcanvas.h" #else diff --git a/wxPython/contrib/ogl/ogl.cpp b/wxPython/contrib/ogl/ogl.cpp index abd1f2f04e..da700b564f 100644 --- a/wxPython/contrib/ogl/ogl.cpp +++ b/wxPython/contrib/ogl/ogl.cpp @@ -55,7 +55,7 @@ extern PyObject *SWIG_newvarlink(void); #define SWIG_name "oglc" -#include "export.h" +#include "wxPython.h" #include "oglhelpers.h" diff --git a/wxPython/contrib/ogl/ogl.i b/wxPython/contrib/ogl/ogl.i index 0d66d65282..b23154b679 100644 --- a/wxPython/contrib/ogl/ogl.i +++ b/wxPython/contrib/ogl/ogl.i @@ -14,7 +14,7 @@ %module ogl %{ -#include "export.h" +#include "wxPython.h" #include "oglhelpers.h" %} diff --git a/wxPython/contrib/ogl/oglbasic.cpp b/wxPython/contrib/ogl/oglbasic.cpp index 7bc2a3787c..ab32951076 100644 --- a/wxPython/contrib/ogl/oglbasic.cpp +++ b/wxPython/contrib/ogl/oglbasic.cpp @@ -55,7 +55,7 @@ extern PyObject *SWIG_newvarlink(void); #define SWIG_name "oglbasicc" -#include "export.h" +#include "wxPython.h" #include "oglhelpers.h" diff --git a/wxPython/contrib/ogl/oglbasic.i b/wxPython/contrib/ogl/oglbasic.i index 8fd19b783b..806c6b32ec 100644 --- a/wxPython/contrib/ogl/oglbasic.i +++ b/wxPython/contrib/ogl/oglbasic.i @@ -14,7 +14,7 @@ %module oglbasic %{ -#include "export.h" +#include "wxPython.h" #include "oglhelpers.h" %} diff --git a/wxPython/contrib/ogl/oglcanvas.cpp b/wxPython/contrib/ogl/oglcanvas.cpp index a3feab52c1..b5af2a3820 100644 --- a/wxPython/contrib/ogl/oglcanvas.cpp +++ b/wxPython/contrib/ogl/oglcanvas.cpp @@ -55,7 +55,7 @@ extern PyObject *SWIG_newvarlink(void); #define SWIG_name "oglcanvasc" -#include "export.h" +#include "wxPython.h" #include "oglhelpers.h" diff --git a/wxPython/contrib/ogl/oglcanvas.i b/wxPython/contrib/ogl/oglcanvas.i index a2dd8f59b8..c2005ce1bc 100644 --- a/wxPython/contrib/ogl/oglcanvas.i +++ b/wxPython/contrib/ogl/oglcanvas.i @@ -14,7 +14,7 @@ %module oglcanvas %{ -#include "export.h" +#include "wxPython.h" #include "oglhelpers.h" %} diff --git a/wxPython/contrib/ogl/oglshapes.cpp b/wxPython/contrib/ogl/oglshapes.cpp index 7291643ace..7e4c39f2d5 100644 --- a/wxPython/contrib/ogl/oglshapes.cpp +++ b/wxPython/contrib/ogl/oglshapes.cpp @@ -55,7 +55,7 @@ extern PyObject *SWIG_newvarlink(void); #define SWIG_name "oglshapesc" -#include "export.h" +#include "wxPython.h" #include "oglhelpers.h" diff --git a/wxPython/contrib/ogl/oglshapes.i b/wxPython/contrib/ogl/oglshapes.i index 84e2376787..38fd4dab8a 100644 --- a/wxPython/contrib/ogl/oglshapes.i +++ b/wxPython/contrib/ogl/oglshapes.i @@ -14,7 +14,7 @@ %module oglshapes %{ -#include "export.h" +#include "wxPython.h" #include "oglhelpers.h" %} diff --git a/wxPython/contrib/ogl/oglshapes2.cpp b/wxPython/contrib/ogl/oglshapes2.cpp index 641bff8b01..d23ae73f62 100644 --- a/wxPython/contrib/ogl/oglshapes2.cpp +++ b/wxPython/contrib/ogl/oglshapes2.cpp @@ -55,7 +55,7 @@ extern PyObject *SWIG_newvarlink(void); #define SWIG_name "oglshapes2c" -#include "export.h" +#include "wxPython.h" #include "oglhelpers.h" diff --git a/wxPython/contrib/ogl/oglshapes2.i b/wxPython/contrib/ogl/oglshapes2.i index 22145b2f78..2cb69e5a43 100644 --- a/wxPython/contrib/ogl/oglshapes2.i +++ b/wxPython/contrib/ogl/oglshapes2.i @@ -14,7 +14,7 @@ %module oglshapes2 %{ -#include "export.h" +#include "wxPython.h" #include "oglhelpers.h" %} diff --git a/wxPython/contrib/stc/msw/stc_.cpp b/wxPython/contrib/stc/msw/stc_.cpp index ed6e85e081..97b37af3ca 100644 --- a/wxPython/contrib/stc/msw/stc_.cpp +++ b/wxPython/contrib/stc/msw/stc_.cpp @@ -55,7 +55,7 @@ extern PyObject *SWIG_newvarlink(void); #define SWIG_name "stc_c" -#include "export.h" +#include "wxPython.h" #include "wx/stc/stc.h" diff --git a/wxPython/contrib/stc/stc_.i b/wxPython/contrib/stc/stc_.i index c92d6ebce1..32f05e9e72 100644 --- a/wxPython/contrib/stc/stc_.i +++ b/wxPython/contrib/stc/stc_.i @@ -14,7 +14,7 @@ %{ -#include "export.h" +#include "wxPython.h" #include "wx/stc/stc.h" %} diff --git a/wxPython/contrib/xrc/xrc.cpp b/wxPython/contrib/xrc/xrc.cpp index 175c7a154d..cb13ed9d33 100644 --- a/wxPython/contrib/xrc/xrc.cpp +++ b/wxPython/contrib/xrc/xrc.cpp @@ -55,7 +55,7 @@ extern PyObject *SWIG_newvarlink(void); #define SWIG_name "xrcc" -#include "export.h" +#include "wxPython.h" #include "wx/xrc/xmlres.h" diff --git a/wxPython/contrib/xrc/xrc.i b/wxPython/contrib/xrc/xrc.i index 3e6869004f..692f777545 100644 --- a/wxPython/contrib/xrc/xrc.i +++ b/wxPython/contrib/xrc/xrc.i @@ -14,7 +14,7 @@ %{ -#include "export.h" +#include "wxPython.h" #include "wx/xrc/xmlres.h" %} diff --git a/wxPython/src/calendar.i b/wxPython/src/calendar.i index 6c5b1a4be6..96add9859b 100644 --- a/wxPython/src/calendar.i +++ b/wxPython/src/calendar.i @@ -14,7 +14,7 @@ %{ -#include "export.h" +#include "wxPython.h" #include %} diff --git a/wxPython/src/grid.i b/wxPython/src/grid.i index f09c7d0642..09db772abf 100644 --- a/wxPython/src/grid.i +++ b/wxPython/src/grid.i @@ -15,7 +15,7 @@ #ifndef OLD_GRID %{ -#include "export.h" +#include "wxPython.h" #include #include %} diff --git a/wxPython/src/help.i b/wxPython/src/help.i index f7f6c5a7be..ea1bb8ad54 100644 --- a/wxPython/src/help.i +++ b/wxPython/src/help.i @@ -13,7 +13,7 @@ %module help %{ -#include "export.h" +#include "wxPython.h" #include %} diff --git a/wxPython/src/html.i b/wxPython/src/html.i index 9fc0835024..bb978a43d9 100644 --- a/wxPython/src/html.i +++ b/wxPython/src/html.i @@ -14,7 +14,7 @@ %module html %{ -#include "export.h" +#include "wxPython.h" #include #include #include diff --git a/wxPython/src/htmlhelp.i b/wxPython/src/htmlhelp.i index 7e8612b8dd..b74d65fb9f 100644 --- a/wxPython/src/htmlhelp.i +++ b/wxPython/src/htmlhelp.i @@ -14,7 +14,7 @@ %module htmlhelp %{ -#include "export.h" +#include "wxPython.h" #include #include #include diff --git a/wxPython/src/msw/calendar.cpp b/wxPython/src/msw/calendar.cpp index 9da116f721..046a052370 100644 --- a/wxPython/src/msw/calendar.cpp +++ b/wxPython/src/msw/calendar.cpp @@ -55,7 +55,7 @@ extern PyObject *SWIG_newvarlink(void); #define SWIG_name "calendarc" -#include "export.h" +#include "wxPython.h" #include diff --git a/wxPython/src/msw/grid.cpp b/wxPython/src/msw/grid.cpp index 1b307e707e..4b890d14cf 100644 --- a/wxPython/src/msw/grid.cpp +++ b/wxPython/src/msw/grid.cpp @@ -55,7 +55,7 @@ extern PyObject *SWIG_newvarlink(void); #define SWIG_name "gridc" -#include "export.h" +#include "wxPython.h" #include #include diff --git a/wxPython/src/msw/help.cpp b/wxPython/src/msw/help.cpp index 5115a5c680..c07bd62233 100644 --- a/wxPython/src/msw/help.cpp +++ b/wxPython/src/msw/help.cpp @@ -55,7 +55,7 @@ extern PyObject *SWIG_newvarlink(void); #define SWIG_name "helpc" -#include "export.h" +#include "wxPython.h" #include diff --git a/wxPython/src/msw/html.cpp b/wxPython/src/msw/html.cpp index e56500ea41..82788159f1 100644 --- a/wxPython/src/msw/html.cpp +++ b/wxPython/src/msw/html.cpp @@ -55,7 +55,7 @@ extern PyObject *SWIG_newvarlink(void); #define SWIG_name "htmlc" -#include "export.h" +#include "wxPython.h" #include #include #include diff --git a/wxPython/src/msw/htmlhelp.cpp b/wxPython/src/msw/htmlhelp.cpp index c61bf78725..8f2b5a589a 100644 --- a/wxPython/src/msw/htmlhelp.cpp +++ b/wxPython/src/msw/htmlhelp.cpp @@ -55,7 +55,7 @@ extern PyObject *SWIG_newvarlink(void); #define SWIG_name "htmlhelpc" -#include "export.h" +#include "wxPython.h" #include #include #include diff --git a/wxPython/src/msw/wx.cpp b/wxPython/src/msw/wx.cpp index 186031e5f9..cc298bcb4f 100644 --- a/wxPython/src/msw/wx.cpp +++ b/wxPython/src/msw/wx.cpp @@ -596,7 +596,7 @@ PyObject *ptrfree(PyObject *_PTRVALUE) { wxPyApp* wxGetApp() { //return wxPythonApp; - return (wxPyApp*)wxGetApp(); + return (wxPyApp*)wxTheApp; } void wxApp_CleanUp() { diff --git a/wxPython/src/export.h b/wxPython/src/wxPython.h similarity index 87% rename from wxPython/src/export.h rename to wxPython/src/wxPython.h index a38a1c7a67..934894b2a7 100644 --- a/wxPython/src/export.h +++ b/wxPython/src/wxPython.h @@ -1,8 +1,8 @@ //////////////////////////////////////////////////////////////////////////// -// Name: export.h +// Name: wxPython.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. +// wxPython extension--or from 3rd party apps and modules--in +// order to get access to some helper functions that live in wxc. // // Author: Robin Dunn // @@ -17,16 +17,28 @@ //---------------------------------------------------------------------- +// TODO: Make it so this and helpers.h are installed to +// the wx include path... + #define wxPyUSE_EXPORT #include "helpers.h" +//---------------------------------------------------------------------- +// This needs to be called in modules that need to make calls to any +// of the functions exported by the wxPython API. It sets a static +// pointer to a structure of function pointers located in wxc. static void wxPyCoreAPI_IMPORT() { wxPyCoreAPIPtr = (wxPyCoreAPI*)PyCObject_Import("wxPython.wxc", "wxPyCoreAPI"); if (! wxPyCoreAPIPtr) wxPyCoreAPIPtr = (wxPyCoreAPI*)PyCObject_Import("wxc", "wxPyCoreAPI"); } + + +// The following macros actually call functions of the same name located +// in the wxc extension module via the API pointer retieved above. + #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)) -- 2.45.2