]>
git.saurik.com Git - wxWidgets.git/blob - include/wx/html/m_templ.h
58603ac0863b89c997ef580f276451ccd0950b43
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/html/m_templ.h
3 // Purpose: Modules template file
4 // Author: Vaclav Slavik
5 // Copyright: (c) Vaclav Slavik
6 // Licence: wxWindows licence
7 /////////////////////////////////////////////////////////////////////////////
12 This is set of macros for easier writing of tag handlers. How to use it?
13 See mod_fonts.cpp for example...
15 Attention! This is quite strange C++ bastard. Before using it,
16 I STRONGLY recommend reading and understanding these macros!!
21 #ifndef _WX_M_TEMPL_H_
22 #define _WX_M_TEMPL_H_
28 #include "wx/html/winpars.h"
30 #define TAG_HANDLER_BEGIN(name,tags) \
31 class wxHTML_Handler_##name : public wxHtmlWinTagHandler \
34 wxString GetSupportedTags() {return wxT(tags);}
38 #define TAG_HANDLER_VARS \
41 #define TAG_HANDLER_CONSTR(name) \
43 wxHTML_Handler_##name () : wxHtmlWinTagHandler()
46 #define TAG_HANDLER_PROC(varib) \
48 bool HandleTag(const wxHtmlTag& varib)
52 #define TAG_HANDLER_END(name) \
58 #define TAGS_MODULE_BEGIN(name) \
59 class wxHTML_Module##name : public wxHtmlTagsModule \
61 DECLARE_DYNAMIC_CLASS(wxHTML_Module##name ) \
63 void FillHandlersTable(wxHtmlWinParser *parser) \
69 #define TAGS_MODULE_ADD(handler) \
70 parser->AddTagHandler(new wxHTML_Handler_##handler);
75 #define TAGS_MODULE_END(name) \
78 IMPLEMENT_DYNAMIC_CLASS(wxHTML_Module##name , wxHtmlTagsModule)