]>
git.saurik.com Git - wxWidgets.git/blob - include/wx/html/m_templ.h
1 /////////////////////////////////////////////////////////////////////////////
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_
31 #pragma implementation
34 #include <wx/wxprec.h>
47 #include "wx/html/winpars.h"
50 #define TAG_HANDLER_BEGIN(name,tags) \
51 class HTML_Handler_##name : public wxHtmlWinTagHandler \
54 wxString GetSupportedTags() {return tags;}
58 #define TAG_HANDLER_VARS \
61 #define TAG_HANDLER_CONSTR(name) \
63 HTML_Handler_##name () : wxHtmlWinTagHandler()
66 #define TAG_HANDLER_PROC(varib) \
68 bool HandleTag(const wxHtmlTag& varib)
72 #define TAG_HANDLER_END(name) \
78 #define TAGS_MODULE_BEGIN(name) \
79 class HTML_Module##name : public wxHtmlTagsModule \
81 DECLARE_DYNAMIC_CLASS(HTML_Module##name ) \
83 void FillHandlersTable(wxHtmlWinParser *parser) \
89 #define TAGS_MODULE_ADD(handler) \
90 parser -> AddTagHandler(new HTML_Handler_##handler);
95 #define TAGS_MODULE_END(name) \
98 IMPLEMENT_DYNAMIC_CLASS(HTML_Module##name , wxHtmlTagsModule)