]>
git.saurik.com Git - wxWidgets.git/blob - include/wx/html/m_templ.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/html/m_templ.h
3 // Purpose: Modules template file
4 // Author: Vaclav Slavik
6 // Copyright: (c) Vaclav Slavik
7 // Licence: wxWindows licence
8 /////////////////////////////////////////////////////////////////////////////
13 This is set of macros for easier writing of tag handlers. How to use it?
14 See mod_fonts.cpp for example...
16 Attention! This is quite strange C++ bastard. Before using it,
17 I STRONGLY recommend reading and understanding these macros!!
22 #ifndef _WX_M_TEMPL_H_
23 #define _WX_M_TEMPL_H_
29 #include "wx/html/winpars.h"
31 #define TAG_HANDLER_BEGIN(name,tags) \
32 class wxHTML_Handler_##name : public wxHtmlWinTagHandler \
35 wxString GetSupportedTags() {return wxT(tags);}
39 #define TAG_HANDLER_VARS \
42 #define TAG_HANDLER_CONSTR(name) \
44 wxHTML_Handler_##name () : wxHtmlWinTagHandler()
47 #define TAG_HANDLER_PROC(varib) \
49 bool HandleTag(const wxHtmlTag& varib)
53 #define TAG_HANDLER_END(name) \
59 #define TAGS_MODULE_BEGIN(name) \
60 class wxHTML_Module##name : public wxHtmlTagsModule \
62 DECLARE_DYNAMIC_CLASS(wxHTML_Module##name ) \
64 void FillHandlersTable(wxHtmlWinParser *parser) \
70 #define TAGS_MODULE_ADD(handler) \
71 parser->AddTagHandler(new wxHTML_Handler_##handler);
76 #define TAGS_MODULE_END(name) \
79 IMPLEMENT_DYNAMIC_CLASS(wxHTML_Module##name , wxHtmlTagsModule)