1999-07-07 18:04:58 -04:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
1999-10-02 14:19:46 -04:00
|
|
|
// Name: m_templ.h
|
|
|
|
// Purpose: Modules template file
|
1999-07-07 18:04:58 -04:00
|
|
|
// Author: Vaclav Slavik
|
1999-10-02 14:19:46 -04:00
|
|
|
// RCS-ID: $Id$
|
|
|
|
// Copyright: (c) Vaclav Slavik
|
2004-05-23 16:53:33 -04:00
|
|
|
// Licence: wxWindows licence
|
1999-07-07 18:04:58 -04: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 14:19:46 -04:00
|
|
|
#ifndef _WX_M_TEMPL_H_
|
|
|
|
#define _WX_M_TEMPL_H_
|
1999-07-07 18:04:58 -04:00
|
|
|
|
|
|
|
#include "wx/defs.h"
|
|
|
|
|
2001-07-05 14:48:48 -04:00
|
|
|
#if wxUSE_HTML
|
1999-07-07 18:04:58 -04:00
|
|
|
|
1999-10-02 14:19:46 -04:00
|
|
|
#include "wx/html/winpars.h"
|
1999-07-07 18:04:58 -04:00
|
|
|
|
|
|
|
#define TAG_HANDLER_BEGIN(name,tags) \
|
|
|
|
class HTML_Handler_##name : public wxHtmlWinTagHandler \
|
|
|
|
{ \
|
|
|
|
public: \
|
2002-12-04 09:11:26 -05:00
|
|
|
wxString GetSupportedTags() {return wxT(tags);}
|
1999-07-07 18:04:58 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#define TAG_HANDLER_VARS \
|
|
|
|
private:
|
|
|
|
|
|
|
|
#define TAG_HANDLER_CONSTR(name) \
|
|
|
|
public: \
|
|
|
|
HTML_Handler_##name () : wxHtmlWinTagHandler()
|
|
|
|
|
|
|
|
|
|
|
|
#define TAG_HANDLER_PROC(varib) \
|
|
|
|
public: \
|
|
|
|
bool HandleTag(const wxHtmlTag& varib)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#define TAG_HANDLER_END(name) \
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#define TAGS_MODULE_BEGIN(name) \
|
|
|
|
class HTML_Module##name : public wxHtmlTagsModule \
|
|
|
|
{ \
|
|
|
|
DECLARE_DYNAMIC_CLASS(HTML_Module##name ) \
|
|
|
|
public: \
|
|
|
|
void FillHandlersTable(wxHtmlWinParser *parser) \
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#define TAGS_MODULE_ADD(handler) \
|
2000-11-05 09:59:59 -05:00
|
|
|
parser->AddTagHandler(new HTML_Handler_##handler);
|
1999-07-07 18:04:58 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#define TAGS_MODULE_END(name) \
|
|
|
|
} \
|
|
|
|
}; \
|
|
|
|
IMPLEMENT_DYNAMIC_CLASS(HTML_Module##name , wxHtmlTagsModule)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#endif
|
1999-10-02 14:19:46 -04:00
|
|
|
#endif
|