]> git.saurik.com Git - wxWidgets.git/blobdiff - wxPython/contrib/activex/activex.i
fixed paste error
[wxWidgets.git] / wxPython / contrib / activex / activex.i
index c663e332a4d9149314e02d38d716bca6ffde7861..b1df9e26aee32425265d63f7718bcc7e4384b470 100644 (file)
@@ -11,7 +11,7 @@
 /////////////////////////////////////////////////////////////////////////////
 
 
 /////////////////////////////////////////////////////////////////////////////
 
 
-%module activex
+%module(package="wx") activex
 
 %{
 #include "wx/wxPython/wxPython.h"
 
 %{
 #include "wx/wxPython/wxPython.h"
@@ -57,14 +57,14 @@ typedef unsigned short  VARTYPE;
 // Some conversion helpers
 static wxVariant _PyObj2Variant(PyObject* value);
 static bool  _PyObj2Variant(PyObject* value, wxVariant& wv);
 // Some conversion helpers
 static wxVariant _PyObj2Variant(PyObject* value);
 static bool  _PyObj2Variant(PyObject* value, wxVariant& wv);
-static PyObject* _Variant2PyObj(wxVariant& value, bool useNone=False);
+static PyObject* _Variant2PyObj(wxVariant& value, bool useNone=false);
 static wxString  _VARTYPEname(VARTYPE vt);
 
 // Check if an exception has been raised  (blocking threads)
 inline bool wxPyErr_Occurred()
 {
     bool rval;
 static wxString  _VARTYPEname(VARTYPE vt);
 
 // Check if an exception has been raised  (blocking threads)
 inline bool wxPyErr_Occurred()
 {
     bool rval;
-    bool blocked = wxPyBeginBlockThreads();
+    wxPyBlock_t blocked = wxPyBeginBlockThreads();
     rval = PyErr_Occurred() != NULL;
     wxPyEndBlockThreads(blocked);
     return rval;
     rval = PyErr_Occurred() != NULL;
     wxPyEndBlockThreads(blocked);
     return rval;
@@ -240,6 +240,9 @@ class wxActiveXWindow : public wxActiveX
 {
 private:
     CLSID       m_CLSID;
 {
 private:
     CLSID       m_CLSID;
+    
+    DECLARE_ABSTRACT_CLASS(wxActiveXWindow);
+
 public:
     wxActiveXWindow( wxWindow* parent, const CLSID& clsId, wxWindowID id = -1,
                      const wxPoint& pos = wxDefaultPosition,
 public:
     wxActiveXWindow( wxWindow* parent, const CLSID& clsId, wxWindowID id = -1,
                      const wxPoint& pos = wxDefaultPosition,
@@ -326,7 +329,7 @@ public:
     void SetAXProp(const wxString& name, PyObject* value)
     {        
         const wxPropX& prop = GetAXPropDesc(name);
     void SetAXProp(const wxString& name, PyObject* value)
     {        
         const wxPropX& prop = GetAXPropDesc(name);
-        bool blocked = wxPyBeginBlockThreads();
+        wxPyBlock_t blocked = wxPyBeginBlockThreads();
         if (! PyErr_Occurred() ) {
             if (! prop.CanSet()) {
                 wxString msg;
         if (! PyErr_Occurred() ) {
             if (! prop.CanSet()) {
                 wxString msg;
@@ -362,7 +365,7 @@ public:
     {        
         PyObject* rval = NULL;
         const wxPropX& prop = GetAXPropDesc(name);
     {        
         PyObject* rval = NULL;
         const wxPropX& prop = GetAXPropDesc(name);
-        bool blocked = wxPyBeginBlockThreads();
+        wxPyBlock_t blocked = wxPyBeginBlockThreads();
         if (! PyErr_Occurred() ) {
             if (! prop.CanGet()) {
                 wxString msg;
         if (! PyErr_Occurred() ) {
             if (! prop.CanGet()) {
                 wxString msg;
@@ -408,7 +411,7 @@ public:
         PyObject* rval = NULL;
         const wxFuncX& func = GetAXMethodDesc(name);
         
         PyObject* rval = NULL;
         const wxFuncX& func = GetAXMethodDesc(name);
         
-        bool blocked = wxPyBeginBlockThreads();
+        wxPyBlock_t blocked = wxPyBeginBlockThreads();
         if (! PyErr_Occurred() ) {
             nargs = func.params.size();
             if (nargs > 0)
         if (! PyErr_Occurred() ) {
             nargs = func.params.size();
             if (nargs > 0)
@@ -460,7 +463,7 @@ public:
             // conversion errors for now
             wxVariant wv;
             MSWVariantToVariant(rv, wv);
             // conversion errors for now
             wxVariant wv;
             MSWVariantToVariant(rv, wv);
-            rval = _Variant2PyObj(wv, True);
+            rval = _Variant2PyObj(wv, true);
             VariantClear(&rv);
 
             if (func.hasOut) {
             VariantClear(&rv);
 
             if (func.hasOut) {
@@ -477,7 +480,7 @@ public:
                     const wxParamX &px = func.params[i];
                     if (px.IsOut()) {
                         MSWVariantToVariant(va, wv);
                     const wxParamX &px = func.params[i];
                     if (px.IsOut()) {
                         MSWVariantToVariant(va, wv);
-                        PyObject* obj = _Variant2PyObj(wv, True);
+                        PyObject* obj = _Variant2PyObj(wv, true);
                         PyList_Append(lst, obj);
                     }
                 }
                         PyList_Append(lst, obj);
                     }
                 }
@@ -497,6 +500,8 @@ public:
         return rval;
     }
 };
         return rval;
     }
 };
+
+IMPLEMENT_ABSTRACT_CLASS( wxActiveXWindow, wxWindow );
 %}
 
 
 %}
 
 
@@ -636,13 +641,13 @@ public:
         // handler. We'll convert and load the ActiveX event parameters into
         // attributes of the Python event object.
         void _preCallInit(PyObject* pyself) {
         // handler. We'll convert and load the ActiveX event parameters into
         // attributes of the Python event object.
         void _preCallInit(PyObject* pyself) {
-            bool blocked = wxPyBeginBlockThreads();
+            wxPyBlock_t blocked = wxPyBeginBlockThreads();
             PyObject* pList = PyList_New(0);
             PyObject_SetAttrString(pyself, "paramList", pList);
             Py_DECREF(pList);
             for (int i=0; i<self->ParamCount(); i+=1) {
                 PyObject* name = PyString_FromString((char*)(const char*)self->ParamName(i).mb_str());
             PyObject* pList = PyList_New(0);
             PyObject_SetAttrString(pyself, "paramList", pList);
             Py_DECREF(pList);
             for (int i=0; i<self->ParamCount(); i+=1) {
                 PyObject* name = PyString_FromString((char*)(const char*)self->ParamName(i).mb_str());
-                PyObject* val = _Variant2PyObj((*self)[i], True);
+                PyObject* val = _Variant2PyObj((*self)[i], true);
                 PyObject_SetAttr(pyself, name, val);
                 PyList_Append(pList, name);
                 Py_DECREF(val);
                 PyObject_SetAttr(pyself, name, val);
                 PyList_Append(pList, name);
                 Py_DECREF(val);
@@ -655,7 +660,7 @@ public:
         // handler. It reloads any "out" parameters from the python attributes
         // back into the wxVariant they came from.        
         void _postCallCleanup(PyObject* pyself) {
         // handler. It reloads any "out" parameters from the python attributes
         // back into the wxVariant they came from.        
         void _postCallCleanup(PyObject* pyself) {
-            bool blocked = wxPyBeginBlockThreads();
+            wxPyBlock_t blocked = wxPyBeginBlockThreads();
             for (int i=0; i<self->ParamCount(); i+=1) {
                 PyObject* val = PyObject_GetAttrString(
                     pyself, (char*)(const char*)self->ParamName(i).mb_str());
             for (int i=0; i<self->ParamCount(); i+=1) {
                 PyObject* val = PyObject_GetAttrString(
                     pyself, (char*)(const char*)self->ParamName(i).mb_str());
@@ -861,6 +866,8 @@ class wxIEHtmlWindowBase : public wxActiveXWindow {
 private:
     wxAutoOleInterface<IWebBrowser2>  m_webBrowser;
 
 private:
     wxAutoOleInterface<IWebBrowser2>  m_webBrowser;
 
+    DECLARE_ABSTRACT_CLASS(wxIEHtmlWindowBase);
+
 public:
 
     wxIEHtmlWindowBase ( wxWindow* parent, const CLSID& clsId, wxWindowID id = -1,
 public:
 
     wxIEHtmlWindowBase ( wxWindow* parent, const CLSID& clsId, wxWindowID id = -1,
@@ -1043,6 +1050,9 @@ public:
 //         return ! m_bAmbientUserMode;
 //     };
 };
 //         return ! m_bAmbientUserMode;
 //     };
 };
+
+IMPLEMENT_ABSTRACT_CLASS( wxIEHtmlWindowBase, wxActiveXWindow );
+
 %}
 
 
 %}
 
 
@@ -1059,6 +1069,7 @@ MustHaveApp(wxIEHtmlWindowBase);
 
 class wxIEHtmlWindowBase : public wxActiveXWindow {
 public:
 
 class wxIEHtmlWindowBase : public wxActiveXWindow {
 public:
+    %pythonAppend wxIEHtmlWindowBase    "self._setOORInfo(self)"
 
     wxIEHtmlWindowBase ( wxWindow* parent, const CLSID& clsId, wxWindowID id = -1,
                          const wxPoint& pos = wxDefaultPosition,
 
     wxIEHtmlWindowBase ( wxWindow* parent, const CLSID& clsId, wxWindowID id = -1,
                          const wxPoint& pos = wxDefaultPosition,