From b7c75283f2144469e8fa6a24ca285b42fab69a6b Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Tue, 23 Mar 2004 05:29:50 +0000 Subject: [PATCH] Lindsay Mathieson's newest wxActiveX class has been wrapped into a new extension module called wx.activex. Lots of demo and lib updates to go along with it. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@26301 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- wxPython/contrib/activex/_activex_ex.py | 211 + wxPython/contrib/activex/_activex_rename.i | 16 + wxPython/contrib/activex/_activex_reverse.txt | 2 + wxPython/contrib/activex/activex.i | 1091 +++++ wxPython/contrib/activex/activex.py | 621 +++ wxPython/contrib/activex/activex_wrap.cpp | 3708 +++++++++++++++++ wxPython/contrib/activex/wxie/IEHtmlStream.h | 133 + wxPython/contrib/activex/wxie/IEHtmlWin.cpp | 478 +++ wxPython/contrib/activex/wxie/IEHtmlWin.h | 120 + wxPython/contrib/activex/wxie/README.1st.txt | 6 + wxPython/contrib/activex/wxie/default.doxygen | 205 + .../activex/wxie/doxydoc/annotated.html | 22 + .../contrib/activex/wxie/doxydoc/classes.html | 17 + .../activex/wxie/doxydoc/classwxActiveX.html | 474 +++ .../wxie/doxydoc/classwxActiveX_1_1FuncX.html | 28 + .../doxydoc/classwxActiveX_1_1ParamX.html | 28 + .../wxie/doxydoc/classwxActiveX_1_1PropX.html | 26 + .../wxie/doxydoc/classwxAutoOleInterface.html | 79 + .../contrib/activex/wxie/doxydoc/doxygen.css | 49 + .../contrib/activex/wxie/doxydoc/doxygen.png | Bin 0 -> 2352 bytes .../contrib/activex/wxie/doxydoc/files.html | 18 + .../activex/wxie/doxydoc/functions.html | 38 + .../contrib/activex/wxie/doxydoc/globals.html | 20 + .../activex/wxie/doxydoc/hierarchy.html | 22 + .../wxie/doxydoc/iehtmlwin_8h-source.html | 78 + .../activex/wxie/doxydoc/iehtmlwin_8h.html | 31 + .../contrib/activex/wxie/doxydoc/index.html | 16 + .../wxie/doxydoc/namespaceNS__wxActiveX.html | 25 + .../activex/wxie/doxydoc/namespaces.html | 17 + ...tructNS__wxActiveX_1_1less__wxStringI.html | 28 + .../wxie/doxydoc/wxactivex_8h-source.html | 477 +++ .../activex/wxie/doxydoc/wxactivex_8h.html | 216 + wxPython/contrib/activex/wxie/latex/Makefile | 39 + .../contrib/activex/wxie/latex/annotated.tex | 9 + .../activex/wxie/latex/classwxActiveX.tex | 285 ++ .../wxie/latex/classwxActiveX_1_1FuncX.tex | 18 + .../wxie/latex/classwxActiveX_1_1ParamX.tex | 18 + .../wxie/latex/classwxActiveX_1_1PropX.tex | 16 + .../wxie/latex/classwxAutoOleInterface.tex | 85 + .../contrib/activex/wxie/latex/doxygen.sty | 65 + wxPython/contrib/activex/wxie/latex/files.tex | 5 + .../contrib/activex/wxie/latex/hierarchy.tex | 9 + .../activex/wxie/latex/iehtmlwin_8h.tex | 16 + .../wxie/latex/namespaceNS__wxActiveX.tex | 14 + .../contrib/activex/wxie/latex/namespaces.tex | 4 + .../contrib/activex/wxie/latex/refman.tex | 51 + ...structNS__wxActiveX_1_1less__wxStringI.tex | 18 + .../activex/wxie/latex/wxactivex_8h.tex | 139 + wxPython/contrib/activex/wxie/license.txt | 53 + wxPython/contrib/activex/wxie/makefile | 24 + wxPython/contrib/activex/wxie/makefile.gtk | 24 + wxPython/contrib/activex/wxie/makefile.mtf | 24 + wxPython/contrib/activex/wxie/notes.txt | 2 + wxPython/contrib/activex/wxie/readme.txt | 149 + wxPython/contrib/activex/wxie/resource.h | 70 + .../contrib/activex/wxie/wxActiveXFrame.cpp | 284 ++ .../contrib/activex/wxie/wxActiveXFrame.h | 77 + wxPython/contrib/activex/wxie/wxIE.dsp | 404 ++ wxPython/contrib/activex/wxie/wxIE.ico | Bin 0 -> 766 bytes wxPython/contrib/activex/wxie/wxIE.rc | 169 + wxPython/contrib/activex/wxie/wxIE.xpm | 44 + wxPython/contrib/activex/wxie/wxIEApp.cpp | 99 + wxPython/contrib/activex/wxie/wxIEApp.h | 66 + wxPython/contrib/activex/wxie/wxIEFrm.cpp | 381 ++ wxPython/contrib/activex/wxie/wxIEFrm.h | 95 + wxPython/contrib/activex/wxie/wxactivex.cpp | 2714 ++++++++++++ wxPython/contrib/activex/wxie/wxactivex.h | 676 +++ wxPython/contrib/activex/wxie/zip.bat | 2 + wxPython/demo/ActiveX_FlashWindow.py | 104 + wxPython/demo/ActiveX_IEHtmlWindow.py | 225 + wxPython/demo/ActiveX_PDFWindow.py | 106 + wxPython/demo/IEHtmlWin.py | 4 - wxPython/demo/Main.py | 10 +- wxPython/demo/data/Asteroid_blaster.swf | Bin 0 -> 29235 bytes wxPython/docs/CHANGES.txt | 20 + wxPython/docs/MigrationGuide.txt | 104 + wxPython/include/wx/wxPython/wxPython_int.h | 16 +- wxPython/scripts/CreateBatchFiles.py | 1 + wxPython/scripts/genaxmodule | 5 + wxPython/scripts/genaxmodule.bat | 3 + wxPython/scripts/helpviewer.bat | 2 +- wxPython/scripts/img2png.bat | 2 +- wxPython/scripts/img2py.bat | 2 +- wxPython/scripts/img2xpm.bat | 2 +- wxPython/scripts/pyalacarte.bat | 2 +- wxPython/scripts/pyalamode.bat | 2 +- wxPython/scripts/pycrust.bat | 2 +- wxPython/scripts/pyshell.bat | 2 +- wxPython/scripts/pywrap.bat | 2 +- wxPython/scripts/xrced.bat | 2 +- wxPython/setup.py | 37 +- wxPython/src/helpers.cpp | 11 + wxPython/src/my_typemaps.i | 3 +- wxPython/wx/lib/flashwin.py | 652 +++ wxPython/wx/lib/iewin.py | 890 ++++ wxPython/wx/lib/pdfwin.py | 261 ++ wxPython/wx/tools/genaxmodule.py | 43 + wxPython/wxPython/activex.py | 52 + 98 files changed, 16994 insertions(+), 21 deletions(-) create mode 100644 wxPython/contrib/activex/_activex_ex.py create mode 100644 wxPython/contrib/activex/_activex_rename.i create mode 100644 wxPython/contrib/activex/_activex_reverse.txt create mode 100644 wxPython/contrib/activex/activex.i create mode 100644 wxPython/contrib/activex/activex.py create mode 100644 wxPython/contrib/activex/activex_wrap.cpp create mode 100644 wxPython/contrib/activex/wxie/IEHtmlStream.h create mode 100644 wxPython/contrib/activex/wxie/IEHtmlWin.cpp create mode 100644 wxPython/contrib/activex/wxie/IEHtmlWin.h create mode 100644 wxPython/contrib/activex/wxie/README.1st.txt create mode 100644 wxPython/contrib/activex/wxie/default.doxygen create mode 100644 wxPython/contrib/activex/wxie/doxydoc/annotated.html create mode 100644 wxPython/contrib/activex/wxie/doxydoc/classes.html create mode 100644 wxPython/contrib/activex/wxie/doxydoc/classwxActiveX.html create mode 100644 wxPython/contrib/activex/wxie/doxydoc/classwxActiveX_1_1FuncX.html create mode 100644 wxPython/contrib/activex/wxie/doxydoc/classwxActiveX_1_1ParamX.html create mode 100644 wxPython/contrib/activex/wxie/doxydoc/classwxActiveX_1_1PropX.html create mode 100644 wxPython/contrib/activex/wxie/doxydoc/classwxAutoOleInterface.html create mode 100644 wxPython/contrib/activex/wxie/doxydoc/doxygen.css create mode 100644 wxPython/contrib/activex/wxie/doxydoc/doxygen.png create mode 100644 wxPython/contrib/activex/wxie/doxydoc/files.html create mode 100644 wxPython/contrib/activex/wxie/doxydoc/functions.html create mode 100644 wxPython/contrib/activex/wxie/doxydoc/globals.html create mode 100644 wxPython/contrib/activex/wxie/doxydoc/hierarchy.html create mode 100644 wxPython/contrib/activex/wxie/doxydoc/iehtmlwin_8h-source.html create mode 100644 wxPython/contrib/activex/wxie/doxydoc/iehtmlwin_8h.html create mode 100644 wxPython/contrib/activex/wxie/doxydoc/index.html create mode 100644 wxPython/contrib/activex/wxie/doxydoc/namespaceNS__wxActiveX.html create mode 100644 wxPython/contrib/activex/wxie/doxydoc/namespaces.html create mode 100644 wxPython/contrib/activex/wxie/doxydoc/structNS__wxActiveX_1_1less__wxStringI.html create mode 100644 wxPython/contrib/activex/wxie/doxydoc/wxactivex_8h-source.html create mode 100644 wxPython/contrib/activex/wxie/doxydoc/wxactivex_8h.html create mode 100644 wxPython/contrib/activex/wxie/latex/Makefile create mode 100644 wxPython/contrib/activex/wxie/latex/annotated.tex create mode 100644 wxPython/contrib/activex/wxie/latex/classwxActiveX.tex create mode 100644 wxPython/contrib/activex/wxie/latex/classwxActiveX_1_1FuncX.tex create mode 100644 wxPython/contrib/activex/wxie/latex/classwxActiveX_1_1ParamX.tex create mode 100644 wxPython/contrib/activex/wxie/latex/classwxActiveX_1_1PropX.tex create mode 100644 wxPython/contrib/activex/wxie/latex/classwxAutoOleInterface.tex create mode 100644 wxPython/contrib/activex/wxie/latex/doxygen.sty create mode 100644 wxPython/contrib/activex/wxie/latex/files.tex create mode 100644 wxPython/contrib/activex/wxie/latex/hierarchy.tex create mode 100644 wxPython/contrib/activex/wxie/latex/iehtmlwin_8h.tex create mode 100644 wxPython/contrib/activex/wxie/latex/namespaceNS__wxActiveX.tex create mode 100644 wxPython/contrib/activex/wxie/latex/namespaces.tex create mode 100644 wxPython/contrib/activex/wxie/latex/refman.tex create mode 100644 wxPython/contrib/activex/wxie/latex/structNS__wxActiveX_1_1less__wxStringI.tex create mode 100644 wxPython/contrib/activex/wxie/latex/wxactivex_8h.tex create mode 100644 wxPython/contrib/activex/wxie/license.txt create mode 100644 wxPython/contrib/activex/wxie/makefile create mode 100644 wxPython/contrib/activex/wxie/makefile.gtk create mode 100644 wxPython/contrib/activex/wxie/makefile.mtf create mode 100644 wxPython/contrib/activex/wxie/notes.txt create mode 100644 wxPython/contrib/activex/wxie/readme.txt create mode 100644 wxPython/contrib/activex/wxie/resource.h create mode 100644 wxPython/contrib/activex/wxie/wxActiveXFrame.cpp create mode 100644 wxPython/contrib/activex/wxie/wxActiveXFrame.h create mode 100644 wxPython/contrib/activex/wxie/wxIE.dsp create mode 100644 wxPython/contrib/activex/wxie/wxIE.ico create mode 100644 wxPython/contrib/activex/wxie/wxIE.rc create mode 100644 wxPython/contrib/activex/wxie/wxIE.xpm create mode 100644 wxPython/contrib/activex/wxie/wxIEApp.cpp create mode 100644 wxPython/contrib/activex/wxie/wxIEApp.h create mode 100644 wxPython/contrib/activex/wxie/wxIEFrm.cpp create mode 100644 wxPython/contrib/activex/wxie/wxIEFrm.h create mode 100644 wxPython/contrib/activex/wxie/wxactivex.cpp create mode 100644 wxPython/contrib/activex/wxie/wxactivex.h create mode 100755 wxPython/contrib/activex/wxie/zip.bat create mode 100644 wxPython/demo/ActiveX_FlashWindow.py create mode 100644 wxPython/demo/ActiveX_IEHtmlWindow.py create mode 100644 wxPython/demo/ActiveX_PDFWindow.py create mode 100644 wxPython/demo/data/Asteroid_blaster.swf create mode 100644 wxPython/scripts/genaxmodule create mode 100755 wxPython/scripts/genaxmodule.bat create mode 100644 wxPython/wx/lib/flashwin.py create mode 100644 wxPython/wx/lib/iewin.py create mode 100644 wxPython/wx/lib/pdfwin.py create mode 100644 wxPython/wx/tools/genaxmodule.py create mode 100644 wxPython/wxPython/activex.py diff --git a/wxPython/contrib/activex/_activex_ex.py b/wxPython/contrib/activex/_activex_ex.py new file mode 100644 index 0000000000..76c7bfc015 --- /dev/null +++ b/wxPython/contrib/activex/_activex_ex.py @@ -0,0 +1,211 @@ + + +#--------------------------------------------------------------------------- +# Some helper and utility functions for ActiveX + + +t4 = " " * 4 +t8 = " " * 8 + +def GetAXInfo(ax): + """ + Returns a printable summary of the TypeInfo from the ActiveX instance + passed in. + """ + + def ProcessFuncX(f, out, name): + out.append(name) + out.append(t4 + "retType: %s" % f.retType.vt_type) + if f.params: + out.append(t4 + "params:") + for p in f.params: + out.append(t8 + p.name) + out.append(t8+t4+ "in:%s out:%s optional:%s type:%s" % (p.isIn, p.isOut, p.isOptional, p.vt_type)) + out.append('') + + def ProcessPropX(p, out): + out.append(GernerateAXModule.trimPropName(p.name)) + out.append(t4+ "type:%s arg:%s canGet:%s canSet:%s" % (p.type.vt_type, p.arg.vt_type, p.canGet, p.canSet)) + out.append('') + + out = [] + + out.append("PROPERTIES") + out.append("-"*20) + for p in ax.GetAXProperties(): + ProcessPropX(p, out) + out.append('\n\n') + + out.append("METHODS") + out.append("-"*20) + for m in ax.GetAXMethods(): + ProcessFuncX(m, out, GernerateAXModule.trimMethodName(m.name)) + out.append('\n\n') + + out.append("EVENTS") + out.append("-"*20) + for e in ax.GetAXEvents(): + ProcessFuncX(e, out, GernerateAXModule.trimEventName(e.name)) + out.append('\n\n') + + return "\n".join(out) + + + +class GernerateAXModule: + def __init__(self, ax, className, modulePath, moduleName=None, verbose=False): + """ + Make a Python module file with a class that has been specialized + for the AcitveX object. + + ax An instance of the ActiveXWindow class + className The name to use for the new class + modulePath The path where the new module should be written to + moduleName The name of the .py file to create. If not given + then the className will be used. + """ + import os + if moduleName is None: + moduleName = className + '.py' + filename = os.path.join(modulePath, moduleName) + if verbose: + print "Creating module in:", filename + print " ProgID: ", ax.GetCLSID().GetProgIDString() + print " CLSID: ", ax.GetCLSID().GetCLSIDString() + print + self.mf = file(filename, "w") + self.WriteFileHeader(ax) + self.WriteEvents(ax) + self.WriteClassHeader(ax, className) + self.WriteMethods(ax) + self.WriteProperties(ax) + self.WriteDocs(ax) + self.mf.close() + del self.mf + + + def WriteFileHeader(self, ax): + self.write("# This module was generated by the wx.activex.GernerateAXModule class\n" + "# (See also the genaxmodule script.)\n") + self.write("import wx") + self.write("import wx.activex\n") + self.write("clsID = '%s'\nprogID = '%s'\n" + % (ax.GetCLSID().GetCLSIDString(), ax.GetCLSID().GetProgIDString())) + self.write("\n") + + + def WriteEvents(self, ax): + events = ax.GetAXEvents() + if events: + self.write("# Create eventTypes and event binders") + for e in events: + self.write("wxEVT_%s = wx.activex.RegisterActiveXEvent('%s')" + % (self.trimEventName(e.name), e.name)) + self.write() + for e in events: + n = self.trimEventName(e.name) + self.write("EVT_%s = wx.PyEventBinder(wxEVT_%s, 1)" % (n,n)) + self.write("\n") + + + def WriteClassHeader(self, ax, className): + self.write("# Derive a new class from ActiveXWindow") + self.write("""\ +class %s(wx.activex.ActiveXWindow): + def __init__(self, parent, ID=-1, pos=wx.DefaultPosition, + size=wx.DefaultSize, style=0, name='%s'): + wx.activex.ActiveXWindow.__init__(self, parent, + wx.activex.CLSID('%s'), + ID, pos, size, style, name) + """ % (className, className, ax.GetCLSID().GetCLSIDString()) ) + + + def WriteMethods(self, ax): + methods = ax.GetAXMethods() + if methods: + self.write(t4, "# Methods exported by the ActiveX object") + for m in methods: + name = self.trimMethodName(m.name) + self.write(t4, "def %s(self%s):" % (name, self.getParameters(m, True))) + self.write(t8, "return self.CallAXMethod('%s'%s)" % (m.name, self.getParameters(m, False))) + self.write() + + + def WriteProperties(self, ax): + props = ax.GetAXProperties() + if props: + self.write(t4, "# Getters, Setters and properties") + for p in props: + getterName = setterName = "None" + if p.canGet: + getterName = "_get_" + p.name + self.write(t4, "def %s(self):" % getterName) + self.write(t8, "return self.GetAXProp('%s')" % p.name) + if p.canSet: + setterName = "_set_" + p.name + self.write(t4, "def %s(self, %s):" % (setterName, p.arg.name)) + self.write(t8, "self.SetAXProp('%s', %s)" % (p.name, p.arg.name)) + + self.write(t4, "%s = property(%s, %s)" % + (self.trimPropName(p.name), getterName, setterName)) + self.write() + + + def WriteDocs(self, ax): + self.write() + doc = GetAXInfo(ax) + for line in doc.split('\n'): + self.write("# ", line) + + + + def write(self, *args): + for a in args: + self.mf.write(a) + self.mf.write("\n") + + + def trimEventName(name): + if name.startswith("On"): + name = name[2:] + return name + trimEventName = staticmethod(trimEventName) + + + def trimPropName(name): + #name = name[0].lower() + name[1:] + name = name.lower() + import keyword + if name in keyword.kwlist: name += '_' + return name + trimPropName = staticmethod(trimPropName) + + + def trimMethodName(name): + import keyword + if name in keyword.kwlist: name += '_' + return name + trimMethodName = staticmethod(trimMethodName) + + + def getParameters(self, m, withDefaults): + import keyword + st = "" + # collect the input parameters, if both isIn and isOut are + # False then assume it is an input paramater + params = [] + for p in m.params: + if p.isIn or (not p.isIn and not p.isOut): + params.append(p) + # did we get any? + for p in params: + name = p.name + if name in keyword.kwlist: name += '_' + st += ", " + st += name + if withDefaults and p.isOptional: + st += '=None' + return st + + +#--------------------------------------------------------------------------- diff --git a/wxPython/contrib/activex/_activex_rename.i b/wxPython/contrib/activex/_activex_rename.i new file mode 100644 index 0000000000..1a07b5e522 --- /dev/null +++ b/wxPython/contrib/activex/_activex_rename.i @@ -0,0 +1,16 @@ +// A bunch of %rename directives generated by ./distrib/build_renamers.py +// in order to remove the wx prefix from all global scope names. + +#ifndef BUILDING_RENAMERS + +%rename(ParamX) wxParamX; +%rename(FuncX) wxFuncX; +%rename(PropX) wxPropX; +%rename(ParamXArray) wxParamXArray; +%rename(FuncXArray) wxFuncXArray; +%rename(PropXArray) wxPropXArray; +%rename(ActiveXWindow) wxActiveXWindow; +%rename(ActiveXEvent) wxActiveXEvent; +%rename(IEHtmlWindowBase) wxIEHtmlWindowBase; + +#endif diff --git a/wxPython/contrib/activex/_activex_reverse.txt b/wxPython/contrib/activex/_activex_reverse.txt new file mode 100644 index 0000000000..03f4b7aea3 --- /dev/null +++ b/wxPython/contrib/activex/_activex_reverse.txt @@ -0,0 +1,2 @@ + +EVT* diff --git a/wxPython/contrib/activex/activex.i b/wxPython/contrib/activex/activex.i new file mode 100644 index 0000000000..d4288437d8 --- /dev/null +++ b/wxPython/contrib/activex/activex.i @@ -0,0 +1,1091 @@ +///////////////////////////////////////////////////////////////////////////// +// Name: activex.i +// Purpose: ActiveX controls (such as Internet Explorer) in a wxWindow +// +// Author: Robin Dunn +// +// Created: 18-Mar-2004 +// RCS-ID: $Id$ +// Copyright: (c) 2004 by Total Control Software +// Licence: wxWindows license +///////////////////////////////////////////////////////////////////////////// + + +%module activex + +%{ +#include "wx/wxPython/wxPython.h" +#include "wx/wxPython/pyclasses.h" +#include "wx/wxPython/pyistream.h" + +#include "wxactivex.h" +%} + +//--------------------------------------------------------------------------- + +%import core.i +%pythoncode { wx = core } + +MAKE_CONST_WXSTRING_NOSWIG(PanelNameStr); + +%include _activex_rename.i + + +//--------------------------------------------------------------------------- + +typedef unsigned short USHORT; +typedef long DISPID; +typedef long MEMBERID; +typedef unsigned short VARTYPE; + + +%{ +// Since SWIG doesn't support nested classes, we need to fool it a bit +// and make them look like global classes. These defines make the C++ code +// know what we are doing. +#define wxParamX wxActiveX::ParamX +#define wxFuncX wxActiveX::FuncX +#define wxPropX wxActiveX::PropX +#define wxParamXArray wxActiveX::ParamXArray +#define wxFuncXArray wxActiveX::FuncXArray +#define wxPropXArray wxActiveX::PropXArray +%} + + +%{ +// Some conversion helpers +static wxVariant _PyObj2Variant(PyObject* value); +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; + wxPyBeginBlockThreads(); + rval = PyErr_Occurred() != NULL; + wxPyEndBlockThreads(); + return rval; +} + +%} + +//--------------------------------------------------------------------------- +%newgroup + +DocStr(CLSID, +"This class wraps the Windows CLSID structure and is used to +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}')."); + +class CLSID { +public: + %extend { + CLSID(const wxString& id) + { + int result; + CLSID* self = new CLSID; + memset(self, 0, sizeof(CLSID)); + + if (id[0] == _T('{')) { + // Looks like a classID string + result = + CLSIDFromString( + (LPOLESTR)(const wchar_t *)id.wc_str(wxConvUTF8), + self); + } else { + // Try a progID + result = + CLSIDFromProgID( + (LPOLESTR)(const wchar_t *)id.wc_str(wxConvUTF8), + self); + } + if (result != NOERROR) { + wxPyErr_SetString(PyExc_ValueError, "Not a recognized classID or progID"); + delete self; + return NULL; + } + return self; + } + + ~CLSID() { delete self; } + + wxString GetCLSIDString() + { + LPOLESTR s; + wxString str; + if (StringFromCLSID(*self, &s) == S_OK) { + str = s; + CoTaskMemFree(s); + } + else { + str = _T("Error!"); // TODO: raise exception? + } + return str; + } + wxString GetProgIDString() + { + LPOLESTR s; + wxString str; + if (ProgIDFromCLSID(*self, &s) == S_OK) { + str = s; + CoTaskMemFree(s); + } + else { + str = _T("Error!"); // TODO: raise exception? + } + return str; + } + } + %pythoncode { def __str__(self): return self.GetCLSIDString() } +}; + + +//--------------------------------------------------------------------------- +%newgroup + +%define MAKE_ARRAY_WRAPPER(basetype, arrayname) +class arrayname +{ +public: + %extend { + bool __nonzero__() { return self->size() > 0; } + int __len__() { return self->size(); } + + const basetype& __getitem__(int idx) { + if ( idx >= 0 && idx < self->size() ) + return (*self)[idx]; + else { + static basetype BadVal; + wxPyErr_SetString(PyExc_IndexError, "Index out of range"); + return BadVal; + } + } + // TODO __iter__?? + } +}; +%enddef + +//--------------------------------------------------------------------------- + +%immutable; + +class wxParamX +{ +public: + USHORT flags; + bool isPtr; + bool isSafeArray; + bool isOptional; + VARTYPE vt; + wxString name; + + %feature("shadow") vt_type_get "vt_type = property(_activex.ParamX_vt_type_get)"; + %extend { wxString vt_type_get() { return _VARTYPEname(self->vt); } } + + %feature("shadow") IsIn "isIn = property(_activex.ParamX_IsIn)"; + %feature("shadow") IsOut "isOut = property(_activex.ParamX_IsOut)"; + %feature("shadow") IsRetVal "isRetVal = property(_activex.ParamX_IsRetVal)"; + bool IsIn() const; + bool IsOut() const; + bool IsRetVal() const; + +}; + + +class wxFuncX +{ +public: + wxString name; + MEMBERID memid; + bool hasOut; + + wxParamX retType; + wxParamXArray params; +}; + + +class wxPropX +{ +public: + wxString name; + MEMBERID memid; + wxParamX type; + wxParamX arg; + bool putByRef; + + %feature("shadow") CanGet "canGet = property(_activex.PropX_CanGet)"; + %feature("shadow") CanSet "canSet = property(_activex.PropX_CanSet)"; + bool CanGet() const; + bool CanSet() const; +}; +%mutable; + + +MAKE_ARRAY_WRAPPER(wxParamX, wxParamXArray); +MAKE_ARRAY_WRAPPER(wxFuncX, wxFuncXArray); +MAKE_ARRAY_WRAPPER(wxPropX, wxPropXArray); + + +//--------------------------------------------------------------------------- +%newgroup + +%{ +// C++ version of a Python-aware wxActiveX +class wxActiveXWindow : public wxActiveX +{ +private: + CLSID m_CLSID; +public: + wxActiveXWindow( wxWindow* parent, const CLSID& clsId, wxWindowID id = -1, + const wxPoint& pos = wxDefaultPosition, + const wxSize& size = wxDefaultSize, + long style = 0, + const wxString& name = wxPyPanelNameStr) + : wxActiveX(parent, clsId, id, pos, size, style, name) + { + m_CLSID = clsId; + } + + const CLSID& GetCLSID() const { return m_CLSID; } + + + // Renamed versions of some base class methods that delegate + // to the base where appropriate, and raise Python exceptions + // when needed. + int GetAXEventCount() const { return wxActiveX::GetEventCount(); } + int GetAXPropCount() const { return wxActiveX::GetPropCount(); } + int GetAXMethodCount() const { return wxActiveX::GetMethodCount(); } + + const wxFuncX& GetAXEventDesc(int idx) const + { + static wxFuncX BadVal; + if (idx < 0 || idx >= GetAXEventCount()) { + wxPyErr_SetString(PyExc_IndexError, "Index out of range"); + return BadVal; + } + return m_events[idx]; + } + const wxFuncX& GetAXMethodDesc(int idx) const + { + static wxFuncX BadVal; + if (idx < 0 || idx >= GetAXMethodCount()) { + wxPyErr_SetString(PyExc_IndexError, "Index out of range"); + return BadVal; + } + return m_methods[idx]; + } + const wxPropX& GetAXPropDesc(int idx) const + { + static wxPropX BadVal; + if (idx < 0 || idx >= GetAXPropCount()) { + wxPyErr_SetString(PyExc_IndexError, "Index out of range"); + return BadVal; + } + return m_props[idx]; + } + + const wxFuncX& GetAXMethodDesc(const wxString& name) const + { + NameMap::const_iterator it = m_methodNames.find(name); + if (it == m_methodNames.end()) { + wxString msg; + msg << "method <" << name << "> not found"; + wxPyErr_SetString(PyExc_KeyError, msg.mb_str()); + static wxFuncX BadVal; + return BadVal; + }; + return GetAXMethodDesc(it->second); + } + const wxPropX& GetAXPropDesc(const wxString& name) const + { + NameMap::const_iterator it = m_propNames.find(name); + if (it == m_propNames.end()) { + wxString msg; + msg << "property <" << name << "> not found"; + wxPyErr_SetString(PyExc_KeyError, msg.mb_str()); + static wxPropX BadVal; + return BadVal; + }; + return GetAXPropDesc(it->second); + } + + // Accessors for the internal vectors of events, methods and + // proprties. Can be used as sequence like objects from + // Python. + const wxFuncXArray& GetAXEvents() { return m_events; } + const wxFuncXArray& GetAXMethods() { return m_methods; } + const wxPropXArray& GetAXProperties() { return m_props; } + + + // Set a property from a Python object + void SetAXProp(const wxString& name, PyObject* value) + { + const wxPropX& prop = GetAXPropDesc(name); + wxPyBeginBlockThreads(); + if (! PyErr_Occurred() ) { + if (! prop.CanSet()) { + wxString msg; + msg << "property <" << name << "> is readonly"; + PyErr_SetString(PyExc_TypeError, msg.mb_str()); + goto done; + } else { + wxVariant wxV = _PyObj2Variant(value); + if (PyErr_Occurred()) + goto done; + VARIANT v = {prop.arg.vt}; + if (!VariantToMSWVariant(wxV, v) || PyErr_Occurred()) { + wxString msg; + msg << "Unable to convert value to expected type: (" + << _VARTYPEname(prop.arg.vt) << ") for property <" + << name << ">"; + PyErr_SetString(PyExc_TypeError, msg.mb_str()); + goto done; + } + PyThreadState* tstate = wxPyBeginAllowThreads(); + SetProp(prop.memid, v); + VariantClear(&v); + wxPyEndAllowThreads(tstate); + } + } + done: + wxPyEndBlockThreads(); + } + + + // Get a property and convert it to a Python object + PyObject* GetAXProp(const wxString& name) + { + PyObject* rval = NULL; + const wxPropX& prop = GetAXPropDesc(name); + wxPyBeginBlockThreads(); + if (! PyErr_Occurred() ) { + if (! prop.CanGet()) { + wxString msg; + msg << "property <" << name << "> is writeonly"; + PyErr_SetString(PyExc_TypeError, msg.mb_str()); + goto done; + } else { + PyThreadState* tstate = wxPyBeginAllowThreads(); + VARIANT v = GetPropAsVariant(prop.memid); + wxPyEndAllowThreads(tstate); + wxVariant wv; + if (!MSWVariantToVariant(v, wv) || PyErr_Occurred()) { + wxString msg; + msg << "Unable to convert value to expected type: (" + << _VARTYPEname(prop.arg.vt) << ") for property <" + << name << ">"; + PyErr_SetString(PyExc_TypeError, msg.mb_str()); + goto done; + } + rval = _Variant2PyObj(wv); + VariantClear(&v); + } + } + done: + wxPyEndBlockThreads(); + return rval; + } + + + // If both IsIn and isOut are false, assume it is actually an + // input param + bool paramIsIn(const wxParamX& p) + { + return p.IsIn() || (!p.IsIn() && !p.IsOut()); + } + + + // Call a method of the ActiveX object + PyObject* _CallAXMethod(const wxString& name, PyObject* args) + { + VARIANTARG *vargs = NULL; + int nargs = 0; + PyObject* rval = NULL; + const wxFuncX& func = GetAXMethodDesc(name); + + wxPyBeginBlockThreads(); + if (! PyErr_Occurred() ) { + nargs = func.params.size(); + if (nargs > 0) + vargs = new VARIANTARG[nargs]; + + if (vargs) { + // init type of vargs, in reverse order + int i; + for (i = 0; i < nargs; i++) + vargs[nargs - i - 1].vt = func.params[i].vt; + + // Map the args coming from Python to the input parameters in vargs + int pi = 0; + i = 0; + while ( i) the name of the ActiveX event."); + +class wxActiveXEvent : public wxCommandEvent +{ +public: + %feature("shadow") EventName "eventName = property(_activex.ActiveXEvent_EventName)"; + wxString EventName(); + + %extend { + DocStr(_preInit, +"This is called by the EventThunker before calling the handler. +We'll convert and load the ActiveX event parameters into +attributes of the Python event object."); + void _preInit(PyObject* pyself) { + 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*)self->ParamName(i).mb_str()); + PyObject* val = _Variant2PyObj((*self)[i], True); + PyObject_SetAttr(pyself, name, val); + PyList_Append(pList, name); + Py_DECREF(val); + Py_DECREF(name); + } + wxPyEndBlockThreads(); + } + } +}; + +//--------------------------------------------------------------------------- + +%{ + +// Caller should already have the GIL! +wxVariant _PyObj2Variant(PyObject* value) +{ + wxVariant rval; + + if (value == Py_None) + return rval; + + else if (PyBool_Check(value)) + rval = (value == Py_True) ? true : false; + + else if (PyInt_Check(value)) + rval = PyInt_AS_LONG(value); + + else if (PyFloat_Check(value)) + rval = PyFloat_AS_DOUBLE(value); + + else if (PyString_Check(value) || PyUnicode_Check(value)) + rval = Py2wxString(value); + + // TODO: PyList of strings --> wxArrayString + // wxDateTime + // list of objects + + else { + PyErr_SetString(PyExc_TypeError, "Unsupported object type in _PyObj2Variant"); + rval = (long)0; + } + + return rval; +} + + +// Caller should already have the GIL! +PyObject* _Variant2PyObj(wxVariant& value, bool useNone) +{ + PyObject* rval = NULL; + + if (value.IsNull()) { + rval = Py_None; + Py_INCREF(rval); + } + + // should "char" be treated as an int or as a string? + else if (value.IsType(_T("char")) || value.IsType(_T("long"))) + rval = PyInt_FromLong(value); + + else if (value.IsType(_T("double"))) + rval = PyFloat_FromDouble(value); + + else if (value.IsType(_T("bool"))) + rval = PyBool_FromLong((bool)value); + + else if (value.IsType(_T("string"))) + rval = wx2PyString(value); + + else { + if (useNone) { + rval = Py_None; + Py_INCREF(rval); + } + else { + PyErr_SetString(PyExc_TypeError, "Unsupported object type in _Variant2PyObj"); + } + } + return rval; +} + + +wxString _VARTYPEname(VARTYPE vt) +{ + if (vt & VT_BYREF) + vt &= ~(VT_BYREF); + + switch(vt) { + case VT_VARIANT: + return _T("VT_VARIANT"); + + // 1 byte chars + case VT_I1: + case VT_UI1: + // 2 byte shorts + case VT_I2: + case VT_UI2: + // 4 bytes longs + case VT_I4: + case VT_UI4: + case VT_INT: + case VT_UINT: + case VT_ERROR: + return _T("int"); + + // 4 byte floats + case VT_R4: + // 8 byte doubles + case VT_R8: + // decimals are converted from doubles too + case VT_DECIMAL: + return _T("double"); + + case VT_BOOL: + return _T("bool"); + + case VT_DATE: + return _T("wx.DateTime"); + + case VT_BSTR: + return _T("string"); + + case VT_UNKNOWN: + return _T("VT_UNKNOWN"); + + case VT_DISPATCH: + return _T("VT_DISPATCH"); + + case VT_EMPTY: + return _T("VT_EMPTY"); + + case VT_NULL: + return _T("VT_NULL"); + + case VT_VOID: + return _T("VT_VOID"); + + default: + wxString msg; + msg << _T("unsupported type ") << vt; + return msg; + } +} + +%} + +//--------------------------------------------------------------------------- +//--------------------------------------------------------------------------- +%newgroup + + +%{ +// A class derived from out 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 +// also get some of the extra stuff like loading a document from +// a string or a stream, getting text contents, etc. that +// Lindsay's version gives us. +// + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "IEHtmlStream.h" + +class wxIEHtmlWindowBase : public wxActiveXWindow { +private: + wxAutoOleInterface m_webBrowser; + +public: + + wxIEHtmlWindowBase ( wxWindow* parent, const CLSID& clsId, wxWindowID id = -1, + const wxPoint& pos = wxDefaultPosition, + const wxSize& size = wxDefaultSize, + long style = 0, + const wxString& name = wxPyPanelNameStr) + : wxActiveXWindow(parent, clsId, id, pos, size, style, name) + { + HRESULT hret; + + // Get IWebBrowser2 Interface + hret = m_webBrowser.QueryInterface(IID_IWebBrowser2, m_ActiveX); + wxASSERT(SUCCEEDED(hret)); + } + + + void SetCharset(const wxString& charset) + { + HRESULT hret; + + // HTML Document ? + IDispatch *pDisp = NULL; + hret = m_webBrowser->get_Document(&pDisp); + wxAutoOleInterface disp(pDisp); + + if (disp.Ok()) + { + wxAutoOleInterface doc(IID_IHTMLDocument2, disp); + if (doc.Ok()) + doc->put_charset((BSTR) (const wchar_t *) charset.wc_str(wxConvUTF8)); + //doc->put_charset((BSTR) wxConvUTF8.cMB2WC(charset).data()); + } + } + + + bool LoadString(const wxString& html) + { + char *data = NULL; + size_t len = html.length(); + len *= sizeof(wxChar); + data = (char *) malloc(len); + memcpy(data, html.c_str(), len); + return LoadStream(new wxOwnedMemInputStream(data, len)); + } + + + bool LoadStream(IStreamAdaptorBase *pstrm) + { + // need to prepend this as poxy MSHTML will not recognise a HTML comment + // as starting a html document and treats it as plain text + // Does nayone know how to force it to html mode ? + pstrm->prepend = ""; + + // strip leading whitespace as it can confuse MSHTML + wxAutoOleInterface strm(pstrm); + + // Document Interface + IDispatch *pDisp = NULL; + HRESULT hret = m_webBrowser->get_Document(&pDisp); + if (! pDisp) + return false; + wxAutoOleInterface disp(pDisp); + + + // get IPersistStreamInit + wxAutoOleInterface + pPersistStreamInit(IID_IPersistStreamInit, disp); + + if (pPersistStreamInit.Ok()) + { + HRESULT hr = pPersistStreamInit->InitNew(); + if (SUCCEEDED(hr)) + hr = pPersistStreamInit->Load(strm); + + return SUCCEEDED(hr); + } + else + return false; + } + + bool LoadStream(wxInputStream *is) + { + // wrap reference around stream + IwxStreamAdaptor *pstrm = new IwxStreamAdaptor(is); + pstrm->AddRef(); + + return LoadStream(pstrm); + } + + + wxString GetStringSelection(bool asHTML) + { + wxAutoOleInterface tr(wxieGetSelRange(m_oleObject)); + if (! tr) + return wxEmptyString; + + BSTR text = NULL; + HRESULT hr = E_FAIL; + + if (asHTML) + hr = tr->get_htmlText(&text); + else + hr = tr->get_text(&text); + if (hr != S_OK) + return wxEmptyString; + + wxString s = text; + SysFreeString(text); + + return s; + }; + + wxString GetText(bool asHTML) + { + if (! m_webBrowser.Ok()) + return wxEmptyString; + + // get document dispatch interface + IDispatch *iDisp = NULL; + HRESULT hr = m_webBrowser->get_Document(&iDisp); + if (hr != S_OK) + return wxEmptyString; + + // Query for Document Interface + wxAutoOleInterface hd(IID_IHTMLDocument2, iDisp); + iDisp->Release(); + + if (! hd.Ok()) + return wxEmptyString; + + // get body element + IHTMLElement *_body = NULL; + hd->get_body(&_body); + if (! _body) + return wxEmptyString; + wxAutoOleInterface body(_body); + + // get inner text + BSTR text = NULL; + hr = E_FAIL; + + if (asHTML) + hr = body->get_innerHTML(&text); + else + hr = body->get_innerText(&text); + if (hr != S_OK) + return wxEmptyString; + + wxString s = text; + SysFreeString(text); + + return s; + } + + +// void wxIEHtmlWin::SetEditMode(bool seton) +// { +// m_bAmbientUserMode = ! seton; +// AmbientPropertyChanged(DISPID_AMBIENT_USERMODE); +// }; + +// bool wxIEHtmlWin::GetEditMode() +// { +// return ! m_bAmbientUserMode; +// }; +}; +%} + + +// we'll document it in the derived Python class +%feature("noautodoc") wxIEHtmlWindowBase; +%feature("noautodoc") wxIEHtmlWindowBase::SetCharset; +%feature("noautodoc") wxIEHtmlWindowBase::LoadString; +%feature("noautodoc") wxIEHtmlWindowBase::LoadStream; +%feature("noautodoc") wxIEHtmlWindowBase::GetStringSelection; +%feature("noautodoc") wxIEHtmlWindowBase::GetText; + + +class wxIEHtmlWindowBase : public wxActiveXWindow { +public: + + wxIEHtmlWindowBase ( wxWindow* parent, const CLSID& clsId, wxWindowID id = -1, + const wxPoint& pos = wxDefaultPosition, + const wxSize& size = wxDefaultSize, + long style = 0, + const wxString& name = wxPyPanelNameStr); + + void SetCharset(const wxString& charset); + bool LoadString(const wxString& html); + bool LoadStream(wxInputStream *is); + wxString GetStringSelection(bool asHTML); + wxString GetText(bool asHTML); +}; + + + + + + + + + + + +#if 0 +enum wxIEHtmlRefreshLevel +{ + wxIEHTML_REFRESH_NORMAL = 0, + wxIEHTML_REFRESH_IFEXPIRED = 1, + wxIEHTML_REFRESH_CONTINUE = 2, + wxIEHTML_REFRESH_COMPLETELY = 3 +}; + +DocStr(wxIEHtmlWin, +""); +class wxIEHtmlWin : public wxWindow +{ +public: + %pythonAppend wxIEHtmlWin "self._setOORInfo(self)" + + wxIEHtmlWin(wxWindow * parent, wxWindowID id = -1, + const wxPoint& pos = wxDefaultPosition, + const wxSize& size = wxDefaultSize, + long style = 0, + const wxString& name = wxPyPanelNameStr); + + void LoadUrl(const wxString& url); + bool LoadString(wxString html); + bool LoadStream(wxInputStream *is); + + %pythoncode { Navigate = LoadUrl } + + void SetCharset(wxString charset); + void SetEditMode(bool seton); + bool GetEditMode(); + wxString GetStringSelection(bool asHTML = false); + wxString GetText(bool asHTML = false); + + bool GoBack(); + bool GoForward(); + bool GoHome(); + bool GoSearch(); + %name(RefreshPage)bool Refresh(wxIEHtmlRefreshLevel level); + bool Stop(); +}; + + + +%pythoncode { +wxEVT_COMMAND_MSHTML_BEFORENAVIGATE2 = RegisterActiveXEvent('BeforeNavigate2') +wxEVT_COMMAND_MSHTML_NEWWINDOW2 = RegisterActiveXEvent('NewWindow2') +wxEVT_COMMAND_MSHTML_DOCUMENTCOMPLETE = RegisterActiveXEvent('DocumentComplete') +wxEVT_COMMAND_MSHTML_PROGRESSCHANGE = RegisterActiveXEvent('ProgressChange') +wxEVT_COMMAND_MSHTML_STATUSTEXTCHANGE = RegisterActiveXEvent('StatusTextChange') +wxEVT_COMMAND_MSHTML_TITLECHANGE = RegisterActiveXEvent('TitleChange') + +EVT_MSHTML_BEFORENAVIGATE2 = wx.PyEventBinder(wxEVT_COMMAND_MSHTML_BEFORENAVIGATE2, 1) +EVT_MSHTML_NEWWINDOW2 = wx.PyEventBinder(wxEVT_COMMAND_MSHTML_NEWWINDOW2, 1) +EVT_MSHTML_DOCUMENTCOMPLETE = wx.PyEventBinder(wxEVT_COMMAND_MSHTML_DOCUMENTCOMPLETE, 1) +EVT_MSHTML_PROGRESSCHANGE = wx.PyEventBinder(wxEVT_COMMAND_MSHTML_PROGRESSCHANGE, 1) +EVT_MSHTML_STATUSTEXTCHANGE = wx.PyEventBinder(wxEVT_COMMAND_MSHTML_STATUSTEXTCHANGE, 1) +EVT_MSHTML_TITLECHANGE = wx.PyEventBinder(wxEVT_COMMAND_MSHTML_TITLECHANGE, 1) +} + +#endif + +//--------------------------------------------------------------------------- +// Include some extra Python code into the proxy module + +%pythoncode "_activex_ex.py" + +//--------------------------------------------------------------------------- diff --git a/wxPython/contrib/activex/activex.py b/wxPython/contrib/activex/activex.py new file mode 100644 index 0000000000..e834d9e643 --- /dev/null +++ b/wxPython/contrib/activex/activex.py @@ -0,0 +1,621 @@ +# This file was created automatically by SWIG. +# Don't modify this file, modify the SWIG interface instead. + +import _activex + +import core +wx = core +#--------------------------------------------------------------------------- + +class CLSID(object): + """ + This class wraps the Windows CLSID structure and is used to + 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}'). + """ + def __repr__(self): + return "<%s.%s; proxy of C++ CLSID instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) + def __init__(self, *args, **kwargs): + """ + __init__(String id) -> CLSID + + This class wraps the Windows CLSID structure and is used to + 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}'). + """ + newobj = _activex.new_CLSID(*args, **kwargs) + self.this = newobj.this + self.thisown = 1 + del newobj.thisown + def __del__(self, destroy=_activex.delete_CLSID): + """__del__()""" + try: + if self.thisown: destroy(self) + except: pass + + def GetCLSIDString(*args, **kwargs): + """GetCLSIDString() -> String""" + return _activex.CLSID_GetCLSIDString(*args, **kwargs) + + def GetProgIDString(*args, **kwargs): + """GetProgIDString() -> String""" + return _activex.CLSID_GetProgIDString(*args, **kwargs) + + def __str__(self): return self.GetCLSIDString() + +class CLSIDPtr(CLSID): + def __init__(self, this): + self.this = this + if not hasattr(self,"thisown"): self.thisown = 0 + self.__class__ = CLSID +_activex.CLSID_swigregister(CLSIDPtr) + +#--------------------------------------------------------------------------- + +class ParamX(object): + def __init__(self): raise RuntimeError, "No constructor defined" + def __repr__(self): + return "<%s.%s; proxy of C++ wxParamX instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) + flags = property(_activex.ParamX_flags_get) + isPtr = property(_activex.ParamX_isPtr_get) + isSafeArray = property(_activex.ParamX_isSafeArray_get) + isOptional = property(_activex.ParamX_isOptional_get) + vt = property(_activex.ParamX_vt_get) + name = property(_activex.ParamX_name_get) + vt_type = property(_activex.ParamX_vt_type_get) + + isIn = property(_activex.ParamX_IsIn) + + isOut = property(_activex.ParamX_IsOut) + + isRetVal = property(_activex.ParamX_IsRetVal) + + +class ParamXPtr(ParamX): + def __init__(self, this): + self.this = this + if not hasattr(self,"thisown"): self.thisown = 0 + self.__class__ = ParamX +_activex.ParamX_swigregister(ParamXPtr) + +class FuncX(object): + def __init__(self): raise RuntimeError, "No constructor defined" + def __repr__(self): + return "<%s.%s; proxy of C++ wxFuncX instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) + name = property(_activex.FuncX_name_get) + memid = property(_activex.FuncX_memid_get) + hasOut = property(_activex.FuncX_hasOut_get) + retType = property(_activex.FuncX_retType_get) + params = property(_activex.FuncX_params_get) + +class FuncXPtr(FuncX): + def __init__(self, this): + self.this = this + if not hasattr(self,"thisown"): self.thisown = 0 + self.__class__ = FuncX +_activex.FuncX_swigregister(FuncXPtr) + +class PropX(object): + def __init__(self): raise RuntimeError, "No constructor defined" + def __repr__(self): + return "<%s.%s; proxy of C++ wxPropX instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) + name = property(_activex.PropX_name_get) + memid = property(_activex.PropX_memid_get) + type = property(_activex.PropX_type_get) + arg = property(_activex.PropX_arg_get) + putByRef = property(_activex.PropX_putByRef_get) + canGet = property(_activex.PropX_CanGet) + + canSet = property(_activex.PropX_CanSet) + + +class PropXPtr(PropX): + def __init__(self, this): + self.this = this + if not hasattr(self,"thisown"): self.thisown = 0 + self.__class__ = PropX +_activex.PropX_swigregister(PropXPtr) + +class ParamXArray(object): + def __init__(self): raise RuntimeError, "No constructor defined" + def __repr__(self): + return "<%s.%s; proxy of C++ wxParamXArray instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) + def __nonzero__(*args, **kwargs): + """__nonzero__() -> bool""" + return _activex.ParamXArray___nonzero__(*args, **kwargs) + + def __len__(*args, **kwargs): + """__len__() -> int""" + return _activex.ParamXArray___len__(*args, **kwargs) + + def __getitem__(*args, **kwargs): + """__getitem__(int idx) -> ParamX""" + return _activex.ParamXArray___getitem__(*args, **kwargs) + + +class ParamXArrayPtr(ParamXArray): + def __init__(self, this): + self.this = this + if not hasattr(self,"thisown"): self.thisown = 0 + self.__class__ = ParamXArray +_activex.ParamXArray_swigregister(ParamXArrayPtr) + +class FuncXArray(object): + def __init__(self): raise RuntimeError, "No constructor defined" + def __repr__(self): + return "<%s.%s; proxy of C++ wxFuncXArray instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) + def __nonzero__(*args, **kwargs): + """__nonzero__() -> bool""" + return _activex.FuncXArray___nonzero__(*args, **kwargs) + + def __len__(*args, **kwargs): + """__len__() -> int""" + return _activex.FuncXArray___len__(*args, **kwargs) + + def __getitem__(*args, **kwargs): + """__getitem__(int idx) -> FuncX""" + return _activex.FuncXArray___getitem__(*args, **kwargs) + + +class FuncXArrayPtr(FuncXArray): + def __init__(self, this): + self.this = this + if not hasattr(self,"thisown"): self.thisown = 0 + self.__class__ = FuncXArray +_activex.FuncXArray_swigregister(FuncXArrayPtr) + +class PropXArray(object): + def __init__(self): raise RuntimeError, "No constructor defined" + def __repr__(self): + return "<%s.%s; proxy of C++ wxPropXArray instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) + def __nonzero__(*args, **kwargs): + """__nonzero__() -> bool""" + return _activex.PropXArray___nonzero__(*args, **kwargs) + + def __len__(*args, **kwargs): + """__len__() -> int""" + return _activex.PropXArray___len__(*args, **kwargs) + + def __getitem__(*args, **kwargs): + """__getitem__(int idx) -> PropX""" + return _activex.PropXArray___getitem__(*args, **kwargs) + + +class PropXArrayPtr(PropXArray): + def __init__(self, this): + self.this = this + if not hasattr(self,"thisown"): self.thisown = 0 + self.__class__ = PropXArray +_activex.PropXArray_swigregister(PropXArrayPtr) + +#--------------------------------------------------------------------------- + +class ActiveXWindow(core.Window): + """ + ActiveXWindow derives from wxWindow and the constructor accepts a + CLSID for the ActiveX Control that should be created. The + ActiveXWindow class simply adds methods that allow you to query + some of the TypeInfo exposed by the ActiveX object, and also to + 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. + + """ + def __repr__(self): + return "<%s.%s; proxy of C++ wxActiveXWindow instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) + def __init__(self, *args, **kwargs): + """ + __init__(Window parent, CLSID clsId, int id=-1, Point pos=DefaultPosition, + Size size=DefaultSize, long style=0, + String name=PanelNameStr) -> ActiveXWindow + + Creates an ActiveX control from the clsID given and makes it act + as much like a regular wx.Window as possible. + """ + newobj = _activex.new_ActiveXWindow(*args, **kwargs) + self.this = newobj.this + self.thisown = 1 + del newobj.thisown + self._setOORInfo(self) + + def GetCLSID(*args, **kwargs): + """ + GetCLSID() -> CLSID + + Return the CLSID used to construct this ActiveX window + """ + return _activex.ActiveXWindow_GetCLSID(*args, **kwargs) + + def GetAXEventCount(*args, **kwargs): + """ + GetAXEventCount() -> int + + Number of events defined for this control + """ + return _activex.ActiveXWindow_GetAXEventCount(*args, **kwargs) + + def GetAXEventDesc(*args, **kwargs): + """ + GetAXEventDesc(int idx) -> FuncX + + Returns event description by index + """ + return _activex.ActiveXWindow_GetAXEventDesc(*args, **kwargs) + + def GetAXPropCount(*args, **kwargs): + """ + GetAXPropCount() -> int + + Number of properties defined for this control + """ + return _activex.ActiveXWindow_GetAXPropCount(*args, **kwargs) + + def GetAXPropDesc(*args): + """ + GetAXPropDesc(int idx) -> PropX + GetAXPropDesc(String name) -> PropX + """ + return _activex.ActiveXWindow_GetAXPropDesc(*args) + + def GetAXMethodCount(*args, **kwargs): + """ + GetAXMethodCount() -> int + + Number of methods defined for this control + """ + return _activex.ActiveXWindow_GetAXMethodCount(*args, **kwargs) + + def GetAXMethodDesc(*args): + """ + GetAXMethodDesc(int idx) -> FuncX + GetAXMethodDesc(String name) -> FuncX + """ + return _activex.ActiveXWindow_GetAXMethodDesc(*args) + + def GetAXEvents(*args, **kwargs): + """ + GetAXEvents() -> FuncXArray + + Returns a sequence of FuncX objects describing the events + available for this ActiveX object. + """ + return _activex.ActiveXWindow_GetAXEvents(*args, **kwargs) + + def GetAXMethods(*args, **kwargs): + """ + GetAXMethods() -> FuncXArray + + Returns a sequence of FuncX objects describing the methods + available for this ActiveX object. + """ + return _activex.ActiveXWindow_GetAXMethods(*args, **kwargs) + + def GetAXProperties(*args, **kwargs): + """ + GetAXProperties() -> PropXArray + + Returns a sequence of PropX objects describing the properties + available for this ActiveX object. + """ + return _activex.ActiveXWindow_GetAXProperties(*args, **kwargs) + + def SetAXProp(*args, **kwargs): + """ + SetAXProp(String name, PyObject value) + + Set a property of the ActiveX object by name. + """ + return _activex.ActiveXWindow_SetAXProp(*args, **kwargs) + + def GetAXProp(*args, **kwargs): + """ + GetAXProp(String name) -> PyObject + + Get the value of an ActiveX property by name. + """ + return _activex.ActiveXWindow_GetAXProp(*args, **kwargs) + + def _CallAXMethod(*args): + """ + _CallAXMethod(String name, PyObject args) -> PyObject + + The implementation for CallMethod. Calls an ActiveX method, by + name passing the parameters given in args. + """ + return _activex.ActiveXWindow__CallAXMethod(*args) + + def CallAXMethod(self, name, *args): + """ + Front-end for _CallMethod. Simply passes all positional args + after the name as a single tuple to _CallMethod. + """ + return self._CallAXMethod(name, args) + + +class ActiveXWindowPtr(ActiveXWindow): + def __init__(self, this): + self.this = this + if not hasattr(self,"thisown"): self.thisown = 0 + self.__class__ = ActiveXWindow +_activex.ActiveXWindow_swigregister(ActiveXWindowPtr) + +#--------------------------------------------------------------------------- + + +def RegisterActiveXEvent(*args, **kwargs): + """ + RegisterActiveXEvent(String eventName) -> wxEventType + + Creates a standard wx event ID for the given eventName. + """ + return _activex.RegisterActiveXEvent(*args, **kwargs) +class ActiveXEvent(core.CommandEvent): + """ + An instance of ActiveXEvent is sent to the handler for all bound + 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. + """ + def __init__(self): raise RuntimeError, "No constructor defined" + def __repr__(self): + return "<%s.%s; proxy of C++ wxActiveXEvent instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) + eventName = property(_activex.ActiveXEvent_EventName) + + def _preInit(*args, **kwargs): + """ + _preInit(PyObject pyself) + + This is called by the EventThunker before calling the handler. + We'll convert and load the ActiveX event parameters into + attributes of the Python event object. + """ + return _activex.ActiveXEvent__preInit(*args, **kwargs) + + +class ActiveXEventPtr(ActiveXEvent): + def __init__(self, this): + self.this = this + if not hasattr(self,"thisown"): self.thisown = 0 + self.__class__ = ActiveXEvent +_activex.ActiveXEvent_swigregister(ActiveXEventPtr) + +#--------------------------------------------------------------------------- + +class IEHtmlWindowBase(ActiveXWindow): + def __repr__(self): + return "<%s.%s; proxy of C++ wxIEHtmlWindowBase instance at %s>" % (self.__class__.__module__, self.__class__.__name__, self.this,) + def __init__(self, *args, **kwargs): + newobj = _activex.new_IEHtmlWindowBase(*args, **kwargs) + self.this = newobj.this + self.thisown = 1 + del newobj.thisown + def SetCharset(*args, **kwargs): return _activex.IEHtmlWindowBase_SetCharset(*args, **kwargs) + def LoadString(*args, **kwargs): return _activex.IEHtmlWindowBase_LoadString(*args, **kwargs) + def LoadStream(*args, **kwargs): return _activex.IEHtmlWindowBase_LoadStream(*args, **kwargs) + def GetStringSelection(*args, **kwargs): return _activex.IEHtmlWindowBase_GetStringSelection(*args, **kwargs) + def GetText(*args, **kwargs): return _activex.IEHtmlWindowBase_GetText(*args, **kwargs) + +class IEHtmlWindowBasePtr(IEHtmlWindowBase): + def __init__(self, this): + self.this = this + if not hasattr(self,"thisown"): self.thisown = 0 + self.__class__ = IEHtmlWindowBase +_activex.IEHtmlWindowBase_swigregister(IEHtmlWindowBasePtr) + +#--------------------------------------------------------------------------- +# Some helper and utility functions for ActiveX + + +t4 = " " * 4 +t8 = " " * 8 + +def GetAXInfo(ax): + """ + Returns a printable summary of the TypeInfo from the ActiveX instance + passed in. + """ + + def ProcessFuncX(f, out, name): + out.append(name) + out.append(t4 + "retType: %s" % f.retType.vt_type) + if f.params: + out.append(t4 + "params:") + for p in f.params: + out.append(t8 + p.name) + out.append(t8+t4+ "in:%s out:%s optional:%s type:%s" % (p.isIn, p.isOut, p.isOptional, p.vt_type)) + out.append('') + + def ProcessPropX(p, out): + out.append(GernerateAXModule.trimPropName(p.name)) + out.append(t4+ "type:%s arg:%s canGet:%s canSet:%s" % (p.type.vt_type, p.arg.vt_type, p.canGet, p.canSet)) + out.append('') + + out = [] + + out.append("PROPERTIES") + out.append("-"*20) + for p in ax.GetAXProperties(): + ProcessPropX(p, out) + out.append('\n\n') + + out.append("METHODS") + out.append("-"*20) + for m in ax.GetAXMethods(): + ProcessFuncX(m, out, GernerateAXModule.trimMethodName(m.name)) + out.append('\n\n') + + out.append("EVENTS") + out.append("-"*20) + for e in ax.GetAXEvents(): + ProcessFuncX(e, out, GernerateAXModule.trimEventName(e.name)) + out.append('\n\n') + + return "\n".join(out) + + + +class GernerateAXModule: + def __init__(self, ax, className, modulePath, moduleName=None, verbose=False): + """ + Make a Python module file with a class that has been specialized + for the AcitveX object. + + ax An instance of the ActiveXWindow class + className The name to use for the new class + modulePath The path where the new module should be written to + moduleName The name of the .py file to create. If not given + then the className will be used. + """ + import os + if moduleName is None: + moduleName = className + '.py' + filename = os.path.join(modulePath, moduleName) + if verbose: + print "Creating module in:", filename + print " ProgID: ", ax.GetCLSID().GetProgIDString() + print " CLSID: ", ax.GetCLSID().GetCLSIDString() + print + self.mf = file(filename, "w") + self.WriteFileHeader(ax) + self.WriteEvents(ax) + self.WriteClassHeader(ax, className) + self.WriteMethods(ax) + self.WriteProperties(ax) + self.WriteDocs(ax) + self.mf.close() + del self.mf + + + def WriteFileHeader(self, ax): + self.write("# This module was generated by the wx.activex.GernerateAXModule class\n" + "# (See also the genaxmodule script.)\n") + self.write("import wx") + self.write("import wx.activex\n") + self.write("clsID = '%s'\nprogID = '%s'\n" + % (ax.GetCLSID().GetCLSIDString(), ax.GetCLSID().GetProgIDString())) + self.write("\n") + + + def WriteEvents(self, ax): + events = ax.GetAXEvents() + if events: + self.write("# Create eventTypes and event binders") + for e in events: + self.write("wxEVT_%s = wx.activex.RegisterActiveXEvent('%s')" + % (self.trimEventName(e.name), e.name)) + self.write() + for e in events: + n = self.trimEventName(e.name) + self.write("EVT_%s = wx.PyEventBinder(wxEVT_%s, 1)" % (n,n)) + self.write("\n") + + + def WriteClassHeader(self, ax, className): + self.write("# Derive a new class from ActiveXWindow") + self.write("""\ +class %s(wx.activex.ActiveXWindow): + def __init__(self, parent, ID=-1, pos=wx.DefaultPosition, + size=wx.DefaultSize, style=0, name='%s'): + wx.activex.ActiveXWindow.__init__(self, parent, + wx.activex.CLSID('%s'), + ID, pos, size, style, name) + """ % (className, className, ax.GetCLSID().GetCLSIDString()) ) + + + def WriteMethods(self, ax): + methods = ax.GetAXMethods() + if methods: + self.write(t4, "# Methods exported by the ActiveX object") + for m in methods: + name = self.trimMethodName(m.name) + self.write(t4, "def %s(self%s):" % (name, self.getParameters(m, True))) + self.write(t8, "return self.CallAXMethod('%s'%s)" % (m.name, self.getParameters(m, False))) + self.write() + + + def WriteProperties(self, ax): + props = ax.GetAXProperties() + if props: + self.write(t4, "# Getters, Setters and properties") + for p in props: + getterName = setterName = "None" + if p.canGet: + getterName = "_get_" + p.name + self.write(t4, "def %s(self):" % getterName) + self.write(t8, "return self.GetAXProp('%s')" % p.name) + if p.canSet: + setterName = "_set_" + p.name + self.write(t4, "def %s(self, %s):" % (setterName, p.arg.name)) + self.write(t8, "self.SetAXProp('%s', %s)" % (p.name, p.arg.name)) + + self.write(t4, "%s = property(%s, %s)" % + (self.trimPropName(p.name), getterName, setterName)) + self.write() + + + def WriteDocs(self, ax): + self.write() + doc = GetAXInfo(ax) + for line in doc.split('\n'): + self.write("# ", line) + + + + def write(self, *args): + for a in args: + self.mf.write(a) + self.mf.write("\n") + + + def trimEventName(name): + if name.startswith("On"): + name = name[2:] + return name + trimEventName = staticmethod(trimEventName) + + + def trimPropName(name): + #name = name[0].lower() + name[1:] + name = name.lower() + import keyword + if name in keyword.kwlist: name += '_' + return name + trimPropName = staticmethod(trimPropName) + + + def trimMethodName(name): + import keyword + if name in keyword.kwlist: name += '_' + return name + trimMethodName = staticmethod(trimMethodName) + + + def getParameters(self, m, withDefaults): + import keyword + st = "" + # collect the input parameters, if both isIn and isOut are + # False then assume it is an input paramater + params = [] + for p in m.params: + if p.isIn or (not p.isIn and not p.isOut): + params.append(p) + # did we get any? + for p in params: + name = p.name + if name in keyword.kwlist: name += '_' + st += ", " + st += name + if withDefaults and p.isOptional: + st += '=None' + return st + + +#--------------------------------------------------------------------------- + + diff --git a/wxPython/contrib/activex/activex_wrap.cpp b/wxPython/contrib/activex/activex_wrap.cpp new file mode 100644 index 0000000000..08a5b1b4dd --- /dev/null +++ b/wxPython/contrib/activex/activex_wrap.cpp @@ -0,0 +1,3708 @@ +/* ---------------------------------------------------------------------------- + * This file was automatically generated by SWIG (http://www.swig.org). + * Version 1.3.22 + * + * This file is not intended to be easily readable and contains a number of + * coding conventions designed to improve portability and efficiency. Do not make + * changes to this file unless you know what you are doing--modify the SWIG + * interface file instead. + * ----------------------------------------------------------------------------- */ + +#define SWIGPYTHON +#define SWIG_NOINCLUDE + +#ifdef __cplusplus +template class SwigValueWrapper { + T *tt; +public: + SwigValueWrapper() : tt(0) { } + SwigValueWrapper(const SwigValueWrapper& rhs) : tt(new T(*rhs.tt)) { } + SwigValueWrapper(const T& t) : tt(new T(t)) { } + ~SwigValueWrapper() { delete tt; } + SwigValueWrapper& operator=(const T& t) { delete tt; tt = new T(t); return *this; } + operator T&() const { return *tt; } + T *operator&() { return tt; } +private: + SwigValueWrapper& operator=(const SwigValueWrapper& rhs); +}; +#endif + + +#include "Python.h" + +/*************************************************************** -*- c -*- + * python/precommon.swg + * + * Rename all exported symbols from common.swg, to avoid symbol + * clashes if multiple interpreters are included + * + ************************************************************************/ + +#define SWIG_TypeRegister SWIG_Python_TypeRegister +#define SWIG_TypeCheck SWIG_Python_TypeCheck +#define SWIG_TypeCast SWIG_Python_TypeCast +#define SWIG_TypeDynamicCast SWIG_Python_TypeDynamicCast +#define SWIG_TypeName SWIG_Python_TypeName +#define SWIG_TypeQuery SWIG_Python_TypeQuery +#define SWIG_TypeClientData SWIG_Python_TypeClientData +#define SWIG_PackData SWIG_Python_PackData +#define SWIG_UnpackData SWIG_Python_UnpackData + + +/*********************************************************************** + * common.swg for wxPython + * + * Include only the function prototypes and such from SWIG's common.swg, + * but not the runtime functions themselves. This helps keep the + * wrapper files clean of unnecessary stuff that is in the libpy.c file + * anyway. + * + ************************************************************************/ + +#include + +#if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__) +# if defined(_MSC_VER) || defined(__GNUC__) +# if defined(STATIC_LINKED) +# define SWIGEXPORT(a) a +# define SWIGIMPORT(a) extern a +# else +# define SWIGEXPORT(a) __declspec(dllexport) a +# define SWIGIMPORT(a) extern a +# endif +# else +# if defined(__BORLANDC__) +# define SWIGEXPORT(a) a _export +# define SWIGIMPORT(a) a _export +# else +# define SWIGEXPORT(a) a +# define SWIGIMPORT(a) a +# endif +# endif +#else +# define SWIGEXPORT(a) a +# define SWIGIMPORT(a) a +#endif + +#ifdef SWIG_GLOBAL +# define SWIGRUNTIME(a) SWIGEXPORT(a) +#else +# define SWIGRUNTIME(a) static a +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +typedef void *(*swig_converter_func)(void *); +typedef struct swig_type_info *(*swig_dycast_func)(void **); + +typedef struct swig_type_info { + const char *name; + swig_converter_func converter; + const char *str; + void *clientdata; + swig_dycast_func dcast; + struct swig_type_info *next; + struct swig_type_info *prev; +} swig_type_info; + + +SWIGIMPORT(swig_type_info *) SWIG_TypeRegister(swig_type_info *); +SWIGIMPORT(swig_type_info *) SWIG_TypeCheck(char *c, swig_type_info *); +SWIGIMPORT(void *) SWIG_TypeCast(swig_type_info *, void *); +SWIGIMPORT(swig_type_info *) SWIG_TypeDynamicCast(swig_type_info *, void **); +SWIGIMPORT(const char *) SWIG_TypeName(const swig_type_info *); +SWIGIMPORT(swig_type_info *) SWIG_TypeQuery(const char *); +SWIGIMPORT(void) SWIG_TypeClientData(swig_type_info *, void *); +SWIGIMPORT(char *) SWIG_PackData(char *, void *, int); +SWIGIMPORT(char *) SWIG_UnpackData(char *, void *, int); + + +#ifdef __cplusplus +} +#endif + +/*********************************************************************** + * pyrun.swg for wxPython + * + * Include only the function prototypes and such from SWIG's pyrun.swg, + * but not the runtime functions themselves. This helps keep the + * wrapper files clean of unnecessary stuff that is in the libpy.c file + * anyway. + * + ************************************************************************/ + +#include "Python.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#define SWIG_PY_INT 1 +#define SWIG_PY_FLOAT 2 +#define SWIG_PY_STRING 3 +#define SWIG_PY_POINTER 4 +#define SWIG_PY_BINARY 5 + +/* Flags for pointer conversion */ + +#define SWIG_POINTER_EXCEPTION 0x1 +#define SWIG_POINTER_DISOWN 0x2 + +/* Exception handling in wrappers */ +#define SWIG_fail goto fail + +/* Constant information structure */ +typedef struct swig_const_info { + int type; + char *name; + long lvalue; + double dvalue; + void *pvalue; + swig_type_info **ptype; +} swig_const_info; + +/* Common SWIG API */ +#define SWIG_ConvertPtr(obj, pp, type, flags) \ + SWIG_Python_ConvertPtr(obj, pp, type, flags) +#define SWIG_NewPointerObj(p, type, flags) \ + SWIG_Python_NewPointerObj(p, type, flags) +#define SWIG_MustGetPtr(p, type, argnum, flags) \ + SWIG_Python_MustGetPtr(p, type, argnum, flags) + +/* Python-specific SWIG API */ +#define SWIG_newvarlink() \ + SWIG_Python_newvarlink() +#define SWIG_addvarlink(p, name, get_attr, set_attr) \ + SWIG_Python_addvarlink(p, name, get_attr, set_attr) +#define SWIG_ConvertPacked(obj, ptr, sz, ty, flags) \ + SWIG_Python_ConvertPacked(obj, ptr, sz, ty, flags) +#define SWIG_NewPackedObj(ptr, sz, type) \ + SWIG_Python_NewPackedObj(ptr, sz, type) +#define SWIG_InstallConstants(d, constants) \ + SWIG_Python_InstallConstants(d, constants) + +typedef double (*py_objasdbl_conv)(PyObject *obj); + +SWIGIMPORT(int) SWIG_Python_ConvertPtr(PyObject *, void **, swig_type_info *, int); +SWIGIMPORT(PyObject *) SWIG_Python_NewPointerObj(void *, swig_type_info *,int own); +SWIGIMPORT(void *) SWIG_Python_MustGetPtr(PyObject *, swig_type_info *, int, int); +SWIGIMPORT(PyObject *) SWIG_Python_newvarlink(void); +SWIGIMPORT(void) SWIG_Python_addvarlink(PyObject *, char *, PyObject *(*)(void), int (*)(PyObject *)); +SWIGIMPORT(int) SWIG_Python_ConvertPacked(PyObject *, void *, int sz, swig_type_info *, int); +SWIGIMPORT(PyObject *) SWIG_Python_NewPackedObj(void *, int sz, swig_type_info *); +SWIGIMPORT(void) SWIG_Python_InstallConstants(PyObject *d, swig_const_info constants[]); + + +/* Contract support */ + +#define SWIG_contract_assert(expr, msg) if (!(expr)) { PyErr_SetString(PyExc_RuntimeError, (char *) msg ); goto fail; } else + +#ifdef __cplusplus +} +#endif + + +/* -------- TYPES TABLE (BEGIN) -------- */ + +#define SWIGTYPE_p_wxObject swig_types[0] +#define SWIGTYPE_p_wxFuncX swig_types[1] +#define SWIGTYPE_p_wxActiveXWindow swig_types[2] +#define SWIGTYPE_p_wxWindow swig_types[3] +#define SWIGTYPE_p_wxCommandEvent swig_types[4] +#define SWIGTYPE_p_char swig_types[5] +#define SWIGTYPE_p_wxInputStream swig_types[6] +#define SWIGTYPE_p_wxEvtHandler swig_types[7] +#define SWIGTYPE_p_wxPropX swig_types[8] +#define SWIGTYPE_p_wxFuncXArray swig_types[9] +#define SWIGTYPE_p_wxParamXArray swig_types[10] +#define SWIGTYPE_p_wxActiveXEvent swig_types[11] +#define SWIGTYPE_p_wxParamX swig_types[12] +#define SWIGTYPE_p_wxIEHtmlWindowBase swig_types[13] +#define SWIGTYPE_p_wxPropXArray swig_types[14] +#define SWIGTYPE_p_wxEvent swig_types[15] +#define SWIGTYPE_p_CLSID swig_types[16] +static swig_type_info *swig_types[18]; + +/* -------- TYPES TABLE (END) -------- */ + + +/*----------------------------------------------- + @(target):= _activex.so + ------------------------------------------------*/ +#define SWIG_init init_activex + +#define SWIG_name "_activex" + +/* Auxiliar swig macros */ + +#ifdef __cplusplus +#define SWIGSTATICINLINE(a) static inline a +#define SWIGSTATIC(a) static a +#define swig_new_array(type, size) (new type[(size)]) +#define swig_delete_array(cptr) delete[] cptr +#define swig_const_cast(type,a) const_cast(a) +#define swig_static_cast(type,a) static_cast(a) +#define swig_reinterpret_cast(type,a) reinterpret_cast(a) + +#ifdef HAVE_NUMERIC_CAST +#define swig_numeric_cast(type,a) numeric_cast(a) +#else +#define swig_numeric_cast(type,a) static_cast(a) +#endif + +#else /* C case */ + +#define SWIGSTATICINLINE(a) static a +#define SWIGSTATIC(a) static a +#define swig_new_array(type, size) ((type*) malloc((size)*sizeof(type))) +#define swig_delete_array(cptr) free((char*)cptr) +#define swig_const_cast(type,a) (type)(a) +#define swig_static_cast(type,a) (type)(a) +#define swig_reinterpret_cast(type,a) (type)(a) +#define swig_numeric_cast(type,a) (type)(a) + +#endif /* __cplusplus */ + + +#define SWIG_FromSignedChar PyInt_FromLong +#define SWIG_FromUnsignedChar PyInt_FromLong +#define SWIG_FromShort PyInt_FromLong +#define SWIG_FromUnsignedShort PyInt_FromLong +#define SWIG_FromInt PyInt_FromLong +#define SWIG_FromLong PyInt_FromLong +#define SWIG_FromFloat PyFloat_FromDouble +#define SWIG_FromDouble PyFloat_FromDouble +#define SWIG_FromFloat PyFloat_FromDouble +#define SWIG_FromDouble PyFloat_FromDouble + + +#include "wx/wxPython/wxPython.h" +#include "wx/wxPython/pyclasses.h" +#include "wx/wxPython/pyistream.h" + +#include "wxactivex.h" + + static const wxString wxPyPanelNameStr(wxPanelNameStr); + +// Since SWIG doesn't support nested classes, we need to fool it a bit +// and make them look like global classes. These defines make the C++ code +// know what we are doing. +#define wxParamX wxActiveX::ParamX +#define wxFuncX wxActiveX::FuncX +#define wxPropX wxActiveX::PropX +#define wxParamXArray wxActiveX::ParamXArray +#define wxFuncXArray wxActiveX::FuncXArray +#define wxPropXArray wxActiveX::PropXArray + + +// Some conversion helpers +static wxVariant _PyObj2Variant(PyObject* value); +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; + wxPyBeginBlockThreads(); + rval = PyErr_Occurred() != NULL; + wxPyEndBlockThreads(); + return rval; +} + + +CLSID *new_CLSID(wxString const &id){ + int result; + CLSID* self = new CLSID; + memset(self, 0, sizeof(CLSID)); + + if (id[0] == _T('{')) { + // Looks like a classID string + result = + CLSIDFromString( + (LPOLESTR)(const wchar_t *)id.wc_str(wxConvUTF8), + self); + } else { + // Try a progID + result = + CLSIDFromProgID( + (LPOLESTR)(const wchar_t *)id.wc_str(wxConvUTF8), + self); + } + if (result != NOERROR) { + wxPyErr_SetString(PyExc_ValueError, "Not a recognized classID or progID"); + delete self; + return NULL; + } + return self; + } +void delete_CLSID(CLSID *self){ delete self; } +wxString CLSID_GetCLSIDString(CLSID *self){ + LPOLESTR s; + wxString str; + if (StringFromCLSID(*self, &s) == S_OK) { + str = s; + CoTaskMemFree(s); + } + else { + str = _T("Error!"); // TODO: raise exception? + } + return str; + } +wxString CLSID_GetProgIDString(CLSID *self){ + LPOLESTR s; + wxString str; + if (ProgIDFromCLSID(*self, &s) == S_OK) { + str = s; + CoTaskMemFree(s); + } + else { + str = _T("Error!"); // TODO: raise exception? + } + return str; + } +wxString wxParamX_vt_type_get(wxParamX *self){ return _VARTYPEname(self->vt); } +bool wxParamXArray___nonzero__(wxParamXArray *self){ return self->size() > 0; } +int wxParamXArray___len__(wxParamXArray *self){ return self->size(); } + +#include + + +SWIGSTATICINLINE(long) +SWIG_CheckLongInRange(long value, const char* type, + long min_value, long max_value) +{ + if (!PyErr_Occurred()) { + if (value < min_value) { + PyObject *err = + PyString_FromFormat("value %ld is less than '%s' minimum %ld", + value, type, min_value); + + PyErr_SetObject(PyExc_OverflowError, err); + Py_DECREF(err); + } else if (value > max_value) { + PyObject *err = + PyString_FromFormat("value %ld is greater than '%s' maximum %ld", + value, type, max_value); + PyErr_SetObject(PyExc_OverflowError, err); + Py_DECREF(err); + } + } + return value; +} + + +SWIGSTATICINLINE(long) +SWIG_AsLong(PyObject * obj) +{ + return PyInt_Check(obj) ? PyInt_AsLong(obj) : PyLong_AsLong(obj); +} + + +#if INT_MAX != LONG_MAX +SWIGSTATICINLINE(int) +SWIG_AsInt(PyObject *obj) +{ + return swig_numeric_cast(int, + SWIG_CheckLongInRange(SWIG_AsLong(obj), + "int", INT_MIN, INT_MAX)); +} +#else +#define SWIG_AsInt SWIG_AsLong +#endif + + +SWIGSTATICINLINE(int) +SWIG_CheckInt(PyObject* obj) +{ + SWIG_AsInt(obj); + if (PyErr_Occurred()) { + PyErr_Clear(); + return 0; + } else { + return 1; + } +} + +wxParamX const &wxParamXArray___getitem__(wxParamXArray *self,int idx){ + if ( idx >= 0 && idx < self->size() ) + return (*self)[idx]; + else { + static wxParamX BadVal; + wxPyErr_SetString(PyExc_IndexError, "Index out of range"); + return BadVal; + } + } +bool wxFuncXArray___nonzero__(wxFuncXArray *self){ return self->size() > 0; } +int wxFuncXArray___len__(wxFuncXArray *self){ return self->size(); } +wxFuncX const &wxFuncXArray___getitem__(wxFuncXArray *self,int idx){ + if ( idx >= 0 && idx < self->size() ) + return (*self)[idx]; + else { + static wxFuncX BadVal; + wxPyErr_SetString(PyExc_IndexError, "Index out of range"); + return BadVal; + } + } +bool wxPropXArray___nonzero__(wxPropXArray *self){ return self->size() > 0; } +int wxPropXArray___len__(wxPropXArray *self){ return self->size(); } +wxPropX const &wxPropXArray___getitem__(wxPropXArray *self,int idx){ + if ( idx >= 0 && idx < self->size() ) + return (*self)[idx]; + else { + static wxPropX BadVal; + wxPyErr_SetString(PyExc_IndexError, "Index out of range"); + return BadVal; + } + } + +// C++ version of a Python-aware wxActiveX +class wxActiveXWindow : public wxActiveX +{ +private: + CLSID m_CLSID; +public: + wxActiveXWindow( wxWindow* parent, const CLSID& clsId, wxWindowID id = -1, + const wxPoint& pos = wxDefaultPosition, + const wxSize& size = wxDefaultSize, + long style = 0, + const wxString& name = wxPyPanelNameStr) + : wxActiveX(parent, clsId, id, pos, size, style, name) + { + m_CLSID = clsId; + } + + const CLSID& GetCLSID() const { return m_CLSID; } + + + // Renamed versions of some base class methods that delegate + // to the base where appropriate, and raise Python exceptions + // when needed. + int GetAXEventCount() const { return wxActiveX::GetEventCount(); } + int GetAXPropCount() const { return wxActiveX::GetPropCount(); } + int GetAXMethodCount() const { return wxActiveX::GetMethodCount(); } + + const wxFuncX& GetAXEventDesc(int idx) const + { + static wxFuncX BadVal; + if (idx < 0 || idx >= GetAXEventCount()) { + wxPyErr_SetString(PyExc_IndexError, "Index out of range"); + return BadVal; + } + return m_events[idx]; + } + const wxFuncX& GetAXMethodDesc(int idx) const + { + static wxFuncX BadVal; + if (idx < 0 || idx >= GetAXMethodCount()) { + wxPyErr_SetString(PyExc_IndexError, "Index out of range"); + return BadVal; + } + return m_methods[idx]; + } + const wxPropX& GetAXPropDesc(int idx) const + { + static wxPropX BadVal; + if (idx < 0 || idx >= GetAXPropCount()) { + wxPyErr_SetString(PyExc_IndexError, "Index out of range"); + return BadVal; + } + return m_props[idx]; + } + + const wxFuncX& GetAXMethodDesc(const wxString& name) const + { + NameMap::const_iterator it = m_methodNames.find(name); + if (it == m_methodNames.end()) { + wxString msg; + msg << "method <" << name << "> not found"; + wxPyErr_SetString(PyExc_KeyError, msg.mb_str()); + static wxFuncX BadVal; + return BadVal; + }; + return GetAXMethodDesc(it->second); + } + const wxPropX& GetAXPropDesc(const wxString& name) const + { + NameMap::const_iterator it = m_propNames.find(name); + if (it == m_propNames.end()) { + wxString msg; + msg << "property <" << name << "> not found"; + wxPyErr_SetString(PyExc_KeyError, msg.mb_str()); + static wxPropX BadVal; + return BadVal; + }; + return GetAXPropDesc(it->second); + } + + // Accessors for the internal vectors of events, methods and + // proprties. Can be used as sequence like objects from + // Python. + const wxFuncXArray& GetAXEvents() { return m_events; } + const wxFuncXArray& GetAXMethods() { return m_methods; } + const wxPropXArray& GetAXProperties() { return m_props; } + + + // Set a property from a Python object + void SetAXProp(const wxString& name, PyObject* value) + { + const wxPropX& prop = GetAXPropDesc(name); + wxPyBeginBlockThreads(); + if (! PyErr_Occurred() ) { + if (! prop.CanSet()) { + wxString msg; + msg << "property <" << name << "> is readonly"; + PyErr_SetString(PyExc_TypeError, msg.mb_str()); + goto done; + } else { + wxVariant wxV = _PyObj2Variant(value); + if (PyErr_Occurred()) + goto done; + VARIANT v = {prop.arg.vt}; + if (!VariantToMSWVariant(wxV, v) || PyErr_Occurred()) { + wxString msg; + msg << "Unable to convert value to expected type: (" + << _VARTYPEname(prop.arg.vt) << ") for property <" + << name << ">"; + PyErr_SetString(PyExc_TypeError, msg.mb_str()); + goto done; + } + PyThreadState* tstate = wxPyBeginAllowThreads(); + SetProp(prop.memid, v); + VariantClear(&v); + wxPyEndAllowThreads(tstate); + } + } + done: + wxPyEndBlockThreads(); + } + + + // Get a property and convert it to a Python object + PyObject* GetAXProp(const wxString& name) + { + PyObject* rval = NULL; + const wxPropX& prop = GetAXPropDesc(name); + wxPyBeginBlockThreads(); + if (! PyErr_Occurred() ) { + if (! prop.CanGet()) { + wxString msg; + msg << "property <" << name << "> is writeonly"; + PyErr_SetString(PyExc_TypeError, msg.mb_str()); + goto done; + } else { + PyThreadState* tstate = wxPyBeginAllowThreads(); + VARIANT v = GetPropAsVariant(prop.memid); + wxPyEndAllowThreads(tstate); + wxVariant wv; + if (!MSWVariantToVariant(v, wv) || PyErr_Occurred()) { + wxString msg; + msg << "Unable to convert value to expected type: (" + << _VARTYPEname(prop.arg.vt) << ") for property <" + << name << ">"; + PyErr_SetString(PyExc_TypeError, msg.mb_str()); + goto done; + } + rval = _Variant2PyObj(wv); + VariantClear(&v); + } + } + done: + wxPyEndBlockThreads(); + return rval; + } + + + // If both IsIn and isOut are false, assume it is actually an + // input param + bool paramIsIn(const wxParamX& p) + { + return p.IsIn() || (!p.IsIn() && !p.IsOut()); + } + + + // Call a method of the ActiveX object + PyObject* _CallAXMethod(const wxString& name, PyObject* args) + { + VARIANTARG *vargs = NULL; + int nargs = 0; + PyObject* rval = NULL; + const wxFuncX& func = GetAXMethodDesc(name); + + wxPyBeginBlockThreads(); + if (! PyErr_Occurred() ) { + nargs = func.params.size(); + if (nargs > 0) + vargs = new VARIANTARG[nargs]; + + if (vargs) { + // init type of vargs, in reverse order + int i; + for (i = 0; i < nargs; i++) + vargs[nargs - i - 1].vt = func.params[i].vt; + + // Map the args coming from Python to the input parameters in vargs + int pi = 0; + i = 0; + while ( iParamCount(); i+=1) { + PyObject* name = PyString_FromString((char*)self->ParamName(i).mb_str()); + PyObject* val = _Variant2PyObj((*self)[i], True); + PyObject_SetAttr(pyself, name, val); + PyList_Append(pList, name); + Py_DECREF(val); + Py_DECREF(name); + } + wxPyEndBlockThreads(); + } + + +// Caller should already have the GIL! +wxVariant _PyObj2Variant(PyObject* value) +{ + wxVariant rval; + + if (value == Py_None) + return rval; + + else if (PyBool_Check(value)) + rval = (value == Py_True) ? true : false; + + else if (PyInt_Check(value)) + rval = PyInt_AS_LONG(value); + + else if (PyFloat_Check(value)) + rval = PyFloat_AS_DOUBLE(value); + + else if (PyString_Check(value) || PyUnicode_Check(value)) + rval = Py2wxString(value); + + // TODO: PyList of strings --> wxArrayString + // wxDateTime + // list of objects + + else { + PyErr_SetString(PyExc_TypeError, "Unsupported object type in _PyObj2Variant"); + rval = (long)0; + } + + return rval; +} + + +// Caller should already have the GIL! +PyObject* _Variant2PyObj(wxVariant& value, bool useNone) +{ + PyObject* rval = NULL; + + if (value.IsNull()) { + rval = Py_None; + Py_INCREF(rval); + } + + // should "char" be treated as an int or as a string? + else if (value.IsType(_T("char")) || value.IsType(_T("long"))) + rval = PyInt_FromLong(value); + + else if (value.IsType(_T("double"))) + rval = PyFloat_FromDouble(value); + + else if (value.IsType(_T("bool"))) + rval = PyBool_FromLong((bool)value); + + else if (value.IsType(_T("string"))) + rval = wx2PyString(value); + + else { + if (useNone) { + rval = Py_None; + Py_INCREF(rval); + } + else { + PyErr_SetString(PyExc_TypeError, "Unsupported object type in _Variant2PyObj"); + } + } + return rval; +} + + +wxString _VARTYPEname(VARTYPE vt) +{ + if (vt & VT_BYREF) + vt &= ~(VT_BYREF); + + switch(vt) { + case VT_VARIANT: + return _T("VT_VARIANT"); + + // 1 byte chars + case VT_I1: + case VT_UI1: + // 2 byte shorts + case VT_I2: + case VT_UI2: + // 4 bytes longs + case VT_I4: + case VT_UI4: + case VT_INT: + case VT_UINT: + case VT_ERROR: + return _T("int"); + + // 4 byte floats + case VT_R4: + // 8 byte doubles + case VT_R8: + // decimals are converted from doubles too + case VT_DECIMAL: + return _T("double"); + + case VT_BOOL: + return _T("bool"); + + case VT_DATE: + return _T("wx.DateTime"); + + case VT_BSTR: + return _T("string"); + + case VT_UNKNOWN: + return _T("VT_UNKNOWN"); + + case VT_DISPATCH: + return _T("VT_DISPATCH"); + + case VT_EMPTY: + return _T("VT_EMPTY"); + + case VT_NULL: + return _T("VT_NULL"); + + case VT_VOID: + return _T("VT_VOID"); + + default: + wxString msg; + msg << _T("unsupported type ") << vt; + return msg; + } +} + + + +// A class derived from out 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 +// also get some of the extra stuff like loading a document from +// a string or a stream, getting text contents, etc. that +// Lindsay's version gives us. +// + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "IEHtmlStream.h" + +class wxIEHtmlWindowBase : public wxActiveXWindow { +private: + wxAutoOleInterface m_webBrowser; + +public: + + wxIEHtmlWindowBase ( wxWindow* parent, const CLSID& clsId, wxWindowID id = -1, + const wxPoint& pos = wxDefaultPosition, + const wxSize& size = wxDefaultSize, + long style = 0, + const wxString& name = wxPyPanelNameStr) + : wxActiveXWindow(parent, clsId, id, pos, size, style, name) + { + HRESULT hret; + + // Get IWebBrowser2 Interface + hret = m_webBrowser.QueryInterface(IID_IWebBrowser2, m_ActiveX); + wxASSERT(SUCCEEDED(hret)); + } + + + void SetCharset(const wxString& charset) + { + HRESULT hret; + + // HTML Document ? + IDispatch *pDisp = NULL; + hret = m_webBrowser->get_Document(&pDisp); + wxAutoOleInterface disp(pDisp); + + if (disp.Ok()) + { + wxAutoOleInterface doc(IID_IHTMLDocument2, disp); + if (doc.Ok()) + doc->put_charset((BSTR) (const wchar_t *) charset.wc_str(wxConvUTF8)); + //doc->put_charset((BSTR) wxConvUTF8.cMB2WC(charset).data()); + } + } + + + bool LoadString(const wxString& html) + { + char *data = NULL; + size_t len = html.length(); + len *= sizeof(wxChar); + data = (char *) malloc(len); + memcpy(data, html.c_str(), len); + return LoadStream(new wxOwnedMemInputStream(data, len)); + } + + + bool LoadStream(IStreamAdaptorBase *pstrm) + { + // need to prepend this as poxy MSHTML will not recognise a HTML comment + // as starting a html document and treats it as plain text + // Does nayone know how to force it to html mode ? + pstrm->prepend = ""; + + // strip leading whitespace as it can confuse MSHTML + wxAutoOleInterface strm(pstrm); + + // Document Interface + IDispatch *pDisp = NULL; + HRESULT hret = m_webBrowser->get_Document(&pDisp); + if (! pDisp) + return false; + wxAutoOleInterface disp(pDisp); + + + // get IPersistStreamInit + wxAutoOleInterface + pPersistStreamInit(IID_IPersistStreamInit, disp); + + if (pPersistStreamInit.Ok()) + { + HRESULT hr = pPersistStreamInit->InitNew(); + if (SUCCEEDED(hr)) + hr = pPersistStreamInit->Load(strm); + + return SUCCEEDED(hr); + } + else + return false; + } + + bool LoadStream(wxInputStream *is) + { + // wrap reference around stream + IwxStreamAdaptor *pstrm = new IwxStreamAdaptor(is); + pstrm->AddRef(); + + return LoadStream(pstrm); + } + + + wxString GetStringSelection(bool asHTML) + { + wxAutoOleInterface tr(wxieGetSelRange(m_oleObject)); + if (! tr) + return wxEmptyString; + + BSTR text = NULL; + HRESULT hr = E_FAIL; + + if (asHTML) + hr = tr->get_htmlText(&text); + else + hr = tr->get_text(&text); + if (hr != S_OK) + return wxEmptyString; + + wxString s = text; + SysFreeString(text); + + return s; + }; + + wxString GetText(bool asHTML) + { + if (! m_webBrowser.Ok()) + return wxEmptyString; + + // get document dispatch interface + IDispatch *iDisp = NULL; + HRESULT hr = m_webBrowser->get_Document(&iDisp); + if (hr != S_OK) + return wxEmptyString; + + // Query for Document Interface + wxAutoOleInterface hd(IID_IHTMLDocument2, iDisp); + iDisp->Release(); + + if (! hd.Ok()) + return wxEmptyString; + + // get body element + IHTMLElement *_body = NULL; + hd->get_body(&_body); + if (! _body) + return wxEmptyString; + wxAutoOleInterface body(_body); + + // get inner text + BSTR text = NULL; + hr = E_FAIL; + + if (asHTML) + hr = body->get_innerHTML(&text); + else + hr = body->get_innerText(&text); + if (hr != S_OK) + return wxEmptyString; + + wxString s = text; + SysFreeString(text); + + return s; + } + + +// void wxIEHtmlWin::SetEditMode(bool seton) +// { +// m_bAmbientUserMode = ! seton; +// AmbientPropertyChanged(DISPID_AMBIENT_USERMODE); +// }; + +// bool wxIEHtmlWin::GetEditMode() +// { +// return ! m_bAmbientUserMode; +// }; +}; + + +SWIGSTATICINLINE(bool) +SWIG_AsBool(PyObject *obj) +{ + return PyObject_IsTrue(obj) ? true : false; +} + + +SWIGSTATICINLINE(int) +SWIG_CheckBool(PyObject* obj) +{ + SWIG_AsBool(obj); + if (PyErr_Occurred()) { + PyErr_Clear(); + return 0; + } else { + return 1; + } +} + +#ifdef __cplusplus +extern "C" { +#endif +static PyObject *_wrap_new_CLSID(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject *resultobj; + wxString *arg1 = 0 ; + CLSID *result; + bool temp1 = False ; + PyObject * obj0 = 0 ; + char *kwnames[] = { + (char *) "id", NULL + }; + + if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"O:new_CLSID",kwnames,&obj0)) goto fail; + { + arg1 = wxString_in_helper(obj0); + if (arg1 == NULL) SWIG_fail; + temp1 = True; + } + { + PyThreadState* __tstate = wxPyBeginAllowThreads(); + result = (CLSID *)new_CLSID((wxString const &)*arg1); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) SWIG_fail; + } + resultobj = SWIG_NewPointerObj((void*)(result), SWIGTYPE_p_CLSID, 1); + { + if (temp1) + delete arg1; + } + return resultobj; + fail: + { + if (temp1) + delete arg1; + } + return NULL; +} + + +static PyObject *_wrap_delete_CLSID(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject *resultobj; + CLSID *arg1 = (CLSID *) 0 ; + PyObject * obj0 = 0 ; + char *kwnames[] = { + (char *) "self", NULL + }; + + if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"O:delete_CLSID",kwnames,&obj0)) goto fail; + if ((SWIG_ConvertPtr(obj0,(void **)(&arg1),SWIGTYPE_p_CLSID, + SWIG_POINTER_EXCEPTION | 0)) == -1) SWIG_fail; + { + PyThreadState* __tstate = wxPyBeginAllowThreads(); + delete_CLSID(arg1); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) SWIG_fail; + } + Py_INCREF(Py_None); resultobj = Py_None; + return resultobj; + fail: + return NULL; +} + + +static PyObject *_wrap_CLSID_GetCLSIDString(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject *resultobj; + CLSID *arg1 = (CLSID *) 0 ; + wxString result; + PyObject * obj0 = 0 ; + char *kwnames[] = { + (char *) "self", NULL + }; + + if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"O:CLSID_GetCLSIDString",kwnames,&obj0)) goto fail; + if ((SWIG_ConvertPtr(obj0,(void **)(&arg1),SWIGTYPE_p_CLSID, + SWIG_POINTER_EXCEPTION | 0)) == -1) SWIG_fail; + { + PyThreadState* __tstate = wxPyBeginAllowThreads(); + result = CLSID_GetCLSIDString(arg1); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) SWIG_fail; + } + { +#if wxUSE_UNICODE + resultobj = PyUnicode_FromWideChar((&result)->c_str(), (&result)->Len()); +#else + resultobj = PyString_FromStringAndSize((&result)->c_str(), (&result)->Len()); +#endif + } + return resultobj; + fail: + return NULL; +} + + +static PyObject *_wrap_CLSID_GetProgIDString(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject *resultobj; + CLSID *arg1 = (CLSID *) 0 ; + wxString result; + PyObject * obj0 = 0 ; + char *kwnames[] = { + (char *) "self", NULL + }; + + if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"O:CLSID_GetProgIDString",kwnames,&obj0)) goto fail; + if ((SWIG_ConvertPtr(obj0,(void **)(&arg1),SWIGTYPE_p_CLSID, + SWIG_POINTER_EXCEPTION | 0)) == -1) SWIG_fail; + { + PyThreadState* __tstate = wxPyBeginAllowThreads(); + result = CLSID_GetProgIDString(arg1); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) SWIG_fail; + } + { +#if wxUSE_UNICODE + resultobj = PyUnicode_FromWideChar((&result)->c_str(), (&result)->Len()); +#else + resultobj = PyString_FromStringAndSize((&result)->c_str(), (&result)->Len()); +#endif + } + return resultobj; + fail: + return NULL; +} + + +static PyObject * CLSID_swigregister(PyObject *self, PyObject *args) { + PyObject *obj; + if (!PyArg_ParseTuple(args,(char*)"O", &obj)) return NULL; + SWIG_TypeClientData(SWIGTYPE_p_CLSID, obj); + Py_INCREF(obj); + return Py_BuildValue((char *)""); +} +static PyObject *_wrap_ParamX_flags_get(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject *resultobj; + wxParamX *arg1 = (wxParamX *) 0 ; + USHORT result; + PyObject * obj0 = 0 ; + char *kwnames[] = { + (char *) "self", NULL + }; + + if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"O:ParamX_flags_get",kwnames,&obj0)) goto fail; + if ((SWIG_ConvertPtr(obj0,(void **)(&arg1),SWIGTYPE_p_wxParamX, + SWIG_POINTER_EXCEPTION | 0)) == -1) SWIG_fail; + result = (USHORT) ((arg1)->flags); + + resultobj = SWIG_FromUnsignedShort((unsigned short)result); + return resultobj; + fail: + return NULL; +} + + +static PyObject *_wrap_ParamX_isPtr_get(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject *resultobj; + wxParamX *arg1 = (wxParamX *) 0 ; + bool result; + PyObject * obj0 = 0 ; + char *kwnames[] = { + (char *) "self", NULL + }; + + if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"O:ParamX_isPtr_get",kwnames,&obj0)) goto fail; + if ((SWIG_ConvertPtr(obj0,(void **)(&arg1),SWIGTYPE_p_wxParamX, + SWIG_POINTER_EXCEPTION | 0)) == -1) SWIG_fail; + result = (bool) ((arg1)->isPtr); + + resultobj = PyBool_FromLong((bool)result); + return resultobj; + fail: + return NULL; +} + + +static PyObject *_wrap_ParamX_isSafeArray_get(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject *resultobj; + wxParamX *arg1 = (wxParamX *) 0 ; + bool result; + PyObject * obj0 = 0 ; + char *kwnames[] = { + (char *) "self", NULL + }; + + if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"O:ParamX_isSafeArray_get",kwnames,&obj0)) goto fail; + if ((SWIG_ConvertPtr(obj0,(void **)(&arg1),SWIGTYPE_p_wxParamX, + SWIG_POINTER_EXCEPTION | 0)) == -1) SWIG_fail; + result = (bool) ((arg1)->isSafeArray); + + resultobj = PyBool_FromLong((bool)result); + return resultobj; + fail: + return NULL; +} + + +static PyObject *_wrap_ParamX_isOptional_get(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject *resultobj; + wxParamX *arg1 = (wxParamX *) 0 ; + bool result; + PyObject * obj0 = 0 ; + char *kwnames[] = { + (char *) "self", NULL + }; + + if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"O:ParamX_isOptional_get",kwnames,&obj0)) goto fail; + if ((SWIG_ConvertPtr(obj0,(void **)(&arg1),SWIGTYPE_p_wxParamX, + SWIG_POINTER_EXCEPTION | 0)) == -1) SWIG_fail; + result = (bool) ((arg1)->isOptional); + + resultobj = PyBool_FromLong((bool)result); + return resultobj; + fail: + return NULL; +} + + +static PyObject *_wrap_ParamX_vt_get(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject *resultobj; + wxParamX *arg1 = (wxParamX *) 0 ; + VARTYPE result; + PyObject * obj0 = 0 ; + char *kwnames[] = { + (char *) "self", NULL + }; + + if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"O:ParamX_vt_get",kwnames,&obj0)) goto fail; + if ((SWIG_ConvertPtr(obj0,(void **)(&arg1),SWIGTYPE_p_wxParamX, + SWIG_POINTER_EXCEPTION | 0)) == -1) SWIG_fail; + result = (VARTYPE) ((arg1)->vt); + + resultobj = SWIG_FromUnsignedShort((unsigned short)result); + return resultobj; + fail: + return NULL; +} + + +static PyObject *_wrap_ParamX_name_get(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject *resultobj; + wxParamX *arg1 = (wxParamX *) 0 ; + wxString *result; + PyObject * obj0 = 0 ; + char *kwnames[] = { + (char *) "self", NULL + }; + + if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"O:ParamX_name_get",kwnames,&obj0)) goto fail; + if ((SWIG_ConvertPtr(obj0,(void **)(&arg1),SWIGTYPE_p_wxParamX, + SWIG_POINTER_EXCEPTION | 0)) == -1) SWIG_fail; + result = (wxString *)& ((arg1)->name); + + { +#if wxUSE_UNICODE + resultobj = PyUnicode_FromWideChar(result->c_str(), result->Len()); +#else + resultobj = PyString_FromStringAndSize(result->c_str(), result->Len()); +#endif + } + return resultobj; + fail: + return NULL; +} + + +static PyObject *_wrap_ParamX_vt_type_get(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject *resultobj; + wxParamX *arg1 = (wxParamX *) 0 ; + wxString result; + PyObject * obj0 = 0 ; + char *kwnames[] = { + (char *) "self", NULL + }; + + if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"O:ParamX_vt_type_get",kwnames,&obj0)) goto fail; + if ((SWIG_ConvertPtr(obj0,(void **)(&arg1),SWIGTYPE_p_wxParamX, + SWIG_POINTER_EXCEPTION | 0)) == -1) SWIG_fail; + { + PyThreadState* __tstate = wxPyBeginAllowThreads(); + result = wxParamX_vt_type_get(arg1); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) SWIG_fail; + } + { +#if wxUSE_UNICODE + resultobj = PyUnicode_FromWideChar((&result)->c_str(), (&result)->Len()); +#else + resultobj = PyString_FromStringAndSize((&result)->c_str(), (&result)->Len()); +#endif + } + return resultobj; + fail: + return NULL; +} + + +static PyObject *_wrap_ParamX_IsIn(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject *resultobj; + wxParamX *arg1 = (wxParamX *) 0 ; + bool result; + PyObject * obj0 = 0 ; + char *kwnames[] = { + (char *) "self", NULL + }; + + if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"O:ParamX_IsIn",kwnames,&obj0)) goto fail; + if ((SWIG_ConvertPtr(obj0,(void **)(&arg1),SWIGTYPE_p_wxParamX, + SWIG_POINTER_EXCEPTION | 0)) == -1) SWIG_fail; + { + PyThreadState* __tstate = wxPyBeginAllowThreads(); + result = (bool)((wxParamX const *)arg1)->IsIn(); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) SWIG_fail; + } + resultobj = PyBool_FromLong((bool)result); + return resultobj; + fail: + return NULL; +} + + +static PyObject *_wrap_ParamX_IsOut(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject *resultobj; + wxParamX *arg1 = (wxParamX *) 0 ; + bool result; + PyObject * obj0 = 0 ; + char *kwnames[] = { + (char *) "self", NULL + }; + + if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"O:ParamX_IsOut",kwnames,&obj0)) goto fail; + if ((SWIG_ConvertPtr(obj0,(void **)(&arg1),SWIGTYPE_p_wxParamX, + SWIG_POINTER_EXCEPTION | 0)) == -1) SWIG_fail; + { + PyThreadState* __tstate = wxPyBeginAllowThreads(); + result = (bool)((wxParamX const *)arg1)->IsOut(); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) SWIG_fail; + } + resultobj = PyBool_FromLong((bool)result); + return resultobj; + fail: + return NULL; +} + + +static PyObject *_wrap_ParamX_IsRetVal(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject *resultobj; + wxParamX *arg1 = (wxParamX *) 0 ; + bool result; + PyObject * obj0 = 0 ; + char *kwnames[] = { + (char *) "self", NULL + }; + + if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"O:ParamX_IsRetVal",kwnames,&obj0)) goto fail; + if ((SWIG_ConvertPtr(obj0,(void **)(&arg1),SWIGTYPE_p_wxParamX, + SWIG_POINTER_EXCEPTION | 0)) == -1) SWIG_fail; + { + PyThreadState* __tstate = wxPyBeginAllowThreads(); + result = (bool)((wxParamX const *)arg1)->IsRetVal(); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) SWIG_fail; + } + resultobj = PyBool_FromLong((bool)result); + return resultobj; + fail: + return NULL; +} + + +static PyObject * ParamX_swigregister(PyObject *self, PyObject *args) { + PyObject *obj; + if (!PyArg_ParseTuple(args,(char*)"O", &obj)) return NULL; + SWIG_TypeClientData(SWIGTYPE_p_wxParamX, obj); + Py_INCREF(obj); + return Py_BuildValue((char *)""); +} +static PyObject *_wrap_FuncX_name_get(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject *resultobj; + wxFuncX *arg1 = (wxFuncX *) 0 ; + wxString *result; + PyObject * obj0 = 0 ; + char *kwnames[] = { + (char *) "self", NULL + }; + + if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"O:FuncX_name_get",kwnames,&obj0)) goto fail; + if ((SWIG_ConvertPtr(obj0,(void **)(&arg1),SWIGTYPE_p_wxFuncX, + SWIG_POINTER_EXCEPTION | 0)) == -1) SWIG_fail; + result = (wxString *)& ((arg1)->name); + + { +#if wxUSE_UNICODE + resultobj = PyUnicode_FromWideChar(result->c_str(), result->Len()); +#else + resultobj = PyString_FromStringAndSize(result->c_str(), result->Len()); +#endif + } + return resultobj; + fail: + return NULL; +} + + +static PyObject *_wrap_FuncX_memid_get(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject *resultobj; + wxFuncX *arg1 = (wxFuncX *) 0 ; + MEMBERID result; + PyObject * obj0 = 0 ; + char *kwnames[] = { + (char *) "self", NULL + }; + + if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"O:FuncX_memid_get",kwnames,&obj0)) goto fail; + if ((SWIG_ConvertPtr(obj0,(void **)(&arg1),SWIGTYPE_p_wxFuncX, + SWIG_POINTER_EXCEPTION | 0)) == -1) SWIG_fail; + result = (MEMBERID) ((arg1)->memid); + + resultobj = SWIG_FromLong((long)result); + return resultobj; + fail: + return NULL; +} + + +static PyObject *_wrap_FuncX_hasOut_get(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject *resultobj; + wxFuncX *arg1 = (wxFuncX *) 0 ; + bool result; + PyObject * obj0 = 0 ; + char *kwnames[] = { + (char *) "self", NULL + }; + + if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"O:FuncX_hasOut_get",kwnames,&obj0)) goto fail; + if ((SWIG_ConvertPtr(obj0,(void **)(&arg1),SWIGTYPE_p_wxFuncX, + SWIG_POINTER_EXCEPTION | 0)) == -1) SWIG_fail; + result = (bool) ((arg1)->hasOut); + + resultobj = PyBool_FromLong((bool)result); + return resultobj; + fail: + return NULL; +} + + +static PyObject *_wrap_FuncX_retType_get(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject *resultobj; + wxFuncX *arg1 = (wxFuncX *) 0 ; + wxParamX *result; + PyObject * obj0 = 0 ; + char *kwnames[] = { + (char *) "self", NULL + }; + + if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"O:FuncX_retType_get",kwnames,&obj0)) goto fail; + if ((SWIG_ConvertPtr(obj0,(void **)(&arg1),SWIGTYPE_p_wxFuncX, + SWIG_POINTER_EXCEPTION | 0)) == -1) SWIG_fail; + result = (wxParamX *)& ((arg1)->retType); + + resultobj = SWIG_NewPointerObj((void*)(result), SWIGTYPE_p_wxParamX, 0); + return resultobj; + fail: + return NULL; +} + + +static PyObject *_wrap_FuncX_params_get(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject *resultobj; + wxFuncX *arg1 = (wxFuncX *) 0 ; + wxParamXArray *result; + PyObject * obj0 = 0 ; + char *kwnames[] = { + (char *) "self", NULL + }; + + if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"O:FuncX_params_get",kwnames,&obj0)) goto fail; + if ((SWIG_ConvertPtr(obj0,(void **)(&arg1),SWIGTYPE_p_wxFuncX, + SWIG_POINTER_EXCEPTION | 0)) == -1) SWIG_fail; + result = (wxParamXArray *)& ((arg1)->params); + + resultobj = SWIG_NewPointerObj((void*)(result), SWIGTYPE_p_wxParamXArray, 0); + return resultobj; + fail: + return NULL; +} + + +static PyObject * FuncX_swigregister(PyObject *self, PyObject *args) { + PyObject *obj; + if (!PyArg_ParseTuple(args,(char*)"O", &obj)) return NULL; + SWIG_TypeClientData(SWIGTYPE_p_wxFuncX, obj); + Py_INCREF(obj); + return Py_BuildValue((char *)""); +} +static PyObject *_wrap_PropX_name_get(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject *resultobj; + wxPropX *arg1 = (wxPropX *) 0 ; + wxString *result; + PyObject * obj0 = 0 ; + char *kwnames[] = { + (char *) "self", NULL + }; + + if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"O:PropX_name_get",kwnames,&obj0)) goto fail; + if ((SWIG_ConvertPtr(obj0,(void **)(&arg1),SWIGTYPE_p_wxPropX, + SWIG_POINTER_EXCEPTION | 0)) == -1) SWIG_fail; + result = (wxString *)& ((arg1)->name); + + { +#if wxUSE_UNICODE + resultobj = PyUnicode_FromWideChar(result->c_str(), result->Len()); +#else + resultobj = PyString_FromStringAndSize(result->c_str(), result->Len()); +#endif + } + return resultobj; + fail: + return NULL; +} + + +static PyObject *_wrap_PropX_memid_get(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject *resultobj; + wxPropX *arg1 = (wxPropX *) 0 ; + MEMBERID result; + PyObject * obj0 = 0 ; + char *kwnames[] = { + (char *) "self", NULL + }; + + if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"O:PropX_memid_get",kwnames,&obj0)) goto fail; + if ((SWIG_ConvertPtr(obj0,(void **)(&arg1),SWIGTYPE_p_wxPropX, + SWIG_POINTER_EXCEPTION | 0)) == -1) SWIG_fail; + result = (MEMBERID) ((arg1)->memid); + + resultobj = SWIG_FromLong((long)result); + return resultobj; + fail: + return NULL; +} + + +static PyObject *_wrap_PropX_type_get(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject *resultobj; + wxPropX *arg1 = (wxPropX *) 0 ; + wxParamX *result; + PyObject * obj0 = 0 ; + char *kwnames[] = { + (char *) "self", NULL + }; + + if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"O:PropX_type_get",kwnames,&obj0)) goto fail; + if ((SWIG_ConvertPtr(obj0,(void **)(&arg1),SWIGTYPE_p_wxPropX, + SWIG_POINTER_EXCEPTION | 0)) == -1) SWIG_fail; + result = (wxParamX *)& ((arg1)->type); + + resultobj = SWIG_NewPointerObj((void*)(result), SWIGTYPE_p_wxParamX, 0); + return resultobj; + fail: + return NULL; +} + + +static PyObject *_wrap_PropX_arg_get(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject *resultobj; + wxPropX *arg1 = (wxPropX *) 0 ; + wxParamX *result; + PyObject * obj0 = 0 ; + char *kwnames[] = { + (char *) "self", NULL + }; + + if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"O:PropX_arg_get",kwnames,&obj0)) goto fail; + if ((SWIG_ConvertPtr(obj0,(void **)(&arg1),SWIGTYPE_p_wxPropX, + SWIG_POINTER_EXCEPTION | 0)) == -1) SWIG_fail; + result = (wxParamX *)& ((arg1)->arg); + + resultobj = SWIG_NewPointerObj((void*)(result), SWIGTYPE_p_wxParamX, 0); + return resultobj; + fail: + return NULL; +} + + +static PyObject *_wrap_PropX_putByRef_get(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject *resultobj; + wxPropX *arg1 = (wxPropX *) 0 ; + bool result; + PyObject * obj0 = 0 ; + char *kwnames[] = { + (char *) "self", NULL + }; + + if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"O:PropX_putByRef_get",kwnames,&obj0)) goto fail; + if ((SWIG_ConvertPtr(obj0,(void **)(&arg1),SWIGTYPE_p_wxPropX, + SWIG_POINTER_EXCEPTION | 0)) == -1) SWIG_fail; + result = (bool) ((arg1)->putByRef); + + resultobj = PyBool_FromLong((bool)result); + return resultobj; + fail: + return NULL; +} + + +static PyObject *_wrap_PropX_CanGet(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject *resultobj; + wxPropX *arg1 = (wxPropX *) 0 ; + bool result; + PyObject * obj0 = 0 ; + char *kwnames[] = { + (char *) "self", NULL + }; + + if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"O:PropX_CanGet",kwnames,&obj0)) goto fail; + if ((SWIG_ConvertPtr(obj0,(void **)(&arg1),SWIGTYPE_p_wxPropX, + SWIG_POINTER_EXCEPTION | 0)) == -1) SWIG_fail; + { + PyThreadState* __tstate = wxPyBeginAllowThreads(); + result = (bool)((wxPropX const *)arg1)->CanGet(); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) SWIG_fail; + } + resultobj = PyBool_FromLong((bool)result); + return resultobj; + fail: + return NULL; +} + + +static PyObject *_wrap_PropX_CanSet(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject *resultobj; + wxPropX *arg1 = (wxPropX *) 0 ; + bool result; + PyObject * obj0 = 0 ; + char *kwnames[] = { + (char *) "self", NULL + }; + + if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"O:PropX_CanSet",kwnames,&obj0)) goto fail; + if ((SWIG_ConvertPtr(obj0,(void **)(&arg1),SWIGTYPE_p_wxPropX, + SWIG_POINTER_EXCEPTION | 0)) == -1) SWIG_fail; + { + PyThreadState* __tstate = wxPyBeginAllowThreads(); + result = (bool)((wxPropX const *)arg1)->CanSet(); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) SWIG_fail; + } + resultobj = PyBool_FromLong((bool)result); + return resultobj; + fail: + return NULL; +} + + +static PyObject * PropX_swigregister(PyObject *self, PyObject *args) { + PyObject *obj; + if (!PyArg_ParseTuple(args,(char*)"O", &obj)) return NULL; + SWIG_TypeClientData(SWIGTYPE_p_wxPropX, obj); + Py_INCREF(obj); + return Py_BuildValue((char *)""); +} +static PyObject *_wrap_ParamXArray___nonzero__(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject *resultobj; + wxParamXArray *arg1 = (wxParamXArray *) 0 ; + bool result; + PyObject * obj0 = 0 ; + char *kwnames[] = { + (char *) "self", NULL + }; + + if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"O:ParamXArray___nonzero__",kwnames,&obj0)) goto fail; + if ((SWIG_ConvertPtr(obj0,(void **)(&arg1),SWIGTYPE_p_wxParamXArray, + SWIG_POINTER_EXCEPTION | 0)) == -1) SWIG_fail; + { + PyThreadState* __tstate = wxPyBeginAllowThreads(); + result = (bool)wxParamXArray___nonzero__(arg1); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) SWIG_fail; + } + resultobj = PyBool_FromLong((bool)result); + return resultobj; + fail: + return NULL; +} + + +static PyObject *_wrap_ParamXArray___len__(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject *resultobj; + wxParamXArray *arg1 = (wxParamXArray *) 0 ; + int result; + PyObject * obj0 = 0 ; + char *kwnames[] = { + (char *) "self", NULL + }; + + if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"O:ParamXArray___len__",kwnames,&obj0)) goto fail; + if ((SWIG_ConvertPtr(obj0,(void **)(&arg1),SWIGTYPE_p_wxParamXArray, + SWIG_POINTER_EXCEPTION | 0)) == -1) SWIG_fail; + { + PyThreadState* __tstate = wxPyBeginAllowThreads(); + result = (int)wxParamXArray___len__(arg1); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) SWIG_fail; + } + resultobj = SWIG_FromInt((int)result); + return resultobj; + fail: + return NULL; +} + + +static PyObject *_wrap_ParamXArray___getitem__(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject *resultobj; + wxParamXArray *arg1 = (wxParamXArray *) 0 ; + int arg2 ; + wxParamX *result; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + char *kwnames[] = { + (char *) "self",(char *) "idx", NULL + }; + + if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OO:ParamXArray___getitem__",kwnames,&obj0,&obj1)) goto fail; + if ((SWIG_ConvertPtr(obj0,(void **)(&arg1),SWIGTYPE_p_wxParamXArray, + SWIG_POINTER_EXCEPTION | 0)) == -1) SWIG_fail; + arg2 = (int) SWIG_AsInt(obj1); + if (PyErr_Occurred()) SWIG_fail; + { + PyThreadState* __tstate = wxPyBeginAllowThreads(); + { + wxParamX const &_result_ref = wxParamXArray___getitem__(arg1,arg2); + result = (wxParamX *) &_result_ref; + } + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) SWIG_fail; + } + resultobj = SWIG_NewPointerObj((void*)(result), SWIGTYPE_p_wxParamX, 0); + return resultobj; + fail: + return NULL; +} + + +static PyObject * ParamXArray_swigregister(PyObject *self, PyObject *args) { + PyObject *obj; + if (!PyArg_ParseTuple(args,(char*)"O", &obj)) return NULL; + SWIG_TypeClientData(SWIGTYPE_p_wxParamXArray, obj); + Py_INCREF(obj); + return Py_BuildValue((char *)""); +} +static PyObject *_wrap_FuncXArray___nonzero__(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject *resultobj; + wxFuncXArray *arg1 = (wxFuncXArray *) 0 ; + bool result; + PyObject * obj0 = 0 ; + char *kwnames[] = { + (char *) "self", NULL + }; + + if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"O:FuncXArray___nonzero__",kwnames,&obj0)) goto fail; + if ((SWIG_ConvertPtr(obj0,(void **)(&arg1),SWIGTYPE_p_wxFuncXArray, + SWIG_POINTER_EXCEPTION | 0)) == -1) SWIG_fail; + { + PyThreadState* __tstate = wxPyBeginAllowThreads(); + result = (bool)wxFuncXArray___nonzero__(arg1); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) SWIG_fail; + } + resultobj = PyBool_FromLong((bool)result); + return resultobj; + fail: + return NULL; +} + + +static PyObject *_wrap_FuncXArray___len__(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject *resultobj; + wxFuncXArray *arg1 = (wxFuncXArray *) 0 ; + int result; + PyObject * obj0 = 0 ; + char *kwnames[] = { + (char *) "self", NULL + }; + + if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"O:FuncXArray___len__",kwnames,&obj0)) goto fail; + if ((SWIG_ConvertPtr(obj0,(void **)(&arg1),SWIGTYPE_p_wxFuncXArray, + SWIG_POINTER_EXCEPTION | 0)) == -1) SWIG_fail; + { + PyThreadState* __tstate = wxPyBeginAllowThreads(); + result = (int)wxFuncXArray___len__(arg1); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) SWIG_fail; + } + resultobj = SWIG_FromInt((int)result); + return resultobj; + fail: + return NULL; +} + + +static PyObject *_wrap_FuncXArray___getitem__(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject *resultobj; + wxFuncXArray *arg1 = (wxFuncXArray *) 0 ; + int arg2 ; + wxFuncX *result; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + char *kwnames[] = { + (char *) "self",(char *) "idx", NULL + }; + + if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OO:FuncXArray___getitem__",kwnames,&obj0,&obj1)) goto fail; + if ((SWIG_ConvertPtr(obj0,(void **)(&arg1),SWIGTYPE_p_wxFuncXArray, + SWIG_POINTER_EXCEPTION | 0)) == -1) SWIG_fail; + arg2 = (int) SWIG_AsInt(obj1); + if (PyErr_Occurred()) SWIG_fail; + { + PyThreadState* __tstate = wxPyBeginAllowThreads(); + { + wxFuncX const &_result_ref = wxFuncXArray___getitem__(arg1,arg2); + result = (wxFuncX *) &_result_ref; + } + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) SWIG_fail; + } + resultobj = SWIG_NewPointerObj((void*)(result), SWIGTYPE_p_wxFuncX, 0); + return resultobj; + fail: + return NULL; +} + + +static PyObject * FuncXArray_swigregister(PyObject *self, PyObject *args) { + PyObject *obj; + if (!PyArg_ParseTuple(args,(char*)"O", &obj)) return NULL; + SWIG_TypeClientData(SWIGTYPE_p_wxFuncXArray, obj); + Py_INCREF(obj); + return Py_BuildValue((char *)""); +} +static PyObject *_wrap_PropXArray___nonzero__(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject *resultobj; + wxPropXArray *arg1 = (wxPropXArray *) 0 ; + bool result; + PyObject * obj0 = 0 ; + char *kwnames[] = { + (char *) "self", NULL + }; + + if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"O:PropXArray___nonzero__",kwnames,&obj0)) goto fail; + if ((SWIG_ConvertPtr(obj0,(void **)(&arg1),SWIGTYPE_p_wxPropXArray, + SWIG_POINTER_EXCEPTION | 0)) == -1) SWIG_fail; + { + PyThreadState* __tstate = wxPyBeginAllowThreads(); + result = (bool)wxPropXArray___nonzero__(arg1); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) SWIG_fail; + } + resultobj = PyBool_FromLong((bool)result); + return resultobj; + fail: + return NULL; +} + + +static PyObject *_wrap_PropXArray___len__(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject *resultobj; + wxPropXArray *arg1 = (wxPropXArray *) 0 ; + int result; + PyObject * obj0 = 0 ; + char *kwnames[] = { + (char *) "self", NULL + }; + + if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"O:PropXArray___len__",kwnames,&obj0)) goto fail; + if ((SWIG_ConvertPtr(obj0,(void **)(&arg1),SWIGTYPE_p_wxPropXArray, + SWIG_POINTER_EXCEPTION | 0)) == -1) SWIG_fail; + { + PyThreadState* __tstate = wxPyBeginAllowThreads(); + result = (int)wxPropXArray___len__(arg1); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) SWIG_fail; + } + resultobj = SWIG_FromInt((int)result); + return resultobj; + fail: + return NULL; +} + + +static PyObject *_wrap_PropXArray___getitem__(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject *resultobj; + wxPropXArray *arg1 = (wxPropXArray *) 0 ; + int arg2 ; + wxPropX *result; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + char *kwnames[] = { + (char *) "self",(char *) "idx", NULL + }; + + if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OO:PropXArray___getitem__",kwnames,&obj0,&obj1)) goto fail; + if ((SWIG_ConvertPtr(obj0,(void **)(&arg1),SWIGTYPE_p_wxPropXArray, + SWIG_POINTER_EXCEPTION | 0)) == -1) SWIG_fail; + arg2 = (int) SWIG_AsInt(obj1); + if (PyErr_Occurred()) SWIG_fail; + { + PyThreadState* __tstate = wxPyBeginAllowThreads(); + { + wxPropX const &_result_ref = wxPropXArray___getitem__(arg1,arg2); + result = (wxPropX *) &_result_ref; + } + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) SWIG_fail; + } + resultobj = SWIG_NewPointerObj((void*)(result), SWIGTYPE_p_wxPropX, 0); + return resultobj; + fail: + return NULL; +} + + +static PyObject * PropXArray_swigregister(PyObject *self, PyObject *args) { + PyObject *obj; + if (!PyArg_ParseTuple(args,(char*)"O", &obj)) return NULL; + SWIG_TypeClientData(SWIGTYPE_p_wxPropXArray, obj); + Py_INCREF(obj); + return Py_BuildValue((char *)""); +} +static PyObject *_wrap_new_ActiveXWindow(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject *resultobj; + wxWindow *arg1 = (wxWindow *) 0 ; + CLSID *arg2 = 0 ; + int arg3 = (int) -1 ; + wxPoint const &arg4_defvalue = wxDefaultPosition ; + wxPoint *arg4 = (wxPoint *) &arg4_defvalue ; + wxSize const &arg5_defvalue = wxDefaultSize ; + wxSize *arg5 = (wxSize *) &arg5_defvalue ; + long arg6 = (long) 0 ; + wxString const &arg7_defvalue = wxPyPanelNameStr ; + wxString *arg7 = (wxString *) &arg7_defvalue ; + wxActiveXWindow *result; + wxPoint temp4 ; + wxSize temp5 ; + bool temp7 = False ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + PyObject * obj3 = 0 ; + PyObject * obj4 = 0 ; + PyObject * obj5 = 0 ; + PyObject * obj6 = 0 ; + char *kwnames[] = { + (char *) "parent",(char *) "clsId",(char *) "id",(char *) "pos",(char *) "size",(char *) "style",(char *) "name", NULL + }; + + if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OO|OOOOO:new_ActiveXWindow",kwnames,&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6)) goto fail; + if ((SWIG_ConvertPtr(obj0,(void **)(&arg1),SWIGTYPE_p_wxWindow, + SWIG_POINTER_EXCEPTION | 0)) == -1) SWIG_fail; + if ((SWIG_ConvertPtr(obj1,(void **)(&arg2),SWIGTYPE_p_CLSID, + SWIG_POINTER_EXCEPTION | 0)) == -1) + SWIG_fail; + if (arg2 == NULL) { + PyErr_SetString(PyExc_TypeError,"null reference"); + SWIG_fail; + } + if (obj2) { + arg3 = (int) SWIG_AsInt(obj2); + if (PyErr_Occurred()) SWIG_fail; + } + if (obj3) { + { + arg4 = &temp4; + if ( ! wxPoint_helper(obj3, &arg4)) SWIG_fail; + } + } + if (obj4) { + { + arg5 = &temp5; + if ( ! wxSize_helper(obj4, &arg5)) SWIG_fail; + } + } + if (obj5) { + arg6 = (long) SWIG_AsLong(obj5); + if (PyErr_Occurred()) SWIG_fail; + } + if (obj6) { + { + arg7 = wxString_in_helper(obj6); + if (arg7 == NULL) SWIG_fail; + temp7 = True; + } + } + { + PyThreadState* __tstate = wxPyBeginAllowThreads(); + result = (wxActiveXWindow *)new wxActiveXWindow(arg1,(CLSID const &)*arg2,arg3,(wxPoint const &)*arg4,(wxSize const &)*arg5,arg6,(wxString const &)*arg7); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) SWIG_fail; + } + resultobj = SWIG_NewPointerObj((void*)(result), SWIGTYPE_p_wxActiveXWindow, 1); + { + if (temp7) + delete arg7; + } + return resultobj; + fail: + { + if (temp7) + delete arg7; + } + return NULL; +} + + +static PyObject *_wrap_ActiveXWindow_GetCLSID(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject *resultobj; + wxActiveXWindow *arg1 = (wxActiveXWindow *) 0 ; + CLSID *result; + PyObject * obj0 = 0 ; + char *kwnames[] = { + (char *) "self", NULL + }; + + if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"O:ActiveXWindow_GetCLSID",kwnames,&obj0)) goto fail; + if ((SWIG_ConvertPtr(obj0,(void **)(&arg1),SWIGTYPE_p_wxActiveXWindow, + SWIG_POINTER_EXCEPTION | 0)) == -1) SWIG_fail; + { + PyThreadState* __tstate = wxPyBeginAllowThreads(); + { + CLSID const &_result_ref = ((wxActiveXWindow const *)arg1)->GetCLSID(); + result = (CLSID *) &_result_ref; + } + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) SWIG_fail; + } + resultobj = SWIG_NewPointerObj((void*)(result), SWIGTYPE_p_CLSID, 0); + return resultobj; + fail: + return NULL; +} + + +static PyObject *_wrap_ActiveXWindow_GetAXEventCount(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject *resultobj; + wxActiveXWindow *arg1 = (wxActiveXWindow *) 0 ; + int result; + PyObject * obj0 = 0 ; + char *kwnames[] = { + (char *) "self", NULL + }; + + if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"O:ActiveXWindow_GetAXEventCount",kwnames,&obj0)) goto fail; + if ((SWIG_ConvertPtr(obj0,(void **)(&arg1),SWIGTYPE_p_wxActiveXWindow, + SWIG_POINTER_EXCEPTION | 0)) == -1) SWIG_fail; + { + PyThreadState* __tstate = wxPyBeginAllowThreads(); + result = (int)((wxActiveXWindow const *)arg1)->GetAXEventCount(); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) SWIG_fail; + } + resultobj = SWIG_FromInt((int)result); + return resultobj; + fail: + return NULL; +} + + +static PyObject *_wrap_ActiveXWindow_GetAXEventDesc(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject *resultobj; + wxActiveXWindow *arg1 = (wxActiveXWindow *) 0 ; + int arg2 ; + wxFuncX *result; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + char *kwnames[] = { + (char *) "self",(char *) "idx", NULL + }; + + if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OO:ActiveXWindow_GetAXEventDesc",kwnames,&obj0,&obj1)) goto fail; + if ((SWIG_ConvertPtr(obj0,(void **)(&arg1),SWIGTYPE_p_wxActiveXWindow, + SWIG_POINTER_EXCEPTION | 0)) == -1) SWIG_fail; + arg2 = (int) SWIG_AsInt(obj1); + if (PyErr_Occurred()) SWIG_fail; + { + PyThreadState* __tstate = wxPyBeginAllowThreads(); + { + wxFuncX const &_result_ref = ((wxActiveXWindow const *)arg1)->GetAXEventDesc(arg2); + result = (wxFuncX *) &_result_ref; + } + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) SWIG_fail; + } + resultobj = SWIG_NewPointerObj((void*)(result), SWIGTYPE_p_wxFuncX, 0); + return resultobj; + fail: + return NULL; +} + + +static PyObject *_wrap_ActiveXWindow_GetAXPropCount(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject *resultobj; + wxActiveXWindow *arg1 = (wxActiveXWindow *) 0 ; + int result; + PyObject * obj0 = 0 ; + char *kwnames[] = { + (char *) "self", NULL + }; + + if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"O:ActiveXWindow_GetAXPropCount",kwnames,&obj0)) goto fail; + if ((SWIG_ConvertPtr(obj0,(void **)(&arg1),SWIGTYPE_p_wxActiveXWindow, + SWIG_POINTER_EXCEPTION | 0)) == -1) SWIG_fail; + { + PyThreadState* __tstate = wxPyBeginAllowThreads(); + result = (int)((wxActiveXWindow const *)arg1)->GetAXPropCount(); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) SWIG_fail; + } + resultobj = SWIG_FromInt((int)result); + return resultobj; + fail: + return NULL; +} + + +static PyObject *_wrap_ActiveXWindow_GetAXPropDesc__SWIG_0(PyObject *self, PyObject *args) { + PyObject *resultobj; + wxActiveXWindow *arg1 = (wxActiveXWindow *) 0 ; + int arg2 ; + wxPropX *result; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + + if(!PyArg_ParseTuple(args,(char *)"OO:ActiveXWindow_GetAXPropDesc",&obj0,&obj1)) goto fail; + if ((SWIG_ConvertPtr(obj0,(void **)(&arg1),SWIGTYPE_p_wxActiveXWindow, + SWIG_POINTER_EXCEPTION | 0)) == -1) SWIG_fail; + arg2 = (int) SWIG_AsInt(obj1); + if (PyErr_Occurred()) SWIG_fail; + { + PyThreadState* __tstate = wxPyBeginAllowThreads(); + { + wxPropX const &_result_ref = ((wxActiveXWindow const *)arg1)->GetAXPropDesc(arg2); + result = (wxPropX *) &_result_ref; + } + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) SWIG_fail; + } + resultobj = SWIG_NewPointerObj((void*)(result), SWIGTYPE_p_wxPropX, 0); + return resultobj; + fail: + return NULL; +} + + +static PyObject *_wrap_ActiveXWindow_GetAXPropDesc__SWIG_1(PyObject *self, PyObject *args) { + PyObject *resultobj; + wxActiveXWindow *arg1 = (wxActiveXWindow *) 0 ; + wxString *arg2 = 0 ; + wxPropX *result; + bool temp2 = False ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + + if(!PyArg_ParseTuple(args,(char *)"OO:ActiveXWindow_GetAXPropDesc",&obj0,&obj1)) goto fail; + if ((SWIG_ConvertPtr(obj0,(void **)(&arg1),SWIGTYPE_p_wxActiveXWindow, + SWIG_POINTER_EXCEPTION | 0)) == -1) SWIG_fail; + { + arg2 = wxString_in_helper(obj1); + if (arg2 == NULL) SWIG_fail; + temp2 = True; + } + { + PyThreadState* __tstate = wxPyBeginAllowThreads(); + { + wxPropX const &_result_ref = ((wxActiveXWindow const *)arg1)->GetAXPropDesc((wxString const &)*arg2); + result = (wxPropX *) &_result_ref; + } + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) SWIG_fail; + } + resultobj = SWIG_NewPointerObj((void*)(result), SWIGTYPE_p_wxPropX, 0); + { + if (temp2) + delete arg2; + } + return resultobj; + fail: + { + if (temp2) + delete arg2; + } + return NULL; +} + + +static PyObject *_wrap_ActiveXWindow_GetAXPropDesc(PyObject *self, PyObject *args) { + int argc; + PyObject *argv[3]; + int ii; + + argc = PyObject_Length(args); + for (ii = 0; (ii < argc) && (ii < 2); ii++) { + argv[ii] = PyTuple_GetItem(args,ii); + } + if (argc == 2) { + int _v; + { + void *ptr; + if (SWIG_ConvertPtr(argv[0], &ptr, SWIGTYPE_p_wxActiveXWindow, 0) == -1) { + _v = 0; + PyErr_Clear(); + } else { + _v = 1; + } + } + if (_v) { + { + _v = PyString_Check(argv[1]) || PyUnicode_Check(argv[1]); + } + if (_v) { + return _wrap_ActiveXWindow_GetAXPropDesc__SWIG_1(self,args); + } + } + } + if (argc == 2) { + int _v; + { + void *ptr; + if (SWIG_ConvertPtr(argv[0], &ptr, SWIGTYPE_p_wxActiveXWindow, 0) == -1) { + _v = 0; + PyErr_Clear(); + } else { + _v = 1; + } + } + if (_v) { + _v = SWIG_CheckInt(argv[1]); + if (_v) { + return _wrap_ActiveXWindow_GetAXPropDesc__SWIG_0(self,args); + } + } + } + + PyErr_SetString(PyExc_TypeError,"No matching function for overloaded 'ActiveXWindow_GetAXPropDesc'"); + return NULL; +} + + +static PyObject *_wrap_ActiveXWindow_GetAXMethodCount(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject *resultobj; + wxActiveXWindow *arg1 = (wxActiveXWindow *) 0 ; + int result; + PyObject * obj0 = 0 ; + char *kwnames[] = { + (char *) "self", NULL + }; + + if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"O:ActiveXWindow_GetAXMethodCount",kwnames,&obj0)) goto fail; + if ((SWIG_ConvertPtr(obj0,(void **)(&arg1),SWIGTYPE_p_wxActiveXWindow, + SWIG_POINTER_EXCEPTION | 0)) == -1) SWIG_fail; + { + PyThreadState* __tstate = wxPyBeginAllowThreads(); + result = (int)((wxActiveXWindow const *)arg1)->GetAXMethodCount(); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) SWIG_fail; + } + resultobj = SWIG_FromInt((int)result); + return resultobj; + fail: + return NULL; +} + + +static PyObject *_wrap_ActiveXWindow_GetAXMethodDesc__SWIG_0(PyObject *self, PyObject *args) { + PyObject *resultobj; + wxActiveXWindow *arg1 = (wxActiveXWindow *) 0 ; + int arg2 ; + wxFuncX *result; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + + if(!PyArg_ParseTuple(args,(char *)"OO:ActiveXWindow_GetAXMethodDesc",&obj0,&obj1)) goto fail; + if ((SWIG_ConvertPtr(obj0,(void **)(&arg1),SWIGTYPE_p_wxActiveXWindow, + SWIG_POINTER_EXCEPTION | 0)) == -1) SWIG_fail; + arg2 = (int) SWIG_AsInt(obj1); + if (PyErr_Occurred()) SWIG_fail; + { + PyThreadState* __tstate = wxPyBeginAllowThreads(); + { + wxFuncX const &_result_ref = ((wxActiveXWindow const *)arg1)->GetAXMethodDesc(arg2); + result = (wxFuncX *) &_result_ref; + } + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) SWIG_fail; + } + resultobj = SWIG_NewPointerObj((void*)(result), SWIGTYPE_p_wxFuncX, 0); + return resultobj; + fail: + return NULL; +} + + +static PyObject *_wrap_ActiveXWindow_GetAXMethodDesc__SWIG_1(PyObject *self, PyObject *args) { + PyObject *resultobj; + wxActiveXWindow *arg1 = (wxActiveXWindow *) 0 ; + wxString *arg2 = 0 ; + wxFuncX *result; + bool temp2 = False ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + + if(!PyArg_ParseTuple(args,(char *)"OO:ActiveXWindow_GetAXMethodDesc",&obj0,&obj1)) goto fail; + if ((SWIG_ConvertPtr(obj0,(void **)(&arg1),SWIGTYPE_p_wxActiveXWindow, + SWIG_POINTER_EXCEPTION | 0)) == -1) SWIG_fail; + { + arg2 = wxString_in_helper(obj1); + if (arg2 == NULL) SWIG_fail; + temp2 = True; + } + { + PyThreadState* __tstate = wxPyBeginAllowThreads(); + { + wxFuncX const &_result_ref = ((wxActiveXWindow const *)arg1)->GetAXMethodDesc((wxString const &)*arg2); + result = (wxFuncX *) &_result_ref; + } + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) SWIG_fail; + } + resultobj = SWIG_NewPointerObj((void*)(result), SWIGTYPE_p_wxFuncX, 0); + { + if (temp2) + delete arg2; + } + return resultobj; + fail: + { + if (temp2) + delete arg2; + } + return NULL; +} + + +static PyObject *_wrap_ActiveXWindow_GetAXMethodDesc(PyObject *self, PyObject *args) { + int argc; + PyObject *argv[3]; + int ii; + + argc = PyObject_Length(args); + for (ii = 0; (ii < argc) && (ii < 2); ii++) { + argv[ii] = PyTuple_GetItem(args,ii); + } + if (argc == 2) { + int _v; + { + void *ptr; + if (SWIG_ConvertPtr(argv[0], &ptr, SWIGTYPE_p_wxActiveXWindow, 0) == -1) { + _v = 0; + PyErr_Clear(); + } else { + _v = 1; + } + } + if (_v) { + { + _v = PyString_Check(argv[1]) || PyUnicode_Check(argv[1]); + } + if (_v) { + return _wrap_ActiveXWindow_GetAXMethodDesc__SWIG_1(self,args); + } + } + } + if (argc == 2) { + int _v; + { + void *ptr; + if (SWIG_ConvertPtr(argv[0], &ptr, SWIGTYPE_p_wxActiveXWindow, 0) == -1) { + _v = 0; + PyErr_Clear(); + } else { + _v = 1; + } + } + if (_v) { + _v = SWIG_CheckInt(argv[1]); + if (_v) { + return _wrap_ActiveXWindow_GetAXMethodDesc__SWIG_0(self,args); + } + } + } + + PyErr_SetString(PyExc_TypeError,"No matching function for overloaded 'ActiveXWindow_GetAXMethodDesc'"); + return NULL; +} + + +static PyObject *_wrap_ActiveXWindow_GetAXEvents(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject *resultobj; + wxActiveXWindow *arg1 = (wxActiveXWindow *) 0 ; + wxFuncXArray *result; + PyObject * obj0 = 0 ; + char *kwnames[] = { + (char *) "self", NULL + }; + + if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"O:ActiveXWindow_GetAXEvents",kwnames,&obj0)) goto fail; + if ((SWIG_ConvertPtr(obj0,(void **)(&arg1),SWIGTYPE_p_wxActiveXWindow, + SWIG_POINTER_EXCEPTION | 0)) == -1) SWIG_fail; + { + PyThreadState* __tstate = wxPyBeginAllowThreads(); + { + wxFuncXArray const &_result_ref = (arg1)->GetAXEvents(); + result = (wxFuncXArray *) &_result_ref; + } + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) SWIG_fail; + } + resultobj = SWIG_NewPointerObj((void*)(result), SWIGTYPE_p_wxFuncXArray, 0); + return resultobj; + fail: + return NULL; +} + + +static PyObject *_wrap_ActiveXWindow_GetAXMethods(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject *resultobj; + wxActiveXWindow *arg1 = (wxActiveXWindow *) 0 ; + wxFuncXArray *result; + PyObject * obj0 = 0 ; + char *kwnames[] = { + (char *) "self", NULL + }; + + if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"O:ActiveXWindow_GetAXMethods",kwnames,&obj0)) goto fail; + if ((SWIG_ConvertPtr(obj0,(void **)(&arg1),SWIGTYPE_p_wxActiveXWindow, + SWIG_POINTER_EXCEPTION | 0)) == -1) SWIG_fail; + { + PyThreadState* __tstate = wxPyBeginAllowThreads(); + { + wxFuncXArray const &_result_ref = (arg1)->GetAXMethods(); + result = (wxFuncXArray *) &_result_ref; + } + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) SWIG_fail; + } + resultobj = SWIG_NewPointerObj((void*)(result), SWIGTYPE_p_wxFuncXArray, 0); + return resultobj; + fail: + return NULL; +} + + +static PyObject *_wrap_ActiveXWindow_GetAXProperties(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject *resultobj; + wxActiveXWindow *arg1 = (wxActiveXWindow *) 0 ; + wxPropXArray *result; + PyObject * obj0 = 0 ; + char *kwnames[] = { + (char *) "self", NULL + }; + + if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"O:ActiveXWindow_GetAXProperties",kwnames,&obj0)) goto fail; + if ((SWIG_ConvertPtr(obj0,(void **)(&arg1),SWIGTYPE_p_wxActiveXWindow, + SWIG_POINTER_EXCEPTION | 0)) == -1) SWIG_fail; + { + PyThreadState* __tstate = wxPyBeginAllowThreads(); + { + wxPropXArray const &_result_ref = (arg1)->GetAXProperties(); + result = (wxPropXArray *) &_result_ref; + } + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) SWIG_fail; + } + resultobj = SWIG_NewPointerObj((void*)(result), SWIGTYPE_p_wxPropXArray, 0); + return resultobj; + fail: + return NULL; +} + + +static PyObject *_wrap_ActiveXWindow_SetAXProp(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject *resultobj; + wxActiveXWindow *arg1 = (wxActiveXWindow *) 0 ; + wxString *arg2 = 0 ; + PyObject *arg3 = (PyObject *) 0 ; + bool temp2 = False ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + char *kwnames[] = { + (char *) "self",(char *) "name",(char *) "value", NULL + }; + + if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OOO:ActiveXWindow_SetAXProp",kwnames,&obj0,&obj1,&obj2)) goto fail; + if ((SWIG_ConvertPtr(obj0,(void **)(&arg1),SWIGTYPE_p_wxActiveXWindow, + SWIG_POINTER_EXCEPTION | 0)) == -1) SWIG_fail; + { + arg2 = wxString_in_helper(obj1); + if (arg2 == NULL) SWIG_fail; + temp2 = True; + } + arg3 = obj2; + { + PyThreadState* __tstate = wxPyBeginAllowThreads(); + (arg1)->SetAXProp((wxString const &)*arg2,arg3); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) SWIG_fail; + } + Py_INCREF(Py_None); resultobj = Py_None; + { + if (temp2) + delete arg2; + } + return resultobj; + fail: + { + if (temp2) + delete arg2; + } + return NULL; +} + + +static PyObject *_wrap_ActiveXWindow_GetAXProp(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject *resultobj; + wxActiveXWindow *arg1 = (wxActiveXWindow *) 0 ; + wxString *arg2 = 0 ; + PyObject *result; + bool temp2 = False ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + char *kwnames[] = { + (char *) "self",(char *) "name", NULL + }; + + if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OO:ActiveXWindow_GetAXProp",kwnames,&obj0,&obj1)) goto fail; + if ((SWIG_ConvertPtr(obj0,(void **)(&arg1),SWIGTYPE_p_wxActiveXWindow, + SWIG_POINTER_EXCEPTION | 0)) == -1) SWIG_fail; + { + arg2 = wxString_in_helper(obj1); + if (arg2 == NULL) SWIG_fail; + temp2 = True; + } + { + PyThreadState* __tstate = wxPyBeginAllowThreads(); + result = (PyObject *)(arg1)->GetAXProp((wxString const &)*arg2); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) SWIG_fail; + } + resultobj = result; + { + if (temp2) + delete arg2; + } + return resultobj; + fail: + { + if (temp2) + delete arg2; + } + return NULL; +} + + +static PyObject *_wrap_ActiveXWindow__CallAXMethod(PyObject *self, PyObject *args) { + PyObject *resultobj; + wxActiveXWindow *arg1 = (wxActiveXWindow *) 0 ; + wxString *arg2 = 0 ; + PyObject *arg3 = (PyObject *) 0 ; + PyObject *result; + bool temp2 = False ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + + if(!PyArg_ParseTuple(args,(char *)"OOO:ActiveXWindow__CallAXMethod",&obj0,&obj1,&obj2)) goto fail; + if ((SWIG_ConvertPtr(obj0,(void **)(&arg1),SWIGTYPE_p_wxActiveXWindow, + SWIG_POINTER_EXCEPTION | 0)) == -1) SWIG_fail; + { + arg2 = wxString_in_helper(obj1); + if (arg2 == NULL) SWIG_fail; + temp2 = True; + } + arg3 = obj2; + { + PyThreadState* __tstate = wxPyBeginAllowThreads(); + result = (PyObject *)(arg1)->_CallAXMethod((wxString const &)*arg2,arg3); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) SWIG_fail; + } + resultobj = result; + { + if (temp2) + delete arg2; + } + return resultobj; + fail: + { + if (temp2) + delete arg2; + } + return NULL; +} + + +static PyObject * ActiveXWindow_swigregister(PyObject *self, PyObject *args) { + PyObject *obj; + if (!PyArg_ParseTuple(args,(char*)"O", &obj)) return NULL; + SWIG_TypeClientData(SWIGTYPE_p_wxActiveXWindow, obj); + Py_INCREF(obj); + return Py_BuildValue((char *)""); +} +static PyObject *_wrap_RegisterActiveXEvent(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject *resultobj; + wxString *arg1 = 0 ; + wxEventType result; + bool temp1 = False ; + PyObject * obj0 = 0 ; + char *kwnames[] = { + (char *) "eventName", NULL + }; + + if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"O:RegisterActiveXEvent",kwnames,&obj0)) goto fail; + { + arg1 = wxString_in_helper(obj0); + if (arg1 == NULL) SWIG_fail; + temp1 = True; + } + { + PyThreadState* __tstate = wxPyBeginAllowThreads(); + result = (wxEventType)RegisterActiveXEvent((wxString const &)*arg1); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) SWIG_fail; + } + resultobj = SWIG_FromInt((int)result); + { + if (temp1) + delete arg1; + } + return resultobj; + fail: + { + if (temp1) + delete arg1; + } + return NULL; +} + + +static PyObject *_wrap_ActiveXEvent_EventName(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject *resultobj; + wxActiveXEvent *arg1 = (wxActiveXEvent *) 0 ; + wxString result; + PyObject * obj0 = 0 ; + char *kwnames[] = { + (char *) "self", NULL + }; + + if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"O:ActiveXEvent_EventName",kwnames,&obj0)) goto fail; + if ((SWIG_ConvertPtr(obj0,(void **)(&arg1),SWIGTYPE_p_wxActiveXEvent, + SWIG_POINTER_EXCEPTION | 0)) == -1) SWIG_fail; + { + PyThreadState* __tstate = wxPyBeginAllowThreads(); + result = (arg1)->EventName(); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) SWIG_fail; + } + { +#if wxUSE_UNICODE + resultobj = PyUnicode_FromWideChar((&result)->c_str(), (&result)->Len()); +#else + resultobj = PyString_FromStringAndSize((&result)->c_str(), (&result)->Len()); +#endif + } + return resultobj; + fail: + return NULL; +} + + +static PyObject *_wrap_ActiveXEvent__preInit(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject *resultobj; + wxActiveXEvent *arg1 = (wxActiveXEvent *) 0 ; + PyObject *arg2 = (PyObject *) 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + char *kwnames[] = { + (char *) "self",(char *) "pyself", NULL + }; + + if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OO:ActiveXEvent__preInit",kwnames,&obj0,&obj1)) goto fail; + if ((SWIG_ConvertPtr(obj0,(void **)(&arg1),SWIGTYPE_p_wxActiveXEvent, + SWIG_POINTER_EXCEPTION | 0)) == -1) SWIG_fail; + arg2 = obj1; + { + PyThreadState* __tstate = wxPyBeginAllowThreads(); + wxActiveXEvent__preInit(arg1,arg2); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) SWIG_fail; + } + Py_INCREF(Py_None); resultobj = Py_None; + return resultobj; + fail: + return NULL; +} + + +static PyObject * ActiveXEvent_swigregister(PyObject *self, PyObject *args) { + PyObject *obj; + if (!PyArg_ParseTuple(args,(char*)"O", &obj)) return NULL; + SWIG_TypeClientData(SWIGTYPE_p_wxActiveXEvent, obj); + Py_INCREF(obj); + return Py_BuildValue((char *)""); +} +static PyObject *_wrap_new_IEHtmlWindowBase(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject *resultobj; + wxWindow *arg1 = (wxWindow *) 0 ; + CLSID *arg2 = 0 ; + int arg3 = (int) -1 ; + wxPoint const &arg4_defvalue = wxDefaultPosition ; + wxPoint *arg4 = (wxPoint *) &arg4_defvalue ; + wxSize const &arg5_defvalue = wxDefaultSize ; + wxSize *arg5 = (wxSize *) &arg5_defvalue ; + long arg6 = (long) 0 ; + wxString const &arg7_defvalue = wxPyPanelNameStr ; + wxString *arg7 = (wxString *) &arg7_defvalue ; + wxIEHtmlWindowBase *result; + wxPoint temp4 ; + wxSize temp5 ; + bool temp7 = False ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + PyObject * obj3 = 0 ; + PyObject * obj4 = 0 ; + PyObject * obj5 = 0 ; + PyObject * obj6 = 0 ; + char *kwnames[] = { + (char *) "parent",(char *) "clsId",(char *) "id",(char *) "pos",(char *) "size",(char *) "style",(char *) "name", NULL + }; + + if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OO|OOOOO:new_IEHtmlWindowBase",kwnames,&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6)) goto fail; + if ((SWIG_ConvertPtr(obj0,(void **)(&arg1),SWIGTYPE_p_wxWindow, + SWIG_POINTER_EXCEPTION | 0)) == -1) SWIG_fail; + if ((SWIG_ConvertPtr(obj1,(void **)(&arg2),SWIGTYPE_p_CLSID, + SWIG_POINTER_EXCEPTION | 0)) == -1) + SWIG_fail; + if (arg2 == NULL) { + PyErr_SetString(PyExc_TypeError,"null reference"); + SWIG_fail; + } + if (obj2) { + arg3 = (int) SWIG_AsInt(obj2); + if (PyErr_Occurred()) SWIG_fail; + } + if (obj3) { + { + arg4 = &temp4; + if ( ! wxPoint_helper(obj3, &arg4)) SWIG_fail; + } + } + if (obj4) { + { + arg5 = &temp5; + if ( ! wxSize_helper(obj4, &arg5)) SWIG_fail; + } + } + if (obj5) { + arg6 = (long) SWIG_AsLong(obj5); + if (PyErr_Occurred()) SWIG_fail; + } + if (obj6) { + { + arg7 = wxString_in_helper(obj6); + if (arg7 == NULL) SWIG_fail; + temp7 = True; + } + } + { + PyThreadState* __tstate = wxPyBeginAllowThreads(); + result = (wxIEHtmlWindowBase *)new wxIEHtmlWindowBase(arg1,(CLSID const &)*arg2,arg3,(wxPoint const &)*arg4,(wxSize const &)*arg5,arg6,(wxString const &)*arg7); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) SWIG_fail; + } + resultobj = SWIG_NewPointerObj((void*)(result), SWIGTYPE_p_wxIEHtmlWindowBase, 1); + { + if (temp7) + delete arg7; + } + return resultobj; + fail: + { + if (temp7) + delete arg7; + } + return NULL; +} + + +static PyObject *_wrap_IEHtmlWindowBase_SetCharset(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject *resultobj; + wxIEHtmlWindowBase *arg1 = (wxIEHtmlWindowBase *) 0 ; + wxString *arg2 = 0 ; + bool temp2 = False ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + char *kwnames[] = { + (char *) "self",(char *) "charset", NULL + }; + + if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OO:IEHtmlWindowBase_SetCharset",kwnames,&obj0,&obj1)) goto fail; + if ((SWIG_ConvertPtr(obj0,(void **)(&arg1),SWIGTYPE_p_wxIEHtmlWindowBase, + SWIG_POINTER_EXCEPTION | 0)) == -1) SWIG_fail; + { + arg2 = wxString_in_helper(obj1); + if (arg2 == NULL) SWIG_fail; + temp2 = True; + } + { + PyThreadState* __tstate = wxPyBeginAllowThreads(); + (arg1)->SetCharset((wxString const &)*arg2); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) SWIG_fail; + } + Py_INCREF(Py_None); resultobj = Py_None; + { + if (temp2) + delete arg2; + } + return resultobj; + fail: + { + if (temp2) + delete arg2; + } + return NULL; +} + + +static PyObject *_wrap_IEHtmlWindowBase_LoadString(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject *resultobj; + wxIEHtmlWindowBase *arg1 = (wxIEHtmlWindowBase *) 0 ; + wxString *arg2 = 0 ; + bool result; + bool temp2 = False ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + char *kwnames[] = { + (char *) "self",(char *) "html", NULL + }; + + if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OO:IEHtmlWindowBase_LoadString",kwnames,&obj0,&obj1)) goto fail; + if ((SWIG_ConvertPtr(obj0,(void **)(&arg1),SWIGTYPE_p_wxIEHtmlWindowBase, + SWIG_POINTER_EXCEPTION | 0)) == -1) SWIG_fail; + { + arg2 = wxString_in_helper(obj1); + if (arg2 == NULL) SWIG_fail; + temp2 = True; + } + { + PyThreadState* __tstate = wxPyBeginAllowThreads(); + result = (bool)(arg1)->LoadString((wxString const &)*arg2); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) SWIG_fail; + } + resultobj = PyBool_FromLong((bool)result); + { + if (temp2) + delete arg2; + } + return resultobj; + fail: + { + if (temp2) + delete arg2; + } + return NULL; +} + + +static PyObject *_wrap_IEHtmlWindowBase_LoadStream(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject *resultobj; + wxIEHtmlWindowBase *arg1 = (wxIEHtmlWindowBase *) 0 ; + wxInputStream *arg2 = (wxInputStream *) 0 ; + bool result; + wxPyInputStream *temp2 ; + bool created2 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + char *kwnames[] = { + (char *) "self",(char *) "is", NULL + }; + + if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OO:IEHtmlWindowBase_LoadStream",kwnames,&obj0,&obj1)) goto fail; + if ((SWIG_ConvertPtr(obj0,(void **)(&arg1),SWIGTYPE_p_wxIEHtmlWindowBase, + SWIG_POINTER_EXCEPTION | 0)) == -1) SWIG_fail; + { + if (wxPyConvertSwigPtr(obj1, (void **)&temp2, wxT("wxPyInputStream"))) { + arg2 = temp2->m_wxis; + created2 = False; + } else { + PyErr_Clear(); // clear the failure of the wxPyConvert above + arg2 = wxPyCBInputStream_create(obj1, False); + if (arg2 == NULL) { + PyErr_SetString(PyExc_TypeError, "Expected wxInputStream or Python file-like object."); + SWIG_fail; + } + created2 = True; + } + } + { + PyThreadState* __tstate = wxPyBeginAllowThreads(); + result = (bool)(arg1)->LoadStream(arg2); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) SWIG_fail; + } + resultobj = PyBool_FromLong((bool)result); + { + if (created2) + delete arg2; + } + return resultobj; + fail: + { + if (created2) + delete arg2; + } + return NULL; +} + + +static PyObject *_wrap_IEHtmlWindowBase_GetStringSelection(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject *resultobj; + wxIEHtmlWindowBase *arg1 = (wxIEHtmlWindowBase *) 0 ; + bool arg2 ; + wxString result; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + char *kwnames[] = { + (char *) "self",(char *) "asHTML", NULL + }; + + if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OO:IEHtmlWindowBase_GetStringSelection",kwnames,&obj0,&obj1)) goto fail; + if ((SWIG_ConvertPtr(obj0,(void **)(&arg1),SWIGTYPE_p_wxIEHtmlWindowBase, + SWIG_POINTER_EXCEPTION | 0)) == -1) SWIG_fail; + arg2 = (bool) SWIG_AsBool(obj1); + if (PyErr_Occurred()) SWIG_fail; + { + PyThreadState* __tstate = wxPyBeginAllowThreads(); + result = (arg1)->GetStringSelection(arg2); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) SWIG_fail; + } + { +#if wxUSE_UNICODE + resultobj = PyUnicode_FromWideChar((&result)->c_str(), (&result)->Len()); +#else + resultobj = PyString_FromStringAndSize((&result)->c_str(), (&result)->Len()); +#endif + } + return resultobj; + fail: + return NULL; +} + + +static PyObject *_wrap_IEHtmlWindowBase_GetText(PyObject *self, PyObject *args, PyObject *kwargs) { + PyObject *resultobj; + wxIEHtmlWindowBase *arg1 = (wxIEHtmlWindowBase *) 0 ; + bool arg2 ; + wxString result; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + char *kwnames[] = { + (char *) "self",(char *) "asHTML", NULL + }; + + if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OO:IEHtmlWindowBase_GetText",kwnames,&obj0,&obj1)) goto fail; + if ((SWIG_ConvertPtr(obj0,(void **)(&arg1),SWIGTYPE_p_wxIEHtmlWindowBase, + SWIG_POINTER_EXCEPTION | 0)) == -1) SWIG_fail; + arg2 = (bool) SWIG_AsBool(obj1); + if (PyErr_Occurred()) SWIG_fail; + { + PyThreadState* __tstate = wxPyBeginAllowThreads(); + result = (arg1)->GetText(arg2); + + wxPyEndAllowThreads(__tstate); + if (PyErr_Occurred()) SWIG_fail; + } + { +#if wxUSE_UNICODE + resultobj = PyUnicode_FromWideChar((&result)->c_str(), (&result)->Len()); +#else + resultobj = PyString_FromStringAndSize((&result)->c_str(), (&result)->Len()); +#endif + } + return resultobj; + fail: + return NULL; +} + + +static PyObject * IEHtmlWindowBase_swigregister(PyObject *self, PyObject *args) { + PyObject *obj; + if (!PyArg_ParseTuple(args,(char*)"O", &obj)) return NULL; + SWIG_TypeClientData(SWIGTYPE_p_wxIEHtmlWindowBase, obj); + Py_INCREF(obj); + return Py_BuildValue((char *)""); +} +static PyMethodDef SwigMethods[] = { + { (char *)"new_CLSID", (PyCFunction) _wrap_new_CLSID, METH_VARARGS | METH_KEYWORDS }, + { (char *)"delete_CLSID", (PyCFunction) _wrap_delete_CLSID, METH_VARARGS | METH_KEYWORDS }, + { (char *)"CLSID_GetCLSIDString", (PyCFunction) _wrap_CLSID_GetCLSIDString, METH_VARARGS | METH_KEYWORDS }, + { (char *)"CLSID_GetProgIDString", (PyCFunction) _wrap_CLSID_GetProgIDString, METH_VARARGS | METH_KEYWORDS }, + { (char *)"CLSID_swigregister", CLSID_swigregister, METH_VARARGS }, + { (char *)"ParamX_flags_get", (PyCFunction) _wrap_ParamX_flags_get, METH_VARARGS | METH_KEYWORDS }, + { (char *)"ParamX_isPtr_get", (PyCFunction) _wrap_ParamX_isPtr_get, METH_VARARGS | METH_KEYWORDS }, + { (char *)"ParamX_isSafeArray_get", (PyCFunction) _wrap_ParamX_isSafeArray_get, METH_VARARGS | METH_KEYWORDS }, + { (char *)"ParamX_isOptional_get", (PyCFunction) _wrap_ParamX_isOptional_get, METH_VARARGS | METH_KEYWORDS }, + { (char *)"ParamX_vt_get", (PyCFunction) _wrap_ParamX_vt_get, METH_VARARGS | METH_KEYWORDS }, + { (char *)"ParamX_name_get", (PyCFunction) _wrap_ParamX_name_get, METH_VARARGS | METH_KEYWORDS }, + { (char *)"ParamX_vt_type_get", (PyCFunction) _wrap_ParamX_vt_type_get, METH_VARARGS | METH_KEYWORDS }, + { (char *)"ParamX_IsIn", (PyCFunction) _wrap_ParamX_IsIn, METH_VARARGS | METH_KEYWORDS }, + { (char *)"ParamX_IsOut", (PyCFunction) _wrap_ParamX_IsOut, METH_VARARGS | METH_KEYWORDS }, + { (char *)"ParamX_IsRetVal", (PyCFunction) _wrap_ParamX_IsRetVal, METH_VARARGS | METH_KEYWORDS }, + { (char *)"ParamX_swigregister", ParamX_swigregister, METH_VARARGS }, + { (char *)"FuncX_name_get", (PyCFunction) _wrap_FuncX_name_get, METH_VARARGS | METH_KEYWORDS }, + { (char *)"FuncX_memid_get", (PyCFunction) _wrap_FuncX_memid_get, METH_VARARGS | METH_KEYWORDS }, + { (char *)"FuncX_hasOut_get", (PyCFunction) _wrap_FuncX_hasOut_get, METH_VARARGS | METH_KEYWORDS }, + { (char *)"FuncX_retType_get", (PyCFunction) _wrap_FuncX_retType_get, METH_VARARGS | METH_KEYWORDS }, + { (char *)"FuncX_params_get", (PyCFunction) _wrap_FuncX_params_get, METH_VARARGS | METH_KEYWORDS }, + { (char *)"FuncX_swigregister", FuncX_swigregister, METH_VARARGS }, + { (char *)"PropX_name_get", (PyCFunction) _wrap_PropX_name_get, METH_VARARGS | METH_KEYWORDS }, + { (char *)"PropX_memid_get", (PyCFunction) _wrap_PropX_memid_get, METH_VARARGS | METH_KEYWORDS }, + { (char *)"PropX_type_get", (PyCFunction) _wrap_PropX_type_get, METH_VARARGS | METH_KEYWORDS }, + { (char *)"PropX_arg_get", (PyCFunction) _wrap_PropX_arg_get, METH_VARARGS | METH_KEYWORDS }, + { (char *)"PropX_putByRef_get", (PyCFunction) _wrap_PropX_putByRef_get, METH_VARARGS | METH_KEYWORDS }, + { (char *)"PropX_CanGet", (PyCFunction) _wrap_PropX_CanGet, METH_VARARGS | METH_KEYWORDS }, + { (char *)"PropX_CanSet", (PyCFunction) _wrap_PropX_CanSet, METH_VARARGS | METH_KEYWORDS }, + { (char *)"PropX_swigregister", PropX_swigregister, METH_VARARGS }, + { (char *)"ParamXArray___nonzero__", (PyCFunction) _wrap_ParamXArray___nonzero__, METH_VARARGS | METH_KEYWORDS }, + { (char *)"ParamXArray___len__", (PyCFunction) _wrap_ParamXArray___len__, METH_VARARGS | METH_KEYWORDS }, + { (char *)"ParamXArray___getitem__", (PyCFunction) _wrap_ParamXArray___getitem__, METH_VARARGS | METH_KEYWORDS }, + { (char *)"ParamXArray_swigregister", ParamXArray_swigregister, METH_VARARGS }, + { (char *)"FuncXArray___nonzero__", (PyCFunction) _wrap_FuncXArray___nonzero__, METH_VARARGS | METH_KEYWORDS }, + { (char *)"FuncXArray___len__", (PyCFunction) _wrap_FuncXArray___len__, METH_VARARGS | METH_KEYWORDS }, + { (char *)"FuncXArray___getitem__", (PyCFunction) _wrap_FuncXArray___getitem__, METH_VARARGS | METH_KEYWORDS }, + { (char *)"FuncXArray_swigregister", FuncXArray_swigregister, METH_VARARGS }, + { (char *)"PropXArray___nonzero__", (PyCFunction) _wrap_PropXArray___nonzero__, METH_VARARGS | METH_KEYWORDS }, + { (char *)"PropXArray___len__", (PyCFunction) _wrap_PropXArray___len__, METH_VARARGS | METH_KEYWORDS }, + { (char *)"PropXArray___getitem__", (PyCFunction) _wrap_PropXArray___getitem__, METH_VARARGS | METH_KEYWORDS }, + { (char *)"PropXArray_swigregister", PropXArray_swigregister, METH_VARARGS }, + { (char *)"new_ActiveXWindow", (PyCFunction) _wrap_new_ActiveXWindow, METH_VARARGS | METH_KEYWORDS }, + { (char *)"ActiveXWindow_GetCLSID", (PyCFunction) _wrap_ActiveXWindow_GetCLSID, METH_VARARGS | METH_KEYWORDS }, + { (char *)"ActiveXWindow_GetAXEventCount", (PyCFunction) _wrap_ActiveXWindow_GetAXEventCount, METH_VARARGS | METH_KEYWORDS }, + { (char *)"ActiveXWindow_GetAXEventDesc", (PyCFunction) _wrap_ActiveXWindow_GetAXEventDesc, METH_VARARGS | METH_KEYWORDS }, + { (char *)"ActiveXWindow_GetAXPropCount", (PyCFunction) _wrap_ActiveXWindow_GetAXPropCount, METH_VARARGS | METH_KEYWORDS }, + { (char *)"ActiveXWindow_GetAXPropDesc", _wrap_ActiveXWindow_GetAXPropDesc, METH_VARARGS }, + { (char *)"ActiveXWindow_GetAXMethodCount", (PyCFunction) _wrap_ActiveXWindow_GetAXMethodCount, METH_VARARGS | METH_KEYWORDS }, + { (char *)"ActiveXWindow_GetAXMethodDesc", _wrap_ActiveXWindow_GetAXMethodDesc, METH_VARARGS }, + { (char *)"ActiveXWindow_GetAXEvents", (PyCFunction) _wrap_ActiveXWindow_GetAXEvents, METH_VARARGS | METH_KEYWORDS }, + { (char *)"ActiveXWindow_GetAXMethods", (PyCFunction) _wrap_ActiveXWindow_GetAXMethods, METH_VARARGS | METH_KEYWORDS }, + { (char *)"ActiveXWindow_GetAXProperties", (PyCFunction) _wrap_ActiveXWindow_GetAXProperties, METH_VARARGS | METH_KEYWORDS }, + { (char *)"ActiveXWindow_SetAXProp", (PyCFunction) _wrap_ActiveXWindow_SetAXProp, METH_VARARGS | METH_KEYWORDS }, + { (char *)"ActiveXWindow_GetAXProp", (PyCFunction) _wrap_ActiveXWindow_GetAXProp, METH_VARARGS | METH_KEYWORDS }, + { (char *)"ActiveXWindow__CallAXMethod", _wrap_ActiveXWindow__CallAXMethod, METH_VARARGS }, + { (char *)"ActiveXWindow_swigregister", ActiveXWindow_swigregister, METH_VARARGS }, + { (char *)"RegisterActiveXEvent", (PyCFunction) _wrap_RegisterActiveXEvent, METH_VARARGS | METH_KEYWORDS }, + { (char *)"ActiveXEvent_EventName", (PyCFunction) _wrap_ActiveXEvent_EventName, METH_VARARGS | METH_KEYWORDS }, + { (char *)"ActiveXEvent__preInit", (PyCFunction) _wrap_ActiveXEvent__preInit, METH_VARARGS | METH_KEYWORDS }, + { (char *)"ActiveXEvent_swigregister", ActiveXEvent_swigregister, METH_VARARGS }, + { (char *)"new_IEHtmlWindowBase", (PyCFunction) _wrap_new_IEHtmlWindowBase, METH_VARARGS | METH_KEYWORDS }, + { (char *)"IEHtmlWindowBase_SetCharset", (PyCFunction) _wrap_IEHtmlWindowBase_SetCharset, METH_VARARGS | METH_KEYWORDS }, + { (char *)"IEHtmlWindowBase_LoadString", (PyCFunction) _wrap_IEHtmlWindowBase_LoadString, METH_VARARGS | METH_KEYWORDS }, + { (char *)"IEHtmlWindowBase_LoadStream", (PyCFunction) _wrap_IEHtmlWindowBase_LoadStream, METH_VARARGS | METH_KEYWORDS }, + { (char *)"IEHtmlWindowBase_GetStringSelection", (PyCFunction) _wrap_IEHtmlWindowBase_GetStringSelection, METH_VARARGS | METH_KEYWORDS }, + { (char *)"IEHtmlWindowBase_GetText", (PyCFunction) _wrap_IEHtmlWindowBase_GetText, METH_VARARGS | METH_KEYWORDS }, + { (char *)"IEHtmlWindowBase_swigregister", IEHtmlWindowBase_swigregister, METH_VARARGS }, + { NULL, NULL } +}; + + +/* -------- TYPE CONVERSION AND EQUIVALENCE RULES (BEGIN) -------- */ + +static void *_p_wxLayoutConstraintsTo_p_wxObject(void *x) { + return (void *)((wxObject *) ((wxLayoutConstraints *) x)); +} +static void *_p_wxGBSizerItemTo_p_wxObject(void *x) { + return (void *)((wxObject *) (wxSizerItem *) ((wxGBSizerItem *) x)); +} +static void *_p_wxSizerItemTo_p_wxObject(void *x) { + return (void *)((wxObject *) ((wxSizerItem *) x)); +} +static void *_p_wxScrollEventTo_p_wxObject(void *x) { + return (void *)((wxObject *) (wxEvent *)(wxCommandEvent *) ((wxScrollEvent *) x)); +} +static void *_p_wxIndividualLayoutConstraintTo_p_wxObject(void *x) { + return (void *)((wxObject *) ((wxIndividualLayoutConstraint *) x)); +} +static void *_p_wxStaticBoxSizerTo_p_wxObject(void *x) { + return (void *)((wxObject *) (wxSizer *)(wxBoxSizer *) ((wxStaticBoxSizer *) x)); +} +static void *_p_wxBoxSizerTo_p_wxObject(void *x) { + return (void *)((wxObject *) (wxSizer *) ((wxBoxSizer *) x)); +} +static void *_p_wxSizerTo_p_wxObject(void *x) { + return (void *)((wxObject *) ((wxSizer *) x)); +} +static void *_p_wxGridBagSizerTo_p_wxObject(void *x) { + return (void *)((wxObject *) (wxSizer *)(wxGridSizer *)(wxFlexGridSizer *) ((wxGridBagSizer *) x)); +} +static void *_p_wxUpdateUIEventTo_p_wxObject(void *x) { + return (void *)((wxObject *) (wxEvent *)(wxCommandEvent *) ((wxUpdateUIEvent *) x)); +} +static void *_p_wxEventTo_p_wxObject(void *x) { + return (void *)((wxObject *) ((wxEvent *) x)); +} +static void *_p_wxFlexGridSizerTo_p_wxObject(void *x) { + return (void *)((wxObject *) (wxSizer *)(wxGridSizer *) ((wxFlexGridSizer *) x)); +} +static void *_p_wxGridSizerTo_p_wxObject(void *x) { + return (void *)((wxObject *) (wxSizer *) ((wxGridSizer *) x)); +} +static void *_p_wxInitDialogEventTo_p_wxObject(void *x) { + return (void *)((wxObject *) (wxEvent *) ((wxInitDialogEvent *) x)); +} +static void *_p_wxPaintEventTo_p_wxObject(void *x) { + return (void *)((wxObject *) (wxEvent *) ((wxPaintEvent *) x)); +} +static void *_p_wxNcPaintEventTo_p_wxObject(void *x) { + return (void *)((wxObject *) (wxEvent *) ((wxNcPaintEvent *) x)); +} +static void *_p_wxPaletteChangedEventTo_p_wxObject(void *x) { + return (void *)((wxObject *) (wxEvent *) ((wxPaletteChangedEvent *) x)); +} +static void *_p_wxDisplayChangedEventTo_p_wxObject(void *x) { + return (void *)((wxObject *) (wxEvent *) ((wxDisplayChangedEvent *) x)); +} +static void *_p_wxMouseCaptureChangedEventTo_p_wxObject(void *x) { + return (void *)((wxObject *) (wxEvent *) ((wxMouseCaptureChangedEvent *) x)); +} +static void *_p_wxSysColourChangedEventTo_p_wxObject(void *x) { + return (void *)((wxObject *) (wxEvent *) ((wxSysColourChangedEvent *) x)); +} +static void *_p_wxControlTo_p_wxObject(void *x) { + return (void *)((wxObject *) (wxEvtHandler *)(wxWindow *) ((wxControl *) x)); +} +static void *_p_wxSetCursorEventTo_p_wxObject(void *x) { + return (void *)((wxObject *) (wxEvent *) ((wxSetCursorEvent *) x)); +} +static void *_p_wxFSFileTo_p_wxObject(void *x) { + return (void *)((wxObject *) ((wxFSFile *) x)); +} +static void *_p_wxPySizerTo_p_wxObject(void *x) { + return (void *)((wxObject *) (wxSizer *) ((wxPySizer *) x)); +} +static void *_p_wxPyEventTo_p_wxObject(void *x) { + return (void *)((wxObject *) (wxEvent *) ((wxPyEvent *) x)); +} +static void *_p_wxNotifyEventTo_p_wxObject(void *x) { + return (void *)((wxObject *) (wxEvent *)(wxCommandEvent *) ((wxNotifyEvent *) x)); +} +static void *_p_wxShowEventTo_p_wxObject(void *x) { + return (void *)((wxObject *) (wxEvent *) ((wxShowEvent *) x)); +} +static void *_p_wxMenuItemTo_p_wxObject(void *x) { + return (void *)((wxObject *) ((wxMenuItem *) x)); +} +static void *_p_wxIdleEventTo_p_wxObject(void *x) { + return (void *)((wxObject *) (wxEvent *) ((wxIdleEvent *) x)); +} +static void *_p_wxWindowCreateEventTo_p_wxObject(void *x) { + return (void *)((wxObject *) (wxEvent *)(wxCommandEvent *) ((wxWindowCreateEvent *) x)); +} +static void *_p_wxQueryNewPaletteEventTo_p_wxObject(void *x) { + return (void *)((wxObject *) (wxEvent *) ((wxQueryNewPaletteEvent *) x)); +} +static void *_p_wxMaximizeEventTo_p_wxObject(void *x) { + return (void *)((wxObject *) (wxEvent *) ((wxMaximizeEvent *) x)); +} +static void *_p_wxIconizeEventTo_p_wxObject(void *x) { + return (void *)((wxObject *) (wxEvent *) ((wxIconizeEvent *) x)); +} +static void *_p_wxSizeEventTo_p_wxObject(void *x) { + return (void *)((wxObject *) (wxEvent *) ((wxSizeEvent *) x)); +} +static void *_p_wxMoveEventTo_p_wxObject(void *x) { + return (void *)((wxObject *) (wxEvent *) ((wxMoveEvent *) x)); +} +static void *_p_wxActivateEventTo_p_wxObject(void *x) { + return (void *)((wxObject *) (wxEvent *) ((wxActivateEvent *) x)); +} +static void *_p_wxXPMHandlerTo_p_wxObject(void *x) { + return (void *)((wxObject *) (wxImageHandler *) ((wxXPMHandler *) x)); +} +static void *_p_wxPNMHandlerTo_p_wxObject(void *x) { + return (void *)((wxObject *) (wxImageHandler *) ((wxPNMHandler *) x)); +} +static void *_p_wxJPEGHandlerTo_p_wxObject(void *x) { + return (void *)((wxObject *) (wxImageHandler *) ((wxJPEGHandler *) x)); +} +static void *_p_wxPCXHandlerTo_p_wxObject(void *x) { + return (void *)((wxObject *) (wxImageHandler *) ((wxPCXHandler *) x)); +} +static void *_p_wxGIFHandlerTo_p_wxObject(void *x) { + return (void *)((wxObject *) (wxImageHandler *) ((wxGIFHandler *) x)); +} +static void *_p_wxPNGHandlerTo_p_wxObject(void *x) { + return (void *)((wxObject *) (wxImageHandler *) ((wxPNGHandler *) x)); +} +static void *_p_wxANIHandlerTo_p_wxObject(void *x) { + return (void *)((wxObject *) (wxImageHandler *)(wxBMPHandler *)(wxICOHandler *)(wxCURHandler *) ((wxANIHandler *) x)); +} +static void *_p_wxCURHandlerTo_p_wxObject(void *x) { + return (void *)((wxObject *) (wxImageHandler *)(wxBMPHandler *)(wxICOHandler *) ((wxCURHandler *) x)); +} +static void *_p_wxICOHandlerTo_p_wxObject(void *x) { + return (void *)((wxObject *) (wxImageHandler *)(wxBMPHandler *) ((wxICOHandler *) x)); +} +static void *_p_wxBMPHandlerTo_p_wxObject(void *x) { + return (void *)((wxObject *) (wxImageHandler *) ((wxBMPHandler *) x)); +} +static void *_p_wxImageHandlerTo_p_wxObject(void *x) { + return (void *)((wxObject *) ((wxImageHandler *) x)); +} +static void *_p_wxTIFFHandlerTo_p_wxObject(void *x) { + return (void *)((wxObject *) (wxImageHandler *) ((wxTIFFHandler *) x)); +} +static void *_p_wxEvtHandlerTo_p_wxObject(void *x) { + return (void *)((wxObject *) ((wxEvtHandler *) x)); +} +static void *_p_wxAcceleratorTableTo_p_wxObject(void *x) { + return (void *)((wxObject *) ((wxAcceleratorTable *) x)); +} +static void *_p_wxImageTo_p_wxObject(void *x) { + return (void *)((wxObject *) ((wxImage *) x)); +} +static void *_p_wxScrollWinEventTo_p_wxObject(void *x) { + return (void *)((wxObject *) (wxEvent *) ((wxScrollWinEvent *) x)); +} +static void *_p_wxWindowDestroyEventTo_p_wxObject(void *x) { + return (void *)((wxObject *) (wxEvent *)(wxCommandEvent *) ((wxWindowDestroyEvent *) x)); +} +static void *_p_wxNavigationKeyEventTo_p_wxObject(void *x) { + return (void *)((wxObject *) (wxEvent *) ((wxNavigationKeyEvent *) x)); +} +static void *_p_wxKeyEventTo_p_wxObject(void *x) { + return (void *)((wxObject *) (wxEvent *) ((wxKeyEvent *) x)); +} +static void *_p_wxActiveXWindowTo_p_wxObject(void *x) { + return (void *)((wxObject *) (wxEvtHandler *)(wxWindow *) ((wxActiveXWindow *) x)); +} +static void *_p_wxWindowTo_p_wxObject(void *x) { + return (void *)((wxObject *) (wxEvtHandler *) ((wxWindow *) x)); +} +static void *_p_wxMenuTo_p_wxObject(void *x) { + return (void *)((wxObject *) (wxEvtHandler *) ((wxMenu *) x)); +} +static void *_p_wxMenuBarTo_p_wxObject(void *x) { + return (void *)((wxObject *) (wxEvtHandler *)(wxWindow *) ((wxMenuBar *) x)); +} +static void *_p_wxActiveXEventTo_p_wxObject(void *x) { + return (void *)((wxObject *) (wxEvent *)(wxCommandEvent *) ((wxActiveXEvent *) x)); +} +static void *_p_wxFileSystemTo_p_wxObject(void *x) { + return (void *)((wxObject *) ((wxFileSystem *) x)); +} +static void *_p_wxContextMenuEventTo_p_wxObject(void *x) { + return (void *)((wxObject *) (wxEvent *)(wxCommandEvent *) ((wxContextMenuEvent *) x)); +} +static void *_p_wxMenuEventTo_p_wxObject(void *x) { + return (void *)((wxObject *) (wxEvent *) ((wxMenuEvent *) x)); +} +static void *_p_wxIEHtmlWindowBaseTo_p_wxObject(void *x) { + return (void *)((wxObject *) (wxEvtHandler *)(wxWindow *)(wxActiveXWindow *) ((wxIEHtmlWindowBase *) x)); +} +static void *_p_wxPyAppTo_p_wxObject(void *x) { + return (void *)((wxObject *) (wxEvtHandler *) ((wxPyApp *) x)); +} +static void *_p_wxCloseEventTo_p_wxObject(void *x) { + return (void *)((wxObject *) (wxEvent *) ((wxCloseEvent *) x)); +} +static void *_p_wxMouseEventTo_p_wxObject(void *x) { + return (void *)((wxObject *) (wxEvent *) ((wxMouseEvent *) x)); +} +static void *_p_wxEraseEventTo_p_wxObject(void *x) { + return (void *)((wxObject *) (wxEvent *) ((wxEraseEvent *) x)); +} +static void *_p_wxPyCommandEventTo_p_wxObject(void *x) { + return (void *)((wxObject *) (wxEvent *)(wxCommandEvent *) ((wxPyCommandEvent *) x)); +} +static void *_p_wxCommandEventTo_p_wxObject(void *x) { + return (void *)((wxObject *) (wxEvent *) ((wxCommandEvent *) x)); +} +static void *_p_wxDropFilesEventTo_p_wxObject(void *x) { + return (void *)((wxObject *) (wxEvent *) ((wxDropFilesEvent *) x)); +} +static void *_p_wxFocusEventTo_p_wxObject(void *x) { + return (void *)((wxObject *) (wxEvent *) ((wxFocusEvent *) x)); +} +static void *_p_wxChildFocusEventTo_p_wxObject(void *x) { + return (void *)((wxObject *) (wxEvent *)(wxCommandEvent *) ((wxChildFocusEvent *) x)); +} +static void *_p_wxControlWithItemsTo_p_wxObject(void *x) { + return (void *)((wxObject *) (wxEvtHandler *)(wxWindow *)(wxControl *) ((wxControlWithItems *) x)); +} +static void *_p_wxPyValidatorTo_p_wxObject(void *x) { + return (void *)((wxObject *) (wxEvtHandler *)(wxValidator *) ((wxPyValidator *) x)); +} +static void *_p_wxValidatorTo_p_wxObject(void *x) { + return (void *)((wxObject *) (wxEvtHandler *) ((wxValidator *) x)); +} +static void *_p_wxIEHtmlWindowBaseTo_p_wxActiveXWindow(void *x) { + return (void *)((wxActiveXWindow *) ((wxIEHtmlWindowBase *) x)); +} +static void *_p_wxControlTo_p_wxWindow(void *x) { + return (void *)((wxWindow *) ((wxControl *) x)); +} +static void *_p_wxControlWithItemsTo_p_wxWindow(void *x) { + return (void *)((wxWindow *) (wxControl *) ((wxControlWithItems *) x)); +} +static void *_p_wxActiveXWindowTo_p_wxWindow(void *x) { + return (void *)((wxWindow *) ((wxActiveXWindow *) x)); +} +static void *_p_wxMenuBarTo_p_wxWindow(void *x) { + return (void *)((wxWindow *) ((wxMenuBar *) x)); +} +static void *_p_wxIEHtmlWindowBaseTo_p_wxWindow(void *x) { + return (void *)((wxWindow *) (wxActiveXWindow *) ((wxIEHtmlWindowBase *) x)); +} +static void *_p_wxChildFocusEventTo_p_wxCommandEvent(void *x) { + return (void *)((wxCommandEvent *) ((wxChildFocusEvent *) x)); +} +static void *_p_wxScrollEventTo_p_wxCommandEvent(void *x) { + return (void *)((wxCommandEvent *) ((wxScrollEvent *) x)); +} +static void *_p_wxWindowCreateEventTo_p_wxCommandEvent(void *x) { + return (void *)((wxCommandEvent *) ((wxWindowCreateEvent *) x)); +} +static void *_p_wxUpdateUIEventTo_p_wxCommandEvent(void *x) { + return (void *)((wxCommandEvent *) ((wxUpdateUIEvent *) x)); +} +static void *_p_wxActiveXEventTo_p_wxCommandEvent(void *x) { + return (void *)((wxCommandEvent *) ((wxActiveXEvent *) x)); +} +static void *_p_wxWindowDestroyEventTo_p_wxCommandEvent(void *x) { + return (void *)((wxCommandEvent *) ((wxWindowDestroyEvent *) x)); +} +static void *_p_wxContextMenuEventTo_p_wxCommandEvent(void *x) { + return (void *)((wxCommandEvent *) ((wxContextMenuEvent *) x)); +} +static void *_p_wxNotifyEventTo_p_wxCommandEvent(void *x) { + return (void *)((wxCommandEvent *) ((wxNotifyEvent *) x)); +} +static void *_p_wxPyCommandEventTo_p_wxCommandEvent(void *x) { + return (void *)((wxCommandEvent *) ((wxPyCommandEvent *) x)); +} +static void *_p_wxControlTo_p_wxEvtHandler(void *x) { + return (void *)((wxEvtHandler *) (wxWindow *) ((wxControl *) x)); +} +static void *_p_wxWindowTo_p_wxEvtHandler(void *x) { + return (void *)((wxEvtHandler *) ((wxWindow *) x)); +} +static void *_p_wxControlWithItemsTo_p_wxEvtHandler(void *x) { + return (void *)((wxEvtHandler *) (wxWindow *)(wxControl *) ((wxControlWithItems *) x)); +} +static void *_p_wxActiveXWindowTo_p_wxEvtHandler(void *x) { + return (void *)((wxEvtHandler *) (wxWindow *) ((wxActiveXWindow *) x)); +} +static void *_p_wxPyAppTo_p_wxEvtHandler(void *x) { + return (void *)((wxEvtHandler *) ((wxPyApp *) x)); +} +static void *_p_wxValidatorTo_p_wxEvtHandler(void *x) { + return (void *)((wxEvtHandler *) ((wxValidator *) x)); +} +static void *_p_wxPyValidatorTo_p_wxEvtHandler(void *x) { + return (void *)((wxEvtHandler *) (wxValidator *) ((wxPyValidator *) x)); +} +static void *_p_wxMenuBarTo_p_wxEvtHandler(void *x) { + return (void *)((wxEvtHandler *) (wxWindow *) ((wxMenuBar *) x)); +} +static void *_p_wxMenuTo_p_wxEvtHandler(void *x) { + return (void *)((wxEvtHandler *) ((wxMenu *) x)); +} +static void *_p_wxIEHtmlWindowBaseTo_p_wxEvtHandler(void *x) { + return (void *)((wxEvtHandler *) (wxWindow *)(wxActiveXWindow *) ((wxIEHtmlWindowBase *) x)); +} +static void *_p_wxContextMenuEventTo_p_wxEvent(void *x) { + return (void *)((wxEvent *) (wxCommandEvent *) ((wxContextMenuEvent *) x)); +} +static void *_p_wxMenuEventTo_p_wxEvent(void *x) { + return (void *)((wxEvent *) ((wxMenuEvent *) x)); +} +static void *_p_wxCloseEventTo_p_wxEvent(void *x) { + return (void *)((wxEvent *) ((wxCloseEvent *) x)); +} +static void *_p_wxMouseEventTo_p_wxEvent(void *x) { + return (void *)((wxEvent *) ((wxMouseEvent *) x)); +} +static void *_p_wxEraseEventTo_p_wxEvent(void *x) { + return (void *)((wxEvent *) ((wxEraseEvent *) x)); +} +static void *_p_wxSetCursorEventTo_p_wxEvent(void *x) { + return (void *)((wxEvent *) ((wxSetCursorEvent *) x)); +} +static void *_p_wxInitDialogEventTo_p_wxEvent(void *x) { + return (void *)((wxEvent *) ((wxInitDialogEvent *) x)); +} +static void *_p_wxScrollEventTo_p_wxEvent(void *x) { + return (void *)((wxEvent *) (wxCommandEvent *) ((wxScrollEvent *) x)); +} +static void *_p_wxPyEventTo_p_wxEvent(void *x) { + return (void *)((wxEvent *) ((wxPyEvent *) x)); +} +static void *_p_wxNotifyEventTo_p_wxEvent(void *x) { + return (void *)((wxEvent *) (wxCommandEvent *) ((wxNotifyEvent *) x)); +} +static void *_p_wxIdleEventTo_p_wxEvent(void *x) { + return (void *)((wxEvent *) ((wxIdleEvent *) x)); +} +static void *_p_wxWindowCreateEventTo_p_wxEvent(void *x) { + return (void *)((wxEvent *) (wxCommandEvent *) ((wxWindowCreateEvent *) x)); +} +static void *_p_wxQueryNewPaletteEventTo_p_wxEvent(void *x) { + return (void *)((wxEvent *) ((wxQueryNewPaletteEvent *) x)); +} +static void *_p_wxMaximizeEventTo_p_wxEvent(void *x) { + return (void *)((wxEvent *) ((wxMaximizeEvent *) x)); +} +static void *_p_wxIconizeEventTo_p_wxEvent(void *x) { + return (void *)((wxEvent *) ((wxIconizeEvent *) x)); +} +static void *_p_wxActivateEventTo_p_wxEvent(void *x) { + return (void *)((wxEvent *) ((wxActivateEvent *) x)); +} +static void *_p_wxSizeEventTo_p_wxEvent(void *x) { + return (void *)((wxEvent *) ((wxSizeEvent *) x)); +} +static void *_p_wxMoveEventTo_p_wxEvent(void *x) { + return (void *)((wxEvent *) ((wxMoveEvent *) x)); +} +static void *_p_wxPaintEventTo_p_wxEvent(void *x) { + return (void *)((wxEvent *) ((wxPaintEvent *) x)); +} +static void *_p_wxNcPaintEventTo_p_wxEvent(void *x) { + return (void *)((wxEvent *) ((wxNcPaintEvent *) x)); +} +static void *_p_wxUpdateUIEventTo_p_wxEvent(void *x) { + return (void *)((wxEvent *) (wxCommandEvent *) ((wxUpdateUIEvent *) x)); +} +static void *_p_wxPaletteChangedEventTo_p_wxEvent(void *x) { + return (void *)((wxEvent *) ((wxPaletteChangedEvent *) x)); +} +static void *_p_wxDisplayChangedEventTo_p_wxEvent(void *x) { + return (void *)((wxEvent *) ((wxDisplayChangedEvent *) x)); +} +static void *_p_wxMouseCaptureChangedEventTo_p_wxEvent(void *x) { + return (void *)((wxEvent *) ((wxMouseCaptureChangedEvent *) x)); +} +static void *_p_wxSysColourChangedEventTo_p_wxEvent(void *x) { + return (void *)((wxEvent *) ((wxSysColourChangedEvent *) x)); +} +static void *_p_wxDropFilesEventTo_p_wxEvent(void *x) { + return (void *)((wxEvent *) ((wxDropFilesEvent *) x)); +} +static void *_p_wxFocusEventTo_p_wxEvent(void *x) { + return (void *)((wxEvent *) ((wxFocusEvent *) x)); +} +static void *_p_wxChildFocusEventTo_p_wxEvent(void *x) { + return (void *)((wxEvent *) (wxCommandEvent *) ((wxChildFocusEvent *) x)); +} +static void *_p_wxActiveXEventTo_p_wxEvent(void *x) { + return (void *)((wxEvent *) (wxCommandEvent *) ((wxActiveXEvent *) x)); +} +static void *_p_wxShowEventTo_p_wxEvent(void *x) { + return (void *)((wxEvent *) ((wxShowEvent *) x)); +} +static void *_p_wxCommandEventTo_p_wxEvent(void *x) { + return (void *)((wxEvent *) ((wxCommandEvent *) x)); +} +static void *_p_wxPyCommandEventTo_p_wxEvent(void *x) { + return (void *)((wxEvent *) (wxCommandEvent *) ((wxPyCommandEvent *) x)); +} +static void *_p_wxWindowDestroyEventTo_p_wxEvent(void *x) { + return (void *)((wxEvent *) (wxCommandEvent *) ((wxWindowDestroyEvent *) x)); +} +static void *_p_wxNavigationKeyEventTo_p_wxEvent(void *x) { + return (void *)((wxEvent *) ((wxNavigationKeyEvent *) x)); +} +static void *_p_wxKeyEventTo_p_wxEvent(void *x) { + return (void *)((wxEvent *) ((wxKeyEvent *) x)); +} +static void *_p_wxScrollWinEventTo_p_wxEvent(void *x) { + return (void *)((wxEvent *) ((wxScrollWinEvent *) x)); +} +static swig_type_info _swigt__p_wxObject[] = {{"_p_wxObject", 0, "wxObject *", 0, 0, 0, 0},{"_p_wxLayoutConstraints", _p_wxLayoutConstraintsTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxGBSizerItem", _p_wxGBSizerItemTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxSizerItem", _p_wxSizerItemTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxScrollEvent", _p_wxScrollEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxIndividualLayoutConstraint", _p_wxIndividualLayoutConstraintTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxStaticBoxSizer", _p_wxStaticBoxSizerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxBoxSizer", _p_wxBoxSizerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxSizer", _p_wxSizerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxGridBagSizer", _p_wxGridBagSizerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxUpdateUIEvent", _p_wxUpdateUIEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxMenu", _p_wxMenuTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxEvent", _p_wxEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxFlexGridSizer", _p_wxFlexGridSizerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxGridSizer", _p_wxGridSizerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxInitDialogEvent", _p_wxInitDialogEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxNcPaintEvent", _p_wxNcPaintEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPaintEvent", _p_wxPaintEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPaletteChangedEvent", _p_wxPaletteChangedEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxDisplayChangedEvent", _p_wxDisplayChangedEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxSysColourChangedEvent", _p_wxSysColourChangedEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxMouseCaptureChangedEvent", _p_wxMouseCaptureChangedEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxControl", _p_wxControlTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxSetCursorEvent", _p_wxSetCursorEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxFSFile", _p_wxFSFileTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPySizer", _p_wxPySizerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyEvent", _p_wxPyEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxNotifyEvent", _p_wxNotifyEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxShowEvent", _p_wxShowEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxMenuItem", _p_wxMenuItemTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxMoveEvent", _p_wxMoveEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxSizeEvent", _p_wxSizeEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxActivateEvent", _p_wxActivateEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxIconizeEvent", _p_wxIconizeEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxMaximizeEvent", _p_wxMaximizeEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxIdleEvent", _p_wxIdleEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxWindowCreateEvent", _p_wxWindowCreateEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxQueryNewPaletteEvent", _p_wxQueryNewPaletteEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxXPMHandler", _p_wxXPMHandlerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPNMHandler", _p_wxPNMHandlerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxJPEGHandler", _p_wxJPEGHandlerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPCXHandler", _p_wxPCXHandlerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxGIFHandler", _p_wxGIFHandlerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPNGHandler", _p_wxPNGHandlerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxANIHandler", _p_wxANIHandlerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxCURHandler", _p_wxCURHandlerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxICOHandler", _p_wxICOHandlerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxBMPHandler", _p_wxBMPHandlerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxImageHandler", _p_wxImageHandlerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxTIFFHandler", _p_wxTIFFHandlerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxEvtHandler", _p_wxEvtHandlerTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxAcceleratorTable", _p_wxAcceleratorTableTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxImage", _p_wxImageTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxScrollWinEvent", _p_wxScrollWinEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxObject", 0, 0, 0, 0, 0, 0},{"_p_wxKeyEvent", _p_wxKeyEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxNavigationKeyEvent", _p_wxNavigationKeyEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxWindowDestroyEvent", _p_wxWindowDestroyEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxActiveXEvent", _p_wxActiveXEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxActiveXWindow", _p_wxActiveXWindowTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxWindow", _p_wxWindowTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxMenuBar", _p_wxMenuBarTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxFileSystem", _p_wxFileSystemTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxIEHtmlWindowBase", _p_wxIEHtmlWindowBaseTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxContextMenuEvent", _p_wxContextMenuEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxMenuEvent", _p_wxMenuEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyApp", _p_wxPyAppTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxCloseEvent", _p_wxCloseEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxMouseEvent", _p_wxMouseEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxEraseEvent", _p_wxEraseEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxCommandEvent", _p_wxCommandEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyCommandEvent", _p_wxPyCommandEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxDropFilesEvent", _p_wxDropFilesEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxFocusEvent", _p_wxFocusEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxChildFocusEvent", _p_wxChildFocusEventTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxControlWithItems", _p_wxControlWithItemsTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxPyValidator", _p_wxPyValidatorTo_p_wxObject, 0, 0, 0, 0, 0},{"_p_wxValidator", _p_wxValidatorTo_p_wxObject, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0}}; +static swig_type_info _swigt__p_wxFuncX[] = {{"_p_wxFuncX", 0, "wxFuncX *", 0, 0, 0, 0},{"_p_wxFuncX", 0, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0}}; +static swig_type_info _swigt__p_wxActiveXWindow[] = {{"_p_wxActiveXWindow", 0, "wxActiveXWindow *", 0, 0, 0, 0},{"_p_wxActiveXWindow", 0, 0, 0, 0, 0, 0},{"_p_wxIEHtmlWindowBase", _p_wxIEHtmlWindowBaseTo_p_wxActiveXWindow, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0}}; +static swig_type_info _swigt__p_wxWindow[] = {{"_p_wxWindow", 0, "wxWindow *", 0, 0, 0, 0},{"_p_wxControl", _p_wxControlTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxWindow", 0, 0, 0, 0, 0, 0},{"_p_wxControlWithItems", _p_wxControlWithItemsTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxActiveXWindow", _p_wxActiveXWindowTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxMenuBar", _p_wxMenuBarTo_p_wxWindow, 0, 0, 0, 0, 0},{"_p_wxIEHtmlWindowBase", _p_wxIEHtmlWindowBaseTo_p_wxWindow, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0}}; +static swig_type_info _swigt__p_wxCommandEvent[] = {{"_p_wxCommandEvent", 0, "wxCommandEvent *", 0, 0, 0, 0},{"_p_wxChildFocusEvent", _p_wxChildFocusEventTo_p_wxCommandEvent, 0, 0, 0, 0, 0},{"_p_wxScrollEvent", _p_wxScrollEventTo_p_wxCommandEvent, 0, 0, 0, 0, 0},{"_p_wxWindowCreateEvent", _p_wxWindowCreateEventTo_p_wxCommandEvent, 0, 0, 0, 0, 0},{"_p_wxUpdateUIEvent", _p_wxUpdateUIEventTo_p_wxCommandEvent, 0, 0, 0, 0, 0},{"_p_wxActiveXEvent", _p_wxActiveXEventTo_p_wxCommandEvent, 0, 0, 0, 0, 0},{"_p_wxWindowDestroyEvent", _p_wxWindowDestroyEventTo_p_wxCommandEvent, 0, 0, 0, 0, 0},{"_p_wxContextMenuEvent", _p_wxContextMenuEventTo_p_wxCommandEvent, 0, 0, 0, 0, 0},{"_p_wxCommandEvent", 0, 0, 0, 0, 0, 0},{"_p_wxNotifyEvent", _p_wxNotifyEventTo_p_wxCommandEvent, 0, 0, 0, 0, 0},{"_p_wxPyCommandEvent", _p_wxPyCommandEventTo_p_wxCommandEvent, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0}}; +static swig_type_info _swigt__p_char[] = {{"_p_char", 0, "char *", 0, 0, 0, 0},{"_p_char", 0, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0}}; +static swig_type_info _swigt__p_wxInputStream[] = {{"_p_wxInputStream", 0, "wxInputStream *", 0, 0, 0, 0},{"_p_wxInputStream", 0, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0}}; +static swig_type_info _swigt__p_wxEvtHandler[] = {{"_p_wxEvtHandler", 0, "wxEvtHandler *", 0, 0, 0, 0},{"_p_wxControl", _p_wxControlTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxWindow", _p_wxWindowTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxControlWithItems", _p_wxControlWithItemsTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxActiveXWindow", _p_wxActiveXWindowTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxEvtHandler", 0, 0, 0, 0, 0, 0},{"_p_wxPyApp", _p_wxPyAppTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxMenuBar", _p_wxMenuBarTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxValidator", _p_wxValidatorTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxPyValidator", _p_wxPyValidatorTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxMenu", _p_wxMenuTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{"_p_wxIEHtmlWindowBase", _p_wxIEHtmlWindowBaseTo_p_wxEvtHandler, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0}}; +static swig_type_info _swigt__p_wxPropX[] = {{"_p_wxPropX", 0, "wxPropX *", 0, 0, 0, 0},{"_p_wxPropX", 0, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0}}; +static swig_type_info _swigt__p_wxFuncXArray[] = {{"_p_wxFuncXArray", 0, "wxFuncXArray *", 0, 0, 0, 0},{"_p_wxFuncXArray", 0, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0}}; +static swig_type_info _swigt__p_wxParamXArray[] = {{"_p_wxParamXArray", 0, "wxParamXArray *", 0, 0, 0, 0},{"_p_wxParamXArray", 0, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0}}; +static swig_type_info _swigt__p_wxActiveXEvent[] = {{"_p_wxActiveXEvent", 0, "wxActiveXEvent *", 0, 0, 0, 0},{"_p_wxActiveXEvent", 0, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0}}; +static swig_type_info _swigt__p_wxParamX[] = {{"_p_wxParamX", 0, "wxParamX *", 0, 0, 0, 0},{"_p_wxParamX", 0, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0}}; +static swig_type_info _swigt__p_wxIEHtmlWindowBase[] = {{"_p_wxIEHtmlWindowBase", 0, "wxIEHtmlWindowBase *", 0, 0, 0, 0},{"_p_wxIEHtmlWindowBase", 0, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0}}; +static swig_type_info _swigt__p_wxPropXArray[] = {{"_p_wxPropXArray", 0, "wxPropXArray *", 0, 0, 0, 0},{"_p_wxPropXArray", 0, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0}}; +static swig_type_info _swigt__p_wxEvent[] = {{"_p_wxEvent", 0, "wxEvent *", 0, 0, 0, 0},{"_p_wxContextMenuEvent", _p_wxContextMenuEventTo_p_wxEvent, 0, 0, 0, 0, 0},{"_p_wxMenuEvent", _p_wxMenuEventTo_p_wxEvent, 0, 0, 0, 0, 0},{"_p_wxCloseEvent", _p_wxCloseEventTo_p_wxEvent, 0, 0, 0, 0, 0},{"_p_wxMouseEvent", _p_wxMouseEventTo_p_wxEvent, 0, 0, 0, 0, 0},{"_p_wxEraseEvent", _p_wxEraseEventTo_p_wxEvent, 0, 0, 0, 0, 0},{"_p_wxSetCursorEvent", _p_wxSetCursorEventTo_p_wxEvent, 0, 0, 0, 0, 0},{"_p_wxInitDialogEvent", _p_wxInitDialogEventTo_p_wxEvent, 0, 0, 0, 0, 0},{"_p_wxScrollEvent", _p_wxScrollEventTo_p_wxEvent, 0, 0, 0, 0, 0},{"_p_wxPyEvent", _p_wxPyEventTo_p_wxEvent, 0, 0, 0, 0, 0},{"_p_wxNotifyEvent", _p_wxNotifyEventTo_p_wxEvent, 0, 0, 0, 0, 0},{"_p_wxEvent", 0, 0, 0, 0, 0, 0},{"_p_wxQueryNewPaletteEvent", _p_wxQueryNewPaletteEventTo_p_wxEvent, 0, 0, 0, 0, 0},{"_p_wxWindowCreateEvent", _p_wxWindowCreateEventTo_p_wxEvent, 0, 0, 0, 0, 0},{"_p_wxIdleEvent", _p_wxIdleEventTo_p_wxEvent, 0, 0, 0, 0, 0},{"_p_wxMaximizeEvent", _p_wxMaximizeEventTo_p_wxEvent, 0, 0, 0, 0, 0},{"_p_wxIconizeEvent", _p_wxIconizeEventTo_p_wxEvent, 0, 0, 0, 0, 0},{"_p_wxMoveEvent", _p_wxMoveEventTo_p_wxEvent, 0, 0, 0, 0, 0},{"_p_wxSizeEvent", _p_wxSizeEventTo_p_wxEvent, 0, 0, 0, 0, 0},{"_p_wxActivateEvent", _p_wxActivateEventTo_p_wxEvent, 0, 0, 0, 0, 0},{"_p_wxPaintEvent", _p_wxPaintEventTo_p_wxEvent, 0, 0, 0, 0, 0},{"_p_wxNcPaintEvent", _p_wxNcPaintEventTo_p_wxEvent, 0, 0, 0, 0, 0},{"_p_wxUpdateUIEvent", _p_wxUpdateUIEventTo_p_wxEvent, 0, 0, 0, 0, 0},{"_p_wxPaletteChangedEvent", _p_wxPaletteChangedEventTo_p_wxEvent, 0, 0, 0, 0, 0},{"_p_wxDisplayChangedEvent", _p_wxDisplayChangedEventTo_p_wxEvent, 0, 0, 0, 0, 0},{"_p_wxMouseCaptureChangedEvent", _p_wxMouseCaptureChangedEventTo_p_wxEvent, 0, 0, 0, 0, 0},{"_p_wxSysColourChangedEvent", _p_wxSysColourChangedEventTo_p_wxEvent, 0, 0, 0, 0, 0},{"_p_wxActiveXEvent", _p_wxActiveXEventTo_p_wxEvent, 0, 0, 0, 0, 0},{"_p_wxDropFilesEvent", _p_wxDropFilesEventTo_p_wxEvent, 0, 0, 0, 0, 0},{"_p_wxFocusEvent", _p_wxFocusEventTo_p_wxEvent, 0, 0, 0, 0, 0},{"_p_wxChildFocusEvent", _p_wxChildFocusEventTo_p_wxEvent, 0, 0, 0, 0, 0},{"_p_wxShowEvent", _p_wxShowEventTo_p_wxEvent, 0, 0, 0, 0, 0},{"_p_wxCommandEvent", _p_wxCommandEventTo_p_wxEvent, 0, 0, 0, 0, 0},{"_p_wxPyCommandEvent", _p_wxPyCommandEventTo_p_wxEvent, 0, 0, 0, 0, 0},{"_p_wxWindowDestroyEvent", _p_wxWindowDestroyEventTo_p_wxEvent, 0, 0, 0, 0, 0},{"_p_wxNavigationKeyEvent", _p_wxNavigationKeyEventTo_p_wxEvent, 0, 0, 0, 0, 0},{"_p_wxKeyEvent", _p_wxKeyEventTo_p_wxEvent, 0, 0, 0, 0, 0},{"_p_wxScrollWinEvent", _p_wxScrollWinEventTo_p_wxEvent, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0}}; +static swig_type_info _swigt__p_CLSID[] = {{"_p_CLSID", 0, "CLSID *", 0, 0, 0, 0},{"_p_CLSID", 0, 0, 0, 0, 0, 0},{0, 0, 0, 0, 0, 0, 0}}; + +static swig_type_info *swig_types_initial[] = { +_swigt__p_wxObject, +_swigt__p_wxFuncX, +_swigt__p_wxActiveXWindow, +_swigt__p_wxWindow, +_swigt__p_wxCommandEvent, +_swigt__p_char, +_swigt__p_wxInputStream, +_swigt__p_wxEvtHandler, +_swigt__p_wxPropX, +_swigt__p_wxFuncXArray, +_swigt__p_wxParamXArray, +_swigt__p_wxActiveXEvent, +_swigt__p_wxParamX, +_swigt__p_wxIEHtmlWindowBase, +_swigt__p_wxPropXArray, +_swigt__p_wxEvent, +_swigt__p_CLSID, +0 +}; + + +/* -------- TYPE CONVERSION AND EQUIVALENCE RULES (END) -------- */ + +static swig_const_info swig_const_table[] = { +{0}}; + +#ifdef __cplusplus +} +#endif + +#ifdef __cplusplus +extern "C" +#endif +SWIGEXPORT(void) SWIG_init(void) { + static PyObject *SWIG_globals = 0; + static int typeinit = 0; + PyObject *m, *d; + int i; + if (!SWIG_globals) SWIG_globals = SWIG_newvarlink(); + m = Py_InitModule((char *) SWIG_name, SwigMethods); + d = PyModule_GetDict(m); + + if (!typeinit) { + for (i = 0; swig_types_initial[i]; i++) { + swig_types[i] = SWIG_TypeRegister(swig_types_initial[i]); + } + typeinit = 1; + } + SWIG_InstallConstants(d,swig_const_table); + +} + diff --git a/wxPython/contrib/activex/wxie/IEHtmlStream.h b/wxPython/contrib/activex/wxie/IEHtmlStream.h new file mode 100644 index 0000000000..ac481a936b --- /dev/null +++ b/wxPython/contrib/activex/wxie/IEHtmlStream.h @@ -0,0 +1,133 @@ +/* + wxActiveX Library Licence, Version 3 + ==================================== + + Copyright (C) 2003 Lindsay Mathieson [, ...] + + Everyone is permitted to copy and distribute verbatim copies + of this licence document, but changing it is not allowed. + + wxActiveX LIBRARY LICENCE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + This library is free software; you can redistribute it and/or modify it + under the terms of the GNU Library General Public Licence as published by + the Free Software Foundation; either version 2 of the Licence, or (at + your option) any later version. + + This library is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library + General Public Licence for more details. + + You should have received a copy of the GNU Library General Public Licence + along with this software, usually in a file named COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, + Boston, MA 02111-1307 USA. + + EXCEPTION NOTICE + + 1. As a special exception, the copyright holders of this library give + permission for additional uses of the text contained in this release of + the library as licenced under the wxActiveX Library Licence, applying + either version 3 of the Licence, or (at your option) any later version of + the Licence as published by the copyright holders of version 3 of the + Licence document. + + 2. The exception is that you may use, copy, link, modify and distribute + under the user's own terms, binary object code versions of works based + on the Library. + + 3. If you copy code from files distributed under the terms of the GNU + General Public Licence or the GNU Library General Public Licence into a + copy of this library, as this licence permits, the exception does not + apply to the code that you add in this way. To avoid misleading anyone as + to the status of such modified files, you must delete this exception + notice from such code and/or adjust the licensing conditions notice + accordingly. + + 4. If you write modifications of your own for this library, it is your + choice whether to permit this exception to apply to your modifications. + If you do not wish that, you must delete the exception notice from such + code and/or adjust the licensing conditions notice accordingly. +*/ + +// This module contains the declarations of the stream adapters and such that +// used to be in IEHtmlWin.cpp, so that they can be used independently in the +// wxPython wrappers... + + +#ifndef _IEHTMLSTREAM_H_ +#define _IEHTMLSTREAM_H_ + + +class IStreamAdaptorBase : public IStream +{ +private: + DECLARE_OLE_UNKNOWN(IStreamAdaptorBase); + +public: + string prepend; + + IStreamAdaptorBase() {} + virtual ~IStreamAdaptorBase() {} + + virtual int Read(char *buf, int cb) = 0; + + // ISequentialStream + HRESULT STDMETHODCALLTYPE Read(void __RPC_FAR *pv, ULONG cb, ULONG __RPC_FAR *pcbRead); + + HRESULT STDMETHODCALLTYPE Write(const void __RPC_FAR *pv, ULONG cb, ULONG __RPC_FAR *pcbWritten) {return E_NOTIMPL;} + + // IStream + HRESULT STDMETHODCALLTYPE Seek(LARGE_INTEGER dlibMove, DWORD dwOrigin, ULARGE_INTEGER __RPC_FAR *plibNewPosition) {return E_NOTIMPL;} + HRESULT STDMETHODCALLTYPE SetSize(ULARGE_INTEGER libNewSize) {return E_NOTIMPL;} + HRESULT STDMETHODCALLTYPE CopyTo(IStream __RPC_FAR *pstm, ULARGE_INTEGER cb, ULARGE_INTEGER __RPC_FAR *pcbRead, ULARGE_INTEGER __RPC_FAR *pcbWritten) {return E_NOTIMPL;} + HRESULT STDMETHODCALLTYPE Commit(DWORD grfCommitFlags) {return E_NOTIMPL;} + HRESULT STDMETHODCALLTYPE Revert(void) {return E_NOTIMPL;} + HRESULT STDMETHODCALLTYPE LockRegion(ULARGE_INTEGER libOffset, ULARGE_INTEGER cb, DWORD dwLockType) {return E_NOTIMPL;} + HRESULT STDMETHODCALLTYPE UnlockRegion(ULARGE_INTEGER libOffset, ULARGE_INTEGER cb, DWORD dwLockType) {return E_NOTIMPL;} + HRESULT STDMETHODCALLTYPE Stat(STATSTG __RPC_FAR *pstatstg, DWORD grfStatFlag) {return E_NOTIMPL;} + HRESULT STDMETHODCALLTYPE Clone(IStream __RPC_FAR *__RPC_FAR *ppstm) {return E_NOTIMPL;} +}; + + + +class IStreamAdaptor : public IStreamAdaptorBase +{ +private: + istream *m_is; + +public: + IStreamAdaptor(istream *is); + ~IStreamAdaptor(); + int Read(char *buf, int cb); +}; + + + +class IwxStreamAdaptor : public IStreamAdaptorBase +{ +private: + wxInputStream *m_is; + +public: + IwxStreamAdaptor(wxInputStream *is); + ~IwxStreamAdaptor(); + int Read(char *buf, int cb); +}; + + +class wxOwnedMemInputStream : public wxMemoryInputStream +{ +public: + char *m_data; + + wxOwnedMemInputStream(char *data, size_t len); + ~wxOwnedMemInputStream(); +}; + + +wxAutoOleInterface wxieGetSelRange(IOleObject *oleObject); + +#endif diff --git a/wxPython/contrib/activex/wxie/IEHtmlWin.cpp b/wxPython/contrib/activex/wxie/IEHtmlWin.cpp new file mode 100644 index 0000000000..cab5efcdd7 --- /dev/null +++ b/wxPython/contrib/activex/wxie/IEHtmlWin.cpp @@ -0,0 +1,478 @@ +/* + wxActiveX Library Licence, Version 3 + ==================================== + + Copyright (C) 2003 Lindsay Mathieson [, ...] + + Everyone is permitted to copy and distribute verbatim copies + of this licence document, but changing it is not allowed. + + wxActiveX LIBRARY LICENCE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + This library is free software; you can redistribute it and/or modify it + under the terms of the GNU Library General Public Licence as published by + the Free Software Foundation; either version 2 of the Licence, or (at + your option) any later version. + + This library is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library + General Public Licence for more details. + + You should have received a copy of the GNU Library General Public Licence + along with this software, usually in a file named COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, + Boston, MA 02111-1307 USA. + + EXCEPTION NOTICE + + 1. As a special exception, the copyright holders of this library give + permission for additional uses of the text contained in this release of + the library as licenced under the wxActiveX Library Licence, applying + either version 3 of the Licence, or (at your option) any later version of + the Licence as published by the copyright holders of version 3 of the + Licence document. + + 2. The exception is that you may use, copy, link, modify and distribute + under the user's own terms, binary object code versions of works based + on the Library. + + 3. If you copy code from files distributed under the terms of the GNU + General Public Licence or the GNU Library General Public Licence into a + copy of this library, as this licence permits, the exception does not + apply to the code that you add in this way. To avoid misleading anyone as + to the status of such modified files, you must delete this exception + notice from such code and/or adjust the licensing conditions notice + accordingly. + + 4. If you write modifications of your own for this library, it is your + choice whether to permit this exception to apply to your modifications. + If you do not wish that, you must delete the exception notice from such + code and/or adjust the licensing conditions notice accordingly. +*/ + +#include "IEHtmlWin.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +using namespace std; + + + +////////////////////////////////////////////////////////////////////// +// Stream adapters and such + +HRESULT STDMETHODCALLTYPE IStreamAdaptorBase::Read(void __RPC_FAR *pv, ULONG cb, ULONG __RPC_FAR *pcbRead) +{ + if (prepend.size() > 0) + { + int n = min(prepend.size(), cb); + prepend.copy((char *) pv, n); + prepend = prepend.substr(n); + if (pcbRead) + *pcbRead = n; + + return S_OK; + }; + + int rc = Read((char *) pv, cb); + if (pcbRead) + *pcbRead = rc; + + return S_OK; +}; + +DEFINE_OLE_TABLE(IStreamAdaptorBase) + OLE_IINTERFACE(IUnknown) + OLE_IINTERFACE(ISequentialStream) + OLE_IINTERFACE(IStream) +END_OLE_TABLE; + + +IStreamAdaptor::IStreamAdaptor(istream *is) + : IStreamAdaptorBase(), m_is(is) +{ + wxASSERT(m_is != NULL); +} + +IStreamAdaptor::~IStreamAdaptor() +{ + delete m_is; +} + +int IStreamAdaptor::Read(char *buf, int cb) +{ + m_is->read(buf, cb); + return m_is->gcount(); +} + + +IwxStreamAdaptor::IwxStreamAdaptor(wxInputStream *is) + : IStreamAdaptorBase(), m_is(is) +{ + wxASSERT(m_is != NULL); +} +IwxStreamAdaptor::~IwxStreamAdaptor() +{ + delete m_is; +} + +// ISequentialStream +int IwxStreamAdaptor::Read(char *buf, int cb) +{ + m_is->Read(buf, cb); + return m_is->LastRead(); +}; + +wxOwnedMemInputStream::wxOwnedMemInputStream(char *data, size_t len) + : wxMemoryInputStream(data, len), m_data(data) +{} + +wxOwnedMemInputStream::~wxOwnedMemInputStream() +{ + free(m_data); +} + + +////////////////////////////////////////////////////////////////////// +BEGIN_EVENT_TABLE(wxIEHtmlWin, wxActiveX) +END_EVENT_TABLE() + + +static const CLSID CLSID_MozillaBrowser = +{ 0x1339B54C, 0x3453, 0x11D2, + { 0x93, 0xB9, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00 } }; + + +//#define PROGID "Shell.Explorer" +#define PROGID CLSID_WebBrowser +//#define PROGID CLSID_MozillaBrowser +//#define PROGID CLSID_HTMLDocument +//#define PROGID "MSCAL.Calendar" +//#define PROGID "" +//#define PROGID "SoftwareFX.ChartFX.20" + +wxIEHtmlWin::wxIEHtmlWin(wxWindow * parent, wxWindowID id, + const wxPoint& pos, + const wxSize& size, + long style, + const wxString& name) : + wxActiveX(parent, PROGID, id, pos, size, style, name) +{ + SetupBrowser(); +} + + +wxIEHtmlWin::~wxIEHtmlWin() +{ +} + +void wxIEHtmlWin::SetupBrowser() +{ + HRESULT hret; + + // Get IWebBrowser2 Interface + hret = m_webBrowser.QueryInterface(IID_IWebBrowser2, m_ActiveX); + assert(SUCCEEDED(hret)); + + // web browser setup + m_webBrowser->put_MenuBar(VARIANT_FALSE); + m_webBrowser->put_AddressBar(VARIANT_FALSE); + m_webBrowser->put_StatusBar(VARIANT_FALSE); + m_webBrowser->put_ToolBar(VARIANT_FALSE); + + m_webBrowser->put_RegisterAsBrowser(VARIANT_TRUE); + m_webBrowser->put_RegisterAsDropTarget(VARIANT_TRUE); + + m_webBrowser->Navigate( L"about:blank", NULL, NULL, NULL, NULL ); +} + + +void wxIEHtmlWin::SetEditMode(bool seton) +{ + m_bAmbientUserMode = ! seton; + AmbientPropertyChanged(DISPID_AMBIENT_USERMODE); +}; + +bool wxIEHtmlWin::GetEditMode() +{ + return ! m_bAmbientUserMode; +}; + + +void wxIEHtmlWin::SetCharset(const wxString& charset) +{ + // HTML Document ? + IDispatch *pDisp = NULL; + HRESULT hret = m_webBrowser->get_Document(&pDisp); + wxAutoOleInterface disp(pDisp); + + if (disp.Ok()) + { + wxAutoOleInterface doc(IID_IHTMLDocument2, disp); + if (doc.Ok()) + doc->put_charset((BSTR) (const wchar_t *) charset.wc_str(wxConvUTF8)); + //doc->put_charset((BSTR) wxConvUTF8.cMB2WC(charset).data()); + }; +}; + + +void wxIEHtmlWin::LoadUrl(const wxString& url) +{ + VARIANTARG navFlag, targetFrame, postData, headers; + navFlag.vt = VT_EMPTY; + navFlag.vt = VT_I2; + navFlag.iVal = navNoReadFromCache; + targetFrame.vt = VT_EMPTY; + postData.vt = VT_EMPTY; + headers.vt = VT_EMPTY; + + HRESULT hret = 0; + hret = m_webBrowser->Navigate((BSTR) (const wchar_t *) url.wc_str(wxConvUTF8), + &navFlag, &targetFrame, &postData, &headers); +}; + + +bool wxIEHtmlWin::LoadString(const wxString& html) +{ + char *data = NULL; + size_t len = html.length(); +#ifdef UNICODE + len *= 2; +#endif + data = (char *) malloc(len); + memcpy(data, html.c_str(), len); + return LoadStream(new wxOwnedMemInputStream(data, len)); +}; + +bool wxIEHtmlWin::LoadStream(IStreamAdaptorBase *pstrm) +{ + // need to prepend this as poxy MSHTML will not recognise a HTML comment + // as starting a html document and treats it as plain text + // Does nayone know how to force it to html mode ? + pstrm->prepend = ""; + + // strip leading whitespace as it can confuse MSHTML + wxAutoOleInterface strm(pstrm); + + // Document Interface + IDispatch *pDisp = NULL; + HRESULT hret = m_webBrowser->get_Document(&pDisp); + if (! pDisp) + return false; + wxAutoOleInterface disp(pDisp); + + + // get IPersistStreamInit + wxAutoOleInterface + pPersistStreamInit(IID_IPersistStreamInit, disp); + + if (pPersistStreamInit.Ok()) + { + HRESULT hr = pPersistStreamInit->InitNew(); + if (SUCCEEDED(hr)) + hr = pPersistStreamInit->Load(strm); + + return SUCCEEDED(hr); + } + else + return false; +}; + +bool wxIEHtmlWin::LoadStream(istream *is) +{ + // wrap reference around stream + IStreamAdaptor *pstrm = new IStreamAdaptor(is); + pstrm->AddRef(); + + return LoadStream(pstrm); +}; + +bool wxIEHtmlWin::LoadStream(wxInputStream *is) +{ + // wrap reference around stream + IwxStreamAdaptor *pstrm = new IwxStreamAdaptor(is); + pstrm->AddRef(); + + return LoadStream(pstrm); +}; + + +bool wxIEHtmlWin::GoBack() +{ + HRESULT hret = 0; + hret = m_webBrowser->GoBack(); + return hret == S_OK; +} + +bool wxIEHtmlWin::GoForward() +{ + HRESULT hret = 0; + hret = m_webBrowser->GoForward(); + return hret == S_OK; +} + +bool wxIEHtmlWin::GoHome() +{ + try + { + CallMethod("GoHome"); + return true; + } + catch(exception&) + { + return false; + }; +} + +bool wxIEHtmlWin::GoSearch() +{ + HRESULT hret = 0; + hret = m_webBrowser->GoSearch(); + return hret == S_OK; +} + +bool wxIEHtmlWin::Refresh(wxIEHtmlRefreshLevel level) +{ + VARIANTARG levelArg; + HRESULT hret = 0; + + levelArg.vt = VT_I2; + levelArg.iVal = level; + hret = m_webBrowser->Refresh2(&levelArg); + return hret == S_OK; +} + +bool wxIEHtmlWin::Stop() +{ + HRESULT hret = 0; + hret = m_webBrowser->Stop(); + return hret == S_OK; +} + + +/////////////////////////////////////////////////////////////////////////////// + +static wxAutoOleInterface GetSelObject(IOleObject *oleObject) +{ + // Query for IWebBrowser interface + wxAutoOleInterface wb(IID_IWebBrowser2, oleObject); + if (! wb.Ok()) + return wxAutoOleInterface(); + + IDispatch *iDisp = NULL; + HRESULT hr = wb->get_Document(&iDisp); + if (hr != S_OK) + return wxAutoOleInterface(); + + // Query for Document Interface + wxAutoOleInterface hd(IID_IHTMLDocument2, iDisp); + iDisp->Release(); + + if (! hd.Ok()) + return wxAutoOleInterface(); + + IHTMLSelectionObject *_so = NULL; + hr = hd->get_selection(&_so); + + // take ownership of selection object + wxAutoOleInterface so(_so); + + return so; +}; + +wxAutoOleInterface wxieGetSelRange(IOleObject *oleObject) +{ + wxAutoOleInterface tr; + + wxAutoOleInterface so(GetSelObject(oleObject)); + if (! so) + return tr; + + IDispatch *iDisp = NULL; + HRESULT hr = so->createRange(&iDisp); + if (hr != S_OK) + return tr; + + // Query for IHTMLTxtRange interface + tr.QueryInterface(IID_IHTMLTxtRange, iDisp); + iDisp->Release(); + return tr; +}; + + +wxString wxIEHtmlWin::GetStringSelection(bool asHTML) +{ + wxAutoOleInterface tr(wxieGetSelRange(m_oleObject)); + if (! tr) + return wxEmptyString; + + BSTR text = NULL; + HRESULT hr = E_FAIL; + + if (asHTML) + hr = tr->get_htmlText(&text); + else + hr = tr->get_text(&text); + if (hr != S_OK) + return wxEmptyString; + + wxString s = text; + SysFreeString(text); + + return s; +}; + +wxString wxIEHtmlWin::GetText(bool asHTML) +{ + if (! m_webBrowser.Ok()) + return wxEmptyString; + + // get document dispatch interface + IDispatch *iDisp = NULL; + HRESULT hr = m_webBrowser->get_Document(&iDisp); + if (hr != S_OK) + return wxEmptyString; + + // Query for Document Interface + wxAutoOleInterface hd(IID_IHTMLDocument2, iDisp); + iDisp->Release(); + + if (! hd.Ok()) + return wxEmptyString; + + // get body element + IHTMLElement *_body = NULL; + hd->get_body(&_body); + if (! _body) + return wxEmptyString; + wxAutoOleInterface body(_body); + + // get inner text + BSTR text = NULL; + hr = E_FAIL; + + if (asHTML) + hr = body->get_innerHTML(&text); + else + hr = body->get_innerText(&text); + if (hr != S_OK) + return wxEmptyString; + + wxString s = text; + SysFreeString(text); + + return s; +}; diff --git a/wxPython/contrib/activex/wxie/IEHtmlWin.h b/wxPython/contrib/activex/wxie/IEHtmlWin.h new file mode 100644 index 0000000000..2762156fa5 --- /dev/null +++ b/wxPython/contrib/activex/wxie/IEHtmlWin.h @@ -0,0 +1,120 @@ +/* + wxActiveX Library Licence, Version 3 + ==================================== + + Copyright (C) 2003 Lindsay Mathieson [, ...] + + Everyone is permitted to copy and distribute verbatim copies + of this licence document, but changing it is not allowed. + + wxActiveX LIBRARY LICENCE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + This library is free software; you can redistribute it and/or modify it + under the terms of the GNU Library General Public Licence as published by + the Free Software Foundation; either version 2 of the Licence, or (at + your option) any later version. + + This library is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library + General Public Licence for more details. + + You should have received a copy of the GNU Library General Public Licence + along with this software, usually in a file named COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, + Boston, MA 02111-1307 USA. + + EXCEPTION NOTICE + + 1. As a special exception, the copyright holders of this library give + permission for additional uses of the text contained in this release of + the library as licenced under the wxActiveX Library Licence, applying + either version 3 of the Licence, or (at your option) any later version of + the Licence as published by the copyright holders of version 3 of the + Licence document. + + 2. The exception is that you may use, copy, link, modify and distribute + under the user's own terms, binary object code versions of works based + on the Library. + + 3. If you copy code from files distributed under the terms of the GNU + General Public Licence or the GNU Library General Public Licence into a + copy of this library, as this licence permits, the exception does not + apply to the code that you add in this way. To avoid misleading anyone as + to the status of such modified files, you must delete this exception + notice from such code and/or adjust the licensing conditions notice + accordingly. + + 4. If you write modifications of your own for this library, it is your + choice whether to permit this exception to apply to your modifications. + If you do not wish that, you must delete the exception notice from such + code and/or adjust the licensing conditions notice accordingly. +*/ + +/*! \file iehtmlwin.h + \brief implements wxIEHtmlWin window class +*/ +#ifndef _IEHTMLWIN_H_ +#define _IEHTMLWIN_H_ +#pragma warning( disable : 4101 4786) +#pragma warning( disable : 4786) + + +#include +#include +#include +#include +using namespace std; + +#include "wxactivex.h" + + +enum wxIEHtmlRefreshLevel +{ + wxIEHTML_REFRESH_NORMAL = 0, + wxIEHTML_REFRESH_IFEXPIRED = 1, + wxIEHTML_REFRESH_CONTINUE = 2, + wxIEHTML_REFRESH_COMPLETELY = 3 +}; + +class IStreamAdaptorBase; + +class wxIEHtmlWin : public wxActiveX +{ +public: + wxIEHtmlWin(wxWindow * parent, wxWindowID id = -1, + const wxPoint& pos = wxDefaultPosition, + const wxSize& size = wxDefaultSize, + long style = 0, + const wxString& name = wxPanelNameStr); + virtual ~wxIEHtmlWin(); + + void LoadUrl(const wxString& url); + bool LoadString(const wxString& html); + bool LoadStream(istream *strm); + bool LoadStream(wxInputStream *is); + + void SetCharset(const wxString& charset); + void SetEditMode(bool seton); + bool GetEditMode(); + wxString GetStringSelection(bool asHTML = false); + wxString GetText(bool asHTML = false); + + bool GoBack(); + bool GoForward(); + bool GoHome(); + bool GoSearch(); + bool Refresh(wxIEHtmlRefreshLevel level); + bool Stop(); + + DECLARE_EVENT_TABLE(); + +protected: + void SetupBrowser(); + bool LoadStream(IStreamAdaptorBase *pstrm); + + wxAutoOleInterface m_webBrowser; +}; + +#endif /* _IEHTMLWIN_H_ */ diff --git a/wxPython/contrib/activex/wxie/README.1st.txt b/wxPython/contrib/activex/wxie/README.1st.txt new file mode 100644 index 0000000000..3eb79d1924 --- /dev/null +++ b/wxPython/contrib/activex/wxie/README.1st.txt @@ -0,0 +1,6 @@ +The contents of this dir are from the 9-Jan-2004 version of wxie.zip +downloaded from: + + http://members.optusnet.com.au/~blackpaw1/wxactivex.html + + diff --git a/wxPython/contrib/activex/wxie/default.doxygen b/wxPython/contrib/activex/wxie/default.doxygen new file mode 100644 index 0000000000..d8e5549e0d --- /dev/null +++ b/wxPython/contrib/activex/wxie/default.doxygen @@ -0,0 +1,205 @@ +# Doxyfile 1.3-rc2 + +#--------------------------------------------------------------------------- +# General configuration options +#--------------------------------------------------------------------------- +PROJECT_NAME = wxActiveX +PROJECT_NUMBER = +OUTPUT_DIRECTORY = +OUTPUT_LANGUAGE = English +EXTRACT_ALL = NO +EXTRACT_PRIVATE = NO +EXTRACT_STATIC = YES +EXTRACT_LOCAL_CLASSES = YES +HIDE_UNDOC_MEMBERS = YES +HIDE_UNDOC_CLASSES = YES +HIDE_FRIEND_COMPOUNDS = NO +HIDE_IN_BODY_DOCS = NO +BRIEF_MEMBER_DESC = YES +REPEAT_BRIEF = YES +ALWAYS_DETAILED_SEC = NO +INLINE_INHERITED_MEMB = NO +FULL_PATH_NAMES = NO +STRIP_FROM_PATH = +INTERNAL_DOCS = NO +CASE_SENSE_NAMES = YES +SHORT_NAMES = NO +HIDE_SCOPE_NAMES = NO +VERBATIM_HEADERS = YES +SHOW_INCLUDE_FILES = YES +JAVADOC_AUTOBRIEF = YES +MULTILINE_CPP_IS_BRIEF = NO +DETAILS_AT_TOP = YES +INHERIT_DOCS = NO +INLINE_INFO = YES +SORT_MEMBER_DOCS = NO +DISTRIBUTE_GROUP_DOC = YES +TAB_SIZE = 8 +GENERATE_TODOLIST = YES +GENERATE_TESTLIST = YES +GENERATE_BUGLIST = YES +GENERATE_DEPRECATEDLIST= YES +ALIASES = +ENABLED_SECTIONS = +MAX_INITIALIZER_LINES = 30 +OPTIMIZE_OUTPUT_FOR_C = YES +OPTIMIZE_OUTPUT_JAVA = NO +SHOW_USED_FILES = YES +#--------------------------------------------------------------------------- +# configuration options related to warning and progress messages +#--------------------------------------------------------------------------- +QUIET = NO +WARNINGS = YES +WARN_IF_UNDOCUMENTED = YES +WARN_IF_DOC_ERROR = YES +WARN_FORMAT = "$file($line): $text" +WARN_LOGFILE = +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- +INPUT = .\wxactivex.h .\iehtmlwin.h +FILE_PATTERNS = *.cpp \ + *.c \ + *.h \ + *.cxx \ + *.idl +RECURSIVE = NO +EXCLUDE = +EXCLUDE_SYMLINKS = NO +EXCLUDE_PATTERNS = +EXAMPLE_PATH = +EXAMPLE_PATTERNS = +EXAMPLE_RECURSIVE = NO +IMAGE_PATH = +INPUT_FILTER = +FILTER_SOURCE_FILES = NO +#--------------------------------------------------------------------------- +# configuration options related to source browsing +#--------------------------------------------------------------------------- +SOURCE_BROWSER = YES +INLINE_SOURCES = NO +STRIP_CODE_COMMENTS = YES +REFERENCED_BY_RELATION = NO +REFERENCES_RELATION = NO +#--------------------------------------------------------------------------- +# configuration options related to the alphabetical class index +#--------------------------------------------------------------------------- +ALPHABETICAL_INDEX = YES +COLS_IN_ALPHA_INDEX = 4 +IGNORE_PREFIX = +#--------------------------------------------------------------------------- +# configuration options related to the HTML output +#--------------------------------------------------------------------------- +GENERATE_HTML = YES +HTML_OUTPUT = doxydoc +HTML_FILE_EXTENSION = .html +HTML_HEADER = +HTML_FOOTER = +HTML_STYLESHEET = +HTML_ALIGN_MEMBERS = YES +GENERATE_HTMLHELP = no +CHM_FILE = wxactivex.chm +HHC_LOCATION = hhc.exe +GENERATE_CHI = NO +BINARY_TOC = NO +TOC_EXPAND = NO +DISABLE_INDEX = NO +ENUM_VALUES_PER_LINE = 4 +GENERATE_TREEVIEW = NO +TREEVIEW_WIDTH = 250 +#--------------------------------------------------------------------------- +# configuration options related to the LaTeX output +#--------------------------------------------------------------------------- +GENERATE_LATEX = YES +LATEX_OUTPUT = latex +LATEX_CMD_NAME = latex +MAKEINDEX_CMD_NAME = makeindex +COMPACT_LATEX = NO +PAPER_TYPE = a4wide +EXTRA_PACKAGES = +LATEX_HEADER = +PDF_HYPERLINKS = NO +USE_PDFLATEX = NO +LATEX_BATCHMODE = NO +#--------------------------------------------------------------------------- +# configuration options related to the RTF output +#--------------------------------------------------------------------------- +GENERATE_RTF = NO +RTF_OUTPUT = rtf +COMPACT_RTF = NO +RTF_HYPERLINKS = NO +RTF_STYLESHEET_FILE = +RTF_EXTENSIONS_FILE = +#--------------------------------------------------------------------------- +# configuration options related to the man page output +#--------------------------------------------------------------------------- +GENERATE_MAN = NO +MAN_OUTPUT = man +MAN_EXTENSION = .3 +MAN_LINKS = NO +#--------------------------------------------------------------------------- +# configuration options related to the XML output +#--------------------------------------------------------------------------- +GENERATE_XML = NO +XML_SCHEMA = +XML_DTD = +#--------------------------------------------------------------------------- +# configuration options for the AutoGen Definitions output +#--------------------------------------------------------------------------- +GENERATE_AUTOGEN_DEF = NO +#--------------------------------------------------------------------------- +# configuration options related to the Perl module output +#--------------------------------------------------------------------------- +GENERATE_PERLMOD = NO +PERLMOD_LATEX = NO +PERLMOD_PRETTY = YES +PERLMOD_MAKEVAR_PREFIX = +#--------------------------------------------------------------------------- +# Configuration options related to the preprocessor +#--------------------------------------------------------------------------- +ENABLE_PREPROCESSING = YES +MACRO_EXPANSION = NO +EXPAND_ONLY_PREDEF = NO +SEARCH_INCLUDES = YES +INCLUDE_PATH = +INCLUDE_FILE_PATTERNS = +PREDEFINED = +EXPAND_AS_DEFINED = +SKIP_FUNCTION_MACROS = YES +#--------------------------------------------------------------------------- +# Configuration::addtions related to external references +#--------------------------------------------------------------------------- +TAGFILES = +GENERATE_TAGFILE = +ALLEXTERNALS = NO +EXTERNAL_GROUPS = YES +PERL_PATH = /usr/bin/perl +#--------------------------------------------------------------------------- +# Configuration options related to the dot tool +#--------------------------------------------------------------------------- +CLASS_DIAGRAMS = YES +HIDE_UNDOC_RELATIONS = YES +HAVE_DOT = NO +CLASS_GRAPH = YES +COLLABORATION_GRAPH = YES +TEMPLATE_RELATIONS = YES +INCLUDE_GRAPH = YES +INCLUDED_BY_GRAPH = YES +GRAPHICAL_HIERARCHY = YES +DOT_IMAGE_FORMAT = png +DOT_PATH = +DOTFILE_DIRS = +MAX_DOT_GRAPH_WIDTH = 1024 +MAX_DOT_GRAPH_HEIGHT = 1024 +GENERATE_LEGEND = YES +DOT_CLEANUP = YES +#--------------------------------------------------------------------------- +# Configuration::addtions related to the search engine +#--------------------------------------------------------------------------- +SEARCHENGINE = NO +CGI_NAME = search.cgi +CGI_URL = +DOC_URL = +DOC_ABSPATH = +BIN_ABSPATH = /usr/local/bin/ +EXT_DOC_PATHS = diff --git a/wxPython/contrib/activex/wxie/doxydoc/annotated.html b/wxPython/contrib/activex/wxie/doxydoc/annotated.html new file mode 100644 index 0000000000..b479a7c944 --- /dev/null +++ b/wxPython/contrib/activex/wxie/doxydoc/annotated.html @@ -0,0 +1,22 @@ + + +Annotated Index + + + +
+Main Page   Namespace List   Class Hierarchy   Alphabetical List   Data Structures   File List   Data Fields   Globals  
+

wxActiveX Data Structures

Here are the data structures with brief descriptions: + + + + + + +
NS_wxActiveX::less_wxStringISTL utilty class
wxActiveXMain class for embedding a ActiveX control
wxActiveX::FuncXType & Parameter info for Events and Methods
wxActiveX::ParamXGeneral parameter and return type infoformation for Events, Properties and Methods
wxActiveX::PropXType info for properties
wxAutoOleInterface< I >Template class for smart interface handling
+
Generated on Tue Apr 1 14:51:12 2003 for wxActiveX by + +doxygen1.3-rc3
+ + diff --git a/wxPython/contrib/activex/wxie/doxydoc/classes.html b/wxPython/contrib/activex/wxie/doxydoc/classes.html new file mode 100644 index 0000000000..27447dfeac --- /dev/null +++ b/wxPython/contrib/activex/wxie/doxydoc/classes.html @@ -0,0 +1,17 @@ + + +Alphabetical index + + + +
+Main Page   Namespace List   Class Hierarchy   Alphabetical List   Data Structures   File List   Data Fields   Globals  
+

wxActiveX Data Structure Index

+
  L  
+
  W  
+
wxActiveX::FuncX   wxActiveX::PropX   
less_wxStringI (NS_wxActiveX)   wxActiveX   wxActiveX::ParamX   wxAutoOleInterface   

Generated on Tue Apr 1 14:51:12 2003 for wxActiveX by + +doxygen1.3-rc3
+ + diff --git a/wxPython/contrib/activex/wxie/doxydoc/classwxActiveX.html b/wxPython/contrib/activex/wxie/doxydoc/classwxActiveX.html new file mode 100644 index 0000000000..78582380da --- /dev/null +++ b/wxPython/contrib/activex/wxie/doxydoc/classwxActiveX.html @@ -0,0 +1,474 @@ + + +wxActiveX class Reference + + + +
+Main Page   Namespace List   Class Hierarchy   Alphabetical List   Data Structures   File List   Data Fields   Globals  
+

wxActiveX Class Reference

#include <wxactivex.h> +

+


Detailed Description

+Main class for embedding a ActiveX control. +

+Use by itself or derive from it

Note:
The utility program (wxie) can generate a list of events, methods & properties for a control. First display the control (File|Display), then get the type info (ActiveX|Get Type Info) - these are copied to the clipboard. Eventually this will be expanded to autogenerate wxWindows source files for a control with all methods etc encapsulated.
+
Usage:
construct using a ProgId or class id
 new wxActiveX(parent, CLSID_WebBrowser, id, pos, size, style, name)
+
 new wxActiveX(parent, "ShockwaveFlash.ShockwaveFlash", id, pos, size, style, name)
+
+
Properties
Properties can be set using SetProp() and set/retrieved using Prop()
 SetProp(name, wxVariant(x)) 
+
or
 wxString Prop("<name>") = x
+
 wxString result = Prop("<name>")
+
 flash_ctl.Prop("movie") = "file:///movies/test.swf";
+
 flash_ctl.Prop("Playing") = false;
+
 wxString current_movie = flash_ctl.Prop("movie");
+
+
Methods
Methods are invoked with CallMethod()
 wxVariant result = CallMethod("<name>", args, nargs = -1)
+
 wxVariant args[] = {0L, "file:///e:/dev/wxie/bug-zap.swf"};
+    wxVariant result = X->CallMethod("LoadMovie", args);
+
+
events
respond to events with the EVT_ACTIVEX(controlId, eventName, handler) & EVT_ACTIVEX_DISPID(controlId, eventDispId, handler) macros
+    BEGIN_EVENT_TABLE(wxIEFrame, wxFrame)
+        EVT_ACTIVEX_DISPID(ID_MSHTML, DISPID_STATUSTEXTCHANGE,  OnMSHTMLStatusTextChangeX)
+        EVT_ACTIVEX(ID_MSHTML, "BeforeNavigate2",   OnMSHTMLBeforeNavigate2X)
+        EVT_ACTIVEX(ID_MSHTML, "TitleChange",       OnMSHTMLTitleChangeX)
+        EVT_ACTIVEX(ID_MSHTML, "NewWindow2",        OnMSHTMLNewWindow2X)
+        EVT_ACTIVEX(ID_MSHTML, "ProgressChange",    OnMSHTMLProgressChangeX)
+    END_EVENT_TABLE()
+
+ +

+ +

+Definition at line 329 of file wxactivex.h. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Public Member Functions

wxActiveX (wxWindow *parent, REFCLSID clsid, wxWindowID id=-1, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=0, const wxString &name=wxPanelNameStr)
 Create using clsid.

wxActiveX (wxWindow *parent, wxString progId, wxWindowID id=-1, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=0, const wxString &name=wxPanelNameStr)
 create using progid.

+int GetEventCount () const
 Number of events defined for this control.

const FuncXGetEventDesc (int idx) const
 returns event description by index.

+int GetPropCount () const
 Number of properties defined for this control.

const PropXGetPropDesc (int idx) const
 returns property description by index.

const PropXGetPropDesc (wxString name) const
 returns property description by name.

+int GetMethodCount () const
 Number of methods defined for this control.

const FuncXGetMethodDesc (int idx) const
 returns method description by name.

const FuncXGetMethodDesc (wxString name) const
 returns method description by name.

+void SetProp (MEMBERID name, VARIANTARG &value)
 Set property VARIANTARG value by MEMBERID.

+void SetProp (const wxString &name, const wxVariant &value)
 Set property using wxVariant by name.

wxPropertySetter Prop (wxString name)
 Generic Get/Set Property by name. Automatically handles most types.

wxVariant CallMethod (wxString name, wxVariant args[], int nargs=-1)
 Call a method of the ActiveX control. Automatically handles most types.


Related Functions

(Note that these are not member functions.)

bool MSWVariantToVariant (VARIANTARG &va, wxVariant &vx)
 Convert MSW VARIANTARG to wxVariant. Handles basic types, need to add:
    +
  • VT_ARRAY | VT_*
  • better support for VT_UNKNOWN (currently treated as void *)
  • better support for VT_DISPATCH (currently treated as void *).
+


bool VariantToMSWVariant (const wxVariant &vx, VARIANTARG &va)
 Convert wxVariant to MSW VARIANTARG. Handles basic types, need to add:
    +
  • VT_ARRAY | VT_*
  • better support for VT_UNKNOWN (currently treated as void *)
  • better support for VT_DISPATCH (currently treated as void *).
+


+


Member Function Documentation

+

+ + + + +
+ + + + + + + + + + +
const FuncX& wxActiveX::GetEventDesc int   idx const
+
+ + + + + +
+   + + +

+returns event description by index. +

+throws exception for invalid index

+

+ + + + +
+ + + + + + + + + + +
const PropX& wxActiveX::GetPropDesc int   idx const
+
+ + + + + +
+   + + +

+returns property description by index. +

+throws exception for invalid index

+

+ + + + +
+ + + + + + + + + + +
const PropX& wxActiveX::GetPropDesc wxString   name const
+
+ + + + + +
+   + + +

+returns property description by name. +

+throws exception for invalid name

+

+ + + + +
+ + + + + + + + + + +
const FuncX& wxActiveX::GetMethodDesc int   idx const
+
+ + + + + +
+   + + +

+returns method description by name. +

+throws exception for invalid index

+

+ + + + +
+ + + + + + + + + + +
const FuncX& wxActiveX::GetMethodDesc wxString   name const
+
+ + + + + +
+   + + +

+returns method description by name. +

+throws exception for invalid name

+

+ + + + +
+ + + + + + + + + + +
wxPropertySetter wxActiveX::Prop wxString   name [inline]
+
+ + + + + +
+   + + +

+Generic Get/Set Property by name. Automatically handles most types. +

+

Parameters:
+ + +
name Property name to read/set
+
+
Returns:
wxPropertySetter, which has overloads for setting/getting the property
+

+

Usage:
    +
  • Prop("<name>") = <value>
  • var = Prop("<name>")
  • e.g:
      +
    •  flash_ctl.Prop("movie") = "file:///movies/test.swf";
      +
    •  flash_ctl.Prop("Playing") = false;
      +
    •  wxString current_movie = flash_ctl.Prop("movie");
      +
    +
+
+
Exceptions:
+ + +
raises exception if <name> is invalid
+
+
Note:
Have to add a few more type conversions yet ...
+ +

+Definition at line 458 of file wxactivex.h.

+

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
wxVariant wxActiveX::CallMethod wxString   name,
wxVariant   args[],
int   nargs = -1
+
+ + + + + +
+   + + +

+Call a method of the ActiveX control. Automatically handles most types. +

+

Parameters:
+ + + + +
name name of method to call
args array of wxVariant's, defaults to NULL (no args)
nargs number of arguments passed via args. Defaults to actual number of args for the method
+
+
Returns:
wxVariant
+

+

Usage:
    +
  • result = CallMethod("<name>", args, nargs)
  • e.g.
  • +            wxVariant args[] = {0L, "file:///e:/dev/wxie/bug-zap.swf"};
    +            wxVariant result = X->CallMethod("LoadMovie", args);
    +
+
+
Exceptions:
+ + +
raises exception if <name> is invalid
+
+
Note:
Since wxVariant has built in type conversion, most the std types can be passed easily
+
+


Friends And Related Function Documentation

+

+ + + + +
+ + + + + + + + + + + + + + + + + + + +
bool MSWVariantToVariant VARIANTARG &   va,
wxVariant &   vx
[related]
+
+ + + + + +
+   + + +

+Convert MSW VARIANTARG to wxVariant. Handles basic types, need to add:

    +
  • VT_ARRAY | VT_*
  • better support for VT_UNKNOWN (currently treated as void *)
  • better support for VT_DISPATCH (currently treated as void *).
+ +

+

Parameters:
+ + + +
va VARAIANTARG to convert from
vx Destination wxVariant
+
+
Returns:
success/failure (true/false)
+
+

+ + + + +
+ + + + + + + + + + + + + + + + + + + +
bool VariantToMSWVariant const wxVariant &   vx,
VARIANTARG &   va
[related]
+
+ + + + + +
+   + + +

+Convert wxVariant to MSW VARIANTARG. Handles basic types, need to add:

    +
  • VT_ARRAY | VT_*
  • better support for VT_UNKNOWN (currently treated as void *)
  • better support for VT_DISPATCH (currently treated as void *).
+ +

+

Parameters:
+ + + +
vx wxVariant to convert from
va Destination VARIANTARG
+
+
Returns:
success/failure (true/false)
+
+


The documentation for this class was generated from the following file: +
Generated on Tue Apr 1 14:51:12 2003 for wxActiveX by + +doxygen1.3-rc3
+ + diff --git a/wxPython/contrib/activex/wxie/doxydoc/classwxActiveX_1_1FuncX.html b/wxPython/contrib/activex/wxie/doxydoc/classwxActiveX_1_1FuncX.html new file mode 100644 index 0000000000..ad9af919c7 --- /dev/null +++ b/wxPython/contrib/activex/wxie/doxydoc/classwxActiveX_1_1FuncX.html @@ -0,0 +1,28 @@ + + +wxActiveX::FuncX class Reference + + + +
+Main Page   Namespace List   Class Hierarchy   Alphabetical List   Data Structures   File List   Data Fields   Globals  
+

wxActiveX::FuncX Class Reference

#include <wxactivex.h> +

+


Detailed Description

+Type & Parameter info for Events and Methods. +

+refer to FUNCDESC in MSDN +

+ +

+Definition at line 350 of file wxactivex.h. + +
+


The documentation for this class was generated from the following file: +
Generated on Tue Apr 1 14:51:12 2003 for wxActiveX by + +doxygen1.3-rc3
+ + diff --git a/wxPython/contrib/activex/wxie/doxydoc/classwxActiveX_1_1ParamX.html b/wxPython/contrib/activex/wxie/doxydoc/classwxActiveX_1_1ParamX.html new file mode 100644 index 0000000000..f873c76c39 --- /dev/null +++ b/wxPython/contrib/activex/wxie/doxydoc/classwxActiveX_1_1ParamX.html @@ -0,0 +1,28 @@ + + +wxActiveX::ParamX class Reference + + + +
+Main Page   Namespace List   Class Hierarchy   Alphabetical List   Data Structures   File List   Data Fields   Globals  
+

wxActiveX::ParamX Class Reference

#include <wxactivex.h> +

+


Detailed Description

+General parameter and return type infoformation for Events, Properties and Methods. +

+refer to ELEMDESC, IDLDESC in MSDN +

+ +

+Definition at line 333 of file wxactivex.h. + +
+


The documentation for this class was generated from the following file: +
Generated on Tue Apr 1 14:51:12 2003 for wxActiveX by + +doxygen1.3-rc3
+ + diff --git a/wxPython/contrib/activex/wxie/doxydoc/classwxActiveX_1_1PropX.html b/wxPython/contrib/activex/wxie/doxydoc/classwxActiveX_1_1PropX.html new file mode 100644 index 0000000000..d79b43cd2e --- /dev/null +++ b/wxPython/contrib/activex/wxie/doxydoc/classwxActiveX_1_1PropX.html @@ -0,0 +1,26 @@ + + +wxActiveX::PropX class Reference + + + +
+Main Page   Namespace List   Class Hierarchy   Alphabetical List   Data Structures   File List   Data Fields   Globals  
+

wxActiveX::PropX Class Reference

#include <wxactivex.h> +

+


Detailed Description

+Type info for properties. +

+ +

+Definition at line 362 of file wxactivex.h. + +
+


The documentation for this class was generated from the following file: +
Generated on Tue Apr 1 14:51:12 2003 for wxActiveX by + +doxygen1.3-rc3
+ + diff --git a/wxPython/contrib/activex/wxie/doxydoc/classwxAutoOleInterface.html b/wxPython/contrib/activex/wxie/doxydoc/classwxAutoOleInterface.html new file mode 100644 index 0000000000..20a553c1ba --- /dev/null +++ b/wxPython/contrib/activex/wxie/doxydoc/classwxAutoOleInterface.html @@ -0,0 +1,79 @@ + + + TemplatewxAutoOleInterface< I > class Reference + + + +
+Main Page   Namespace List   Class Hierarchy   Alphabetical List   Data Structures   File List   Data Fields   Globals  
+

wxAutoOleInterface< I > Class Template Reference

#include <wxactivex.h> +

+


Detailed Description

+

template<class I>
+ class wxAutoOleInterface< I >

+ +Template class for smart interface handling. +

+

    +
  • Automatically dereferences ole interfaces
  • Smart Copy Semantics
  • Can Create Interfaces
  • Can query for other interfaces
+ +

+ +

+Definition at line 45 of file wxactivex.h. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Public Member Functions

wxAutoOleInterface (I *pInterface=NULL)
 takes ownership of an existing interface Assumed to already have a AddRef() applied

wxAutoOleInterface (REFIID riid, IUnknown *pUnk)
 queries for an interface

wxAutoOleInterface (REFIID riid, IDispatch *pDispatch)
 queries for an interface

wxAutoOleInterface (REFCLSID clsid, REFIID riid)
 Creates an Interface.

wxAutoOleInterface (const wxAutoOleInterface< I > &ti)
 copy constructor

+wxAutoOleInterface< I > & operator= (const wxAutoOleInterface< I > &ti)
 assignment operator

+wxAutoOleInterface< I > & operator= (I *&ti)
 takes ownership of an existing interface Assumed to already have a AddRef() applied

~wxAutoOleInterface ()
 invokes Free()

+void Free ()
 Releases interface (i.e decrements refCount).

+HRESULT QueryInterface (REFIID riid, IUnknown *pUnk)
 queries for an interface

+HRESULT CreateInstance (REFCLSID clsid, REFIID riid)
 Create a Interface instance.

operator I * () const
 returns the interface pointer

+I * operator-> ()
 returns the dereferenced interface pointer

+I ** GetRef ()
 returns a pointer to the interface pointer

+bool Ok () const
 returns true if we have a valid interface pointer

+


The documentation for this class was generated from the following file: +
Generated on Tue Apr 1 14:51:12 2003 for wxActiveX by + +doxygen1.3-rc3
+ + diff --git a/wxPython/contrib/activex/wxie/doxydoc/doxygen.css b/wxPython/contrib/activex/wxie/doxydoc/doxygen.css new file mode 100644 index 0000000000..8cb8b2e5bd --- /dev/null +++ b/wxPython/contrib/activex/wxie/doxydoc/doxygen.css @@ -0,0 +1,49 @@ +H1 { text-align: center; } +CAPTION { font-weight: bold } +A.qindex {} +A.qindexRef {} +A.el { text-decoration: none; font-weight: bold } +A.elRef { font-weight: bold } +A.code { text-decoration: none; font-weight: normal; color: #4444ee } +A.codeRef { font-weight: normal; color: #4444ee } +A:hover { text-decoration: none; background-color: #f2f2ff } +DL.el { margin-left: -1cm } +DIV.fragment { width: 100%; border: none; background-color: #eeeeee } +DIV.ah { background-color: black; font-weight: bold; color: #ffffff; margin-bottom: 3px; margin-top: 3px } +TD.md { background-color: #f2f2ff; font-weight: bold; } +TD.mdname1 { background-color: #f2f2ff; font-weight: bold; color: #602020; } +TD.mdname { background-color: #f2f2ff; font-weight: bold; color: #602020; width: 600px; } +DIV.groupHeader { margin-left: 16px; margin-top: 12px; margin-bottom: 6px; font-weight: bold } +DIV.groupText { margin-left: 16px; font-style: italic; font-size: smaller } +BODY { background: white; color: black } +TD.indexkey { + background-color: #eeeeff; + font-weight: bold; + padding-right : 10px; + padding-top : 2px; + padding-left : 10px; + padding-bottom : 2px; + margin-left : 0px; + margin-right : 0px; + margin-top : 2px; + margin-bottom : 2px +} +TD.indexvalue { + background-color: #eeeeff; + font-style: italic; + padding-right : 10px; + padding-top : 2px; + padding-left : 10px; + padding-bottom : 2px; + margin-left : 0px; + margin-right : 0px; + margin-top : 2px; + margin-bottom : 2px +} +span.keyword { color: #008000 } +span.keywordtype { color: #604020 } +span.keywordflow { color: #e08000 } +span.comment { color: #800000 } +span.preprocessor { color: #806020 } +span.stringliteral { color: #002080 } +span.charliteral { color: #008080 } diff --git a/wxPython/contrib/activex/wxie/doxydoc/doxygen.png b/wxPython/contrib/activex/wxie/doxydoc/doxygen.png new file mode 100644 index 0000000000000000000000000000000000000000..96ae72c2978be48bb081e0795f5e9a5d6905a5b9 GIT binary patch literal 2352 zcmaJ@XHXM}5)Mc=AW}p^5e%RSEsY{YdPy*fgck593B?GZMk&IDB6^_&r6UR=V1t07 zqDYYB{P-jdO973>Gf8e9NRM)Dp)o!g0qM<4Vj=zPe@|Dq666;okhst+uYS@xk zAe#!=^Zln?PyVKr%6E;`S(kqWY=*HsfA1V;)fhQ<$CMos^=cI}FxoX8aHZD(`7N&D z>eW}uY`q&yA(Aq{v|hyY~*BV!IpRizEa^A zSwUf5fG8o|FrCa?7W_ZsbCSbIMfvD5rc2)xa_CE)&3MK>PdiZzPSx=EY{5R=Lw9$W zFB~Q4-_erioglSItWbyFcScK%P|Bx2nok_;7V~gL{^sw)Hmw`$rsv1K}`8Yt2#c0pX2g5sO;y1o~4%iuIyi#qw zFm*RC`MvCuf!1<4v?T_#Q{Sw>Dv=96=Qk`bvEfC+V}+C_G!9f5qp+Mfqpdo&v-7X2 zEsjl=2Zs2jpeR3I^jOrC#EnCRYK7ykw~Y<^$KBzQ$j?=wli)Z_dg%f@3mh@mn~ zY-rW-_)2Tp)x!)>H?E^r>=E{}#T=G-CW-@osY zch;71#~zaaQaCN&u+y;iqyJD$efQ0`ds~0bG7EEg?iz@?@KkW>xdI>kcON*eM-mkj z{Hg4Mq|yM@aKlnN8Ad!tqDiW7k~_vI0!L4-1Z&Wup7|~d>#qjJ0-uA&ia#r&mdx8v zh{Ysj=iMgA&&1A@moF|nsz(e)_;Uiol|tq()vU(gqOB|ji;{rH_>zyt2xSg9h+h{C zv+F5Xy#5KK7P)%}Ck#D|^?1V$N)szVm7J2X#m+w(imL|lM%~vBw^Q~q$CrnXoTf$H zzF~>!<$mS2O?lzwP|kfiF}g8jcl3mUEgkkkh%w!KZMvAFF9^}~ej@k#Gd^V_{0z7E zlS6D1*YZT=yhuXqJ9{VQ#HEDN*DR$8sI6F7<;IiQSrcoeN7g_o#?!`Af^b9`2;50K zitSJI72p0Sb8pZ7DS_NNl_sYR+va{vYOi<{J}UY2dXxVnRvC@qh1F8VTgYH6vT~(% zZ2N{=>^>N0x=jb@(&D^o^RLm}($~_;&Kub{C2Xfmah^5anC-b6$;BEl3*$8jem8}c z3*MM|I(n@y9TAF*ctIWJT!UQdUmM^y{K3@8sQJdNrafkJtINN7ONa1e;w?Mt{_JhM zvRka(c#HYT@E0V`S6xwQ!o-vU4DQhKh-)xd(lG?l6971ya~`Kg%#4-Zl9lG!@VLCj zn%e5Mm!q<2O$UGcRpXu>y%9VED_L9OY%qWuy3i~< z+emnMRoLY#-xm~rEgRP6atqF;dvM1{=%Q7NcKcBg&Z1l zV~6}Z`XPV+=bsYaz2&oFCc3ZEn}yXbvh;enHYUk;@jUTd(xG51%O-4mi-__eW*D%0++`&?dm# zPd_nXLUL4%gBDan;34>)_!5SOs{V7u1HVyR7H*pVx$aUUgqXX95@2i(7j1|H^I|!M zS3hU81OfgU9~=o25UZE}Kn~T?I2_2;b7HMR`%*)h);W}}SN$d(wjY3w22CPf3pSEK z`@JL}GUw`L^lZx+{KurgBTG8o(X~G|(-<9c9%;J8&^(JEc$Oi*N?=TC)Lzw#&F7Nl zHQB3u-YV(8aQrkAK!U7fLifRwqTWQcQt+0@;kmR<&^uK8n9YK;XTuDH?XY{HL*v09 z8svU;%Hhy$AH9$^e+pAEde;2I<;K%f*-dV3{IarZHE-WX1+D)GFP8KnOsc_^ z6q~mV=laSj_m1;^5X}%ECLfW5I$=E3`=TMVtLt?(a30*5=_&F*bvhx?FF`d>rP;x^MFfsMbkCxS5D-e^%!V{JsKKS`i`&ka` z-g#uQghXfa@Au4JFJ6eWrAEFVsOiW@X;hgN@VQgD2(fD=RxXatsl;WS2C1NQ5IP1br%vg@40K^|6=DP_ zk`iN1j)|m@h&uj}I)0bKLPIDz#87e&KcIbI4*IVgDKNyBa(Q1*52cUvH89j85a4h> zq`m + +File Index + + + +
+Main Page   Namespace List   Class Hierarchy   Alphabetical List   Data Structures   File List   Data Fields   Globals  
+

wxActiveX File List

Here is a list of all documented files with brief descriptions: + + +
iehtmlwin.h [code]Implements wxIEHtmlWin window class
wxactivex.h [code]Implements wxActiveX window class and OLE tools
+
Generated on Tue Apr 1 14:51:12 2003 for wxActiveX by + +doxygen1.3-rc3
+ + diff --git a/wxPython/contrib/activex/wxie/doxydoc/functions.html b/wxPython/contrib/activex/wxie/doxydoc/functions.html new file mode 100644 index 0000000000..2ab053d221 --- /dev/null +++ b/wxPython/contrib/activex/wxie/doxydoc/functions.html @@ -0,0 +1,38 @@ + + +Compound Member Index + + + +
+Main Page   Namespace List   Class Hierarchy   Alphabetical List   Data Structures   File List   Data Fields   Globals  
+

wxActiveX Data Fields

Here is a list of all documented struct and union fields with links to the struct/union documentation for each field: +
Generated on Tue Apr 1 14:51:12 2003 for wxActiveX by + +doxygen1.3-rc3
+ + diff --git a/wxPython/contrib/activex/wxie/doxydoc/globals.html b/wxPython/contrib/activex/wxie/doxydoc/globals.html new file mode 100644 index 0000000000..cf458e457d --- /dev/null +++ b/wxPython/contrib/activex/wxie/doxydoc/globals.html @@ -0,0 +1,20 @@ + + +File Member Index + + + +
+Main Page   Namespace List   Class Hierarchy   Alphabetical List   Data Structures   File List   Data Fields   Globals  
+

wxActiveX Globals

Here is a list of all documented functions, variables, defines, enums, and typedefs with links to the documentation: +
Generated on Tue Apr 1 14:51:12 2003 for wxActiveX by + +doxygen1.3-rc3
+ + diff --git a/wxPython/contrib/activex/wxie/doxydoc/hierarchy.html b/wxPython/contrib/activex/wxie/doxydoc/hierarchy.html new file mode 100644 index 0000000000..c6e07a0c3c --- /dev/null +++ b/wxPython/contrib/activex/wxie/doxydoc/hierarchy.html @@ -0,0 +1,22 @@ + + +Hierarchical Index + + + +
+Main Page   Namespace List   Class Hierarchy   Alphabetical List   Data Structures   File List   Data Fields   Globals  
+

wxActiveX Class Hierarchy

This inheritance list is sorted roughly, but not completely, alphabetically: +
Generated on Tue Apr 1 14:51:12 2003 for wxActiveX by + +doxygen1.3-rc3
+ + diff --git a/wxPython/contrib/activex/wxie/doxydoc/iehtmlwin_8h-source.html b/wxPython/contrib/activex/wxie/doxydoc/iehtmlwin_8h-source.html new file mode 100644 index 0000000000..af554942aa --- /dev/null +++ b/wxPython/contrib/activex/wxie/doxydoc/iehtmlwin_8h-source.html @@ -0,0 +1,78 @@ + + +iehtmlwin.h Source File + + + +
+Main Page   Namespace List   Class Hierarchy   Alphabetical List   Data Structures   File List   Data Fields   Globals  
+

iehtmlwin.h

Go to the documentation of this file.
00001 
+00004 #ifndef _IEHTMLWIN_H_
+00005 #define _IEHTMLWIN_H_
+00006 #pragma warning( disable : 4101 4786)
+00007 #pragma warning( disable : 4786)
+00008 
+00009 
+00010 #include <wx/setup.h>
+00011 #include <wx/wx.h>
+00012 #include <exdisp.h>
+00013 #include <iostream>
+00014 using namespace std;
+00015 
+00016 #include "wxactivex.h"
+00017 
+00018 
+00019 enum wxIEHtmlRefreshLevel 
+00020 {
+00021         wxIEHTML_REFRESH_NORMAL = 0,
+00022         wxIEHTML_REFRESH_IFEXPIRED = 1,
+00023         wxIEHTML_REFRESH_CONTINUE = 2,
+00024         wxIEHTML_REFRESH_COMPLETELY = 3
+00025 };
+00026 
+00027 class IStreamAdaptorBase;
+00028 
+00029 class wxIEHtmlWin : public wxActiveX
+00030 {
+00031 public:
+00032     wxIEHtmlWin(wxWindow * parent, wxWindowID id = -1,
+00033         const wxPoint& pos = wxDefaultPosition,
+00034         const wxSize& size = wxDefaultSize,
+00035         long style = 0,
+00036         const wxString& name = wxPanelNameStr);
+00037         virtual ~wxIEHtmlWin();
+00038 
+00039         void LoadUrl(const wxString&);
+00040     bool LoadString(wxString html);
+00041     bool LoadStream(istream *strm);
+00042     bool LoadStream(wxInputStream *is);
+00043 
+00044         void SetCharset(wxString charset);
+00045     void SetEditMode(bool seton);
+00046     bool GetEditMode();
+00047     wxString GetStringSelection(bool asHTML = false);
+00048         wxString GetText(bool asHTML = false);
+00049 
+00050         bool GoBack();
+00051         bool GoForward();
+00052         bool GoHome();
+00053         bool GoSearch();
+00054         bool Refresh(wxIEHtmlRefreshLevel level);
+00055         bool Stop();
+00056 
+00057         DECLARE_EVENT_TABLE();
+00058 
+00059 protected:
+00060     void SetupBrowser();
+00061     bool LoadStream(IStreamAdaptorBase *pstrm);
+00062 
+00063         wxAutoOleInterface<IWebBrowser2>                m_webBrowser;
+00064 };
+00065 
+00066 #endif /* _IEHTMLWIN_H_ */
+

Generated on Tue Apr 1 14:51:12 2003 for wxActiveX by + +doxygen1.3-rc3
+ + diff --git a/wxPython/contrib/activex/wxie/doxydoc/iehtmlwin_8h.html b/wxPython/contrib/activex/wxie/doxydoc/iehtmlwin_8h.html new file mode 100644 index 0000000000..7903e1fc42 --- /dev/null +++ b/wxPython/contrib/activex/wxie/doxydoc/iehtmlwin_8h.html @@ -0,0 +1,31 @@ + + +iehtmlwin.h File Reference + + + +
+Main Page   Namespace List   Class Hierarchy   Alphabetical List   Data Structures   File List   Data Fields   Globals  
+

iehtmlwin.h File Reference


Detailed Description

+implements wxIEHtmlWin window class +

+ +

+Definition in file iehtmlwin.h. +

+#include <wx/setup.h>
+#include <wx/wx.h>
+#include <exdisp.h>
+#include <iostream>
+#include "wxactivex.h"
+ +

+Go to the source code of this file. + +
+


Generated on Tue Apr 1 14:51:12 2003 for wxActiveX by + +doxygen1.3-rc3
+ + diff --git a/wxPython/contrib/activex/wxie/doxydoc/index.html b/wxPython/contrib/activex/wxie/doxydoc/index.html new file mode 100644 index 0000000000..2c50a1c1db --- /dev/null +++ b/wxPython/contrib/activex/wxie/doxydoc/index.html @@ -0,0 +1,16 @@ + + +Main Page + + + +
+Main Page   Namespace List   Class Hierarchy   Alphabetical List   Data Structures   File List   Data Fields   Globals  
+

wxActiveX Documentation

+

+


Generated on Tue Apr 1 14:51:12 2003 for wxActiveX by + +doxygen1.3-rc3
+ + diff --git a/wxPython/contrib/activex/wxie/doxydoc/namespaceNS__wxActiveX.html b/wxPython/contrib/activex/wxie/doxydoc/namespaceNS__wxActiveX.html new file mode 100644 index 0000000000..ee053e2245 --- /dev/null +++ b/wxPython/contrib/activex/wxie/doxydoc/namespaceNS__wxActiveX.html @@ -0,0 +1,25 @@ + + +NS_wxActiveX Namespace Reference + + + +
+Main Page   Namespace List   Class Hierarchy   Alphabetical List   Data Structures   File List   Data Fields   Globals  
+

NS_wxActiveX Namespace Reference


Detailed Description

+wxActiveX Namespace for stuff I want to keep out of other tools way. +

+ +

+ + + + + +

Data Structures

struct  less_wxStringI
 STL utilty class. More...

+


Generated on Tue Apr 1 14:51:12 2003 for wxActiveX by + +doxygen1.3-rc3
+ + diff --git a/wxPython/contrib/activex/wxie/doxydoc/namespaces.html b/wxPython/contrib/activex/wxie/doxydoc/namespaces.html new file mode 100644 index 0000000000..50633b5fe9 --- /dev/null +++ b/wxPython/contrib/activex/wxie/doxydoc/namespaces.html @@ -0,0 +1,17 @@ + + +Namespace Index + + + +
+Main Page   Namespace List   Class Hierarchy   Alphabetical List   Data Structures   File List   Data Fields   Globals  
+

wxActiveX Namespace List

Here is a list of all documented namespaces with brief descriptions: + +
NS_wxActiveXWxActiveX Namespace for stuff I want to keep out of other tools way
+
Generated on Tue Apr 1 14:51:12 2003 for wxActiveX by + +doxygen1.3-rc3
+ + diff --git a/wxPython/contrib/activex/wxie/doxydoc/structNS__wxActiveX_1_1less__wxStringI.html b/wxPython/contrib/activex/wxie/doxydoc/structNS__wxActiveX_1_1less__wxStringI.html new file mode 100644 index 0000000000..60329673f0 --- /dev/null +++ b/wxPython/contrib/activex/wxie/doxydoc/structNS__wxActiveX_1_1less__wxStringI.html @@ -0,0 +1,28 @@ + + +NS_wxActiveX::less_wxStringI struct Reference + + + +
+Main Page   Namespace List   Class Hierarchy   Alphabetical List   Data Structures   File List   Data Fields   Globals  
+

NS_wxActiveX::less_wxStringI Struct Reference

#include <wxactivex.h> +

+


Detailed Description

+STL utilty class. +

+specific to wxActiveX, for creating case insenstive maps etc +

+ +

+Definition at line 29 of file wxactivex.h. + +
+


The documentation for this struct was generated from the following file: +
Generated on Tue Apr 1 14:51:12 2003 for wxActiveX by + +doxygen1.3-rc3
+ + diff --git a/wxPython/contrib/activex/wxie/doxydoc/wxactivex_8h-source.html b/wxPython/contrib/activex/wxie/doxydoc/wxactivex_8h-source.html new file mode 100644 index 0000000000..3191ba03b0 --- /dev/null +++ b/wxPython/contrib/activex/wxie/doxydoc/wxactivex_8h-source.html @@ -0,0 +1,477 @@ + + +wxactivex.h Source File + + + +
+Main Page   Namespace List   Class Hierarchy   Alphabetical List   Data Structures   File List   Data Fields   Globals  
+

wxactivex.h

Go to the documentation of this file.
00001 
+00005 #ifndef WX_ACTIVE_X
+00006 #define WX_ACTIVE_X
+00007 #pragma warning( disable : 4101 4786)
+00008 #pragma warning( disable : 4786)
+00009 
+00010 
+00011 #include <wx/setup.h>
+00012 #include <wx/wx.h>
+00013 #include <wx/variant.h>
+00014 #include <wx/datetime.h>
+00015 #include <oleidl.h>
+00016 #include <exdisp.h>
+00017 #include <docobj.h>
+00018 #include <iostream>
+00019 #include <vector>
+00020 #include <map>
+00021 using namespace std;
+00022 
+00024 namespace NS_wxActiveX
+00025 {
+00029         struct less_wxStringI
+00030         {
+00031                 bool operator()(const wxString& x, const wxString& y) const
+00032                 {
+00033                         return x.CmpNoCase(y) < 0;
+00034                 };
+00035         };
+00036 };
+00037 
+00038 
+00045 template <class I> class wxAutoOleInterface
+00046 {
+00047         protected:
+00048     I *m_interface;
+00049 
+00050         public:
+00053     explicit wxAutoOleInterface(I *pInterface = NULL) : m_interface(pInterface) {}
+00054 
+00056     wxAutoOleInterface(REFIID riid, IUnknown *pUnk) : m_interface(NULL)
+00057         {
+00058                 QueryInterface(riid, pUnk);
+00059         };
+00061     wxAutoOleInterface(REFIID riid, IDispatch *pDispatch) : m_interface(NULL)
+00062         {
+00063                 QueryInterface(riid, pDispatch);
+00064         };
+00065 
+00067         wxAutoOleInterface(REFCLSID clsid, REFIID riid) : m_interface(NULL)
+00068         {
+00069                 CreateInstance(clsid, riid);
+00070         };
+00071 
+00073     wxAutoOleInterface(const wxAutoOleInterface<I>& ti) : m_interface(NULL)
+00074     {
+00075                 operator = (ti);
+00076     }
+00077 
+00079     wxAutoOleInterface<I>& operator = (const wxAutoOleInterface<I>& ti)
+00080     {
+00081                 if (ti.m_interface)
+00082                         ti.m_interface->AddRef();
+00083         Free();
+00084         m_interface = ti.m_interface;
+00085         return *this;
+00086     }
+00087 
+00090     wxAutoOleInterface<I>& operator = (I *&ti)
+00091     {
+00092         Free();
+00093         m_interface = ti;
+00094         return *this;
+00095     }
+00096 
+00098     ~wxAutoOleInterface()
+00099     {
+00100         Free();
+00101     };
+00102 
+00103 
+00105     inline void Free()
+00106     {
+00107         if (m_interface)
+00108                 m_interface->Release();
+00109         m_interface = NULL;
+00110     };
+00111 
+00113     HRESULT QueryInterface(REFIID riid, IUnknown *pUnk)
+00114         {
+00115                 Free();
+00116                 wxASSERT(pUnk != NULL);
+00117             return pUnk->QueryInterface(riid, (void **) &m_interface);
+00118         };
+00119 
+00121     HRESULT CreateInstance(REFCLSID clsid, REFIID riid)
+00122     {
+00123                 Free();
+00124             return CoCreateInstance(clsid, NULL, CLSCTX_ALL, riid, (void **) &m_interface);
+00125     };
+00126 
+00127 
+00129     inline operator I *() const {return m_interface;}
+00130 
+00132     inline I* operator ->() {return m_interface;}
+00134         inline I** GetRef()     {return &m_interface;}
+00136         inline bool Ok() const  {return m_interface != NULL;}
+00137 };
+00138 
+00139 
+00142 wxString OLEHResultToString(HRESULT hr);
+00145 wxString GetIIDName(REFIID riid);
+00146 
+00147 //#define __WXOLEDEBUG
+00148 
+00149 
+00150 #ifdef __WXOLEDEBUG
+00151     #define WXOLE_TRACE(str) {OutputDebugString(str);OutputDebugString("\r\n");}
+00152     #define WXOLE_TRACEOUT(stuff)\
+00153     {\
+00154         wxString os;\
+00155         os << stuff << "\r\n";\
+00156         WXOLE_TRACE(os.mb_str());\
+00157     }
+00158 
+00159     #define WXOLE_WARN(__hr,msg)\
+00160     {\
+00161         if (__hr != S_OK)\
+00162         {\
+00163             wxString s = "*** ";\
+00164             s += msg;\
+00165             s += " : "+ OLEHResultToString(__hr);\
+00166             WXOLE_TRACE(s.c_str());\
+00167         }\
+00168     }
+00169 #else
+00170     #define WXOLE_TRACE(str)
+00171     #define WXOLE_TRACEOUT(stuff)
+00172     #define WXOLE_WARN(_proc,msg) {_proc;}
+00173 #endif
+00174 
+00175 class wxOleInit
+00176 {
+00177         public:
+00178     static IMalloc *GetIMalloc();
+00179 
+00180     wxOleInit();
+00181     ~wxOleInit();
+00182 };
+00183 
+00184 #define DECLARE_OLE_UNKNOWN(cls)\
+00185         private:\
+00186     class TAutoInitInt\
+00187     {\
+00188         public:\
+00189         LONG l;\
+00190         TAutoInitInt() : l(0) {}\
+00191     };\
+00192     TAutoInitInt refCount, lockCount;\
+00193     wxOleInit oleInit;\
+00194         static void _GetInterface(cls *self, REFIID iid, void **_interface, const char *&desc);\
+00195     public:\
+00196     LONG GetRefCount();\
+00197         HRESULT STDMETHODCALLTYPE QueryInterface(REFIID iid, void ** ppvObject);\
+00198         ULONG STDMETHODCALLTYPE AddRef();\
+00199         ULONG STDMETHODCALLTYPE Release();\
+00200     ULONG STDMETHODCALLTYPE AddLock();\
+00201         ULONG STDMETHODCALLTYPE ReleaseLock()
+00202 
+00203 #define DEFINE_OLE_TABLE(cls)\
+00204         LONG cls::GetRefCount() {return refCount.l;}\
+00205     HRESULT STDMETHODCALLTYPE cls::QueryInterface(REFIID iid, void ** ppvObject)\
+00206     {\
+00207         if (! ppvObject)\
+00208         {\
+00209             WXOLE_TRACE("*** NULL POINTER ***");\
+00210             return E_FAIL;\
+00211         };\
+00212         const char *desc = NULL;\
+00213         cls::_GetInterface(this, iid, ppvObject, desc);\
+00214         if (! *ppvObject)\
+00215         {\
+00216             WXOLE_TRACEOUT("<" << GetIIDName(iid).c_str() << "> Not Found");\
+00217             return E_NOINTERFACE;\
+00218         };\
+00219         WXOLE_TRACEOUT("QI : <" << desc <<">");\
+00220         ((IUnknown * )(*ppvObject))->AddRef();\
+00221         return S_OK;\
+00222     };\
+00223     ULONG STDMETHODCALLTYPE cls::AddRef()\
+00224     {\
+00225         WXOLE_TRACEOUT(# cls << "::Add ref(" << refCount.l << ")");\
+00226         InterlockedIncrement(&refCount.l);\
+00227         return refCount.l;\
+00228     };\
+00229     ULONG STDMETHODCALLTYPE cls::Release()\
+00230     {\
+00231         if (refCount.l > 0)\
+00232         {\
+00233                 InterlockedDecrement(&refCount.l);\
+00234                 WXOLE_TRACEOUT(# cls << "::Del ref(" << refCount.l << ")");\
+00235             if (refCount.l == 0)\
+00236                 {\
+00237                 delete this;\
+00238                     return 0;\
+00239                 };\
+00240                 return refCount.l;\
+00241         }\
+00242         else\
+00243                 return 0;\
+00244     }\
+00245     ULONG STDMETHODCALLTYPE cls::AddLock()\
+00246     {\
+00247         WXOLE_TRACEOUT(# cls << "::Add Lock(" << lockCount.l << ")");\
+00248         InterlockedIncrement(&lockCount.l);\
+00249         return lockCount.l;\
+00250     };\
+00251     ULONG STDMETHODCALLTYPE cls::ReleaseLock()\
+00252     {\
+00253         if (lockCount.l > 0)\
+00254         {\
+00255                 InterlockedDecrement(&lockCount.l);\
+00256                 WXOLE_TRACEOUT(# cls << "::Del Lock(" << lockCount.l << ")");\
+00257             return lockCount.l;\
+00258         }\
+00259         else\
+00260                 return 0;\
+00261     }\
+00262     DEFINE_OLE_BASE(cls)
+00263 
+00264 #define DEFINE_OLE_BASE(cls)\
+00265         void cls::_GetInterface(cls *self, REFIID iid, void **_interface, const char *&desc)\
+00266         {\
+00267                 *_interface = NULL;\
+00268             desc = NULL;
+00269 
+00270 #define OLE_INTERFACE(_iid, _type)\
+00271     if (IsEqualIID(iid, _iid))\
+00272     {\
+00273         WXOLE_TRACE("Found Interface <" # _type ">");\
+00274         *_interface = (IUnknown *) (_type *) self;\
+00275         desc = # _iid;\
+00276         return;\
+00277     }
+00278 
+00279 #define OLE_IINTERFACE(_face) OLE_INTERFACE(IID_##_face, _face)
+00280 
+00281 #define OLE_INTERFACE_CUSTOM(func)\
+00282     if (func(self, iid, _interface, desc))\
+00283         {\
+00284         return;\
+00285         }
+00286 
+00287 #define END_OLE_TABLE\
+00288         }
+00289 
+00290 
+00328 
+00329 class wxActiveX : public wxWindow {
+00330 public:
+00333         class ParamX 
+00334         {
+00335         public:
+00336                 USHORT      flags;
+00337         bool isPtr, isSafeArray;
+00338                 VARTYPE     vt;
+00339         wxString    name;
+00340 
+00341         ParamX() : vt(VT_EMPTY) {}
+00342                 inline bool IsIn() const                {return (flags & IDLFLAG_FIN) != 0;}
+00343                 inline bool IsOut() const               {return (flags & IDLFLAG_FOUT) != 0;}
+00344                 inline bool IsRetVal() const    {return (flags & IDLFLAG_FRETVAL) != 0;}
+00345         };
+00346         typedef vector<ParamX>  ParamXArray;
+00347 
+00350     class FuncX 
+00351     {
+00352     public:
+00353         wxString    name;
+00354         MEMBERID    memid;
+00355                 bool            hasOut;
+00356 
+00357         ParamX      retType;
+00358                 ParamXArray     params;
+00359     };
+00360 
+00362         class PropX
+00363         {
+00364         public:
+00365                 wxString        name;
+00366         MEMBERID    memid;
+00367         ParamX      type;
+00368         ParamX      arg;
+00369                 bool            putByRef;
+00370 
+00371                 PropX() : putByRef (false) {}
+00372                 inline bool CanGet() const {return type.vt != VT_EMPTY;}
+00373                 inline bool CanSet() const {return arg.vt != VT_EMPTY;}
+00374         };
+00375 
+00377     wxActiveX(wxWindow * parent, REFCLSID clsid, wxWindowID id = -1,
+00378         const wxPoint& pos = wxDefaultPosition,
+00379         const wxSize& size = wxDefaultSize,
+00380         long style = 0,
+00381         const wxString& name = wxPanelNameStr);
+00383     wxActiveX(wxWindow * parent, wxString progId, wxWindowID id = -1,
+00384         const wxPoint& pos = wxDefaultPosition,
+00385         const wxSize& size = wxDefaultSize,
+00386         long style = 0,
+00387         const wxString& name = wxPanelNameStr);
+00388         virtual ~wxActiveX();
+00389 
+00391     inline int GetEventCount() const {return m_events.size();}
+00394     const FuncX& GetEventDesc(int idx) const;
+00395 
+00397     inline int GetPropCount() const {return m_props.size();}
+00400     const PropX& GetPropDesc(int idx) const;
+00403     const PropX& GetPropDesc(wxString name) const;
+00404 
+00406     inline int GetMethodCount() const {return m_methods.size();}
+00409     const FuncX& GetMethodDesc(int idx) const;
+00412     const FuncX& GetMethodDesc(wxString name) const;
+00413 
+00415     void SetProp(MEMBERID name, VARIANTARG& value);
+00417     void SetProp(const wxString &name, const wxVariant &value);
+00418     
+00419     class wxPropertySetter
+00420     {
+00421     public:
+00422         wxActiveX *m_ctl;
+00423         wxString m_propName;
+00424 
+00425         wxPropertySetter(wxActiveX *ctl, wxString propName) : 
+00426             m_ctl(ctl), m_propName(propName) {}
+00427         
+00428         inline const wxPropertySetter& operator = (wxVariant v) const
+00429         {
+00430             m_ctl->SetProp(m_propName, v);
+00431             return *this;
+00432         };
+00433 
+00434         inline operator wxVariant() const   {return m_ctl->GetPropAsWxVariant(m_propName);};
+00435         inline operator wxString() const    {return m_ctl->GetPropAsString(m_propName);};
+00436         inline operator char() const        {return m_ctl->GetPropAsChar(m_propName);};
+00437         inline operator long() const        {return m_ctl->GetPropAsLong(m_propName);};
+00438         inline operator bool() const        {return m_ctl->GetPropAsBool(m_propName);};
+00439         inline operator double() const      {return m_ctl->GetPropAsDouble(m_propName);};
+00440         inline operator wxDateTime() const  {return m_ctl->GetPropAsDateTime(m_propName);};
+00441         inline operator void *() const      {return m_ctl->GetPropAsPointer(m_propName);};
+00442     };
+00443 
+00458     inline wxPropertySetter Prop(wxString name) {return wxPropertySetter(this, name);}
+00459 
+00460     VARIANT GetPropAsVariant(MEMBERID name);
+00461     VARIANT GetPropAsVariant(const wxString& name);
+00462     wxVariant GetPropAsWxVariant(const wxString& name);
+00463     wxString GetPropAsString(const wxString& name);
+00464     char GetPropAsChar(const wxString& name);
+00465     long GetPropAsLong(const wxString& name);
+00466     bool GetPropAsBool(const wxString& name);
+00467     double GetPropAsDouble(const wxString& name);
+00468     wxDateTime GetPropAsDateTime(const wxString& name);
+00469     void *GetPropAsPointer(const wxString& name);
+00470 
+00471     // methods
+00472     // VARIANTARG form is passed straight to Invoke, 
+00473     // so args in *REVERSE* order
+00474     VARIANT CallMethod(MEMBERID name, VARIANTARG args[], int argc);
+00475     VARIANT CallMethod(wxString name, VARIANTARG args[] = NULL, int argc = -1);
+00476     // args are in *NORMAL* order
+00477     // args can be a single wxVariant or an array
+00493     wxVariant CallMethod(wxString name, wxVariant args[], int nargs = -1);
+00494 
+00495         HRESULT ConnectAdvise(REFIID riid, IUnknown *eventSink);
+00496 
+00497         void OnSize(wxSizeEvent&);
+00498     void OnPaint(wxPaintEvent& event);
+00499     void OnMouse(wxMouseEvent& event);
+00500         void OnSetFocus(wxFocusEvent&);
+00501     void OnKillFocus(wxFocusEvent&);
+00502 
+00503         DECLARE_EVENT_TABLE();
+00504 
+00505 protected:
+00506     friend class FrameSite;
+00507     friend class wxActiveXEvents;
+00508 
+00509         typedef map<MEMBERID, FuncX>    FuncXMap;
+00510     typedef map<wxString, FuncX, NS_wxActiveX::less_wxStringI>  FuncXStringMap;
+00511         typedef map<wxString, PropX, NS_wxActiveX::less_wxStringI> PropXMap;
+00512         typedef wxAutoOleInterface<IConnectionPoint>    wxOleConnectionPoint;
+00513         typedef pair<wxOleConnectionPoint, DWORD>               wxOleConnection;
+00514         typedef vector<wxOleConnection>                                 wxOleConnectionArray;
+00515 
+00516         wxAutoOleInterface<IDispatch>                   m_Dispatch;
+00517     wxAutoOleInterface<IOleClientSite>      m_clientSite;
+00518     wxAutoOleInterface<IUnknown>            m_ActiveX;
+00519         wxAutoOleInterface<IOleObject>                  m_oleObject;
+00520         wxAutoOleInterface<IOleInPlaceObject>   m_oleInPlaceObject;
+00521     wxAutoOleInterface<IOleInPlaceActiveObject>
+00522 
+00523                                             m_oleInPlaceActiveObject;
+00524     wxAutoOleInterface<IOleDocumentView>        m_docView;
+00525     wxAutoOleInterface<IViewObject>             m_viewObject;
+00526         HWND m_oleObjectHWND;
+00527     bool m_bAmbientUserMode;
+00528     DWORD m_docAdviseCookie;
+00529         wxOleConnectionArray                                    m_connections;
+00530 
+00531         void CreateActiveX(REFCLSID clsid);
+00532     void CreateActiveX(LPOLESTR progId);
+00533     HRESULT AmbientPropertyChanged(DISPID dispid);
+00534 
+00535         void GetTypeInfo();
+00536         void GetTypeInfo(ITypeInfo *ti, bool defInterface, bool defEventSink);
+00537 
+00538 
+00539     // events
+00540     FuncXMap            m_events;
+00541 
+00542         // properties
+00543         PropXMap                m_props;
+00544 
+00545     // Methods
+00546     FuncXStringMap  m_methods;
+00547 
+00548     long MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam);
+00549 };
+00550 
+00551 // events
+00552 class wxActiveXEvent : public wxCommandEvent
+00553 {
+00554 private:
+00555     friend class wxActiveXEvents;
+00556 
+00557     wxVariant m_params;
+00558 
+00559 public:
+00560 
+00561     virtual wxEvent *Clone() const { return new wxActiveXEvent(*this); }
+00562 
+00563     wxString EventName();
+00564     int ParamCount() const;
+00565     wxString ParamType(int idx);
+00566     wxString ParamName(int idx);
+00567     wxVariant& operator[] (int idx);
+00568     wxVariant& operator[] (wxString name);
+00569 };
+00570 
+00571 const wxEventType& RegisterActiveXEvent(const wxChar *eventName);
+00572 const wxEventType& RegisterActiveXEvent(DISPID event);
+00573 
+00574 typedef void (wxEvtHandler::*wxActiveXEventFunction)(wxActiveXEvent&);
+00575 
+00578 #define EVT_ACTIVEX(id, eventName, fn) DECLARE_EVENT_TABLE_ENTRY(RegisterActiveXEvent(wxT(eventName)), id, -1, (wxObjectEventFunction) (wxEventFunction) (wxActiveXEventFunction) & fn, (wxObject *) NULL ),
+00581 #define EVT_ACTIVEX_DISPID(id, eventDispId, fn) DECLARE_EVENT_TABLE_ENTRY(RegisterActiveXEvent(eventDispId), id, -1, (wxObjectEventFunction) (wxEventFunction) (wxActiveXEventFunction) & fn, (wxObject *) NULL ),
+00582 
+00583 //util
+00584 bool wxDateTimeToVariant(wxDateTime dt, VARIANTARG& va);
+00585 bool VariantToWxDateTime(VARIANTARG va, wxDateTime& dt);
+00596 bool MSWVariantToVariant(VARIANTARG& va, wxVariant& vx);
+00607 bool VariantToMSWVariant(const wxVariant& vx, VARIANTARG& va);
+00608 
+00609 #endif /* _IEHTMLWIN_H_ */
+

Generated on Tue Apr 1 14:51:12 2003 for wxActiveX by + +doxygen1.3-rc3
+ + diff --git a/wxPython/contrib/activex/wxie/doxydoc/wxactivex_8h.html b/wxPython/contrib/activex/wxie/doxydoc/wxactivex_8h.html new file mode 100644 index 0000000000..ea2f98918f --- /dev/null +++ b/wxPython/contrib/activex/wxie/doxydoc/wxactivex_8h.html @@ -0,0 +1,216 @@ + + +wxactivex.h File Reference + + + +
+Main Page   Namespace List   Class Hierarchy   Alphabetical List   Data Structures   File List   Data Fields   Globals  
+

wxactivex.h File Reference


Detailed Description

+implements wxActiveX window class and OLE tools +

+ +

+Definition in file wxactivex.h. +

+#include <wx/setup.h>
+#include <wx/wx.h>
+#include <wx/variant.h>
+#include <wx/datetime.h>
+#include <oleidl.h>
+#include <exdisp.h>
+#include <docobj.h>
+#include <iostream>
+#include <vector>
+#include <map>
+ +

+Go to the source code of this file. + + + + + + + + + + + + + + + + + + + + + + + + + +

Namespaces

namespace  NS_wxActiveX
namespace  std

Data Structures

class  wxAutoOleInterface
 Template class for smart interface handling. More...

class  wxActiveX
 Main class for embedding a ActiveX control. More...

class  ParamX
 General parameter and return type infoformation for Events, Properties and Methods. More...

class  FuncX
 Type & Parameter info for Events and Methods. More...

class  PropX
 Type info for properties. More...


Defines

+#define EVT_ACTIVEX(id, eventName, fn)   DECLARE_EVENT_TABLE_ENTRY(RegisterActiveXEvent(wxT(eventName)), id, -1, (wxObjectEventFunction) (wxEventFunction) (wxActiveXEventFunction) & fn, (wxObject *) NULL ),
 Event handle for events by name.

+#define EVT_ACTIVEX_DISPID(id, eventDispId, fn)   DECLARE_EVENT_TABLE_ENTRY(RegisterActiveXEvent(eventDispId), id, -1, (wxObjectEventFunction) (wxEventFunction) (wxActiveXEventFunction) & fn, (wxObject *) NULL ),
 Event handle for events by DISPID (dispath id).


Functions

+wxString OLEHResultToString (HRESULT hr)
 Converts a std HRESULT to its error code. Hardcoded, by no means a definitive list.

+wxString GetIIDName (REFIID riid)
 Returns the string description of a IID. Hardcoded, by no means a definitive list.

+


Define Documentation

+

+ + + + +
+ + + + + + + +
#define DECLARE_OLE_UNKNOWNcls   +
+
+ + + + + +
+   + + +

+Value:

private:\
+    class TAutoInitInt\
+    {\
+        public:\
+        LONG l;\
+        TAutoInitInt() : l(0) {}\
+    };\
+    TAutoInitInt refCount, lockCount;\
+    wxOleInit oleInit;\
+        static void _GetInterface(cls *self, REFIID iid, void **_interface, const char *&desc);\
+    public:\
+    LONG GetRefCount();\
+        HRESULT STDMETHODCALLTYPE QueryInterface(REFIID iid, void ** ppvObject);\
+        ULONG STDMETHODCALLTYPE AddRef();\
+        ULONG STDMETHODCALLTYPE Release();\
+    ULONG STDMETHODCALLTYPE AddLock();\
+        ULONG STDMETHODCALLTYPE ReleaseLock()
+
+

+Definition at line 184 of file wxactivex.h.

+

+ + + + +
+ + + + + + + +
#define DEFINE_OLE_BASEcls   +
+
+ + + + + +
+   + + +

+Value:

void cls::_GetInterface(cls *self, REFIID iid, void **_interface, const char *&desc)\
+        {\
+                *_interface = NULL;\
+            desc = NULL;
+
+

+Definition at line 264 of file wxactivex.h.

+

+ + + + +
+ + + + + + + + + + +
#define OLE_INTERFACE_iid,
_type   +
+
+ + + + + +
+   + + +

+Value:

if (IsEqualIID(iid, _iid))\
+    {\
+        WXOLE_TRACE("Found Interface <" # _type ">");\
+        *_interface = (IUnknown *) (_type *) self;\
+        desc = # _iid;\
+        return;\
+    }
+
+

+Definition at line 270 of file wxactivex.h.

+

+ + + + +
+ + + + + + + +
#define OLE_INTERFACE_CUSTOMfunc   +
+
+ + + + + +
+   + + +

+Value:

if (func(self, iid, _interface, desc))\
+        {\
+        return;\
+        }
+
+

+Definition at line 281 of file wxactivex.h.

+


Generated on Tue Apr 1 14:51:12 2003 for wxActiveX by + +doxygen1.3-rc3
+ + diff --git a/wxPython/contrib/activex/wxie/latex/Makefile b/wxPython/contrib/activex/wxie/latex/Makefile new file mode 100644 index 0000000000..a4079415c8 --- /dev/null +++ b/wxPython/contrib/activex/wxie/latex/Makefile @@ -0,0 +1,39 @@ +all: refman.dvi + +ps: refman.ps + +pdf: refman.pdf + +ps_2on1: refman_2on1.ps + +pdf_2on1: refman_2on1.pdf + +refman.ps: refman.dvi + dvips -o refman.ps refman.dvi + +refman.pdf: refman.ps + gswin32c -q -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile=refman.pdf -c save pop -f refman.ps + +refman.dvi: refman.tex doxygen.sty + echo "Running latex..." + latex refman.tex + echo "Running makeindex..." + makeindex refman.idx + echo "Rerunning latex...." + latex refman.tex + latex_count=5 ; \ + while egrep -s 'Rerun (LaTeX|to get cross-references right)' refman.log && [ $$latex_count -gt 0 ] ;\ + do \ + echo "Rerunning latex...." ;\ + latex refman.tex ;\ + latex_count=`expr $$latex_count - 1` ;\ + done + +refman_2on1.ps: refman.ps + psnup -2 refman.ps >refman_2on1.ps + +refman_2on1.pdf: refman_2on1.ps + gswin32c -q -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile=refman_2on1.pdf -c save pop -f refman_2on1.ps + +clean: + rm -f *.ps *.dvi *.aux *.toc *.idx *.ind *.ilg *.log *.out diff --git a/wxPython/contrib/activex/wxie/latex/annotated.tex b/wxPython/contrib/activex/wxie/latex/annotated.tex new file mode 100644 index 0000000000..5e92881456 --- /dev/null +++ b/wxPython/contrib/activex/wxie/latex/annotated.tex @@ -0,0 +1,9 @@ +\section{wx\-Active\-X Data Structures} +Here are the data structures with brief descriptions:\begin{CompactList} +\item\contentsline{section}{{\bf NS\_\-wx\-Active\-X::less\_\-wx\-String\-I} (STL utilty class)}{\pageref{structNS__wxActiveX_1_1less__wxStringI}}{} +\item\contentsline{section}{{\bf wx\-Active\-X} (Main class for embedding a Active\-X control)}{\pageref{classwxActiveX}}{} +\item\contentsline{section}{{\bf wx\-Active\-X::Func\-X} (Type \& Parameter info for Events and Methods)}{\pageref{classwxActiveX_1_1FuncX}}{} +\item\contentsline{section}{{\bf wx\-Active\-X::Param\-X} (General parameter and return type infoformation for Events, Properties and Methods)}{\pageref{classwxActiveX_1_1ParamX}}{} +\item\contentsline{section}{{\bf wx\-Active\-X::Prop\-X} (Type info for properties)}{\pageref{classwxActiveX_1_1PropX}}{} +\item\contentsline{section}{{\bf wx\-Auto\-Ole\-Interface$<$ I $>$} (Template class for smart interface handling)}{\pageref{classwxAutoOleInterface}}{} +\end{CompactList} diff --git a/wxPython/contrib/activex/wxie/latex/classwxActiveX.tex b/wxPython/contrib/activex/wxie/latex/classwxActiveX.tex new file mode 100644 index 0000000000..72b2086511 --- /dev/null +++ b/wxPython/contrib/activex/wxie/latex/classwxActiveX.tex @@ -0,0 +1,285 @@ +\section{wx\-Active\-X Class Reference} +\label{classwxActiveX}\index{wxActiveX@{wxActiveX}} +{\tt \#include $<$wxactivex.h$>$} + + + +\subsection{Detailed Description} +Main class for embedding a Active\-X control. + +Use by itself or derive from it \begin{Desc} +\item[Note:]The utility program (wxie) can generate a list of events, methods \& properties for a control. First display the control (File$|$Display), then get the type info (Active\-X$|$Get Type Info) - these are copied to the clipboard. Eventually this will be expanded to autogenerate wx\-Windows source files for a control with all methods etc encapsulated. \end{Desc} +\begin{Desc} +\item[Usage: ]construct using a Prog\-Id or class id + +\footnotesize\begin{verbatim} new wxActiveX(parent, CLSID_WebBrowser, id, pos, size, style, name) +\end{verbatim}\normalsize + + +\footnotesize\begin{verbatim} new wxActiveX(parent, "ShockwaveFlash.ShockwaveFlash", id, pos, size, style, name) +\end{verbatim}\normalsize +\end{Desc} +\begin{Desc} +\item[Properties]Properties can be set using {\tt {\bf Set\-Prop()}} and set/retrieved using {\tt {\bf Prop()}} + +\footnotesize\begin{verbatim} SetProp(name, wxVariant(x)) +\end{verbatim}\normalsize +or + +\footnotesize\begin{verbatim} wxString Prop("") = x +\end{verbatim}\normalsize + + +\footnotesize\begin{verbatim} wxString result = Prop("") +\end{verbatim}\normalsize + + +\footnotesize\begin{verbatim} flash_ctl.Prop("movie") = "file:///movies/test.swf"; +\end{verbatim}\normalsize + + +\footnotesize\begin{verbatim} flash_ctl.Prop("Playing") = false; +\end{verbatim}\normalsize + + +\footnotesize\begin{verbatim} wxString current_movie = flash_ctl.Prop("movie"); +\end{verbatim}\normalsize +\end{Desc} +\begin{Desc} +\item[Methods]Methods are invoked with {\tt {\bf Call\-Method()}} + +\footnotesize\begin{verbatim} wxVariant result = CallMethod("", args, nargs = -1) +\end{verbatim}\normalsize + + +\footnotesize\begin{verbatim} wxVariant args[] = {0L, "file:///e:/dev/wxie/bug-zap.swf"}; + wxVariant result = X->CallMethod("LoadMovie", args); +\end{verbatim}\normalsize +\end{Desc} +\begin{Desc} +\item[events]respond to events with the {\tt {\bf EVT\_\-ACTIVEX(control\-Id, event\-Name, handler)}} \& {\tt {\bf EVT\_\-ACTIVEX\_\-DISPID(control\-Id, event\-Disp\-Id, handler)}} macros + +\footnotesize\begin{verbatim} + BEGIN_EVENT_TABLE(wxIEFrame, wxFrame) + EVT_ACTIVEX_DISPID(ID_MSHTML, DISPID_STATUSTEXTCHANGE, OnMSHTMLStatusTextChangeX) + EVT_ACTIVEX(ID_MSHTML, "BeforeNavigate2", OnMSHTMLBeforeNavigate2X) + EVT_ACTIVEX(ID_MSHTML, "TitleChange", OnMSHTMLTitleChangeX) + EVT_ACTIVEX(ID_MSHTML, "NewWindow2", OnMSHTMLNewWindow2X) + EVT_ACTIVEX(ID_MSHTML, "ProgressChange", OnMSHTMLProgressChangeX) + END_EVENT_TABLE() +\end{verbatim}\normalsize +\end{Desc} + + + + +Definition at line 329 of file wxactivex.h.\subsection*{Public Member Functions} +\begin{CompactItemize} +\item +\index{wxActiveX@{wxActiveX}!wxActiveX@{wxActiveX}}\index{wxActiveX@{wxActiveX}!wxActiveX@{wxActiveX}} +{\bf wx\-Active\-X} (wx\-Window $\ast$parent, REFCLSID clsid, wx\-Window\-ID id=-1, const wx\-Point \&pos=wx\-Default\-Position, const wx\-Size \&size=wx\-Default\-Size, long style=0, const wx\-String \&name=wx\-Panel\-Name\-Str)\label{classwxActiveX_a0} + +\begin{CompactList}\small\item\em Create using clsid.\item\end{CompactList}\item +\index{wxActiveX@{wxActiveX}!wxActiveX@{wxActiveX}}\index{wxActiveX@{wxActiveX}!wxActiveX@{wxActiveX}} +{\bf wx\-Active\-X} (wx\-Window $\ast$parent, wx\-String prog\-Id, wx\-Window\-ID id=-1, const wx\-Point \&pos=wx\-Default\-Position, const wx\-Size \&size=wx\-Default\-Size, long style=0, const wx\-String \&name=wx\-Panel\-Name\-Str)\label{classwxActiveX_a1} + +\begin{CompactList}\small\item\em create using progid.\item\end{CompactList}\item +\index{GetEventCount@{GetEventCount}!wxActiveX@{wxActiveX}}\index{wxActiveX@{wxActiveX}!GetEventCount@{GetEventCount}} +int {\bf Get\-Event\-Count} () const\label{classwxActiveX_a3} + +\begin{CompactList}\small\item\em Number of events defined for this control.\item\end{CompactList}\item +const {\bf Func\-X} \& {\bf Get\-Event\-Desc} (int idx) const +\begin{CompactList}\small\item\em returns event description by index.\item\end{CompactList}\item +\index{GetPropCount@{GetPropCount}!wxActiveX@{wxActiveX}}\index{wxActiveX@{wxActiveX}!GetPropCount@{GetPropCount}} +int {\bf Get\-Prop\-Count} () const\label{classwxActiveX_a5} + +\begin{CompactList}\small\item\em Number of properties defined for this control.\item\end{CompactList}\item +const {\bf Prop\-X} \& {\bf Get\-Prop\-Desc} (int idx) const +\begin{CompactList}\small\item\em returns property description by index.\item\end{CompactList}\item +const {\bf Prop\-X} \& {\bf Get\-Prop\-Desc} (wx\-String name) const +\begin{CompactList}\small\item\em returns property description by name.\item\end{CompactList}\item +\index{GetMethodCount@{GetMethodCount}!wxActiveX@{wxActiveX}}\index{wxActiveX@{wxActiveX}!GetMethodCount@{GetMethodCount}} +int {\bf Get\-Method\-Count} () const\label{classwxActiveX_a8} + +\begin{CompactList}\small\item\em Number of methods defined for this control.\item\end{CompactList}\item +const {\bf Func\-X} \& {\bf Get\-Method\-Desc} (int idx) const +\begin{CompactList}\small\item\em returns method description by name.\item\end{CompactList}\item +const {\bf Func\-X} \& {\bf Get\-Method\-Desc} (wx\-String name) const +\begin{CompactList}\small\item\em returns method description by name.\item\end{CompactList}\item +\index{SetProp@{SetProp}!wxActiveX@{wxActiveX}}\index{wxActiveX@{wxActiveX}!SetProp@{SetProp}} +void {\bf Set\-Prop} (MEMBERID name, VARIANTARG \&value)\label{classwxActiveX_a11} + +\begin{CompactList}\small\item\em Set property VARIANTARG value by MEMBERID.\item\end{CompactList}\item +\index{SetProp@{SetProp}!wxActiveX@{wxActiveX}}\index{wxActiveX@{wxActiveX}!SetProp@{SetProp}} +void {\bf Set\-Prop} (const wx\-String \&name, const wx\-Variant \&value)\label{classwxActiveX_a12} + +\begin{CompactList}\small\item\em Set property using wx\-Variant by name.\item\end{CompactList}\item +wx\-Property\-Setter {\bf Prop} (wx\-String name) +\begin{CompactList}\small\item\em Generic Get/Set Property by name. Automatically handles most types.\item\end{CompactList}\item +wx\-Variant {\bf Call\-Method} (wx\-String name, wx\-Variant args[$\,$], int nargs=-1) +\begin{CompactList}\small\item\em Call a method of the Active\-X control. Automatically handles most types.\item\end{CompactList}\end{CompactItemize} +\subsection*{Related Functions} +(Note that these are not member functions.)\begin{CompactItemize} +\item +bool {\bf MSWVariant\-To\-Variant} (VARIANTARG \&va, wx\-Variant \&vx) +\begin{CompactList}\small\item\em Convert MSW VARIANTARG to wx\-Variant. Handles basic types, need to add:\begin{itemize} +\item VT\_\-ARRAY $|$ VT\_\-$\ast$\item better support for VT\_\-UNKNOWN (currently treated as void $\ast$)\item better support for VT\_\-DISPATCH (currently treated as void $\ast$).\end{itemize} +\item\end{CompactList}\item +bool {\bf Variant\-To\-MSWVariant} (const wx\-Variant \&vx, VARIANTARG \&va) +\begin{CompactList}\small\item\em Convert wx\-Variant to MSW VARIANTARG. Handles basic types, need to add:\begin{itemize} +\item VT\_\-ARRAY $|$ VT\_\-$\ast$\item better support for VT\_\-UNKNOWN (currently treated as void $\ast$)\item better support for VT\_\-DISPATCH (currently treated as void $\ast$).\end{itemize} +\item\end{CompactList}\end{CompactItemize} + + +\subsection{Member Function Documentation} +\index{wxActiveX@{wx\-Active\-X}!GetEventDesc@{GetEventDesc}} +\index{GetEventDesc@{GetEventDesc}!wxActiveX@{wx\-Active\-X}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}const {\bf Func\-X}\& wx\-Active\-X::Get\-Event\-Desc (int {\em idx}) const}\label{classwxActiveX_a4} + + +returns event description by index. + +throws exception for invalid index \index{wxActiveX@{wx\-Active\-X}!GetPropDesc@{GetPropDesc}} +\index{GetPropDesc@{GetPropDesc}!wxActiveX@{wx\-Active\-X}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}const {\bf Prop\-X}\& wx\-Active\-X::Get\-Prop\-Desc (int {\em idx}) const}\label{classwxActiveX_a6} + + +returns property description by index. + +throws exception for invalid index \index{wxActiveX@{wx\-Active\-X}!GetPropDesc@{GetPropDesc}} +\index{GetPropDesc@{GetPropDesc}!wxActiveX@{wx\-Active\-X}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}const {\bf Prop\-X}\& wx\-Active\-X::Get\-Prop\-Desc (wx\-String {\em name}) const}\label{classwxActiveX_a7} + + +returns property description by name. + +throws exception for invalid name \index{wxActiveX@{wx\-Active\-X}!GetMethodDesc@{GetMethodDesc}} +\index{GetMethodDesc@{GetMethodDesc}!wxActiveX@{wx\-Active\-X}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}const {\bf Func\-X}\& wx\-Active\-X::Get\-Method\-Desc (int {\em idx}) const}\label{classwxActiveX_a9} + + +returns method description by name. + +throws exception for invalid index \index{wxActiveX@{wx\-Active\-X}!GetMethodDesc@{GetMethodDesc}} +\index{GetMethodDesc@{GetMethodDesc}!wxActiveX@{wx\-Active\-X}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}const {\bf Func\-X}\& wx\-Active\-X::Get\-Method\-Desc (wx\-String {\em name}) const}\label{classwxActiveX_a10} + + +returns method description by name. + +throws exception for invalid name \index{wxActiveX@{wx\-Active\-X}!Prop@{Prop}} +\index{Prop@{Prop}!wxActiveX@{wx\-Active\-X}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}wx\-Property\-Setter wx\-Active\-X::Prop (wx\-String {\em name})\hspace{0.3cm}{\tt [inline]}}\label{classwxActiveX_a13} + + +Generic Get/Set Property by name. Automatically handles most types. + +\begin{Desc} +\item[Parameters:] +\begin{description} +\item[{\em name}]Property name to read/set \end{description} +\end{Desc} +\begin{Desc} +\item[Returns:]wx\-Property\-Setter, which has overloads for setting/getting the property \end{Desc} + + +\begin{Desc} +\item[Usage:]\begin{itemize} +\item Prop(\char`\"{}$<$name$>$\char`\"{}) = $<$value$>$\item var = Prop(\char`\"{}$<$name$>$\char`\"{})\item e.g:\begin{itemize} +\item + +\footnotesize\begin{verbatim} flash_ctl.Prop("movie") = "file:///movies/test.swf"; +\end{verbatim}\normalsize +\item + +\footnotesize\begin{verbatim} flash_ctl.Prop("Playing") = false; +\end{verbatim}\normalsize +\item + +\footnotesize\begin{verbatim} wxString current_movie = flash_ctl.Prop("movie"); +\end{verbatim}\normalsize +\end{itemize} +\end{itemize} +\end{Desc} +\begin{Desc} +\item[Exceptions:] +\begin{description} +\item[{\em raises}]exception if $<$name$>$ is invalid \end{description} +\end{Desc} +\begin{Desc} +\item[Note:]Have to add a few more type conversions yet ... \end{Desc} + + +Definition at line 458 of file wxactivex.h.\index{wxActiveX@{wx\-Active\-X}!CallMethod@{CallMethod}} +\index{CallMethod@{CallMethod}!wxActiveX@{wx\-Active\-X}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}wx\-Variant wx\-Active\-X::Call\-Method (wx\-String {\em name}, wx\-Variant {\em args}[$\,$], int {\em nargs} = -1)}\label{classwxActiveX_a26} + + +Call a method of the Active\-X control. Automatically handles most types. + +\begin{Desc} +\item[Parameters:] +\begin{description} +\item[{\em name}]name of method to call \item[{\em args}]array of wx\-Variant's, defaults to NULL (no args) \item[{\em nargs}]number of arguments passed via args. Defaults to actual number of args for the method \end{description} +\end{Desc} +\begin{Desc} +\item[Returns:]wx\-Variant \end{Desc} + + +\begin{Desc} +\item[Usage:]\begin{itemize} +\item result = Call\-Method(\char`\"{}$<$name$>$\char`\"{}, args, nargs)\item e.g.\item + +\footnotesize\begin{verbatim} + wxVariant args[] = {0L, "file:///e:/dev/wxie/bug-zap.swf"}; + wxVariant result = X->CallMethod("LoadMovie", args); +\end{verbatim}\normalsize +\end{itemize} +\end{Desc} +\begin{Desc} +\item[Exceptions:] +\begin{description} +\item[{\em raises}]exception if $<$name$>$ is invalid \end{description} +\end{Desc} +\begin{Desc} +\item[Note:]Since wx\-Variant has built in type conversion, most the std types can be passed easily \end{Desc} + + +\subsection{Friends And Related Function Documentation} +\index{wxActiveX@{wx\-Active\-X}!MSWVariantToVariant@{MSWVariantToVariant}} +\index{MSWVariantToVariant@{MSWVariantToVariant}!wxActiveX@{wx\-Active\-X}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool MSWVariant\-To\-Variant (VARIANTARG \& {\em va}, wx\-Variant \& {\em vx})\hspace{0.3cm}{\tt [related]}}\label{classwxActiveX_k0} + + +Convert MSW VARIANTARG to wx\-Variant. Handles basic types, need to add:\begin{itemize} +\item VT\_\-ARRAY $|$ VT\_\-$\ast$\item better support for VT\_\-UNKNOWN (currently treated as void $\ast$)\item better support for VT\_\-DISPATCH (currently treated as void $\ast$).\end{itemize} + + +\begin{Desc} +\item[Parameters:] +\begin{description} +\item[{\em va}]VARAIANTARG to convert from \item[{\em vx}]Destination wx\-Variant \end{description} +\end{Desc} +\begin{Desc} +\item[Returns:]success/failure (true/false) \end{Desc} +\index{wxActiveX@{wx\-Active\-X}!VariantToMSWVariant@{VariantToMSWVariant}} +\index{VariantToMSWVariant@{VariantToMSWVariant}!wxActiveX@{wx\-Active\-X}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool Variant\-To\-MSWVariant (const wx\-Variant \& {\em vx}, VARIANTARG \& {\em va})\hspace{0.3cm}{\tt [related]}}\label{classwxActiveX_k1} + + +Convert wx\-Variant to MSW VARIANTARG. Handles basic types, need to add:\begin{itemize} +\item VT\_\-ARRAY $|$ VT\_\-$\ast$\item better support for VT\_\-UNKNOWN (currently treated as void $\ast$)\item better support for VT\_\-DISPATCH (currently treated as void $\ast$).\end{itemize} + + +\begin{Desc} +\item[Parameters:] +\begin{description} +\item[{\em vx}]wx\-Variant to convert from \item[{\em va}]Destination VARIANTARG \end{description} +\end{Desc} +\begin{Desc} +\item[Returns:]success/failure (true/false) \end{Desc} + + +The documentation for this class was generated from the following file:\begin{CompactItemize} +\item +{\bf wxactivex.h}\end{CompactItemize} diff --git a/wxPython/contrib/activex/wxie/latex/classwxActiveX_1_1FuncX.tex b/wxPython/contrib/activex/wxie/latex/classwxActiveX_1_1FuncX.tex new file mode 100644 index 0000000000..6f0731c763 --- /dev/null +++ b/wxPython/contrib/activex/wxie/latex/classwxActiveX_1_1FuncX.tex @@ -0,0 +1,18 @@ +\section{wx\-Active\-X::Func\-X Class Reference} +\label{classwxActiveX_1_1FuncX}\index{wxActiveX::FuncX@{wxActiveX::FuncX}} +{\tt \#include $<$wxactivex.h$>$} + + + +\subsection{Detailed Description} +Type \& Parameter info for Events and Methods. + +refer to FUNCDESC in MSDN + + + +Definition at line 350 of file wxactivex.h. + +The documentation for this class was generated from the following file:\begin{CompactItemize} +\item +{\bf wxactivex.h}\end{CompactItemize} diff --git a/wxPython/contrib/activex/wxie/latex/classwxActiveX_1_1ParamX.tex b/wxPython/contrib/activex/wxie/latex/classwxActiveX_1_1ParamX.tex new file mode 100644 index 0000000000..e40b614c2f --- /dev/null +++ b/wxPython/contrib/activex/wxie/latex/classwxActiveX_1_1ParamX.tex @@ -0,0 +1,18 @@ +\section{wx\-Active\-X::Param\-X Class Reference} +\label{classwxActiveX_1_1ParamX}\index{wxActiveX::ParamX@{wxActiveX::ParamX}} +{\tt \#include $<$wxactivex.h$>$} + + + +\subsection{Detailed Description} +General parameter and return type infoformation for Events, Properties and Methods. + +refer to ELEMDESC, IDLDESC in MSDN + + + +Definition at line 333 of file wxactivex.h. + +The documentation for this class was generated from the following file:\begin{CompactItemize} +\item +{\bf wxactivex.h}\end{CompactItemize} diff --git a/wxPython/contrib/activex/wxie/latex/classwxActiveX_1_1PropX.tex b/wxPython/contrib/activex/wxie/latex/classwxActiveX_1_1PropX.tex new file mode 100644 index 0000000000..ee9e71473f --- /dev/null +++ b/wxPython/contrib/activex/wxie/latex/classwxActiveX_1_1PropX.tex @@ -0,0 +1,16 @@ +\section{wx\-Active\-X::Prop\-X Class Reference} +\label{classwxActiveX_1_1PropX}\index{wxActiveX::PropX@{wxActiveX::PropX}} +{\tt \#include $<$wxactivex.h$>$} + + + +\subsection{Detailed Description} +Type info for properties. + + + +Definition at line 362 of file wxactivex.h. + +The documentation for this class was generated from the following file:\begin{CompactItemize} +\item +{\bf wxactivex.h}\end{CompactItemize} diff --git a/wxPython/contrib/activex/wxie/latex/classwxAutoOleInterface.tex b/wxPython/contrib/activex/wxie/latex/classwxAutoOleInterface.tex new file mode 100644 index 0000000000..ca96bbfa68 --- /dev/null +++ b/wxPython/contrib/activex/wxie/latex/classwxAutoOleInterface.tex @@ -0,0 +1,85 @@ +\section{wx\-Auto\-Ole\-Interface$<$ I $>$ Class Template Reference} +\label{classwxAutoOleInterface}\index{wxAutoOleInterface@{wxAutoOleInterface}} +{\tt \#include $<$wxactivex.h$>$} + + + +\subsection{Detailed Description} +\subsubsection*{template$<$class I$>$ class wx\-Auto\-Ole\-Interface$<$ I $>$} + +Template class for smart interface handling. + +\begin{itemize} +\item Automatically dereferences ole interfaces\item Smart Copy Semantics\item Can Create Interfaces\item Can query for other interfaces \end{itemize} + + + + +Definition at line 45 of file wxactivex.h.\subsection*{Public Member Functions} +\begin{CompactItemize} +\item +\index{wxAutoOleInterface@{wxAutoOleInterface}!wxAutoOleInterface@{wxAutoOleInterface}}\index{wxAutoOleInterface@{wxAutoOleInterface}!wxAutoOleInterface@{wxAutoOleInterface}} +{\bf wx\-Auto\-Ole\-Interface} (I $\ast$p\-Interface=NULL)\label{classwxAutoOleInterface_a0} + +\begin{CompactList}\small\item\em takes ownership of an existing interface Assumed to already have a Add\-Ref() applied\item\end{CompactList}\item +\index{wxAutoOleInterface@{wxAutoOleInterface}!wxAutoOleInterface@{wxAutoOleInterface}}\index{wxAutoOleInterface@{wxAutoOleInterface}!wxAutoOleInterface@{wxAutoOleInterface}} +{\bf wx\-Auto\-Ole\-Interface} (REFIID riid, IUnknown $\ast$p\-Unk)\label{classwxAutoOleInterface_a1} + +\begin{CompactList}\small\item\em queries for an interface\item\end{CompactList}\item +\index{wxAutoOleInterface@{wxAutoOleInterface}!wxAutoOleInterface@{wxAutoOleInterface}}\index{wxAutoOleInterface@{wxAutoOleInterface}!wxAutoOleInterface@{wxAutoOleInterface}} +{\bf wx\-Auto\-Ole\-Interface} (REFIID riid, IDispatch $\ast$p\-Dispatch)\label{classwxAutoOleInterface_a2} + +\begin{CompactList}\small\item\em queries for an interface\item\end{CompactList}\item +\index{wxAutoOleInterface@{wxAutoOleInterface}!wxAutoOleInterface@{wxAutoOleInterface}}\index{wxAutoOleInterface@{wxAutoOleInterface}!wxAutoOleInterface@{wxAutoOleInterface}} +{\bf wx\-Auto\-Ole\-Interface} (REFCLSID clsid, REFIID riid)\label{classwxAutoOleInterface_a3} + +\begin{CompactList}\small\item\em Creates an Interface.\item\end{CompactList}\item +\index{wxAutoOleInterface@{wxAutoOleInterface}!wxAutoOleInterface@{wxAutoOleInterface}}\index{wxAutoOleInterface@{wxAutoOleInterface}!wxAutoOleInterface@{wxAutoOleInterface}} +{\bf wx\-Auto\-Ole\-Interface} (const wx\-Auto\-Ole\-Interface$<$ I $>$ \&ti)\label{classwxAutoOleInterface_a4} + +\begin{CompactList}\small\item\em copy constructor\item\end{CompactList}\item +\index{operator=@{operator=}!wxAutoOleInterface@{wxAutoOleInterface}}\index{wxAutoOleInterface@{wxAutoOleInterface}!operator=@{operator=}} +wx\-Auto\-Ole\-Interface$<$ I $>$ \& {\bf operator=} (const wx\-Auto\-Ole\-Interface$<$ I $>$ \&ti)\label{classwxAutoOleInterface_a5} + +\begin{CompactList}\small\item\em assignment operator\item\end{CompactList}\item +\index{operator=@{operator=}!wxAutoOleInterface@{wxAutoOleInterface}}\index{wxAutoOleInterface@{wxAutoOleInterface}!operator=@{operator=}} +wx\-Auto\-Ole\-Interface$<$ I $>$ \& {\bf operator=} (I $\ast$\&ti)\label{classwxAutoOleInterface_a6} + +\begin{CompactList}\small\item\em takes ownership of an existing interface Assumed to already have a Add\-Ref() applied\item\end{CompactList}\item +\index{~wxAutoOleInterface@{$\sim$wxAutoOleInterface}!wxAutoOleInterface@{wxAutoOleInterface}}\index{wxAutoOleInterface@{wxAutoOleInterface}!~wxAutoOleInterface@{$\sim$wxAutoOleInterface}} +{\bf $\sim$wx\-Auto\-Ole\-Interface} ()\label{classwxAutoOleInterface_a7} + +\begin{CompactList}\small\item\em invokes {\bf Free()}\item\end{CompactList}\item +\index{Free@{Free}!wxAutoOleInterface@{wxAutoOleInterface}}\index{wxAutoOleInterface@{wxAutoOleInterface}!Free@{Free}} +void {\bf Free} ()\label{classwxAutoOleInterface_a8} + +\begin{CompactList}\small\item\em Releases interface (i.e decrements ref\-Count).\item\end{CompactList}\item +\index{QueryInterface@{QueryInterface}!wxAutoOleInterface@{wxAutoOleInterface}}\index{wxAutoOleInterface@{wxAutoOleInterface}!QueryInterface@{QueryInterface}} +HRESULT {\bf Query\-Interface} (REFIID riid, IUnknown $\ast$p\-Unk)\label{classwxAutoOleInterface_a9} + +\begin{CompactList}\small\item\em queries for an interface\item\end{CompactList}\item +\index{CreateInstance@{CreateInstance}!wxAutoOleInterface@{wxAutoOleInterface}}\index{wxAutoOleInterface@{wxAutoOleInterface}!CreateInstance@{CreateInstance}} +HRESULT {\bf Create\-Instance} (REFCLSID clsid, REFIID riid)\label{classwxAutoOleInterface_a10} + +\begin{CompactList}\small\item\em Create a Interface instance.\item\end{CompactList}\item +\index{operator I *@{operator I $\ast$}!wxAutoOleInterface@{wxAutoOleInterface}}\index{wxAutoOleInterface@{wxAutoOleInterface}!operator I *@{operator I $\ast$}} +{\bf operator I $\ast$} () const\label{classwxAutoOleInterface_a11} + +\begin{CompactList}\small\item\em returns the interface pointer\item\end{CompactList}\item +\index{operator->@{operator-$>$}!wxAutoOleInterface@{wxAutoOleInterface}}\index{wxAutoOleInterface@{wxAutoOleInterface}!operator->@{operator-$>$}} +I $\ast$ {\bf operator $\rightarrow$ } ()\label{classwxAutoOleInterface_a12} + +\begin{CompactList}\small\item\em returns the dereferenced interface pointer\item\end{CompactList}\item +\index{GetRef@{GetRef}!wxAutoOleInterface@{wxAutoOleInterface}}\index{wxAutoOleInterface@{wxAutoOleInterface}!GetRef@{GetRef}} +I $\ast$$\ast$ {\bf Get\-Ref} ()\label{classwxAutoOleInterface_a13} + +\begin{CompactList}\small\item\em returns a pointer to the interface pointer\item\end{CompactList}\item +\index{Ok@{Ok}!wxAutoOleInterface@{wxAutoOleInterface}}\index{wxAutoOleInterface@{wxAutoOleInterface}!Ok@{Ok}} +bool {\bf Ok} () const\label{classwxAutoOleInterface_a14} + +\begin{CompactList}\small\item\em returns true if we have a valid interface pointer\item\end{CompactList}\end{CompactItemize} + + +The documentation for this class was generated from the following file:\begin{CompactItemize} +\item +{\bf wxactivex.h}\end{CompactItemize} diff --git a/wxPython/contrib/activex/wxie/latex/doxygen.sty b/wxPython/contrib/activex/wxie/latex/doxygen.sty new file mode 100644 index 0000000000..a31c8b939a --- /dev/null +++ b/wxPython/contrib/activex/wxie/latex/doxygen.sty @@ -0,0 +1,65 @@ +\NeedsTeXFormat{LaTeX2e} +\ProvidesPackage{doxygen} +\RequirePackage{calc} +\RequirePackage{array} +\pagestyle{fancyplain} +\addtolength{\headwidth}{\marginparsep} +\addtolength{\headwidth}{\marginparwidth} +\newcommand{\clearemptydoublepage}{\newpage{\pagestyle{empty}\cleardoublepage}} +\renewcommand{\chaptermark}[1]{\markboth{#1}{}} +\renewcommand{\sectionmark}[1]{\markright{\thesection\ #1}} +\lhead[\fancyplain{}{\bfseries\thepage}] + {\fancyplain{}{\bfseries\rightmark}} +\rhead[\fancyplain{}{\bfseries\leftmark}] + {\fancyplain{}{\bfseries\thepage}} +\rfoot[\fancyplain{}{\bfseries\scriptsize Generated on Tue Apr 1 14:51:12 2003 for wx\-Active\-X by Doxygen }]{} +\lfoot[]{\fancyplain{}{\bfseries\scriptsize Generated on Tue Apr 1 14:51:12 2003 for wx\-Active\-X by Doxygen }} +\cfoot{} +\newenvironment{CompactList} +{\begin{list}{}{ + \setlength{\leftmargin}{0.5cm} + \setlength{\itemsep}{0pt} + \setlength{\parsep}{0pt} + \setlength{\topsep}{0pt} + \renewcommand{\makelabel}{}}} +{\end{list}} +\newenvironment{CompactItemize} +{ + \begin{itemize} + \setlength{\itemsep}{-3pt} + \setlength{\parsep}{0pt} + \setlength{\topsep}{0pt} + \setlength{\partopsep}{0pt} +} +{\end{itemize}} +\newcommand{\PBS}[1]{\let\temp=\\#1\let\\=\temp} +\newlength{\tmplength} +\newenvironment{TabularC}[1] +{ +\setlength{\tmplength} + {\linewidth/(#1)-\tabcolsep*2-\arrayrulewidth*(#1+1)/(#1)} + \par\begin{tabular*}{\linewidth} + {*{#1}{|>{\PBS\raggedright\hspace{0pt}}p{\the\tmplength}}|} +} +{\end{tabular*}\par} +\newcommand{\entrylabel}[1]{ + {\parbox[b]{\labelwidth-4pt}{\makebox[0pt][l]{\textbf{#1}}\\}}} +\newenvironment{Desc} +{\begin{list}{} + { + \settowidth{\labelwidth}{40pt} + \setlength{\leftmargin}{\labelwidth} + \setlength{\parsep}{0pt} + \setlength{\itemsep}{-4pt} + \renewcommand{\makelabel}{\entrylabel} + } +} +{\end{list}} +\newenvironment{Indent} + {\begin{list}{}{\setlength{\leftmargin}{0.5cm}} + \item[]\ignorespaces} + {\unskip\end{list}} +\setlength{\parindent}{0cm} +\setlength{\parskip}{0.2cm} +\addtocounter{secnumdepth}{1} +\sloppy diff --git a/wxPython/contrib/activex/wxie/latex/files.tex b/wxPython/contrib/activex/wxie/latex/files.tex new file mode 100644 index 0000000000..ee190e7c11 --- /dev/null +++ b/wxPython/contrib/activex/wxie/latex/files.tex @@ -0,0 +1,5 @@ +\section{wx\-Active\-X File List} +Here is a list of all documented files with brief descriptions:\begin{CompactList} +\item\contentsline{section}{{\bf iehtmlwin.h} (Implements wx\-IEHtml\-Win window class)}{\pageref{iehtmlwin_8h}}{} +\item\contentsline{section}{{\bf wxactivex.h} (Implements {\bf wx\-Active\-X} window class and OLE tools)}{\pageref{wxactivex_8h}}{} +\end{CompactList} diff --git a/wxPython/contrib/activex/wxie/latex/hierarchy.tex b/wxPython/contrib/activex/wxie/latex/hierarchy.tex new file mode 100644 index 0000000000..107b666b02 --- /dev/null +++ b/wxPython/contrib/activex/wxie/latex/hierarchy.tex @@ -0,0 +1,9 @@ +\section{wx\-Active\-X Class Hierarchy} +This inheritance list is sorted roughly, but not completely, alphabetically:\begin{CompactList} +\item \contentsline{section}{NS\_\-wx\-Active\-X::less\_\-wx\-String\-I}{\pageref{structNS__wxActiveX_1_1less__wxStringI}}{} +\item \contentsline{section}{wx\-Active\-X}{\pageref{classwxActiveX}}{} +\item \contentsline{section}{wx\-Active\-X::Func\-X}{\pageref{classwxActiveX_1_1FuncX}}{} +\item \contentsline{section}{wx\-Active\-X::Param\-X}{\pageref{classwxActiveX_1_1ParamX}}{} +\item \contentsline{section}{wx\-Active\-X::Prop\-X}{\pageref{classwxActiveX_1_1PropX}}{} +\item \contentsline{section}{wx\-Auto\-Ole\-Interface$<$ I $>$}{\pageref{classwxAutoOleInterface}}{} +\end{CompactList} diff --git a/wxPython/contrib/activex/wxie/latex/iehtmlwin_8h.tex b/wxPython/contrib/activex/wxie/latex/iehtmlwin_8h.tex new file mode 100644 index 0000000000..ce44a19608 --- /dev/null +++ b/wxPython/contrib/activex/wxie/latex/iehtmlwin_8h.tex @@ -0,0 +1,16 @@ +\section{iehtmlwin.h File Reference} +\label{iehtmlwin_8h}\index{iehtmlwin.h@{iehtmlwin.h}} + + +\subsection{Detailed Description} +implements wx\-IEHtml\-Win window class + + + +Definition in file {\bf iehtmlwin.h}. + +{\tt \#include $<$wx/setup.h$>$}\par +{\tt \#include $<$wx/wx.h$>$}\par +{\tt \#include $<$exdisp.h$>$}\par +{\tt \#include $<$iostream$>$}\par +{\tt \#include \char`\"{}wxactivex.h\char`\"{}}\par diff --git a/wxPython/contrib/activex/wxie/latex/namespaceNS__wxActiveX.tex b/wxPython/contrib/activex/wxie/latex/namespaceNS__wxActiveX.tex new file mode 100644 index 0000000000..1bc10ec699 --- /dev/null +++ b/wxPython/contrib/activex/wxie/latex/namespaceNS__wxActiveX.tex @@ -0,0 +1,14 @@ +\section{NS\_\-wx\-Active\-X Namespace Reference} +\label{namespaceNS__wxActiveX}\index{NS_wxActiveX@{NS\_\-wxActiveX}} + + +\subsection{Detailed Description} +{\bf wx\-Active\-X} Namespace for stuff I want to keep out of other tools way. + + + +\subsection*{Data Structures} +\begin{CompactItemize} +\item +struct {\bf less\_\-wx\-String\-I} +\begin{CompactList}\small\item\em STL utilty class.\item\end{CompactList}\end{CompactItemize} diff --git a/wxPython/contrib/activex/wxie/latex/namespaces.tex b/wxPython/contrib/activex/wxie/latex/namespaces.tex new file mode 100644 index 0000000000..067bdd6e32 --- /dev/null +++ b/wxPython/contrib/activex/wxie/latex/namespaces.tex @@ -0,0 +1,4 @@ +\section{wx\-Active\-X Namespace List} +Here is a list of all documented namespaces with brief descriptions:\begin{CompactList} +\item\contentsline{section}{{\bf NS\_\-wx\-Active\-X} (Wx\-Active\-X Namespace for stuff I want to keep out of other tools way)}{\pageref{namespaceNS__wxActiveX}}{} +\end{CompactList} diff --git a/wxPython/contrib/activex/wxie/latex/refman.tex b/wxPython/contrib/activex/wxie/latex/refman.tex new file mode 100644 index 0000000000..b07708e854 --- /dev/null +++ b/wxPython/contrib/activex/wxie/latex/refman.tex @@ -0,0 +1,51 @@ +\documentclass[a4paper]{book} +\usepackage{a4wide} +\usepackage{makeidx} +\usepackage{fancyhdr} +\usepackage{graphicx} +\usepackage{multicol} +\usepackage{float} +\usepackage{textcomp} +\usepackage{alltt} +\usepackage{doxygen} +\makeindex +\setcounter{tocdepth}{1} +\setlength{\footrulewidth}{0.4pt} +\begin{document} +\begin{titlepage} +\vspace*{7cm} +\begin{center} +{\Large wx\-Active\-X Reference Manual}\\ +\vspace*{1cm} +{\large Generated by Doxygen 1.3-rc3}\\ +\vspace*{0.5cm} +{\small Tue Apr 1 14:51:12 2003}\\ +\end{center} +\end{titlepage} +\clearemptydoublepage +\pagenumbering{roman} +\tableofcontents +\clearemptydoublepage +\pagenumbering{arabic} +\chapter{wx\-Active\-X Namespace Index} +\input{namespaces} +\chapter{wx\-Active\-X Hierarchical Index} +\input{hierarchy} +\chapter{wx\-Active\-X Data Structure Index} +\input{annotated} +\chapter{wx\-Active\-X File Index} +\input{files} +\chapter{wx\-Active\-X Namespace Documentation} +\input{namespaceNS__wxActiveX} +\chapter{wx\-Active\-X Data Structure Documentation} +\input{structNS__wxActiveX_1_1less__wxStringI} +\include{classwxActiveX} +\include{classwxActiveX_1_1FuncX} +\include{classwxActiveX_1_1ParamX} +\include{classwxActiveX_1_1PropX} +\include{classwxAutoOleInterface} +\chapter{wx\-Active\-X File Documentation} +\input{iehtmlwin_8h} +\include{wxactivex_8h} +\printindex +\end{document} diff --git a/wxPython/contrib/activex/wxie/latex/structNS__wxActiveX_1_1less__wxStringI.tex b/wxPython/contrib/activex/wxie/latex/structNS__wxActiveX_1_1less__wxStringI.tex new file mode 100644 index 0000000000..7b40a80617 --- /dev/null +++ b/wxPython/contrib/activex/wxie/latex/structNS__wxActiveX_1_1less__wxStringI.tex @@ -0,0 +1,18 @@ +\section{NS\_\-wx\-Active\-X::less\_\-wx\-String\-I Struct Reference} +\label{structNS__wxActiveX_1_1less__wxStringI}\index{NS_wxActiveX::less_wxStringI@{NS\_\-wxActiveX::less\_\-wxStringI}} +{\tt \#include $<$wxactivex.h$>$} + + + +\subsection{Detailed Description} +STL utilty class. + +specific to {\bf wx\-Active\-X}, for creating case insenstive maps etc + + + +Definition at line 29 of file wxactivex.h. + +The documentation for this struct was generated from the following file:\begin{CompactItemize} +\item +{\bf wxactivex.h}\end{CompactItemize} diff --git a/wxPython/contrib/activex/wxie/latex/wxactivex_8h.tex b/wxPython/contrib/activex/wxie/latex/wxactivex_8h.tex new file mode 100644 index 0000000000..911fe27107 --- /dev/null +++ b/wxPython/contrib/activex/wxie/latex/wxactivex_8h.tex @@ -0,0 +1,139 @@ +\section{wxactivex.h File Reference} +\label{wxactivex_8h}\index{wxactivex.h@{wxactivex.h}} + + +\subsection{Detailed Description} +implements {\bf wx\-Active\-X} window class and OLE tools + + + +Definition in file {\bf wxactivex.h}. + +{\tt \#include $<$wx/setup.h$>$}\par +{\tt \#include $<$wx/wx.h$>$}\par +{\tt \#include $<$wx/variant.h$>$}\par +{\tt \#include $<$wx/datetime.h$>$}\par +{\tt \#include $<$oleidl.h$>$}\par +{\tt \#include $<$exdisp.h$>$}\par +{\tt \#include $<$docobj.h$>$}\par +{\tt \#include $<$iostream$>$}\par +{\tt \#include $<$vector$>$}\par +{\tt \#include $<$map$>$}\par +\subsection*{Namespaces} +\begin{CompactItemize} +\item +namespace {\bf NS\_\-wx\-Active\-X} +\item +namespace {\bf std} +\end{CompactItemize} +\subsection*{Data Structures} +\begin{CompactItemize} +\item +class {\bf wx\-Auto\-Ole\-Interface} +\begin{CompactList}\small\item\em Template class for smart interface handling.\item\end{CompactList}\item +class {\bf wx\-Active\-X} +\begin{CompactList}\small\item\em Main class for embedding a Active\-X control.\item\end{CompactList}\item +class {\bf Param\-X} +\begin{CompactList}\small\item\em General parameter and return type infoformation for Events, Properties and Methods.\item\end{CompactList}\item +class {\bf Func\-X} +\begin{CompactList}\small\item\em Type \& Parameter info for Events and Methods.\item\end{CompactList}\item +class {\bf Prop\-X} +\begin{CompactList}\small\item\em Type info for properties.\item\end{CompactList}\end{CompactItemize} +\subsection*{Defines} +\begin{CompactItemize} +\item +\index{EVT_ACTIVEX@{EVT\_\-ACTIVEX}!wxactivex.h@{wxactivex.h}}\index{wxactivex.h@{wxactivex.h}!EVT_ACTIVEX@{EVT\_\-ACTIVEX}} +\#define {\bf EVT\_\-ACTIVEX}(id, event\-Name, fn)\ DECLARE\_\-EVENT\_\-TABLE\_\-ENTRY(Register\-Active\-XEvent(wx\-T(event\-Name)), id, -1, (wx\-Object\-Event\-Function) (wx\-Event\-Function) (wx\-Active\-XEvent\-Function) \& fn, (wx\-Object $\ast$) NULL ),\label{wxactivex_8h_a10} + +\begin{CompactList}\small\item\em Event handle for events by name.\item\end{CompactList}\item +\index{EVT_ACTIVEX_DISPID@{EVT\_\-ACTIVEX\_\-DISPID}!wxactivex.h@{wxactivex.h}}\index{wxactivex.h@{wxactivex.h}!EVT_ACTIVEX_DISPID@{EVT\_\-ACTIVEX\_\-DISPID}} +\#define {\bf EVT\_\-ACTIVEX\_\-DISPID}(id, event\-Disp\-Id, fn)\ DECLARE\_\-EVENT\_\-TABLE\_\-ENTRY(Register\-Active\-XEvent(event\-Disp\-Id), id, -1, (wx\-Object\-Event\-Function) (wx\-Event\-Function) (wx\-Active\-XEvent\-Function) \& fn, (wx\-Object $\ast$) NULL ),\label{wxactivex_8h_a11} + +\begin{CompactList}\small\item\em Event handle for events by DISPID (dispath id).\item\end{CompactList}\end{CompactItemize} +\subsection*{Functions} +\begin{CompactItemize} +\item +\index{OLEHResultToString@{OLEHResultToString}!wxactivex.h@{wxactivex.h}}\index{wxactivex.h@{wxactivex.h}!OLEHResultToString@{OLEHResultToString}} +wx\-String {\bf OLEHResult\-To\-String} (HRESULT hr)\label{wxactivex_8h_a13} + +\begin{CompactList}\small\item\em Converts a std HRESULT to its error code. Hardcoded, by no means a definitive list.\item\end{CompactList}\item +\index{GetIIDName@{GetIIDName}!wxactivex.h@{wxactivex.h}}\index{wxactivex.h@{wxactivex.h}!GetIIDName@{GetIIDName}} +wx\-String {\bf Get\-IIDName} (REFIID riid)\label{wxactivex_8h_a14} + +\begin{CompactList}\small\item\em Returns the string description of a IID. Hardcoded, by no means a definitive list.\item\end{CompactList}\end{CompactItemize} + + +\subsection{Define Documentation} +\index{wxactivex.h@{wxactivex.h}!DECLARE_OLE_UNKNOWN@{DECLARE\_\-OLE\_\-UNKNOWN}} +\index{DECLARE_OLE_UNKNOWN@{DECLARE\_\-OLE\_\-UNKNOWN}!wxactivex.h@{wxactivex.h}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}\#define DECLARE\_\-OLE\_\-UNKNOWN(cls)}\label{wxactivex_8h_a3} + + +{\bf Value:} + +\footnotesize\begin{verbatim}private:\ + class TAutoInitInt\ + {\ + public:\ + LONG l;\ + TAutoInitInt() : l(0) {}\ + };\ + TAutoInitInt refCount, lockCount;\ + wxOleInit oleInit;\ + static void _GetInterface(cls *self, REFIID iid, void **_interface, const char *&desc);\ + public:\ + LONG GetRefCount();\ + HRESULT STDMETHODCALLTYPE QueryInterface(REFIID iid, void ** ppvObject);\ + ULONG STDMETHODCALLTYPE AddRef();\ + ULONG STDMETHODCALLTYPE Release();\ + ULONG STDMETHODCALLTYPE AddLock();\ + ULONG STDMETHODCALLTYPE ReleaseLock() +\end{verbatim}\normalsize + + +Definition at line 184 of file wxactivex.h.\index{wxactivex.h@{wxactivex.h}!DEFINE_OLE_BASE@{DEFINE\_\-OLE\_\-BASE}} +\index{DEFINE_OLE_BASE@{DEFINE\_\-OLE\_\-BASE}!wxactivex.h@{wxactivex.h}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}\#define DEFINE\_\-OLE\_\-BASE(cls)}\label{wxactivex_8h_a5} + + +{\bf Value:} + +\footnotesize\begin{verbatim}void cls::_GetInterface(cls *self, REFIID iid, void **_interface, const char *&desc)\ + {\ + *_interface = NULL;\ + desc = NULL; +\end{verbatim}\normalsize + + +Definition at line 264 of file wxactivex.h.\index{wxactivex.h@{wxactivex.h}!OLE_INTERFACE@{OLE\_\-INTERFACE}} +\index{OLE_INTERFACE@{OLE\_\-INTERFACE}!wxactivex.h@{wxactivex.h}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}\#define OLE\_\-INTERFACE(\_\-iid, \_\-type)}\label{wxactivex_8h_a6} + + +{\bf Value:} + +\footnotesize\begin{verbatim}if (IsEqualIID(iid, _iid))\ + {\ + WXOLE_TRACE("Found Interface <" # _type ">");\ + *_interface = (IUnknown *) (_type *) self;\ + desc = # _iid;\ + return;\ + } +\end{verbatim}\normalsize + + +Definition at line 270 of file wxactivex.h.\index{wxactivex.h@{wxactivex.h}!OLE_INTERFACE_CUSTOM@{OLE\_\-INTERFACE\_\-CUSTOM}} +\index{OLE_INTERFACE_CUSTOM@{OLE\_\-INTERFACE\_\-CUSTOM}!wxactivex.h@{wxactivex.h}} +\subsubsection{\setlength{\rightskip}{0pt plus 5cm}\#define OLE\_\-INTERFACE\_\-CUSTOM(func)}\label{wxactivex_8h_a8} + + +{\bf Value:} + +\footnotesize\begin{verbatim}if (func(self, iid, _interface, desc))\ + {\ + return;\ + } +\end{verbatim}\normalsize + + +Definition at line 281 of file wxactivex.h. \ No newline at end of file diff --git a/wxPython/contrib/activex/wxie/license.txt b/wxPython/contrib/activex/wxie/license.txt new file mode 100644 index 0000000000..1c980e23b7 --- /dev/null +++ b/wxPython/contrib/activex/wxie/license.txt @@ -0,0 +1,53 @@ + wxActiveX Library Licence, Version 3 + ==================================== + + Copyright (C) 2003 Lindsay Mathieson [, ...] + + Everyone is permitted to copy and distribute verbatim copies + of this licence document, but changing it is not allowed. + + wxActiveX LIBRARY LICENCE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + This library is free software; you can redistribute it and/or modify it + under the terms of the GNU Library General Public Licence as published by + the Free Software Foundation; either version 2 of the Licence, or (at + your option) any later version. + + This library is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library + General Public Licence for more details. + + You should have received a copy of the GNU Library General Public Licence + along with this software, usually in a file named COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, + Boston, MA 02111-1307 USA. + + EXCEPTION NOTICE + + 1. As a special exception, the copyright holders of this library give + permission for additional uses of the text contained in this release of + the library as licenced under the wxActiveX Library Licence, applying + either version 3 of the Licence, or (at your option) any later version of + the Licence as published by the copyright holders of version 3 of the + Licence document. + + 2. The exception is that you may use, copy, link, modify and distribute + under the user's own terms, binary object code versions of works based + on the Library. + + 3. If you copy code from files distributed under the terms of the GNU + General Public Licence or the GNU Library General Public Licence into a + copy of this library, as this licence permits, the exception does not + apply to the code that you add in this way. To avoid misleading anyone as + to the status of such modified files, you must delete this exception + notice from such code and/or adjust the licensing conditions notice + accordingly. + + 4. If you write modifications of your own for this library, it is your + choice whether to permit this exception to apply to your modifications. + If you do not wish that, you must delete the exception notice from such + code and/or adjust the licensing conditions notice accordingly. + + diff --git a/wxPython/contrib/activex/wxie/makefile b/wxPython/contrib/activex/wxie/makefile new file mode 100644 index 0000000000..f38721378c --- /dev/null +++ b/wxPython/contrib/activex/wxie/makefile @@ -0,0 +1,24 @@ +CC = gcc + +PROGRAM = wxIE + +CFLAGS = -I/m/snowball/icicle/gswd/devenv/include -D__WXMOTIF__ +LFLAGS = -L/m/snowball/icicle/devenv/lib + +# implementation + +.SUFFIXES: .o .cpp + +SOURCES:sh= /bin/ls *.cpp + +OBJECTS = $(SOURCES:.cpp=.o) + +.cpp.o : + $(CC) -c $(CFLAGS) `wx-config --cflags` -o $@ $< + +$(PROGRAM): $(OBJECTS) + $(CC) -o $(PROGRAM) $(OBJECTS) $(LFLAGS) `wx-config --libs` + +clean: + rm -f *.o $(PROGRAM) + diff --git a/wxPython/contrib/activex/wxie/makefile.gtk b/wxPython/contrib/activex/wxie/makefile.gtk new file mode 100644 index 0000000000..9fcb0db2b7 --- /dev/null +++ b/wxPython/contrib/activex/wxie/makefile.gtk @@ -0,0 +1,24 @@ +CC = gcc + +PROGRAM = wxIE + +CFLAGS = -I/m/snowball/icicle/gswd/devenv/include -D__WXGTK__ +LFLAGS = -L/m/snowball/icicle/devenv/lib + +# implementation + +.SUFFIXES: .o .cpp + +SOURCES:sh= /bin/ls *.cpp + +OBJECTS = $(SOURCES:.cpp=.o) + +.cpp.o : + $(CC) -c $(CFLAGS) `wx-config --cflags` -o $@ $< + +$(PROGRAM): $(OBJECTS) + $(CC) -o $(PROGRAM) $(OBJECTS) $(LFLAGS) `wx-config --libs` + +clean: + rm -f *.o $(PROGRAM) + diff --git a/wxPython/contrib/activex/wxie/makefile.mtf b/wxPython/contrib/activex/wxie/makefile.mtf new file mode 100644 index 0000000000..f38721378c --- /dev/null +++ b/wxPython/contrib/activex/wxie/makefile.mtf @@ -0,0 +1,24 @@ +CC = gcc + +PROGRAM = wxIE + +CFLAGS = -I/m/snowball/icicle/gswd/devenv/include -D__WXMOTIF__ +LFLAGS = -L/m/snowball/icicle/devenv/lib + +# implementation + +.SUFFIXES: .o .cpp + +SOURCES:sh= /bin/ls *.cpp + +OBJECTS = $(SOURCES:.cpp=.o) + +.cpp.o : + $(CC) -c $(CFLAGS) `wx-config --cflags` -o $@ $< + +$(PROGRAM): $(OBJECTS) + $(CC) -o $(PROGRAM) $(OBJECTS) $(LFLAGS) `wx-config --libs` + +clean: + rm -f *.o $(PROGRAM) + diff --git a/wxPython/contrib/activex/wxie/notes.txt b/wxPython/contrib/activex/wxie/notes.txt new file mode 100644 index 0000000000..14db3c7ae6 --- /dev/null +++ b/wxPython/contrib/activex/wxie/notes.txt @@ -0,0 +1,2 @@ +Flash needs the following GUID for its event interface +{D27CDB6D-AE6D-11CF-96B8-444553540000} \ No newline at end of file diff --git a/wxPython/contrib/activex/wxie/readme.txt b/wxPython/contrib/activex/wxie/readme.txt new file mode 100644 index 0000000000..ec3039dd4f --- /dev/null +++ b/wxPython/contrib/activex/wxie/readme.txt @@ -0,0 +1,149 @@ +Lindsay Mathieson +Email : + +This is prelimanary stuff - the controls need extra methods and events etc, +feel free to email with suggestions &/or patches. + +Tested with wxWindows 2.3.2. +Built with MS Visual C++ 6.0 & DevStudio +Minor use of templates and STL + +----------------------------------------------------------- +This sample illustrates using wxActiveX and wxIEHtmlWin too: +1. Host an arbitrary ActiveX control +1.1 - Capture and logging of all events from control +2. Specifically host the MSHTML Control + + +wxActiveX: +========== +wxActiveX is used to host and siplay any activeX control, all the wxWindows developer +needs to know is either the ProgID or CLSID of the control in question. + +Derived From: +- wxWindow + +Include Files: +- wxactivex.h + +Source Files: +- wxactivex.cpp + +Event Handling: +--------------- +- EVT_ACTIVEX(id, eventName, handler) (handler = void OnActiveX(wxActiveXEvent& event)) +- EVT_ACTIVEX_DISPID(id, eventDispId, handler) (handler = void OnActiveX(wxActiveXEvent& event)) +class wxActiveXEvent : public wxNotifyEvent + wxString EventName(); + int ParamCount() const; + wxString ParamType(int idx); + wxString ParamName(int idx); + wxVariant operator[] (int idx) const; // parameter by index + wxVariant& operator[] (int idx); + wxVariant operator[] (wxString name) const; // named parameters + wxVariant& operator[] (wxString name); + + +Members: +-------- +wxActiveX::wxActiveX(wxWindow * parent, REFCLSID clsid, wxWindowID id = -1); +- Creates a activeX control identified by clsid +e.g + wxFrame *frame = new wxFrame(this, -1, "test"); + wxActiveX *X = new wxActiveX(frame, CLSID_WebBrowser); + +wxActiveX::wxActiveX(wxWindow * parent, wxString progId, wxWindowID id = -1); +- Creates a activeX control identified by progId +e.g. + wxFrame *frame = new wxFrame(this, -1, "test"); + wxActiveX *X = new wxActiveX(frame, "MSCAL.Calendar"); + + +wxActiveX::~wxActiveX(); +- Destroys the control +- disconnects all connection points + +- int GetEventCount() const; + Number of events generated by control + +- const FuncX& GetEvent(int idx) const; + Names, Params and Typeinfo for events + +HRESULT wxActiveX::ConnectAdvise(REFIID riid, IUnknown *eventSink); +- Connects a event sink. Connections are automaticlly diconnected in the destructor +e.g. + FS_DWebBrowserEvents2 *events = new FS_DWebBrowserEvents2(iecontrol); + hret = iecontrol->ConnectAdvise(DIID_DWebBrowserEvents2, events); + if (! SUCCEEDED(hret)) + delete events; + + +Sample Events: +-------------- +EVT_ACTIVEX(ID_MSHTML, "BeforeNavigate2", OnMSHTMLBeforeNavigate2X) + +void wxIEFrame::OnMSHTMLBeforeNavigate2X(wxActiveXEvent& event) +{ + wxString url = event["Url"]; + + int rc = wxMessageBox(url, "Allow open url ?", wxYES_NO); + + if (rc != wxYES) + event["Cancel"] = true; +}; + + +wxIEHtmlWin: +============ +wxIEHtmlWin is a specialisation of the wxActiveX control for hosting the MSHTML control. + +Derived From: +- wxActiveX +- wxWindow + +Event Handling: +--------------- +- see wxActiveX +Members: +-------- +wxIEHtmlWin::wxIEHtmlWin(wxWindow * parent, wxWindowID id = -1); +- Constructs and initialises the MSHTML control +- LoadUrl("about:blank") is called + +wxIEHtmlWin::~wxIEHtmlWin(); +- destroys the control + +void wxIEHtmlWin::LoadUrl(const wxString&); +- Attempts to browse to the url, the control uses its internal (MS) + network streams + +bool wxIEHtmlWin::LoadString(wxString html); +- Load the passed HTML string + +bool wxIEHtmlWin::LoadStream(istream *strm); +- load the passed HTML stream. The control takes ownership of + the pointer, deleting when finished. + +bool wxIEHtmlWin::LoadStream(wxInputStream *is); +- load the passed HTML stream. The control takes ownership of + the pointer, deleting when finished. + +void wxIEHtmlWin::SetCharset(wxString charset); +- Sets the charset of the loaded document + +void wxIEHtmlWin::SetEditMode(bool seton); +- Sets edit mode. + NOTE: This does work, but is bare bones - we need more events exposed before + this is usable as an HTML editor. + +bool wxIEHtmlWin::GetEditMode(); +- Returns the edit mode setting + +wxString wxIEHtmlWin::GetStringSelection(bool asHTML = false); +- Returns the currently selected text (plain or HTML text) + +wxString GetText(bool asHTML = false); +- Returns the body text (plain or HTML text) + +Lindsay Mathieson +Email : diff --git a/wxPython/contrib/activex/wxie/resource.h b/wxPython/contrib/activex/wxie/resource.h new file mode 100644 index 0000000000..f66fef822c --- /dev/null +++ b/wxPython/contrib/activex/wxie/resource.h @@ -0,0 +1,70 @@ +/* + wxActiveX Library Licence, Version 3 + ==================================== + + Copyright (C) 2003 Lindsay Mathieson [, ...] + + Everyone is permitted to copy and distribute verbatim copies + of this licence document, but changing it is not allowed. + + wxActiveX LIBRARY LICENCE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + This library is free software; you can redistribute it and/or modify it + under the terms of the GNU Library General Public Licence as published by + the Free Software Foundation; either version 2 of the Licence, or (at + your option) any later version. + + This library is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library + General Public Licence for more details. + + You should have received a copy of the GNU Library General Public Licence + along with this software, usually in a file named COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, + Boston, MA 02111-1307 USA. + + EXCEPTION NOTICE + + 1. As a special exception, the copyright holders of this library give + permission for additional uses of the text contained in this release of + the library as licenced under the wxActiveX Library Licence, applying + either version 3 of the Licence, or (at your option) any later version of + the Licence as published by the copyright holders of version 3 of the + Licence document. + + 2. The exception is that you may use, copy, link, modify and distribute + under the user's own terms, binary object code versions of works based + on the Library. + + 3. If you copy code from files distributed under the terms of the GNU + General Public Licence or the GNU Library General Public Licence into a + copy of this library, as this licence permits, the exception does not + apply to the code that you add in this way. To avoid misleading anyone as + to the status of such modified files, you must delete this exception + notice from such code and/or adjust the licensing conditions notice + accordingly. + + 4. If you write modifications of your own for this library, it is your + choice whether to permit this exception to apply to your modifications. + If you do not wish that, you must delete the exception notice from such + code and/or adjust the licensing conditions notice accordingly. +*/ + +//{{NO_DEPENDENCIES}} +// Microsoft Developer Studio generated include file. +// Used by wxIE.rc +// +#define DUMMY 4 + +// Next default values for new objects +// +#ifdef APSTUDIO_INVOKED +#ifndef APSTUDIO_READONLY_SYMBOLS +#define _APS_NEXT_RESOURCE_VALUE 102 +#define _APS_NEXT_COMMAND_VALUE 40001 +#define _APS_NEXT_CONTROL_VALUE 1000 +#define _APS_NEXT_SYMED_VALUE 101 +#endif +#endif diff --git a/wxPython/contrib/activex/wxie/wxActiveXFrame.cpp b/wxPython/contrib/activex/wxie/wxActiveXFrame.cpp new file mode 100644 index 0000000000..ff6ddcbd84 --- /dev/null +++ b/wxPython/contrib/activex/wxie/wxActiveXFrame.cpp @@ -0,0 +1,284 @@ +/* + wxActiveX Library Licence, Version 3 + ==================================== + + Copyright (C) 2003 Lindsay Mathieson [, ...] + + Everyone is permitted to copy and distribute verbatim copies + of this licence document, but changing it is not allowed. + + wxActiveX LIBRARY LICENCE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + This library is free software; you can redistribute it and/or modify it + under the terms of the GNU Library General Public Licence as published by + the Free Software Foundation; either version 2 of the Licence, or (at + your option) any later version. + + This library is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library + General Public Licence for more details. + + You should have received a copy of the GNU Library General Public Licence + along with this software, usually in a file named COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, + Boston, MA 02111-1307 USA. + + EXCEPTION NOTICE + + 1. As a special exception, the copyright holders of this library give + permission for additional uses of the text contained in this release of + the library as licenced under the wxActiveX Library Licence, applying + either version 3 of the Licence, or (at your option) any later version of + the Licence as published by the copyright holders of version 3 of the + Licence document. + + 2. The exception is that you may use, copy, link, modify and distribute + under the user's own terms, binary object code versions of works based + on the Library. + + 3. If you copy code from files distributed under the terms of the GNU + General Public Licence or the GNU Library General Public Licence into a + copy of this library, as this licence permits, the exception does not + apply to the code that you add in this way. To avoid misleading anyone as + to the status of such modified files, you must delete this exception + notice from such code and/or adjust the licensing conditions notice + accordingly. + + 4. If you write modifications of your own for this library, it is your + choice whether to permit this exception to apply to your modifications. + If you do not wish that, you must delete the exception notice from such + code and/or adjust the licensing conditions notice accordingly. +*/ + +// ---------------------------------------------------------------------------- +// headers +// ---------------------------------------------------------------------------- +// For compilers that support precompilation, includes "wx/wx.h". +#if defined(__WXGTK__) || defined(__WXMOTIF__) + #include "wx/wx.h" +#endif +#include "wx/wxprec.h" +#include "wx/filedlg.h" +#include "wx/textdlg.h" +#include "wxActiveXFrame.h" +#include +using namespace std; +#include "wx/splitter.h" +#include "wx/textctrl.h" +#include "wx/clipbrd.h" +#include + +enum +{ + // menu items + MENU_GETTYPEINFO = 700, + MENU_INVOKEMETHOD, + MENU_TEST +}; + +BEGIN_EVENT_TABLE(wxActiveXFrame, wxFrame) + EVT_MENU(MENU_GETTYPEINFO, wxActiveXFrame::OnGetTypeInfo) + EVT_MENU(MENU_INVOKEMETHOD, wxActiveXFrame::OnInvokeMethod) + EVT_MENU(MENU_TEST, wxActiveXFrame::OnTest) +END_EVENT_TABLE() + + +wxActiveXFrame::wxActiveXFrame(wxWindow *parent, wxString title) : + wxFrame(parent, -1, title) +{ + // create a menu bar + wxMenu *xMenu = new wxMenu("", wxMENU_TEAROFF); + + xMenu->Append(MENU_GETTYPEINFO, "Get Type Info", ""); + xMenu->Append(MENU_INVOKEMETHOD, "Invoke Method (no params)", ""); + xMenu->Append(MENU_TEST, "Test", "For debugging purposes"); + + // now append the freshly created menu to the menu bar... + wxMenuBar *menuBar = new wxMenuBar(); + menuBar->Append(xMenu, "&ActiveX"); + + // ... and attach this menu bar to the frame + SetMenuBar(menuBar); + + wxSplitterWindow *sp = new wxSplitterWindow(this); + X = new wxActiveX(sp, title, 101); + + textLog = new wxTextCtrl(sp, -1, "", wxPoint(0,0), wxDefaultSize, wxTE_MULTILINE | wxTE_READONLY); + + sp->SplitHorizontally(X, textLog, 0); + + // conenct all events + for (int i = 0; i < X->GetEventCount(); i++) + { + const wxActiveX::FuncX& func = X->GetEventDesc(i); + const wxEventType& ev = RegisterActiveXEvent((DISPID) func.memid); + Connect(101, ev, (wxObjectEventFunction) OnActiveXEvent); + }; +} + +wxString VarTypeAsString(VARTYPE vt) +{ +#define VT(vtype, desc) case vtype : return desc + + if (vt & VT_BYREF) + vt -= VT_BYREF; + + if (vt & VT_ARRAY) + vt -= VT_ARRAY; + + switch (vt) + { + VT(VT_SAFEARRAY, "SafeArray"); + VT(VT_EMPTY, "empty"); + VT(VT_NULL, "null"); + VT(VT_UI1, "byte"); + VT(VT_I1, "char"); + VT(VT_I2, "short"); + VT(VT_I4, "long"); + VT(VT_UI2, "unsigned short"); + VT(VT_UI4, "unsigned long"); + VT(VT_INT, "int"); + VT(VT_UINT, "unsigned int"); + VT(VT_R4, "real(4)"); + VT(VT_R8, "real(8)"); + VT(VT_CY, "Currency"); + VT(VT_DATE, "wxDate"); + VT(VT_BSTR, "wxString"); + VT(VT_DISPATCH, "IDispatch"); + VT(VT_ERROR, "SCode Error"); + VT(VT_BOOL, "bool"); + VT(VT_VARIANT, "wxVariant"); + VT(VT_UNKNOWN, "IUknown"); + VT(VT_VOID, "void"); + VT(VT_PTR, "void *"); + VT(VT_USERDEFINED, "*user defined*"); + + default: + { + wxString s; + s << "Unknown(" << vt << ")"; + return s; + }; + }; + +#undef VT +}; + +#define ENDL "\r\n" + + +void OutFunc(wxString& os, const wxActiveX::FuncX& func) +{ + os << VarTypeAsString(func.retType.vt) << " " << func.name << "("; + for (unsigned int p = 0; p < func.params.size(); p++) + { + const wxActiveX::ParamX& param = func.params[p]; + if (param.IsIn() && param.IsOut()) + os << "[IN OUT] "; + else if (param.IsIn()) + os << "[IN] "; + else if (param.IsIn()) + os << "[OUT] "; + os << VarTypeAsString(param.vt) << " " << (param.isPtr ? "*" : "") << param.name; + if (p < func.params.size() - 1) + os << ", "; + }; + os << ")" << ENDL; +}; + +void wxActiveXFrame::OnGetTypeInfo(wxCommandEvent& event) +{ + wxString os; + + int i =0; + os << + "Props" << ENDL << + "=====" << ENDL; + for (i = 0; i < X->GetPropCount(); i++) + { + wxActiveX::PropX prop = X->GetPropDesc(i); + os << VarTypeAsString(prop.type.vt) << " " << prop.name << "("; + if (prop.CanSet()) + { + os << VarTypeAsString(prop.arg.vt); + }; + os << ")" << ENDL; + + }; + os << ENDL; + + os << + "Events" << ENDL << + "======" << ENDL; + for (i = 0; i < X->GetEventCount(); i++) + OutFunc(os, X->GetEventDesc(i)); + os << ENDL; + + os << + "Methods" << ENDL << + "=======" << ENDL; + for (i = 0; i < X->GetMethodCount(); i++) + OutFunc(os, X->GetMethodDesc(i)); + os << ENDL; + + + if (wxTheClipboard->Open()) + { + wxDataObjectSimple *wo = new wxTextDataObject(os); + wxTheClipboard->SetData(wo); + wxTheClipboard->Flush(); + wxTheClipboard->Close(); + }; + + wxMessageBox(os, "Type Info", wxOK, this); +}; + +void wxActiveXFrame::OnInvokeMethod(wxCommandEvent& event) +{ + //wxTextEntryDialog dlg(this, "Method"); + //if (dlg.ShowModal() == wxID_OK) + // X->CallMethod(dlg.GetValue()); +}; + +void wxActiveXFrame::OnTest(wxCommandEvent& event) +{ + // flash testing + wxVariant args[] = {0L, "http://www.macromedia.com/support/flash/ts/documents/java_script_comm/flash_to_javascript.swf"}; + X->CallMethod("LoadMovie", args); + //X->Prop("Movie") = "http://www.macromedia.com/support/flash/ts/documents/java_script_comm/flash_to_javascript.swf"; + + // mc cal testing + //X->Prop("year") = 1964L; + //X->Prop("Value") = wxDateTime::Now(); + + // pdf testing + //wxVariant file = "C:\\WINNT\\wx2\\docs\\pdf\\dialoged.pdf"; + //X->CallMethod("LoadFile", &file); +}; + +void wxActiveXFrame::OnActiveXEvent(wxActiveXEvent& event) +{ +#ifdef UNICODE + wostringstream os; +#else + ostringstream os; +#endif + + os << (const wxChar *) event.EventName() << wxT("("); + + for (int p = 0; p < event.ParamCount(); p++) + { + os << + (const wxChar *) event.ParamType(p) << wxT(" ") << + (const wxChar *) event.ParamName(p) << wxT(" = ") << + (const wxChar *) (wxString) event[p]; + if (p < event.ParamCount() - 1) + os << wxT(", "); + }; + os << wxT(")") << endl; + wxString data = os.str().c_str(); + textLog->AppendText(data); +}; + diff --git a/wxPython/contrib/activex/wxie/wxActiveXFrame.h b/wxPython/contrib/activex/wxie/wxActiveXFrame.h new file mode 100644 index 0000000000..ad98d5d6dd --- /dev/null +++ b/wxPython/contrib/activex/wxie/wxActiveXFrame.h @@ -0,0 +1,77 @@ +/* + wxActiveX Library Licence, Version 3 + ==================================== + + Copyright (C) 2003 Lindsay Mathieson [, ...] + + Everyone is permitted to copy and distribute verbatim copies + of this licence document, but changing it is not allowed. + + wxActiveX LIBRARY LICENCE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + This library is free software; you can redistribute it and/or modify it + under the terms of the GNU Library General Public Licence as published by + the Free Software Foundation; either version 2 of the Licence, or (at + your option) any later version. + + This library is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library + General Public Licence for more details. + + You should have received a copy of the GNU Library General Public Licence + along with this software, usually in a file named COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, + Boston, MA 02111-1307 USA. + + EXCEPTION NOTICE + + 1. As a special exception, the copyright holders of this library give + permission for additional uses of the text contained in this release of + the library as licenced under the wxActiveX Library Licence, applying + either version 3 of the Licence, or (at your option) any later version of + the Licence as published by the copyright holders of version 3 of the + Licence document. + + 2. The exception is that you may use, copy, link, modify and distribute + under the user's own terms, binary object code versions of works based + on the Library. + + 3. If you copy code from files distributed under the terms of the GNU + General Public Licence or the GNU Library General Public Licence into a + copy of this library, as this licence permits, the exception does not + apply to the code that you add in this way. To avoid misleading anyone as + to the status of such modified files, you must delete this exception + notice from such code and/or adjust the licensing conditions notice + accordingly. + + 4. If you write modifications of your own for this library, it is your + choice whether to permit this exception to apply to your modifications. + If you do not wish that, you must delete the exception notice from such + code and/or adjust the licensing conditions notice accordingly. +*/ + +#ifndef wxActiveXFrame_h +#define wxActiveXFrame_h + +#include "wxactivex.h" + +class wxActiveXFrame : public wxFrame +{ +public: + wxActiveX *X; + wxTextCtrl *textLog; + + wxActiveXFrame(wxWindow *parent, wxString title); + + DECLARE_EVENT_TABLE() + + void OnGetTypeInfo(wxCommandEvent& event); + void OnInvokeMethod(wxCommandEvent& event); + void OnTest(wxCommandEvent& event); + void OnActiveXEvent(wxActiveXEvent& event); +}; + + +#endif \ No newline at end of file diff --git a/wxPython/contrib/activex/wxie/wxIE.dsp b/wxPython/contrib/activex/wxie/wxIE.dsp new file mode 100644 index 0000000000..88caf4d967 --- /dev/null +++ b/wxPython/contrib/activex/wxie/wxIE.dsp @@ -0,0 +1,404 @@ +# Microsoft Developer Studio Project File - Name="wxIE" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Console Application" 0x0103 + +CFG=wxIE - Win32 Unicode Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "wxIE.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "wxIE.mak" CFG="wxIE - Win32 Unicode Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "wxIE - Win32 Release" (based on "Win32 (x86) Console Application") +!MESSAGE "wxIE - Win32 Debug" (based on "Win32 (x86) Console Application") +!MESSAGE "wxIE - Win32 Unicode Debug" (based on "Win32 (x86) Console Application") +!MESSAGE "wxIE - Win32 Unicode Release" (based on "Win32 (x86) Console Application") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +RSC=rc.exe + +!IF "$(CFG)" == "wxIE - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c +# ADD CPP /nologo /MD /W3 /GX /O1 /Ob2 /I "$(WXWIN)\include" /I "$(WXWIN)\contrib\include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /D "__WINDOWS__" /D "__WXMSW__" /D "__WIN95__" /D "__WIN32__" /D WINVER=0x0400 /D "STRICT" /YX /FD /c +# ADD BASE RSC /l 0xc09 /d "NDEBUG" +# ADD RSC /l 0xc09 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib comctl32.lib rpcrt4.lib wsock32.lib winmm.lib wxmsw.lib /nologo /subsystem:windows /machine:I386 /nodefaultlib:"libc.lib" /nodefaultlib:"libci.lib" /nodefaultlib:"msvcrtd.lib" /libpath:"$(WXWIN)\Lib" /libpath:"$(WXWIN)\contrib\Lib" +# SUBTRACT LINK32 /pdb:none + +!ELSEIF "$(CFG)" == "wxIE - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c +# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "$(WXWIN)\lib\vc_dll\mswd" /I "$(WXWIN)\include" /I "$(WXWIN)\contrib\include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /D "__WINDOWS__" /D "__WXMSW__" /D DEBUG=1 /D "__WXDEBUG__" /D "__WIN95__" /D "__WIN32__" /D WINVER=0x0400 /D "STRICT" /Yu"wx/wxprec.h" /FD /GZ /c +# ADD BASE RSC /l 0xc09 /d "_DEBUG" +# ADD RSC /l 0xc09 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib comctl32.lib rpcrt4.lib wsock32.lib winmm.lib wxbase25d.lib wxbase25d_net.lib wxbase25d_xml.lib /nologo /subsystem:windows /debug /machine:I386 /nodefaultlib:"libcd.lib" /nodefaultlib:"libcid.lib" /nodefaultlib:"msvcrt.lib" /pdbtype:sept /libpath:"$(WXWIN)\Lib" /libpath:"$(WXWIN)\lib\vc_dll" /libpath:"$(WXWIN)\contrib\Lib" +# SUBTRACT LINK32 /pdb:none + +!ELSEIF "$(CFG)" == "wxIE - Win32 Unicode Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "wxIE___Win32_Unicode_Debug" +# PROP BASE Intermediate_Dir "wxIE___Win32_Unicode_Debug" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "wxIE___Win32_Unicode_Debug" +# PROP Intermediate_Dir "wxIE___Win32_Unicode_Debug" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "$(WXWIN)\include" /I "$(WXWIN)\contrib\include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /D "__WINDOWS__" /D "__WXMSW__" /D DEBUG=1 /D "__WXDEBUG__" /D "__WIN95__" /D "__WIN32__" /D WINVER=0x0400 /D "STRICT" /Yu"wx/wxprec.h" /FD /GZ /c +# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "$(WXWIN)\include" /I "$(WXWIN)\contrib\include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_WINDOWS" /D "__WINDOWS__" /D "__WXMSW__" /D DEBUG=1 /D "__WXDEBUG__" /D "__WIN95__" /D "__WIN32__" /D WINVER=0x0400 /D "STRICT" /D UNICODE=1 /Yu"wx/wxprec.h" /FD /GZ /c +# ADD BASE RSC /l 0xc09 /d "_DEBUG" +# ADD RSC /l 0xc09 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib comctl32.lib rpcrt4.lib wsock32.lib winmm.lib wxmswd.lib pngd.lib zlibd.lib jpegd.lib tiffd.lib /nologo /subsystem:windows /debug /machine:I386 /nodefaultlib:"libcd.lib" /nodefaultlib:"libcid.lib" /nodefaultlib:"msvcrt.lib" /out:"wxIE.exe" /pdbtype:sept /libpath:"$(WXWIN)\Lib" /libpath:"$(WXWIN)\contrib\Lib" +# SUBTRACT BASE LINK32 /pdb:none +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib comctl32.lib rpcrt4.lib wsock32.lib winmm.lib wxmswud.lib /nologo /subsystem:windows /debug /machine:I386 /nodefaultlib:"libcd.lib" /nodefaultlib:"libcid.lib" /nodefaultlib:"msvcrt.lib" /out:"wxIE.exe" /pdbtype:sept /libpath:"$(WXWIN)\Lib" /libpath:"$(WXWIN)\contrib\Lib" +# SUBTRACT LINK32 /pdb:none + +!ELSEIF "$(CFG)" == "wxIE - Win32 Unicode Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "wxIE___Win32_Unicode_Release" +# PROP BASE Intermediate_Dir "wxIE___Win32_Unicode_Release" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "wxIE___Win32_Unicode_Release" +# PROP Intermediate_Dir "wxIE___Win32_Unicode_Release" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MD /W3 /GX /O1 /Ob2 /I "$(WXWIN)\include" /I "$(WXWIN)\contrib\include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /D "__WINDOWS__" /D "__WXMSW__" /D "__WIN95__" /D "__WIN32__" /D WINVER=0x0400 /D "STRICT" /YX /FD /c +# ADD CPP /nologo /MD /W3 /GX /O1 /Ob2 /I "$(WXWIN)\include" /I "$(WXWIN)\contrib\include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /D "_WINDOWS" /D "__WINDOWS__" /D "__WXMSW__" /D "__WIN95__" /D "__WIN32__" /D WINVER=0x0400 /D "STRICT" /YX /FD /c +# ADD BASE RSC /l 0xc09 /d "NDEBUG" +# ADD RSC /l 0xc09 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib comctl32.lib rpcrt4.lib wsock32.lib winmm.lib wx.lib xpm.lib png.lib zlib.lib jpeg.lib tiff.lib /nologo /subsystem:windows /machine:I386 /nodefaultlib:"libc.lib" /nodefaultlib:"libci.lib" /nodefaultlib:"msvcrtd.lib" /out:"wxIE.exe" +# SUBTRACT BASE LINK32 /pdb:none +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib comctl32.lib rpcrt4.lib wsock32.lib winmm.lib wxmswu.lib /nologo /subsystem:windows /machine:I386 /nodefaultlib:"libc.lib" /nodefaultlib:"libci.lib" /nodefaultlib:"msvcrtd.lib" /out:"wxIE.exe" /libpath:"$(WXWIN)\Lib" /libpath:"$(WXWIN)\contrib\Lib" +# SUBTRACT LINK32 /pdb:none + +!ENDIF + +# Begin Target + +# Name "wxIE - Win32 Release" +# Name "wxIE - Win32 Debug" +# Name "wxIE - Win32 Unicode Debug" +# Name "wxIE - Win32 Unicode Release" +# Begin Group "Source Files" + +# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" +# Begin Source File + +SOURCE=.\IEHtmlWin.cpp + +!IF "$(CFG)" == "wxIE - Win32 Release" + +# SUBTRACT CPP /YX + +!ELSEIF "$(CFG)" == "wxIE - Win32 Debug" + +# SUBTRACT CPP /YX /Yc /Yu + +!ELSEIF "$(CFG)" == "wxIE - Win32 Unicode Debug" + +# SUBTRACT BASE CPP /YX /Yc /Yu +# SUBTRACT CPP /YX /Yc /Yu + +!ELSEIF "$(CFG)" == "wxIE - Win32 Unicode Release" + +# SUBTRACT BASE CPP /YX +# SUBTRACT CPP /YX + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\wxactivex.cpp + +!IF "$(CFG)" == "wxIE - Win32 Release" + +!ELSEIF "$(CFG)" == "wxIE - Win32 Debug" + +# SUBTRACT CPP /YX /Yc /Yu + +!ELSEIF "$(CFG)" == "wxIE - Win32 Unicode Debug" + +# SUBTRACT BASE CPP /YX /Yc /Yu +# SUBTRACT CPP /YX /Yc /Yu + +!ELSEIF "$(CFG)" == "wxIE - Win32 Unicode Release" + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\wxActiveXFrame.cpp +# End Source File +# Begin Source File + +SOURCE=.\wxIE.rc +# End Source File +# Begin Source File + +SOURCE=.\wxIEApp.cpp +# ADD CPP /Yc"wx/wxprec.h" +# End Source File +# Begin Source File + +SOURCE=.\wxIEFrm.cpp +# End Source File +# End Group +# Begin Group "Header Files" + +# PROP Default_Filter "h;hpp;hxx;hm;inl" +# Begin Source File + +SOURCE=.\IEHtmlWin.h +# End Source File +# Begin Source File + +SOURCE=.\resource.h +# End Source File +# Begin Source File + +SOURCE=.\wxactivex.h +# End Source File +# Begin Source File + +SOURCE=.\wxActiveXFrame.h +# End Source File +# Begin Source File + +SOURCE=.\wxIEApp.h +# End Source File +# Begin Source File + +SOURCE=.\wxIEFrm.h +# End Source File +# End Group +# Begin Group "Resource Files" + +# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" +# Begin Source File + +SOURCE=.\wx\msw\blank.cur +# End Source File +# Begin Source File + +SOURCE=.\wx\msw\bullseye.cur +# End Source File +# Begin Source File + +SOURCE=.\wx\msw\colours.bmp +# End Source File +# Begin Source File + +SOURCE=.\wx\msw\cross.bmp +# End Source File +# Begin Source File + +SOURCE=.\wx\msw\disable.bmp +# End Source File +# Begin Source File + +SOURCE=.\wx\msw\error.ico +# End Source File +# Begin Source File + +SOURCE=.\wx\msw\hand.cur +# End Source File +# Begin Source File + +SOURCE=.\wx\msw\info.ico +# End Source File +# Begin Source File + +SOURCE=.\wx\msw\magnif1.cur +# End Source File +# Begin Source File + +SOURCE=.\wx\msw\noentry.cur +# End Source File +# Begin Source File + +SOURCE=.\wx\msw\pbrush.cur +# End Source File +# Begin Source File + +SOURCE=.\wx\msw\pencil.cur +# End Source File +# Begin Source File + +SOURCE=.\wx\msw\plot_dwn.bmp +# End Source File +# Begin Source File + +SOURCE=.\wx\msw\plot_enl.bmp +# End Source File +# Begin Source File + +SOURCE=.\wx\msw\plot_shr.bmp +# End Source File +# Begin Source File + +SOURCE=.\wx\msw\plot_up.bmp +# End Source File +# Begin Source File + +SOURCE=.\wx\msw\plot_zin.bmp +# End Source File +# Begin Source File + +SOURCE=.\wx\msw\plot_zot.bmp +# End Source File +# Begin Source File + +SOURCE=.\wx\msw\pntleft.cur +# End Source File +# Begin Source File + +SOURCE=.\wx\msw\pntright.cur +# End Source File +# Begin Source File + +SOURCE=.\wx\msw\query.cur +# End Source File +# Begin Source File + +SOURCE=.\wx\msw\question.ico +# End Source File +# Begin Source File + +SOURCE=.\wx\msw\roller.cur +# End Source File +# Begin Source File + +SOURCE=.\wx\msw\size.cur +# End Source File +# Begin Source File + +SOURCE=.\wx\msw\tick.bmp +# End Source File +# Begin Source File + +SOURCE=.\wx\msw\tip.ico +# End Source File +# Begin Source File + +SOURCE=.\wx\msw\warning.ico +# End Source File +# Begin Source File + +SOURCE=.\wx\msw\watch1.cur +# End Source File +# Begin Source File + +SOURCE=.\wxIE.ico +# End Source File +# End Group +# Begin Source File + +SOURCE=.\default.doxygen +# End Source File +# Begin Source File + +SOURCE=.\license.txt +# End Source File +# Begin Source File + +SOURCE=.\makefile +# PROP Exclude_From_Scan -1 +# PROP BASE Exclude_From_Build 1 +# PROP Exclude_From_Build 1 +# End Source File +# Begin Source File + +SOURCE=.\makefile.gtk +# PROP Exclude_From_Scan -1 +# PROP BASE Exclude_From_Build 1 +# PROP Exclude_From_Build 1 +# End Source File +# Begin Source File + +SOURCE=.\makefile.mtf +# PROP Exclude_From_Scan -1 +# PROP BASE Exclude_From_Build 1 +# PROP Exclude_From_Build 1 +# End Source File +# Begin Source File + +SOURCE=.\notes.txt +# End Source File +# Begin Source File + +SOURCE=.\readme.txt +# End Source File +# Begin Source File + +SOURCE=.\wxIE.xpm +# PROP Exclude_From_Scan -1 +# PROP BASE Exclude_From_Build 1 +# PROP Exclude_From_Build 1 +# End Source File +# End Target +# End Project diff --git a/wxPython/contrib/activex/wxie/wxIE.ico b/wxPython/contrib/activex/wxie/wxIE.ico new file mode 100644 index 0000000000000000000000000000000000000000..2310c5d275a87af295d5ea8dc79ea417a5e74c53 GIT binary patch literal 766 zcmZQzU<5)11px*Sc)`TLAO@s0fLH;D9e|jTfdxnc0Z +#include +#include +#include +#include +#include + + + +///////////////////////////////////////////////////////////////////////////// +// English (U.S.) resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) +#ifdef _WIN32 +LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US +#pragma code_page(1252) +#endif //_WIN32 + + + +#ifdef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// TEXTINCLUDE +// + +1 TEXTINCLUDE DISCARDABLE +BEGIN + "resource.h\0" +END + +2 TEXTINCLUDE DISCARDABLE +BEGIN + "#include ""afxres.h""\r\n" + "\0" +END + +3 TEXTINCLUDE DISCARDABLE +BEGIN + "\r\n" + "\0" +END + +#endif // APSTUDIO_INVOKED + + +///////////////////////////////////////////////////////////////////////////// +// +// Bitmap +// + +/* +WXDISABLE_BUTTON_BITMAP BITMAP MOVEABLE PURE "wx/msw/disable.bmp" +WXBITMAP_STD_COLOURS BITMAP MOVEABLE PURE "wx/msw/colours.bmp" +TICK_BMP BITMAP MOVEABLE PURE "wx/msw/tick.bmp" +PLOT_ZOT_BMP BITMAP MOVEABLE PURE "wx/msw/plot_zot.bmp" +PLOT_ZIN_BMP BITMAP MOVEABLE PURE "wx/msw/plot_zin.bmp" +PLOT_UP_BMP BITMAP MOVEABLE PURE "wx/msw/plot_up.bmp" +PLOT_SHR_BMP BITMAP MOVEABLE PURE "wx/msw/plot_shr.bmp" +PLOT_ENL_BMP BITMAP MOVEABLE PURE "wx/msw/plot_enl.bmp" +PLOT_DWN_BMP BITMAP MOVEABLE PURE "wx/msw/plot_dwn.bmp" +CROSS_BMP BITMAP MOVEABLE PURE "wx/msw/cross.bmp" +*/ + +///////////////////////////////////////////////////////////////////////////// +// +// Cursor +// + +/* +WXCURSOR_WATCH CURSOR DISCARDABLE "wx\\msw\\watch1.cur" +WXCURSOR_SIZING CURSOR DISCARDABLE "wx/msw/size.cur" +WXCURSOR_ROLLER CURSOR DISCARDABLE "wx/msw/roller.cur" +WXCURSOR_QARROW CURSOR DISCARDABLE "wx/msw/query.cur" +WXCURSOR_PRIGHT CURSOR DISCARDABLE "wx/msw/pntright.cur" +WXCURSOR_PLEFT CURSOR DISCARDABLE "wx/msw/pntleft.cur" +WXCURSOR_PENCIL CURSOR DISCARDABLE "wx/msw/pencil.cur" +WXCURSOR_PBRUSH CURSOR DISCARDABLE "wx/msw/pbrush.cur" +WXCURSOR_NO_ENTRY CURSOR DISCARDABLE "wx/msw/noentry.cur" +WXCURSOR_MAGNIFIER CURSOR DISCARDABLE "wx/msw/magnif1.cur" +WXCURSOR_HAND CURSOR DISCARDABLE "wx/msw/hand.cur" +WXCURSOR_BULLSEYE CURSOR DISCARDABLE "wx/msw/bullseye.cur" +WXCURSOR_BLANK CURSOR DISCARDABLE "wx/msw/blank.cur" +*/ + +///////////////////////////////////////////////////////////////////////////// +// +// Dialog +// + +WXRESIZEABLEDIALOG DIALOG DISCARDABLE 34, 22, 144, 75 +STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME +BEGIN +END + +WXNOCAPTIONDIALOG DIALOG DISCARDABLE 34, 22, 144, 75 +STYLE WS_POPUP +BEGIN +END + +WXCAPTIONDIALOG DIALOG DISCARDABLE 34, 22, 144, 75 +STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "Dummy dialog" +BEGIN +END + + +///////////////////////////////////////////////////////////////////////////// +// +// Icon +// + +// Icon with lowest ID value placed first to ensure application icon +// remains consistent on all systems. +WXIE ICON DISCARDABLE "wxIE.ico" +/* +WXICON_WARNING ICON DISCARDABLE "wx\\msw\\warning.ico" +WXICON_TIP ICON DISCARDABLE "wx/msw/tip.ico" +WXICON_QUESTION ICON DISCARDABLE "wx/msw/question.ico" +WXICON_INFO ICON DISCARDABLE "wx/msw/info.ico" +WXICON_ERROR ICON DISCARDABLE "wx/msw/error.ico" +*/ + +///////////////////////////////////////////////////////////////////////////// +// +// Menu +// + +WXWINDOWMENU MENU DISCARDABLE +BEGIN + POPUP "&Window" + BEGIN + MENUITEM "&Cascade", 4002 + MENUITEM "Tile &Horizontally", 4001 + MENUITEM "Tile &Vertically", 4005 + MENUITEM "", 65535 + MENUITEM "&Arrange Icons", 4003 + MENUITEM "&Next", 4004 + END +END + +#endif // English (U.S.) resources +///////////////////////////////////////////////////////////////////////////// + + + +#ifndef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 3 resource. +// + + +///////////////////////////////////////////////////////////////////////////// +#endif // not APSTUDIO_INVOKED + diff --git a/wxPython/contrib/activex/wxie/wxIE.xpm b/wxPython/contrib/activex/wxie/wxIE.xpm new file mode 100644 index 0000000000..6148afb6ba --- /dev/null +++ b/wxPython/contrib/activex/wxie/wxIE.xpm @@ -0,0 +1,44 @@ +/* XPM */ +static char *wxIE_xpm[] = { +/* columns rows colors chars-per-pixel */ +"32 32 6 1", +" c Black", +". c Blue", +"X c #00bf00", +"o c Red", +"O c Yellow", +"+ c Gray100", +/* pixels */ +" ", +" oooooo +++++++++++++++++++++++ ", +" oooooo +++++++++++++++++++++++ ", +" oooooo +++++++++++++++++++++++ ", +" oooooo +++++++++++++++++++++++ ", +" oooooo +++++++++++++++++++++++ ", +" oooooo +++++++++++++++++++++++ ", +" oooooo +++++++++++++++++++++++ ", +" ", +" ++++++ ++++++++++++++++++ .... ", +" ++++++ ++++++++++++++++++ .... ", +" ++++++ ++++++++++++++++++ .... ", +" ++++++ ++++++++++++++++++ .... ", +" ++++++ ++++++++++++++++++ .... ", +" ++++++ ++++++++++++++++++ ", +" ++++++ ++++++++++++++++++ ++++ ", +" ++++++ ++++++++++++++++++ ++++ ", +" ++++++ ++++++++++++++++++ ++++ ", +" ++++++ ++++++++++++++++++ ++++ ", +" ++++++ ++++++++++++++++++ ++++ ", +" ++++++ ++++++++++++++++++ ++++ ", +" ++++++ ++++++++++++++++++ ++++ ", +" ++++++ ++++++++++++++++++ ++++ ", +" ++++++ ++++++++++++++++++ ++++ ", +" ++++++ ++++ ", +" ++++++ OOOOOOOOOOOO XXXXX ++++ ", +" ++++++ OOOOOOOOOOOO XXXXX ++++ ", +" ++++++ OOOOOOOOOOOO XXXXX ++++ ", +" ++++++ OOOOOOOOOOOO XXXXX ++++ ", +" ++++++ OOOOOOOOOOOO XXXXX ++++ ", +" ++++++ OOOOOOOOOOOO XXXXX ++++ ", +" " +}; diff --git a/wxPython/contrib/activex/wxie/wxIEApp.cpp b/wxPython/contrib/activex/wxie/wxIEApp.cpp new file mode 100644 index 0000000000..1c1dd737a5 --- /dev/null +++ b/wxPython/contrib/activex/wxie/wxIEApp.cpp @@ -0,0 +1,99 @@ +/* + wxActiveX Library Licence, Version 3 + ==================================== + + Copyright (C) 2003 Lindsay Mathieson [, ...] + + Everyone is permitted to copy and distribute verbatim copies + of this licence document, but changing it is not allowed. + + wxActiveX LIBRARY LICENCE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + This library is free software; you can redistribute it and/or modify it + under the terms of the GNU Library General Public Licence as published by + the Free Software Foundation; either version 2 of the Licence, or (at + your option) any later version. + + This library is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library + General Public Licence for more details. + + You should have received a copy of the GNU Library General Public Licence + along with this software, usually in a file named COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, + Boston, MA 02111-1307 USA. + + EXCEPTION NOTICE + + 1. As a special exception, the copyright holders of this library give + permission for additional uses of the text contained in this release of + the library as licenced under the wxActiveX Library Licence, applying + either version 3 of the Licence, or (at your option) any later version of + the Licence as published by the copyright holders of version 3 of the + Licence document. + + 2. The exception is that you may use, copy, link, modify and distribute + under the user's own terms, binary object code versions of works based + on the Library. + + 3. If you copy code from files distributed under the terms of the GNU + General Public Licence or the GNU Library General Public Licence into a + copy of this library, as this licence permits, the exception does not + apply to the code that you add in this way. To avoid misleading anyone as + to the status of such modified files, you must delete this exception + notice from such code and/or adjust the licensing conditions notice + accordingly. + + 4. If you write modifications of your own for this library, it is your + choice whether to permit this exception to apply to your modifications. + If you do not wish that, you must delete the exception notice from such + code and/or adjust the licensing conditions notice accordingly. +*/ + +// ---------------------------------------------------------------------------- +// headers +// ---------------------------------------------------------------------------- +// For compilers that support precompilation, includes "wx/wx.h". +#if defined(__WXGTK__) || defined(__WXMOTIF__) + #include "wx/wx.h" +#endif +#include "wx/wxprec.h" +#include "wxIEApp.h" +#include "wxIEFrm.h" +#include "resource.h" + + + +// Create a new application object: this macro will allow wxWindows to create +// the application object during program execution (it's better than using a +// static object for many reasons) and also declares the accessor function +// wxGetApp() which will return the reference of the right type (i.e. wxIEApp and +// not wxApp) +IMPLEMENT_APP(wxIEApp) + +// ============================================================================ +// implementation +// ============================================================================ + +// ---------------------------------------------------------------------------- +// the application class +// ---------------------------------------------------------------------------- + +// 'Main program' equivalent: the program execution "starts" here +bool wxIEApp::OnInit() +{ + // create the main application window + wxIEFrame *frame = new wxIEFrame(wxT("IE Test")); + + // and show it (the frames, unlike simple controls, are not shown when + // created initially) + frame->Show(TRUE); + + // success: wxApp::OnRun() will be called which will enter the main message + // loop and the application will run. If we returned FALSE here, the + // application would exit immediately. + return TRUE; +} + diff --git a/wxPython/contrib/activex/wxie/wxIEApp.h b/wxPython/contrib/activex/wxie/wxIEApp.h new file mode 100644 index 0000000000..71783d221c --- /dev/null +++ b/wxPython/contrib/activex/wxie/wxIEApp.h @@ -0,0 +1,66 @@ +/* + wxActiveX Library Licence, Version 3 + ==================================== + + Copyright (C) 2003 Lindsay Mathieson [, ...] + + Everyone is permitted to copy and distribute verbatim copies + of this licence document, but changing it is not allowed. + + wxActiveX LIBRARY LICENCE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + This library is free software; you can redistribute it and/or modify it + under the terms of the GNU Library General Public Licence as published by + the Free Software Foundation; either version 2 of the Licence, or (at + your option) any later version. + + This library is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library + General Public Licence for more details. + + You should have received a copy of the GNU Library General Public Licence + along with this software, usually in a file named COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, + Boston, MA 02111-1307 USA. + + EXCEPTION NOTICE + + 1. As a special exception, the copyright holders of this library give + permission for additional uses of the text contained in this release of + the library as licenced under the wxActiveX Library Licence, applying + either version 3 of the Licence, or (at your option) any later version of + the Licence as published by the copyright holders of version 3 of the + Licence document. + + 2. The exception is that you may use, copy, link, modify and distribute + under the user's own terms, binary object code versions of works based + on the Library. + + 3. If you copy code from files distributed under the terms of the GNU + General Public Licence or the GNU Library General Public Licence into a + copy of this library, as this licence permits, the exception does not + apply to the code that you add in this way. To avoid misleading anyone as + to the status of such modified files, you must delete this exception + notice from such code and/or adjust the licensing conditions notice + accordingly. + + 4. If you write modifications of your own for this library, it is your + choice whether to permit this exception to apply to your modifications. + If you do not wish that, you must delete the exception notice from such + code and/or adjust the licensing conditions notice accordingly. +*/ + +// Define a new application type, each program should derive a class from wxApp +class wxIEApp : public wxApp +{ +public: + // override base class virtuals + // ---------------------------- + + // this one is called on application startup and is a good place for the app + // initialization (doing it here and not in the ctor allows to have an error + // return: if OnInit() returns false, the application terminates) + virtual bool OnInit(); +}; diff --git a/wxPython/contrib/activex/wxie/wxIEFrm.cpp b/wxPython/contrib/activex/wxie/wxIEFrm.cpp new file mode 100644 index 0000000000..61d624c127 --- /dev/null +++ b/wxPython/contrib/activex/wxie/wxIEFrm.cpp @@ -0,0 +1,381 @@ +/* + wxActiveX Library Licence, Version 3 + ==================================== + + Copyright (C) 2003 Lindsay Mathieson [, ...] + + Everyone is permitted to copy and distribute verbatim copies + of this licence document, but changing it is not allowed. + + wxActiveX LIBRARY LICENCE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + This library is free software; you can redistribute it and/or modify it + under the terms of the GNU Library General Public Licence as published by + the Free Software Foundation; either version 2 of the Licence, or (at + your option) any later version. + + This library is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library + General Public Licence for more details. + + You should have received a copy of the GNU Library General Public Licence + along with this software, usually in a file named COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, + Boston, MA 02111-1307 USA. + + EXCEPTION NOTICE + + 1. As a special exception, the copyright holders of this library give + permission for additional uses of the text contained in this release of + the library as licenced under the wxActiveX Library Licence, applying + either version 3 of the Licence, or (at your option) any later version of + the Licence as published by the copyright holders of version 3 of the + Licence document. + + 2. The exception is that you may use, copy, link, modify and distribute + under the user's own terms, binary object code versions of works based + on the Library. + + 3. If you copy code from files distributed under the terms of the GNU + General Public Licence or the GNU Library General Public Licence into a + copy of this library, as this licence permits, the exception does not + apply to the code that you add in this way. To avoid misleading anyone as + to the status of such modified files, you must delete this exception + notice from such code and/or adjust the licensing conditions notice + accordingly. + + 4. If you write modifications of your own for this library, it is your + choice whether to permit this exception to apply to your modifications. + If you do not wish that, you must delete the exception notice from such + code and/or adjust the licensing conditions notice accordingly. +*/ + +// ---------------------------------------------------------------------------- +// headers +// ---------------------------------------------------------------------------- +// For compilers that support precompilation, includes "wx/wx.h". +#if defined(__WXGTK__) || defined(__WXMOTIF__) + #include "wx/wx.h" +#endif +#include "wx/wxprec.h" +#include "wx/filedlg.h" +#include "wxIEApp.h" +#include "wxIEFrm.h" +#include "wxActiveXFrame.h" +#include +#include +using namespace std; +#include + +// ---------------------------------------------------------------------------- +// resources +// ---------------------------------------------------------------------------- +// the application icon +#if defined(__WXGTK__) || defined(__WXMOTIF__) + #include "wxIE.xpm" +#endif + +// ---------------------------------------------------------------------------- +// constants +// ---------------------------------------------------------------------------- + +// IDs for the controls and the menu commands +enum +{ + // menu items + FILE_QUIT = 1, + FILE_OPEN, + FILE_BROWSE, + FILE_HTML_EDITMODE, + FILE_TEST_HTML, + FILE_TEST_SELECT, + FILE_TEST_HTMLSELECT, + FILE_TEST_GETTEXT, + FILE_TEST_HTMLGETTEXT, + FILE_TEST_HOME, + FILE_TEST_ACTIVEX, + FILE_ABOUT, + + // controls + ID_MSHTML = 501, + ID_PROGRESS_GAUGE +}; + +// ---------------------------------------------------------------------------- +// event tables and other macros for wxWindows +// ---------------------------------------------------------------------------- + +// the event tables connect the wxWindows events with the functions (event +// handlers) which process them. It can be also done at run-time, but for the +// simple menu events like this the static method is much simpler. +BEGIN_EVENT_TABLE(wxIEFrame, wxFrame) + EVT_SIZE(wxIEFrame::OnSize) + EVT_MENU(FILE_QUIT, wxIEFrame::OnQuit) + EVT_MENU(FILE_BROWSE, wxIEFrame::OnBrowse) + EVT_MENU(FILE_OPEN, wxIEFrame::OnOpen) + EVT_MENU(FILE_HTML_EDITMODE, wxIEFrame::OnEditMode) + EVT_UPDATE_UI(FILE_HTML_EDITMODE, wxIEFrame::OnEditModeUI) + EVT_MENU(FILE_TEST_HTML, wxIEFrame::OnTestHTML) + EVT_MENU(FILE_TEST_SELECT, wxIEFrame::OnTestSelect) + EVT_MENU(FILE_TEST_HTMLSELECT, wxIEFrame::OnTestHTMLSelect) + EVT_MENU(FILE_TEST_GETTEXT, wxIEFrame::OnTestGetText) + EVT_MENU(FILE_TEST_HTMLGETTEXT, wxIEFrame::OnTestHTMLGetText) + EVT_MENU(FILE_TEST_HOME, wxIEFrame::OnTestHome) + EVT_MENU(FILE_TEST_ACTIVEX, wxIEFrame::OnTestActiveX) + EVT_MENU(FILE_ABOUT, wxIEFrame::OnAbout) + + // ActiveX Events + EVT_ACTIVEX_DISPID(ID_MSHTML, DISPID_STATUSTEXTCHANGE, OnMSHTMLStatusTextChangeX) + EVT_ACTIVEX(ID_MSHTML, "BeforeNavigate2", OnMSHTMLBeforeNavigate2X) + EVT_ACTIVEX(ID_MSHTML, "TitleChange", OnMSHTMLTitleChangeX) + EVT_ACTIVEX(ID_MSHTML, "NewWindow2", OnMSHTMLNewWindow2X) + EVT_ACTIVEX(ID_MSHTML, "ProgressChange", OnMSHTMLProgressChangeX) +END_EVENT_TABLE() + +// ---------------------------------------------------------------------------- +// main frame +// ---------------------------------------------------------------------------- + +// frame constructor +wxIEFrame::wxIEFrame(const wxString& title, const wxPoint& pos, const wxSize& size) + : wxFrame((wxFrame *)NULL, -1, title, pos, size) +{ + // set the frame icon + SetIcon(wxICON(wxIE)); + + // create a menu bar + wxMenu *menuFile = new wxMenu("", wxMENU_TEAROFF); + + // the "About" item should be in the help menu + wxMenu *helpMenu = new wxMenu; + helpMenu->Append(FILE_ABOUT, "&About...\tCtrl-A", "Show about dialog"); + + menuFile->Append(FILE_TEST_HTML, "Test HTML", "Demonstrates LoadString()"); + menuFile->Append(FILE_OPEN, "Open HTML File", "Demonstrates LoadStream(istream *)"); + menuFile->Append(FILE_BROWSE, "Browse Web Page", "Demonstrates LoadUrl(url)"); + menuFile->Append(FILE_HTML_EDITMODE, "Edit Mode", "Demonstrates editing html", true); + menuFile->AppendSeparator(); + menuFile->Append(FILE_TEST_SELECT, "Get Selected Text", "Demonstrates GetStringSelection(false)"); + menuFile->Append(FILE_TEST_HTMLSELECT, "Get HTML Selected Text", "Demonstrates GetStringSelection(true)"); + menuFile->AppendSeparator(); + menuFile->Append(FILE_TEST_GETTEXT, "Get Text", "Demonstrates GetText(false)"); + menuFile->Append(FILE_TEST_HTMLGETTEXT, "Get HTML Text", "Demonstrates GetText(true)"); + menuFile->Append(FILE_TEST_HOME, "Open Home Page", "Demonstrates GoHome()"); + menuFile->AppendSeparator(); + menuFile->Append(FILE_TEST_ACTIVEX, "Display a ActiveX control", "Demonstrates the Generic ActiveX Container"); + menuFile->AppendSeparator(); + menuFile->Append(FILE_QUIT, "E&xit\tAlt-X", "Quit this program"); + + // now append the freshly created menu to the menu bar... + wxMenuBar *menuBar = new wxMenuBar(); + menuBar->Append(menuFile, "&File"); + menuBar->Append(helpMenu, "&Help"); + + // ... and attach this menu bar to the frame + SetMenuBar(menuBar); + + // create a status bar just for fun (by default with 1 pane only) + wxStatusBar * sb = CreateStatusBar(2); + SetStatusText("Ready"); + + // progress gauge (belongs to status bar) + m_gauge = new wxGauge(sb, ID_PROGRESS_GAUGE, 100); + + // IE Control + m_ie = new wxIEHtmlWin(this, ID_MSHTML); + +} + + +// event handlers + +void wxIEFrame::OnSize(wxSizeEvent& event) +{ + wxFrame::OnSize(event); + + wxStatusBar* sb = GetStatusBar(); + if (! sb) + return; + + wxRect rc; + sb->GetFieldRect(1, rc); + + m_gauge->SetSize(rc); +}; + +void wxIEFrame::OnQuit(wxCommandEvent& WXUNUSED(event)) +{ + // TRUE is to force the frame to close + Close(TRUE); +} + +void wxIEFrame::OnAbout(wxCommandEvent& WXUNUSED(event)) +{ + wxString msg; + msg.Printf( _T("About wxIE...\n")); + wxMessageBox(msg, "About wxIE", wxOK | wxICON_INFORMATION, this); +} + +void wxIEFrame::OnTestHTML(wxCommandEvent& WXUNUSED(event)) +{ + wxString html = + "

Hello World

Plain Text"; + m_ie->LoadString(html); +} + + +void wxIEFrame::OnTestSelect(wxCommandEvent& WXUNUSED(event)) +{ + wxString s = m_ie->GetStringSelection(); + + wxMessageBox(s); +} + +void wxIEFrame::OnTestHTMLSelect(wxCommandEvent& WXUNUSED(event)) +{ + wxString s = m_ie->GetStringSelection(true); + + wxMessageBox(s); +} + +void wxIEFrame::OnTestGetText(wxCommandEvent& WXUNUSED(event)) +{ + wxString s = m_ie->GetText(); + + wxMessageBox(s); +} + +void wxIEFrame::OnTestHTMLGetText(wxCommandEvent& WXUNUSED(event)) +{ + wxString s = m_ie->GetText(true); + + wxMessageBox(s); +} + +void wxIEFrame::OnTestHome(wxCommandEvent& WXUNUSED(event)) +{ + m_ie->GoHome(); +}; + + +void wxIEFrame::OnOpen(wxCommandEvent& WXUNUSED(event)) +{ + wxFileDialog dlg(this, "Chooose a HTML File", "", "", "HTML files (*.html; *.htm)|*.html;*.htm|",wxOPEN); + + if (dlg.ShowModal() == wxID_OK) + { + wxString fname = dlg.GetPath(); + + ifstream *is = new ifstream(fname.mb_str()); + m_ie->LoadStream(is); + }; +} + +void wxIEFrame::OnEditMode(wxCommandEvent& WXUNUSED(event)) +{ + m_ie->SetEditMode(! m_ie->GetEditMode()); +} + +void wxIEFrame::OnEditModeUI(wxUpdateUIEvent& event) +{ + if (m_ie) + event.Check(m_ie->GetEditMode()); +} + +void wxIEFrame::OnBrowse(wxCommandEvent& WXUNUSED(event)) +{ + wxString url = wxGetTextFromUser("Enter URL:", "Browse", "", this); + + m_ie->LoadUrl(url); +} + +void wxIEFrame::OnMSHTMLStatusTextChangeX(wxActiveXEvent& event) +{ + SetStatusText(event["Text"]); +}; + + +void wxIEFrame::OnMSHTMLBeforeNavigate2X(wxActiveXEvent& event) +{ + wxString url = event["Url"]; + if (url == "about:blank") + return; + + int rc = wxMessageBox(url, "Allow open url ?", wxYES_NO); + + if (rc != wxYES) + event["Cancel"] = true; +}; + +void wxIEFrame::OnMSHTMLTitleChangeX(wxActiveXEvent& event) +{ + SetTitle(event["Text"]); +}; + + +void wxIEFrame::OnMSHTMLNewWindow2X(wxActiveXEvent& event) +{ + int rc = wxMessageBox("New Window requested", "Allow New Window ?", wxYES_NO); + + if (rc != wxYES) + event["Cancel"] = true; +}; + + +void wxIEFrame::OnMSHTMLProgressChangeX(wxActiveXEvent& event) +{ + if ((long) event["ProgressMax"] != m_gauge->GetRange()) + m_gauge->SetRange((long) event["ProgressMax"]); + + m_gauge->SetValue((long) event["Progress"]); +}; + +void wxIEFrame::OnTestActiveX(wxCommandEvent& WXUNUSED(event)) +{ +// Some known prog ids +//#define PROGID "Shell.Explorer" +//#define PROGID CLSID_WebBrowser +//#define PROGID CLSID_MozillaBrowser +//#define PROGID CLSID_HTMLDocument +//#define PROGID "MSCAL.Calendar" +//#define PROGID "WordPad.Document" +//#define PROGID "SoftwareFX.ChartFX" +//#define PROGID "PDF.PdfCtrl" +#define PROGID "ShockwaveFlash.ShockwaveFlash" + + wxDialog dlg(this, -1, wxString(wxT("Test ActiveX"))); + + wxFlexGridSizer *sz = new wxFlexGridSizer(2); + sz->Add(new wxStaticText(&dlg, -1, wxT("Enter a ActiveX ProgId")), 0, wxALL, 5 ); + + wxComboBox *cb = new wxComboBox(&dlg, 101, ""); + cb->Append(wxT("ShockwaveFlash.ShockwaveFlash")); + cb->Append(wxT("MSCAL.Calendar")); + cb->Append(wxT("Shell.Explorer")); + cb->Append(wxT("WordPad.Document.1")); + cb->Append(wxT("SoftwareFX.ChartFX.20")); + cb->Append(wxT("PDF.PdfCtrl.5")); + cb->SetSelection(0); + + sz->Add(cb, 0, wxALL, 5 ); + + // next row + sz->Add(new wxButton(&dlg, wxID_CANCEL, "Cancel"), 0, wxALIGN_RIGHT|wxALL, 5 ); + sz->Add(new wxButton(&dlg, wxID_OK, "Ok"), 0, wxALIGN_RIGHT|wxALL, 5 ); + + dlg.SetAutoLayout( TRUE ); + dlg.SetSizer(sz); + sz->Fit(&dlg); + sz->SetSizeHints(&dlg); + + + if (dlg.ShowModal() == wxID_OK) + { + wxString progId = cb->GetValue(); + wxActiveXFrame *frame = new wxActiveXFrame(this, progId); + frame->Show(); + }; +} + diff --git a/wxPython/contrib/activex/wxie/wxIEFrm.h b/wxPython/contrib/activex/wxie/wxIEFrm.h new file mode 100644 index 0000000000..58149f1a35 --- /dev/null +++ b/wxPython/contrib/activex/wxie/wxIEFrm.h @@ -0,0 +1,95 @@ +/* + wxActiveX Library Licence, Version 3 + ==================================== + + Copyright (C) 2003 Lindsay Mathieson [, ...] + + Everyone is permitted to copy and distribute verbatim copies + of this licence document, but changing it is not allowed. + + wxActiveX LIBRARY LICENCE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + This library is free software; you can redistribute it and/or modify it + under the terms of the GNU Library General Public Licence as published by + the Free Software Foundation; either version 2 of the Licence, or (at + your option) any later version. + + This library is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library + General Public Licence for more details. + + You should have received a copy of the GNU Library General Public Licence + along with this software, usually in a file named COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, + Boston, MA 02111-1307 USA. + + EXCEPTION NOTICE + + 1. As a special exception, the copyright holders of this library give + permission for additional uses of the text contained in this release of + the library as licenced under the wxActiveX Library Licence, applying + either version 3 of the Licence, or (at your option) any later version of + the Licence as published by the copyright holders of version 3 of the + Licence document. + + 2. The exception is that you may use, copy, link, modify and distribute + under the user's own terms, binary object code versions of works based + on the Library. + + 3. If you copy code from files distributed under the terms of the GNU + General Public Licence or the GNU Library General Public Licence into a + copy of this library, as this licence permits, the exception does not + apply to the code that you add in this way. To avoid misleading anyone as + to the status of such modified files, you must delete this exception + notice from such code and/or adjust the licensing conditions notice + accordingly. + + 4. If you write modifications of your own for this library, it is your + choice whether to permit this exception to apply to your modifications. + If you do not wish that, you must delete the exception notice from such + code and/or adjust the licensing conditions notice accordingly. +*/ + +#include "IEHtmlWin.h" +#include "wx/gauge.h" + +// Define a new frame type: this is going to be our main frame +class wxIEFrame : public wxFrame +{ +public: + wxIEHtmlWin *m_ie; + wxGauge *m_gauge; + + // ctor(s) + wxIEFrame(const wxString& title, const wxPoint& pos = wxDefaultPosition, + const wxSize& size = wxDefaultSize); + + // event handlers (these functions should _not_ be virtual) + void OnSize(wxSizeEvent& event); + void OnQuit(wxCommandEvent& event); + void OnAbout(wxCommandEvent& event); + + void OnEditMode(wxCommandEvent& event); + void OnEditModeUI(wxUpdateUIEvent& event); + void OnBrowse(wxCommandEvent& event); + void OnOpen(wxCommandEvent& event); + void OnTestHTML(wxCommandEvent& event); + void OnTestSelect(wxCommandEvent& event); + void OnTestHTMLSelect(wxCommandEvent& event); + void OnTestGetText(wxCommandEvent& event); + void OnTestHTMLGetText(wxCommandEvent& event); + void OnTestHome(wxCommandEvent& event); + void OnTestActiveX(wxCommandEvent& event); + +private: + // any class wishing to process wxWindows events must use this macro + DECLARE_EVENT_TABLE() + + void OnMSHTMLStatusTextChangeX(wxActiveXEvent& event); + void OnMSHTMLBeforeNavigate2X(wxActiveXEvent& event); + void OnMSHTMLTitleChangeX(wxActiveXEvent& event); + void OnMSHTMLNewWindow2X(wxActiveXEvent& event); + void OnMSHTMLProgressChangeX(wxActiveXEvent& event); +}; diff --git a/wxPython/contrib/activex/wxie/wxactivex.cpp b/wxPython/contrib/activex/wxie/wxactivex.cpp new file mode 100644 index 0000000000..4cdb00010f --- /dev/null +++ b/wxPython/contrib/activex/wxie/wxactivex.cpp @@ -0,0 +1,2714 @@ +/* + wxActiveX Library Licence, Version 3 + ==================================== + + Copyright (C) 2003 Lindsay Mathieson [, ...] + + Everyone is permitted to copy and distribute verbatim copies + of this licence document, but changing it is not allowed. + + wxActiveX LIBRARY LICENCE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + This library is free software; you can redistribute it and/or modify it + under the terms of the GNU Library General Public Licence as published by + the Free Software Foundation; either version 2 of the Licence, or (at + your option) any later version. + + This library is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library + General Public Licence for more details. + + You should have received a copy of the GNU Library General Public Licence + along with this software, usually in a file named COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, + Boston, MA 02111-1307 USA. + + EXCEPTION NOTICE + + 1. As a special exception, the copyright holders of this library give + permission for additional uses of the text contained in this release of + the library as licenced under the wxActiveX Library Licence, applying + either version 3 of the Licence, or (at your option) any later version of + the Licence as published by the copyright holders of version 3 of the + Licence document. + + 2. The exception is that you may use, copy, link, modify and distribute + under the user's own terms, binary object code versions of works based + on the Library. + + 3. If you copy code from files distributed under the terms of the GNU + General Public Licence or the GNU Library General Public Licence into a + copy of this library, as this licence permits, the exception does not + apply to the code that you add in this way. To avoid misleading anyone as + to the status of such modified files, you must delete this exception + notice from such code and/or adjust the licensing conditions notice + accordingly. + + 4. If you write modifications of your own for this library, it is your + choice whether to permit this exception to apply to your modifications. + If you do not wish that, you must delete the exception notice from such + code and/or adjust the licensing conditions notice accordingly. +*/ + +#include "wxActiveX.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +using namespace std; + +// Depending on compilation mode, the wx headers may have undef'd +// this, but in this case we need it so the virtual method in +// FrameSite will match what is in oleidl.h. +#ifndef GetObject + #ifdef _UNICODE + #define GetObject GetObjectW + #else + #define GetObject GetObjectA + #endif +#endif + + +////////////////////////////////////////////////////////////////////// +BEGIN_EVENT_TABLE(wxActiveX, wxWindow) + EVT_SIZE(wxActiveX::OnSize) + EVT_PAINT(wxActiveX::OnPaint) + EVT_MOUSE_EVENTS(wxActiveX::OnMouse) + EVT_SET_FOCUS(wxActiveX::OnSetFocus) + EVT_KILL_FOCUS(wxActiveX::OnKillFocus) +END_EVENT_TABLE() + +class wxActiveX; + +class FrameSite : + public IOleClientSite, + public IOleInPlaceSiteEx, + public IOleInPlaceFrame, + public IOleItemContainer, + public IDispatch, + public IOleCommandTarget, + public IOleDocumentSite, + public IAdviseSink, + public IOleControlSite +{ +private: + DECLARE_OLE_UNKNOWN(FrameSite); + +public: + FrameSite(wxActiveX * win); + virtual ~FrameSite(); + + //IOleWindow + STDMETHODIMP GetWindow(HWND*); + STDMETHODIMP ContextSensitiveHelp(BOOL); + + //IOleInPlaceUIWindow + STDMETHODIMP GetBorder(LPRECT); + STDMETHODIMP RequestBorderSpace(LPCBORDERWIDTHS); + STDMETHODIMP SetBorderSpace(LPCBORDERWIDTHS); + STDMETHODIMP SetActiveObject(IOleInPlaceActiveObject*, LPCOLESTR); + + //IOleInPlaceFrame + STDMETHODIMP InsertMenus(HMENU, LPOLEMENUGROUPWIDTHS); + STDMETHODIMP SetMenu(HMENU, HOLEMENU, HWND); + STDMETHODIMP RemoveMenus(HMENU); + STDMETHODIMP SetStatusText(LPCOLESTR); + STDMETHODIMP EnableModeless(BOOL); + STDMETHODIMP TranslateAccelerator(LPMSG, WORD); + + //IOleInPlaceSite + STDMETHODIMP CanInPlaceActivate(); + STDMETHODIMP OnInPlaceActivate(); + STDMETHODIMP OnUIActivate(); + STDMETHODIMP GetWindowContext(IOleInPlaceFrame**, IOleInPlaceUIWindow**, + LPRECT, LPRECT, LPOLEINPLACEFRAMEINFO); + STDMETHODIMP Scroll(SIZE); + STDMETHODIMP OnUIDeactivate(BOOL); + STDMETHODIMP OnInPlaceDeactivate(); + STDMETHODIMP DiscardUndoState(); + STDMETHODIMP DeactivateAndUndo(); + STDMETHODIMP OnPosRectChange(LPCRECT); + + //IOleInPlaceSiteEx + STDMETHODIMP OnInPlaceActivateEx(BOOL*, DWORD); + STDMETHODIMP OnInPlaceDeactivateEx(BOOL); + STDMETHODIMP RequestUIActivate(); + + //IOleClientSite + STDMETHODIMP SaveObject(); + STDMETHODIMP GetMoniker(DWORD, DWORD, IMoniker**); + STDMETHODIMP GetContainer(LPOLECONTAINER FAR*); + STDMETHODIMP ShowObject(); + STDMETHODIMP OnShowWindow(BOOL); + STDMETHODIMP RequestNewObjectLayout(); + + //IOleControlSite + STDMETHODIMP OnControlInfoChanged(); + STDMETHODIMP LockInPlaceActive(BOOL); + STDMETHODIMP GetExtendedControl(IDispatch**); + STDMETHODIMP TransformCoords(POINTL*, POINTF*, DWORD); + STDMETHODIMP TranslateAccelerator(LPMSG, DWORD); + STDMETHODIMP OnFocus(BOOL); + STDMETHODIMP ShowPropertyFrame(); + + //IOleCommandTarget + STDMETHODIMP QueryStatus(const GUID*, ULONG, OLECMD[], OLECMDTEXT*); + STDMETHODIMP Exec(const GUID*, DWORD, DWORD, VARIANTARG*, VARIANTARG*); + + //IParseDisplayName + STDMETHODIMP ParseDisplayName(IBindCtx*, LPOLESTR, ULONG*, IMoniker**); + + //IOleContainer + STDMETHODIMP EnumObjects(DWORD, IEnumUnknown**); + STDMETHODIMP LockContainer(BOOL); + + //IOleItemContainer + STDMETHODIMP GetObject(LPOLESTR, DWORD, IBindCtx*, REFIID, void**); + STDMETHODIMP GetObjectStorage(LPOLESTR, IBindCtx*, REFIID, void**); + STDMETHODIMP IsRunning(LPOLESTR); + + //IDispatch + STDMETHODIMP GetIDsOfNames(REFIID, OLECHAR**, unsigned int, LCID, DISPID*); + STDMETHODIMP GetTypeInfo(unsigned int, LCID, ITypeInfo**); + STDMETHODIMP GetTypeInfoCount(unsigned int*); + STDMETHODIMP Invoke(DISPID, REFIID, LCID, WORD, DISPPARAMS*, VARIANT*, EXCEPINFO*, UINT*); + + //IAdviseSink + void STDMETHODCALLTYPE OnDataChange(FORMATETC*, STGMEDIUM*); + void STDMETHODCALLTYPE OnViewChange(DWORD, LONG); + void STDMETHODCALLTYPE OnRename(IMoniker*); + void STDMETHODCALLTYPE OnSave(); + void STDMETHODCALLTYPE OnClose(); + + // IOleDocumentSite + HRESULT STDMETHODCALLTYPE ActivateMe(IOleDocumentView __RPC_FAR *pViewToActivate); + +protected: + + wxActiveX * m_window; + + HDC m_hDCBuffer; + HWND m_hWndParent; + + bool m_bSupportsWindowlessActivation; + bool m_bInPlaceLocked; + bool m_bInPlaceActive; + bool m_bUIActive; + bool m_bWindowless; + + + + LCID m_nAmbientLocale; + COLORREF m_clrAmbientForeColor; + COLORREF m_clrAmbientBackColor; + bool m_bAmbientShowHatching; + bool m_bAmbientShowGrabHandles; + bool m_bAmbientAppearance; +}; + +DEFINE_OLE_TABLE(FrameSite) + OLE_INTERFACE(IID_IUnknown, IOleClientSite) + + OLE_IINTERFACE(IOleClientSite) + + OLE_INTERFACE(IID_IOleWindow, IOleInPlaceSite) + OLE_IINTERFACE(IOleInPlaceSite) + OLE_IINTERFACE(IOleInPlaceSiteEx) + + //OLE_IINTERFACE(IOleWindow) + OLE_IINTERFACE(IOleInPlaceUIWindow) + OLE_IINTERFACE(IOleInPlaceFrame) + + OLE_IINTERFACE(IParseDisplayName) + OLE_IINTERFACE(IOleContainer) + OLE_IINTERFACE(IOleItemContainer) + + OLE_IINTERFACE(IDispatch) + + OLE_IINTERFACE(IOleCommandTarget) + + OLE_IINTERFACE(IOleDocumentSite) + + OLE_IINTERFACE(IAdviseSink) + + OLE_IINTERFACE(IOleControlSite) + +END_OLE_TABLE; + + +wxActiveX::wxActiveX(wxWindow * parent, REFCLSID clsid, wxWindowID id, + const wxPoint& pos, + const wxSize& size, + long style, + const wxString& name) : +wxWindow(parent, id, pos, size, style, name) +{ + m_bAmbientUserMode = true; + m_docAdviseCookie = 0; + CreateActiveX(clsid); +} + +wxActiveX::wxActiveX(wxWindow * parent, const wxString& progId, wxWindowID id, + const wxPoint& pos, + const wxSize& size, + long style, + const wxString& name) : + wxWindow(parent, id, pos, size, style, name) +{ + m_bAmbientUserMode = true; + m_docAdviseCookie = 0; + CreateActiveX((LPOLESTR) (const wchar_t *) progId.wc_str(wxConvUTF8)); +} + +wxActiveX::~wxActiveX() +{ + // disconnect connection points + wxOleConnectionArray::iterator it = m_connections.begin(); + while (it != m_connections.end()) + { + wxOleConnectionPoint& cp = it->first; + cp->Unadvise(it->second); + + it++; + }; + m_connections.clear(); + + if (m_oleInPlaceObject.Ok()) + { + m_oleInPlaceObject->InPlaceDeactivate(); + m_oleInPlaceObject->UIDeactivate(); + } + + + if (m_oleObject.Ok()) + { + if (m_docAdviseCookie != 0) + m_oleObject->Unadvise(m_docAdviseCookie); + + m_oleObject->DoVerb(OLEIVERB_HIDE, NULL, m_clientSite, 0, (HWND) GetHWND(), NULL); + m_oleObject->Close(OLECLOSE_NOSAVE); + m_oleObject->SetClientSite(NULL); + } +} + +void wxActiveX::CreateActiveX(REFCLSID clsid) +{ + SetTransparent(); + + HRESULT hret; + + //////////////////////////////////////////////////////// + // FrameSite + FrameSite *frame = new FrameSite(this); + // oleClientSite + hret = m_clientSite.QueryInterface(IID_IOleClientSite, (IDispatch *) frame); + wxCHECK_RET(SUCCEEDED(hret), _T("m_clientSite.QueryInterface failed")); + // adviseSink + wxAutoOleInterface adviseSink(IID_IAdviseSink, (IDispatch *) frame); + wxCHECK_RET(adviseSink.Ok(), _T("adviseSink not Ok")); + + + // // Create Object, get IUnknown interface + m_ActiveX.CreateInstance(clsid, IID_IUnknown); + wxCHECK_RET(m_ActiveX.Ok(), _T("m_ActiveX.CreateInstance failed")); + + // Get Dispatch interface + hret = m_Dispatch.QueryInterface(IID_IDispatch, m_ActiveX); + WXOLE_WARN(hret, "Unable to get dispatch interface"); + + // Type Info + GetTypeInfo(); + + // Get IOleObject interface + hret = m_oleObject.QueryInterface(IID_IOleObject, m_ActiveX); + wxCHECK_RET(SUCCEEDED(hret), _("Unable to get IOleObject interface")); + + // get IViewObject Interface + hret = m_viewObject.QueryInterface(IID_IViewObject, m_ActiveX); + wxCHECK_RET(SUCCEEDED(hret), _T("Unable to get IViewObject Interface")); + + // document advise + m_docAdviseCookie = 0; + hret = m_oleObject->Advise(adviseSink, &m_docAdviseCookie); + WXOLE_WARN(hret, "m_oleObject->Advise(adviseSink, &m_docAdviseCookie),\"Advise\")"); + m_oleObject->SetHostNames(L"wxActiveXContainer", NULL); + OleSetContainedObject(m_oleObject, TRUE); + OleRun(m_oleObject); + + + // Get IOleInPlaceObject interface + hret = m_oleInPlaceObject.QueryInterface(IID_IOleInPlaceObject, m_ActiveX); + wxCHECK_RET(SUCCEEDED(hret), _T("Unable to get IOleInPlaceObject interface")); + + // status + DWORD dwMiscStatus; + m_oleObject->GetMiscStatus(DVASPECT_CONTENT, &dwMiscStatus); + wxCHECK_RET(SUCCEEDED(hret), _T("Unable to get oleObject status")); + + // set client site first ? + if (dwMiscStatus & OLEMISC_SETCLIENTSITEFIRST) + m_oleObject->SetClientSite(m_clientSite); + + + // stream init + wxAutoOleInterface + pPersistStreamInit(IID_IPersistStreamInit, m_oleObject); + + if (pPersistStreamInit.Ok()) + { + hret = pPersistStreamInit->InitNew(); + WXOLE_WARN(hret, "CreateActiveX::pPersistStreamInit->InitNew()"); + }; + + if (! (dwMiscStatus & OLEMISC_SETCLIENTSITEFIRST)) + m_oleObject->SetClientSite(m_clientSite); + + + int w, h; + GetClientSize(&w, &h); + RECT posRect; + posRect.left = 0; + posRect.top = 0; + posRect.right = w; + posRect.bottom = h; + + m_oleObjectHWND = 0; + + if (m_oleInPlaceObject.Ok()) + { + hret = m_oleInPlaceObject->GetWindow(&m_oleObjectHWND); + WXOLE_WARN(hret, "m_oleInPlaceObject->GetWindow(&m_oleObjectHWND)"); + if (SUCCEEDED(hret)) + ::SetActiveWindow(m_oleObjectHWND); + }; + + + if (! (dwMiscStatus & OLEMISC_INVISIBLEATRUNTIME)) + { + if (w > 0 && h > 0 && m_oleInPlaceObject.Ok()) + m_oleInPlaceObject->SetObjectRects(&posRect, &posRect); + + hret = m_oleObject->DoVerb(OLEIVERB_INPLACEACTIVATE, NULL, m_clientSite, 0, (HWND)GetHWND(), &posRect); + hret = m_oleObject->DoVerb(OLEIVERB_SHOW, 0, m_clientSite, 0, (HWND)GetHWND(), &posRect); + }; + + if (! m_oleObjectHWND && m_oleInPlaceObject.Ok()) + { + hret = m_oleInPlaceObject->GetWindow(&m_oleObjectHWND); + WXOLE_WARN(hret, "m_oleInPlaceObject->GetWindow(&m_oleObjectHWND)"); + }; + + if (m_oleObjectHWND) + { + ::SetActiveWindow(m_oleObjectHWND); + ::ShowWindow(m_oleObjectHWND, SW_SHOW); + + // Update by GBR to resize older controls + wxSizeEvent szEvent; + szEvent.m_size = wxSize(w, h) ; + AddPendingEvent(szEvent); + }; +} + +void wxActiveX::CreateActiveX(LPOLESTR progId) +{ + CLSID clsid; + if (CLSIDFromProgID(progId, &clsid) != S_OK) + return; + + CreateActiveX(clsid); +}; + +//////////////////////////////////////////////////////////////////////////////////////////////////////////// +// Case Insensitive Map of Event names to eventTypes +// created dynamically at run time in: +// EVT_ACTIVEX(eventName, id, fn) +// we map the pointer to them so that: +// const wxEventType& RegisterActiveXEvent(wxString eventName); +// can return a const reference, which is neccessary for event tables +// probably should use a wxWindows hash table here, but I'm lazy ... +typedef map ActiveXNamedEventMap; +static ActiveXNamedEventMap sg_NamedEventMap; + +const wxEventType& RegisterActiveXEvent(const wxChar *eventName) +{ + wxString ev = eventName; + ActiveXNamedEventMap::iterator it = sg_NamedEventMap.find(ev); + if (it == sg_NamedEventMap.end()) + { + wxEventType *et = new wxEventType(wxNewEventType()); + sg_NamedEventMap[ev] = et; + + return *et; + }; + + return *(it->second); +}; + + +//////////////////////////////////////////////////////////////////////////////////////////////////////////// +// Map of Event DISPID's to eventTypes +// created dynamically at run time in: +// EVT_ACTIVEX(eventName, id, fn) +// we map the pointer to them so that: +// const wxEventType& RegisterActiveXEvent(wxString eventName); +// can return a const reference, which is neccessary for event tables + +typedef map ActiveXDISPIDEventMap; +static ActiveXDISPIDEventMap sg_dispIdEventMap; + +const wxEventType& RegisterActiveXEvent(DISPID event) +{ + ActiveXDISPIDEventMap::iterator it = sg_dispIdEventMap.find(event); + if (it == sg_dispIdEventMap.end()) + { + wxEventType *et = new wxEventType(wxNewEventType()); + sg_dispIdEventMap[event] = et; + + return *et; + }; + + return *(it->second); +}; + +// one off class for automatic freeing of activeX eventtypes +class ActiveXEventMapFlusher +{ +public: + ~ActiveXEventMapFlusher() + { + // Named events + ActiveXNamedEventMap::iterator it = sg_NamedEventMap.end(); + while (it != sg_NamedEventMap.end()) + { + delete it->second; + it++; + }; + sg_NamedEventMap.clear(); + + // DISPID events + ActiveXDISPIDEventMap::iterator dit = sg_dispIdEventMap.end(); + while (dit != sg_dispIdEventMap.end()) + { + delete dit->second; + dit++; + }; + sg_dispIdEventMap.clear(); + }; +}; + +static ActiveXEventMapFlusher s_dummyActiveXEventMapFlusher; + + +////////////////////////////////////////////////////// +VARTYPE wxTypeToVType(const wxVariant& v) +{ + wxString type = v.GetType(); + if (type == wxT("bool")) + return VT_BOOL; + else if (type == wxT("char")) + return VT_I1; + else if (type == wxT("datetime")) + return VT_DATE; + else if (type == wxT("double")) + return VT_R8; + else if (type == wxT("list")) + return VT_ARRAY; + else if (type == wxT("long")) + return VT_I4; + else if (type == wxT("string")) + return VT_BSTR; + else if (type == wxT("stringlist")) + return VT_ARRAY; + else if (type == wxT("date")) + return VT_DATE; + else if (type == wxT("time")) + return VT_DATE; + else if (type == wxT("void*")) + return VT_VOID | VT_BYREF; + else + return VT_NULL; +}; + +bool wxDateTimeToDATE(wxDateTime dt, DATE& d) +{ + SYSTEMTIME st; + memset(&st, 0, sizeof(st)); + + st.wYear = dt.GetYear(); + st.wMonth = dt.GetMonth() + 1; + st.wDay = dt.GetDay(); + st.wHour = dt.GetHour(); + st.wMinute = dt.GetMinute(); + st.wSecond = dt.GetSecond(); + st.wMilliseconds = dt.GetMillisecond(); + return SystemTimeToVariantTime(&st, &d) != FALSE; +}; + +bool wxDateTimeToVariant(wxDateTime dt, VARIANTARG& va) +{ + return wxDateTimeToDATE(dt, va.date); +}; + +bool DATEToWxDateTime(DATE date, wxDateTime& dt) +{ + SYSTEMTIME st; + if (! VariantTimeToSystemTime(date, &st)) + return false; + + dt = wxDateTime( + st.wDay, + wxDateTime::Month(int(wxDateTime::Jan) + st.wMonth - 1), + st.wYear, + st.wHour, st.wMinute, st.wSecond, st.wMilliseconds); + + return true; +}; + +bool VariantToWxDateTime(VARIANTARG va, wxDateTime& dt) +{ + HRESULT hr = VariantChangeType(&va, &va, 0, VT_DATE); + if (! SUCCEEDED(hr)) + return false; + + return DATEToWxDateTime(va.date, dt); +}; + +bool MSWVariantToVariant(VARIANTARG& va, wxVariant& vx) +{ + bool byRef = false; + VARTYPE vt = va.vt; + + if (vt & VT_ARRAY) + return false; // don't support arrays yet + + if (vt & VT_BYREF) + { + byRef = true; + vt &= ~(VT_BYREF); + }; + + + switch(vt) + { + case VT_VARIANT: + if (byRef) + return MSWVariantToVariant(*va.pvarVal, vx); + else + { + VARIANT tmp = va; + VariantChangeType(&tmp, &tmp, 0, wxTypeToVType(vx)); + bool rc = MSWVariantToVariant(tmp, vx); + VariantClear(&tmp); + return rc; + }; + + // 1 byte chars + case VT_I1: + case VT_UI1: + if (byRef) + vx = (char) *va.pbVal; + else + vx = (char) va.bVal; + return true; + + // 2 byte shorts + case VT_I2: + case VT_UI2: + if (byRef) + vx = (long) *va.puiVal; + else + vx = (long) va.uiVal; + return true; + + // 4 bytes longs + case VT_I4: + case VT_UI4: + case VT_INT: + case VT_UINT: + case VT_ERROR: + if (byRef) + vx = (long) *va.pulVal; + else + vx = (long) va.ulVal; + return true; + + + // 4 byte floats + case VT_R4: + if (byRef) + vx = *va.pfltVal; + else + vx = va.fltVal; + return true; + + // 8 byte doubles + case VT_R8: + if (byRef) + vx = *va.pdblVal; + else + vx = va.dblVal; + return true; + + case VT_BOOL: + if (byRef) + vx = (*va.pboolVal ? true : false); + else + vx = (va.boolVal ? true : false); + return true; + + case VT_CY: + vx.MakeNull(); + return false; // what the hell is a CY ? + + case VT_DECIMAL: + { + double d = 0; + HRESULT hr; + if (byRef) + hr = VarR8FromDec(va.pdecVal, &d); + else + hr = VarR8FromDec(&va.decVal, &d); + + vx = d; + return SUCCEEDED(hr); + }; + + case VT_DATE: + { + wxDateTime dt; + bool rc = false; + if (byRef) + rc = DATEToWxDateTime(*va.pdate, dt); + else + rc = VariantToWxDateTime(va, dt); + vx = dt; + return rc; + }; + + case VT_BSTR: + if (byRef) + vx = wxString(*va.pbstrVal); + else + vx = wxString(va.bstrVal); + return true; + + case VT_UNKNOWN: // should do a custom wxVariantData for this + if (byRef) + vx = (void *) *va.ppunkVal; + else + vx = (void *) va.punkVal; + return false; + + case VT_DISPATCH: // should do a custom wxVariantData for this + if (byRef) + vx = (void *) *va.ppdispVal; + else + vx = (void *) va.pdispVal; + return false; + + default: + vx.MakeNull(); + return false; + }; +}; + +bool VariantToMSWVariant(const wxVariant& vx, VARIANTARG& va) +{ + bool byRef = false; + VARTYPE vt = va.vt; + + if (vt & VT_ARRAY) + return false; // don't support arrays yet + + if (vt & VT_BYREF) + { + byRef = true; + vt &= ~(VT_BYREF); + }; + + switch(vt) + { + case VT_VARIANT: + if (byRef) + return VariantToMSWVariant(vx, *va.pvarVal); + else + { + va.vt = wxTypeToVType(vx); + return VariantToMSWVariant(vx, va); + }; + + // 1 byte chars + case VT_I1: + case VT_UI1: + if (byRef) + *va.pbVal = (char) vx; + else + va.bVal = (char) vx; + return true; + + // 2 byte shorts + case VT_I2: + case VT_UI2: + if (byRef) + *va.puiVal = (long) vx; + else + va.uiVal = (long) vx; + return true; + + // 4 bytes longs + case VT_I4: + case VT_UI4: + case VT_INT: + case VT_UINT: + case VT_ERROR: + if (byRef) + *va.pulVal = (long) vx; + else + va.ulVal = (long) vx; + return true; + + + // 4 byte floats + case VT_R4: + if (byRef) + *va.pfltVal = (double) vx; + else + va.fltVal = (double) vx; + return true; + + // 8 byte doubles + case VT_R8: + if (byRef) + *va.pdblVal = (double) vx; + else + va.dblVal = (double) vx; + return true; + + case VT_BOOL: + if (byRef) + *va.pboolVal = ((bool) vx) ? TRUE : FALSE; + else + va.boolVal = ((bool) vx) ? TRUE : FALSE; + return true; + + case VT_CY: + return false; // what the hell is a CY ? + + case VT_DECIMAL: + if (byRef) + return SUCCEEDED(VarDecFromR8(vx, va.pdecVal)); + else + return SUCCEEDED(VarDecFromR8(vx, &va.decVal)); + + case VT_DATE: + if (byRef) + return wxDateTimeToDATE(vx, *va.pdate); + else + return wxDateTimeToVariant(vx,va); + + case VT_BSTR: + if (byRef) + *va.pbstrVal = SysAllocString(vx.GetString().wc_str(wxConvUTF8)); + else + va.bstrVal = SysAllocString(vx.GetString().wc_str(wxConvUTF8)); + return true; + + case VT_UNKNOWN: // should do a custom wxVariantData for this + if (byRef) + *va.ppunkVal = (IUnknown *) (void *) vx; + else + va.punkVal = (IUnknown *) (void *) vx; + return false; + + case VT_DISPATCH: // should do a custom wxVariantData for this + if (byRef) + *va.ppdispVal = (IDispatch *) (void *) vx; + else + va.pdispVal = (IDispatch *) (void *) vx; + return false; + + default: + return false; + }; +}; + +IMPLEMENT_CLASS(wxActiveXEvent, wxCommandEvent) + +class wxActiveXEvents : public IDispatch +{ +private: + DECLARE_OLE_UNKNOWN(wxActiveXEvents); + + + wxActiveX *m_activeX; + IID m_customId; + bool m_haveCustomId; + + friend bool wxActiveXEventsInterface(wxActiveXEvents *self, REFIID iid, void **_interface, const char *&desc); + +public: + wxActiveXEvents(wxActiveX *ax) : m_activeX(ax), m_haveCustomId(false) {} + wxActiveXEvents(wxActiveX *ax, REFIID iid) : m_activeX(ax), m_haveCustomId(true), m_customId(iid) {} + virtual ~wxActiveXEvents() + { + } + + //IDispatch + STDMETHODIMP GetIDsOfNames(REFIID r, OLECHAR** o, unsigned int i, LCID l, DISPID* d) + { + return E_NOTIMPL; + }; + + STDMETHODIMP GetTypeInfo(unsigned int i, LCID l, ITypeInfo** t) + { + return E_NOTIMPL; + }; + + STDMETHODIMP GetTypeInfoCount(unsigned int* i) + { + return E_NOTIMPL; + }; + + + void DispatchEvent(wxActiveX::FuncX &func, const wxEventType& eventType, DISPPARAMS * pDispParams) + { + wxActiveXEvent event; + event.SetId(m_activeX->GetId()); + event.SetEventType(eventType); + event.m_params.NullList(); + event.m_params.SetName(func.name); + + // arguments + if (pDispParams) + { + // cdecl call + // sometimes the pDispParams does not match the param info for a activex control + int nArg = min(func.params.size(), pDispParams->cArgs); + for (int i = nArg - 1; i >= 0; i--) + { + VARIANTARG& va = pDispParams->rgvarg[i]; + wxActiveX::ParamX &px = func.params[nArg - i - 1]; + wxVariant vx; + + vx.SetName(px.name); + MSWVariantToVariant(va, vx); + event.m_params.Append(vx); + }; + }; + + if (func.hasOut) + { + int nArg = min(func.params.size(), pDispParams->cArgs); + m_activeX->GetParent()->ProcessEvent(event); + for (int i = 0; i < nArg; i++) + { + VARIANTARG& va = pDispParams->rgvarg[i]; + wxActiveX::ParamX &px = func.params[nArg - i - 1]; + + if (px.IsOut()) + { + wxVariant& vx = event.m_params[nArg - i - 1]; + + VariantToMSWVariant(vx, va); + }; + }; + } + else + m_activeX->GetParent()->AddPendingEvent(event); + + }; + + STDMETHODIMP Invoke(DISPID dispIdMember, REFIID riid, LCID lcid, + WORD wFlags, DISPPARAMS * pDispParams, + VARIANT * pVarResult, EXCEPINFO * pExcepInfo, + unsigned int * puArgErr) + { + if (wFlags & (DISPATCH_PROPERTYGET | DISPATCH_PROPERTYPUT | DISPATCH_PROPERTYPUTREF)) + return E_NOTIMPL; + + wxASSERT(m_activeX); + + // find event for dispid + wxActiveX::MemberIdMap::iterator mit = m_activeX->m_eventMemberIds.find((MEMBERID) dispIdMember); + if (mit == m_activeX->m_eventMemberIds.end()) + return S_OK; + + // sanity check + int midx = mit->second; + if (midx < 0 || midx >= m_activeX->GetEventCount()) + return S_OK; + + wxActiveX::FuncX &func = m_activeX->m_events[midx]; + + + // try to find dispid event + ActiveXDISPIDEventMap::iterator dit = sg_dispIdEventMap.find(dispIdMember); + if (dit != sg_dispIdEventMap.end()) + { + // Dispatch Event + DispatchEvent(func, *(dit->second), pDispParams); + return S_OK; + }; + + // try named event + ActiveXNamedEventMap::iterator nit = sg_NamedEventMap.find(func.name); + if (nit == sg_NamedEventMap.end()) + return S_OK; + + // Dispatch Event + DispatchEvent(func, *(nit->second), pDispParams); + return S_OK; + } +}; + +bool wxActiveXEventsInterface(wxActiveXEvents *self, REFIID iid, void **_interface, const char *&desc) +{ + if (self->m_haveCustomId && IsEqualIID(iid, self->m_customId)) + { + WXOLE_TRACE("Found Custom Dispatch Interface"); + *_interface = (IUnknown *) (IDispatch *) self; + desc = "Custom Dispatch Interface"; + return true; + }; + + return false; +}; + +DEFINE_OLE_TABLE(wxActiveXEvents) + OLE_IINTERFACE(IUnknown) + OLE_INTERFACE(IID_IDispatch, IDispatch) + OLE_INTERFACE_CUSTOM(wxActiveXEventsInterface) +END_OLE_TABLE; + +wxString wxActiveXEvent::EventName() +{ + return m_params.GetName(); +}; + +int wxActiveXEvent::ParamCount() const +{ + return m_params.GetCount(); +}; + +wxString wxActiveXEvent::ParamType(int idx) +{ + wxASSERT(idx >= 0 && idx < m_params.GetCount()); + + return m_params[idx].GetType(); +}; + +wxString wxActiveXEvent::ParamName(int idx) +{ + wxASSERT(idx >= 0 && idx < m_params.GetCount()); + + return m_params[idx].GetName(); +}; + +static wxVariant nullVar; + +wxVariant& wxActiveXEvent::operator[] (int idx) +{ + wxASSERT(idx >= 0 && idx < ParamCount()); + + return m_params[idx]; +}; + +wxVariant& wxActiveXEvent::operator[] (wxString name) +{ + for (int i = 0; i < m_params.GetCount(); i++) + { + if (name.CmpNoCase(m_params[i].GetName()) == 0) + return m_params[i]; + }; + + wxString err = "wxActiveXEvent::operator[] invalid name <" + name + ">"; + err += "\r\nValid Names = :\r\n"; + for (i = 0; i < m_params.GetCount(); i++) + { + err += m_params[i].GetName(); + err += "\r\n"; + }; + + wxASSERT_MSG(false, err); + + return nullVar; +}; + +void wxActiveX::GetTypeInfo() +{ + /* + We are currently only interested in the IDispatch interface + to the control. For dual interfaces (TypeKind = TKIND_INTERFACE) + we should drill down through the inheritance + (using TYPEATTR->cImplTypes) and GetRefTypeOfImplType(n) + and retrieve all the func names etc that way, then generate a C++ + header file for it. + + But we don't do this and probably never will, so if we have a DUAL + interface then we query for the IDispatch + via GetRefTypeOfImplType(-1). + */ + + HRESULT hret = 0; + + // get type info via class info + wxAutoOleInterface classInfo(IID_IProvideClassInfo, m_ActiveX); + if (! classInfo.Ok()) + return; + + // type info + wxAutoOleInterface typeInfo; + hret = classInfo->GetClassInfo(typeInfo.GetRef()); + if (! typeInfo.Ok()) + return; + + // TYPEATTR + TYPEATTR *ta = NULL; + hret = typeInfo->GetTypeAttr(&ta); + if (! ta) + return; + + // this should be a TKIND_COCLASS + wxASSERT(ta->typekind == TKIND_COCLASS); + + // iterate contained interfaces + for (int i = 0; i < ta->cImplTypes; i++) + { + HREFTYPE rt = 0; + + // get dispatch type info handle + hret = typeInfo->GetRefTypeOfImplType(i, &rt); + if (! SUCCEEDED(hret)) + continue; + + // get dispatch type info interface + wxAutoOleInterface ti; + hret = typeInfo->GetRefTypeInfo(rt, ti.GetRef()); + if (! ti.Ok()) + continue; + + // check if default event sink + bool defInterface = false; + bool defEventSink = false; + int impTypeFlags = 0; + typeInfo->GetImplTypeFlags(i, &impTypeFlags); + + if (impTypeFlags & IMPLTYPEFLAG_FDEFAULT) + { + if (impTypeFlags & IMPLTYPEFLAG_FSOURCE) + { + WXOLE_TRACEOUT("Default Event Sink"); + defEventSink = true; + if (impTypeFlags & IMPLTYPEFLAG_FDEFAULTVTABLE) + { + WXOLE_TRACEOUT("*ERROR* - Default Event Sink is via vTable"); + defEventSink = false; + }; + } + else + { + WXOLE_TRACEOUT("Default Interface"); + defInterface = true; + } + }; + + + // process + GetTypeInfo(ti, defInterface, defEventSink); + }; + + + // free + typeInfo->ReleaseTypeAttr(ta); +}; + +void ElemDescToParam(const ELEMDESC& ed, wxActiveX::ParamX& param) +{ + param.flags = ed.idldesc.wIDLFlags; + param.vt = ed.tdesc.vt; + param.isPtr = (param.vt == VT_PTR); + param.isSafeArray = (param.vt == VT_SAFEARRAY); + if (param.isPtr || param.isSafeArray) + param.vt = ed.tdesc.lptdesc->vt; +}; + +void wxActiveX::GetTypeInfo(ITypeInfo *ti, bool defInterface, bool defEventSink) +{ + // wxAutoOleInterface<> assumes a ref has already been added + ti->AddRef(); + wxAutoOleInterface typeInfo(ti); + + // TYPEATTR + TYPEATTR *ta = NULL; + HRESULT hret = typeInfo->GetTypeAttr(&ta); + if (! ta) + return; + + if (ta->typekind == TKIND_DISPATCH) + { + WXOLE_TRACEOUT("GUID = " << GetIIDName(ta->guid).c_str()); + + if (defEventSink) + { + wxActiveXEvents *disp = new wxActiveXEvents(this, ta->guid); + ConnectAdvise(ta->guid, disp); + }; + + + // Get Function Names + for (int i = 0; i < ta->cFuncs; i++) + { + FUNCDESC FAR *fd = NULL; + + hret = typeInfo->GetFuncDesc(i, &fd); + if (! fd) + continue; + + BSTR anames[1] = {NULL}; + unsigned int n = 0; + + hret = typeInfo->GetNames(fd->memid, anames, 1, &n); + + if (anames[0]) + { + wxString name = anames[0]; + + WXOLE_TRACEOUT("Name " << i << " = " << name.c_str()); + SysFreeString(anames[0]); + + if (defInterface || defEventSink) + { + FuncX func; + func.name = name; + func.memid = fd->memid; + func.hasOut = false; + + // get Param Names + unsigned int maxPNames = fd->cParams + 1; + unsigned int nPNames = 0; + BSTR *pnames = new BSTR[maxPNames]; + + hret = typeInfo->GetNames(fd->memid, pnames, maxPNames, &nPNames); + + int pbase = 0; + if (fd->cParams < int(nPNames)) + { + pbase++; + SysFreeString(pnames[0]); + }; + + // params + ElemDescToParam(fd->elemdescFunc, func.retType); + for (int p = 0; p < fd->cParams; p++) + { + ParamX param; + + ElemDescToParam(fd->lprgelemdescParam[p], param); + + param.name = pnames[pbase + p]; + SysFreeString(pnames[pbase + p]); + + param.isOptional = (p > fd->cParams - fd->cParamsOpt); + + func.hasOut |= (param.IsOut() || param.isPtr); + func.params.push_back(param); + }; + delete [] pnames; + + if (defEventSink) + { + m_events.push_back(func); + m_eventMemberIds[fd->memid] = m_events.size() - 1; + } + else + { + if (fd->invkind == INVOKE_FUNC) + { + m_methods.push_back(func); + m_methodNames[func.name] = m_methods.size() - 1; + } + else + { + NameMap::iterator it = m_propNames.find(func.name); + int idx = -1; + if (it == m_propNames.end()) + { + m_props.push_back(PropX()); + idx = m_props.size() - 1; + m_propNames[func.name] = idx; + m_props[idx].name = func.name; + m_props[idx].memid = func.memid; + + } + else + idx = it->second; + + if (fd->invkind == INVOKE_PROPERTYGET) + m_props[idx].type = func.retType; + else if (func.params.size() > 0) + { + m_props[idx].arg = func.params[0]; + m_props[idx].putByRef = (fd->invkind == INVOKE_PROPERTYPUTREF); + }; + }; + }; + }; + }; + + typeInfo->ReleaseFuncDesc(fd); + }; + } + + typeInfo->ReleaseTypeAttr(ta); +}; + +/////////////////////////////////////////////// +// Type Info exposure +const wxActiveX::FuncX& wxActiveX::GetEventDesc(int idx) const +{ + wxASSERT(idx >= 0 && idx < GetEventCount()); + + return m_events[idx]; +}; + +const wxActiveX::PropX& wxActiveX::GetPropDesc(int idx) const +{ + if (idx < 0 || idx >= GetPropCount()) + throw exception("Property index out of bounds"); + + return m_props[idx]; +}; + +const wxActiveX::PropX& wxActiveX::GetPropDesc(const wxString& name) const +{ + NameMap::const_iterator it = m_propNames.find(name); + if (it == m_propNames.end()) + { + wxString s; + s << "property <" << name << "> not found"; + throw exception(s.mb_str()); + }; + + return GetPropDesc(it->second); +}; + +const wxActiveX::FuncX& wxActiveX::GetMethodDesc(int idx) const +{ + if (idx < 0 || idx >= GetMethodCount()) + throw exception("Method index out of bounds"); + + + return m_methods[idx]; +}; + + +const wxActiveX::FuncX& wxActiveX::GetMethodDesc(const wxString& name) const +{ + NameMap::const_iterator it = m_methodNames.find(name); + if (it == m_methodNames.end()) + { + wxString s; + s << "method <" << name << "> not found"; + throw exception(s.mb_str()); + }; + + return GetMethodDesc(it->second); +}; + + +void wxActiveX::SetProp(MEMBERID name, VARIANTARG& value) +{ + DISPID pids[1] = {DISPID_PROPERTYPUT}; + DISPPARAMS params = {&value, pids, 1, 1}; + + EXCEPINFO x; + memset(&x, 0, sizeof(x)); + unsigned int argErr = 0; + + HRESULT hr = m_Dispatch->Invoke( + name, + IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_PROPERTYPUT, + ¶ms, NULL, &x, &argErr); + + WXOLE_WARN(hr, "Invoke Prop(...)"); +}; + +void wxActiveX::SetProp(const wxString &name, const wxVariant &value) +{ + const PropX& prop = GetPropDesc(name); + if (! prop.CanSet()) + { + wxString s; + s << "property <" << name << "> is readonly"; + throw exception(s.mb_str()); + }; + + VARIANT v = {prop.arg.vt}; + VariantToMSWVariant(value, v); + SetProp(prop.memid, v); + VariantClear(&v); // this releases any BSTR's etc +}; + +VARIANT wxActiveX::GetPropAsVariant(MEMBERID name) +{ + VARIANT v; + VariantInit(&v); + + DISPPARAMS params = {NULL, NULL, 0, 0}; + + EXCEPINFO x; + memset(&x, 0, sizeof(x)); + unsigned int argErr = 0; + + HRESULT hr = m_Dispatch->Invoke( + name, + IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_PROPERTYGET, + ¶ms, &v, &x, &argErr); + + WXOLE_WARN(hr, "Invoke Prop(...)"); + + return v; +}; + +VARIANT wxActiveX::GetPropAsVariant(const wxString& name) +{ + const PropX& prop = GetPropDesc(name); + if (! prop.CanGet()) + { + wxString s; + s << "property <" << name << "> is writeonly"; + throw exception(s.mb_str()); + }; + + return GetPropAsVariant(prop.memid); +}; + +wxVariant wxActiveX::GetPropAsWxVariant(const wxString& name) +{ + VARIANT v = GetPropAsVariant(name); + HRESULT hr = VariantChangeType(&v, &v, 0, VT_BSTR); + if (! SUCCEEDED(hr)) + throw exception("Unable to convert variant"); + + wxVariant wv; + MSWVariantToVariant(v, wv); + + VariantClear(&v); + + return wv; +}; + +wxString wxActiveX::GetPropAsString(const wxString& name) +{ + VARIANT v = GetPropAsVariant(name); + HRESULT hr = VariantChangeType(&v, &v, 0, VT_BSTR); + if (! SUCCEEDED(hr)) + throw exception("Unable to convert variant"); + + wxString s = v.bstrVal; + VariantClear(&v); + + return s; +}; + +char wxActiveX::GetPropAsChar(const wxString& name) +{ + VARIANT v = GetPropAsVariant(name); + HRESULT hr = VariantChangeType(&v, &v, 0, VT_I1); + if (! SUCCEEDED(hr)) + throw exception("Unable to convert variant"); + + return v.cVal; +}; + +long wxActiveX::GetPropAsLong(const wxString& name) +{ + VARIANT v = GetPropAsVariant(name); + HRESULT hr = VariantChangeType(&v, &v, 0, VT_I4); + if (! SUCCEEDED(hr)) + throw exception("Unable to convert variant"); + + return v.iVal; +}; + +bool wxActiveX::GetPropAsBool(const wxString& name) +{ + VARIANT v = GetPropAsVariant(name); + HRESULT hr = VariantChangeType(&v, &v, 0, VT_BOOL); + if (! SUCCEEDED(hr)) + throw exception("Unable to convert variant"); + + return v.boolVal != 0; +}; + +double wxActiveX::GetPropAsDouble(const wxString& name) +{ + VARIANT v = GetPropAsVariant(name); + HRESULT hr = VariantChangeType(&v, &v, 0, VT_R8); + if (! SUCCEEDED(hr)) + throw exception("Unable to convert variant"); + + return v.dblVal; +}; + +wxDateTime wxActiveX::GetPropAsDateTime(const wxString& name) +{ + wxDateTime dt; + VARIANT v = GetPropAsVariant(name); + + if (! VariantToWxDateTime(v, dt)) + throw exception("Unable to convert variant to wxDateTime"); + + return dt; +}; + +void *wxActiveX::GetPropAsPointer(const wxString& name) +{ + VARIANT v = GetPropAsVariant(name); + HRESULT hr = VariantChangeType(&v, &v, 0, VT_BYREF); + if (! SUCCEEDED(hr)) + throw exception("Unable to convert variant"); + + return v.byref; +}; + + + +// call methods +VARIANT wxActiveX::CallMethod(MEMBERID name, VARIANTARG args[], int argc) +{ + DISPPARAMS pargs = {args, NULL, argc, 0}; + VARIANT retVal; + VariantInit(&retVal); + + EXCEPINFO x; + memset(&x, 0, sizeof(x)); + unsigned int argErr = 0; + + HRESULT hr = m_Dispatch->Invoke( + name, + IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, + &pargs, &retVal, &x, &argErr); + + WXOLE_WARN(hr, "Invoke Method(...)"); + return retVal; +}; + +VARIANT wxActiveX::CallMethod(const wxString& name, VARIANTARG args[], int argc) +{ + const FuncX& func = GetMethodDesc(name); + if (argc < 0) + argc = func.params.size(); + + return CallMethod(func.memid, args, argc); +}; + + +wxVariant wxActiveX::CallMethod(const wxString& name, wxVariant args[], int nargs) +{ + const FuncX& func = GetMethodDesc(name); + + if (args == NULL) + nargs = 0; + + VARIANTARG *vargs = NULL; + if (nargs < 0) + nargs = func.params.size(); + + if (nargs > 0) + vargs = new VARIANTARG[nargs]; + + if (vargs) + { + // init type of vargs + for (int i = 0; i < nargs; i++) + vargs[nargs - i - 1].vt = func.params[i].vt; + + // put data + for (i = 0; i < nargs; i++) + VariantToMSWVariant(args[i], vargs[nargs - i - 1]); + }; + + VARIANT rv = CallMethod(func.memid, vargs, nargs); + + // process any by ref params + if (func.hasOut) + { + for (int i = 0; i < nargs; i++) + { + VARIANTARG& va = vargs[nargs - i - 1]; + const wxActiveX::ParamX &px = func.params[i]; + + if (px.IsOut()) + { + wxVariant& vx = args[i]; + + MSWVariantToVariant(va, vx); + }; + }; + } + + if (vargs) + { + for (int i = 0; i < nargs; i++) + VariantClear(&vargs[i]); + delete [] vargs; + }; + + wxVariant ret; + + MSWVariantToVariant(rv, ret); + VariantClear(&rv); + + return ret; +}; + + +/////////////////////////////////////////////// + +HRESULT wxActiveX::ConnectAdvise(REFIID riid, IUnknown *events) +{ + wxOleConnectionPoint cp; + DWORD adviseCookie = 0; + + wxAutoOleInterface cpContainer(IID_IConnectionPointContainer, m_ActiveX); + if (! cpContainer.Ok()) + return E_FAIL; + + HRESULT hret = cpContainer->FindConnectionPoint(riid, cp.GetRef()); + if (! SUCCEEDED(hret)) + return hret; + + hret = cp->Advise(events, &adviseCookie); + + if (SUCCEEDED(hret)) + m_connections.push_back(wxOleConnection(cp, adviseCookie)); + else + { + WXOLE_WARN(hret, "ConnectAdvise"); + }; + + return hret; +}; + +HRESULT wxActiveX::AmbientPropertyChanged(DISPID dispid) +{ + wxAutoOleInterface oleControl(IID_IOleControl, m_oleObject); + + if (oleControl.Ok()) + return oleControl->OnAmbientPropertyChange(dispid); + else + return S_FALSE; +}; + +#define HIMETRIC_PER_INCH 2540 +#define MAP_PIX_TO_LOGHIM(x,ppli) MulDiv(HIMETRIC_PER_INCH, (x), (ppli)) + +static void PixelsToHimetric(SIZEL &sz) +{ + static int logX = 0; + static int logY = 0; + + if (logY == 0) + { + // initaliase + HDC dc = GetDC(NULL); + logX = GetDeviceCaps(dc, LOGPIXELSX); + logY = GetDeviceCaps(dc, LOGPIXELSY); + ReleaseDC(NULL, dc); + }; + +#define HIMETRIC_INCH 2540 +#define CONVERT(x, logpixels) MulDiv(HIMETRIC_INCH, (x), (logpixels)) + + sz.cx = CONVERT(sz.cx, logX); + sz.cy = CONVERT(sz.cy, logY); + +#undef CONVERT +#undef HIMETRIC_INCH +} + + +void wxActiveX::OnSize(wxSizeEvent& event) +{ + int w, h; + GetClientSize(&w, &h); + + RECT posRect; + posRect.left = 0; + posRect.top = 0; + posRect.right = w; + posRect.bottom = h; + + if (w <= 0 && h <= 0) + return; + + // extents are in HIMETRIC units + if (m_oleObject.Ok()) + { + SIZEL sz = {w, h}; + PixelsToHimetric(sz); + + SIZEL sz2; + + m_oleObject->GetExtent(DVASPECT_CONTENT, &sz2); + if (sz2.cx != sz.cx || sz.cy != sz2.cy) + m_oleObject->SetExtent(DVASPECT_CONTENT, &sz); + }; + + if (m_oleInPlaceObject.Ok()) + m_oleInPlaceObject->SetObjectRects(&posRect, &posRect); +} + +void wxActiveX::OnPaint(wxPaintEvent& event) +{ + wxLogTrace(wxT(""),wxT("repainting activex win")); + wxPaintDC dc(this); + dc.BeginDrawing(); + int w, h; + GetSize(&w, &h); + RECT posRect; + posRect.left = 0; + posRect.top = 0; + posRect.right = w; + posRect.bottom = h; + + // Draw only when control is windowless or deactivated + if (m_viewObject) + { + ::RedrawWindow(m_oleObjectHWND, NULL, NULL, RDW_INTERNALPAINT); + { + RECTL *prcBounds = (RECTL *) &posRect; + m_viewObject->Draw(DVASPECT_CONTENT, -1, NULL, NULL, NULL, + (HDC)dc.GetHDC(), prcBounds, NULL, NULL, 0); + } + } + else + { + dc.SetBrush(*wxRED_BRUSH); + dc.DrawRectangle(0, 0, w, h); + dc.SetBrush(wxNullBrush); + } + dc.EndDrawing(); +} + + +void wxActiveX::OnMouse(wxMouseEvent& event) +{ + if (m_oleObjectHWND == NULL) + { + wxLogTrace(wxT(""),wxT("no oleInPlaceObject")); + event.Skip(); + return; + } + + wxLogTrace(wxT(""),wxT("mouse event")); + UINT msg = 0; + WPARAM wParam = 0; + LPARAM lParam = 0; + LRESULT lResult = 0; + + if (event.m_metaDown) + wParam |= MK_CONTROL; + if (event.m_shiftDown) + wParam |= MK_SHIFT; + if (event.m_leftDown) + wParam |= MK_LBUTTON; + if (event.m_middleDown) + wParam |= MK_MBUTTON; + if (event.m_rightDown) + wParam |= MK_RBUTTON; + lParam = event.m_x << 16; + lParam |= event.m_y; + + if (event.LeftDown()) + msg = WM_LBUTTONDOWN; + else if (event.LeftDClick()) + msg = WM_LBUTTONDBLCLK; + else if (event.LeftUp()) + msg = WM_LBUTTONUP; + else if (event.MiddleDown()) + msg = WM_MBUTTONDOWN; + else if (event.MiddleDClick()) + msg = WM_MBUTTONDBLCLK; + else if (event.MiddleUp()) + msg = WM_MBUTTONUP; + else if (event.RightDown()) + msg = WM_RBUTTONDOWN; + else if (event.RightDClick()) + msg = WM_RBUTTONDBLCLK; + else if (event.RightUp()) + msg = WM_RBUTTONUP; + else if (event.Moving() || event.Dragging()) + msg = WM_MOUSEMOVE; + + wxString log; + if (msg == 0) + { + wxLogTrace(wxT(""),wxT("no message")); + event.Skip(); return; + }; + + if (!::SendMessage(m_oleObjectHWND, msg, wParam, lParam)) + { + wxLogTrace(wxT(""),wxT("msg not delivered")); + event.Skip(); + return; + }; + + wxLogTrace(wxT(""),wxT("msg sent")); +} + +long wxActiveX::MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam) +{ + if (m_oleObjectHWND == NULL) + return wxWindow::MSWWindowProc(nMsg, wParam, lParam); + + switch(nMsg) + { + case WM_CHAR: + case WM_DEADCHAR: + case WM_KEYDOWN: + case WM_KEYUP: + case WM_SYSCHAR: + case WM_SYSDEADCHAR: + case WM_SYSKEYDOWN: + case WM_SYSKEYUP: + PostMessage(m_oleObjectHWND, nMsg, wParam, lParam); + + default: + return wxWindow::MSWWindowProc(nMsg, wParam, lParam); + }; +}; + +void wxActiveX::OnSetFocus(wxFocusEvent& event) +{ + if (m_oleInPlaceActiveObject.Ok()) + m_oleInPlaceActiveObject->OnFrameWindowActivate(TRUE); +} + +void wxActiveX::OnKillFocus(wxFocusEvent& event) +{ + if (m_oleInPlaceActiveObject.Ok()) + m_oleInPlaceActiveObject->OnFrameWindowActivate(FALSE); +} + + +FrameSite::FrameSite(wxActiveX * win) +{ + m_window = win; + m_bSupportsWindowlessActivation = true; + m_bInPlaceLocked = false; + m_bUIActive = false; + m_bInPlaceActive = false; + m_bWindowless = false; + + m_nAmbientLocale = 0; + m_clrAmbientForeColor = ::GetSysColor(COLOR_WINDOWTEXT); + m_clrAmbientBackColor = ::GetSysColor(COLOR_WINDOW); + m_bAmbientShowHatching = true; + m_bAmbientShowGrabHandles = true; + m_bAmbientAppearance = true; + + m_hDCBuffer = NULL; + m_hWndParent = (HWND)m_window->GetHWND(); +} + +FrameSite::~FrameSite() +{ +} + + +//IDispatch + +HRESULT FrameSite::GetIDsOfNames(REFIID riid, OLECHAR ** rgszNames, unsigned int cNames, + LCID lcid, DISPID * rgDispId) +{ + WXOLE_TRACE("IDispatch::GetIDsOfNames"); + return E_NOTIMPL; +} + +HRESULT FrameSite::GetTypeInfo(unsigned int iTInfo, LCID lcid, ITypeInfo ** ppTInfo) +{ + WXOLE_TRACE("IDispatch::GetTypeInfo"); + return E_NOTIMPL; +} + +HRESULT FrameSite::GetTypeInfoCount(unsigned int * pcTInfo) +{ + WXOLE_TRACE("IDispatch::GetTypeInfoCount"); + return E_NOTIMPL; +} + +HRESULT FrameSite::Invoke(DISPID dispIdMember, REFIID riid, LCID lcid, + WORD wFlags, DISPPARAMS * pDispParams, + VARIANT * pVarResult, EXCEPINFO * pExcepInfo, + unsigned int * puArgErr) +{ + WXOLE_TRACE("IDispatch::Invoke"); + + if (!(wFlags & DISPATCH_PROPERTYGET)) + return S_OK; + + HRESULT hr; + + if (pVarResult == NULL) + return E_INVALIDARG; + + //The most common case is boolean, use as an initial type + V_VT(pVarResult) = VT_BOOL; + + switch (dispIdMember) + { + case DISPID_AMBIENT_MESSAGEREFLECT: + WXOLE_TRACE("Invoke::DISPID_AMBIENT_MESSAGEREFLECT"); + V_BOOL(pVarResult)= FALSE; + return S_OK; + + case DISPID_AMBIENT_DISPLAYASDEFAULT: + WXOLE_TRACE("Invoke::DISPID_AMBIENT_DISPLAYASDEFAULT"); + V_BOOL(pVarResult)= TRUE; + return S_OK; + + case DISPID_AMBIENT_OFFLINEIFNOTCONNECTED: + WXOLE_TRACE("Invoke::DISPID_AMBIENT_OFFLINEIFNOTCONNECTED"); + V_BOOL(pVarResult) = TRUE; + return S_OK; + + + case DISPID_AMBIENT_SILENT: + WXOLE_TRACE("Invoke::DISPID_AMBIENT_SILENT"); + V_BOOL(pVarResult)= TRUE; + return S_OK; + + case DISPID_AMBIENT_APPEARANCE: + pVarResult->vt = VT_BOOL; + pVarResult->boolVal = m_bAmbientAppearance; + break; + + case DISPID_AMBIENT_FORECOLOR: + pVarResult->vt = VT_I4; + pVarResult->lVal = (long) m_clrAmbientForeColor; + break; + + case DISPID_AMBIENT_BACKCOLOR: + pVarResult->vt = VT_I4; + pVarResult->lVal = (long) m_clrAmbientBackColor; + break; + + case DISPID_AMBIENT_LOCALEID: + pVarResult->vt = VT_I4; + pVarResult->lVal = (long) m_nAmbientLocale; + break; + + case DISPID_AMBIENT_USERMODE: + pVarResult->vt = VT_BOOL; + pVarResult->boolVal = m_window->m_bAmbientUserMode; + break; + + case DISPID_AMBIENT_SHOWGRABHANDLES: + pVarResult->vt = VT_BOOL; + pVarResult->boolVal = m_bAmbientShowGrabHandles; + break; + + case DISPID_AMBIENT_SHOWHATCHING: + pVarResult->vt = VT_BOOL; + pVarResult->boolVal = m_bAmbientShowHatching; + break; + + default: + return DISP_E_MEMBERNOTFOUND; + } + + return S_OK; +} + +//IOleWindow + +HRESULT FrameSite::GetWindow(HWND * phwnd) +{ + WXOLE_TRACE("IOleWindow::GetWindow"); + if (phwnd == NULL) + return E_INVALIDARG; + (*phwnd) = m_hWndParent; + return S_OK; +} + +HRESULT FrameSite::ContextSensitiveHelp(BOOL fEnterMode) +{ + WXOLE_TRACE("IOleWindow::ContextSensitiveHelp"); + return S_OK; +} + +//IOleInPlaceUIWindow + +HRESULT FrameSite::GetBorder(LPRECT lprectBorder) +{ + WXOLE_TRACE("IOleInPlaceUIWindow::GetBorder"); + if (lprectBorder == NULL) + return E_INVALIDARG; + return INPLACE_E_NOTOOLSPACE; +} + +HRESULT FrameSite::RequestBorderSpace(LPCBORDERWIDTHS pborderwidths) +{ + WXOLE_TRACE("IOleInPlaceUIWindow::RequestBorderSpace"); + if (pborderwidths == NULL) + return E_INVALIDARG; + return INPLACE_E_NOTOOLSPACE; +} + +HRESULT FrameSite::SetBorderSpace(LPCBORDERWIDTHS pborderwidths) +{ + WXOLE_TRACE("IOleInPlaceUIWindow::SetBorderSpace"); + return S_OK; +} + +HRESULT FrameSite::SetActiveObject(IOleInPlaceActiveObject *pActiveObject, LPCOLESTR pszObjName) +{ + WXOLE_TRACE("IOleInPlaceUIWindow::SetActiveObject"); + + if (pActiveObject) + pActiveObject->AddRef(); + + m_window->m_oleInPlaceActiveObject = pActiveObject; + return S_OK; +} + +//IOleInPlaceFrame + +HRESULT FrameSite::InsertMenus(HMENU hmenuShared, LPOLEMENUGROUPWIDTHS lpMenuWidths) +{ + WXOLE_TRACE("IOleInPlaceFrame::InsertMenus"); + return S_OK; +} + +HRESULT FrameSite::SetMenu(HMENU hmenuShared, HOLEMENU holemenu, HWND hwndActiveObject) +{ + WXOLE_TRACE("IOleInPlaceFrame::SetMenu"); + return S_OK; +} + +HRESULT FrameSite::RemoveMenus(HMENU hmenuShared) +{ + WXOLE_TRACE("IOleInPlaceFrame::RemoveMenus"); + return S_OK; +} + +HRESULT FrameSite::SetStatusText(LPCOLESTR pszStatusText) +{ + WXOLE_TRACE("IOleInPlaceFrame::SetStatusText"); + //((wxFrame*)wxGetApp().GetTopWindow())->GetStatusBar()->SetStatusText(pszStatusText); + return S_OK; +} + +HRESULT FrameSite::EnableModeless(BOOL fEnable) +{ + WXOLE_TRACE("IOleInPlaceFrame::EnableModeless"); + return S_OK; +} + +HRESULT FrameSite::TranslateAccelerator(LPMSG lpmsg, WORD wID) +{ + WXOLE_TRACE("IOleInPlaceFrame::TranslateAccelerator"); + // TODO: send an event with this id + if (m_window->m_oleInPlaceActiveObject.Ok()) + m_window->m_oleInPlaceActiveObject->TranslateAccelerator(lpmsg); + + return S_FALSE; +} + +//IOleInPlaceSite + +HRESULT FrameSite::CanInPlaceActivate() +{ + WXOLE_TRACE("IOleInPlaceSite::CanInPlaceActivate"); + return S_OK; +} + +HRESULT FrameSite::OnInPlaceActivate() +{ + WXOLE_TRACE("IOleInPlaceSite::OnInPlaceActivate"); + m_bInPlaceActive = true; + return S_OK; +} + +HRESULT FrameSite::OnUIActivate() +{ + WXOLE_TRACE("IOleInPlaceSite::OnUIActivate"); + m_bUIActive = true; + return S_OK; +} + +HRESULT FrameSite::GetWindowContext(IOleInPlaceFrame **ppFrame, + IOleInPlaceUIWindow **ppDoc, + LPRECT lprcPosRect, + LPRECT lprcClipRect, + LPOLEINPLACEFRAMEINFO lpFrameInfo) +{ + WXOLE_TRACE("IOleInPlaceSite::GetWindowContext"); + if (ppFrame == NULL || ppDoc == NULL || lprcPosRect == NULL || + lprcClipRect == NULL || lpFrameInfo == NULL) + { + if (ppFrame != NULL) + (*ppFrame) = NULL; + if (ppDoc != NULL) + (*ppDoc) = NULL; + return E_INVALIDARG; + } + + HRESULT hr = QueryInterface(IID_IOleInPlaceFrame, (void **) ppFrame); + if (! SUCCEEDED(hr)) + { + WXOLE_TRACE("IOleInPlaceSite::IOleInPlaceFrame Error !"); + return E_UNEXPECTED; + }; + + hr = QueryInterface(IID_IOleInPlaceUIWindow, (void **) ppDoc); + if (! SUCCEEDED(hr)) + { + WXOLE_TRACE("IOleInPlaceSite::IOleInPlaceUIWindow Error !"); + (*ppFrame)->Release(); + *ppFrame = NULL; + return E_UNEXPECTED; + }; + + int w, h; + m_window->GetClientSize(&w, &h); + if (lprcPosRect) + { + lprcPosRect->left = lprcPosRect->top = 0; + lprcPosRect->right = w; + lprcPosRect->bottom = h; + }; + if (lprcClipRect) + { + lprcClipRect->left = lprcClipRect->top = 0; + lprcClipRect->right = w; + lprcClipRect->bottom = h; + }; + + memset(lpFrameInfo, 0, sizeof(OLEINPLACEFRAMEINFO)); + lpFrameInfo->cb = sizeof(OLEINPLACEFRAMEINFO); + lpFrameInfo->hwndFrame = m_hWndParent; + + return S_OK; +} + +HRESULT FrameSite::Scroll(SIZE scrollExtent) +{ + WXOLE_TRACE("IOleInPlaceSite::Scroll"); + return S_OK; +} + +HRESULT FrameSite::OnUIDeactivate(BOOL fUndoable) +{ + WXOLE_TRACE("IOleInPlaceSite::OnUIDeactivate"); + m_bUIActive = false; + return S_OK; +} + +HRESULT FrameSite::OnInPlaceDeactivate() +{ + WXOLE_TRACE("IOleInPlaceSite::OnInPlaceDeactivate"); + m_bInPlaceActive = false; + return S_OK; +} + +HRESULT FrameSite::DiscardUndoState() +{ + WXOLE_TRACE("IOleInPlaceSite::DiscardUndoState"); + return S_OK; +} + +HRESULT FrameSite::DeactivateAndUndo() +{ + WXOLE_TRACE("IOleInPlaceSite::DeactivateAndUndo"); + return S_OK; +} + +HRESULT FrameSite::OnPosRectChange(LPCRECT lprcPosRect) +{ + WXOLE_TRACE("IOleInPlaceSite::OnPosRectChange"); + if (m_window->m_oleInPlaceObject.Ok() && lprcPosRect) + m_window->m_oleInPlaceObject->SetObjectRects(lprcPosRect, lprcPosRect); + + return S_OK; +} + +//IOleInPlaceSiteEx + +HRESULT FrameSite::OnInPlaceActivateEx(BOOL * pfNoRedraw, DWORD dwFlags) +{ + WXOLE_TRACE("IOleInPlaceSiteEx::OnInPlaceActivateEx"); + OleLockRunning(m_window->m_ActiveX, TRUE, FALSE); + if (pfNoRedraw) + (*pfNoRedraw) = FALSE; + return S_OK; +} + +HRESULT FrameSite::OnInPlaceDeactivateEx(BOOL fNoRedraw) +{ + WXOLE_TRACE("IOleInPlaceSiteEx::OnInPlaceDeactivateEx"); + OleLockRunning(m_window->m_ActiveX, FALSE, FALSE); + return S_OK; +} + +HRESULT FrameSite::RequestUIActivate() +{ + WXOLE_TRACE("IOleInPlaceSiteEx::RequestUIActivate"); + return S_OK; +} + + +//IOleClientSite + +HRESULT FrameSite::SaveObject() +{ + WXOLE_TRACE("IOleClientSite::SaveObject"); + return S_OK; +} + +const char *OleGetMonikerToStr(DWORD dwAssign) +{ + switch (dwAssign) + { + case OLEGETMONIKER_ONLYIFTHERE : return "OLEGETMONIKER_ONLYIFTHERE"; + case OLEGETMONIKER_FORCEASSIGN : return "OLEGETMONIKER_FORCEASSIGN"; + case OLEGETMONIKER_UNASSIGN : return "OLEGETMONIKER_UNASSIGN"; + case OLEGETMONIKER_TEMPFORUSER : return "OLEGETMONIKER_TEMPFORUSER"; + default : return "Bad Enum"; + }; +}; + +const char *OleGetWhicMonikerStr(DWORD dwWhichMoniker) +{ + switch(dwWhichMoniker) + { + case OLEWHICHMK_CONTAINER : return "OLEWHICHMK_CONTAINER"; + case OLEWHICHMK_OBJREL : return "OLEWHICHMK_OBJREL"; + case OLEWHICHMK_OBJFULL : return "OLEWHICHMK_OBJFULL"; + default : return "Bad Enum"; + }; +}; + +HRESULT FrameSite::GetMoniker(DWORD dwAssign, DWORD dwWhichMoniker, + IMoniker ** ppmk) +{ + WXOLE_TRACEOUT("IOleClientSite::GetMoniker(" << OleGetMonikerToStr(dwAssign) << ", " << OleGetWhicMonikerStr(dwWhichMoniker) << ")"); + + + if (! ppmk) + return E_FAIL; + + /* + HRESULT hr = CreateFileMoniker(L"e:\\dev\\wxie\\bug-zap.swf", ppmk); + if (SUCCEEDED(hr)) + return S_OK; + */ + *ppmk = NULL; + + return E_FAIL ; +} + +HRESULT FrameSite::GetContainer(LPOLECONTAINER * ppContainer) +{ + WXOLE_TRACE("IOleClientSite::GetContainer"); + if (ppContainer == NULL) + return E_INVALIDARG; + + HRESULT hr = QueryInterface(IID_IOleContainer, (void**)(ppContainer)); + wxASSERT(SUCCEEDED(hr)); + + return hr; +} + +HRESULT FrameSite::ShowObject() +{ + WXOLE_TRACE("IOleClientSite::ShowObject"); + if (m_window->m_oleObjectHWND) + ::ShowWindow(m_window->m_oleObjectHWND, SW_SHOW); + return S_OK; +} + +HRESULT FrameSite::OnShowWindow(BOOL fShow) +{ + WXOLE_TRACE("IOleClientSite::OnShowWindow"); + return S_OK; +} + +HRESULT FrameSite::RequestNewObjectLayout() +{ + WXOLE_TRACE("IOleClientSite::RequestNewObjectLayout"); + return E_NOTIMPL; +} + +// IParseDisplayName + +HRESULT FrameSite::ParseDisplayName(IBindCtx *pbc, LPOLESTR pszDisplayName, + ULONG *pchEaten, IMoniker **ppmkOut) +{ + WXOLE_TRACE("IParseDisplayName::ParseDisplayName"); + return E_NOTIMPL; +} + +//IOleContainer + +HRESULT FrameSite::EnumObjects(DWORD grfFlags, IEnumUnknown **ppenum) +{ + WXOLE_TRACE("IOleContainer::EnumObjects"); + return E_NOTIMPL; +} + +HRESULT FrameSite::LockContainer(BOOL fLock) +{ + WXOLE_TRACE("IOleContainer::LockContainer"); + // TODO + return S_OK; +} + +//IOleItemContainer + +HRESULT FrameSite::GetObject(LPOLESTR pszItem, DWORD dwSpeedNeeded, + IBindCtx * pbc, REFIID riid, void ** ppvObject) +{ + WXOLE_TRACE("IOleItemContainer::GetObject"); + if (pszItem == NULL) + return E_INVALIDARG; + if (ppvObject == NULL) + return E_INVALIDARG; + + *ppvObject = NULL; + return MK_E_NOOBJECT; +} + +HRESULT FrameSite::GetObjectStorage(LPOLESTR pszItem, IBindCtx * pbc, + REFIID riid, void ** ppvStorage) +{ + WXOLE_TRACE("IOleItemContainer::GetObjectStorage"); + if (pszItem == NULL) + return E_INVALIDARG; + if (ppvStorage == NULL) + return E_INVALIDARG; + + *ppvStorage = NULL; + return MK_E_NOOBJECT; +} + +HRESULT FrameSite::IsRunning(LPOLESTR pszItem) +{ + WXOLE_TRACE("IOleItemContainer::IsRunning"); + if (pszItem == NULL) + return E_INVALIDARG; + + return MK_E_NOOBJECT; +} + + + +//IOleControlSite + +HRESULT FrameSite::OnControlInfoChanged() +{ + WXOLE_TRACE("IOleControlSite::OnControlInfoChanged"); + return S_OK; +} + +HRESULT FrameSite::LockInPlaceActive(BOOL fLock) +{ + WXOLE_TRACE("IOleControlSite::LockInPlaceActive"); + m_bInPlaceLocked = (fLock) ? true : false; + return S_OK; +} + +HRESULT FrameSite::GetExtendedControl(IDispatch ** ppDisp) +{ + WXOLE_TRACE("IOleControlSite::GetExtendedControl"); + return E_NOTIMPL; +} + +HRESULT FrameSite::TransformCoords(POINTL * pPtlHimetric, POINTF * pPtfContainer, DWORD dwFlags) +{ + WXOLE_TRACE("IOleControlSite::TransformCoords"); + HRESULT hr = S_OK; + + if (pPtlHimetric == NULL) + return E_INVALIDARG; + + if (pPtfContainer == NULL) + return E_INVALIDARG; + + return E_NOTIMPL; + +} + +HRESULT FrameSite::TranslateAccelerator(LPMSG pMsg, DWORD grfModifiers) +{ + WXOLE_TRACE("IOleControlSite::TranslateAccelerator"); + // TODO: send an event with this id + return E_NOTIMPL; +} + +HRESULT FrameSite::OnFocus(BOOL fGotFocus) +{ + WXOLE_TRACE("IOleControlSite::OnFocus"); + return S_OK; +} + +HRESULT FrameSite::ShowPropertyFrame() +{ + WXOLE_TRACE("IOleControlSite::ShowPropertyFrame"); + return E_NOTIMPL; +} + +//IOleCommandTarget + +HRESULT FrameSite::QueryStatus(const GUID * pguidCmdGroup, ULONG cCmds, + OLECMD * prgCmds, OLECMDTEXT * pCmdTet) +{ + WXOLE_TRACE("IOleCommandTarget::QueryStatus"); + if (prgCmds == NULL) return E_INVALIDARG; + bool bCmdGroupFound = false; + + for (ULONG nCmd = 0; nCmd < cCmds; nCmd++) + { + // unsupported by default + prgCmds[nCmd].cmdf = 0; + + // TODO + } + + if (!bCmdGroupFound) { OLECMDERR_E_UNKNOWNGROUP; } + return S_OK; +} + +HRESULT FrameSite::Exec(const GUID * pguidCmdGroup, DWORD nCmdID, + DWORD nCmdExecOpt, VARIANTARG * pVaIn, + VARIANTARG * pVaOut) +{ + WXOLE_TRACE("IOleCommandTarget::Exec"); + bool bCmdGroupFound = false; + + if (!bCmdGroupFound) { OLECMDERR_E_UNKNOWNGROUP; } + return OLECMDERR_E_NOTSUPPORTED; +} + +//IAdviseSink + +void STDMETHODCALLTYPE FrameSite::OnDataChange(FORMATETC * pFormatEtc, STGMEDIUM * pgStgMed) +{ + WXOLE_TRACE("IAdviseSink::OnDataChange"); +} + +void STDMETHODCALLTYPE FrameSite::OnViewChange(DWORD dwAspect, LONG lIndex) +{ + WXOLE_TRACE("IAdviseSink::OnViewChange"); + // redraw the control +} + +void STDMETHODCALLTYPE FrameSite::OnRename(IMoniker * pmk) +{ + WXOLE_TRACE("IAdviseSink::OnRename"); +} + +void STDMETHODCALLTYPE FrameSite::OnSave() +{ + WXOLE_TRACE("IAdviseSink::OnSave"); +} + +void STDMETHODCALLTYPE FrameSite::OnClose() +{ + WXOLE_TRACE("IAdviseSink::OnClose"); +} + +///////////////////////////////////////////// +// IOleDocumentSite +HRESULT STDMETHODCALLTYPE FrameSite::ActivateMe( + /* [in] */ IOleDocumentView __RPC_FAR *pViewToActivate) +{ + wxAutoOleInterface inPlaceSite(IID_IOleInPlaceSite, (IDispatch *) this); + if (!inPlaceSite.Ok()) + return E_FAIL; + + if (pViewToActivate) + { + m_window->m_docView = pViewToActivate; + m_window->m_docView->SetInPlaceSite(inPlaceSite); + } + else + { + wxAutoOleInterface oleDoc(IID_IOleDocument, m_window->m_oleObject); + if (! oleDoc.Ok()) + return E_FAIL; + + HRESULT hr = oleDoc->CreateView(inPlaceSite, NULL, 0, m_window->m_docView.GetRef()); + if (hr != S_OK) + return E_FAIL; + + m_window->m_docView->SetInPlaceSite(inPlaceSite); + }; + + m_window->m_docView->UIActivate(TRUE); + + return S_OK; +}; + + +static IMalloc *iMalloc = NULL; + +IMalloc *wxOleInit::GetIMalloc() +{ + assert(iMalloc); + return iMalloc; +}; + +wxOleInit::wxOleInit() +{ + if (OleInitialize(NULL) == S_OK && iMalloc == NULL) + CoGetMalloc(1, &iMalloc); + else if (iMalloc) + iMalloc->AddRef(); +}; + +wxOleInit::~wxOleInit() +{ + if (iMalloc) + { + if (iMalloc->Release() == 0) + iMalloc = NULL; + }; + + OleUninitialize(); +} + +bool GetSysErrMessage(int err, wxString& s) +{ + char buf[256]; + if (FormatMessage( + FORMAT_MESSAGE_FROM_SYSTEM, NULL, + err,0, buf, sizeof(buf), NULL) == 0) + return false; + + buf[sizeof(buf) - 1] = 0; + s = buf; + return true; +}; + +wxString OLEHResultToString(HRESULT hr) +{ + // try formatmessage + wxString err; + if (GetSysErrMessage(hr, err)) + return err; + + switch (hr) + { + case S_OK: + return ""; + + case CONNECT_E_CANNOTCONNECT: + return "Cannot connect to event interface (maybe not there ?) - see MSDN"; + + case DISP_E_MEMBERNOTFOUND: + return "The requested member does not exist, or the call to Invoke tried to set the value of a read-only property."; + + case DISP_E_BADVARTYPE: + return "One of the parameters in rgvarg is not a valid variant type."; + + case DISP_E_BADPARAMCOUNT: + return "The number of elements provided to DISPPARAMS is different from the number of parameters accepted by the method or property"; + + case DISP_E_EXCEPTION: + return "The application needs to raise an exception. In this case, the structure passed in pExcepInfo should be filled in."; + + case DISP_E_TYPEMISMATCH: + return "One or more of the parameters could not be coerced. The index within rgvarg of the first parameter with the incorrect type is returned in the puArgErr parameter."; + + case DISP_E_PARAMNOTOPTIONAL: + return "A required parameter was omitted."; + + case DISP_E_PARAMNOTFOUND: + return "One of the parameter DISPIDs does not correspond to a parameter on the method. In this case, puArgErr should be set to the first parameter that contains the error."; + + case OLECMDERR_E_UNKNOWNGROUP: + return "The pguidCmdGroup parameter is not NULL but does not specify a recognized command group."; + + case OLECMDERR_E_NOTSUPPORTED: + return "The nCmdID parameter is not a valid command in the group identified by pguidCmdGroup."; + + case OLECMDERR_E_DISABLED: + return "The command identified by nCmdID is currently disabled and cannot be executed."; + + case OLECMDERR_E_NOHELP: + return "The caller has asked for help on the command identified by nCmdID, but no help is available."; + + case OLECMDERR_E_CANCELED: + return "The user canceled the execution of the command."; + + case E_INVALIDARG: + return "E_INVALIDARG"; + + case E_OUTOFMEMORY: + return "E_OUTOFMEMORY"; + + case E_NOINTERFACE: + return "E_NOINTERFACE"; + + case E_UNEXPECTED: + return "E_UNEXPECTED"; + + case STG_E_INVALIDFLAG: + return "STG_E_INVALIDFLAG"; + + case E_FAIL: + return "E_FAIL"; + + case E_NOTIMPL: + return "E_NOTIMPL"; + + default: + { + char buf[64]; + sprintf(buf, "Unknown - 0x%X", hr); + return wxString(buf); + } + }; +}; + +// borrowed from src/msw/ole/oleutils.cpp +wxString GetIIDName(REFIID riid) +{ + // an association between symbolic name and numeric value of an IID + struct KNOWN_IID + { + const IID *pIid; + const wxChar *szName; + }; + + // construct the table containing all known interfaces + #define ADD_KNOWN_IID(name) { &IID_I##name, _T(#name) } + #define ADD_KNOWN_GUID(name) { &name, _T(#name) } + + static const KNOWN_IID aKnownIids[] = + { + ADD_KNOWN_IID(ServiceProvider), + ADD_KNOWN_IID(AdviseSink), + ADD_KNOWN_IID(AdviseSink2), + ADD_KNOWN_IID(BindCtx), + ADD_KNOWN_IID(ClassFactory), +#if ( !defined( __VISUALC__) || (__VISUALC__!=1010) ) && !defined(__MWERKS__) + ADD_KNOWN_IID(ContinueCallback), + ADD_KNOWN_IID(EnumOleDocumentViews), + ADD_KNOWN_IID(OleCommandTarget), + ADD_KNOWN_IID(OleDocument), + ADD_KNOWN_IID(OleDocumentSite), + ADD_KNOWN_IID(OleDocumentView), + ADD_KNOWN_IID(Print), +#endif + ADD_KNOWN_IID(DataAdviseHolder), + ADD_KNOWN_IID(DataObject), + ADD_KNOWN_IID(Debug), + ADD_KNOWN_IID(DebugStream), + ADD_KNOWN_IID(DfReserved1), + ADD_KNOWN_IID(DfReserved2), + ADD_KNOWN_IID(DfReserved3), + ADD_KNOWN_IID(Dispatch), + ADD_KNOWN_IID(DropSource), + ADD_KNOWN_IID(DropTarget), + ADD_KNOWN_IID(EnumCallback), + ADD_KNOWN_IID(EnumFORMATETC), + ADD_KNOWN_IID(EnumGeneric), + ADD_KNOWN_IID(EnumHolder), + ADD_KNOWN_IID(EnumMoniker), + ADD_KNOWN_IID(EnumOLEVERB), + ADD_KNOWN_IID(EnumSTATDATA), + ADD_KNOWN_IID(EnumSTATSTG), + ADD_KNOWN_IID(EnumString), + ADD_KNOWN_IID(EnumUnknown), + ADD_KNOWN_IID(EnumVARIANT), + ADD_KNOWN_IID(ExternalConnection), + ADD_KNOWN_IID(InternalMoniker), + ADD_KNOWN_IID(LockBytes), + ADD_KNOWN_IID(Malloc), + ADD_KNOWN_IID(Marshal), + ADD_KNOWN_IID(MessageFilter), + ADD_KNOWN_IID(Moniker), + ADD_KNOWN_IID(OleAdviseHolder), + ADD_KNOWN_IID(OleCache), + ADD_KNOWN_IID(OleCache2), + ADD_KNOWN_IID(OleCacheControl), + ADD_KNOWN_IID(OleClientSite), + ADD_KNOWN_IID(OleContainer), + ADD_KNOWN_IID(OleInPlaceActiveObject), + ADD_KNOWN_IID(OleInPlaceFrame), + ADD_KNOWN_IID(OleInPlaceObject), + ADD_KNOWN_IID(OleInPlaceSite), + ADD_KNOWN_IID(OleInPlaceUIWindow), + ADD_KNOWN_IID(OleItemContainer), + ADD_KNOWN_IID(OleLink), + ADD_KNOWN_IID(OleManager), + ADD_KNOWN_IID(OleObject), + ADD_KNOWN_IID(OlePresObj), + ADD_KNOWN_IID(OleWindow), + ADD_KNOWN_IID(PSFactory), + ADD_KNOWN_IID(ParseDisplayName), + ADD_KNOWN_IID(Persist), + ADD_KNOWN_IID(PersistFile), + ADD_KNOWN_IID(PersistStorage), + ADD_KNOWN_IID(PersistStream), + ADD_KNOWN_IID(ProxyManager), + ADD_KNOWN_IID(RootStorage), + ADD_KNOWN_IID(RpcChannel), + ADD_KNOWN_IID(RpcProxy), + ADD_KNOWN_IID(RpcStub), + ADD_KNOWN_IID(RunnableObject), + ADD_KNOWN_IID(RunningObjectTable), + ADD_KNOWN_IID(StdMarshalInfo), + ADD_KNOWN_IID(Storage), + ADD_KNOWN_IID(Stream), + ADD_KNOWN_IID(StubManager), + ADD_KNOWN_IID(Unknown), + ADD_KNOWN_IID(ViewObject), + ADD_KNOWN_IID(ViewObject2), + ADD_KNOWN_GUID(IID_IDispatch), + ADD_KNOWN_GUID(IID_IWebBrowser), + ADD_KNOWN_GUID(IID_IWebBrowserApp), + ADD_KNOWN_GUID(IID_IWebBrowser2), + ADD_KNOWN_GUID(IID_IWebBrowser), + ADD_KNOWN_GUID(DIID_DWebBrowserEvents2), + ADD_KNOWN_GUID(DIID_DWebBrowserEvents), + }; + + // don't clobber preprocessor name space + #undef ADD_KNOWN_IID + #undef ADD_KNOWN_GUID + + // try to find the interface in the table + for ( size_t ui = 0; ui < WXSIZEOF(aKnownIids); ui++ ) + { + if ( riid == *aKnownIids[ui].pIid ) + { + return aKnownIids[ui].szName; + } + } + + // unknown IID, just transform to string + LPOLESTR str = NULL; + StringFromIID(riid, &str); + if (str) + { + wxString s = str; + CoTaskMemFree(str); + return s; + } + else + return "StringFromIID() error"; +} diff --git a/wxPython/contrib/activex/wxie/wxactivex.h b/wxPython/contrib/activex/wxie/wxactivex.h new file mode 100644 index 0000000000..4b40323708 --- /dev/null +++ b/wxPython/contrib/activex/wxie/wxactivex.h @@ -0,0 +1,676 @@ +/* + wxActiveX Library Licence, Version 3 + ==================================== + + Copyright (C) 2003 Lindsay Mathieson [, ...] + + Everyone is permitted to copy and distribute verbatim copies + of this licence document, but changing it is not allowed. + + wxActiveX LIBRARY LICENCE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + This library is free software; you can redistribute it and/or modify it + under the terms of the GNU Library General Public Licence as published by + the Free Software Foundation; either version 2 of the Licence, or (at + your option) any later version. + + This library is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library + General Public Licence for more details. + + You should have received a copy of the GNU Library General Public Licence + along with this software, usually in a file named COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, + Boston, MA 02111-1307 USA. + + EXCEPTION NOTICE + + 1. As a special exception, the copyright holders of this library give + permission for additional uses of the text contained in this release of + the library as licenced under the wxActiveX Library Licence, applying + either version 3 of the Licence, or (at your option) any later version of + the Licence as published by the copyright holders of version 3 of the + Licence document. + + 2. The exception is that you may use, copy, link, modify and distribute + under the user's own terms, binary object code versions of works based + on the Library. + + 3. If you copy code from files distributed under the terms of the GNU + General Public Licence or the GNU Library General Public Licence into a + copy of this library, as this licence permits, the exception does not + apply to the code that you add in this way. To avoid misleading anyone as + to the status of such modified files, you must delete this exception + notice from such code and/or adjust the licensing conditions notice + accordingly. + + 4. If you write modifications of your own for this library, it is your + choice whether to permit this exception to apply to your modifications. + If you do not wish that, you must delete the exception notice from such + code and/or adjust the licensing conditions notice accordingly. +*/ + +/*! \file wxactivex.h + \brief implements wxActiveX window class and OLE tools +*/ + +#ifndef WX_ACTIVE_X +#define WX_ACTIVE_X +#pragma warning( disable : 4101 4786) +#pragma warning( disable : 4786) + + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +using namespace std; + +/// \brief wxActiveX Namespace for stuff I want to keep out of other tools way. +namespace NS_wxActiveX +{ + /// STL utilty class. + /// specific to wxActiveX, for creating + /// case insenstive maps etc + struct less_wxStringI + { + bool operator()(const wxString& x, const wxString& y) const + { + return x.CmpNoCase(y) < 0; + }; + }; +}; + + +////////////////////////////////////////// +/// Template class for smart interface handling. +/// - Automatically dereferences ole interfaces +/// - Smart Copy Semantics +/// - Can Create Interfaces +/// - Can query for other interfaces +template class wxAutoOleInterface +{ + protected: + I *m_interface; + + public: + /// takes ownership of an existing interface + /// Assumed to already have a AddRef() applied + explicit wxAutoOleInterface(I *pInterface = NULL) : m_interface(pInterface) {} + + /// queries for an interface + wxAutoOleInterface(REFIID riid, IUnknown *pUnk) : m_interface(NULL) + { + QueryInterface(riid, pUnk); + }; + /// queries for an interface + wxAutoOleInterface(REFIID riid, IDispatch *pDispatch) : m_interface(NULL) + { + QueryInterface(riid, pDispatch); + }; + + /// Creates an Interface + wxAutoOleInterface(REFCLSID clsid, REFIID riid) : m_interface(NULL) + { + CreateInstance(clsid, riid); + }; + + /// copy constructor + wxAutoOleInterface(const wxAutoOleInterface& ti) : m_interface(NULL) + { + operator = (ti); + } + + /// assignment operator + wxAutoOleInterface& operator = (const wxAutoOleInterface& ti) + { + if (ti.m_interface) + ti.m_interface->AddRef(); + Free(); + m_interface = ti.m_interface; + return *this; + } + + /// takes ownership of an existing interface + /// Assumed to already have a AddRef() applied + wxAutoOleInterface& operator = (I *&ti) + { + Free(); + m_interface = ti; + return *this; + } + + /// invokes Free() + ~wxAutoOleInterface() + { + Free(); + }; + + + /// Releases interface (i.e decrements refCount) + inline void Free() + { + if (m_interface) + m_interface->Release(); + m_interface = NULL; + }; + + /// queries for an interface + HRESULT QueryInterface(REFIID riid, IUnknown *pUnk) + { + Free(); + wxCHECK(pUnk != NULL, -1); + return pUnk->QueryInterface(riid, (void **) &m_interface); + }; + + /// Create a Interface instance + HRESULT CreateInstance(REFCLSID clsid, REFIID riid) + { + Free(); + return CoCreateInstance(clsid, NULL, CLSCTX_ALL, riid, (void **) &m_interface); + }; + + + /// returns the interface pointer + inline operator I *() const {return m_interface;} + + /// returns the dereferenced interface pointer + inline I* operator ->() {return m_interface;} + /// returns a pointer to the interface pointer + inline I** GetRef() {return &m_interface;} + /// returns true if we have a valid interface pointer + inline bool Ok() const {return m_interface != NULL;} +}; + + +/// \brief Converts a std HRESULT to its error code. +/// Hardcoded, by no means a definitive list. +wxString OLEHResultToString(HRESULT hr); +/// \brief Returns the string description of a IID. +/// Hardcoded, by no means a definitive list. +wxString GetIIDName(REFIID riid); + +//#define __WXOLEDEBUG + + +#ifdef __WXOLEDEBUG + #define WXOLE_TRACE(str) {OutputDebugString(str);OutputDebugString("\r\n");} + #define WXOLE_TRACEOUT(stuff)\ + {\ + wxString os;\ + os << stuff << "\r\n";\ + WXOLE_TRACE(os.mb_str());\ + } + + #define WXOLE_WARN(__hr,msg)\ + {\ + if (__hr != S_OK)\ + {\ + wxString s = "*** ";\ + s += msg;\ + s += " : "+ OLEHResultToString(__hr);\ + WXOLE_TRACE(s.c_str());\ + }\ + } +#else + #define WXOLE_TRACE(str) + #define WXOLE_TRACEOUT(stuff) + #define WXOLE_WARN(_proc,msg) {_proc;} +#endif + +class wxOleInit +{ + public: + static IMalloc *GetIMalloc(); + + wxOleInit(); + ~wxOleInit(); +}; + +#define DECLARE_OLE_UNKNOWN(cls)\ + private:\ + class TAutoInitInt\ + {\ + public:\ + LONG l;\ + TAutoInitInt() : l(0) {}\ + };\ + TAutoInitInt refCount, lockCount;\ + wxOleInit oleInit;\ + static void _GetInterface(cls *self, REFIID iid, void **_interface, const char *&desc);\ + public:\ + LONG GetRefCount();\ + HRESULT STDMETHODCALLTYPE QueryInterface(REFIID iid, void ** ppvObject);\ + ULONG STDMETHODCALLTYPE AddRef();\ + ULONG STDMETHODCALLTYPE Release();\ + ULONG STDMETHODCALLTYPE AddLock();\ + ULONG STDMETHODCALLTYPE ReleaseLock() + +#define DEFINE_OLE_TABLE(cls)\ + LONG cls::GetRefCount() {return refCount.l;}\ + HRESULT STDMETHODCALLTYPE cls::QueryInterface(REFIID iid, void ** ppvObject)\ + {\ + if (! ppvObject)\ + {\ + WXOLE_TRACE("*** NULL POINTER ***");\ + return E_FAIL;\ + };\ + const char *desc = NULL;\ + cls::_GetInterface(this, iid, ppvObject, desc);\ + if (! *ppvObject)\ + {\ + WXOLE_TRACEOUT("<" << GetIIDName(iid).c_str() << "> Not Found");\ + return E_NOINTERFACE;\ + };\ + WXOLE_TRACEOUT("QI : <" << desc <<">");\ + ((IUnknown * )(*ppvObject))->AddRef();\ + return S_OK;\ + };\ + ULONG STDMETHODCALLTYPE cls::AddRef()\ + {\ + WXOLE_TRACEOUT(# cls << "::Add ref(" << refCount.l << ")");\ + InterlockedIncrement(&refCount.l);\ + return refCount.l;\ + };\ + ULONG STDMETHODCALLTYPE cls::Release()\ + {\ + if (refCount.l > 0)\ + {\ + InterlockedDecrement(&refCount.l);\ + WXOLE_TRACEOUT(# cls << "::Del ref(" << refCount.l << ")");\ + if (refCount.l == 0)\ + {\ + delete this;\ + return 0;\ + };\ + return refCount.l;\ + }\ + else\ + return 0;\ + }\ + ULONG STDMETHODCALLTYPE cls::AddLock()\ + {\ + WXOLE_TRACEOUT(# cls << "::Add Lock(" << lockCount.l << ")");\ + InterlockedIncrement(&lockCount.l);\ + return lockCount.l;\ + };\ + ULONG STDMETHODCALLTYPE cls::ReleaseLock()\ + {\ + if (lockCount.l > 0)\ + {\ + InterlockedDecrement(&lockCount.l);\ + WXOLE_TRACEOUT(# cls << "::Del Lock(" << lockCount.l << ")");\ + return lockCount.l;\ + }\ + else\ + return 0;\ + }\ + DEFINE_OLE_BASE(cls) + +#define DEFINE_OLE_BASE(cls)\ + void cls::_GetInterface(cls *self, REFIID iid, void **_interface, const char *&desc)\ + {\ + *_interface = NULL;\ + desc = NULL; + +#define OLE_INTERFACE(_iid, _type)\ + if (IsEqualIID(iid, _iid))\ + {\ + WXOLE_TRACE("Found Interface <" # _type ">");\ + *_interface = (IUnknown *) (_type *) self;\ + desc = # _iid;\ + return;\ + } + +#define OLE_IINTERFACE(_face) OLE_INTERFACE(IID_##_face, _face) + +#define OLE_INTERFACE_CUSTOM(func)\ + if (func(self, iid, _interface, desc))\ + {\ + return;\ + } + +#define END_OLE_TABLE\ + } + + +/// Main class for embedding a ActiveX control. +/// Use by itself or derive from it +/// \note The utility program (wxie) can generate a list of events, methods & properties +/// for a control. +/// First display the control (File|Display), +/// then get the type info (ActiveX|Get Type Info) - these are copied to the clipboard. +/// Eventually this will be expanded to autogenerate +/// wxWindows source files for a control with all methods etc encapsulated. +/// \par Usage: +/// construct using a ProgId or class id +/// \code new wxActiveX(parent, CLSID_WebBrowser, id, pos, size, style, name)\endcode +/// \code new wxActiveX(parent, "ShockwaveFlash.ShockwaveFlash", id, pos, size, style, name)\endcode +/// \par Properties +/// Properties can be set using \c SetProp() and set/retrieved using \c Prop() +/// \code SetProp(name, wxVariant(x)) \endcode or +/// \code wxString Prop("") = x\endcode +/// \code wxString result = Prop("")\endcode +/// \code flash_ctl.Prop("movie") = "file:///movies/test.swf";\endcode +/// \code flash_ctl.Prop("Playing") = false;\endcode +/// \code wxString current_movie = flash_ctl.Prop("movie");\endcode +/// \par Methods +/// Methods are invoked with \c CallMethod() +/// \code wxVariant result = CallMethod("", args, nargs = -1)\endcode +/// \code wxVariant args[] = {0L, "file:///e:/dev/wxie/bug-zap.swf"}; +/// wxVariant result = X->CallMethod("LoadMovie", args);\endcode +/// \par events +/// respond to events with the +/// \c EVT_ACTIVEX(controlId, eventName, handler) & +/// \c EVT_ACTIVEX_DISPID(controlId, eventDispId, handler) macros +/// \code +/// BEGIN_EVENT_TABLE(wxIEFrame, wxFrame) +/// EVT_ACTIVEX_DISPID(ID_MSHTML, DISPID_STATUSTEXTCHANGE, OnMSHTMLStatusTextChangeX) +/// EVT_ACTIVEX(ID_MSHTML, "BeforeNavigate2", OnMSHTMLBeforeNavigate2X) +/// EVT_ACTIVEX(ID_MSHTML, "TitleChange", OnMSHTMLTitleChangeX) +/// EVT_ACTIVEX(ID_MSHTML, "NewWindow2", OnMSHTMLNewWindow2X) +/// EVT_ACTIVEX(ID_MSHTML, "ProgressChange", OnMSHTMLProgressChangeX) +/// END_EVENT_TABLE()\endcode +class wxActiveX : public wxWindow { +public: + /// General parameter and return type infoformation for Events, Properties and Methods. + /// refer to ELEMDESC, IDLDESC in MSDN + class ParamX + { + public: + USHORT flags; + bool isPtr; + bool isSafeArray; + bool isOptional; + VARTYPE vt; + wxString name; + + ParamX() : isOptional(false), vt(VT_EMPTY) {} + inline bool IsIn() const {return (flags & IDLFLAG_FIN) != 0;} + inline bool IsOut() const {return (flags & IDLFLAG_FOUT) != 0;} + inline bool IsRetVal() const {return (flags & IDLFLAG_FRETVAL) != 0;} + }; + typedef vector ParamXArray; + + + /// Type & Parameter info for Events and Methods. + /// refer to FUNCDESC in MSDN + class FuncX + { + public: + wxString name; + MEMBERID memid; + bool hasOut; + + ParamX retType; + ParamXArray params; + }; + typedef vector FuncXArray; + + + /// Type info for properties. + class PropX + { + public: + wxString name; + MEMBERID memid; + ParamX type; + ParamX arg; + bool putByRef; + + PropX() : putByRef (false) {} + inline bool CanGet() const {return type.vt != VT_EMPTY;} + inline bool CanSet() const {return arg.vt != VT_EMPTY;} + }; + typedef vector PropXArray; + + + /// Create using clsid. + wxActiveX(wxWindow * parent, REFCLSID clsid, wxWindowID id = -1, + const wxPoint& pos = wxDefaultPosition, + const wxSize& size = wxDefaultSize, + long style = 0, + const wxString& name = wxPanelNameStr); + /// create using progid. + wxActiveX(wxWindow * parent, const wxString& progId, wxWindowID id = -1, + const wxPoint& pos = wxDefaultPosition, + const wxSize& size = wxDefaultSize, + long style = 0, + const wxString& name = wxPanelNameStr); + virtual ~wxActiveX(); + + /// Number of events defined for this control. + inline int GetEventCount() const {return m_events.size();} + /// returns event description by index. + /// throws exception for invalid index + const FuncX& GetEventDesc(int idx) const; + + /// Number of properties defined for this control. + inline int GetPropCount() const {return m_props.size();} + /// returns property description by index. + /// throws exception for invalid index + const PropX& GetPropDesc(int idx) const; + /// returns property description by name. + /// throws exception for invalid name + const PropX& GetPropDesc(const wxString& name) const; + + /// Number of methods defined for this control. + inline int GetMethodCount() const {return m_methods.size();} + /// returns method description by name. + /// throws exception for invalid index + const FuncX& GetMethodDesc(int idx) const; + /// returns method description by name. + /// throws exception for invalid name + const FuncX& GetMethodDesc(const wxString& name) const; + + /// Set property VARIANTARG value by MEMBERID. + void SetProp(MEMBERID name, VARIANTARG& value); + /// Set property using wxVariant by name. + void SetProp(const wxString &name, const wxVariant &value); + + class wxPropertySetter + { + public: + wxActiveX *m_ctl; + wxString m_propName; + + wxPropertySetter(wxActiveX *ctl, const wxString& propName) : + m_ctl(ctl), m_propName(propName) {} + + inline const wxPropertySetter& operator = (wxVariant v) const + { + m_ctl->SetProp(m_propName, v); + return *this; + }; + + inline operator wxVariant() const {return m_ctl->GetPropAsWxVariant(m_propName);}; + inline operator wxString() const {return m_ctl->GetPropAsString(m_propName);}; + inline operator char() const {return m_ctl->GetPropAsChar(m_propName);}; + inline operator long() const {return m_ctl->GetPropAsLong(m_propName);}; + inline operator bool() const {return m_ctl->GetPropAsBool(m_propName);}; + inline operator double() const {return m_ctl->GetPropAsDouble(m_propName);}; + inline operator wxDateTime() const {return m_ctl->GetPropAsDateTime(m_propName);}; + inline operator void *() const {return m_ctl->GetPropAsPointer(m_propName);}; + }; + + /// \fn inline wxPropertySetter Prop(wxString name) {return wxPropertySetter(this, name);} + /// \param name Property name to read/set + /// \return wxPropertySetter, which has overloads for setting/getting the property + /// \brief Generic Get/Set Property by name. + /// Automatically handles most types + /// \par Usage: + /// - Prop("\") = \ + /// - var = Prop("\") + /// - e.g: + /// - \code flash_ctl.Prop("movie") = "file:///movies/test.swf";\endcode + /// - \code flash_ctl.Prop("Playing") = false;\endcode + /// - \code wxString current_movie = flash_ctl.Prop("movie");\endcode + /// \exception raises exception if \ is invalid + /// \note Have to add a few more type conversions yet ... + inline wxPropertySetter Prop(wxString name) {return wxPropertySetter(this, name);} + + VARIANT GetPropAsVariant(MEMBERID name); + VARIANT GetPropAsVariant(const wxString& name); + wxVariant GetPropAsWxVariant(const wxString& name); + wxString GetPropAsString(const wxString& name); + char GetPropAsChar(const wxString& name); + long GetPropAsLong(const wxString& name); + bool GetPropAsBool(const wxString& name); + double GetPropAsDouble(const wxString& name); + wxDateTime GetPropAsDateTime(const wxString& name); + void *GetPropAsPointer(const wxString& name); + + // methods + // VARIANTARG form is passed straight to Invoke, + // so args in *REVERSE* order + VARIANT CallMethod(MEMBERID name, VARIANTARG args[], int argc); + VARIANT CallMethod(const wxString& name, VARIANTARG args[] = NULL, int argc = -1); + // args are in *NORMAL* order + // args can be a single wxVariant or an array + /// \fn wxVariant CallMethod(wxString name, wxVariant args[], int nargs = -1); + /// \param name name of method to call + /// \param args array of wxVariant's, defaults to NULL (no args) + /// \param nargs number of arguments passed via args. Defaults to actual number of args for the method + /// \return wxVariant + /// \brief Call a method of the ActiveX control. + /// Automatically handles most types + /// \par Usage: + /// - result = CallMethod("\", args, nargs) + /// - e.g. + /// - \code + /// wxVariant args[] = {0L, "file:///e:/dev/wxie/bug-zap.swf"}; + /// wxVariant result = X->CallMethod("LoadMovie", args);\endcode + /// \exception raises exception if \ is invalid + /// \note Since wxVariant has built in type conversion, most the std types can be passed easily + wxVariant CallMethod(const wxString& name, wxVariant args[], int nargs = -1); + + HRESULT ConnectAdvise(REFIID riid, IUnknown *eventSink); + + void OnSize(wxSizeEvent&); + void OnPaint(wxPaintEvent& event); + void OnMouse(wxMouseEvent& event); + void OnSetFocus(wxFocusEvent&); + void OnKillFocus(wxFocusEvent&); + + DECLARE_EVENT_TABLE(); + +protected: + friend class FrameSite; + friend class wxActiveXEvents; + + + typedef map MemberIdMap; + typedef map NameMap; + + typedef wxAutoOleInterface wxOleConnectionPoint; + typedef pair wxOleConnection; + typedef vector wxOleConnectionArray; + + wxAutoOleInterface m_Dispatch; + wxAutoOleInterface m_clientSite; + wxAutoOleInterface m_ActiveX; + wxAutoOleInterface m_oleObject; + wxAutoOleInterface m_oleInPlaceObject; + wxAutoOleInterface + + m_oleInPlaceActiveObject; + wxAutoOleInterface m_docView; + wxAutoOleInterface m_viewObject; + HWND m_oleObjectHWND; + bool m_bAmbientUserMode; + DWORD m_docAdviseCookie; + wxOleConnectionArray m_connections; + + void CreateActiveX(REFCLSID clsid); + void CreateActiveX(LPOLESTR progId); + HRESULT AmbientPropertyChanged(DISPID dispid); + + void GetTypeInfo(); + void GetTypeInfo(ITypeInfo *ti, bool defInterface, bool defEventSink); + + + // events + FuncXArray m_events; + MemberIdMap m_eventMemberIds; + + // properties + PropXArray m_props; + NameMap m_propNames; + + // Methods + FuncXArray m_methods; + NameMap m_methodNames; + + long MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam); +}; + +// events +class wxActiveXEvent : public wxCommandEvent +{ +private: + friend class wxActiveXEvents; + + wxVariant m_params; + +public: + + virtual wxEvent *Clone() const { return new wxActiveXEvent(*this); } + + wxString EventName(); + int ParamCount() const; + wxString ParamType(int idx); + wxString ParamName(int idx); + wxVariant& operator[] (int idx); + wxVariant& operator[] (wxString name); + +private: + DECLARE_CLASS(wxActiveXEvent) +}; + +const wxEventType& RegisterActiveXEvent(const wxChar *eventName); +const wxEventType& RegisterActiveXEvent(DISPID event); + +typedef void (wxEvtHandler::*wxActiveXEventFunction)(wxActiveXEvent&); + +/// \def EVT_ACTIVEX(id, eventName, fn) +/// \brief Event handle for events by name +#define EVT_ACTIVEX(id, eventName, fn) DECLARE_EVENT_TABLE_ENTRY(RegisterActiveXEvent(wxT(eventName)), id, -1, (wxObjectEventFunction) (wxEventFunction) (wxActiveXEventFunction) & fn, (wxObject *) NULL ), +/// \def EVT_ACTIVEX_DISPID(id, eventDispId, fn) +/// \brief Event handle for events by DISPID (dispath id) +#define EVT_ACTIVEX_DISPID(id, eventDispId, fn) DECLARE_EVENT_TABLE_ENTRY(RegisterActiveXEvent(eventDispId), id, -1, (wxObjectEventFunction) (wxEventFunction) (wxActiveXEventFunction) & fn, (wxObject *) NULL ), + +//util +bool wxDateTimeToVariant(wxDateTime dt, VARIANTARG& va); +bool VariantToWxDateTime(VARIANTARG va, wxDateTime& dt); +/// \relates wxActiveX +/// \fn bool MSWVariantToVariant(VARIANTARG& va, wxVariant& vx); +/// \param va VARAIANTARG to convert from +/// \param vx Destination wxVariant +/// \return success/failure (true/false) +/// \brief Convert MSW VARIANTARG to wxVariant. +/// Handles basic types, need to add: +/// - VT_ARRAY | VT_* +/// - better support for VT_UNKNOWN (currently treated as void *) +/// - better support for VT_DISPATCH (currently treated as void *) +bool MSWVariantToVariant(VARIANTARG& va, wxVariant& vx); +/// \relates wxActiveX +/// \fn bool VariantToMSWVariant(const wxVariant& vx, VARIANTARG& va); +/// \param vx wxVariant to convert from +/// \param va Destination VARIANTARG +/// \return success/failure (true/false) +/// \brief Convert wxVariant to MSW VARIANTARG. +/// Handles basic types, need to add: +/// - VT_ARRAY | VT_* +/// - better support for VT_UNKNOWN (currently treated as void *) +/// - better support for VT_DISPATCH (currently treated as void *) +bool VariantToMSWVariant(const wxVariant& vx, VARIANTARG& va); + +#endif /* _IEHTMLWIN_H_ */ diff --git a/wxPython/contrib/activex/wxie/zip.bat b/wxPython/contrib/activex/wxie/zip.bat new file mode 100755 index 0000000000..2953b60707 --- /dev/null +++ b/wxPython/contrib/activex/wxie/zip.bat @@ -0,0 +1,2 @@ +del wxie.zip +pkzip -max -add -dir -recurse -excl=CVS\*.* -excl=CVS\*.* -excl=debug\*.* wxie *.* diff --git a/wxPython/demo/ActiveX_FlashWindow.py b/wxPython/demo/ActiveX_FlashWindow.py new file mode 100644 index 0000000000..f0cf3db966 --- /dev/null +++ b/wxPython/demo/ActiveX_FlashWindow.py @@ -0,0 +1,104 @@ +import os +import wx + +if wx.Platform == '__WXMSW__': + from wx.lib.flashwin import FlashWindow + +from Main import opj + +#---------------------------------------------------------------------- + +class TestPanel(wx.Panel): + def __init__(self, parent, log): + wx.Panel.__init__(self, parent, -1) + self.pdf = None + + sizer = wx.BoxSizer(wx.VERTICAL) + btnSizer = wx.BoxSizer(wx.HORIZONTAL) + + self.flash = FlashWindow(self, style=wx.SUNKEN_BORDER) + self.flash.LoadMovie(0, 'file://' + os.path.abspath('data/Asteroid_blaster.swf')) + + sizer.Add(self.flash, proportion=1, flag=wx.EXPAND) + + btn = wx.Button(self, wx.NewId(), "Open Flash File") + self.Bind(wx.EVT_BUTTON, self.OnOpenFileButton, btn) + btnSizer.Add(btn, proportion=1, flag=wx.EXPAND|wx.ALL, border=5) + + btn = wx.Button(self, wx.NewId(), "Open Flash URL") + self.Bind(wx.EVT_BUTTON, self.OnOpenURLButton, btn) + btnSizer.Add(btn, proportion=1, flag=wx.EXPAND|wx.ALL, border=5) + + btnSizer.Add((50,-1), proportion=2, flag=wx.EXPAND) + sizer.Add(btnSizer, proportion=0, flag=wx.EXPAND) + + self.SetSizer(sizer) + self.SetAutoLayout(True) + + + + def OnOpenFileButton(self, event): + dlg = wx.FileDialog(self, wildcard="*.swf") + + if dlg.ShowModal() == wx.ID_OK: + wx.BeginBusyCursor() + self.flash.LoadMovie(0, 'file://' + dlg.GetPath()) + wx.EndBusyCursor() + + dlg.Destroy() + + + def OnOpenURLButton(self, event): + dlg = wx.TextEntryDialog(self, "Enter a URL of a .swf file", "Enter URL") + + if dlg.ShowModal() == wx.ID_OK: + wx.BeginBusyCursor() + # setting the movie property works too + self.flash.movie = dlg.GetValue() + wx.EndBusyCursor() + + dlg.Destroy() + + + +#---------------------------------------------------------------------- + +def runTest(frame, nb, log): + if wx.Platform == '__WXMSW__': + win = TestPanel(nb, log) + return win + else: + dlg = wx.MessageDialog(frame, 'This demo only works on MSW.', + 'Sorry', wx.OK | wx.ICON_INFORMATION) + dlg.ShowModal() + dlg.Destroy() + + +overview = """\ +

wx.lib.pdfwin.FlashWindow

+ +The wx.lib.pdfwin.FlashWindow class is yet another example of using +ActiveX controls from wxPython using the new wx.activex module. This +allows you to use an ActiveX control as if it is a wx.Window, you can +call its methods, set/get properties, and receive events from the +ActiveX control in a very intuitive way. + +

Using this class is simpler than ActiveXWrapper, doesn't rely on +the win32all extensions, and is more "wx\'ish", meaning that it uses +events and etc. as would be expected from any other wx window. + +

This demo embeds the Shackwave Flash control, and lets you play a game. + + +""" + +#---------------------------------------------------------------------- + + + +if __name__ == '__main__': + import sys,os + import run + run.main(['', os.path.basename(sys.argv[0])] + sys.argv[1:]) + + diff --git a/wxPython/demo/ActiveX_IEHtmlWindow.py b/wxPython/demo/ActiveX_IEHtmlWindow.py new file mode 100644 index 0000000000..b3bc40fbf7 --- /dev/null +++ b/wxPython/demo/ActiveX_IEHtmlWindow.py @@ -0,0 +1,225 @@ +# 11/18/2003 - Jeff Grimmett (grimmtooth@softhome.net) +# +# o Updated for wx namespace +# + +import wx + +if wx.Platform == '__WXMSW__': + import wx.lib.iewin as iewin + +#---------------------------------------------------------------------- + +class TestPanel(wx.Window): + def __init__(self, parent, log, frame=None): + wx.Window.__init__( + self, parent, -1, + style=wx.TAB_TRAVERSAL|wx.CLIP_CHILDREN|wx.NO_FULL_REPAINT_ON_RESIZE + ) + + self.log = log + self.current = "http://wxPython.org/" + self.frame = frame + + if frame: + self.titleBase = frame.GetTitle() + + sizer = wx.BoxSizer(wx.VERTICAL) + btnSizer = wx.BoxSizer(wx.HORIZONTAL) + + self.ie = iewin.IEHtmlWindow(self, -1, style = wx.NO_FULL_REPAINT_ON_RESIZE) + + + btn = wx.Button(self, -1, "Open", style=wx.BU_EXACTFIT) + self.Bind(wx.EVT_BUTTON, self.OnOpenButton, btn) + btnSizer.Add(btn, 0, wx.EXPAND|wx.ALL, 2) + + btn = wx.Button(self, -1, "Home", style=wx.BU_EXACTFIT) + self.Bind(wx.EVT_BUTTON, self.OnHomeButton, btn) + btnSizer.Add(btn, 0, wx.EXPAND|wx.ALL, 2) + + btn = wx.Button(self, -1, "<--", style=wx.BU_EXACTFIT) + self.Bind(wx.EVT_BUTTON, self.OnPrevPageButton, btn) + btnSizer.Add(btn, 0, wx.EXPAND|wx.ALL, 2) + + btn = wx.Button(self, -1, "-->", style=wx.BU_EXACTFIT) + self.Bind(wx.EVT_BUTTON, self.OnNextPageButton, btn) + btnSizer.Add(btn, 0, wx.EXPAND|wx.ALL, 2) + + btn = wx.Button(self, -1, "Stop", style=wx.BU_EXACTFIT) + self.Bind(wx.EVT_BUTTON, self.OnStopButton, btn) + btnSizer.Add(btn, 0, wx.EXPAND|wx.ALL, 2) + + btn = wx.Button(self, -1, "Search", style=wx.BU_EXACTFIT) + self.Bind(wx.EVT_BUTTON, self.OnSearchPageButton, btn) + btnSizer.Add(btn, 0, wx.EXPAND|wx.ALL, 2) + + btn = wx.Button(self, -1, "Refresh", style=wx.BU_EXACTFIT) + self.Bind(wx.EVT_BUTTON, self.OnRefreshPageButton, btn) + btnSizer.Add(btn, 0, wx.EXPAND|wx.ALL, 2) + + txt = wx.StaticText(self, -1, "Location:") + btnSizer.Add(txt, 0, wx.CENTER|wx.ALL, 2) + + self.location = wx.ComboBox( + self, -1, "", style=wx.CB_DROPDOWN|wx.PROCESS_ENTER + ) + + self.Bind(wx.EVT_COMBOBOX, self.OnLocationSelect, self.location) + self.location.Bind(wx.EVT_KEY_UP, self.OnLocationKey) + self.location.Bind(wx.EVT_CHAR, self.IgnoreReturn) + btnSizer.Add(self.location, 1, wx.EXPAND|wx.ALL, 2) + + sizer.Add(btnSizer, 0, wx.EXPAND) + sizer.Add(self.ie, 1, wx.EXPAND) + + self.ie.LoadUrl(self.current) + self.location.Append(self.current) + + self.SetSizer(sizer) + # Since this is a wxWindow we have to call Layout ourselves + self.Bind(wx.EVT_SIZE, self.OnSize) + + # Hook up the event handlers for the IE window + self.Bind(iewin.EVT_BeforeNavigate2, self.OnBeforeNavigate2, self.ie) + self.Bind(iewin.EVT_NewWindow2, self.OnNewWindow2, self.ie) + self.Bind(iewin.EVT_DocumentComplete, self.OnDocumentComplete, self.ie) + ##self.Bind(iewin.EVT_ProgressChange, self.OnProgressChange, self.ie) + self.Bind(iewin.EVT_StatusTextChange, self.OnStatusTextChange, self.ie) + self.Bind(iewin.EVT_TitleChange, self.OnTitleChange, self.ie) + + + def ShutdownDemo(self): + # put the frame title back + if self.frame: + self.frame.SetTitle(self.titleBase) + + + def OnSize(self, evt): + self.Layout() + + + def OnLocationSelect(self, evt): + url = self.location.GetStringSelection() + self.log.write('OnLocationSelect: %s\n' % url) + self.ie.Navigate(url) + + def OnLocationKey(self, evt): + if evt.KeyCode() == wx.WXK_RETURN: + URL = self.location.GetValue() + self.location.Append(URL) + self.ie.Navigate(URL) + else: + evt.Skip() + + + def IgnoreReturn(self, evt): + if evt.GetKeyCode() != wx.WXK_RETURN: + evt.Skip() + + def OnOpenButton(self, event): + dlg = wx.TextEntryDialog(self, "Open Location", + "Enter a full URL or local path", + self.current, wx.OK|wx.CANCEL) + dlg.CentreOnParent() + + if dlg.ShowModal() == wx.ID_OK: + self.current = dlg.GetValue() + self.ie.Navigate(self.current) + + dlg.Destroy() + + def OnHomeButton(self, event): + self.ie.GoHome() ## ET Phone Home! + + def OnPrevPageButton(self, event): + self.ie.GoBack() + + def OnNextPageButton(self, event): + self.ie.GoForward() + + def OnStopButton(self, evt): + self.ie.Stop() + + def OnSearchPageButton(self, evt): + self.ie.GoSearch() + + def OnRefreshPageButton(self, evt): + self.ie.Refresh(iewin.REFRESH_COMPLETELY) + + + def logEvt(self, evt): + pst = "" + for name in evt.paramList: + pst += " %s:%s " % (name, repr(getattr(evt, name))) + self.log.write('%s: %s\n' % (evt.eventName, pst)) + + + def OnBeforeNavigate2(self, evt): + self.logEvt(evt) + + def OnNewWindow2(self, evt): + self.logEvt(evt) +## evt.Veto() # TODO + + def OnProgressChange(self, evt): + self.logEvt(evt) + + def OnDocumentComplete(self, evt): + self.logEvt(evt) + self.current = evt.URL + self.location.SetValue(self.current) + + def OnTitleChange(self, evt): + self.logEvt(evt) + if self.frame: + self.frame.SetTitle(self.titleBase + ' -- ' + evt.Text) + + def OnStatusTextChange(self, evt): + self.logEvt(evt) + if self.frame: + self.frame.SetStatusText(evt.Text) + + +#---------------------------------------------------------------------- +# for the demo framework... + +def runTest(frame, nb, log): + if wx.Platform == '__WXMSW__': + win = TestPanel(nb, log, frame) + return win + else: + dlg = wx.MessageDialog(frame, 'This demo only works on Windows.', + 'Sorry', wx.OK | wx.ICON_INFORMATION) + dlg.ShowModal() + dlg.Destroy() + + + +overview = """\ + +

wx.lib.iewin.IEHtmlWindow

+ +The wx.lib.iewin.IEHtmlWindow class is one example of using ActiveX +controls from wxPython using the new wx.activex module. This allows +you to use an ActiveX control as if it is a wx.Window, you can call +its methods, set/get properties, and receive events from the ActiveX +control in a very intuitive way. + +

Using this class is simpler than ActiveXWrapper, doesn't rely on +the win32all extensions, and is more "wx\'ish", meaning that it uses +events and etc. as would be expected from any other wx window. + + +""" + + + +if __name__ == '__main__': + import sys,os + import run + run.main(['', os.path.basename(sys.argv[0])] + sys.argv[1:]) + + +#---------------------------------------------------------------------- + diff --git a/wxPython/demo/ActiveX_PDFWindow.py b/wxPython/demo/ActiveX_PDFWindow.py new file mode 100644 index 0000000000..35c3956c30 --- /dev/null +++ b/wxPython/demo/ActiveX_PDFWindow.py @@ -0,0 +1,106 @@ +import sys +import wx + +if wx.Platform == '__WXMSW__': + from wx.lib.pdfwin import PDFWindow + + +#---------------------------------------------------------------------- + +class TestPanel(wx.Panel): + def __init__(self, parent, log): + wx.Panel.__init__(self, parent, -1) + self.pdf = None + + sizer = wx.BoxSizer(wx.VERTICAL) + btnSizer = wx.BoxSizer(wx.HORIZONTAL) + + self.pdf = PDFWindow(self, style=wx.SUNKEN_BORDER) + + sizer.Add(self.pdf, proportion=1, flag=wx.EXPAND) + + btn = wx.Button(self, wx.NewId(), "Open PDF File") + self.Bind(wx.EVT_BUTTON, self.OnOpenButton, btn) + btnSizer.Add(btn, proportion=1, flag=wx.EXPAND|wx.ALL, border=5) + + btn = wx.Button(self, wx.NewId(), "<-- Previous Page") + self.Bind(wx.EVT_BUTTON, self.OnPrevPageButton, btn) + btnSizer.Add(btn, proportion=1, flag=wx.EXPAND|wx.ALL, border=5) + + btn = wx.Button(self, wx.NewId(), "Next Page -->") + self.Bind(wx.EVT_BUTTON, self.OnNextPageButton, btn) + btnSizer.Add(btn, proportion=1, flag=wx.EXPAND|wx.ALL, border=5) + + + btnSizer.Add((50,-1), proportion=2, flag=wx.EXPAND) + sizer.Add(btnSizer, proportion=0, flag=wx.EXPAND) + + self.SetSizer(sizer) + self.SetAutoLayout(True) + + + + def OnOpenButton(self, event): + dlg = wx.FileDialog(self, wildcard="*.pdf") + + if dlg.ShowModal() == wx.ID_OK: + wx.BeginBusyCursor() + self.pdf.LoadFile(dlg.GetPath()) + wx.EndBusyCursor() + + dlg.Destroy() + + + def OnPrevPageButton(self, event): + self.pdf.gotoPreviousPage() + + + def OnNextPageButton(self, event): + self.pdf.gotoNextPage() + + + +#---------------------------------------------------------------------- + +def runTest(frame, nb, log): + if wx.Platform == '__WXMSW__': + win = TestPanel(nb, log) + return win + else: + dlg = wx.MessageDialog(frame, 'This demo only works on MSW.', + 'Sorry', wx.OK | wx.ICON_INFORMATION) + dlg.ShowModal() + dlg.Destroy() + + +overview = """\ +

wx.lib.pdfwin.PDFWindow

+ +The wx.lib.pdfwin.PDFWindow class is another example of using ActiveX +controls from wxPython using the new wx.activex module. This allows +you to use an ActiveX control as if it is a wx.Window, you can call +its methods, set/get properties, and receive events from the ActiveX +control in a very intuitive way. + +

Using this class is simpler than ActiveXWrapper, doesn't rely on +the win32all extensions, and is more "wx\'ish", meaning that it uses +events and etc. as would be expected from any other wx window. + +

This demo embeds the Adobe Acrobat Reader, and gives you some +buttons for opening a PDF file, changing pages, etc. that show how to +call methods on the COM object. If you don't have Acrobat Reader 4.0 +(or greater) installed it won't work. + + +""" + +#---------------------------------------------------------------------- + + + +if __name__ == '__main__': + import sys,os + import run + run.main(['', os.path.basename(sys.argv[0])] + sys.argv[1:]) + + diff --git a/wxPython/demo/IEHtmlWin.py b/wxPython/demo/IEHtmlWin.py index 56e4c57935..672e29d755 100644 --- a/wxPython/demo/IEHtmlWin.py +++ b/wxPython/demo/IEHtmlWin.py @@ -2,10 +2,6 @@ # # o Updated for wx namespace # -# 11/28/2003 - Jeff Grimmett (grimmtooth@softhome.net) -# -# o iewin.py is missing -# import wx diff --git a/wxPython/demo/Main.py b/wxPython/demo/Main.py index f20cea6235..d57aebbb36 100644 --- a/wxPython/demo/Main.py +++ b/wxPython/demo/Main.py @@ -39,6 +39,9 @@ _treeList = [ 'Cursor', 'PyPlot', 'ImageAlpha', + 'ActiveX_FlashWindow', + 'ActiveX_IEHtmlWindow', + 'ActiveX_PDFWindow', ]), # managed windows == things with a (optional) caption you can close @@ -126,6 +129,9 @@ _treeList = [ # controls coming from other libraries ('More Windows/Controls', [ + 'ActiveX_FlashWindow', + 'ActiveX_IEHtmlWindow', + 'ActiveX_PDFWindow', #'RightTextCtrl', deprecated as we have wxTE_RIGHT now. 'Calendar', 'CalendarCtrl', @@ -137,7 +143,7 @@ _treeList = [ 'FloatBar', 'FloatCanvas', 'HtmlWindow', - 'IEHtmlWin', + ##'IEHtmlWin', 'IntCtrl', 'MVCTree', 'MaskedEditControls', @@ -219,7 +225,7 @@ _treeList = [ # need libs not coming with the demo ('Objects using an external library', [ - 'ActiveXWrapper_Acrobat', + ##'ActiveXWrapper_Acrobat', ##'ActiveXWrapper_IE', # currently has tstate problems... 'GLCanvas', #'PlotCanvas', # deprecated, use PyPlot diff --git a/wxPython/demo/data/Asteroid_blaster.swf b/wxPython/demo/data/Asteroid_blaster.swf new file mode 100644 index 0000000000000000000000000000000000000000..ffc57312fd90d96eb9d94e58bd5a0d0bab136b1f GIT binary patch literal 29235 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 aj}uVMNV0}t-idHF9|tfI;C}$BqY%({D+yQt literal 0 HcmV?d00001 diff --git a/wxPython/docs/CHANGES.txt b/wxPython/docs/CHANGES.txt index a82ddba9ba..b1d028aced 100644 --- a/wxPython/docs/CHANGES.txt +++ b/wxPython/docs/CHANGES.txt @@ -87,6 +87,26 @@ Added wx.PlatformInfo which is a tuple containing strings that describe the platform and build options of wxPython. See the MigrationGuide for more details. +Created a new extension module "activex" from Lindsay Mathieson's +newest wxActiveX_ class. (The existing iewin module used an older +version of this code, but only exposed the wxIEHtmlWin class.) This +new module will (in theory ;-) ) allow you to host arbitrary ActiveX +controls in a wx.Window, **without** requiring the use of the win32com +and other PyWin32 modules! This should eliminate the cronic problems +that have resulted from minor mismatches in how PyWin32 handles the +GIL and tstate when making callbacks, etc. The older iewin module +will be left in this release as the new stuff is not fully backwards +compatible, but you should migrate your code to the wx.activex version +of IEHtmlWindow, or the implementation in wx.lib.iewin, so the old one +can be eventually removed. Additionally, I've always considered that +the wx.lib.activexwrapper module is an ugly hack that I only included +in the lib because I couldn't figure out anything better. Well now we +have something that, if it isn't already, has the potential to be +better. So consider migrating away from using activexwrapper as well. +Please see the MigrationGuide for more details on using the new +module. + +.. _wxActiveX: http://members.optusnet.com.au/~blackpaw1/wxactivex.html diff --git a/wxPython/docs/MigrationGuide.txt b/wxPython/docs/MigrationGuide.txt index 7dd57bec23..d299c4d411 100644 --- a/wxPython/docs/MigrationGuide.txt +++ b/wxPython/docs/MigrationGuide.txt @@ -441,6 +441,110 @@ BTW, wx.Platform will probably be deprecated in the future. +ActiveX +------- + +Lindsay Mathieson's newest wxActiveX_ class has been wrapped into a new +extension module called wx.activex. It is very generic and dynamic +and should allow hosting of arbitray ActiveX controls within your +wxPython apps. So far I've tested it with IE, PDF, and Flash +controls, (and there are new samples in the demo and also library +modules supporting these.) + +.. _wxActiveX: http://members.optusnet.com.au/~blackpaw1/wxactivex.html + +The new wx.activex module contains a bunch of code, but the most +important things to look at are ActiveXWindow and ActiveXEvent. +ActiveXWindow derives from wxWindow and the constructor accepts a +CLSID for the ActiveX Control that should be created. (There is also +a CLSID class that can convert from a progID or a CLSID String.) The +ActiveXWindow class simply adds methods that allow you to query some +of the TypeInfo exposed by the ActiveX object, and also to 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, +(just bool, integers, floating point, strings and None/Empty so far, +but more can be handled later.) + +That's pretty much all there is to the class, as I mentioned before it +is very generic and dynamic. Very little is hard-coded and everything +that is done with the actual ActiveX control is done at runtime and +referenced by property or method name. Since Python is such a dynamic +language this is a very good match. I thought for a while about doing +some Python black-magic and making the specific methods/properties of +the actual ActiveX control "appear" at runtime, but then decided that +it would be better and more understandable to do it via subclassing. +So there is a utility class in wx.activex that given an existing +ActiveXWindow instance can generate a .py module containing a derived +class with real methods and properties that do the Right Thing to +reflect those calls to the real ActiveX control. There is also a +script/tool module named genaxmodule that given a CLSID or progID and +a class name, will generate the module for you. There are a few +examples of the output of this tool in the wx.lib package. See +iewin.py, pdfwin.py and flashwin.py. + +Currently the genaxmodule tool will tweak some of the names it +generates, but this can be controled if you would like to do it +differently by deriving your own class from GernerateAXModule, +overriding some methods and then using this class from a tool like +genaxmodule. [TODO: make specifying a new class on genaxmodule's +command-line possible.] The current default behavior is that any +event names that start with "On" will have the "On" dropped, property +names are converted to all lower case, and if any name is a Python +keyword it will have an underscore appended to it. GernerateAXModule +does it's best when generating the code in the new module, but it can +only be as good as the TypeInfo data available from the ActiveX +control so sometimes some tweaking will be needed. For example, the +IE web browser control defines the Flags parameter of the Navigate2 +method as required, but MSDN says it is optional. + +It is intended that this new wx.activex module will replace both the +older version of Lindsay's code available in iewin.IEHtmlWindow, and +also the wx.lib.activexwraper module. Probably the biggest +differences you'l ecounted in migrating activexwrapper-based code +(besides events working better without causing deadlocks) is that +events are no longer caught by overriding methods in your derived +class. Instead ActiveXWindow uses the wx event system and you bind +handlers for the ActiveX events exactly the same way you do for any wx +event. There is just one extra step needed and that is creating an +event ID from the ActiveX event name, and if you use the genaxmodule +tool then this extra step will be handled for you there. For example, +for the StatusTextChange event in the IE web browser control, this +code is generated for you:: + + wxEVT_StatusTextChange = wx.activex.RegisterActiveXEvent('StatusTextChange') + EVT_StatusTextChange = wx.PyEventBinder(wxEVT_StatusTextChange, 1) + +and you would use it in your code like this:: + + self.Bind(iewin.EVT_StatusTextChange, self.UpdateStatusText, self.ie) + +When the event happens and your event handler function is called the +event properties from the ActiveX control (if any) are converted to +attributes of the event object passed to the handler. (Can you say +'event' any more times in a single sentence? ;-) ) For example the +StatusTextChange event will also send the text that should be put into +the status line as an event parameter named "Text" and you can access +it your handlers as an attribute of the evnt object like this:: + + def UpdateStatusText(self, evt): + self.SetStatusText(evt.Text) + +These event object attributes should be considered read-only since +support for output parameters on the events is not yet implemented. +But that could/should change in the future. + +So how do you know what methods, events and properties that am ActiveX +control supports? There is a funciton in wx.activex named GetAXInfo +that returns a printable summary of the TypeInfo from the ActiveX +instance passed in. You can use this as an example of how to browse +the TypeInfo provided, and there is also a copy of this function's +output appended as a comment to the modules produced by the +genaxmodule tool. Beyond that you'll need to consult the docs +provided by the makers of the ActiveX control that you are using. + + + Other Stuff ----------- diff --git a/wxPython/include/wx/wxPython/wxPython_int.h b/wxPython/include/wx/wxPython/wxPython_int.h index ed07d2ee97..b5f0d14d68 100644 --- a/wxPython/include/wx/wxPython/wxPython_int.h +++ b/wxPython/include/wx/wxPython/wxPython_int.h @@ -144,8 +144,20 @@ void wxPyEndBlockThreads(); #endif // wxPyUSE_EXPORTED_API -#define wxPyBLOCK_THREADS(stmt) { wxPyBeginBlockThreads(); stmt; wxPyEndBlockThreads(); } -#define wxPyRaiseNotImplemented() wxPyBLOCK_THREADS(PyErr_SetNone(PyExc_NotImplementedError)) + +// A macro that will help to execute simple statments wrapped in +// StartBlock/EndBlockThreads calls +#define wxPyBLOCK_THREADS(stmt) \ + { wxPyBeginBlockThreads(); stmt; wxPyEndBlockThreads(); } + +// Raise the NotImplementedError exception (blocking threads) +#define wxPyRaiseNotImplemented() \ + wxPyBLOCK_THREADS(PyErr_SetNone(PyExc_NotImplementedError)) + +// Raise any exception witha string value (blocking threads) +#define wxPyErr_SetString(err, str) \ + wxPyBLOCK_THREADS(PyErr_SetString(err, str)) + //--------------------------------------------------------------------------- // These are helpers used by the typemaps diff --git a/wxPython/scripts/CreateBatchFiles.py b/wxPython/scripts/CreateBatchFiles.py index d5d861801f..c9b8abc81e 100644 --- a/wxPython/scripts/CreateBatchFiles.py +++ b/wxPython/scripts/CreateBatchFiles.py @@ -19,6 +19,7 @@ scriptdir = os.getcwd() scripts = [ ("img2png", 0), ("img2py", 0), ("img2xpm", 0), + ("genaxmodule",0), ("xrced", 1), ("pyshell", 1), ("pycrust", 1), diff --git a/wxPython/scripts/genaxmodule b/wxPython/scripts/genaxmodule new file mode 100644 index 0000000000..9083e5d610 --- /dev/null +++ b/wxPython/scripts/genaxmodule @@ -0,0 +1,5 @@ +#!/usr/bin/env python + +import sys +from wx.tools.genaxmodule import main +main(sys.argv) diff --git a/wxPython/scripts/genaxmodule.bat b/wxPython/scripts/genaxmodule.bat new file mode 100755 index 0000000000..110786d146 --- /dev/null +++ b/wxPython/scripts/genaxmodule.bat @@ -0,0 +1,3 @@ +@echo off + +C:\Tools\python23\python.exe C:\PROJECTS\wx2.5\wxPython\scripts\genaxmodule %1 %2 %3 %4 %5 %6 %7 %8 %9 diff --git a/wxPython/scripts/helpviewer.bat b/wxPython/scripts/helpviewer.bat index b459850abf..0aa15b1cd4 100755 --- a/wxPython/scripts/helpviewer.bat +++ b/wxPython/scripts/helpviewer.bat @@ -1,3 +1,3 @@ @echo off -start E:\tools\python23\pythonw.exe E:\PROJECTS\wx2.5\wxPython\scripts\helpviewer %1 %2 %3 %4 %5 %6 %7 %8 %9 +start C:\Tools\python23\pythonw.exe C:\PROJECTS\wx2.5\wxPython\scripts\helpviewer %1 %2 %3 %4 %5 %6 %7 %8 %9 diff --git a/wxPython/scripts/img2png.bat b/wxPython/scripts/img2png.bat index 37b2b4ce88..d181dc3878 100755 --- a/wxPython/scripts/img2png.bat +++ b/wxPython/scripts/img2png.bat @@ -1,3 +1,3 @@ @echo off -E:\tools\python23\python.exe E:\PROJECTS\wx2.5\wxPython\scripts\img2png %1 %2 %3 %4 %5 %6 %7 %8 %9 +C:\Tools\python23\python.exe C:\PROJECTS\wx2.5\wxPython\scripts\img2png %1 %2 %3 %4 %5 %6 %7 %8 %9 diff --git a/wxPython/scripts/img2py.bat b/wxPython/scripts/img2py.bat index 003dd086c4..b8e23bd41c 100755 --- a/wxPython/scripts/img2py.bat +++ b/wxPython/scripts/img2py.bat @@ -1,3 +1,3 @@ @echo off -E:\tools\python23\python.exe E:\PROJECTS\wx2.5\wxPython\scripts\img2py %1 %2 %3 %4 %5 %6 %7 %8 %9 +C:\Tools\python23\python.exe C:\PROJECTS\wx2.5\wxPython\scripts\img2py %1 %2 %3 %4 %5 %6 %7 %8 %9 diff --git a/wxPython/scripts/img2xpm.bat b/wxPython/scripts/img2xpm.bat index 88ef51b86c..f82bd098a8 100755 --- a/wxPython/scripts/img2xpm.bat +++ b/wxPython/scripts/img2xpm.bat @@ -1,3 +1,3 @@ @echo off -E:\tools\python23\python.exe E:\PROJECTS\wx2.5\wxPython\scripts\img2xpm %1 %2 %3 %4 %5 %6 %7 %8 %9 +C:\Tools\python23\python.exe C:\PROJECTS\wx2.5\wxPython\scripts\img2xpm %1 %2 %3 %4 %5 %6 %7 %8 %9 diff --git a/wxPython/scripts/pyalacarte.bat b/wxPython/scripts/pyalacarte.bat index 820cc1163f..0e31a9afaa 100755 --- a/wxPython/scripts/pyalacarte.bat +++ b/wxPython/scripts/pyalacarte.bat @@ -1,3 +1,3 @@ @echo off -start E:\tools\python23\pythonw.exe E:\PROJECTS\wx2.5\wxPython\scripts\pyalacarte %1 %2 %3 %4 %5 %6 %7 %8 %9 +start C:\Tools\python23\pythonw.exe C:\PROJECTS\wx2.5\wxPython\scripts\pyalacarte %1 %2 %3 %4 %5 %6 %7 %8 %9 diff --git a/wxPython/scripts/pyalamode.bat b/wxPython/scripts/pyalamode.bat index b972610680..7fd99e3e85 100755 --- a/wxPython/scripts/pyalamode.bat +++ b/wxPython/scripts/pyalamode.bat @@ -1,3 +1,3 @@ @echo off -start E:\tools\python23\pythonw.exe E:\PROJECTS\wx2.5\wxPython\scripts\pyalamode %1 %2 %3 %4 %5 %6 %7 %8 %9 +start C:\Tools\python23\pythonw.exe C:\PROJECTS\wx2.5\wxPython\scripts\pyalamode %1 %2 %3 %4 %5 %6 %7 %8 %9 diff --git a/wxPython/scripts/pycrust.bat b/wxPython/scripts/pycrust.bat index d6746ab5b5..eec40f3203 100755 --- a/wxPython/scripts/pycrust.bat +++ b/wxPython/scripts/pycrust.bat @@ -1,3 +1,3 @@ @echo off -start E:\tools\python23\pythonw.exe E:\PROJECTS\wx2.5\wxPython\scripts\pycrust %1 %2 %3 %4 %5 %6 %7 %8 %9 +start C:\Tools\python23\pythonw.exe C:\PROJECTS\wx2.5\wxPython\scripts\pycrust %1 %2 %3 %4 %5 %6 %7 %8 %9 diff --git a/wxPython/scripts/pyshell.bat b/wxPython/scripts/pyshell.bat index 626e094ff4..a10c86a63b 100755 --- a/wxPython/scripts/pyshell.bat +++ b/wxPython/scripts/pyshell.bat @@ -1,3 +1,3 @@ @echo off -start E:\tools\python23\pythonw.exe E:\PROJECTS\wx2.5\wxPython\scripts\pyshell %1 %2 %3 %4 %5 %6 %7 %8 %9 +start C:\Tools\python23\pythonw.exe C:\PROJECTS\wx2.5\wxPython\scripts\pyshell %1 %2 %3 %4 %5 %6 %7 %8 %9 diff --git a/wxPython/scripts/pywrap.bat b/wxPython/scripts/pywrap.bat index 683f8cb98c..f08897bdf3 100755 --- a/wxPython/scripts/pywrap.bat +++ b/wxPython/scripts/pywrap.bat @@ -1,3 +1,3 @@ @echo off -start E:\tools\python23\pythonw.exe E:\PROJECTS\wx2.5\wxPython\scripts\pywrap %1 %2 %3 %4 %5 %6 %7 %8 %9 +start C:\Tools\python23\pythonw.exe C:\PROJECTS\wx2.5\wxPython\scripts\pywrap %1 %2 %3 %4 %5 %6 %7 %8 %9 diff --git a/wxPython/scripts/xrced.bat b/wxPython/scripts/xrced.bat index cc9d95d7c7..3db0aff74b 100755 --- a/wxPython/scripts/xrced.bat +++ b/wxPython/scripts/xrced.bat @@ -1,3 +1,3 @@ @echo off -start E:\tools\python23\pythonw.exe E:\PROJECTS\wx2.5\wxPython\scripts\xrced %1 %2 %3 %4 %5 %6 %7 %8 %9 +start C:\Tools\python23\pythonw.exe C:\PROJECTS\wx2.5\wxPython\scripts\xrced %1 %2 %3 %4 %5 %6 %7 %8 %9 diff --git a/wxPython/setup.py b/wxPython/setup.py index 5f4f7311e7..a1b23a3185 100755 --- a/wxPython/setup.py +++ b/wxPython/setup.py @@ -67,6 +67,7 @@ BUILD_DLLWIDGET = 0# Build a module that enables unknown wx widgets # Internet Explorer wrapper (experimental) BUILD_IEWIN = (os.name == 'nt') +BUILD_ACTIVEX = (os.name == 'nt') # new version of IEWIN CORE_ONLY = 0 # if true, don't build any of the above @@ -186,7 +187,7 @@ if os.name == 'nt': # Boolean (int) flags for flag in ['BUILD_GLCANVAS', 'BUILD_OGL', 'BUILD_STC', 'BUILD_XRC', - 'BUILD_GIZMOS', 'BUILD_DLLWIDGET', 'BUILD_IEWIN', + 'BUILD_GIZMOS', 'BUILD_DLLWIDGET', 'BUILD_IEWIN', 'BUILD_ACTIVEX', 'CORE_ONLY', 'PREP_ONLY', 'USE_SWIG', 'UNICODE', 'UNDEF_NDEBUG', 'NO_SCRIPTS', 'BUILD_RENAMERS', 'FINAL', 'HYBRID', ]: @@ -463,6 +464,7 @@ if CORE_ONLY: BUILD_GIZMOS = 0 BUILD_DLLWIDGET = 0 BUILD_IEWIN = 0 + BUILD_ACTIVEX = 0 if debug: FINAL = 0 @@ -1147,6 +1149,39 @@ if BUILD_IEWIN: wxpExtensions.append(ext) +#---------------------------------------------------------------------- +# Define the ACTIVEX extension module (experimental) +#---------------------------------------------------------------------- + +if BUILD_ACTIVEX: + msg('Preparing ACTIVEX...') + location = 'contrib/activex' + axloc = opj(location, "wxie") + + swig_files = ['activex.i', ] + + swig_sources = run_swig(swig_files, location, '', PKGDIR, + USE_SWIG, swig_force, swig_args, swig_deps + + [ '%s/_activex_ex.py' % location]) + + + ext = Extension('_activex', ['%s/IEHtmlWin.cpp' % axloc, + '%s/wxactivex.cpp' % axloc, + ] + swig_sources, + + include_dirs = includes + [ axloc ], + define_macros = defines, + + library_dirs = libdirs, + libraries = libs, + + extra_compile_args = cflags, + extra_link_args = lflags, + ) + + wxpExtensions.append(ext) + + #---------------------------------------------------------------------- # Define the XRC extension module #---------------------------------------------------------------------- diff --git a/wxPython/src/helpers.cpp b/wxPython/src/helpers.cpp index 79c46641b6..628046c2af 100644 --- a/wxPython/src/helpers.cpp +++ b/wxPython/src/helpers.cpp @@ -1425,6 +1425,17 @@ void wxPyCallback::EventThunker(wxEvent& event) { if (!arg) { PyErr_Print(); } else { + // Check if the event object needs some preinitialization + if (PyObject_HasAttrString(arg, "_preInit")) { + result = PyObject_CallMethod(arg, "_preInit", "O", arg); + if ( result ) { + Py_DECREF(result); // result is ignored, but we still need to decref it + PyErr_Clear(); // Just in case... + } else { + PyErr_Print(); + } + } + // Call the event handler, passing the event object tuple = PyTuple_New(1); PyTuple_SET_ITEM(tuple, 0, arg); // steals ref to arg diff --git a/wxPython/src/my_typemaps.i b/wxPython/src/my_typemaps.i index 754704242b..c1a37dfc22 100644 --- a/wxPython/src/my_typemaps.i +++ b/wxPython/src/my_typemaps.i @@ -268,8 +268,7 @@ //--------------------------------------------------------------------------- -%typemap(out) bool "$result = $1 ? Py_True : Py_False; Py_INCREF($result);" - +%typemap(out) bool "$result = PyBool_FromLong((bool)$1);" //--------------------------------------------------------------------------- diff --git a/wxPython/wx/lib/flashwin.py b/wxPython/wx/lib/flashwin.py new file mode 100644 index 0000000000..0083aa8f84 --- /dev/null +++ b/wxPython/wx/lib/flashwin.py @@ -0,0 +1,652 @@ +#---------------------------------------------------------------------- +# Name: wx.lib.flashwin +# Purpose: A class that allows the use of the Shockwave Flash +# ActiveX control +# +# Author: Robin Dunn +# +# Created: 22-March-2004 +# RCS-ID: $Id$ +# Copyright: (c) 2004 by Total Control Software +# Licence: wxWindows license +#---------------------------------------------------------------------- +# This module was generated by the wx.activex.GernerateAXModule class +# (See also the genaxmodule script.) + +import wx +import wx.activex + +clsID = '{D27CDB6E-AE6D-11CF-96B8-444553540000}' +progID = 'ShockwaveFlash.ShockwaveFlash.1' + + + +# Create eventTypes and event binders +wxEVT_ReadyStateChange = wx.activex.RegisterActiveXEvent('OnReadyStateChange') +wxEVT_Progress = wx.activex.RegisterActiveXEvent('OnProgress') +wxEVT_FSCommand = wx.activex.RegisterActiveXEvent('FSCommand') + +EVT_ReadyStateChange = wx.PyEventBinder(wxEVT_ReadyStateChange, 1) +EVT_Progress = wx.PyEventBinder(wxEVT_Progress, 1) +EVT_FSCommand = wx.PyEventBinder(wxEVT_FSCommand, 1) + + +# Derive a new class from ActiveXWindow +class FlashWindow(wx.activex.ActiveXWindow): + def __init__(self, parent, ID=-1, pos=wx.DefaultPosition, + size=wx.DefaultSize, style=0, name='FlashWindow'): + wx.activex.ActiveXWindow.__init__(self, parent, + wx.activex.CLSID('{D27CDB6E-AE6D-11CF-96B8-444553540000}'), + ID, pos, size, style, name) + + # Methods exported by the ActiveX object + def QueryInterface(self, riid): + return self.CallAXMethod('QueryInterface', riid) + + def AddRef(self): + return self.CallAXMethod('AddRef') + + def Release(self): + return self.CallAXMethod('Release') + + def GetTypeInfoCount(self): + return self.CallAXMethod('GetTypeInfoCount') + + def GetTypeInfo(self, itinfo, lcid): + return self.CallAXMethod('GetTypeInfo', itinfo, lcid) + + def GetIDsOfNames(self, riid, rgszNames, cNames, lcid): + return self.CallAXMethod('GetIDsOfNames', riid, rgszNames, cNames, lcid) + + def Invoke(self, dispidMember, riid, lcid, wFlags, pdispparams): + return self.CallAXMethod('Invoke', dispidMember, riid, lcid, wFlags, pdispparams) + + def SetZoomRect(self, left, top, right, bottom): + return self.CallAXMethod('SetZoomRect', left, top, right, bottom) + + def Zoom(self, factor): + return self.CallAXMethod('Zoom', factor) + + def Pan(self, x, y, mode): + return self.CallAXMethod('Pan', x, y, mode) + + def Play(self): + return self.CallAXMethod('Play') + + def Stop(self): + return self.CallAXMethod('Stop') + + def Back(self): + return self.CallAXMethod('Back') + + def Forward(self): + return self.CallAXMethod('Forward') + + def Rewind(self): + return self.CallAXMethod('Rewind') + + def StopPlay(self): + return self.CallAXMethod('StopPlay') + + def GotoFrame(self, FrameNum): + return self.CallAXMethod('GotoFrame', FrameNum) + + def CurrentFrame(self): + return self.CallAXMethod('CurrentFrame') + + def IsPlaying(self): + return self.CallAXMethod('IsPlaying') + + def PercentLoaded(self): + return self.CallAXMethod('PercentLoaded') + + def FrameLoaded(self, FrameNum): + return self.CallAXMethod('FrameLoaded', FrameNum) + + def FlashVersion(self): + return self.CallAXMethod('FlashVersion') + + def LoadMovie(self, layer, url): + return self.CallAXMethod('LoadMovie', layer, url) + + def TGotoFrame(self, target, FrameNum): + return self.CallAXMethod('TGotoFrame', target, FrameNum) + + def TGotoLabel(self, target, label): + return self.CallAXMethod('TGotoLabel', target, label) + + def TCurrentFrame(self, target): + return self.CallAXMethod('TCurrentFrame', target) + + def TCurrentLabel(self, target): + return self.CallAXMethod('TCurrentLabel', target) + + def TPlay(self, target): + return self.CallAXMethod('TPlay', target) + + def TStopPlay(self, target): + return self.CallAXMethod('TStopPlay', target) + + def SetVariable(self, name, value): + return self.CallAXMethod('SetVariable', name, value) + + def GetVariable(self, name): + return self.CallAXMethod('GetVariable', name) + + def TSetProperty(self, target, property, value): + return self.CallAXMethod('TSetProperty', target, property, value) + + def TGetProperty(self, target, property): + return self.CallAXMethod('TGetProperty', target, property) + + def TCallFrame(self, target, FrameNum): + return self.CallAXMethod('TCallFrame', target, FrameNum) + + def TCallLabel(self, target, label): + return self.CallAXMethod('TCallLabel', target, label) + + def TSetPropertyNum(self, target, property, value): + return self.CallAXMethod('TSetPropertyNum', target, property, value) + + def TGetPropertyNum(self, target, property): + return self.CallAXMethod('TGetPropertyNum', target, property) + + def TGetPropertyAsNumber(self, target, property): + return self.CallAXMethod('TGetPropertyAsNumber', target, property) + + # Getters, Setters and properties + def _get_ReadyState(self): + return self.GetAXProp('ReadyState') + readystate = property(_get_ReadyState, None) + + def _get_TotalFrames(self): + return self.GetAXProp('TotalFrames') + totalframes = property(_get_TotalFrames, None) + + def _get_Playing(self): + return self.GetAXProp('Playing') + def _set_Playing(self, Playing): + self.SetAXProp('Playing', Playing) + playing = property(_get_Playing, _set_Playing) + + def _get_Quality(self): + return self.GetAXProp('Quality') + def _set_Quality(self, Quality): + self.SetAXProp('Quality', Quality) + quality = property(_get_Quality, _set_Quality) + + def _get_ScaleMode(self): + return self.GetAXProp('ScaleMode') + def _set_ScaleMode(self, ScaleMode): + self.SetAXProp('ScaleMode', ScaleMode) + scalemode = property(_get_ScaleMode, _set_ScaleMode) + + def _get_AlignMode(self): + return self.GetAXProp('AlignMode') + def _set_AlignMode(self, AlignMode): + self.SetAXProp('AlignMode', AlignMode) + alignmode = property(_get_AlignMode, _set_AlignMode) + + def _get_BackgroundColor(self): + return self.GetAXProp('BackgroundColor') + def _set_BackgroundColor(self, BackgroundColor): + self.SetAXProp('BackgroundColor', BackgroundColor) + backgroundcolor = property(_get_BackgroundColor, _set_BackgroundColor) + + def _get_Loop(self): + return self.GetAXProp('Loop') + def _set_Loop(self, Loop): + self.SetAXProp('Loop', Loop) + loop = property(_get_Loop, _set_Loop) + + def _get_Movie(self): + return self.GetAXProp('Movie') + def _set_Movie(self, Movie): + self.SetAXProp('Movie', Movie) + movie = property(_get_Movie, _set_Movie) + + def _get_FrameNum(self): + return self.GetAXProp('FrameNum') + def _set_FrameNum(self, FrameNum): + self.SetAXProp('FrameNum', FrameNum) + framenum = property(_get_FrameNum, _set_FrameNum) + + def _get_WMode(self): + return self.GetAXProp('WMode') + def _set_WMode(self, WMode): + self.SetAXProp('WMode', WMode) + wmode = property(_get_WMode, _set_WMode) + + def _get_SAlign(self): + return self.GetAXProp('SAlign') + def _set_SAlign(self, SAlign): + self.SetAXProp('SAlign', SAlign) + salign = property(_get_SAlign, _set_SAlign) + + def _get_Menu(self): + return self.GetAXProp('Menu') + def _set_Menu(self, Menu): + self.SetAXProp('Menu', Menu) + menu = property(_get_Menu, _set_Menu) + + def _get_Base(self): + return self.GetAXProp('Base') + def _set_Base(self, Base): + self.SetAXProp('Base', Base) + base = property(_get_Base, _set_Base) + + def _get_Scale(self): + return self.GetAXProp('Scale') + def _set_Scale(self, Scale): + self.SetAXProp('Scale', Scale) + scale = property(_get_Scale, _set_Scale) + + def _get_DeviceFont(self): + return self.GetAXProp('DeviceFont') + def _set_DeviceFont(self, DeviceFont): + self.SetAXProp('DeviceFont', DeviceFont) + devicefont = property(_get_DeviceFont, _set_DeviceFont) + + def _get_EmbedMovie(self): + return self.GetAXProp('EmbedMovie') + def _set_EmbedMovie(self, EmbedMovie): + self.SetAXProp('EmbedMovie', EmbedMovie) + embedmovie = property(_get_EmbedMovie, _set_EmbedMovie) + + def _get_BGColor(self): + return self.GetAXProp('BGColor') + def _set_BGColor(self, BGColor): + self.SetAXProp('BGColor', BGColor) + bgcolor = property(_get_BGColor, _set_BGColor) + + def _get_Quality2(self): + return self.GetAXProp('Quality2') + def _set_Quality2(self, Quality2): + self.SetAXProp('Quality2', Quality2) + quality2 = property(_get_Quality2, _set_Quality2) + + def _get_SWRemote(self): + return self.GetAXProp('SWRemote') + def _set_SWRemote(self, SWRemote): + self.SetAXProp('SWRemote', SWRemote) + swremote = property(_get_SWRemote, _set_SWRemote) + + def _get_FlashVars(self): + return self.GetAXProp('FlashVars') + def _set_FlashVars(self, FlashVars): + self.SetAXProp('FlashVars', FlashVars) + flashvars = property(_get_FlashVars, _set_FlashVars) + + def _get_AllowScriptAccess(self): + return self.GetAXProp('AllowScriptAccess') + def _set_AllowScriptAccess(self, AllowScriptAccess): + self.SetAXProp('AllowScriptAccess', AllowScriptAccess) + allowscriptaccess = property(_get_AllowScriptAccess, _set_AllowScriptAccess) + + def _get_MovieData(self): + return self.GetAXProp('MovieData') + def _set_MovieData(self, MovieData): + self.SetAXProp('MovieData', MovieData) + moviedata = property(_get_MovieData, _set_MovieData) + + +# PROPERTIES +# -------------------- +# readystate +# type:int arg:VT_EMPTY canGet:True canSet:False +# +# totalframes +# type:int arg:VT_EMPTY canGet:True canSet:False +# +# playing +# type:bool arg:bool canGet:True canSet:True +# +# quality +# type:int arg:int canGet:True canSet:True +# +# scalemode +# type:int arg:int canGet:True canSet:True +# +# alignmode +# type:int arg:int canGet:True canSet:True +# +# backgroundcolor +# type:int arg:int canGet:True canSet:True +# +# loop +# type:bool arg:bool canGet:True canSet:True +# +# movie +# type:string arg:string canGet:True canSet:True +# +# framenum +# type:int arg:int canGet:True canSet:True +# +# wmode +# type:string arg:string canGet:True canSet:True +# +# salign +# type:string arg:string canGet:True canSet:True +# +# menu +# type:bool arg:bool canGet:True canSet:True +# +# base +# type:string arg:string canGet:True canSet:True +# +# scale +# type:string arg:string canGet:True canSet:True +# +# devicefont +# type:bool arg:bool canGet:True canSet:True +# +# embedmovie +# type:bool arg:bool canGet:True canSet:True +# +# bgcolor +# type:string arg:string canGet:True canSet:True +# +# quality2 +# type:string arg:string canGet:True canSet:True +# +# swremote +# type:string arg:string canGet:True canSet:True +# +# flashvars +# type:string arg:string canGet:True canSet:True +# +# allowscriptaccess +# type:string arg:string canGet:True canSet:True +# +# moviedata +# type:string arg:string canGet:True canSet:True +# +# +# +# +# METHODS +# -------------------- +# QueryInterface +# retType: VT_VOID +# params: +# riid +# in:True out:False optional:False type:unsupported type 29 +# ppvObj +# in:False out:True optional:False type:unsupported type 26 +# +# AddRef +# retType: int +# +# Release +# retType: int +# +# GetTypeInfoCount +# retType: VT_VOID +# params: +# pctinfo +# in:False out:True optional:False type:int +# +# GetTypeInfo +# retType: VT_VOID +# params: +# itinfo +# in:True out:False optional:False type:int +# lcid +# in:True out:False optional:False type:int +# pptinfo +# in:False out:True optional:False type:unsupported type 26 +# +# GetIDsOfNames +# retType: VT_VOID +# params: +# riid +# in:True out:False optional:False type:unsupported type 29 +# rgszNames +# in:True out:False optional:False type:unsupported type 26 +# cNames +# in:True out:False optional:False type:int +# lcid +# in:True out:False optional:False type:int +# rgdispid +# in:False out:True optional:False type:int +# +# Invoke +# retType: VT_VOID +# params: +# dispidMember +# in:True out:False optional:False type:int +# riid +# in:True out:False optional:False type:unsupported type 29 +# lcid +# in:True out:False optional:False type:int +# wFlags +# in:True out:False optional:False type:int +# pdispparams +# in:True out:False optional:False type:unsupported type 29 +# pvarResult +# in:False out:True optional:False type:VT_VARIANT +# pexcepinfo +# in:False out:True optional:False type:unsupported type 29 +# puArgErr +# in:False out:True optional:False type:int +# +# SetZoomRect +# retType: VT_VOID +# params: +# left +# in:True out:False optional:False type:int +# top +# in:True out:False optional:False type:int +# right +# in:True out:False optional:False type:int +# bottom +# in:True out:False optional:False type:int +# +# Zoom +# retType: VT_VOID +# params: +# factor +# in:True out:False optional:False type:int +# +# Pan +# retType: VT_VOID +# params: +# x +# in:True out:False optional:False type:int +# y +# in:True out:False optional:False type:int +# mode +# in:True out:False optional:False type:int +# +# Play +# retType: VT_VOID +# +# Stop +# retType: VT_VOID +# +# Back +# retType: VT_VOID +# +# Forward +# retType: VT_VOID +# +# Rewind +# retType: VT_VOID +# +# StopPlay +# retType: VT_VOID +# +# GotoFrame +# retType: VT_VOID +# params: +# FrameNum +# in:True out:False optional:False type:int +# +# CurrentFrame +# retType: int +# +# IsPlaying +# retType: bool +# +# PercentLoaded +# retType: int +# +# FrameLoaded +# retType: bool +# params: +# FrameNum +# in:True out:False optional:False type:int +# +# FlashVersion +# retType: int +# +# LoadMovie +# retType: VT_VOID +# params: +# layer +# in:True out:False optional:False type:int +# url +# in:True out:False optional:False type:string +# +# TGotoFrame +# retType: VT_VOID +# params: +# target +# in:True out:False optional:False type:string +# FrameNum +# in:True out:False optional:False type:int +# +# TGotoLabel +# retType: VT_VOID +# params: +# target +# in:True out:False optional:False type:string +# label +# in:True out:False optional:False type:string +# +# TCurrentFrame +# retType: int +# params: +# target +# in:True out:False optional:False type:string +# +# TCurrentLabel +# retType: string +# params: +# target +# in:True out:False optional:False type:string +# +# TPlay +# retType: VT_VOID +# params: +# target +# in:True out:False optional:False type:string +# +# TStopPlay +# retType: VT_VOID +# params: +# target +# in:True out:False optional:False type:string +# +# SetVariable +# retType: VT_VOID +# params: +# name +# in:True out:False optional:False type:string +# value +# in:True out:False optional:False type:string +# +# GetVariable +# retType: string +# params: +# name +# in:True out:False optional:False type:string +# +# TSetProperty +# retType: VT_VOID +# params: +# target +# in:True out:False optional:False type:string +# property +# in:True out:False optional:False type:int +# value +# in:True out:False optional:False type:string +# +# TGetProperty +# retType: string +# params: +# target +# in:True out:False optional:False type:string +# property +# in:True out:False optional:False type:int +# +# TCallFrame +# retType: VT_VOID +# params: +# target +# in:True out:False optional:False type:string +# FrameNum +# in:True out:False optional:False type:int +# +# TCallLabel +# retType: VT_VOID +# params: +# target +# in:True out:False optional:False type:string +# label +# in:True out:False optional:False type:string +# +# TSetPropertyNum +# retType: VT_VOID +# params: +# target +# in:True out:False optional:False type:string +# property +# in:True out:False optional:False type:int +# value +# in:True out:False optional:False type:double +# +# TGetPropertyNum +# retType: double +# params: +# target +# in:True out:False optional:False type:string +# property +# in:True out:False optional:False type:int +# +# TGetPropertyAsNumber +# retType: double +# params: +# target +# in:True out:False optional:False type:string +# property +# in:True out:False optional:False type:int +# +# +# +# +# EVENTS +# -------------------- +# ReadyStateChange +# retType: VT_VOID +# params: +# newState +# in:False out:False optional:False type:int +# +# Progress +# retType: VT_VOID +# params: +# percentDone +# in:False out:False optional:False type:int +# +# FSCommand +# retType: VT_VOID +# params: +# command +# in:True out:False optional:False type:string +# args +# in:True out:False optional:False type:string +# +# +# +# diff --git a/wxPython/wx/lib/iewin.py b/wxPython/wx/lib/iewin.py new file mode 100644 index 0000000000..7ebc0097c2 --- /dev/null +++ b/wxPython/wx/lib/iewin.py @@ -0,0 +1,890 @@ +#---------------------------------------------------------------------- +# Name: wx.lib.iewin +# Purpose: A class that allows the use of the IE web browser +# ActiveX control +# +# Author: Robin Dunn +# +# Created: 22-March-2004 +# RCS-ID: $Id$ +# Copyright: (c) 2004 by Total Control Software +# Licence: wxWindows license +#---------------------------------------------------------------------- + +# This module was originally generated by the +# wx.activex.GernerateAXModule class but has been tweaked somewhat as +# indicated below. + +import wx +import wx.activex + +clsID = '{8856F961-340A-11D0-A96B-00C04FD705A2}' +progID = 'Shell.Explorer.2' + + +# Flags to be used with the RefreshPage method +REFRESH_NORMAL = 0 +REFRESH_IFEXPIRED = 1 +REFRESH_CONTINUE = 2 +REFRESH_COMPLETELY = 3 + +# Flags to be used with LoadUrl, Navigate, Navigate2 methods +NAV_OpenInNewWindow = 0x1 +NAV_NoHistory = 0x2 +NAV_NoReadFromCache = 0x4 +NAV_NoWriteToCache = 0x8 +NAV_AllowAutosearch = 0x10 +NAV_BrowserBar = 0x20 +NAV_Hyperlink = 0x40 + + + +# Create eventTypes and event binders +wxEVT_StatusTextChange = wx.activex.RegisterActiveXEvent('StatusTextChange') +wxEVT_ProgressChange = wx.activex.RegisterActiveXEvent('ProgressChange') +wxEVT_CommandStateChange = wx.activex.RegisterActiveXEvent('CommandStateChange') +wxEVT_DownloadBegin = wx.activex.RegisterActiveXEvent('DownloadBegin') +wxEVT_DownloadComplete = wx.activex.RegisterActiveXEvent('DownloadComplete') +wxEVT_TitleChange = wx.activex.RegisterActiveXEvent('TitleChange') +wxEVT_PropertyChange = wx.activex.RegisterActiveXEvent('PropertyChange') +wxEVT_BeforeNavigate2 = wx.activex.RegisterActiveXEvent('BeforeNavigate2') +wxEVT_NewWindow2 = wx.activex.RegisterActiveXEvent('NewWindow2') +wxEVT_NavigateComplete2 = wx.activex.RegisterActiveXEvent('NavigateComplete2') +wxEVT_DocumentComplete = wx.activex.RegisterActiveXEvent('DocumentComplete') +wxEVT_Quit = wx.activex.RegisterActiveXEvent('OnQuit') +wxEVT_Visible = wx.activex.RegisterActiveXEvent('OnVisible') +wxEVT_ToolBar = wx.activex.RegisterActiveXEvent('OnToolBar') +wxEVT_MenuBar = wx.activex.RegisterActiveXEvent('OnMenuBar') +wxEVT_StatusBar = wx.activex.RegisterActiveXEvent('OnStatusBar') +wxEVT_FullScreen = wx.activex.RegisterActiveXEvent('OnFullScreen') +wxEVT_TheaterMode = wx.activex.RegisterActiveXEvent('OnTheaterMode') +wxEVT_WindowSetResizable = wx.activex.RegisterActiveXEvent('WindowSetResizable') +wxEVT_WindowSetLeft = wx.activex.RegisterActiveXEvent('WindowSetLeft') +wxEVT_WindowSetTop = wx.activex.RegisterActiveXEvent('WindowSetTop') +wxEVT_WindowSetWidth = wx.activex.RegisterActiveXEvent('WindowSetWidth') +wxEVT_WindowSetHeight = wx.activex.RegisterActiveXEvent('WindowSetHeight') +wxEVT_WindowClosing = wx.activex.RegisterActiveXEvent('WindowClosing') +wxEVT_ClientToHostWindow = wx.activex.RegisterActiveXEvent('ClientToHostWindow') +wxEVT_SetSecureLockIcon = wx.activex.RegisterActiveXEvent('SetSecureLockIcon') +wxEVT_FileDownload = wx.activex.RegisterActiveXEvent('FileDownload') +wxEVT_NavigateError = wx.activex.RegisterActiveXEvent('NavigateError') +wxEVT_PrintTemplateInstantiation = wx.activex.RegisterActiveXEvent('PrintTemplateInstantiation') +wxEVT_PrintTemplateTeardown = wx.activex.RegisterActiveXEvent('PrintTemplateTeardown') +wxEVT_UpdatePageStatus = wx.activex.RegisterActiveXEvent('UpdatePageStatus') +wxEVT_PrivacyImpactedStateChange = wx.activex.RegisterActiveXEvent('PrivacyImpactedStateChange') + +EVT_StatusTextChange = wx.PyEventBinder(wxEVT_StatusTextChange, 1) +EVT_ProgressChange = wx.PyEventBinder(wxEVT_ProgressChange, 1) +EVT_CommandStateChange = wx.PyEventBinder(wxEVT_CommandStateChange, 1) +EVT_DownloadBegin = wx.PyEventBinder(wxEVT_DownloadBegin, 1) +EVT_DownloadComplete = wx.PyEventBinder(wxEVT_DownloadComplete, 1) +EVT_TitleChange = wx.PyEventBinder(wxEVT_TitleChange, 1) +EVT_PropertyChange = wx.PyEventBinder(wxEVT_PropertyChange, 1) +EVT_BeforeNavigate2 = wx.PyEventBinder(wxEVT_BeforeNavigate2, 1) +EVT_NewWindow2 = wx.PyEventBinder(wxEVT_NewWindow2, 1) +EVT_NavigateComplete2 = wx.PyEventBinder(wxEVT_NavigateComplete2, 1) +EVT_DocumentComplete = wx.PyEventBinder(wxEVT_DocumentComplete, 1) +EVT_Quit = wx.PyEventBinder(wxEVT_Quit, 1) +EVT_Visible = wx.PyEventBinder(wxEVT_Visible, 1) +EVT_ToolBar = wx.PyEventBinder(wxEVT_ToolBar, 1) +EVT_MenuBar = wx.PyEventBinder(wxEVT_MenuBar, 1) +EVT_StatusBar = wx.PyEventBinder(wxEVT_StatusBar, 1) +EVT_FullScreen = wx.PyEventBinder(wxEVT_FullScreen, 1) +EVT_TheaterMode = wx.PyEventBinder(wxEVT_TheaterMode, 1) +EVT_WindowSetResizable = wx.PyEventBinder(wxEVT_WindowSetResizable, 1) +EVT_WindowSetLeft = wx.PyEventBinder(wxEVT_WindowSetLeft, 1) +EVT_WindowSetTop = wx.PyEventBinder(wxEVT_WindowSetTop, 1) +EVT_WindowSetWidth = wx.PyEventBinder(wxEVT_WindowSetWidth, 1) +EVT_WindowSetHeight = wx.PyEventBinder(wxEVT_WindowSetHeight, 1) +EVT_WindowClosing = wx.PyEventBinder(wxEVT_WindowClosing, 1) +EVT_ClientToHostWindow = wx.PyEventBinder(wxEVT_ClientToHostWindow, 1) +EVT_SetSecureLockIcon = wx.PyEventBinder(wxEVT_SetSecureLockIcon, 1) +EVT_FileDownload = wx.PyEventBinder(wxEVT_FileDownload, 1) +EVT_NavigateError = wx.PyEventBinder(wxEVT_NavigateError, 1) +EVT_PrintTemplateInstantiation = wx.PyEventBinder(wxEVT_PrintTemplateInstantiation, 1) +EVT_PrintTemplateTeardown = wx.PyEventBinder(wxEVT_PrintTemplateTeardown, 1) +EVT_UpdatePageStatus = wx.PyEventBinder(wxEVT_UpdatePageStatus, 1) +EVT_PrivacyImpactedStateChange = wx.PyEventBinder(wxEVT_PrivacyImpactedStateChange, 1) + + +# For this there are af ew special methods implemented in C++ in the +# IEHtmlWindowBase class, so derive from it instead of ActiveXWindow. +class IEHtmlWindow(wx.activex.IEHtmlWindowBase): + def __init__(self, parent, ID=-1, pos=wx.DefaultPosition, + size=wx.DefaultSize, style=0, name='IEHtmlWindow'): + wx.activex.IEHtmlWindowBase.__init__(self, parent, + wx.activex.CLSID('{8856F961-340A-11D0-A96B-00C04FD705A2}'), + ID, pos, size, style, name) + + # Methods from IEHtmlWindowBase. Redirected from here just for + # the sake of completeness... + def LoadString(self, html): + """Load the html document from a string""" + return wx.activex.IEHtmlWindowBase.LoadString(self, html) + + + def LoadStream(self, stream): + """ + Load the html document from a wx.InputStream or a Python + file-like object. + """ + return wx.activex.IEHtmlWindowBase.LoadStream(self, stream) + + + def LoadUrl(self, URL, Flags=0): + """Load the document from url.""" + return self.Navigate2(URL, Flags) + + + def GetStringSelection(self, asHTML): + """ + Returns the contents of the selected portion of the document as + either html or plain text. + """ + return wx.activex.IEHtmlWindowBase.GetStringSelection(self, asHTML) + + + def GetText(self, asHTML): + """ + Returns the contents of the the html document as either html or plain text. + """ + return wx.activex.IEHtmlWindowBase.GetText(self, asHTML) + + + def SetCharset(self, charset): + """""" + return wx.activex.IEHtmlWindowBase.SetCharset(self, charset) + + + # Methods exported by the ActiveX object + def QueryInterface(self, riid): + return self.CallAXMethod('QueryInterface', riid) + + def AddRef(self): + return self.CallAXMethod('AddRef') + + def Release(self): + return self.CallAXMethod('Release') + + def GetTypeInfoCount(self): + return self.CallAXMethod('GetTypeInfoCount') + + def GetTypeInfo(self, itinfo, lcid): + return self.CallAXMethod('GetTypeInfo', itinfo, lcid) + + def GetIDsOfNames(self, riid, rgszNames, cNames, lcid): + return self.CallAXMethod('GetIDsOfNames', riid, rgszNames, cNames, lcid) + + def Invoke(self, dispidMember, riid, lcid, wFlags, pdispparams): + return self.CallAXMethod('Invoke', dispidMember, riid, lcid, wFlags, pdispparams) + + def GoBack(self): + return self.CallAXMethod('GoBack') + + def GoForward(self): + return self.CallAXMethod('GoForward') + + def GoHome(self): + return self.CallAXMethod('GoHome') + + def GoSearch(self): + return self.CallAXMethod('GoSearch') + + # added default for Flags + def Navigate(self, URL, Flags=0, TargetFrameName=None, PostData=None, Headers=None): + return self.CallAXMethod('Navigate', URL, Flags, TargetFrameName, PostData, Headers) + + # Removed to prevent conflict with wx.Window.Refresh + #def Refresh(self): + # return self.CallAXMethod('Refresh') + + # renamed + def RefreshPage(self, Level=REFRESH_NORMAL): + return self.CallAXMethod('Refresh2', Level) + + def Stop(self): + return self.CallAXMethod('Stop') + + def Quit(self): + return self.CallAXMethod('Quit') + + def ClientToWindow(self, pcx, pcy): + return self.CallAXMethod('ClientToWindow', pcx, pcy) + + def PutProperty(self, Property, vtValue): + return self.CallAXMethod('PutProperty', Property, vtValue) + + def GetProperty(self, Property): + return self.CallAXMethod('GetProperty', Property) + + # added default for flags + def Navigate2(self, URL, Flags=0, TargetFrameName=None, PostData=None, Headers=None): + return self.CallAXMethod('Navigate2', URL, Flags, TargetFrameName, PostData, Headers) + + def QueryStatusWB(self, cmdID): + return self.CallAXMethod('QueryStatusWB', cmdID) + + def ExecWB(self, cmdID, cmdexecopt, pvaIn, pvaOut=None): + return self.CallAXMethod('ExecWB', cmdID, cmdexecopt, pvaIn, pvaOut) + + def ShowBrowserBar(self, pvaClsid, pvarShow, pvarSize=None): + return self.CallAXMethod('ShowBrowserBar', pvaClsid, pvarShow, pvarSize) + + # Getters, Setters and properties + def _get_Application(self): + return self.GetAXProp('Application') + application = property(_get_Application, None) + + def _get_Parent(self): + return self.GetAXProp('Parent') + parent = property(_get_Parent, None) + + def _get_Container(self): + return self.GetAXProp('Container') + container = property(_get_Container, None) + + def _get_Document(self): + return self.GetAXProp('Document') + document = property(_get_Document, None) + + def _get_TopLevelContainer(self): + return self.GetAXProp('TopLevelContainer') + toplevelcontainer = property(_get_TopLevelContainer, None) + + def _get_Type(self): + return self.GetAXProp('Type') + type = property(_get_Type, None) + + def _get_Left(self): + return self.GetAXProp('Left') + def _set_Left(self, Left): + self.SetAXProp('Left', Left) + left = property(_get_Left, _set_Left) + + def _get_Top(self): + return self.GetAXProp('Top') + def _set_Top(self, Top): + self.SetAXProp('Top', Top) + top = property(_get_Top, _set_Top) + + def _get_Width(self): + return self.GetAXProp('Width') + def _set_Width(self, Width): + self.SetAXProp('Width', Width) + width = property(_get_Width, _set_Width) + + def _get_Height(self): + return self.GetAXProp('Height') + def _set_Height(self, Height): + self.SetAXProp('Height', Height) + height = property(_get_Height, _set_Height) + + def _get_LocationName(self): + return self.GetAXProp('LocationName') + locationname = property(_get_LocationName, None) + + def _get_LocationURL(self): + return self.GetAXProp('LocationURL') + locationurl = property(_get_LocationURL, None) + + def _get_Busy(self): + return self.GetAXProp('Busy') + busy = property(_get_Busy, None) + + def _get_Name(self): + return self.GetAXProp('Name') + name = property(_get_Name, None) + + def _get_HWND(self): + return self.GetAXProp('HWND') + hwnd = property(_get_HWND, None) + + def _get_FullName(self): + return self.GetAXProp('FullName') + fullname = property(_get_FullName, None) + + def _get_Path(self): + return self.GetAXProp('Path') + path = property(_get_Path, None) + + def _get_Visible(self): + return self.GetAXProp('Visible') + def _set_Visible(self, Visible): + self.SetAXProp('Visible', Visible) + visible = property(_get_Visible, _set_Visible) + + def _get_StatusBar(self): + return self.GetAXProp('StatusBar') + def _set_StatusBar(self, StatusBar): + self.SetAXProp('StatusBar', StatusBar) + statusbar = property(_get_StatusBar, _set_StatusBar) + + def _get_StatusText(self): + return self.GetAXProp('StatusText') + def _set_StatusText(self, StatusText): + self.SetAXProp('StatusText', StatusText) + statustext = property(_get_StatusText, _set_StatusText) + + def _get_ToolBar(self): + return self.GetAXProp('ToolBar') + def _set_ToolBar(self, ToolBar): + self.SetAXProp('ToolBar', ToolBar) + toolbar = property(_get_ToolBar, _set_ToolBar) + + def _get_MenuBar(self): + return self.GetAXProp('MenuBar') + def _set_MenuBar(self, MenuBar): + self.SetAXProp('MenuBar', MenuBar) + menubar = property(_get_MenuBar, _set_MenuBar) + + def _get_FullScreen(self): + return self.GetAXProp('FullScreen') + def _set_FullScreen(self, FullScreen): + self.SetAXProp('FullScreen', FullScreen) + fullscreen = property(_get_FullScreen, _set_FullScreen) + + def _get_ReadyState(self): + return self.GetAXProp('ReadyState') + readystate = property(_get_ReadyState, None) + + def _get_Offline(self): + return self.GetAXProp('Offline') + def _set_Offline(self, Offline): + self.SetAXProp('Offline', Offline) + offline = property(_get_Offline, _set_Offline) + + def _get_Silent(self): + return self.GetAXProp('Silent') + def _set_Silent(self, Silent): + self.SetAXProp('Silent', Silent) + silent = property(_get_Silent, _set_Silent) + + def _get_RegisterAsBrowser(self): + return self.GetAXProp('RegisterAsBrowser') + def _set_RegisterAsBrowser(self, RegisterAsBrowser): + self.SetAXProp('RegisterAsBrowser', RegisterAsBrowser) + registerasbrowser = property(_get_RegisterAsBrowser, _set_RegisterAsBrowser) + + def _get_RegisterAsDropTarget(self): + return self.GetAXProp('RegisterAsDropTarget') + def _set_RegisterAsDropTarget(self, RegisterAsDropTarget): + self.SetAXProp('RegisterAsDropTarget', RegisterAsDropTarget) + registerasdroptarget = property(_get_RegisterAsDropTarget, _set_RegisterAsDropTarget) + + def _get_TheaterMode(self): + return self.GetAXProp('TheaterMode') + def _set_TheaterMode(self, TheaterMode): + self.SetAXProp('TheaterMode', TheaterMode) + theatermode = property(_get_TheaterMode, _set_TheaterMode) + + def _get_AddressBar(self): + return self.GetAXProp('AddressBar') + def _set_AddressBar(self, AddressBar): + self.SetAXProp('AddressBar', AddressBar) + addressbar = property(_get_AddressBar, _set_AddressBar) + + def _get_Resizable(self): + return self.GetAXProp('Resizable') + def _set_Resizable(self, Resizable): + self.SetAXProp('Resizable', Resizable) + resizable = property(_get_Resizable, _set_Resizable) + + +# PROPERTIES +# -------------------- +# application +# type:VT_DISPATCH arg:VT_EMPTY canGet:True canSet:False +# +# parent +# type:VT_DISPATCH arg:VT_EMPTY canGet:True canSet:False +# +# container +# type:VT_DISPATCH arg:VT_EMPTY canGet:True canSet:False +# +# document +# type:VT_DISPATCH arg:VT_EMPTY canGet:True canSet:False +# +# toplevelcontainer +# type:bool arg:VT_EMPTY canGet:True canSet:False +# +# type +# type:string arg:VT_EMPTY canGet:True canSet:False +# +# left +# type:int arg:int canGet:True canSet:True +# +# top +# type:int arg:int canGet:True canSet:True +# +# width +# type:int arg:int canGet:True canSet:True +# +# height +# type:int arg:int canGet:True canSet:True +# +# locationname +# type:string arg:VT_EMPTY canGet:True canSet:False +# +# locationurl +# type:string arg:VT_EMPTY canGet:True canSet:False +# +# busy +# type:bool arg:VT_EMPTY canGet:True canSet:False +# +# name +# type:string arg:VT_EMPTY canGet:True canSet:False +# +# hwnd +# type:int arg:VT_EMPTY canGet:True canSet:False +# +# fullname +# type:string arg:VT_EMPTY canGet:True canSet:False +# +# path +# type:string arg:VT_EMPTY canGet:True canSet:False +# +# visible +# type:bool arg:bool canGet:True canSet:True +# +# statusbar +# type:bool arg:bool canGet:True canSet:True +# +# statustext +# type:string arg:string canGet:True canSet:True +# +# toolbar +# type:int arg:int canGet:True canSet:True +# +# menubar +# type:bool arg:bool canGet:True canSet:True +# +# fullscreen +# type:bool arg:bool canGet:True canSet:True +# +# readystate +# type:unsupported type 29 arg:VT_EMPTY canGet:True canSet:False +# +# offline +# type:bool arg:bool canGet:True canSet:True +# +# silent +# type:bool arg:bool canGet:True canSet:True +# +# registerasbrowser +# type:bool arg:bool canGet:True canSet:True +# +# registerasdroptarget +# type:bool arg:bool canGet:True canSet:True +# +# theatermode +# type:bool arg:bool canGet:True canSet:True +# +# addressbar +# type:bool arg:bool canGet:True canSet:True +# +# resizable +# type:bool arg:bool canGet:True canSet:True +# +# +# +# +# METHODS +# -------------------- +# QueryInterface +# retType: VT_VOID +# params: +# riid +# in:True out:False optional:False type:unsupported type 29 +# ppvObj +# in:False out:True optional:False type:unsupported type 26 +# +# AddRef +# retType: int +# +# Release +# retType: int +# +# GetTypeInfoCount +# retType: VT_VOID +# params: +# pctinfo +# in:False out:True optional:False type:int +# +# GetTypeInfo +# retType: VT_VOID +# params: +# itinfo +# in:True out:False optional:False type:int +# lcid +# in:True out:False optional:False type:int +# pptinfo +# in:False out:True optional:False type:unsupported type 26 +# +# GetIDsOfNames +# retType: VT_VOID +# params: +# riid +# in:True out:False optional:False type:unsupported type 29 +# rgszNames +# in:True out:False optional:False type:unsupported type 26 +# cNames +# in:True out:False optional:False type:int +# lcid +# in:True out:False optional:False type:int +# rgdispid +# in:False out:True optional:False type:int +# +# Invoke +# retType: VT_VOID +# params: +# dispidMember +# in:True out:False optional:False type:int +# riid +# in:True out:False optional:False type:unsupported type 29 +# lcid +# in:True out:False optional:False type:int +# wFlags +# in:True out:False optional:False type:int +# pdispparams +# in:True out:False optional:False type:unsupported type 29 +# pvarResult +# in:False out:True optional:False type:VT_VARIANT +# pexcepinfo +# in:False out:True optional:False type:unsupported type 29 +# puArgErr +# in:False out:True optional:False type:int +# +# GoBack +# retType: VT_VOID +# +# GoForward +# retType: VT_VOID +# +# GoHome +# retType: VT_VOID +# +# GoSearch +# retType: VT_VOID +# +# Navigate +# retType: VT_VOID +# params: +# URL +# in:True out:False optional:False type:string +# Flags +# in:True out:False optional:False type:VT_VARIANT +# TargetFrameName +# in:True out:False optional:True type:VT_VARIANT +# PostData +# in:True out:False optional:True type:VT_VARIANT +# Headers +# in:True out:False optional:True type:VT_VARIANT +# +# Refresh +# retType: VT_VOID +# +# Refresh2 +# retType: VT_VOID +# params: +# Level +# in:True out:False optional:False type:VT_VARIANT +# +# Stop +# retType: VT_VOID +# +# Quit +# retType: VT_VOID +# +# ClientToWindow +# retType: VT_VOID +# params: +# pcx +# in:True out:True optional:False type:int +# pcy +# in:True out:True optional:False type:int +# +# PutProperty +# retType: VT_VOID +# params: +# Property +# in:True out:False optional:False type:string +# vtValue +# in:True out:False optional:False type:VT_VARIANT +# +# GetProperty +# retType: VT_VARIANT +# params: +# Property +# in:True out:False optional:False type:string +# +# Navigate2 +# retType: VT_VOID +# params: +# URL +# in:True out:False optional:False type:VT_VARIANT +# Flags +# in:True out:False optional:False type:VT_VARIANT +# TargetFrameName +# in:True out:False optional:True type:VT_VARIANT +# PostData +# in:True out:False optional:True type:VT_VARIANT +# Headers +# in:True out:False optional:True type:VT_VARIANT +# +# QueryStatusWB +# retType: unsupported type 29 +# params: +# cmdID +# in:True out:False optional:False type:unsupported type 29 +# +# ExecWB +# retType: VT_VOID +# params: +# cmdID +# in:True out:False optional:False type:unsupported type 29 +# cmdexecopt +# in:True out:False optional:False type:unsupported type 29 +# pvaIn +# in:True out:False optional:False type:VT_VARIANT +# pvaOut +# in:True out:True optional:True type:VT_VARIANT +# +# ShowBrowserBar +# retType: VT_VOID +# params: +# pvaClsid +# in:True out:False optional:False type:VT_VARIANT +# pvarShow +# in:True out:False optional:False type:VT_VARIANT +# pvarSize +# in:True out:False optional:True type:VT_VARIANT +# +# +# +# +# EVENTS +# -------------------- +# StatusTextChange +# retType: VT_VOID +# params: +# Text +# in:True out:False optional:False type:string +# +# ProgressChange +# retType: VT_VOID +# params: +# Progress +# in:True out:False optional:False type:int +# ProgressMax +# in:True out:False optional:False type:int +# +# CommandStateChange +# retType: VT_VOID +# params: +# Command +# in:True out:False optional:False type:int +# Enable +# in:True out:False optional:False type:bool +# +# DownloadBegin +# retType: VT_VOID +# +# DownloadComplete +# retType: VT_VOID +# +# TitleChange +# retType: VT_VOID +# params: +# Text +# in:True out:False optional:False type:string +# +# PropertyChange +# retType: VT_VOID +# params: +# szProperty +# in:True out:False optional:False type:string +# +# BeforeNavigate2 +# retType: VT_VOID +# params: +# pDisp +# in:True out:False optional:False type:VT_DISPATCH +# URL +# in:True out:False optional:False type:VT_VARIANT +# Flags +# in:True out:False optional:False type:VT_VARIANT +# TargetFrameName +# in:True out:False optional:False type:VT_VARIANT +# PostData +# in:True out:False optional:False type:VT_VARIANT +# Headers +# in:True out:False optional:False type:VT_VARIANT +# Cancel +# in:True out:True optional:False type:bool +# +# NewWindow2 +# retType: VT_VOID +# params: +# ppDisp +# in:True out:True optional:False type:VT_DISPATCH +# Cancel +# in:True out:True optional:False type:bool +# +# NavigateComplete2 +# retType: VT_VOID +# params: +# pDisp +# in:True out:False optional:False type:VT_DISPATCH +# URL +# in:True out:False optional:False type:VT_VARIANT +# +# DocumentComplete +# retType: VT_VOID +# params: +# pDisp +# in:True out:False optional:False type:VT_DISPATCH +# URL +# in:True out:False optional:False type:VT_VARIANT +# +# Quit +# retType: VT_VOID +# +# Visible +# retType: VT_VOID +# params: +# Visible +# in:True out:False optional:False type:bool +# +# ToolBar +# retType: VT_VOID +# params: +# ToolBar +# in:True out:False optional:False type:bool +# +# MenuBar +# retType: VT_VOID +# params: +# MenuBar +# in:True out:False optional:False type:bool +# +# StatusBar +# retType: VT_VOID +# params: +# StatusBar +# in:True out:False optional:False type:bool +# +# FullScreen +# retType: VT_VOID +# params: +# FullScreen +# in:True out:False optional:False type:bool +# +# TheaterMode +# retType: VT_VOID +# params: +# TheaterMode +# in:True out:False optional:False type:bool +# +# WindowSetResizable +# retType: VT_VOID +# params: +# Resizable +# in:True out:False optional:False type:bool +# +# WindowSetLeft +# retType: VT_VOID +# params: +# Left +# in:True out:False optional:False type:int +# +# WindowSetTop +# retType: VT_VOID +# params: +# Top +# in:True out:False optional:False type:int +# +# WindowSetWidth +# retType: VT_VOID +# params: +# Width +# in:True out:False optional:False type:int +# +# WindowSetHeight +# retType: VT_VOID +# params: +# Height +# in:True out:False optional:False type:int +# +# WindowClosing +# retType: VT_VOID +# params: +# IsChildWindow +# in:True out:False optional:False type:bool +# Cancel +# in:True out:True optional:False type:bool +# +# ClientToHostWindow +# retType: VT_VOID +# params: +# CX +# in:True out:True optional:False type:int +# CY +# in:True out:True optional:False type:int +# +# SetSecureLockIcon +# retType: VT_VOID +# params: +# SecureLockIcon +# in:True out:False optional:False type:int +# +# FileDownload +# retType: VT_VOID +# params: +# Cancel +# in:True out:True optional:False type:bool +# +# NavigateError +# retType: VT_VOID +# params: +# pDisp +# in:True out:False optional:False type:VT_DISPATCH +# URL +# in:True out:False optional:False type:VT_VARIANT +# Frame +# in:True out:False optional:False type:VT_VARIANT +# StatusCode +# in:True out:False optional:False type:VT_VARIANT +# Cancel +# in:True out:True optional:False type:bool +# +# PrintTemplateInstantiation +# retType: VT_VOID +# params: +# pDisp +# in:True out:False optional:False type:VT_DISPATCH +# +# PrintTemplateTeardown +# retType: VT_VOID +# params: +# pDisp +# in:True out:False optional:False type:VT_DISPATCH +# +# UpdatePageStatus +# retType: VT_VOID +# params: +# pDisp +# in:True out:False optional:False type:VT_DISPATCH +# nPage +# in:True out:False optional:False type:VT_VARIANT +# fDone +# in:True out:False optional:False type:VT_VARIANT +# +# PrivacyImpactedStateChange +# retType: VT_VOID +# params: +# bImpacted +# in:True out:False optional:False type:bool +# +# +# +# diff --git a/wxPython/wx/lib/pdfwin.py b/wxPython/wx/lib/pdfwin.py new file mode 100644 index 0000000000..9f884671eb --- /dev/null +++ b/wxPython/wx/lib/pdfwin.py @@ -0,0 +1,261 @@ +#---------------------------------------------------------------------- +# Name: wx.lib.pdfwin +# Purpose: A class that allows the use of the Acrobat PSF reader +# ActiveX control +# +# Author: Robin Dunn +# +# Created: 22-March-2004 +# RCS-ID: $Id$ +# Copyright: (c) 2004 by Total Control Software +# Licence: wxWindows license +#---------------------------------------------------------------------- +# This module was generated by the wx.activex.GernerateAXModule class +# (See also the genaxmodule script.) + +import wx +import wx.activex + +clsID = '{CA8A9780-280D-11CF-A24D-444553540000}' +progID = 'PDF.PdfCtrl.5' + + + +# Derive a new class from ActiveXWindow +class PDFWindow(wx.activex.ActiveXWindow): + def __init__(self, parent, ID=-1, pos=wx.DefaultPosition, + size=wx.DefaultSize, style=0, name='PDFWindow'): + wx.activex.ActiveXWindow.__init__(self, parent, + wx.activex.CLSID('{CA8A9780-280D-11CF-A24D-444553540000}'), + ID, pos, size, style, name) + + # Methods exported by the ActiveX object + def LoadFile(self, fileName): + return self.CallAXMethod('LoadFile', fileName) + + def setShowToolbar(self, On): + return self.CallAXMethod('setShowToolbar', On) + + def gotoFirstPage(self): + return self.CallAXMethod('gotoFirstPage') + + def gotoLastPage(self): + return self.CallAXMethod('gotoLastPage') + + def gotoNextPage(self): + return self.CallAXMethod('gotoNextPage') + + def gotoPreviousPage(self): + return self.CallAXMethod('gotoPreviousPage') + + def setCurrentPage(self, n): + return self.CallAXMethod('setCurrentPage', n) + + def goForwardStack(self): + return self.CallAXMethod('goForwardStack') + + def goBackwardStack(self): + return self.CallAXMethod('goBackwardStack') + + def setPageMode(self, pageMode): + return self.CallAXMethod('setPageMode', pageMode) + + def setLayoutMode(self, layoutMode): + return self.CallAXMethod('setLayoutMode', layoutMode) + + def setNamedDest(self, namedDest): + return self.CallAXMethod('setNamedDest', namedDest) + + def Print(self): + return self.CallAXMethod('Print') + + def printWithDialog(self): + return self.CallAXMethod('printWithDialog') + + def setZoom(self, percent): + return self.CallAXMethod('setZoom', percent) + + def setZoomScroll(self, percent, left, top): + return self.CallAXMethod('setZoomScroll', percent, left, top) + + def setView(self, viewMode): + return self.CallAXMethod('setView', viewMode) + + def setViewScroll(self, viewMode, offset): + return self.CallAXMethod('setViewScroll', viewMode, offset) + + def setViewRect(self, left, top, width, height): + return self.CallAXMethod('setViewRect', left, top, width, height) + + def printPages(self, from_, to): + return self.CallAXMethod('printPages', from_, to) + + def printPagesFit(self, from_, to, shrinkToFit): + return self.CallAXMethod('printPagesFit', from_, to, shrinkToFit) + + def printAll(self): + return self.CallAXMethod('printAll') + + def printAllFit(self, shrinkToFit): + return self.CallAXMethod('printAllFit', shrinkToFit) + + def setShowScrollbars(self, On): + return self.CallAXMethod('setShowScrollbars', On) + + def AboutBox(self): + return self.CallAXMethod('AboutBox') + + +# PROPERTIES +# -------------------- +# +# +# +# METHODS +# -------------------- +# LoadFile +# retType: bool +# params: +# fileName +# in:False out:False optional:False type:string +# +# setShowToolbar +# retType: VT_VOID +# params: +# On +# in:False out:False optional:False type:bool +# +# gotoFirstPage +# retType: VT_VOID +# +# gotoLastPage +# retType: VT_VOID +# +# gotoNextPage +# retType: VT_VOID +# +# gotoPreviousPage +# retType: VT_VOID +# +# setCurrentPage +# retType: VT_VOID +# params: +# n +# in:False out:False optional:False type:int +# +# goForwardStack +# retType: VT_VOID +# +# goBackwardStack +# retType: VT_VOID +# +# setPageMode +# retType: VT_VOID +# params: +# pageMode +# in:False out:False optional:False type:string +# +# setLayoutMode +# retType: VT_VOID +# params: +# layoutMode +# in:False out:False optional:False type:string +# +# setNamedDest +# retType: VT_VOID +# params: +# namedDest +# in:False out:False optional:False type:string +# +# Print +# retType: VT_VOID +# +# printWithDialog +# retType: VT_VOID +# +# setZoom +# retType: VT_VOID +# params: +# percent +# in:False out:False optional:False type:double +# +# setZoomScroll +# retType: VT_VOID +# params: +# percent +# in:False out:False optional:False type:double +# left +# in:False out:False optional:False type:double +# top +# in:False out:False optional:False type:double +# +# setView +# retType: VT_VOID +# params: +# viewMode +# in:False out:False optional:False type:string +# +# setViewScroll +# retType: VT_VOID +# params: +# viewMode +# in:False out:False optional:False type:string +# offset +# in:False out:False optional:False type:double +# +# setViewRect +# retType: VT_VOID +# params: +# left +# in:False out:False optional:False type:double +# top +# in:False out:False optional:False type:double +# width +# in:False out:False optional:False type:double +# height +# in:False out:False optional:False type:double +# +# printPages +# retType: VT_VOID +# params: +# from +# in:False out:False optional:False type:int +# to +# in:False out:False optional:False type:int +# +# printPagesFit +# retType: VT_VOID +# params: +# from +# in:False out:False optional:False type:int +# to +# in:False out:False optional:False type:int +# shrinkToFit +# in:False out:False optional:False type:bool +# +# printAll +# retType: VT_VOID +# +# printAllFit +# retType: VT_VOID +# params: +# shrinkToFit +# in:False out:False optional:False type:bool +# +# setShowScrollbars +# retType: VT_VOID +# params: +# On +# in:False out:False optional:False type:bool +# +# AboutBox +# retType: VT_VOID +# +# +# +# +# EVENTS +# -------------------- +# +# +# diff --git a/wxPython/wx/tools/genaxmodule.py b/wxPython/wx/tools/genaxmodule.py new file mode 100644 index 0000000000..c178aabaec --- /dev/null +++ b/wxPython/wx/tools/genaxmodule.py @@ -0,0 +1,43 @@ +""" + + +When this script is run it will create a .py module (output to the +current directory) containing a class derived from +wx.activex.ActiveXWindow for the progID or CLSID given on the command +line. By default the class name will be used as the module name as +well, but this is just because I am lazy, not trying to define a +standard or anything. Feel free to rename the module, I do. + +Usage: + + python genax.py CLSID|progID className + +""" + +import wx +import wx.activex +import sys + + +def main(args): + if len(args) < 3: + print __doc__ + sys.exit(1) + + # unfortunatly we need to make an app, frame and an instance of + # the ActiceX control in order to get the TypeInfo about it... + app = wx.PySimpleApp() + f = wx.Frame(None, -1, "") + clsid = wx.activex.CLSID(args[1]) + axw = wx.activex.ActiveXWindow(f, clsid) + + wx.activex.GernerateAXModule(axw, args[2], '.', verbose=True) + + # Cleanup + f.Close() + app.MainLoop() + + +if __name__ == "__main__": + main(sys.argv) + diff --git a/wxPython/wxPython/activex.py b/wxPython/wxPython/activex.py new file mode 100644 index 0000000000..71d46e8c2e --- /dev/null +++ b/wxPython/wxPython/activex.py @@ -0,0 +1,52 @@ +## This file reverse renames symbols in the wx package to give +## them their wx prefix again, for backwards compatibility. +## +## Generated by ./distrib/build_renamers.py + +# This silly stuff here is so the wxPython.wx module doesn't conflict +# with the wx package. We need to import modules from the wx package +# here, then we'll put the wxPython.wx entry back in sys.modules. +import sys +_wx = None +if sys.modules.has_key('wxPython.wx'): + _wx = sys.modules['wxPython.wx'] + del sys.modules['wxPython.wx'] + +import wx.activex + +sys.modules['wxPython.wx'] = _wx +del sys, _wx + + +# Now assign all the reverse-renamed names: +CLSID = wx.activex.CLSID +CLSIDPtr = wx.activex.CLSIDPtr +wxParamX = wx.activex.ParamX +wxParamXPtr = wx.activex.ParamXPtr +wxFuncX = wx.activex.FuncX +wxFuncXPtr = wx.activex.FuncXPtr +wxPropX = wx.activex.PropX +wxPropXPtr = wx.activex.PropXPtr +wxParamXArray = wx.activex.ParamXArray +wxParamXArrayPtr = wx.activex.ParamXArrayPtr +wxFuncXArray = wx.activex.FuncXArray +wxFuncXArrayPtr = wx.activex.FuncXArrayPtr +wxPropXArray = wx.activex.PropXArray +wxPropXArrayPtr = wx.activex.PropXArrayPtr +wxActiveXWindow = wx.activex.ActiveXWindow +wxActiveXWindowPtr = wx.activex.ActiveXWindowPtr +RegisterActiveXEvent = wx.activex.RegisterActiveXEvent +wxActiveXEvent = wx.activex.ActiveXEvent +wxActiveXEventPtr = wx.activex.ActiveXEventPtr +wxIEHtmlWindowBase = wx.activex.IEHtmlWindowBase +wxIEHtmlWindowBasePtr = wx.activex.IEHtmlWindowBasePtr + + +d = globals() +for k, v in wx.activex.__dict__.iteritems(): + if k.startswith('EVT'): + d[k] = v +del d, k, v + + + -- 2.45.2