]> git.saurik.com Git - wxWidgets.git/blobdiff - wxPython/src/html.i
New wxDesigner-less version of the MimeTypesManager demo
[wxWidgets.git] / wxPython / src / html.i
index 86609a3fd60a42c8c7aaf41ec3a489a582013a2b..7449fdff7a75a8d8001a8ce4e79678f068cccdf2 100644 (file)
 #include <wx/html/htmprint.h>
 #include <wx/html/helpctrl.h>
 
-
-    DECLARE_DEF_STRING(EmptyString);
-    static const wxChar* wxHtmlWindowNameStr = wxT("htmlWindow");
-    DECLARE_DEF_STRING(HtmlWindowNameStr);
-    static const wxChar* wxHtmlPrintoutTitleStr = wxT("Printout");
-    DECLARE_DEF_STRING(HtmlPrintoutTitleStr);
-    static const wxChar* wxHtmlPrintingTitleStr = wxT("Printing");
-    DECLARE_DEF_STRING(HtmlPrintingTitleStr);
-    
 %}
 
+
 //---------------------------------------------------------------------------
 
 %import windows.i
 %include _html_rename.i
 
 
+MAKE_CONST_WXSTRING_NOSWIG(EmptyString);
+MAKE_CONST_WXSTRING2(HtmlWindowNameStr, "htmlWindow")
+MAKE_CONST_WXSTRING2(HtmlPrintoutTitleStr, "Printout")
+MAKE_CONST_WXSTRING2(HtmlPrintingTitleStr, "Printing")
+
+
 // TODO: Split this file into multiple %included files that coresponds to the
 // wx/html include files (more or less.)
 
@@ -329,15 +327,17 @@ public:
 
         // First, make a new instance of the tag handler
         wxPyBeginBlockThreads();
-        PyObject* arg = Py_BuildValue("()");
-        PyObject* obj = PyInstance_New(m_tagHandlerClass, arg, NULL);
+        PyObject* arg = PyTuple_New(0);
+        PyObject* obj = PyObject_CallObject(m_tagHandlerClass, arg);
         Py_DECREF(arg);
-        wxPyEndBlockThreads();
-
+        
         // now figure out where it's C++ object is...
         wxPyHtmlWinTagHandler* thPtr;
-        if (! wxPyConvertSwigPtr(obj, (void **)&thPtr, wxT("wxPyHtmlWinTagHandler")))
+        if (! wxPyConvertSwigPtr(obj, (void **)&thPtr, wxT("wxPyHtmlWinTagHandler"))) {
+            wxPyEndBlockThreads();
             return;
+        }
+        wxPyEndBlockThreads();
 
         // add it,
         parser->AddTagHandler(thPtr);
@@ -487,6 +487,8 @@ public:
     int GetWidth();
     int GetHeight();
     int GetDescent();
+    const wxString& GetId() const;
+    void SetId(const wxString& id);
     wxHtmlLinkInfo* GetLink(int x = 0, int y = 0);
     wxHtmlCell* GetNext();
     wxHtmlContainerCell* GetParent();