wxWidgets/include/wx/html/m_templ.h

84 lines
2.6 KiB
C
Raw Normal View History

/////////////////////////////////////////////////////////////////////////////
// Name: wx/html/m_templ.h
// Purpose: Modules template file
// Author: Vaclav Slavik
// Copyright: (c) Vaclav Slavik
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
/*
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!!
*/
#ifndef _WX_M_TEMPL_H_
#define _WX_M_TEMPL_H_
#include "wx/defs.h"
#if wxUSE_HTML
#include "wx/html/winpars.h"
#define TAG_HANDLER_BEGIN(name,tags) \
class wxHTML_Handler_##name : public wxHtmlWinTagHandler \
{ \
public: \
2016-09-25 20:21:28 +00:00
wxString GetSupportedTags() wxOVERRIDE {return wxT(tags);}
#define TAG_HANDLER_VARS \
private:
#define TAG_HANDLER_CONSTR(name) \
public: \
wxHTML_Handler_##name () : wxHtmlWinTagHandler()
#define TAG_HANDLER_PROC(varib) \
public: \
2016-09-25 20:21:28 +00:00
bool HandleTag(const wxHtmlTag& varib) wxOVERRIDE
#define TAG_HANDLER_END(name) \
};
#define TAGS_MODULE_BEGIN(name) \
class wxHTML_Module##name : public wxHtmlTagsModule \
{ \
wxDECLARE_DYNAMIC_CLASS(wxHTML_Module##name ); \
public: \
2015-09-07 00:20:42 +00:00
void FillHandlersTable(wxHtmlWinParser *parser) wxOVERRIDE \
{
#define TAGS_MODULE_ADD(handler) \
parser->AddTagHandler(new wxHTML_Handler_##handler);
#define TAGS_MODULE_END(name) \
} \
}; \
wxIMPLEMENT_DYNAMIC_CLASS(wxHTML_Module##name , wxHtmlTagsModule)
#endif
#endif