1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxHtmlWindow class for parsing & displaying HTML (implementation)
4 // Author: Vaclav Slavik
6 // Copyright: (c) 1999 Vaclav Slavik
7 // Licence: wxWindows Licence
8 /////////////////////////////////////////////////////////////////////////////
12 #pragma implementation "htmlwin.h"
13 #pragma implementation "htmlproc.h"
16 #include "wx/wxprec.h"
19 #if wxUSE_HTML && wxUSE_STREAMS
28 #include "wx/dcclient.h"
32 #include "wx/html/htmlwin.h"
33 #include "wx/html/htmlproc.h"
36 #include "wx/arrimpl.cpp"
37 #include "wx/listimpl.cpp"
39 //-----------------------------------------------------------------------------
41 //-----------------------------------------------------------------------------
43 // item of history list
44 class WXDLLEXPORT wxHtmlHistoryItem
47 wxHtmlHistoryItem(const wxString
& p
, const wxString
& a
) {m_Page
= p
, m_Anchor
= a
, m_Pos
= 0;}
48 int GetPos() const {return m_Pos
;}
49 void SetPos(int p
) {m_Pos
= p
;}
50 const wxString
& GetPage() const {return m_Page
;}
51 const wxString
& GetAnchor() const {return m_Anchor
;}
60 //-----------------------------------------------------------------------------
61 // our private arrays:
62 //-----------------------------------------------------------------------------
64 WX_DECLARE_OBJARRAY(wxHtmlHistoryItem
, wxHtmlHistoryArray
);
65 WX_DEFINE_OBJARRAY(wxHtmlHistoryArray
);
67 WX_DECLARE_LIST(wxHtmlProcessor
, wxHtmlProcessorList
);
68 WX_DEFINE_LIST(wxHtmlProcessorList
);
70 //-----------------------------------------------------------------------------
72 //-----------------------------------------------------------------------------
75 void wxHtmlWindow::Init()
77 m_tmpMouseMoved
= FALSE
;
80 m_tmpCanDrawLocks
= 0;
81 m_FS
= new wxFileSystem();
82 m_RelatedStatusBar
= -1;
83 m_RelatedFrame
= NULL
;
84 m_TitleFormat
= wxT("%s");
85 m_OpenedPage
= m_OpenedAnchor
= m_OpenedPageTitle
= wxEmptyString
;
87 m_Parser
= new wxHtmlWinParser(this);
88 m_Parser
->SetFS(m_FS
);
91 m_History
= new wxHtmlHistoryArray
;
96 m_makingSelection
= false;
99 bool wxHtmlWindow::Create(wxWindow
*parent
, wxWindowID id
,
100 const wxPoint
& pos
, const wxSize
& size
,
101 long style
, const wxString
& name
)
103 if (!wxScrolledWindow::Create(parent
, id
, pos
, size
,
104 style
| wxVSCROLL
| wxHSCROLL
, name
))
108 SetPage(wxT("<html><body></body></html>"));
113 wxHtmlWindow::~wxHtmlWindow()
117 if (m_Cell
) delete m_Cell
;
127 void wxHtmlWindow::SetRelatedFrame(wxFrame
* frame
, const wxString
& format
)
129 m_RelatedFrame
= frame
;
130 m_TitleFormat
= format
;
135 void wxHtmlWindow::SetRelatedStatusBar(int bar
)
137 m_RelatedStatusBar
= bar
;
142 void wxHtmlWindow::SetFonts(wxString normal_face
, wxString fixed_face
, const int *sizes
)
144 wxString op
= m_OpenedPage
;
146 m_Parser
->SetFonts(normal_face
, fixed_face
, sizes
);
147 // fonts changed => contents invalid, so reload the page:
148 SetPage(wxT("<html><body></body></html>"));
149 if (!op
.IsEmpty()) LoadPage(op
);
154 bool wxHtmlWindow::SetPage(const wxString
& source
)
156 wxString
newsrc(source
);
158 wxDELETE(m_selection
);
160 // pass HTML through registered processors:
161 if (m_Processors
|| m_GlobalProcessors
)
163 wxHtmlProcessorList::Node
*nodeL
, *nodeG
;
166 nodeL
= (m_Processors
) ? m_Processors
->GetFirst() : NULL
;
167 nodeG
= (m_GlobalProcessors
) ? m_GlobalProcessors
->GetFirst() : NULL
;
169 // VS: there are two lists, global and local, both of them sorted by
170 // priority. Since we have to go through _both_ lists with
171 // decreasing priority, we "merge-sort" the lists on-line by
172 // processing that one of the two heads that has higher priority
173 // in every iteration
174 while (nodeL
|| nodeG
)
176 prL
= (nodeL
) ? nodeL
->GetData()->GetPriority() : -1;
177 prG
= (nodeG
) ? nodeG
->GetData()->GetPriority() : -1;
180 if (nodeL
->GetData()->IsEnabled())
181 newsrc
= nodeL
->GetData()->Process(newsrc
);
182 nodeL
= nodeL
->GetNext();
186 if (nodeG
->GetData()->IsEnabled())
187 newsrc
= nodeG
->GetData()->Process(newsrc
);
188 nodeG
= nodeG
->GetNext();
193 // ...and run the parser on it:
194 wxClientDC
*dc
= new wxClientDC(this);
195 dc
->SetMapMode(wxMM_TEXT
);
196 SetBackgroundColour(wxColour(0xFF, 0xFF, 0xFF));
197 m_OpenedPage
= m_OpenedAnchor
= m_OpenedPageTitle
= wxEmptyString
;
204 m_Cell
= (wxHtmlContainerCell
*) m_Parser
->Parse(newsrc
);
206 m_Cell
->SetIndent(m_Borders
, wxHTML_INDENT_ALL
, wxHTML_UNITS_PIXELS
);
207 m_Cell
->SetAlignHor(wxHTML_ALIGN_CENTER
);
209 if (m_tmpCanDrawLocks
== 0)
214 bool wxHtmlWindow::AppendToPage(const wxString
& source
)
216 return SetPage(*(GetParser()->GetSource()) + source
);
219 bool wxHtmlWindow::LoadPage(const wxString
& location
)
221 wxBusyCursor busyCursor
;
225 bool needs_refresh
= FALSE
;
228 if (m_HistoryOn
&& (m_HistoryPos
!= -1))
230 // store scroll position into history item:
232 GetViewStart(&x
, &y
);
233 (*m_History
)[m_HistoryPos
].SetPos(y
);
236 if (location
[0] == wxT('#'))
239 wxString anch
= location
.Mid(1) /*1 to end*/;
241 rt_val
= ScrollToAnchor(anch
);
244 else if (location
.Find(wxT('#')) != wxNOT_FOUND
&& location
.BeforeFirst(wxT('#')) == m_OpenedPage
)
246 wxString anch
= location
.AfterFirst(wxT('#'));
248 rt_val
= ScrollToAnchor(anch
);
251 else if (location
.Find(wxT('#')) != wxNOT_FOUND
&&
252 (m_FS
->GetPath() + location
.BeforeFirst(wxT('#'))) == m_OpenedPage
)
254 wxString anch
= location
.AfterFirst(wxT('#'));
256 rt_val
= ScrollToAnchor(anch
);
262 needs_refresh
= TRUE
;
264 if (m_RelatedStatusBar
!= -1)
266 m_RelatedFrame
->SetStatusText(_("Connecting..."), m_RelatedStatusBar
);
270 f
= m_Parser
->OpenURL(wxHTML_URL_PAGE
, location
);
272 // try to interpret 'location' as filename instead of URL:
275 wxFileName
fn(location
);
276 wxString location2
= wxFileSystem::FileNameToURL(fn
);
277 f
= m_Parser
->OpenURL(wxHTML_URL_PAGE
, location2
);
282 wxLogError(_("Unable to open requested HTML document: %s"), location
.c_str());
290 wxString src
= wxEmptyString
;
292 if (m_RelatedStatusBar
!= -1)
294 wxString msg
= _("Loading : ") + location
;
295 m_RelatedFrame
->SetStatusText(msg
, m_RelatedStatusBar
);
299 node
= m_Filters
.GetFirst();
302 wxHtmlFilter
*h
= (wxHtmlFilter
*) node
->GetData();
305 src
= h
->ReadFile(*f
);
308 node
= node
->GetNext();
310 if (src
== wxEmptyString
)
312 if (m_DefaultFilter
== NULL
) m_DefaultFilter
= GetDefaultFilter();
313 src
= m_DefaultFilter
->ReadFile(*f
);
316 m_FS
->ChangePathTo(f
->GetLocation());
317 rt_val
= SetPage(src
);
318 m_OpenedPage
= f
->GetLocation();
319 if (f
->GetAnchor() != wxEmptyString
)
321 ScrollToAnchor(f
->GetAnchor());
326 if (m_RelatedStatusBar
!= -1) m_RelatedFrame
->SetStatusText(_("Done"), m_RelatedStatusBar
);
330 if (m_HistoryOn
) // add this page to history there:
332 int c
= m_History
->GetCount() - (m_HistoryPos
+ 1);
334 if (m_HistoryPos
< 0 ||
335 (*m_History
)[m_HistoryPos
].GetPage() != m_OpenedPage
||
336 (*m_History
)[m_HistoryPos
].GetAnchor() != m_OpenedAnchor
)
339 for (int i
= 0; i
< c
; i
++)
340 m_History
->RemoveAt(m_HistoryPos
);
341 m_History
->Add(new wxHtmlHistoryItem(m_OpenedPage
, m_OpenedAnchor
));
345 if (m_OpenedPageTitle
== wxEmptyString
)
346 OnSetTitle(wxFileNameFromPath(m_OpenedPage
));
360 bool wxHtmlWindow::LoadFile(const wxFileName
& filename
)
362 wxString url
= wxFileSystem::FileNameToURL(filename
);
363 return LoadPage(url
);
367 bool wxHtmlWindow::ScrollToAnchor(const wxString
& anchor
)
369 const wxHtmlCell
*c
= m_Cell
->Find(wxHTML_COND_ISANCHOR
, &anchor
);
372 wxLogWarning(_("HTML anchor %s does not exist."), anchor
.c_str());
379 for (y
= 0; c
!= NULL
; c
= c
->GetParent()) y
+= c
->GetPosY();
380 Scroll(-1, y
/ wxHTML_SCROLL_STEP
);
381 m_OpenedAnchor
= anchor
;
387 void wxHtmlWindow::OnSetTitle(const wxString
& title
)
392 tit
.Printf(m_TitleFormat
, title
.c_str());
393 m_RelatedFrame
->SetTitle(tit
);
395 m_OpenedPageTitle
= title
;
402 void wxHtmlWindow::CreateLayout()
404 int ClientWidth
, ClientHeight
;
408 if (m_Style
& wxHW_SCROLLBAR_NEVER
)
410 SetScrollbars(wxHTML_SCROLL_STEP
, 1, m_Cell
->GetWidth() / wxHTML_SCROLL_STEP
, 0); // always off
411 GetClientSize(&ClientWidth
, &ClientHeight
);
412 m_Cell
->Layout(ClientWidth
);
416 GetClientSize(&ClientWidth
, &ClientHeight
);
417 m_Cell
->Layout(ClientWidth
);
418 if (ClientHeight
< m_Cell
->GetHeight() + GetCharHeight())
421 wxHTML_SCROLL_STEP
, wxHTML_SCROLL_STEP
,
422 m_Cell
->GetWidth() / wxHTML_SCROLL_STEP
,
423 (m_Cell
->GetHeight() + GetCharHeight()) / wxHTML_SCROLL_STEP
424 /*cheat: top-level frag is always container*/);
426 else /* we fit into window, no need for scrollbars */
428 SetScrollbars(wxHTML_SCROLL_STEP
, 1, m_Cell
->GetWidth() / wxHTML_SCROLL_STEP
, 0); // disable...
429 GetClientSize(&ClientWidth
, &ClientHeight
);
430 m_Cell
->Layout(ClientWidth
); // ...and relayout
437 void wxHtmlWindow::ReadCustomization(wxConfigBase
*cfg
, wxString path
)
442 wxString p_fff
, p_ffn
;
444 if (path
!= wxEmptyString
)
446 oldpath
= cfg
->GetPath();
450 m_Borders
= cfg
->Read(wxT("wxHtmlWindow/Borders"), m_Borders
);
451 p_fff
= cfg
->Read(wxT("wxHtmlWindow/FontFaceFixed"), m_Parser
->m_FontFaceFixed
);
452 p_ffn
= cfg
->Read(wxT("wxHtmlWindow/FontFaceNormal"), m_Parser
->m_FontFaceNormal
);
453 for (int i
= 0; i
< 7; i
++)
455 tmp
.Printf(wxT("wxHtmlWindow/FontsSize%i"), i
);
456 p_fontsizes
[i
] = cfg
->Read(tmp
, m_Parser
->m_FontsSizes
[i
]);
458 SetFonts(p_ffn
, p_fff
, p_fontsizes
);
460 if (path
!= wxEmptyString
)
461 cfg
->SetPath(oldpath
);
466 void wxHtmlWindow::WriteCustomization(wxConfigBase
*cfg
, wxString path
)
471 if (path
!= wxEmptyString
)
473 oldpath
= cfg
->GetPath();
477 cfg
->Write(wxT("wxHtmlWindow/Borders"), (long) m_Borders
);
478 cfg
->Write(wxT("wxHtmlWindow/FontFaceFixed"), m_Parser
->m_FontFaceFixed
);
479 cfg
->Write(wxT("wxHtmlWindow/FontFaceNormal"), m_Parser
->m_FontFaceNormal
);
480 for (int i
= 0; i
< 7; i
++)
482 tmp
.Printf(wxT("wxHtmlWindow/FontsSize%i"), i
);
483 cfg
->Write(tmp
, (long) m_Parser
->m_FontsSizes
[i
]);
486 if (path
!= wxEmptyString
)
487 cfg
->SetPath(oldpath
);
492 bool wxHtmlWindow::HistoryBack()
496 if (m_HistoryPos
< 1) return FALSE
;
498 // store scroll position into history item:
500 GetViewStart(&x
, &y
);
501 (*m_History
)[m_HistoryPos
].SetPos(y
);
503 // go to previous position:
506 l
= (*m_History
)[m_HistoryPos
].GetPage();
507 a
= (*m_History
)[m_HistoryPos
].GetAnchor();
510 if (a
== wxEmptyString
) LoadPage(l
);
511 else LoadPage(l
+ wxT("#") + a
);
514 Scroll(0, (*m_History
)[m_HistoryPos
].GetPos());
519 bool wxHtmlWindow::HistoryCanBack()
521 if (m_HistoryPos
< 1) return FALSE
;
526 bool wxHtmlWindow::HistoryForward()
530 if (m_HistoryPos
== -1) return FALSE
;
531 if (m_HistoryPos
>= (int)m_History
->GetCount() - 1)return FALSE
;
533 m_OpenedPage
= wxEmptyString
; // this will disable adding new entry into history in LoadPage()
536 l
= (*m_History
)[m_HistoryPos
].GetPage();
537 a
= (*m_History
)[m_HistoryPos
].GetAnchor();
540 if (a
== wxEmptyString
) LoadPage(l
);
541 else LoadPage(l
+ wxT("#") + a
);
544 Scroll(0, (*m_History
)[m_HistoryPos
].GetPos());
549 bool wxHtmlWindow::HistoryCanForward()
551 if (m_HistoryPos
== -1) return FALSE
;
552 if (m_HistoryPos
>= (int)m_History
->GetCount() - 1)return FALSE
;
557 void wxHtmlWindow::HistoryClear()
563 void wxHtmlWindow::AddProcessor(wxHtmlProcessor
*processor
)
567 m_Processors
= new wxHtmlProcessorList
;
568 m_Processors
->DeleteContents(TRUE
);
570 wxHtmlProcessorList::Node
*node
;
572 for (node
= m_Processors
->GetFirst(); node
; node
= node
->GetNext())
574 if (processor
->GetPriority() > node
->GetData()->GetPriority())
576 m_Processors
->Insert(node
, processor
);
580 m_Processors
->Append(processor
);
583 /*static */ void wxHtmlWindow::AddGlobalProcessor(wxHtmlProcessor
*processor
)
585 if (!m_GlobalProcessors
)
587 m_GlobalProcessors
= new wxHtmlProcessorList
;
588 m_GlobalProcessors
->DeleteContents(TRUE
);
590 wxHtmlProcessorList::Node
*node
;
592 for (node
= m_GlobalProcessors
->GetFirst(); node
; node
= node
->GetNext())
594 if (processor
->GetPriority() > node
->GetData()->GetPriority())
596 m_GlobalProcessors
->Insert(node
, processor
);
600 m_GlobalProcessors
->Append(processor
);
605 wxList
wxHtmlWindow::m_Filters
;
606 wxHtmlFilter
*wxHtmlWindow::m_DefaultFilter
= NULL
;
607 wxCursor
*wxHtmlWindow::s_cur_hand
= NULL
;
608 wxCursor
*wxHtmlWindow::s_cur_arrow
= NULL
;
609 wxHtmlProcessorList
*wxHtmlWindow::m_GlobalProcessors
= NULL
;
611 void wxHtmlWindow::CleanUpStatics()
613 wxDELETE(m_DefaultFilter
);
614 m_Filters
.DeleteContents(TRUE
);
616 wxDELETE(m_GlobalProcessors
);
617 wxDELETE(s_cur_hand
);
618 wxDELETE(s_cur_arrow
);
623 void wxHtmlWindow::AddFilter(wxHtmlFilter
*filter
)
625 m_Filters
.Append(filter
);
629 bool wxHtmlWindow::IsSelectionEnabled() const
632 return !(m_Style
& wxHW_NO_SELECTION
);
639 void wxHtmlWindow::OnLinkClicked(const wxHtmlLinkInfo
& link
)
641 const wxMouseEvent
*e
= link
.GetEvent();
642 if (e
== NULL
|| e
->LeftUp())
643 LoadPage(link
.GetHref());
646 void wxHtmlWindow::OnCellClicked(wxHtmlCell
*cell
,
647 wxCoord x
, wxCoord y
,
648 const wxMouseEvent
& event
)
650 wxCHECK_RET( cell
, _T("can't be called with NULL cell") );
652 cell
->OnMouseClick(this, x
, y
, event
);
655 void wxHtmlWindow::OnCellMouseHover(wxHtmlCell
* WXUNUSED(cell
),
656 wxCoord
WXUNUSED(x
), wxCoord
WXUNUSED(y
))
661 void wxHtmlWindow::OnDraw(wxDC
& dc
)
663 if (m_tmpCanDrawLocks
> 0 || m_Cell
== NULL
) return;
666 wxRect rect
= GetUpdateRegion().GetBox();
668 dc
.SetMapMode(wxMM_TEXT
);
669 dc
.SetBackgroundMode(wxTRANSPARENT
);
670 GetViewStart(&x
, &y
);
672 wxHtmlRenderingState
rstate(m_selection
);
673 m_Cell
->Draw(dc
, 0, 0,
674 y
* wxHTML_SCROLL_STEP
+ rect
.GetTop(),
675 y
* wxHTML_SCROLL_STEP
+ rect
.GetBottom(),
682 void wxHtmlWindow::OnSize(wxSizeEvent
& event
)
684 wxScrolledWindow::OnSize(event
);
690 void wxHtmlWindow::OnMouseMove(wxMouseEvent
& event
)
692 m_tmpMouseMoved
= true;
695 void wxHtmlWindow::OnMouseDown(wxMouseEvent
& event
)
697 if ( event
.LeftDown() && IsSelectionEnabled() )
699 m_makingSelection
= true;
703 wxDELETE(m_selection
);
706 m_tmpSelFromPos
= CalcUnscrolledPosition(event
.GetPosition());
707 m_tmpSelFromCell
= NULL
;
713 void wxHtmlWindow::OnMouseUp(wxMouseEvent
& event
)
715 if ( m_makingSelection
)
718 m_makingSelection
= false;
720 // did the user move the mouse far enough from starting point?
723 // we don't want mouse up event that ended selecting to be
724 // handled as mouse click and e.g. follow hyperlink:
732 wxPoint pos
= CalcUnscrolledPosition(event
.GetPosition());
733 wxHtmlCell
*cell
= m_Cell
->FindCellByPos(pos
.x
, pos
.y
);
735 // VZ: is it possible that we don't find anything at all?
736 // VS: yes. FindCellByPos returns terminal cell and
737 // containers may have empty borders
739 OnCellClicked(cell
, pos
.x
, pos
.y
, event
);
745 void wxHtmlWindow::OnIdle(wxIdleEvent
& WXUNUSED(event
))
747 if (s_cur_hand
== NULL
)
749 s_cur_hand
= new wxCursor(wxCURSOR_HAND
);
750 s_cur_arrow
= new wxCursor(wxCURSOR_ARROW
);
753 if (m_tmpMouseMoved
&& (m_Cell
!= NULL
))
756 wxGetMousePosition(&xc
, &yc
);
757 ScreenToClient(&xc
, &yc
);
758 CalcUnscrolledPosition(xc
, yc
, &x
, &y
);
760 wxHtmlCell
*cell
= m_Cell
->FindCellByPos(x
, y
);
762 // handle selection update:
763 if ( m_makingSelection
)
765 bool goingDown
= m_tmpSelFromPos
.y
< y
||
766 m_tmpSelFromPos
.y
== y
&& m_tmpSelFromPos
.x
< x
;
768 if ( !m_tmpSelFromCell
)
772 m_tmpSelFromCell
= m_Cell
->FindCellByPos(x
, y
,
773 wxHTML_FIND_NEAREST_BEFORE
);
774 #if 0 // FIXME -- needed or not?
775 if (!m_tmpSelFromCell
)
776 m_tmpSelFromCell
= m_Cell
->GetFirstTerminal();
781 m_tmpSelFromCell
= m_Cell
->FindCellByPos(x
, y
,
782 wxHTML_FIND_NEAREST_AFTER
);
783 if (!m_tmpSelFromCell
)
784 m_tmpSelFromCell
= m_Cell
->GetLastTerminal();
788 wxHtmlCell
*selcell
= cell
;
793 selcell
= m_Cell
->FindCellByPos(x
, y
,
794 wxHTML_FIND_NEAREST_AFTER
);
796 selcell
= m_Cell
->GetLastTerminal();
800 selcell
= m_Cell
->FindCellByPos(x
, y
,
801 wxHTML_FIND_NEAREST_BEFORE
);
803 selcell
= m_Cell
->GetFirstTerminal();
807 // NB: it may *rarely* happen that the code above didn't find one
808 // of the cells, e.g. if wxHtmlWindow doesn't contain any
810 if ( selcell
&& m_tmpSelFromCell
)
814 // start selecting only if mouse movement was big enough
815 // (otherwise it was meant as mouse click, not selection):
816 const int PRECISION
= 2;
817 wxPoint diff
= m_tmpSelFromPos
- wxPoint(x
,y
);
818 if (abs(diff
.x
) > PRECISION
|| abs(diff
.y
) > PRECISION
)
820 m_selection
= new wxHtmlSelection();
827 m_selection
->Set(m_tmpSelFromPos
, m_tmpSelFromCell
,
828 wxPoint(x
,y
), selcell
);
832 m_selection
->Set(wxPoint(x
,y
), selcell
,
833 m_tmpSelFromPos
, m_tmpSelFromCell
);
835 Refresh(); // FIXME - optimize!
840 // handle cursor and status bar text changes:
841 if ( cell
!= m_tmpLastCell
)
843 wxHtmlLinkInfo
*lnk
= cell
? cell
->GetLink(x
, y
) : NULL
;
845 if (lnk
!= m_tmpLastLink
)
849 SetCursor(*s_cur_arrow
);
850 if (m_RelatedStatusBar
!= -1)
851 m_RelatedFrame
->SetStatusText(wxEmptyString
, m_RelatedStatusBar
);
855 SetCursor(*s_cur_hand
);
856 if (m_RelatedStatusBar
!= -1)
857 m_RelatedFrame
->SetStatusText(lnk
->GetHref(), m_RelatedStatusBar
);
862 m_tmpLastCell
= cell
;
864 else // mouse moved but stayed in the same cell
867 OnCellMouseHover(cell
, x
, y
);
870 m_tmpMouseMoved
= FALSE
;
875 IMPLEMENT_ABSTRACT_CLASS(wxHtmlProcessor
,wxObject
)
877 IMPLEMENT_DYNAMIC_CLASS(wxHtmlWindow
,wxScrolledWindow
)
879 BEGIN_EVENT_TABLE(wxHtmlWindow
, wxScrolledWindow
)
880 EVT_SIZE(wxHtmlWindow::OnSize
)
881 EVT_LEFT_DOWN(wxHtmlWindow::OnMouseDown
)
882 EVT_LEFT_UP(wxHtmlWindow::OnMouseUp
)
883 EVT_RIGHT_UP(wxHtmlWindow::OnMouseUp
)
884 EVT_MOTION(wxHtmlWindow::OnMouseMove
)
885 EVT_IDLE(wxHtmlWindow::OnIdle
)
892 // A module to allow initialization/cleanup
893 // without calling these functions from app.cpp or from
894 // the user's application.
896 class wxHtmlWinModule
: public wxModule
898 DECLARE_DYNAMIC_CLASS(wxHtmlWinModule
)
900 wxHtmlWinModule() : wxModule() {}
901 bool OnInit() { return TRUE
; }
902 void OnExit() { wxHtmlWindow::CleanUpStatics(); }
905 IMPLEMENT_DYNAMIC_CLASS(wxHtmlWinModule
, wxModule
)
908 // This hack forces the linker to always link in m_* files
909 // (wxHTML doesn't work without handlers from these files)
910 #include "wx/html/forcelnk.h"
911 FORCE_WXHTML_MODULES()