1999-07-07 22:04:58 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
2011-03-20 00:14:35 +00:00
|
|
|
// Name: wx/html/m_templ.h
|
1999-10-02 18:19:46 +00:00
|
|
|
// Purpose: Modules template file
|
1999-07-07 22:04:58 +00:00
|
|
|
// Author: Vaclav Slavik
|
1999-10-02 18:19:46 +00:00
|
|
|
// Copyright: (c) Vaclav Slavik
|
2004-05-23 20:53:33 +00:00
|
|
|
// Licence: wxWindows licence
|
1999-07-07 22:04:58 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
|
|
|
DESCRIPTION:
|
|
|
|
This is set of macros for easier writing of tag handlers. How to use it?
|
|
|
|
See mod_fonts.cpp for example...
|
|
|
|
|
|
|
|
Attention! This is quite strange C++ bastard. Before using it,
|
|
|
|
I STRONGLY recommend reading and understanding these macros!!
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
1999-10-02 18:19:46 +00:00
|
|
|
#ifndef _WX_M_TEMPL_H_
|
|
|
|
#define _WX_M_TEMPL_H_
|
1999-07-07 22:04:58 +00:00
|
|
|
|
|
|
|
#include "wx/defs.h"
|
|
|
|
|
2001-07-05 18:48:48 +00:00
|
|
|
#if wxUSE_HTML
|
1999-07-07 22:04:58 +00:00
|
|
|
|
1999-10-02 18:19:46 +00:00
|
|
|
#include "wx/html/winpars.h"
|
1999-07-07 22:04:58 +00:00
|
|
|
|
|
|
|
#define TAG_HANDLER_BEGIN(name,tags) \
|
2004-10-26 10:32:38 +00:00
|
|
|
class wxHTML_Handler_##name : public wxHtmlWinTagHandler \
|
1999-07-07 22:04:58 +00:00
|
|
|
{ \
|
|
|
|
public: \
|
2016-09-25 20:21:28 +00:00
|
|
|
wxString GetSupportedTags() wxOVERRIDE {return wxT(tags);}
|
1999-07-07 22:04:58 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#define TAG_HANDLER_VARS \
|
|
|
|
private:
|
|
|
|
|
|
|
|
#define TAG_HANDLER_CONSTR(name) \
|
|
|
|
public: \
|
2004-10-26 10:32:38 +00:00
|
|
|
wxHTML_Handler_##name () : wxHtmlWinTagHandler()
|
1999-07-07 22:04:58 +00:00
|
|
|
|
|
|
|
|
|
|
|
#define TAG_HANDLER_PROC(varib) \
|
|
|
|
public: \
|
2016-09-25 20:21:28 +00:00
|
|
|
bool HandleTag(const wxHtmlTag& varib) wxOVERRIDE
|
1999-07-07 22:04:58 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#define TAG_HANDLER_END(name) \
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#define TAGS_MODULE_BEGIN(name) \
|
2004-10-26 10:32:38 +00:00
|
|
|
class wxHTML_Module##name : public wxHtmlTagsModule \
|
1999-07-07 22:04:58 +00:00
|
|
|
{ \
|
2015-04-23 11:49:01 +00:00
|
|
|
wxDECLARE_DYNAMIC_CLASS(wxHTML_Module##name ); \
|
1999-07-07 22:04:58 +00:00
|
|
|
public: \
|
2015-09-07 00:20:42 +00:00
|
|
|
void FillHandlersTable(wxHtmlWinParser *parser) wxOVERRIDE \
|
1999-07-07 22:04:58 +00:00
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#define TAGS_MODULE_ADD(handler) \
|
2004-10-26 10:32:38 +00:00
|
|
|
parser->AddTagHandler(new wxHTML_Handler_##handler);
|
1999-07-07 22:04:58 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#define TAGS_MODULE_END(name) \
|
|
|
|
} \
|
|
|
|
}; \
|
2017-08-20 22:19:31 +00:00
|
|
|
wxIMPLEMENT_DYNAMIC_CLASS(wxHTML_Module##name , wxHtmlTagsModule)
|
1999-07-07 22:04:58 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#endif
|
1999-10-02 18:19:46 +00:00
|
|
|
#endif
|