X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/704a4b7524e05d7bf4d208eb1b30be9989abef4c..50567b69d60faa5a3575a077bb4f98530813c80d:/docs/latex/wx/htmlhand.tex diff --git a/docs/latex/wx/htmlhand.tex b/docs/latex/wx/htmlhand.tex index d926e7ef7c..26012444c9 100644 --- a/docs/latex/wx/htmlhand.tex +++ b/docs/latex/wx/htmlhand.tex @@ -1,13 +1,13 @@ -\membersection{Tag Handlers}\label{handlers} +\section{Tag Handlers}\label{handlers} -wxHTML library provides architecture of pluginable {\it tag handlers}. +The wxHTML library provides architecture of pluggable {\it tag handlers}. Tag handler is class that understands particular HTML tag (or tags) and is able to interpret it. \helpref{wxHtmlWinParser}{wxhtmlwinparser} has static table of {\bf modules}. -Each module contains one or more tag handlers. Each time new wxHtmlWinParser +Each module contains one or more tag handlers. Each time a new wxHtmlWinParser object is constructed all modules are scanned and handlers are added -to wxHtmlParser's list of available handlers (note : wxHtmlParser's list +to wxHtmlParser's list of available handlers (note: wxHtmlParser's list is non-static). \wxheading{How it works} @@ -15,7 +15,7 @@ is non-static). Common tag handler's \helpref{HandleTag}{wxhtmltaghandlerhandletag} method works in four steps: -\begin{enumerate} +\begin{enumerate}\itemsep=0pt \item Save state of parent parser into local variables \item Change parser state according to tag's params \item Parse text between the tag and paired ending tag (if present) @@ -43,23 +43,23 @@ Then you must define handlers and one module. The handler is derived from \helpref{wxHtmlWinTagHandler}{wxhtmlwintaghandler} (or directly from \helpref{wxHtmlTagHandler}{wxhtmltaghandler}) -You can use set of macros to define the handler (see src/mod_*.cpp files -for details). Handler definition must start with {\bf TAG_HANDLER_BEGIN} macro -and end with {\bf TAG_HANDLER_END} macro. I strongly recommend to have a look -at {\it include/wxhtml/mod_templ.h} file. Otherwise you won't understand -the structure of macros... See macros reference: +You can use set of macros to define the handler (see src/mod\_*.cpp files +for details). Handler definition must start with {\bf TAG\_HANDLER\_BEGIN} macro +and end with {\bf TAG\_HANDLER\_END} macro. I strongly recommend to have a look +at {\it include/wxhtml/mod\_templ.h} file. Otherwise you won't understand +the structure of macros. See macros reference: -{\bf TAG_HANDLER_BEGIN}({\it name}, {\it tags}) +{\bf TAG\_HANDLER\_BEGIN}({\it name}, {\it tags}) Starts handler definition. {\it name} is handler identifier (in fact part of class name), {\it tags} is string containing list of tags supported by this handler (in uppercase). This macro derives new class from -wxHtmlWinTagHandler and implements it's +wxHtmlWinTagHandler and implements it is \helpref{GetSupportedTags}{wxhtmltaghandlergetsupportedtags} method. -Example: TAG_HANDLER_BEGIN(FONTS, "B,I,U,T") +Example: TAG\_HANDLER\_BEGIN(FONTS, "B,I,U,T") -{\bf TAG_HANDLER_VARS} +{\bf TAG\_HANDLER\_VARS} This macro starts block of variables definitions. (Variables are identical to class attributes.) Example: @@ -74,10 +74,10 @@ TAG_HANDLER_END(VARS_ONLY) This macro is used only in rare cases. -{\bf TAG_HANDLER_CONSTR}({\it name}) +{\bf TAG\_HANDLER\_CONSTR}({\it name}) This macro supplies object constructor. {\it name} is same name as the one -from TAG_HANDLER_BEGIN macro. Body of constructor follow after +from TAG\_HANDLER\_BEGIN macro. Body of constructor follow after this macro (you must use { and } ). Example: \begin{verbatim} @@ -93,9 +93,9 @@ TAG_HANDLER_END(VARS2) Never used in wxHTML :-) -{\bf TAG_HANDLER_PROC}({\it varib}) +{\bf TAG\_HANDLER\_PROC}({\it varib}) -This is very important macro. It defines \helpref{HandleTag}{wxhtmlparserhandletag} +This is very important macro. It defines \helpref{HandleTag}{wxhtmltaghandlerhandletag} method. {\it varib} is name of parameter passed to the method, usually {\it tag}. Body of method follows after this macro. Note than you must use { and } ! Example: @@ -109,29 +109,29 @@ TAG_HANDLER_BEGIN(TITLE, "TITLE") TAG_HANDLER_END(TITLE) \end{verbatim} -{\bf TAG_HANDLER_END}({\it name}) +{\bf TAG\_HANDLER\_END}({\it name}) Ends definition of tag handler {\it name}. \wxheading{Tags Modules} -You can use set of 3 macros TAGS_MODULE_BEGIN, TAGS_MODULE_ADD and -TAGS_MODULE_END to inherit new module from +You can use set of 3 macros TAGS\_MODULE\_BEGIN, TAGS\_MODULE\_ADD and +TAGS\_MODULE\_END to inherit new module from \helpref{wxHtmlTagsModule}{wxhtmltagsmodule} and to create instance of it. See macros reference: -{\bf TAGS_MODULE_BEGIN}({\it modname}) +{\bf TAGS\_MODULE\_BEGIN}({\it modname}) Begins module definition. {\it modname} is part of class name and must be unique. -{\bf TAGS_MODULE_ADD}({\it name}) +{\bf TAGS\_MODULE\_ADD}({\it name}) Adds the handler to this module. {\it name} is the identifier from -TAG_HANDLER_BEGIN. +TAG\_HANDLER\_BEGIN. -{\bf TAGS_MODULE_END}({\it modname}) +{\bf TAGS\_MODULE\_END}({\it modname}) Ends the definition of module. @@ -144,3 +144,4 @@ TAGS_MODULE_BEGIN(Examples) TAGS_MODULE_ADD(TITLE) TAGS_MODULE_END(Examples) \end{verbatim} +