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) \
|
2004-10-26 06:32:38 -04:00
|
|
|
class wxHTML_Handler_##name : public wxHtmlWinTagHandler \
|
1999-07-07 18:04:58 -04:00
|
|
|
{ \
|
|
|
|
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: \
|
2004-10-26 06:32:38 -04:00
|
|
|
wxHTML_Handler_##name () : wxHtmlWinTagHandler()
|
1999-07-07 18:04:58 -04:00
|
|
|
|
|
|
|
|
|
|
|
#define TAG_HANDLER_PROC(varib) \
|
|
|
|
public: \
|
|
|
|
bool HandleTag(const wxHtmlTag& varib)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#define TAG_HANDLER_END(name) \
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#define TAGS_MODULE_BEGIN(name) \
|
2004-10-26 06:32:38 -04:00
|
|
|
class wxHTML_Module##name : public wxHtmlTagsModule \
|
1999-07-07 18:04:58 -04:00
|
|
|
{ \
|
2004-10-26 06:32:38 -04:00
|
|
|
DECLARE_DYNAMIC_CLASS(wxHTML_Module##name ) \
|
1999-07-07 18:04:58 -04:00
|
|
|
public: \
|
|
|
|
void FillHandlersTable(wxHtmlWinParser *parser) \
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#define TAGS_MODULE_ADD(handler) \
|
2004-10-26 06:32:38 -04:00
|
|
|
parser->AddTagHandler(new wxHTML_Handler_##handler);
|
1999-07-07 18:04:58 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#define TAGS_MODULE_END(name) \
|
|
|
|
} \
|
|
|
|
}; \
|
2004-10-26 06:32:38 -04:00
|
|
|
IMPLEMENT_DYNAMIC_CLASS(wxHTML_Module##name , wxHtmlTagsModule)
|
1999-07-07 18:04:58 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#endif
|
1999-10-02 14:19:46 -04:00
|
|
|
#endif
|