]> git.saurik.com Git - wxWidgets.git/blame - src/html/winpars.cpp
added back 2 extra pixels for the best size under XP
[wxWidgets.git] / src / html / winpars.cpp
CommitLineData
5526e819 1/////////////////////////////////////////////////////////////////////////////
93763ad5 2// Name: src/html/winpars.cpp
5526e819
VS
3// Purpose: wxHtmlParser class (generic parser)
4// Author: Vaclav Slavik
69941f05 5// RCS-ID: $Id$
5526e819 6// Copyright: (c) 1999 Vaclav Slavik
65571936 7// Licence: wxWindows licence
5526e819
VS
8/////////////////////////////////////////////////////////////////////////////
9
3096bd2f 10#include "wx/wxprec.h"
5526e819 11
2b5f62a0 12#ifdef __BORLANDC__
93763ad5 13 #pragma hdrstop
5526e819
VS
14#endif
15
93763ad5
WS
16#if wxUSE_HTML && wxUSE_STREAMS
17
5526e819 18#ifndef WXPRECOMP
04dbb646
VZ
19 #include "wx/intl.h"
20 #include "wx/dc.h"
e4db172a 21 #include "wx/log.h"
9eddec69 22 #include "wx/settings.h"
5526e819
VS
23#endif
24
69941f05
VS
25#include "wx/html/htmldefs.h"
26#include "wx/html/winpars.h"
27#include "wx/html/htmlwin.h"
b250d384 28#include "wx/fontmap.h"
3ec372c8 29#include "wx/uri.h"
5526e819
VS
30
31
32//-----------------------------------------------------------------------------
33// wxHtmlWinParser
34//-----------------------------------------------------------------------------
35
4f44ea36 36IMPLEMENT_ABSTRACT_CLASS(wxHtmlWinParser, wxHtmlParser)
5526e819
VS
37
38wxList wxHtmlWinParser::m_Modules;
39
bc55e31b 40wxHtmlWinParser::wxHtmlWinParser(wxHtmlWindowInterface *wndIface)
5526e819 41{
211dfedd
VS
42 m_tmpStrBuf = NULL;
43 m_tmpStrBufSize = 0;
bc55e31b 44 m_windowInterface = wndIface;
5526e819
VS
45 m_Container = NULL;
46 m_DC = NULL;
47 m_CharHeight = m_CharWidth = 0;
d1da8872 48 m_UseLink = false;
2b5f62a0 49#if !wxUSE_UNICODE
b250d384 50 m_EncConv = NULL;
2b5f62a0
VZ
51 m_InputEnc = wxFONTENCODING_ISO8859_1;
52 m_OutputEnc = wxFONTENCODING_DEFAULT;
53#endif
b6d93b26 54 m_lastWordCell = NULL;
5526e819
VS
55
56 {
57 int i, j, k, l, m;
58 for (i = 0; i < 2; i++)
59 for (j = 0; j < 2; j++)
60 for (k = 0; k < 2; k++)
61 for (l = 0; l < 2; l++)
3c8c8da2 62 for (m = 0; m < 7; m++)
e3c7fd79 63 {
5526e819 64 m_FontsTable[i][j][k][l][m] = NULL;
f1ad10f3 65 m_FontsFacesTable[i][j][k][l][m] = wxEmptyString;
2b5f62a0 66#if !wxUSE_UNICODE
b250d384 67 m_FontsEncTable[i][j][k][l][m] = wxFONTENCODING_DEFAULT;
2b5f62a0 68#endif
f1ad10f3 69 }
4eecf115
VS
70
71 SetFonts(wxEmptyString, wxEmptyString, NULL);
5526e819
VS
72 }
73
74 // fill in wxHtmlParser's tables:
222ed1d6 75 wxList::compatibility_iterator node = m_Modules.GetFirst();
3c8c8da2 76 while (node)
4f9297b0
VS
77 {
78 wxHtmlTagsModule *mod = (wxHtmlTagsModule*) node->GetData();
79 mod->FillHandlersTable(this);
80 node = node->GetNext();
5526e819
VS
81 }
82}
83
b250d384
VS
84wxHtmlWinParser::~wxHtmlWinParser()
85{
86 int i, j, k, l, m;
87
88 for (i = 0; i < 2; i++)
89 for (j = 0; j < 2; j++)
90 for (k = 0; k < 2; k++)
91 for (l = 0; l < 2; l++)
3c8c8da2 92 for (m = 0; m < 7; m++)
e3c7fd79 93 {
3c8c8da2 94 if (m_FontsTable[i][j][k][l][m] != NULL)
b250d384
VS
95 delete m_FontsTable[i][j][k][l][m];
96 }
2b5f62a0 97#if !wxUSE_UNICODE
211dfedd 98 delete m_EncConv;
2b5f62a0 99#endif
211dfedd 100 delete[] m_tmpStrBuf;
b250d384
VS
101}
102
5526e819
VS
103void wxHtmlWinParser::AddModule(wxHtmlTagsModule *module)
104{
105 m_Modules.Append(module);
106}
107
f6bcfd97
BP
108void wxHtmlWinParser::RemoveModule(wxHtmlTagsModule *module)
109{
110 m_Modules.DeleteObject(module);
111}
112
fbfb8bcc 113void wxHtmlWinParser::SetFonts(const wxString& normal_face, const wxString& fixed_face,
4eecf115 114 const int *sizes)
5526e819 115{
4eecf115
VS
116 static int default_sizes[7] =
117 {
118 wxHTML_FONT_SIZE_1,
d1da8872
WS
119 wxHTML_FONT_SIZE_2,
120 wxHTML_FONT_SIZE_3,
121 wxHTML_FONT_SIZE_4,
122 wxHTML_FONT_SIZE_5,
123 wxHTML_FONT_SIZE_6,
124 wxHTML_FONT_SIZE_7
4eecf115 125 };
d1da8872 126
4eecf115
VS
127 if (sizes == NULL) sizes = default_sizes;
128
c9f56e70
VS
129 int i, j, k, l, m;
130
131 for (i = 0; i < 7; i++) m_FontsSizes[i] = sizes[i];
5526e819
VS
132 m_FontFaceFixed = fixed_face;
133 m_FontFaceNormal = normal_face;
3c8c8da2 134
2b5f62a0 135#if !wxUSE_UNICODE
b250d384 136 SetInputEncoding(m_InputEnc);
2b5f62a0 137#endif
c9f56e70
VS
138
139 for (i = 0; i < 2; i++)
140 for (j = 0; j < 2; j++)
141 for (k = 0; k < 2; k++)
142 for (l = 0; l < 2; l++)
143 for (m = 0; m < 7; m++) {
3c8c8da2 144 if (m_FontsTable[i][j][k][l][m] != NULL)
e3c7fd79 145 {
c9f56e70
VS
146 delete m_FontsTable[i][j][k][l][m];
147 m_FontsTable[i][j][k][l][m] = NULL;
148 }
149 }
5526e819
VS
150}
151
10e5c7ea
VS
152void wxHtmlWinParser::SetStandardFonts(int size,
153 const wxString& normal_face,
154 const wxString& fixed_face)
7acd3625 155{
10e5c7ea 156 wxFont defaultFont = wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT);
d1da8872 157
7acd3625
RD
158 int f_sizes[7];
159 if (size == -1)
10e5c7ea 160 size = defaultFont.GetPointSize();
7acd3625
RD
161
162 f_sizes[0] = int(size * 0.6);
163 f_sizes[1] = int(size * 0.8);
164 f_sizes[2] = size;
165 f_sizes[3] = int(size * 1.2);
166 f_sizes[4] = int(size * 1.4);
167 f_sizes[5] = int(size * 1.6);
168 f_sizes[6] = int(size * 1.8);
10e5c7ea 169
d1da8872 170 wxString normal = normal_face.empty() ?
10e5c7ea 171 defaultFont.GetFaceName() : normal_face;
d1da8872 172
10e5c7ea 173 SetFonts(normal, fixed_face, f_sizes);
7acd3625
RD
174}
175
5526e819
VS
176void wxHtmlWinParser::InitParser(const wxString& source)
177{
178 wxHtmlParser::InitParser(source);
2b5f62a0 179 wxASSERT_MSG(m_DC != NULL, wxT("no DC assigned to wxHtmlWinParser!!"));
5526e819
VS
180
181 m_FontBold = m_FontItalic = m_FontUnderlined = m_FontFixed = FALSE;
f2c2fa4d 182 m_FontSize = 3; //default one
5526e819 183 CreateCurrentFont(); // we're selecting default font into
2b5f62a0 184 m_DC->GetTextExtent( wxT("H"), &m_CharWidth, &m_CharHeight);
5526e819 185 /* NOTE : we're not using GetCharWidth/Height() because
0e8c8233 186 of differences under X and win
5526e819
VS
187 */
188
d1da8872 189 m_UseLink = false;
9548f380 190 m_Link = wxHtmlLinkInfo( wxEmptyString );
5526e819
VS
191 m_LinkColor.Set(0, 0, 0xFF);
192 m_ActualColor.Set(0, 0, 0);
efba2b89 193 m_Align = wxHTML_ALIGN_LEFT;
3c115835
VS
194 m_ScriptMode = wxHTML_SCRIPT_NORMAL;
195 m_ScriptBaseline = 0;
d1da8872 196 m_tmpLastWasSpace = false;
b6d93b26 197 m_lastWordCell = NULL;
5526e819 198
69328c1a
VS
199 // open the toplevel container that contains everything else and that
200 // is never closed (this makes parser's life easier):
5526e819 201 OpenContainer();
69328c1a
VS
202
203 // then open the first container into which page's content will go:
5526e819 204 OpenContainer();
2b5f62a0 205
fa2f5d3b 206#if !wxUSE_UNICODE
2b5f62a0
VZ
207 wxString charset = ExtractCharsetInformation(source);
208 if (!charset.empty())
209 {
210 wxFontEncoding enc = wxFontMapper::Get()->CharsetToEncoding(charset);
211 if (enc != wxFONTENCODING_SYSTEM)
212 SetInputEncoding(enc);
213 }
214#endif
215
4f9297b0 216 m_Container->InsertCell(new wxHtmlColourCell(m_ActualColor));
44d0c580 217 wxColour windowColour = wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW) ;
bc55e31b
VS
218
219 m_Container->InsertCell
220 (
221 new wxHtmlColourCell
222 (
223 m_windowInterface
224 ? m_windowInterface->GetHTMLBackgroundColour()
225 : windowColour,
226 wxHTML_CLR_BACKGROUND
227 )
228 );
229
4f9297b0 230 m_Container->InsertCell(new wxHtmlFontCell(CreateCurrentFont()));
5526e819
VS
231}
232
5526e819
VS
233void wxHtmlWinParser::DoneParser()
234{
235 m_Container = NULL;
2b5f62a0
VZ
236#if !wxUSE_UNICODE
237 SetInputEncoding(wxFONTENCODING_ISO8859_1); // for next call
238#endif
5526e819
VS
239 wxHtmlParser::DoneParser();
240}
241
bc55e31b
VS
242#if WXWIN_COMPATIBILITY_2_6
243wxHtmlWindow *wxHtmlWinParser::GetWindow()
244{
245 if (!m_windowInterface)
246 return NULL;
247 return wxDynamicCast(m_windowInterface->GetHTMLWindow(), wxHtmlWindow);
248}
249#endif
250
5526e819
VS
251wxObject* wxHtmlWinParser::GetProduct()
252{
253 wxHtmlContainerCell *top;
254
255 CloseContainer();
256 OpenContainer();
67cfebc2 257
5526e819 258 top = m_Container;
4f9297b0 259 while (top->GetParent()) top = top->GetParent();
ace0fab4
VS
260 top->RemoveExtraSpacing(true, true);
261
5526e819
VS
262 return top;
263}
264
0423bdc7 265wxFSFile *wxHtmlWinParser::OpenURL(wxHtmlURLType type,
6cc4e6b8 266 const wxString& url) const
04db5c3f 267{
bc55e31b
VS
268 if ( !m_windowInterface )
269 return wxHtmlParser::OpenURL(type, url);
270
271 wxString myurl(url);
272 wxHtmlOpeningStatus status;
273 for (;;)
6cc4e6b8 274 {
bc55e31b 275 wxString myfullurl(myurl);
4bfa3189 276
bc55e31b
VS
277 // consider url as absolute path first
278 wxURI current(myurl);
279 myfullurl = current.BuildUnescapedURI();
4bfa3189 280
bc55e31b
VS
281 // if not absolute then ...
282 if( current.IsReference() )
283 {
284 wxString basepath = GetFS()->GetPath();
285 wxURI base(basepath);
4bfa3189 286
bc55e31b
VS
287 // ... try to apply base path if valid ...
288 if( !base.IsReference() )
289 {
290 wxURI path(myfullurl);
291 path.Resolve( base );
292 myfullurl = path.BuildUnescapedURI();
293 }
294 else
295 {
296 // ... or force such addition if not included already
297 if( !current.GetPath().Contains(base.GetPath()) )
4bfa3189 298 {
bc55e31b
VS
299 basepath += myurl;
300 wxURI connected( basepath );
301 myfullurl = connected.BuildUnescapedURI();
4bfa3189
WS
302 }
303 }
6cc4e6b8 304 }
0423bdc7 305
bc55e31b
VS
306 wxString redirect;
307 status = m_windowInterface->OnHTMLOpeningURL(type, myfullurl, &redirect);
308 if ( status != wxHTML_REDIRECT )
309 break;
2c892c0b 310
bc55e31b 311 myurl = redirect;
6cc4e6b8 312 }
2c892c0b 313
bc55e31b
VS
314 if ( status == wxHTML_BLOCK )
315 return NULL;
316
317 return GetFS()->OpenFile(myurl);
04db5c3f 318}
5526e819 319
211dfedd 320void wxHtmlWinParser::AddText(const wxChar* txt)
5526e819 321{
e3c7fd79
VZ
322 size_t i = 0,
323 x,
324 lng = wxStrlen(txt);
211dfedd 325 register wxChar d;
5526e819 326 int templen = 0;
f23e92e7 327 wxChar nbsp = GetEntitiesParser()->GetCharForCode(160 /* nbsp */);
211dfedd
VS
328
329 if (lng+1 > m_tmpStrBufSize)
330 {
331 delete[] m_tmpStrBuf;
332 m_tmpStrBuf = new wxChar[lng+1];
333 m_tmpStrBufSize = lng+1;
334 }
335 wxChar *temp = m_tmpStrBuf;
3c8c8da2
VZ
336
337 if (m_tmpLastWasSpace)
4f9297b0 338 {
3c8c8da2
VZ
339 while ((i < lng) &&
340 ((txt[i] == wxT('\n')) || (txt[i] == wxT('\r')) || (txt[i] == wxT(' ')) ||
211dfedd 341 (txt[i] == wxT('\t')))) i++;
5526e819
VS
342 }
343
3c8c8da2 344 while (i < lng)
4f9297b0 345 {
5526e819
VS
346 x = 0;
347 d = temp[templen++] = txt[i];
3c8c8da2 348 if ((d == wxT('\n')) || (d == wxT('\r')) || (d == wxT(' ')) || (d == wxT('\t')))
e3c7fd79 349 {
5526e819 350 i++, x++;
3c8c8da2 351 while ((i < lng) && ((txt[i] == wxT('\n')) || (txt[i] == wxT('\r')) ||
211dfedd 352 (txt[i] == wxT(' ')) || (txt[i] == wxT('\t')))) i++, x++;
5526e819
VS
353 }
354 else i++;
355
3c8c8da2 356 if (x)
e3c7fd79 357 {
211dfedd 358 temp[templen-1] = wxT(' ');
97eac136 359 DoAddText(temp, templen, nbsp);
d1da8872 360 m_tmpLastWasSpace = true;
5526e819
VS
361 }
362 }
af035b26
VS
363
364 if (templen && (templen > 1 || temp[0] != wxT(' ')))
4f9297b0 365 {
97eac136
VS
366 DoAddText(temp, templen, nbsp);
367 m_tmpLastWasSpace = false;
368 }
369}
370
371void wxHtmlWinParser::DoAddText(wxChar *temp, int& templen, wxChar nbsp)
372{
373 temp[templen] = 0;
374 templen = 0;
2b5f62a0 375#if !wxUSE_UNICODE
97eac136
VS
376 if (m_EncConv)
377 m_EncConv->Convert(temp);
2b5f62a0 378#endif
97eac136
VS
379 size_t len = wxStrlen(temp);
380 for (size_t j = 0; j < len; j++)
381 {
382 if (temp[j] == nbsp)
383 temp[j] = wxT(' ');
5526e819 384 }
97eac136
VS
385
386 wxHtmlCell *c = new wxHtmlWordCell(temp, *(GetDC()));
387
3c115835
VS
388 ApplyStateToCell(c);
389
97eac136
VS
390 m_Container->InsertCell(c);
391 ((wxHtmlWordCell*)c)->SetPreviousWord(m_lastWordCell);
392 m_lastWordCell = (wxHtmlWordCell*)c;
5526e819
VS
393}
394
395
396
397wxHtmlContainerCell* wxHtmlWinParser::OpenContainer()
398{
399 m_Container = new wxHtmlContainerCell(m_Container);
4f9297b0 400 m_Container->SetAlignHor(m_Align);
d1da8872 401 m_tmpLastWasSpace = true;
5526e819
VS
402 /* to avoid space being first character in paragraph */
403 return m_Container;
404}
405
406
407
408wxHtmlContainerCell* wxHtmlWinParser::SetContainer(wxHtmlContainerCell *c)
409{
d1da8872 410 m_tmpLastWasSpace = true;
5526e819
VS
411 /* to avoid space being first character in paragraph */
412 return m_Container = c;
413}
414
415
416
417wxHtmlContainerCell* wxHtmlWinParser::CloseContainer()
418{
4f9297b0 419 m_Container = m_Container->GetParent();
5526e819
VS
420 return m_Container;
421}
422
423
f2c2fa4d
VS
424void wxHtmlWinParser::SetFontSize(int s)
425{
426 if (s < 1) s = 1;
427 else if (s > 7) s = 7;
428 m_FontSize = s;
429}
430
431
432
5526e819
VS
433wxFont* wxHtmlWinParser::CreateCurrentFont()
434{
435 int fb = GetFontBold(),
436 fi = GetFontItalic(),
437 fu = GetFontUnderlined(),
438 ff = GetFontFixed(),
f2c2fa4d 439 fs = GetFontSize() - 1 /*remap from <1;7> to <0;6>*/ ;
5526e819 440
f1ad10f3
VS
441 wxString face = ff ? m_FontFaceFixed : m_FontFaceNormal;
442 wxString *faceptr = &(m_FontsFacesTable[fb][fi][fu][ff][fs]);
443 wxFont **fontptr = &(m_FontsTable[fb][fi][fu][ff][fs]);
2b5f62a0 444#if !wxUSE_UNICODE
b250d384 445 wxFontEncoding *encptr = &(m_FontsEncTable[fb][fi][fu][ff][fs]);
2b5f62a0 446#endif
f1ad10f3 447
2b5f62a0
VZ
448 if (*fontptr != NULL && (*faceptr != face
449#if !wxUSE_UNICODE
450 || *encptr != m_OutputEnc
451#endif
452 ))
4f9297b0 453 {
f1ad10f3
VS
454 delete *fontptr;
455 *fontptr = NULL;
456 }
457
3c8c8da2 458 if (*fontptr == NULL)
4f9297b0 459 {
f1ad10f3
VS
460 *faceptr = face;
461 *fontptr = new wxFont(
7a5e6267 462 (int) (m_FontsSizes[fs] * m_PixelScale),
f1ad10f3
VS
463 ff ? wxMODERN : wxSWISS,
464 fi ? wxITALIC : wxNORMAL,
465 fb ? wxBOLD : wxNORMAL,
d1da8872 466 fu ? true : false, face
2b5f62a0
VZ
467#if wxUSE_UNICODE
468 );
469#else
470 , m_OutputEnc);
471 *encptr = m_OutputEnc;
472#endif
5526e819 473 }
4f9297b0 474 m_DC->SetFont(**fontptr);
f1ad10f3 475 return (*fontptr);
5526e819
VS
476}
477
478
479
f2c2fa4d
VS
480void wxHtmlWinParser::SetLink(const wxHtmlLinkInfo& link)
481{
3c8c8da2 482 m_Link = link;
f2c2fa4d
VS
483 m_UseLink = (link.GetHref() != wxEmptyString);
484}
485
3c8c8da2 486void wxHtmlWinParser::SetFontFace(const wxString& face)
b250d384 487{
3c8c8da2 488 if (GetFontFixed()) m_FontFaceFixed = face;
b250d384
VS
489 else m_FontFaceNormal = face;
490
2b5f62a0 491#if !wxUSE_UNICODE
b250d384
VS
492 if (m_InputEnc != wxFONTENCODING_DEFAULT)
493 SetInputEncoding(m_InputEnc);
2b5f62a0 494#endif
b250d384
VS
495}
496
3c115835
VS
497void wxHtmlWinParser::ApplyStateToCell(wxHtmlCell *cell)
498{
499 // set the link:
500 if (m_UseLink)
501 cell->SetLink(GetLink());
502
503 // apply current script mode settings:
504 cell->SetScriptMode(GetScriptMode(), GetScriptBaseline());
505}
b250d384
VS
506
507
2b5f62a0 508#if !wxUSE_UNICODE
b250d384
VS
509void wxHtmlWinParser::SetInputEncoding(wxFontEncoding enc)
510{
511 m_InputEnc = m_OutputEnc = wxFONTENCODING_DEFAULT;
3c8c8da2 512 if (m_EncConv)
daa616fc 513 {
3c8c8da2 514 delete m_EncConv;
daa616fc
VS
515 m_EncConv = NULL;
516 }
b250d384
VS
517
518 if (enc == wxFONTENCODING_DEFAULT) return;
519
520 wxFontEncoding altfix, altnorm;
521 bool availfix, availnorm;
3c8c8da2
VZ
522
523 // exact match?
142b3bc2
VS
524 availnorm = wxFontMapper::Get()->IsEncodingAvailable(enc, m_FontFaceNormal);
525 availfix = wxFontMapper::Get()->IsEncodingAvailable(enc, m_FontFaceFixed);
3c8c8da2 526 if (availnorm && availfix)
b250d384 527 m_OutputEnc = enc;
3c8c8da2 528
b250d384 529 // alternatives?
d1da8872
WS
530 else if (wxFontMapper::Get()->GetAltForEncoding(enc, &altnorm, m_FontFaceNormal, false) &&
531 wxFontMapper::Get()->GetAltForEncoding(enc, &altfix, m_FontFaceFixed, false) &&
b250d384
VS
532 altnorm == altfix)
533 m_OutputEnc = altnorm;
3c8c8da2 534
b250d384
VS
535 // at least normal face?
536 else if (availnorm)
537 m_OutputEnc = enc;
d1da8872 538 else if (wxFontMapper::Get()->GetAltForEncoding(enc, &altnorm, m_FontFaceNormal, false))
b250d384 539 m_OutputEnc = altnorm;
3c8c8da2 540
b250d384 541 else
c83e1237
SC
542 {
543#ifndef __WXMAC__
544 // okay, let convert to ISO_8859-1, available always
b250d384 545 m_OutputEnc = wxFONTENCODING_DEFAULT;
90548138 546#else
c83e1237 547 m_OutputEnc = wxLocale::GetSystemEncoding() ;
90548138 548#endif
c83e1237 549 }
3c8c8da2 550
b250d384 551 m_InputEnc = enc;
daa616fc
VS
552 if (m_OutputEnc == wxFONTENCODING_DEFAULT)
553 GetEntitiesParser()->SetEncoding(wxFONTENCODING_SYSTEM);
554 else
555 GetEntitiesParser()->SetEncoding(m_OutputEnc);
3c8c8da2 556
b250d384
VS
557 if (m_InputEnc == m_OutputEnc) return;
558
559 m_EncConv = new wxEncodingConverter();
3c8c8da2 560 if (!m_EncConv->Init(m_InputEnc,
b250d384
VS
561 (m_OutputEnc == wxFONTENCODING_DEFAULT) ?
562 wxFONTENCODING_ISO8859_1 : m_OutputEnc,
3c8c8da2 563 wxCONVERT_SUBSTITUTE))
b250d384 564 { // total failture :-(
3c8c8da2
VZ
565 wxLogError(_("Failed to display HTML document in %s encoding"),
566 wxFontMapper::GetEncodingName(enc).c_str());
b250d384
VS
567 m_InputEnc = m_OutputEnc = wxFONTENCODING_DEFAULT;
568 delete m_EncConv;
569 m_EncConv = NULL;
570 }
571}
2b5f62a0 572#endif
b250d384
VS
573
574
f2c2fa4d 575
5526e819
VS
576
577//-----------------------------------------------------------------------------
578// wxHtmlWinTagHandler
579//-----------------------------------------------------------------------------
580
581IMPLEMENT_ABSTRACT_CLASS(wxHtmlWinTagHandler, wxHtmlTagHandler)
582
5526e819
VS
583//-----------------------------------------------------------------------------
584// wxHtmlTagsModule
585//-----------------------------------------------------------------------------
586
d6a6d666
VS
587// NB: This is *NOT* winpars.cpp's initialization and shutdown code!!
588// This module is an ancestor for tag handlers modules defined
589// in m_*.cpp files with TAGS_MODULE_BEGIN...TAGS_MODULE_END construct.
590//
591// Do not add any winpars.cpp shutdown or initialization code to it,
592// create a new module instead!
5526e819
VS
593
594IMPLEMENT_DYNAMIC_CLASS(wxHtmlTagsModule, wxModule)
595
5526e819
VS
596bool wxHtmlTagsModule::OnInit()
597{
598 wxHtmlWinParser::AddModule(this);
d1da8872 599 return true;
5526e819
VS
600}
601
5526e819
VS
602void wxHtmlTagsModule::OnExit()
603{
f6bcfd97 604 wxHtmlWinParser::RemoveModule(this);
5526e819 605}
d6a6d666 606
223d09f6 607#endif