1 /////////////////////////////////////////////////////////////////////////////
2 // Name: src/html/htmlwin.cpp
3 // Purpose: wxHtmlWindow class for parsing & displaying HTML (implementation)
4 // Author: Vaclav Slavik
6 // Copyright: (c) 1999 Vaclav Slavik
7 // Licence: wxWindows licence
8 /////////////////////////////////////////////////////////////////////////////
10 #include "wx/wxprec.h"
16 #if wxUSE_HTML && wxUSE_STREAMS
22 #include "wx/dcclient.h"
24 #include "wx/dcmemory.h"
26 #include "wx/settings.h"
27 #include "wx/dataobj.h"
28 #include "wx/statusbr.h"
31 #include "wx/html/htmlwin.h"
32 #include "wx/html/htmlproc.h"
33 #include "wx/clipbrd.h"
35 #include "wx/arrimpl.cpp"
36 #include "wx/listimpl.cpp"
39 IMPLEMENT_DYNAMIC_CLASS(wxHtmlLinkEvent
, wxCommandEvent
)
40 IMPLEMENT_DYNAMIC_CLASS(wxHtmlCellEvent
, wxCommandEvent
)
42 DEFINE_EVENT_TYPE(wxEVT_COMMAND_HTML_CELL_CLICKED
)
43 DEFINE_EVENT_TYPE(wxEVT_COMMAND_HTML_CELL_HOVER
)
44 DEFINE_EVENT_TYPE(wxEVT_COMMAND_HTML_LINK_CLICKED
)
48 // ----------------------------------------------------------------------------
49 // wxHtmlWinAutoScrollTimer: the timer used to generate a stream of scroll
50 // events when a captured mouse is held outside the window
51 // ----------------------------------------------------------------------------
53 class wxHtmlWinAutoScrollTimer
: public wxTimer
56 wxHtmlWinAutoScrollTimer(wxScrolledWindow
*win
,
57 wxEventType eventTypeToSend
,
61 m_eventType
= eventTypeToSend
;
66 virtual void Notify();
69 wxScrolledWindow
*m_win
;
70 wxEventType m_eventType
;
74 DECLARE_NO_COPY_CLASS(wxHtmlWinAutoScrollTimer
)
77 void wxHtmlWinAutoScrollTimer::Notify()
79 // only do all this as long as the window is capturing the mouse
80 if ( wxWindow::GetCapture() != m_win
)
84 else // we still capture the mouse, continue generating events
86 // first scroll the window if we are allowed to do it
87 wxScrollWinEvent
event1(m_eventType
, m_pos
, m_orient
);
88 event1
.SetEventObject(m_win
);
89 if ( m_win
->GetEventHandler()->ProcessEvent(event1
) )
91 // and then send a pseudo mouse-move event to refresh the selection
92 wxMouseEvent
event2(wxEVT_MOTION
);
93 wxGetMousePosition(&event2
.m_x
, &event2
.m_y
);
95 // the mouse event coordinates should be client, not screen as
96 // returned by wxGetMousePosition
97 wxWindow
*parentTop
= m_win
;
98 while ( parentTop
->GetParent() )
99 parentTop
= parentTop
->GetParent();
100 wxPoint ptOrig
= parentTop
->GetPosition();
101 event2
.m_x
-= ptOrig
.x
;
102 event2
.m_y
-= ptOrig
.y
;
104 event2
.SetEventObject(m_win
);
106 // FIXME: we don't fill in the other members - ok?
107 m_win
->GetEventHandler()->ProcessEvent(event2
);
109 else // can't scroll further, stop
116 #endif // wxUSE_CLIPBOARD
120 //-----------------------------------------------------------------------------
122 //-----------------------------------------------------------------------------
124 // item of history list
125 class WXDLLIMPEXP_HTML wxHtmlHistoryItem
128 wxHtmlHistoryItem(const wxString
& p
, const wxString
& a
) {m_Page
= p
, m_Anchor
= a
, m_Pos
= 0;}
129 int GetPos() const {return m_Pos
;}
130 void SetPos(int p
) {m_Pos
= p
;}
131 const wxString
& GetPage() const {return m_Page
;}
132 const wxString
& GetAnchor() const {return m_Anchor
;}
141 //-----------------------------------------------------------------------------
142 // our private arrays:
143 //-----------------------------------------------------------------------------
145 WX_DECLARE_OBJARRAY(wxHtmlHistoryItem
, wxHtmlHistoryArray
);
146 WX_DEFINE_OBJARRAY(wxHtmlHistoryArray
)
148 WX_DECLARE_LIST(wxHtmlProcessor
, wxHtmlProcessorList
);
149 WX_DEFINE_LIST(wxHtmlProcessorList
)
151 //-----------------------------------------------------------------------------
152 // wxHtmlWindowMouseHelper
153 //-----------------------------------------------------------------------------
155 wxHtmlWindowMouseHelper::wxHtmlWindowMouseHelper(wxHtmlWindowInterface
*iface
)
156 : m_tmpMouseMoved(false),
163 void wxHtmlWindowMouseHelper::HandleMouseMoved()
165 m_tmpMouseMoved
= true;
168 bool wxHtmlWindowMouseHelper::HandleMouseClick(wxHtmlCell
*rootCell
,
170 const wxMouseEvent
& event
)
175 wxHtmlCell
*cell
= rootCell
->FindCellByPos(pos
.x
, pos
.y
);
176 // this check is needed because FindCellByPos returns terminal cell and
177 // containers may have empty borders -- in this case NULL will be
182 // adjust the coordinates to be relative to this cell:
183 wxPoint relpos
= pos
- cell
->GetAbsPos(rootCell
);
185 return OnCellClicked(cell
, relpos
.x
, relpos
.y
, event
);
188 void wxHtmlWindowMouseHelper::HandleIdle(wxHtmlCell
*rootCell
,
191 wxHtmlCell
*cell
= rootCell
? rootCell
->FindCellByPos(pos
.x
, pos
.y
) : NULL
;
193 if (cell
!= m_tmpLastCell
)
195 wxHtmlLinkInfo
*lnk
= NULL
;
198 // adjust the coordinates to be relative to this cell:
199 wxPoint relpos
= pos
- cell
->GetAbsPos(rootCell
);
200 lnk
= cell
->GetLink(relpos
.x
, relpos
.y
);
205 cur
= cell
->GetMouseCursor(m_interface
);
207 cur
= m_interface
->GetHTMLCursor(
208 wxHtmlWindowInterface::HTMLCursor_Default
);
210 m_interface
->GetHTMLWindow()->SetCursor(cur
);
212 if (lnk
!= m_tmpLastLink
)
215 m_interface
->SetHTMLStatusText(lnk
->GetHref());
217 m_interface
->SetHTMLStatusText(wxEmptyString
);
222 m_tmpLastCell
= cell
;
224 else // mouse moved but stayed in the same cell
228 OnCellMouseHover(cell
, pos
.x
, pos
.y
);
232 m_tmpMouseMoved
= false;
235 bool wxHtmlWindowMouseHelper::OnCellClicked(wxHtmlCell
*cell
,
236 wxCoord x
, wxCoord y
,
237 const wxMouseEvent
& event
)
239 wxHtmlCellEvent
ev(wxEVT_COMMAND_HTML_CELL_CLICKED
,
240 m_interface
->GetHTMLWindow()->GetId(),
241 cell
, wxPoint(x
,y
), event
);
243 if (!m_interface
->GetHTMLWindow()->GetEventHandler()->ProcessEvent(ev
))
245 // if the event wasn't handled, do the default processing here:
247 wxASSERT_MSG( cell
, _T("can't be called with NULL cell") );
249 cell
->ProcessMouseClick(m_interface
, ev
.GetPoint(), ev
.GetMouseEvent());
252 // true if a link was clicked, false otherwise
253 return ev
.GetLinkClicked();
256 void wxHtmlWindowMouseHelper::OnCellMouseHover(wxHtmlCell
* cell
,
260 wxHtmlCellEvent
ev(wxEVT_COMMAND_HTML_CELL_HOVER
,
261 m_interface
->GetHTMLWindow()->GetId(),
262 cell
, wxPoint(x
,y
), wxMouseEvent());
263 m_interface
->GetHTMLWindow()->GetEventHandler()->ProcessEvent(ev
);
269 //-----------------------------------------------------------------------------
271 //-----------------------------------------------------------------------------
273 wxList
wxHtmlWindow::m_Filters
;
274 wxHtmlFilter
*wxHtmlWindow::m_DefaultFilter
= NULL
;
275 wxHtmlProcessorList
*wxHtmlWindow::m_GlobalProcessors
= NULL
;
276 wxCursor
*wxHtmlWindow::ms_cursorLink
= NULL
;
277 wxCursor
*wxHtmlWindow::ms_cursorText
= NULL
;
279 void wxHtmlWindow::CleanUpStatics()
281 wxDELETE(m_DefaultFilter
);
282 WX_CLEAR_LIST(wxList
, m_Filters
);
283 if (m_GlobalProcessors
)
284 WX_CLEAR_LIST(wxHtmlProcessorList
, *m_GlobalProcessors
);
285 wxDELETE(m_GlobalProcessors
);
286 wxDELETE(ms_cursorLink
);
287 wxDELETE(ms_cursorText
);
290 void wxHtmlWindow::Init()
292 m_tmpCanDrawLocks
= 0;
293 m_FS
= new wxFileSystem();
295 m_RelatedStatusBar
= NULL
;
296 m_RelatedStatusBarIndex
= -1;
297 #endif // wxUSE_STATUSBAR
298 m_RelatedFrame
= NULL
;
299 m_TitleFormat
= wxT("%s");
300 m_OpenedPage
= m_OpenedAnchor
= m_OpenedPageTitle
= wxEmptyString
;
302 m_Parser
= new wxHtmlWinParser(this);
303 m_Parser
->SetFS(m_FS
);
306 m_History
= new wxHtmlHistoryArray
;
310 m_makingSelection
= false;
312 m_timerAutoScroll
= NULL
;
313 m_lastDoubleClick
= 0;
314 #endif // wxUSE_CLIPBOARD
316 m_eraseBgInOnPaint
= false;
317 m_tmpSelFromCell
= NULL
;
320 bool wxHtmlWindow::Create(wxWindow
*parent
, wxWindowID id
,
321 const wxPoint
& pos
, const wxSize
& size
,
322 long style
, const wxString
& name
)
324 if (!wxScrolledWindow::Create(parent
, id
, pos
, size
,
325 style
| wxVSCROLL
| wxHSCROLL
,
329 SetPage(wxT("<html><body></body></html>"));
334 wxHtmlWindow::~wxHtmlWindow()
338 #endif // wxUSE_CLIPBOARD
347 WX_CLEAR_LIST(wxHtmlProcessorList
, *m_Processors
);
359 void wxHtmlWindow::SetRelatedFrame(wxFrame
* frame
, const wxString
& format
)
361 m_RelatedFrame
= frame
;
362 m_TitleFormat
= format
;
368 void wxHtmlWindow::SetRelatedStatusBar(int index
)
370 m_RelatedStatusBarIndex
= index
;
373 void wxHtmlWindow::SetRelatedStatusBar(wxStatusBar
* statusbar
, int index
)
375 m_RelatedStatusBar
= statusbar
;
376 m_RelatedStatusBarIndex
= index
;
379 #endif // wxUSE_STATUSBAR
383 void wxHtmlWindow::SetFonts(const wxString
& normal_face
, const wxString
& fixed_face
, const int *sizes
)
385 m_Parser
->SetFonts(normal_face
, fixed_face
, sizes
);
387 // re-layout the page after changing fonts:
388 DoSetPage(*(m_Parser
->GetSource()));
391 void wxHtmlWindow::SetStandardFonts(int size
,
392 const wxString
& normal_face
,
393 const wxString
& fixed_face
)
395 m_Parser
->SetStandardFonts(size
, normal_face
, fixed_face
);
397 // re-layout the page after changing fonts:
398 DoSetPage(*(m_Parser
->GetSource()));
401 bool wxHtmlWindow::SetPage(const wxString
& source
)
403 m_OpenedPage
= m_OpenedAnchor
= m_OpenedPageTitle
= wxEmptyString
;
404 return DoSetPage(source
);
407 bool wxHtmlWindow::DoSetPage(const wxString
& source
)
409 wxString
newsrc(source
);
411 wxDELETE(m_selection
);
413 // we will soon delete all the cells, so clear pointers to them:
414 m_tmpSelFromCell
= NULL
;
416 // pass HTML through registered processors:
417 if (m_Processors
|| m_GlobalProcessors
)
419 wxHtmlProcessorList::compatibility_iterator nodeL
, nodeG
;
423 nodeL
= m_Processors
->GetFirst();
424 if ( m_GlobalProcessors
)
425 nodeG
= m_GlobalProcessors
->GetFirst();
427 // VS: there are two lists, global and local, both of them sorted by
428 // priority. Since we have to go through _both_ lists with
429 // decreasing priority, we "merge-sort" the lists on-line by
430 // processing that one of the two heads that has higher priority
431 // in every iteration
432 while (nodeL
|| nodeG
)
434 prL
= (nodeL
) ? nodeL
->GetData()->GetPriority() : -1;
435 prG
= (nodeG
) ? nodeG
->GetData()->GetPriority() : -1;
438 if (nodeL
->GetData()->IsEnabled())
439 newsrc
= nodeL
->GetData()->Process(newsrc
);
440 nodeL
= nodeL
->GetNext();
444 if (nodeG
->GetData()->IsEnabled())
445 newsrc
= nodeG
->GetData()->Process(newsrc
);
446 nodeG
= nodeG
->GetNext();
451 // ...and run the parser on it:
452 wxClientDC
*dc
= new wxClientDC(this);
453 dc
->SetMapMode(wxMM_TEXT
);
454 SetBackgroundColour(wxColour(0xFF, 0xFF, 0xFF));
455 SetBackgroundImage(wxNullBitmap
);
463 m_Cell
= (wxHtmlContainerCell
*) m_Parser
->Parse(newsrc
);
465 m_Cell
->SetIndent(m_Borders
, wxHTML_INDENT_ALL
, wxHTML_UNITS_PIXELS
);
466 m_Cell
->SetAlignHor(wxHTML_ALIGN_CENTER
);
468 if (m_tmpCanDrawLocks
== 0)
473 bool wxHtmlWindow::AppendToPage(const wxString
& source
)
475 return DoSetPage(*(GetParser()->GetSource()) + source
);
478 bool wxHtmlWindow::LoadPage(const wxString
& location
)
480 wxCHECK_MSG( !location
.empty(), false, "location must be non-empty" );
482 wxBusyCursor busyCursor
;
485 bool needs_refresh
= false;
488 if (m_HistoryOn
&& (m_HistoryPos
!= -1))
490 // store scroll position into history item:
492 GetViewStart(&x
, &y
);
493 (*m_History
)[m_HistoryPos
].SetPos(y
);
496 // first check if we're moving to an anchor in the same page
497 size_t posLocalAnchor
= location
.Find('#');
498 if ( posLocalAnchor
!= wxString::npos
&& posLocalAnchor
!= 0 )
500 // check if the part before the anchor is the same as the (either
501 // relative or absolute) URI of the current page
502 const wxString beforeAnchor
= location
.substr(0, posLocalAnchor
);
503 if ( beforeAnchor
!= m_OpenedPage
&&
504 m_FS
->GetPath() + beforeAnchor
!= m_OpenedPage
)
506 // indicate that we're not moving to a local anchor
507 posLocalAnchor
= wxString::npos
;
511 if ( posLocalAnchor
!= wxString::npos
)
514 rt_val
= ScrollToAnchor(location
.substr(posLocalAnchor
+ 1));
517 else // moving to another page
519 needs_refresh
= true;
522 if (m_RelatedStatusBarIndex
!= -1)
524 SetHTMLStatusText(_("Connecting..."));
527 #endif // wxUSE_STATUSBAR
529 wxFSFile
*f
= m_Parser
->OpenURL(wxHTML_URL_PAGE
, location
);
531 // try to interpret 'location' as filename instead of URL:
534 wxFileName
fn(location
);
535 wxString location2
= wxFileSystem::FileNameToURL(fn
);
536 f
= m_Parser
->OpenURL(wxHTML_URL_PAGE
, location2
);
541 wxLogError(_("Unable to open requested HTML document: %s"), location
.c_str());
543 SetHTMLStatusText(wxEmptyString
);
549 wxList::compatibility_iterator node
;
550 wxString src
= wxEmptyString
;
553 if (m_RelatedStatusBarIndex
!= -1)
555 wxString msg
= _("Loading : ") + location
;
556 SetHTMLStatusText(msg
);
559 #endif // wxUSE_STATUSBAR
561 node
= m_Filters
.GetFirst();
564 wxHtmlFilter
*h
= (wxHtmlFilter
*) node
->GetData();
567 src
= h
->ReadFile(*f
);
570 node
= node
->GetNext();
572 if (src
== wxEmptyString
)
574 if (m_DefaultFilter
== NULL
) m_DefaultFilter
= GetDefaultFilter();
575 src
= m_DefaultFilter
->ReadFile(*f
);
578 m_FS
->ChangePathTo(f
->GetLocation());
579 rt_val
= SetPage(src
);
580 m_OpenedPage
= f
->GetLocation();
581 if (f
->GetAnchor() != wxEmptyString
)
583 ScrollToAnchor(f
->GetAnchor());
589 if (m_RelatedStatusBarIndex
!= -1)
591 SetHTMLStatusText(_("Done"));
593 #endif // wxUSE_STATUSBAR
597 if (m_HistoryOn
) // add this page to history there:
599 int c
= m_History
->GetCount() - (m_HistoryPos
+ 1);
601 if (m_HistoryPos
< 0 ||
602 (*m_History
)[m_HistoryPos
].GetPage() != m_OpenedPage
||
603 (*m_History
)[m_HistoryPos
].GetAnchor() != m_OpenedAnchor
)
606 for (int i
= 0; i
< c
; i
++)
607 m_History
->RemoveAt(m_HistoryPos
);
608 m_History
->Add(new wxHtmlHistoryItem(m_OpenedPage
, m_OpenedAnchor
));
612 if (m_OpenedPageTitle
== wxEmptyString
)
613 OnSetTitle(wxFileNameFromPath(m_OpenedPage
));
627 bool wxHtmlWindow::LoadFile(const wxFileName
& filename
)
629 wxString url
= wxFileSystem::FileNameToURL(filename
);
630 return LoadPage(url
);
634 bool wxHtmlWindow::ScrollToAnchor(const wxString
& anchor
)
636 const wxHtmlCell
*c
= m_Cell
->Find(wxHTML_COND_ISANCHOR
, &anchor
);
639 wxLogWarning(_("HTML anchor %s does not exist."), anchor
.c_str());
646 for (y
= 0; c
!= NULL
; c
= c
->GetParent()) y
+= c
->GetPosY();
647 Scroll(-1, y
/ wxHTML_SCROLL_STEP
);
648 m_OpenedAnchor
= anchor
;
654 void wxHtmlWindow::OnSetTitle(const wxString
& title
)
659 tit
.Printf(m_TitleFormat
, title
.c_str());
660 m_RelatedFrame
->SetTitle(tit
);
662 m_OpenedPageTitle
= title
;
669 void wxHtmlWindow::CreateLayout()
671 int ClientWidth
, ClientHeight
;
675 if ( HasFlag(wxHW_SCROLLBAR_NEVER
) )
677 SetScrollbars(1, 1, 0, 0); // always off
678 GetClientSize(&ClientWidth
, &ClientHeight
);
679 m_Cell
->Layout(ClientWidth
);
681 else // !wxHW_SCROLLBAR_NEVER
683 GetClientSize(&ClientWidth
, &ClientHeight
);
684 m_Cell
->Layout(ClientWidth
);
685 if (ClientHeight
< m_Cell
->GetHeight() + GetCharHeight())
688 wxHTML_SCROLL_STEP
, wxHTML_SCROLL_STEP
,
689 m_Cell
->GetWidth() / wxHTML_SCROLL_STEP
,
690 (m_Cell
->GetHeight() + GetCharHeight()) / wxHTML_SCROLL_STEP
691 /*cheat: top-level frag is always container*/);
693 else /* we fit into window, no need for scrollbars */
695 SetScrollbars(wxHTML_SCROLL_STEP
, 1, m_Cell
->GetWidth() / wxHTML_SCROLL_STEP
, 0); // disable...
696 GetClientSize(&ClientWidth
, &ClientHeight
);
697 m_Cell
->Layout(ClientWidth
); // ...and relayout
704 void wxHtmlWindow::ReadCustomization(wxConfigBase
*cfg
, wxString path
)
709 wxString p_fff
, p_ffn
;
711 if (path
!= wxEmptyString
)
713 oldpath
= cfg
->GetPath();
717 m_Borders
= cfg
->Read(wxT("wxHtmlWindow/Borders"), m_Borders
);
718 p_fff
= cfg
->Read(wxT("wxHtmlWindow/FontFaceFixed"), m_Parser
->m_FontFaceFixed
);
719 p_ffn
= cfg
->Read(wxT("wxHtmlWindow/FontFaceNormal"), m_Parser
->m_FontFaceNormal
);
720 for (int i
= 0; i
< 7; i
++)
722 tmp
.Printf(wxT("wxHtmlWindow/FontsSize%i"), i
);
723 p_fontsizes
[i
] = cfg
->Read(tmp
, m_Parser
->m_FontsSizes
[i
]);
725 SetFonts(p_ffn
, p_fff
, p_fontsizes
);
727 if (path
!= wxEmptyString
)
728 cfg
->SetPath(oldpath
);
733 void wxHtmlWindow::WriteCustomization(wxConfigBase
*cfg
, wxString path
)
738 if (path
!= wxEmptyString
)
740 oldpath
= cfg
->GetPath();
744 cfg
->Write(wxT("wxHtmlWindow/Borders"), (long) m_Borders
);
745 cfg
->Write(wxT("wxHtmlWindow/FontFaceFixed"), m_Parser
->m_FontFaceFixed
);
746 cfg
->Write(wxT("wxHtmlWindow/FontFaceNormal"), m_Parser
->m_FontFaceNormal
);
747 for (int i
= 0; i
< 7; i
++)
749 tmp
.Printf(wxT("wxHtmlWindow/FontsSize%i"), i
);
750 cfg
->Write(tmp
, (long) m_Parser
->m_FontsSizes
[i
]);
753 if (path
!= wxEmptyString
)
754 cfg
->SetPath(oldpath
);
759 bool wxHtmlWindow::HistoryBack()
763 if (m_HistoryPos
< 1) return false;
765 // store scroll position into history item:
767 GetViewStart(&x
, &y
);
768 (*m_History
)[m_HistoryPos
].SetPos(y
);
770 // go to previous position:
773 l
= (*m_History
)[m_HistoryPos
].GetPage();
774 a
= (*m_History
)[m_HistoryPos
].GetAnchor();
777 if (a
== wxEmptyString
) LoadPage(l
);
778 else LoadPage(l
+ wxT("#") + a
);
781 Scroll(0, (*m_History
)[m_HistoryPos
].GetPos());
786 bool wxHtmlWindow::HistoryCanBack()
788 if (m_HistoryPos
< 1) return false;
793 bool wxHtmlWindow::HistoryForward()
797 if (m_HistoryPos
== -1) return false;
798 if (m_HistoryPos
>= (int)m_History
->GetCount() - 1)return false;
800 m_OpenedPage
= wxEmptyString
; // this will disable adding new entry into history in LoadPage()
803 l
= (*m_History
)[m_HistoryPos
].GetPage();
804 a
= (*m_History
)[m_HistoryPos
].GetAnchor();
807 if (a
== wxEmptyString
) LoadPage(l
);
808 else LoadPage(l
+ wxT("#") + a
);
811 Scroll(0, (*m_History
)[m_HistoryPos
].GetPos());
816 bool wxHtmlWindow::HistoryCanForward()
818 if (m_HistoryPos
== -1) return false;
819 if (m_HistoryPos
>= (int)m_History
->GetCount() - 1)return false;
824 void wxHtmlWindow::HistoryClear()
830 void wxHtmlWindow::AddProcessor(wxHtmlProcessor
*processor
)
834 m_Processors
= new wxHtmlProcessorList
;
836 wxHtmlProcessorList::compatibility_iterator node
;
838 for (node
= m_Processors
->GetFirst(); node
; node
= node
->GetNext())
840 if (processor
->GetPriority() > node
->GetData()->GetPriority())
842 m_Processors
->Insert(node
, processor
);
846 m_Processors
->Append(processor
);
849 /*static */ void wxHtmlWindow::AddGlobalProcessor(wxHtmlProcessor
*processor
)
851 if (!m_GlobalProcessors
)
853 m_GlobalProcessors
= new wxHtmlProcessorList
;
855 wxHtmlProcessorList::compatibility_iterator node
;
857 for (node
= m_GlobalProcessors
->GetFirst(); node
; node
= node
->GetNext())
859 if (processor
->GetPriority() > node
->GetData()->GetPriority())
861 m_GlobalProcessors
->Insert(node
, processor
);
865 m_GlobalProcessors
->Append(processor
);
870 void wxHtmlWindow::AddFilter(wxHtmlFilter
*filter
)
872 m_Filters
.Append(filter
);
876 bool wxHtmlWindow::IsSelectionEnabled() const
879 return !HasFlag(wxHW_NO_SELECTION
);
887 wxString
wxHtmlWindow::DoSelectionToText(wxHtmlSelection
*sel
)
890 return wxEmptyString
;
894 const wxHtmlCell
*end
= sel
->GetToCell();
896 wxHtmlTerminalCellsInterator
i(sel
->GetFromCell(), end
);
899 text
<< i
->ConvertToText(sel
);
902 const wxHtmlCell
*prev
= *i
;
905 if ( prev
->GetParent() != i
->GetParent() )
907 text
<< i
->ConvertToText(*i
== end
? sel
: NULL
);
914 wxString
wxHtmlWindow::ToText()
919 sel
.Set(m_Cell
->GetFirstTerminal(), m_Cell
->GetLastTerminal());
920 return DoSelectionToText(&sel
);
923 return wxEmptyString
;
926 #endif // wxUSE_CLIPBOARD
928 bool wxHtmlWindow::CopySelection(ClipboardType t
)
933 #if defined(__UNIX__) && !defined(__WXMAC__)
934 wxTheClipboard
->UsePrimarySelection(t
== Primary
);
936 // Primary selection exists only under X11, so don't do anything under
937 // the other platforms when we try to access it
939 // TODO: this should be abstracted at wxClipboard level!
942 #endif // __UNIX__/!__UNIX__
944 if ( wxTheClipboard
->Open() )
946 const wxString
txt(SelectionToText());
947 wxTheClipboard
->SetData(new wxTextDataObject(txt
));
948 wxTheClipboard
->Close();
949 wxLogTrace(_T("wxhtmlselection"),
950 _("Copied to clipboard:\"%s\""), txt
.c_str());
957 #endif // wxUSE_CLIPBOARD
963 void wxHtmlWindow::OnLinkClicked(const wxHtmlLinkInfo
& link
)
965 wxHtmlLinkEvent
event(GetId(), link
);
966 event
.SetEventObject(this);
967 if (!GetEventHandler()->ProcessEvent(event
))
969 // the default behaviour is to load the URL in this window
970 const wxMouseEvent
*e
= event
.GetLinkInfo().GetEvent();
971 if (e
== NULL
|| e
->LeftUp())
972 LoadPage(event
.GetLinkInfo().GetHref());
976 void wxHtmlWindow::OnEraseBackground(wxEraseEvent
& event
)
980 // don't even skip the event, if we don't have a bg bitmap we're going
981 // to overwrite background in OnPaint() below anyhow, so letting the
982 // default handling take place would only result in flicker, just set a
983 // flag to erase the background below
984 m_eraseBgInOnPaint
= true;
988 wxDC
& dc
= *event
.GetDC();
990 // if the image is not fully opaque, we have to erase the background before
991 // drawing it, however avoid doing it for opaque images as this would just
992 // result in extra flicker without any other effect as background is
993 // completely covered anyhow
994 if ( m_bmpBg
.GetMask() )
996 dc
.SetBackground(wxBrush(GetBackgroundColour(), wxBRUSHSTYLE_SOLID
));
1000 const wxSize
sizeWin(GetClientSize());
1001 const wxSize
sizeBmp(m_bmpBg
.GetWidth(), m_bmpBg
.GetHeight());
1002 for ( wxCoord x
= 0; x
< sizeWin
.x
; x
+= sizeBmp
.x
)
1004 for ( wxCoord y
= 0; y
< sizeWin
.y
; y
+= sizeBmp
.y
)
1006 dc
.DrawBitmap(m_bmpBg
, x
, y
, true /* use mask */);
1011 void wxHtmlWindow::OnPaint(wxPaintEvent
& WXUNUSED(event
))
1015 if (m_tmpCanDrawLocks
> 0 || m_Cell
== NULL
)
1019 GetViewStart(&x
, &y
);
1020 wxRect rect
= GetUpdateRegion().GetBox();
1021 wxSize sz
= GetSize();
1024 if ( !m_backBuffer
)
1025 m_backBuffer
= new wxBitmap(sz
.x
, sz
.y
);
1026 dcm
.SelectObject(*m_backBuffer
);
1028 if ( m_eraseBgInOnPaint
)
1030 dcm
.SetBackground(wxBrush(GetBackgroundColour(), wxBRUSHSTYLE_SOLID
));
1033 m_eraseBgInOnPaint
= false;
1035 else // someone has already erased the background, keep it
1037 // preserve the existing background, otherwise we'd erase anything the
1038 // user code had drawn in its EVT_ERASE_BACKGROUND handler when we do
1039 // the Blit back below
1040 dcm
.Blit(0, rect
.GetTop(),
1041 sz
.x
, rect
.GetBottom() - rect
.GetTop() + 1,
1047 dcm
.SetMapMode(wxMM_TEXT
);
1048 dcm
.SetBackgroundMode(wxBRUSHSTYLE_TRANSPARENT
);
1050 wxHtmlRenderingInfo rinfo
;
1051 wxDefaultHtmlRenderingStyle rstyle
;
1052 rinfo
.SetSelection(m_selection
);
1053 rinfo
.SetStyle(&rstyle
);
1054 m_Cell
->Draw(dcm
, 0, 0,
1055 y
* wxHTML_SCROLL_STEP
+ rect
.GetTop(),
1056 y
* wxHTML_SCROLL_STEP
+ rect
.GetBottom(),
1059 //#define DEBUG_HTML_SELECTION
1060 #ifdef DEBUG_HTML_SELECTION
1063 wxGetMousePosition(&xc
, &yc
);
1064 ScreenToClient(&xc
, &yc
);
1065 CalcUnscrolledPosition(xc
, yc
, &x
, &y
);
1066 wxHtmlCell
*at
= m_Cell
->FindCellByPos(x
, y
);
1067 wxHtmlCell
*before
=
1068 m_Cell
->FindCellByPos(x
, y
, wxHTML_FIND_NEAREST_BEFORE
);
1070 m_Cell
->FindCellByPos(x
, y
, wxHTML_FIND_NEAREST_AFTER
);
1072 dcm
.SetBrush(*wxTRANSPARENT_BRUSH
);
1073 dcm
.SetPen(*wxBLACK_PEN
);
1075 dcm
.DrawRectangle(at
->GetAbsPos(),
1076 wxSize(at
->GetWidth(),at
->GetHeight()));
1077 dcm
.SetPen(*wxGREEN_PEN
);
1079 dcm
.DrawRectangle(before
->GetAbsPos().x
+1, before
->GetAbsPos().y
+1,
1080 before
->GetWidth()-2,before
->GetHeight()-2);
1081 dcm
.SetPen(*wxRED_PEN
);
1083 dcm
.DrawRectangle(after
->GetAbsPos().x
+2, after
->GetAbsPos().y
+2,
1084 after
->GetWidth()-4,after
->GetHeight()-4);
1088 dcm
.SetDeviceOrigin(0,0);
1089 dc
.Blit(0, rect
.GetTop(),
1090 sz
.x
, rect
.GetBottom() - rect
.GetTop() + 1,
1098 void wxHtmlWindow::OnSize(wxSizeEvent
& event
)
1100 wxDELETE(m_backBuffer
);
1102 wxScrolledWindow::OnSize(event
);
1105 // Recompute selection if necessary:
1108 m_selection
->Set(m_selection
->GetFromCell(),
1109 m_selection
->GetToCell());
1110 m_selection
->ClearPrivPos();
1117 void wxHtmlWindow::OnMouseMove(wxMouseEvent
& WXUNUSED(event
))
1119 wxHtmlWindowMouseHelper::HandleMouseMoved();
1122 void wxHtmlWindow::OnMouseDown(wxMouseEvent
& event
)
1125 if ( event
.LeftDown() && IsSelectionEnabled() )
1127 const long TRIPLECLICK_LEN
= 200; // 0.2 sec after doubleclick
1128 if ( wxGetLocalTimeMillis() - m_lastDoubleClick
<= TRIPLECLICK_LEN
)
1130 SelectLine(CalcUnscrolledPosition(event
.GetPosition()));
1132 (void) CopySelection();
1136 m_makingSelection
= true;
1140 wxDELETE(m_selection
);
1143 m_tmpSelFromPos
= CalcUnscrolledPosition(event
.GetPosition());
1144 m_tmpSelFromCell
= NULL
;
1149 #endif // wxUSE_CLIPBOARD
1151 // in any case, let the default handler set focus to this window
1155 void wxHtmlWindow::OnMouseUp(wxMouseEvent
& event
)
1158 if ( m_makingSelection
)
1161 m_makingSelection
= false;
1163 // if m_selection=NULL, the user didn't move the mouse far enough from
1164 // starting point and the mouse up event is part of a click, the user
1165 // is not selecting text:
1168 CopySelection(Primary
);
1170 // we don't want mouse up event that ended selecting to be
1171 // handled as mouse click and e.g. follow hyperlink:
1175 #endif // wxUSE_CLIPBOARD
1177 wxPoint pos
= CalcUnscrolledPosition(event
.GetPosition());
1178 wxHtmlWindowMouseHelper::HandleMouseClick(m_Cell
, pos
, event
);
1182 void wxHtmlWindow::OnMouseCaptureLost(wxMouseCaptureLostEvent
& WXUNUSED(event
))
1184 if ( !m_makingSelection
)
1187 // discard the selecting operation
1188 m_makingSelection
= false;
1189 wxDELETE(m_selection
);
1190 m_tmpSelFromCell
= NULL
;
1193 #endif // wxUSE_CLIPBOARD
1196 void wxHtmlWindow::OnInternalIdle()
1198 wxWindow::OnInternalIdle();
1200 if (m_Cell
!= NULL
&& DidMouseMove())
1202 #ifdef DEBUG_HTML_SELECTION
1206 wxGetMousePosition(&xc
, &yc
);
1207 ScreenToClient(&xc
, &yc
);
1208 CalcUnscrolledPosition(xc
, yc
, &x
, &y
);
1210 wxHtmlCell
*cell
= m_Cell
->FindCellByPos(x
, y
);
1212 // handle selection update:
1213 if ( m_makingSelection
)
1215 if ( !m_tmpSelFromCell
)
1216 m_tmpSelFromCell
= m_Cell
->FindCellByPos(
1217 m_tmpSelFromPos
.x
,m_tmpSelFromPos
.y
);
1219 // NB: a trick - we adjust selFromPos to be upper left or bottom
1220 // right corner of the first cell of the selection depending
1221 // on whether the mouse is moving to the right or to the left.
1222 // This gives us more "natural" behaviour when selecting
1223 // a line (specifically, first cell of the next line is not
1224 // included if you drag selection from left to right over
1227 if ( !m_tmpSelFromCell
)
1229 dirFromPos
= m_tmpSelFromPos
;
1233 dirFromPos
= m_tmpSelFromCell
->GetAbsPos();
1234 if ( x
< m_tmpSelFromPos
.x
)
1236 dirFromPos
.x
+= m_tmpSelFromCell
->GetWidth();
1237 dirFromPos
.y
+= m_tmpSelFromCell
->GetHeight();
1240 bool goingDown
= dirFromPos
.y
< y
||
1241 (dirFromPos
.y
== y
&& dirFromPos
.x
< x
);
1243 // determine selection span:
1244 if ( /*still*/ !m_tmpSelFromCell
)
1248 m_tmpSelFromCell
= m_Cell
->FindCellByPos(
1249 m_tmpSelFromPos
.x
,m_tmpSelFromPos
.y
,
1250 wxHTML_FIND_NEAREST_AFTER
);
1251 if (!m_tmpSelFromCell
)
1252 m_tmpSelFromCell
= m_Cell
->GetFirstTerminal();
1256 m_tmpSelFromCell
= m_Cell
->FindCellByPos(
1257 m_tmpSelFromPos
.x
,m_tmpSelFromPos
.y
,
1258 wxHTML_FIND_NEAREST_BEFORE
);
1259 if (!m_tmpSelFromCell
)
1260 m_tmpSelFromCell
= m_Cell
->GetLastTerminal();
1264 wxHtmlCell
*selcell
= cell
;
1269 selcell
= m_Cell
->FindCellByPos(x
, y
,
1270 wxHTML_FIND_NEAREST_BEFORE
);
1272 selcell
= m_Cell
->GetLastTerminal();
1276 selcell
= m_Cell
->FindCellByPos(x
, y
,
1277 wxHTML_FIND_NEAREST_AFTER
);
1279 selcell
= m_Cell
->GetFirstTerminal();
1283 // NB: it may *rarely* happen that the code above didn't find one
1284 // of the cells, e.g. if wxHtmlWindow doesn't contain any
1286 if ( selcell
&& m_tmpSelFromCell
)
1290 // start selecting only if mouse movement was big enough
1291 // (otherwise it was meant as mouse click, not selection):
1292 const int PRECISION
= 2;
1293 wxPoint diff
= m_tmpSelFromPos
- wxPoint(x
,y
);
1294 if (abs(diff
.x
) > PRECISION
|| abs(diff
.y
) > PRECISION
)
1296 m_selection
= new wxHtmlSelection();
1301 if ( m_tmpSelFromCell
->IsBefore(selcell
) )
1303 m_selection
->Set(m_tmpSelFromPos
, m_tmpSelFromCell
,
1304 wxPoint(x
,y
), selcell
);
1308 m_selection
->Set(wxPoint(x
,y
), selcell
,
1309 m_tmpSelFromPos
, m_tmpSelFromCell
);
1311 m_selection
->ClearPrivPos();
1317 // handle cursor and status bar text changes:
1319 // NB: because we're passing in 'cell' and not 'm_Cell' (so that the
1320 // leaf cell lookup isn't done twice), we need to adjust the
1321 // position for the new root:
1322 wxPoint
posInCell(x
, y
);
1324 posInCell
-= cell
->GetAbsPos();
1325 wxHtmlWindowMouseHelper::HandleIdle(cell
, posInCell
);
1330 void wxHtmlWindow::StopAutoScrolling()
1332 if ( m_timerAutoScroll
)
1334 wxDELETE(m_timerAutoScroll
);
1338 void wxHtmlWindow::OnMouseEnter(wxMouseEvent
& event
)
1340 StopAutoScrolling();
1344 void wxHtmlWindow::OnMouseLeave(wxMouseEvent
& event
)
1346 // don't prevent the usual processing of the event from taking place
1349 // when a captured mouse leave a scrolled window we start generate
1350 // scrolling events to allow, for example, extending selection beyond the
1351 // visible area in some controls
1352 if ( wxWindow::GetCapture() == this )
1354 // where is the mouse leaving?
1356 wxPoint pt
= event
.GetPosition();
1359 orient
= wxHORIZONTAL
;
1362 else if ( pt
.y
< 0 )
1364 orient
= wxVERTICAL
;
1367 else // we're lower or to the right of the window
1369 wxSize size
= GetClientSize();
1370 if ( pt
.x
> size
.x
)
1372 orient
= wxHORIZONTAL
;
1373 pos
= GetVirtualSize().x
/ wxHTML_SCROLL_STEP
;
1375 else if ( pt
.y
> size
.y
)
1377 orient
= wxVERTICAL
;
1378 pos
= GetVirtualSize().y
/ wxHTML_SCROLL_STEP
;
1380 else // this should be impossible
1382 // but seems to happen sometimes under wxMSW - maybe it's a bug
1383 // there but for now just ignore it
1385 //wxFAIL_MSG( _T("can't understand where has mouse gone") );
1391 // only start the auto scroll timer if the window can be scrolled in
1393 if ( !HasScrollbar(orient
) )
1396 delete m_timerAutoScroll
;
1397 m_timerAutoScroll
= new wxHtmlWinAutoScrollTimer
1400 pos
== 0 ? wxEVT_SCROLLWIN_LINEUP
1401 : wxEVT_SCROLLWIN_LINEDOWN
,
1405 m_timerAutoScroll
->Start(50); // FIXME: make configurable
1409 void wxHtmlWindow::OnKeyUp(wxKeyEvent
& event
)
1411 if ( IsSelectionEnabled() &&
1412 (event
.GetKeyCode() == 'C' && event
.CmdDown()) )
1414 wxClipboardTextEvent
evt(wxEVT_COMMAND_TEXT_COPY
, GetId());
1416 evt
.SetEventObject(this);
1418 GetEventHandler()->ProcessEvent(evt
);
1422 void wxHtmlWindow::OnCopy(wxCommandEvent
& WXUNUSED(event
))
1424 (void) CopySelection();
1427 void wxHtmlWindow::OnClipboardEvent(wxClipboardTextEvent
& WXUNUSED(event
))
1429 (void) CopySelection();
1432 void wxHtmlWindow::OnDoubleClick(wxMouseEvent
& event
)
1434 // select word under cursor:
1435 if ( IsSelectionEnabled() )
1437 SelectWord(CalcUnscrolledPosition(event
.GetPosition()));
1439 (void) CopySelection(Primary
);
1441 m_lastDoubleClick
= wxGetLocalTimeMillis();
1447 void wxHtmlWindow::SelectWord(const wxPoint
& pos
)
1451 wxHtmlCell
*cell
= m_Cell
->FindCellByPos(pos
.x
, pos
.y
);
1455 m_selection
= new wxHtmlSelection();
1456 m_selection
->Set(cell
, cell
);
1457 RefreshRect(wxRect(CalcScrolledPosition(cell
->GetAbsPos()),
1458 wxSize(cell
->GetWidth(), cell
->GetHeight())));
1463 void wxHtmlWindow::SelectLine(const wxPoint
& pos
)
1467 wxHtmlCell
*cell
= m_Cell
->FindCellByPos(pos
.x
, pos
.y
);
1470 // We use following heuristic to find a "line": let the line be all
1471 // cells in same container as the cell under mouse cursor that are
1472 // neither completely above nor completely bellow the clicked cell
1473 // (i.e. are likely to be words positioned on same line of text).
1475 int y1
= cell
->GetAbsPos().y
;
1476 int y2
= y1
+ cell
->GetHeight();
1478 const wxHtmlCell
*c
;
1479 const wxHtmlCell
*before
= NULL
;
1480 const wxHtmlCell
*after
= NULL
;
1482 // find last cell of line:
1483 for ( c
= cell
->GetNext(); c
; c
= c
->GetNext())
1485 y
= c
->GetAbsPos().y
;
1486 if ( y
+ c
->GetHeight() > y1
&& y
< y2
)
1494 // find first cell of line:
1495 for ( c
= cell
->GetParent()->GetFirstChild();
1496 c
&& c
!= cell
; c
= c
->GetNext())
1498 y
= c
->GetAbsPos().y
;
1499 if ( y
+ c
->GetHeight() > y1
&& y
< y2
)
1511 m_selection
= new wxHtmlSelection();
1512 m_selection
->Set(before
, after
);
1519 void wxHtmlWindow::SelectAll()
1524 m_selection
= new wxHtmlSelection();
1525 m_selection
->Set(m_Cell
->GetFirstTerminal(), m_Cell
->GetLastTerminal());
1530 #endif // wxUSE_CLIPBOARD
1534 IMPLEMENT_ABSTRACT_CLASS(wxHtmlProcessor
,wxObject
)
1536 #if wxUSE_EXTENDED_RTTI
1537 IMPLEMENT_DYNAMIC_CLASS_XTI(wxHtmlWindow
, wxScrolledWindow
,"wx/html/htmlwin.h")
1539 wxBEGIN_PROPERTIES_TABLE(wxHtmlWindow
)
1542 style , wxHW_SCROLLBAR_AUTO
1543 borders , (dimension)
1547 wxEND_PROPERTIES_TABLE()
1549 wxBEGIN_HANDLERS_TABLE(wxHtmlWindow
)
1550 wxEND_HANDLERS_TABLE()
1552 wxCONSTRUCTOR_5( wxHtmlWindow
, wxWindow
* , Parent
, wxWindowID
, Id
, wxPoint
, Position
, wxSize
, Size
, long , WindowStyle
)
1554 IMPLEMENT_DYNAMIC_CLASS(wxHtmlWindow
,wxScrolledWindow
)
1557 BEGIN_EVENT_TABLE(wxHtmlWindow
, wxScrolledWindow
)
1558 EVT_SIZE(wxHtmlWindow::OnSize
)
1559 EVT_LEFT_DOWN(wxHtmlWindow::OnMouseDown
)
1560 EVT_LEFT_UP(wxHtmlWindow::OnMouseUp
)
1561 EVT_RIGHT_UP(wxHtmlWindow::OnMouseUp
)
1562 EVT_MOTION(wxHtmlWindow::OnMouseMove
)
1563 EVT_ERASE_BACKGROUND(wxHtmlWindow::OnEraseBackground
)
1564 EVT_PAINT(wxHtmlWindow::OnPaint
)
1566 EVT_LEFT_DCLICK(wxHtmlWindow::OnDoubleClick
)
1567 EVT_ENTER_WINDOW(wxHtmlWindow::OnMouseEnter
)
1568 EVT_LEAVE_WINDOW(wxHtmlWindow::OnMouseLeave
)
1569 EVT_MOUSE_CAPTURE_LOST(wxHtmlWindow::OnMouseCaptureLost
)
1570 EVT_KEY_UP(wxHtmlWindow::OnKeyUp
)
1571 EVT_MENU(wxID_COPY
, wxHtmlWindow::OnCopy
)
1572 EVT_TEXT_COPY(wxID_ANY
, wxHtmlWindow::OnClipboardEvent
)
1573 #endif // wxUSE_CLIPBOARD
1576 //-----------------------------------------------------------------------------
1577 // wxHtmlWindowInterface implementation in wxHtmlWindow
1578 //-----------------------------------------------------------------------------
1580 void wxHtmlWindow::SetHTMLWindowTitle(const wxString
& title
)
1585 void wxHtmlWindow::OnHTMLLinkClicked(const wxHtmlLinkInfo
& link
)
1587 OnLinkClicked(link
);
1590 wxHtmlOpeningStatus
wxHtmlWindow::OnHTMLOpeningURL(wxHtmlURLType type
,
1591 const wxString
& url
,
1592 wxString
*redirect
) const
1594 return OnOpeningURL(type
, url
, redirect
);
1597 wxPoint
wxHtmlWindow::HTMLCoordsToWindow(wxHtmlCell
*WXUNUSED(cell
),
1598 const wxPoint
& pos
) const
1600 return CalcScrolledPosition(pos
);
1603 wxWindow
* wxHtmlWindow::GetHTMLWindow()
1608 wxColour
wxHtmlWindow::GetHTMLBackgroundColour() const
1610 return GetBackgroundColour();
1613 void wxHtmlWindow::SetHTMLBackgroundColour(const wxColour
& clr
)
1615 SetBackgroundColour(clr
);
1618 void wxHtmlWindow::SetHTMLBackgroundImage(const wxBitmap
& bmpBg
)
1620 SetBackgroundImage(bmpBg
);
1623 void wxHtmlWindow::SetHTMLStatusText(const wxString
& text
)
1626 if (m_RelatedStatusBarIndex
!= -1)
1628 if (m_RelatedStatusBar
)
1630 m_RelatedStatusBar
->SetStatusText(text
, m_RelatedStatusBarIndex
);
1632 else if (m_RelatedFrame
)
1634 m_RelatedFrame
->SetStatusText(text
, m_RelatedStatusBarIndex
);
1639 #endif // wxUSE_STATUSBAR
1643 wxCursor
wxHtmlWindow::GetDefaultHTMLCursor(HTMLCursor type
)
1647 case HTMLCursor_Link
:
1648 if ( !ms_cursorLink
)
1649 ms_cursorLink
= new wxCursor(wxCURSOR_HAND
);
1650 return *ms_cursorLink
;
1652 case HTMLCursor_Text
:
1653 if ( !ms_cursorText
)
1654 ms_cursorText
= new wxCursor(wxCURSOR_IBEAM
);
1655 return *ms_cursorText
;
1657 case HTMLCursor_Default
:
1659 return *wxSTANDARD_CURSOR
;
1663 wxCursor
wxHtmlWindow::GetHTMLCursor(HTMLCursor type
) const
1665 return GetDefaultHTMLCursor(type
);
1669 //-----------------------------------------------------------------------------
1671 //-----------------------------------------------------------------------------
1673 // A module to allow initialization/cleanup
1674 // without calling these functions from app.cpp or from
1675 // the user's application.
1677 class wxHtmlWinModule
: public wxModule
1679 DECLARE_DYNAMIC_CLASS(wxHtmlWinModule
)
1681 wxHtmlWinModule() : wxModule() {}
1682 bool OnInit() { return true; }
1683 void OnExit() { wxHtmlWindow::CleanUpStatics(); }
1686 IMPLEMENT_DYNAMIC_CLASS(wxHtmlWinModule
, wxModule
)
1689 // This hack forces the linker to always link in m_* files
1690 // (wxHTML doesn't work without handlers from these files)
1691 #include "wx/html/forcelnk.h"
1692 FORCE_WXHTML_MODULES()
1694 #endif // wxUSE_HTML