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