//---------------------------------------------------------------------------
-class wxHtmlLinkInfo {
+class wxHtmlLinkInfo : public wxObject {
public:
wxHtmlLinkInfo(const wxString& href, const wxString& target = wxEmptyString);
wxString GetHref();
//---------------------------------------------------------------------------
-class wxHtmlTag {
+class wxHtmlTag : public wxObject {
public:
// Never need to create a new tag from Python...
//wxHtmlTag(const wxString& source, int pos, int end_pos, wxHtmlTagsCache* cache);
//int ScanParam(const wxString& par, const char *format, void* param);
wxString GetAllParams();
- bool IsEnding();
bool HasEnding();
int GetBeginPos();
int GetEndPos1();
//---------------------------------------------------------------------------
-class wxHtmlParser {
+class wxHtmlParser : public wxObject {
public:
// wxHtmlParser(); This is an abstract base class...
%{
class wxPyHtmlTagHandler : public wxHtmlTagHandler {
+ DECLARE_DYNAMIC_CLASS(wxPyHtmlTagHandler);
public:
wxPyHtmlTagHandler() : wxHtmlTagHandler() {};
PYPRIVATE;
};
+IMPLEMENT_DYNAMIC_CLASS(wxPyHtmlTagHandler, wxHtmlTagHandler);
+
IMP_PYCALLBACK_STRING__pure(wxPyHtmlTagHandler, wxHtmlTagHandler, GetSupportedTags);
IMP_PYCALLBACK_BOOL_TAG_pure(wxPyHtmlTagHandler, wxHtmlTagHandler, HandleTag);
%}
-%name(wxHtmlTagHandler) class wxPyHtmlTagHandler {
+%name(wxHtmlTagHandler) class wxPyHtmlTagHandler : public wxObject {
public:
wxPyHtmlTagHandler();
%{
class wxPyHtmlWinTagHandler : public wxHtmlWinTagHandler {
+ DECLARE_DYNAMIC_CLASS(wxPyHtmlWinTagHandler);
public:
wxPyHtmlWinTagHandler() : wxHtmlWinTagHandler() {};
PYPRIVATE;
};
+IMPLEMENT_DYNAMIC_CLASS( wxPyHtmlWinTagHandler, wxHtmlWinTagHandler);
+
IMP_PYCALLBACK_STRING__pure(wxPyHtmlWinTagHandler, wxHtmlWinTagHandler, GetSupportedTags);
IMP_PYCALLBACK_BOOL_TAG_pure(wxPyHtmlWinTagHandler, wxHtmlWinTagHandler, HandleTag);
%}
}
void OnExit() {
- bool doSave = wxPyRestoreThread();
+ wxPyTState* state = wxPyBeginBlockThreads();
Py_DECREF(m_tagHandlerClass);
m_tagHandlerClass = NULL;
for (size_t x=0; x < m_objArray.GetCount(); x++) {
PyObject* obj = (PyObject*)m_objArray.Item(x);
Py_DECREF(obj);
}
- wxPySaveThread(doSave);
+ wxPyEndBlockThreads(state);
};
void FillHandlersTable(wxHtmlWinParser *parser) {
// Wave our magic wand... (if it works it's a miracle! ;-)
// First, make a new instance of the tag handler
- bool doSave = wxPyRestoreThread();
+ wxPyTState* state = wxPyBeginBlockThreads();
PyObject* arg = Py_BuildValue("()");
PyObject* obj = PyInstance_New(m_tagHandlerClass, arg, NULL);
Py_DECREF(arg);
- wxPySaveThread(doSave);
+ wxPyEndBlockThreads(state);
// now figure out where it's C++ object is...
wxPyHtmlWinTagHandler* thPtr;
//---------------------------------------------------------------------------
//---------------------------------------------------------------------------
-class wxHtmlCell {
+class wxHtmlCell : public wxObject {
public:
wxHtmlCell();
};
+class wxHtmlWordCell : public wxHtmlCell
+{
+public:
+ wxHtmlWordCell(const wxString& word, wxDC& dc);
+};
+
+
class wxHtmlContainerCell : public wxHtmlCell {
public:
wxHtmlContainerCell(wxHtmlContainerCell *parent);
};
+class wxHtmlFontCell : public wxHtmlCell
+{
+public:
+ wxHtmlFontCell(wxFont *font);
+};
+
class wxHtmlWidgetCell : public wxHtmlCell {
public:
%{
class wxPyHtmlWindow : public wxHtmlWindow {
+ DECLARE_ABSTRACT_CLASS(wxPyHtmlWindow);
public:
wxPyHtmlWindow(wxWindow *parent, wxWindowID id = -1,
const wxPoint& pos = wxDefaultPosition,
PYPRIVATE;
};
-
+IMPLEMENT_ABSTRACT_CLASS( wxPyHtmlWindow, wxHtmlWindow );
IMP_PYCALLBACK__STRING(wxPyHtmlWindow, wxHtmlWindow, OnSetTitle);
- void wxPyHtmlWindow::OnLinkClicked(const wxHtmlLinkInfo& link) {
- bool doSave = wxPyRestoreThread();
- if (wxPyCBH_findCallback(m_myInst, "OnLinkClicked")) {
+void wxPyHtmlWindow::OnLinkClicked(const wxHtmlLinkInfo& link) {
+ bool found;
+ wxPyTState* state = wxPyBeginBlockThreads();
+ if ((found = wxPyCBH_findCallback(m_myInst, "OnLinkClicked)"))) {
PyObject* obj = wxPyConstructObject((void*)&link, "wxHtmlLinkInfo", 0);
wxPyCBH_callCallback(m_myInst, Py_BuildValue("(O)", obj));
Py_DECREF(obj);
}
- else
+ wxPyEndBlockThreads(state);
+ if (! found)
wxHtmlWindow::OnLinkClicked(link);
- wxPySaveThread(doSave);
}
void wxPyHtmlWindow::base_OnLinkClicked(const wxHtmlLinkInfo& link) {
wxHtmlWindow::OnLinkClicked(link);
//---------------------------------------------------------------------------
-class wxHtmlDCRenderer {
+class wxHtmlDCRenderer : public wxObject {
public:
wxHtmlDCRenderer();
~wxHtmlDCRenderer();
-class wxHtmlEasyPrinting {
+class wxHtmlEasyPrinting : public wxObject {
public:
wxHtmlEasyPrinting(const char* name = "Printing",
wxFrame *parent_frame = NULL);
wxClassInfo::CleanUpClasses();
wxClassInfo::InitializeClasses();
+
+ wxPyPtrTypeMap_Add("wxHtmlTagHandler", "wxPyHtmlTagHandler");
+ wxPyPtrTypeMap_Add("wxHtmlWinTagHandler", "wxPyHtmlWinTagHandler");
+ wxPyPtrTypeMap_Add("wxHtmlWindow", "wxPyHtmlWindow");
%}
//----------------------------------------------------------------------