]>
git.saurik.com Git - wxWidgets.git/blob - wxPython/include/wx/wxPython/wxPython.h
dda85883aab218ffbf642fe98c3a826e9f76fc3c
   1 //////////////////////////////////////////////////////////////////////////// 
   3 // Purpose:     To be used from modules that are not part of the core 
   4 //              wxPython extension--or from 3rd party apps and modules--in 
   5 //              order to get access to the wxPython API (some helper 
   6 //              functions and such) that lives in the wx.core module 
  10 // Created:     14-Dec-2000 
  12 // Copyright:   (c) 2000 by Total Control Software 
  13 // Licence:     wxWindows license 
  14 ///////////////////////////////////////////////////////////////////////////// 
  16 #ifndef __wxp_export__ 
  17 #define __wxp_export__ 
  19 //---------------------------------------------------------------------- 
  21 #define wxPyUSE_EXPORTED_API 
  22 #include "wx/wxPython/wxPython_int.h" 
  24 //---------------------------------------------------------------------- 
  26 // wxPyCoreAPI_IMPORT can be called in extension modules or embedding 
  27 // applications in order to preload the API pointer, and then handle error 
  28 // conditions if it is not able to be loaded for any reason.  If the import 
  29 // fails or there is any other Python related problem then there will be a 
  30 // Python exception set that can be checked with PyErr_Occurred and/or 
  33 // Returns true on success, false if there was an error. 
  35 // See also the definition of the wxPyCoreAPI struct in wxPython_int.h 
  37 static bool wxPyCoreAPI_IMPORT() 
  39     wxPyCoreAPIPtr 
= (wxPyCoreAPI
*)PyCObject_Import("wx._core_", "_wxPyCoreAPI"); 
  40     return wxPyCoreAPIPtr 
!= NULL
; 
  44 // Used by the macros below to fetch the API pointer, importing it first if 
  45 // needed.  This should never need to be called directly. 
  46 inline wxPyCoreAPI
* wxPyGetCoreAPIPtr() 
  48     if (wxPyCoreAPIPtr 
== NULL
) wxPyCoreAPI_IMPORT(); 
  49     // wxASSERT_MSW(wxPyCoreAPIPtr != NULL, wxT("wxPyCoreAPIPtr is NULL!!!"));  // uncomment when needed for debugging 
  50     return wxPyCoreAPIPtr
