]>
Commit | Line | Data |
---|---|---|
5526e819 | 1 | ///////////////////////////////////////////////////////////////////////////// |
69941f05 VS |
2 | // Name: m_templ.h |
3 | // Purpose: Modules template file | |
5526e819 | 4 | // Author: Vaclav Slavik |
69941f05 VS |
5 | // RCS-ID: $Id$ |
6 | // Copyright: (c) Vaclav Slavik | |
7 | // Licence: wxWindows licence | |
5526e819 VS |
8 | ///////////////////////////////////////////////////////////////////////////// |
9 | ||
10 | /* | |
11 | ||
12 | DESCRIPTION: | |
13 | This is set of macros for easier writing of tag handlers. How to use it? | |
14 | See mod_fonts.cpp for example... | |
15 | ||
16 | Attention! This is quite strange C++ bastard. Before using it, | |
17 | I STRONGLY recommend reading and understanding these macros!! | |
18 | ||
19 | */ | |
20 | ||
21 | ||
69941f05 VS |
22 | #ifndef _WX_M_TEMPL_H_ |
23 | #define _WX_M_TEMPL_H_ | |
5526e819 VS |
24 | |
25 | #include "wx/defs.h" | |
26 | #if wxUSE_HTML | |
27 | ||
28 | ||
29 | #ifdef __GNUG__ | |
30 | #pragma interface | |
31 | #pragma implementation | |
32 | #endif | |
33 | ||
34 | #include <wx/wxprec.h> | |
35 | ||
36 | #ifdef __BORDLANDC__ | |
37 | #pragma hdrstop | |
38 | #endif | |
39 | ||
40 | #ifndef WXPRECOMP | |
41 | #include <wx/wx.h> | |
42 | #endif | |
43 | ||
44 | ||
45 | ||
46 | ||
69941f05 | 47 | #include "wx/html/winpars.h" |
5526e819 VS |
48 | |
49 | ||
50 | #define TAG_HANDLER_BEGIN(name,tags) \ | |
51 | class HTML_Handler_##name : public wxHtmlWinTagHandler \ | |
52 | { \ | |
53 | public: \ | |
54 | wxString GetSupportedTags() {return tags;} | |
55 | ||
56 | ||
57 | ||
58 | #define TAG_HANDLER_VARS \ | |
59 | private: | |
60 | ||
61 | #define TAG_HANDLER_CONSTR(name) \ | |
62 | public: \ | |
63 | HTML_Handler_##name () : wxHtmlWinTagHandler() | |
64 | ||
65 | ||
66 | #define TAG_HANDLER_PROC(varib) \ | |
67 | public: \ | |
68 | bool HandleTag(const wxHtmlTag& varib) | |
69 | ||
70 | ||
71 | ||
72 | #define TAG_HANDLER_END(name) \ | |
73 | }; | |
74 | ||
75 | ||
76 | ||
77 | ||
78 | #define TAGS_MODULE_BEGIN(name) \ | |
79 | class HTML_Module##name : public wxHtmlTagsModule \ | |
80 | { \ | |
81 | DECLARE_DYNAMIC_CLASS(HTML_Module##name ) \ | |
82 | public: \ | |
83 | void FillHandlersTable(wxHtmlWinParser *parser) \ | |
84 | { | |
85 | ||
86 | ||
87 | ||
88 | ||
89 | #define TAGS_MODULE_ADD(handler) \ | |
90 | parser -> AddTagHandler(new HTML_Handler_##handler); | |
91 | ||
92 | ||
93 | ||
94 | ||
95 | #define TAGS_MODULE_END(name) \ | |
96 | } \ | |
97 | }; \ | |
98 | IMPLEMENT_DYNAMIC_CLASS(HTML_Module##name , wxHtmlTagsModule) | |
99 | ||
100 | ||
101 | ||
102 | #endif | |
69941f05 | 103 | #endif |