X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/54f9ee450905e98296e6afd1376b3d1e06a1e00f..728f972bcef8d6b01f5f67cb77060d23098d8877:/wxPython/contrib/activex/activex.i diff --git a/wxPython/contrib/activex/activex.i b/wxPython/contrib/activex/activex.i index 6e7c157b45..c3830258e0 100644 --- a/wxPython/contrib/activex/activex.i +++ b/wxPython/contrib/activex/activex.i @@ -11,7 +11,7 @@ ///////////////////////////////////////////////////////////////////////////// -%module activex +%module(package="wx") activex %{ #include "wx/wxPython/wxPython.h" @@ -25,7 +25,7 @@ %import core.i %pythoncode { wx = _core } -%pythoncode { __docfilter__ = wx.__docfilter__ } +%pythoncode { __docfilter__ = wx.__DocFilter(globals()) } MAKE_CONST_WXSTRING_NOSWIG(PanelNameStr); @@ -57,14 +57,14 @@ typedef unsigned short VARTYPE; // Some conversion helpers static wxVariant _PyObj2Variant(PyObject* value); static bool _PyObj2Variant(PyObject* value, wxVariant& wv); -static PyObject* _Variant2PyObj(wxVariant& value, bool useNone=False); +static PyObject* _Variant2PyObj(wxVariant& value, bool useNone=false); static wxString _VARTYPEname(VARTYPE vt); // Check if an exception has been raised (blocking threads) inline bool wxPyErr_Occurred() { bool rval; - bool blocked = wxPyBeginBlockThreads(); + wxPyBlock_t blocked = wxPyBeginBlockThreads(); rval = PyErr_Occurred() != NULL; wxPyEndBlockThreads(blocked); return rval; @@ -80,7 +80,7 @@ DocStr(CLSID, specify the class of the ActiveX object that is to be created. A CLSID can be constructed from either a ProgID string, (such as 'WordPad.Document.1') or a classID string, (such as -'{CA8A9783-280D-11CF-A24D-444553540000}')."); +'{CA8A9783-280D-11CF-A24D-444553540000}').", ""); class CLSID { public: @@ -240,6 +240,9 @@ class wxActiveXWindow : public wxActiveX { private: CLSID m_CLSID; + + DECLARE_ABSTRACT_CLASS(wxActiveXWindow); + public: wxActiveXWindow( wxWindow* parent, const CLSID& clsId, wxWindowID id = -1, const wxPoint& pos = wxDefaultPosition, @@ -326,7 +329,7 @@ public: void SetAXProp(const wxString& name, PyObject* value) { const wxPropX& prop = GetAXPropDesc(name); - bool blocked = wxPyBeginBlockThreads(); + wxPyBlock_t blocked = wxPyBeginBlockThreads(); if (! PyErr_Occurred() ) { if (! prop.CanSet()) { wxString msg; @@ -362,7 +365,7 @@ public: { PyObject* rval = NULL; const wxPropX& prop = GetAXPropDesc(name); - bool blocked = wxPyBeginBlockThreads(); + wxPyBlock_t blocked = wxPyBeginBlockThreads(); if (! PyErr_Occurred() ) { if (! prop.CanGet()) { wxString msg; @@ -408,7 +411,7 @@ public: PyObject* rval = NULL; const wxFuncX& func = GetAXMethodDesc(name); - bool blocked = wxPyBeginBlockThreads(); + wxPyBlock_t blocked = wxPyBeginBlockThreads(); if (! PyErr_Occurred() ) { nargs = func.params.size(); if (nargs > 0) @@ -460,7 +463,7 @@ public: // conversion errors for now wxVariant wv; MSWVariantToVariant(rv, wv); - rval = _Variant2PyObj(wv, True); + rval = _Variant2PyObj(wv, true); VariantClear(&rv); if (func.hasOut) { @@ -477,7 +480,7 @@ public: const wxParamX &px = func.params[i]; if (px.IsOut()) { MSWVariantToVariant(va, wv); - PyObject* obj = _Variant2PyObj(wv, True); + PyObject* obj = _Variant2PyObj(wv, true); PyList_Append(lst, obj); } } @@ -497,6 +500,8 @@ public: return rval; } }; + +IMPLEMENT_ABSTRACT_CLASS( wxActiveXWindow, wxWindow ); %} @@ -512,8 +517,10 @@ get/set properties or call methods by name. The Python implementation automatically handles converting parameters and return values to/from the types expected by the ActiveX code as specified by the TypeInfo. -"); +", ""); + +MustHaveApp(wxActiveXWindow); class wxActiveXWindow : public wxWindow { @@ -527,28 +534,28 @@ public: long style = 0, const wxString& name = wxPyPanelNameStr), "Creates an ActiveX control from the clsID given and makes it act -as much like a regular wx.Window as possible."); +as much like a regular wx.Window as possible.", ""); DocDeclStr( const CLSID& , GetCLSID() const, - "Return the CLSID used to construct this ActiveX window"); + "Return the CLSID used to construct this ActiveX window", ""); DocDeclStr( int , GetAXEventCount() const, - "Number of events defined for this control"); + "Number of events defined for this control", ""); DocDeclStr( const wxFuncX& , GetAXEventDesc(int idx) const, - "Returns event description by index"); + "Returns event description by index", ""); DocDeclStr( int , GetAXPropCount() const, - "Number of properties defined for this control"); + "Number of properties defined for this control", ""); %nokwargs GetAXPropDesc; - DocStr(GetPropDesc, "Returns property description by index or by name"); + DocStr(GetPropDesc, "Returns property description by index or by name", ""); const wxPropX& GetAXPropDesc(int idx) const; const wxPropX& GetAXPropDesc(const wxString& name) const; @@ -556,10 +563,10 @@ as much like a regular wx.Window as possible."); DocDeclStr( int , GetAXMethodCount() const, - "Number of methods defined for this control"); + "Number of methods defined for this control", ""); %nokwargs GetAXMethodDesc; - DocStr(GetMethodDesc, "Returns method description by index or name"); + DocStr(GetMethodDesc, "Returns method description by index or name", ""); const wxFuncX& GetAXMethodDesc(int idx) const; const wxFuncX& GetAXMethodDesc(const wxString& name) const; @@ -567,35 +574,35 @@ as much like a regular wx.Window as possible."); DocDeclStr( const wxFuncXArray& , GetAXEvents(), "Returns a sequence of FuncX objects describing the events -available for this ActiveX object."); +available for this ActiveX object.", ""); DocDeclStr( const wxFuncXArray& , GetAXMethods(), "Returns a sequence of FuncX objects describing the methods -available for this ActiveX object."); +available for this ActiveX object.", ""); DocDeclStr( const wxPropXArray& , GetAXProperties(), "Returns a sequence of PropX objects describing the properties -available for this ActiveX object."); +available for this ActiveX object.", ""); DocDeclStr( void , SetAXProp(const wxString& name, PyObject* value), - "Set a property of the ActiveX object by name."); + "Set a property of the ActiveX object by name.", ""); DocDeclStr( PyObject* , GetAXProp(const wxString& name), - "Get the value of an ActiveX property by name."); + "Get the value of an ActiveX property by name.", ""); %nokwargs _CallAXMethod; DocDeclStr( PyObject* , _CallAXMethod(const wxString& name, PyObject* args), "The implementation for CallMethod. Calls an ActiveX method, by -name passing the parameters given in args."); +name passing the parameters given in args.", ""); %pythoncode { def CallAXMethod(self, name, *args): """ @@ -611,7 +618,7 @@ name passing the parameters given in args."); DocDeclStr( wxEventType , RegisterActiveXEvent(const wxString& eventName), - "Creates a standard wx event ID for the given eventName."); + "Creates a standard wx event ID for the given eventName.", ""); @@ -620,7 +627,7 @@ DocStr(wxActiveXEvent, ActiveX events. Any event parameters from the ActiveX cntrol are turned into attributes of the Python proxy for this event object. Additionally, there is a property called eventName that will -return (suprizingly ) the name of the ActiveX event."); +return (surprisingly ) the name of the ActiveX event.", ""); class wxActiveXEvent : public wxCommandEvent { @@ -634,13 +641,13 @@ public: // handler. We'll convert and load the ActiveX event parameters into // attributes of the Python event object. void _preCallInit(PyObject* pyself) { - bool blocked = wxPyBeginBlockThreads(); + wxPyBlock_t blocked = wxPyBeginBlockThreads(); PyObject* pList = PyList_New(0); PyObject_SetAttrString(pyself, "paramList", pList); Py_DECREF(pList); for (int i=0; iParamCount(); i+=1) { PyObject* name = PyString_FromString((char*)(const char*)self->ParamName(i).mb_str()); - PyObject* val = _Variant2PyObj((*self)[i], True); + PyObject* val = _Variant2PyObj((*self)[i], true); PyObject_SetAttr(pyself, name, val); PyList_Append(pList, name); Py_DECREF(val); @@ -653,7 +660,7 @@ public: // handler. It reloads any "out" parameters from the python attributes // back into the wxVariant they came from. void _postCallCleanup(PyObject* pyself) { - bool blocked = wxPyBeginBlockThreads(); + wxPyBlock_t blocked = wxPyBeginBlockThreads(); for (int i=0; iParamCount(); i+=1) { PyObject* val = PyObject_GetAttrString( pyself, (char*)(const char*)self->ParamName(i).mb_str()); @@ -835,7 +842,7 @@ wxString _VARTYPEname(VARTYPE vt) %{ -// A class derived from out wxActiveXWindow for the IE WebBrowser +// A class derived from our wxActiveXWindow for the IE WebBrowser // control that will serve as a base class for a Python // implementation. This is done so we can "eat our own dog food" // and use a class at least mostly generated by genaxmodule, but @@ -859,6 +866,8 @@ class wxIEHtmlWindowBase : public wxActiveXWindow { private: wxAutoOleInterface m_webBrowser; + DECLARE_ABSTRACT_CLASS(wxIEHtmlWindowBase); + public: wxIEHtmlWindowBase ( wxWindow* parent, const CLSID& clsId, wxWindowID id = -1, @@ -1041,6 +1050,9 @@ public: // return ! m_bAmbientUserMode; // }; }; + +IMPLEMENT_ABSTRACT_CLASS( wxIEHtmlWindowBase, wxActiveXWindow ); + %} @@ -1053,8 +1065,11 @@ public: %feature("noautodoc") wxIEHtmlWindowBase::GetText; +MustHaveApp(wxIEHtmlWindowBase); + class wxIEHtmlWindowBase : public wxActiveXWindow { public: + %pythonAppend wxIEHtmlWindowBase "self._setOORInfo(self)" wxIEHtmlWindowBase ( wxWindow* parent, const CLSID& clsId, wxWindowID id = -1, const wxPoint& pos = wxDefaultPosition,