; 
  54 // The following macros call functions located in wx._core_ of the same name 
  55 // via the API pointer retrieved above.  TODO: Should these be made into 
  58 #define SWIG_Python_TypeRegister(a)             (wxPyGetCoreAPIPtr()->p_SWIG_Python_TypeRegister(a)) 
  59 #define SWIG_Python_TypeCheck(a,b)              (wxPyGetCoreAPIPtr()->p_SWIG_Python_TypeCheck(a,b)) 
  60 #define SWIG_Python_TypeCast(a,b)               (wxPyGetCoreAPIPtr()->p_SWIG_Python_TypeCast(a,b)) 
  61 #define SWIG_Python_TypeDynamicCast(a,b)        (wxPyGetCoreAPIPtr()->p_SWIG_Python_TypeDynamicCast(a,b)) 
  62 #define SWIG_Python_TypeName(a)                 (wxPyGetCoreAPIPtr()->p_SWIG_Python_TypeName(a)) 
  63 #define SWIG_Python_TypeQuery(a)                (wxPyGetCoreAPIPtr()->p_SWIG_Python_TypeQuery(a)) 
  64 #define SWIG_Python_TypeClientData(a,b)         (wxPyGetCoreAPIPtr()->p_SWIG_Python_TypeClientData(a,b)) 
  65 #define SWIG_Python_newvarlink()                (wxPyGetCoreAPIPtr()->p_SWIG_Python_newvarlink()) 
  66 #define SWIG_Python_addvarlink(a,b,c,d)         (wxPyGetCoreAPIPtr()->p_SWIG_Python_addvarlink(a,b,c,d)) 
  67 #define SWIG_Python_ConvertPtr(a,b,c,d)         (wxPyGetCoreAPIPtr()->p_SWIG_Python_ConvertPtr(a,b,c,d)) 
  68 #define SWIG_Python_ConvertPacked(a,b,c,d,e)    (wxPyGetCoreAPIPtr()->p_SWIG_Python_ConvertPacked(a,b,c,d,e)) 
  69 #define SWIG_Python_PackData(a,b,c)             (wxPyGetCoreAPIPtr()->p_SWIG_Python_PackData(a,b,c)) 
  70 #define SWIG_Python_UnpackData(a,b,c)           (wxPyGetCoreAPIPtr()->p_SWIG_Python_UnpackData(a,b,c)) 
  71 #define SWIG_Python_NewPointerObj(a,b,c)        (wxPyGetCoreAPIPtr()->p_SWIG_Python_NewPointerObj(a,b,c)) 
  72 #define SWIG_Python_NewPackedObj(a,b,c)         (wxPyGetCoreAPIPtr()->p_SWIG_Python_NewPackedObj(a,b,c)) 
  73 #define SWIG_Python_InstallConstants(a,b)       (wxPyGetCoreAPIPtr()->p_SWIG_Python_InstallConstants(a,b)) 
  74 #define SWIG_Python_MustGetPtr(a,b,c,d)         (wxPyGetCoreAPIPtr()->p_SWIG_Python_MustGetPtr(a,b,c,d)) 
  76 #define wxPyCheckSwigType(a)                    (wxPyGetCoreAPIPtr()->p_wxPyCheckSwigType(a)) 
  77 #define wxPyConstructObject(a,b,c)              (wxPyGetCoreAPIPtr()->p_wxPyConstructObject(a,b,c)) 
  78 #define wxPyConvertSwigPtr(a,b,c)               (wxPyGetCoreAPIPtr()->p_wxPyConvertSwigPtr(a,b,c)) 
  79 #define wxPyMakeSwigPtr(a,b)                    (wxPyGetCoreAPIPtr()->p_wxPyMakeSwigPtr(a,b)) 
  81 #define wxPyBeginAllowThreads()                 (wxPyGetCoreAPIPtr()->p_wxPyBeginAllowThreads()) 
  82 #define wxPyEndAllowThreads(a)                  (wxPyGetCoreAPIPtr()->p_wxPyEndAllowThreads(a)) 
  83 #define wxPyBeginBlockThreads()                 (wxPyGetCoreAPIPtr()->p_wxPyBeginBlockThreads()) 
  84 #define wxPyEndBlockThreads(a)                  (wxPyGetCoreAPIPtr()->p_wxPyEndBlockThreads(a)) 
  86 #define wxPyConstructObject(a,b,c)              (wxPyGetCoreAPIPtr()->p_wxPyConstructObject(a,b,c)) 
  87 #define wxPy_ConvertList(a)                     (wxPyGetCoreAPIPtr()->p_wxPy_ConvertList(a)) 
  89 #define wxString_in_helper(a)                   (wxPyGetCoreAPIPtr()->p_wxString_in_helper(a)) 
  90 #define Py2wxString(a)                          (wxPyGetCoreAPIPtr()->p_Py2wxString(a)) 
  91 #define wx2PyString(a)                          (wxPyGetCoreAPIPtr()->p_wx2PyString(a)) 
  93 #define byte_LIST_helper(a)                     (wxPyGetCoreAPIPtr()->p_byte_LIST_helper(a)) 
  94 #define int_LIST_helper(a)                      (wxPyGetCoreAPIPtr()->p_int_LIST_helper(a)) 
  95 #define long_LIST_helper(a)                     (wxPyGetCoreAPIPtr()->p_long_LIST_helper(a)) 
  96 #define string_LIST_helper(a)                   (wxPyGetCoreAPIPtr()->p_string_LIST_helper(a)) 
  97 #define wxPoint_LIST_helper(a,b)                (wxPyGetCoreAPIPtr()->p_wxPoint_LIST_helper(a, b)) 
  98 #define wxBitmap_LIST_helper(a)                 (wxPyGetCoreAPIPtr()->p_wxBitmap_LIST_helper(a)) 
  99 #define wxString_LIST_helper(a)                 (wxPyGetCoreAPIPtr()->p_wxString_LIST_helper(a)) 
 100 #define wxAcceleratorEntry_LIST_helper(a)       (wxPyGetCoreAPIPtr()->p_wxAcceleratorEntry_LIST_helper(a)) 
 102 #define wxSize_helper(a,b)                      (wxPyGetCoreAPIPtr()->p_wxSize_helper(a,b)) 
 103 #define wxPoint_helper(a,b)                     (wxPyGetCoreAPIPtr()->p_wxPoint_helper(a,b)) 
 104 #define wxRealPoint_helper(a,b)                 (wxPyGetCoreAPIPtr()->p_wxRealPoint_helper(a,b)) 
 105 #define wxRect_helper(a,b)                      (wxPyGetCoreAPIPtr()->p_wxRect_helper(a,b)) 
 106 #define wxColour_helper(a,b)                    (wxPyGetCoreAPIPtr()->p_wxColour_helper(a,b)) 
 107 #define wxPoint2D_helper(a,b)                   (wxPyGetCoreAPIPtr()->p_wxPoint2D_helper(a,b)) 
 109 #define wxPySimple_typecheck(a,b,c)             (wxPyGetCoreAPIPtr()->p_wxPySimple_typecheck(a,b,c)) 
 110 #define wxColour_typecheck(a)                   (wxPyGetCoreAPIPtr()->p_wxColour_typecheck(a)) 
 112 #define wxPyCBH_setCallbackInfo(a, b, c, d)     (wxPyGetCoreAPIPtr()->p_wxPyCBH_setCallbackInfo(a,b,c,d)) 
 113 #define wxPyCBH_findCallback(a, b)              (wxPyGetCoreAPIPtr()->p_wxPyCBH_findCallback(a, b)) 
 114 #define wxPyCBH_callCallback(a, b)              (wxPyGetCoreAPIPtr()->p_wxPyCBH_callCallback(a, b)) 
 115 #define wxPyCBH_callCallbackObj(a, b)           (wxPyGetCoreAPIPtr()->p_wxPyCBH_callCallbackObj(a, b)) 
 116 #define wxPyCBH_delete(a)                       (wxPyGetCoreAPIPtr()->p_wxPyCBH_delete(a)) 
 118 #define wxPyMake_wxObject(a,b)                  (wxPyGetCoreAPIPtr()->p_wxPyMake_wxObject(a,b,true)) 
 119 #define wxPyMake_wxObject2(a,b,c)               (wxPyGetCoreAPIPtr()->p_wxPyMake_wxObject(a,b,c)) 
 120 #define wxPyMake_wxSizer(a,b)                   (wxPyGetCoreAPIPtr()->p_wxPyMake_wxSizer(a,b)) 
 121 #define wxPyPtrTypeMap_Add(a, b)                (wxPyGetCoreAPIPtr()->p_wxPyPtrTypeMap_Add(a, b)) 
 122 #define wxPy2int_seq_helper(a, b, c)            (wxPyGetCoreAPIPtr()->p_wxPy2int_seq_helper(a, b, c)) 
 123 #define wxPy4int_seq_helper(a, b, c, d, e)      (wxPyGetCoreAPIPtr()->p_wxPy4int_seq_helper(a, b, c, d, e)) 
 124 #define wxArrayString2PyList_helper(a)          (wxPyGetCoreAPIPtr()->p_wxArrayString2PyList_helper(a)) 
 125 #define wxArrayInt2PyList_helper(a)             (wxPyGetCoreAPIPtr()->p_wxArrayInt2PyList_helper(a)) 
 127 #define wxPyClientData_dtor(a)                  (wxPyGetCoreAPIPtr()->p_wxPyClientData_dtor(a)) 
 128 #define wxPyUserData_dtor(a)                    (wxPyGetCoreAPIPtr()->p_wxPyUserData_dtor(a)) 
 129 #define wxPyOORClientData_dtor(a)               (wxPyGetCoreAPIPtr()->p_wxPyOORClientData_dtor(a)) 
 131 #define wxPyCBInputStream_create(a, b)          (wxPyGetCoreAPIPtr()->p_wxPyCBInputStream_create(a, b)) 
 133 #define wxPyInstance_Check(a)                   (wxPyGetCoreAPIPtr()->p_wxPyInstance_Check(a)) 
 134 #define wxPySwigInstance_Check(a)               (wxPyGetCoreAPIPtr()->p_wxPySwigInstance_Check(a)) 
 136 #define wxPyCheckForApp()                       (wxPyGetCoreAPIPtr()->p_wxPyCheckForApp()) 
 139 //----------------------------------------------------------------------