]>
Commit | Line | Data |
---|---|---|
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 | ///////////////////////////////////////////////////////////////////////////// | |
8 | ||
9 | /* | |
10 | ||
11 | DESCRIPTION: | |
12 | This is set of macros for easier writing of tag handlers. How to use it? | |
13 | See mod_fonts.cpp for example... | |
14 | ||
15 | Attention! This is quite strange C++ bastard. Before using it, | |
16 | I STRONGLY recommend reading and understanding these macros!! | |
17 | ||
18 | */ | |
19 | ||
20 | ||
21 | #ifndef _WX_M_TEMPL_H_ | |
22 | #define _WX_M_TEMPL_H_ | |
23 | ||
24 | #include "wx/defs.h" | |
25 | ||
26 | #if wxUSE_HTML | |
27 | ||
28 | #include "wx/html/winpars.h" | |
29 | ||
30 | #define TAG_HANDLER_BEGIN(name,tags) \ | |
31 | class wxHTML_Handler_##name : public wxHtmlWinTagHandler \ | |
32 | { \ | |
33 | public: \ | |
34 | wxString GetSupportedTags() {return wxT(tags);} | |
35 | ||
36 | ||
37 | ||
38 | #define TAG_HANDLER_VARS \ | |
39 | private: | |
40 | ||
41 | #define TAG_HANDLER_CONSTR(name) \ | |
42 | public: \ | |
43 | wxHTML_Handler_##name () : wxHtmlWinTagHandler() | |
44 | ||
45 | ||
46 | #define TAG_HANDLER_PROC(varib) \ | |
47 | public: \ | |
48 | bool HandleTag(const wxHtmlTag& varib) | |
49 | ||
50 | ||
51 | ||
52 | #define TAG_HANDLER_END(name) \ | |
53 | }; | |
54 | ||
55 | ||
56 | ||
57 | ||
58 | #define TAGS_MODULE_BEGIN(name) \ | |
59 | class wxHTML_Module##name : public wxHtmlTagsModule \ | |
60 | { \ | |
61 | DECLARE_DYNAMIC_CLASS(wxHTML_Module##name ) \ | |
62 | public: \ | |
63 | void FillHandlersTable(wxHtmlWinParser *parser) \ | |
64 | { | |
65 | ||
66 | ||
67 | ||
68 | ||
69 | #define TAGS_MODULE_ADD(handler) \ | |
70 | parser->AddTagHandler(new wxHTML_Handler_##handler); | |
71 | ||
72 | ||
73 | ||
74 | ||
75 | #define TAGS_MODULE_END(name) \ | |
76 | } \ | |
77 | }; \ | |
78 | IMPLEMENT_DYNAMIC_CLASS(wxHTML_Module##name , wxHtmlTagsModule) | |
79 | ||
80 | ||
81 | ||
82 | #endif | |
83 | #endif |