]>
git.saurik.com Git - wxWidgets.git/blob - include/wx/html/mod_templ.h
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxHtml tags module generic "template"
4 // Author: Vaclav Slavik
5 // Copyright: (c) 1999 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 __MOD_TEMPL_H__
22 #define __MOD_TEMPL_H__
30 #pragma implementation
33 #include <wx/wxprec.h>
46 #include <wx/html/htmlwinparser.h>
49 #define TAG_HANDLER_BEGIN(name,tags) \
50 class HTML_Handler_##name : public wxHtmlWinTagHandler \
53 wxString GetSupportedTags() {return tags;}
57 #define TAG_HANDLER_VARS \
60 #define TAG_HANDLER_CONSTR(name) \
62 HTML_Handler_##name () : wxHtmlWinTagHandler()
65 #define TAG_HANDLER_PROC(varib) \
67 bool HandleTag(const wxHtmlTag& varib)
71 #define TAG_HANDLER_END(name) \
77 #define TAGS_MODULE_BEGIN(name) \
78 class HTML_Module##name : public wxHtmlTagsModule \
80 DECLARE_DYNAMIC_CLASS(HTML_Module##name ) \
82 void FillHandlersTable(wxHtmlWinParser *parser) \
88 #define TAGS_MODULE_ADD(handler) \
89 parser -> AddTagHandler(new HTML_Handler_##handler);
94 #define TAGS_MODULE_END(name) \
97 IMPLEMENT_DYNAMIC_CLASS(HTML_Module##name , wxHtmlTagsModule)