Changed: Remove old libwww elements

--HG--
branch : develop
This commit is contained in:
Nimetu 2019-05-03 00:26:12 +03:00
parent 8f124b3066
commit fed9a2b0c9
7 changed files with 302 additions and 2438 deletions

View file

@ -23,7 +23,6 @@
#include "nel/gui/group_tree.h" #include "nel/gui/group_tree.h"
#include "nel/gui/ctrl_button.h" #include "nel/gui/ctrl_button.h"
#include "nel/gui/group_table.h" #include "nel/gui/group_table.h"
#include "nel/gui/libwww_types.h"
#include "nel/gui/html_element.h" #include "nel/gui/html_element.h"
#include "nel/gui/css_style.h" #include "nel/gui/css_style.h"

View file

@ -21,7 +21,6 @@
#define CL_LIB_WWW_H #define CL_LIB_WWW_H
#include "nel/misc/rgba.h" #include "nel/misc/rgba.h"
#include "nel/gui/libwww_types.h"
// forward declaration to avoid curl.h inclusion everywhere // forward declaration to avoid curl.h inclusion everywhere
typedef void CURL; typedef void CURL;
@ -32,251 +31,146 @@ namespace NLGUI
class CCtrlScroll; class CCtrlScroll;
class CGroupList; class CGroupList;
// *************************************************************************** // List of HTML elements. Does not need to be sorted
typedef enum _HTMLElement {
HTML_HTML,
HTML_BODY,
// meta
HTML_BASE,
HTML_HEAD,
HTML_LINK,
HTML_META,
HTML_STYLE,
HTML_TITLE,
// content sectioning
HTML_ADDRESS,
HTML_ARTICLE,
HTML_ASIDE,
HTML_FOOTER,
HTML_HEADER,
HTML_H1,
HTML_H2,
HTML_H3,
HTML_H4,
HTML_H5,
HTML_H6,
HTML_HGROUP,
HTML_MAIN,
HTML_NAV,
HTML_SECTION,
// text content
HTML_BLOCKQUOTE,
HTML_DD,
HTML_DIR,
HTML_DIV,
HTML_DL,
HTML_DT,
HTML_FIGCAPTION,
HTML_FIGURE,
HTML_HR,
HTML_LI,
HTML_OL,
HTML_P,
HTML_PRE,
HTML_UL,
// inline text
HTML_A,
HTML_ABBR,
HTML_B,
HTML_BDI,
HTML_BDO,
HTML_BR,
HTML_CITE,
HTML_CODE,
HTML_DATA,
HTML_DFN,
HTML_EM,
HTML_I,
HTML_KBD,
HTML_MARK,
HTML_Q,
HTML_RB,
HTML_RP,
HTML_RT,
HTML_RTC,
HTML_RUBY,
HTML_S,
HTML_SAMP,
HTML_SMALL,
HTML_SPAN,
HTML_STRONG,
HTML_SUB,
HTML_SUP,
HTML_TIME,
HTML_TT,
HTML_U,
HTML_VAR,
HTML_WBR,
// image, multimedia
HTML_AREA,
HTML_AUDIO,
HTML_IMG,
HTML_MAP,
HTML_TRACK,
HTML_VIDEO,
// embedded content
HTML_APPLET,
HTML_EMBED,
HTML_IFRAME,
HTML_NOEMBED,
HTML_OBJECT,
HTML_PARAM,
HTML_PICTURE,
HTML_SOURCE,
// scripting
HTML_CANVAS,
HTML_NOSCRIPT,
HTML_SCRIPT,
// demarcating edits
HTML_DEL,
HTML_INS,
// table
HTML_CAPTION,
HTML_COL,
HTML_COLGROUP,
HTML_TABLE,
HTML_TBODY,
HTML_TD,
HTML_TFOOT,
HTML_TH,
HTML_THEAD,
HTML_TR,
// forms
HTML_BUTTON,
HTML_DATALIST,
HTML_FIELDSET,
HTML_FORM,
HTML_INPUT,
HTML_LABEL,
HTML_LEGEND,
HTML_METER,
HTML_OPTGROUP,
HTML_OPTION,
HTML_OUTPUT,
HTML_PROGRESS,
HTML_SELECT,
HTML_TEXTAREA,
// interactive elements
HTML_DETAILS,
HTML_DIALOG,
HTML_MENU,
HTML_MENUITEM,
HTML_SUMMARY,
// -- tags for ryzom --
HTML_FONT,
HTML_LUA,
// last entry for unknown elements
HTML_NB_ELEMENTS
} HTMLElement;
// Legacy function from libwww // case insensitive lookup for HTMLElement enum by name
SGML_dtd * HTML_dtd (void); // return HTML_NB_ELEMENTS if no match
HTMLElement htmlElementLookup(const char *name);
// Init the libwww
void initLibWWW();
// ***************************************************************************
// Some DTD table
// Here, modify the DTD table to change the HTML parser (add new tags for exemples)
#undef HTML_ATTR
#define HTML_ATTR(t,a) MY_HTML_##t##_##a
enum
{
HTML_ATTR(HTML,DIR) = 0,
HTML_ATTR(HTML,LANG),
HTML_ATTR(HTML,VERSION),
HTML_ATTR(HTML,STYLE),
};
enum
{
HTML_ATTR(A,ACCESSKEY) = 0,
HTML_ATTR(A,CHARSET),
HTML_ATTR(A,CLASS),
HTML_ATTR(A,COORDS),
HTML_ATTR(A,DIR),
HTML_ATTR(A,HREF),
HTML_ATTR(A,HREFLANG),
HTML_ATTR(A,ID),
HTML_ATTR(A,NAME),
HTML_ATTR(A,REL),
HTML_ATTR(A,REV),
HTML_ATTR(A,SHAPE),
HTML_ATTR(A,STYLE),
HTML_ATTR(A,TABINDEX),
HTML_ATTR(A,TARGET),
HTML_ATTR(A,TYPE),
HTML_ATTR(A,TITLE),
HTML_ATTR(A,Z_ACTION_CATEGORY),
HTML_ATTR(A,Z_ACTION_PARAMS),
HTML_ATTR(A,Z_ACTION_SHORTCUT),
};
enum
{
HTML_ATTR(TABLE,ALIGN) = 0,
HTML_ATTR(TABLE,BGCOLOR),
HTML_ATTR(TABLE,BORDER),
HTML_ATTR(TABLE,BORDERCOLOR),
HTML_ATTR(TABLE,CELLPADDING),
HTML_ATTR(TABLE,CELLSPACING),
HTML_ATTR(TABLE,CLASS),
HTML_ATTR(TABLE,DIR),
HTML_ATTR(TABLE,FRAME),
HTML_ATTR(TABLE,ID),
HTML_ATTR(TABLE,L_MARGIN),
HTML_ATTR(TABLE,LANG),
HTML_ATTR(TABLE,NOWRAP),
HTML_ATTR(TABLE,RULES),
HTML_ATTR(TABLE,SUMMARY),
HTML_ATTR(TABLE,STYLE),
HTML_ATTR(TABLE,TITLE),
HTML_ATTR(TABLE,VALIGN),
HTML_ATTR(TABLE,WIDTH)
};
enum
{
HTML_ATTR(TR,ALIGN) = 0,
HTML_ATTR(TR,BGCOLOR),
HTML_ATTR(TR,L_MARGIN),
HTML_ATTR(TR,NOWRAP),
HTML_ATTR(TR,VALIGN),
HTML_ATTR(TR,STYLE),
};
enum
{
HTML_ATTR(TD,ABBR) = 0,
HTML_ATTR(TD,ALIGN),
HTML_ATTR(TD,AXIS),
HTML_ATTR(TD,BGCOLOR),
HTML_ATTR(TD,CHAR),
HTML_ATTR(TD,CHAROFF),
HTML_ATTR(TD,CLASS),
HTML_ATTR(TD,COLSPAN),
HTML_ATTR(TD,DIR),
HTML_ATTR(TD,ID),
HTML_ATTR(TD,HEADERS),
HTML_ATTR(TD,HEIGHT),
HTML_ATTR(TD,L_MARGIN),
HTML_ATTR(TD,LANG),
HTML_ATTR(TD,NOWRAP),
HTML_ATTR(TD,ROWSPAN),
HTML_ATTR(TD,SCOPE),
HTML_ATTR(TD,STYLE),
HTML_ATTR(TD,TITLE),
HTML_ATTR(TD,VALIGN),
HTML_ATTR(TD,WIDTH),
};
enum
{
HTML_ATTR(IMG,ALIGN) = 0,
HTML_ATTR(IMG,ALT),
HTML_ATTR(IMG,BORDER),
HTML_ATTR(IMG,CLASS),
HTML_ATTR(IMG,DIR),
HTML_ATTR(IMG,GLOBAL_COLOR),
HTML_ATTR(IMG,HEIGHT),
HTML_ATTR(IMG,HSPACE),
HTML_ATTR(IMG,ID),
HTML_ATTR(IMG,ISMAP),
HTML_ATTR(IMG,LANG),
HTML_ATTR(IMG,LONGDESC),
HTML_ATTR(IMG,SRC),
HTML_ATTR(IMG,STYLE),
HTML_ATTR(IMG,TITLE),
HTML_ATTR(IMG,USEMAP),
HTML_ATTR(IMG,VSPACE),
HTML_ATTR(IMG,WIDTH),
// not sorted to keep enum values
HTML_ATTR(IMG,DATA_OVER_SRC),
};
enum
{
HTML_ATTR(INPUT,ACCEPT) = 0,
HTML_ATTR(INPUT,ACCESSKEY),
HTML_ATTR(INPUT,ALIGN),
HTML_ATTR(INPUT,ALT),
HTML_ATTR(INPUT,CHECKED),
HTML_ATTR(INPUT,CLASS),
HTML_ATTR(INPUT,DIR),
HTML_ATTR(INPUT,DISABLED),
HTML_ATTR(INPUT,GLOBAL_COLOR),
HTML_ATTR(INPUT,ID),
HTML_ATTR(INPUT,LANG),
HTML_ATTR(INPUT,MAXLENGTH),
HTML_ATTR(INPUT,NAME),
HTML_ATTR(INPUT,READONLY),
HTML_ATTR(INPUT,SIZE),
HTML_ATTR(INPUT,SRC),
HTML_ATTR(INPUT,STYLE),
HTML_ATTR(INPUT,TABINDEX),
HTML_ATTR(INPUT,TITLE),
HTML_ATTR(INPUT,TYPE),
HTML_ATTR(INPUT,USEMAP),
HTML_ATTR(INPUT,VALUE),
HTML_ATTR(INPUT,Z_BTN_TMPL),
HTML_ATTR(INPUT,Z_INPUT_TMPL),
HTML_ATTR(INPUT,Z_INPUT_WIDTH),
};
enum
{
HTML_ATTR(TEXTAREA,CLASS) = 0,
HTML_ATTR(TEXTAREA,COLS),
HTML_ATTR(TEXTAREA,DIR),
HTML_ATTR(TEXTAREA,DISABLED),
HTML_ATTR(TEXTAREA,ID),
HTML_ATTR(TEXTAREA,LANG),
HTML_ATTR(TEXTAREA,MAXLENGTH),
HTML_ATTR(TEXTAREA,NAME),
HTML_ATTR(TEXTAREA,READONLY),
HTML_ATTR(TEXTAREA,ROWS),
HTML_ATTR(TEXTAREA,STYLE),
HTML_ATTR(TEXTAREA,TABINDEX),
HTML_ATTR(TEXTAREA,TITLE),
HTML_ATTR(TEXTAREA,Z_INPUT_TMPL),
};
enum
{
HTML_ATTR(P,QUICK_HELP_CONDITION) = 0,
HTML_ATTR(P,QUICK_HELP_EVENTS),
HTML_ATTR(P,QUICK_HELP_LINK),
HTML_ATTR(P,NAME),
HTML_ATTR(P,STYLE),
};
enum
{
HTML_ATTR(DIV,CLASS) = 0,
HTML_ATTR(DIV,ID),
HTML_ATTR(DIV,NAME),
HTML_ATTR(DIV,STYLE),
};
enum
{
HTML_ATTR(SPAN,CLASS) = 0,
HTML_ATTR(SPAN,ID),
HTML_ATTR(SPAN,STYLE),
};
enum
{
HTML_ATTR(H1,CLASS) = 0,
HTML_ATTR(H1,ID),
HTML_ATTR(H1,STYLE),
};
enum
{
HTML_ATTR(H2,CLASS) = 0,
HTML_ATTR(H2,ID),
HTML_ATTR(H2,STYLE),
};
enum
{
HTML_ATTR(H3,CLASS) = 0,
HTML_ATTR(H3,ID),
HTML_ATTR(H3,STYLE),
};
enum
{
HTML_ATTR(H4,CLASS) = 0,
HTML_ATTR(H4,ID),
HTML_ATTR(H4,STYLE),
};
enum
{
HTML_ATTR(H5,CLASS) = 0,
HTML_ATTR(H5,ID),
HTML_ATTR(H5,STYLE),
};
enum
{
HTML_ATTR(H6,CLASS) = 0,
HTML_ATTR(H6,ID),
HTML_ATTR(H6,STYLE),
};
#undef HTML_ATTR
// *************************************************************************** // ***************************************************************************
// Read HTML color value from src and set dest // Read HTML color value from src and set dest

File diff suppressed because it is too large Load diff

View file

@ -1444,7 +1444,6 @@ namespace NLGUI
initImageDownload(); initImageDownload();
initBnpDownload(); initBnpDownload();
initLibWWW();
} }
// *************************************************************************** // ***************************************************************************

View file

@ -59,8 +59,6 @@ namespace NLGUI
// recursive function to walk html document // recursive function to walk html document
void CHtmlParser::parseNode(xmlNode *a_node, CHtmlElement &parent, std::string &styleString, std::vector<std::string> &links) const void CHtmlParser::parseNode(xmlNode *a_node, CHtmlElement &parent, std::string &styleString, std::vector<std::string> &links) const
{ {
SGML_dtd *HTML_DTD = HTML_dtd ();
uint childIndex = 0; uint childIndex = 0;
uint element_number; uint element_number;
xmlNode *node = a_node; xmlNode *node = a_node;
@ -73,12 +71,8 @@ namespace NLGUI
else else
if (node->type == XML_ELEMENT_NODE) if (node->type == XML_ELEMENT_NODE)
{ {
// find libwww tag // find html element
for(element_number = 0; element_number<HTML_ELEMENTS; ++element_number) element_number = htmlElementLookup((const char*)node->name);
{
if (xmlStrncasecmp(node->name, (const xmlChar *)HTML_DTD->tags[element_number].name.c_str(), xmlStrlen(node->name)) == 0)
break;
}
// get pointer to previous sibling // get pointer to previous sibling
CHtmlElement *prevSibling = NULL; CHtmlElement *prevSibling = NULL;

View file

@ -29,6 +29,167 @@ using namespace NLMISC;
namespace NLGUI namespace NLGUI
{ {
struct CNameToHtmlElement
{
HTMLElement ID;
const char* Name;
CNameToHtmlElement(HTMLElement id, const char*name)
: ID(id), Name(name) {}
};
// sorted list of HTML_ELEMENT enum to TAG name
static CNameToHtmlElement htmlElementToName[] =
{
CNameToHtmlElement(HTML_A, "a"),
CNameToHtmlElement(HTML_ABBR, "abbr"),
CNameToHtmlElement(HTML_ADDRESS, "address"),
CNameToHtmlElement(HTML_APPLET, "applet"),
CNameToHtmlElement(HTML_AREA, "area"),
CNameToHtmlElement(HTML_ARTICLE, "article"),
CNameToHtmlElement(HTML_ASIDE, "aside"),
CNameToHtmlElement(HTML_AUDIO, "audio"),
CNameToHtmlElement(HTML_B, "b"),
CNameToHtmlElement(HTML_BASE, "base"),
CNameToHtmlElement(HTML_BDI, "bdi"),
CNameToHtmlElement(HTML_BDO, "bdo"),
CNameToHtmlElement(HTML_BLOCKQUOTE, "blockquote"),
CNameToHtmlElement(HTML_BODY, "body"),
CNameToHtmlElement(HTML_BR, "br"),
CNameToHtmlElement(HTML_BUTTON, "button"),
CNameToHtmlElement(HTML_CANVAS, "canvas"),
CNameToHtmlElement(HTML_CAPTION, "caption"),
CNameToHtmlElement(HTML_CITE, "cite"),
CNameToHtmlElement(HTML_CODE, "code"),
CNameToHtmlElement(HTML_COL, "col"),
CNameToHtmlElement(HTML_COLGROUP, "colgroup"),
CNameToHtmlElement(HTML_DATA, "data"),
CNameToHtmlElement(HTML_DATALIST, "datalist"),
CNameToHtmlElement(HTML_DD, "dd"),
CNameToHtmlElement(HTML_DEL, "del"),
CNameToHtmlElement(HTML_DETAILS, "details"),
CNameToHtmlElement(HTML_DFN, "dfn"),
CNameToHtmlElement(HTML_DIALOG, "dialog"),
CNameToHtmlElement(HTML_DIR, "dir"),
CNameToHtmlElement(HTML_DIV, "div"),
CNameToHtmlElement(HTML_DL, "dl"),
CNameToHtmlElement(HTML_DT, "dt"),
CNameToHtmlElement(HTML_EM, "em"),
CNameToHtmlElement(HTML_EMBED, "embed"),
CNameToHtmlElement(HTML_FIELDSET, "fieldset"),
CNameToHtmlElement(HTML_FIGCAPTION, "figcaption"),
CNameToHtmlElement(HTML_FIGURE, "figure"),
CNameToHtmlElement(HTML_FONT, "font"),
CNameToHtmlElement(HTML_FOOTER, "footer"),
CNameToHtmlElement(HTML_FORM, "form"),
CNameToHtmlElement(HTML_H1, "h1"),
CNameToHtmlElement(HTML_H2, "h2"),
CNameToHtmlElement(HTML_H3, "h3"),
CNameToHtmlElement(HTML_H4, "h4"),
CNameToHtmlElement(HTML_H5, "h5"),
CNameToHtmlElement(HTML_H6, "h6"),
CNameToHtmlElement(HTML_HEAD, "head"),
CNameToHtmlElement(HTML_HEADER, "header"),
CNameToHtmlElement(HTML_HGROUP, "hgroup"),
CNameToHtmlElement(HTML_HR, "hr"),
CNameToHtmlElement(HTML_HTML, "html"),
CNameToHtmlElement(HTML_I, "i"),
CNameToHtmlElement(HTML_IFRAME, "iframe"),
CNameToHtmlElement(HTML_IMG, "img"),
CNameToHtmlElement(HTML_INPUT, "input"),
CNameToHtmlElement(HTML_INS, "ins"),
CNameToHtmlElement(HTML_KBD, "kbd"),
CNameToHtmlElement(HTML_LABEL, "label"),
CNameToHtmlElement(HTML_LEGEND, "legend"),
CNameToHtmlElement(HTML_LI, "li"),
CNameToHtmlElement(HTML_LINK, "link"),
CNameToHtmlElement(HTML_LUA, "lua"),
CNameToHtmlElement(HTML_MAIN, "main"),
CNameToHtmlElement(HTML_MAP, "map"),
CNameToHtmlElement(HTML_MARK, "mark"),
CNameToHtmlElement(HTML_MENU, "menu"),
CNameToHtmlElement(HTML_MENUITEM, "menuitem"),
CNameToHtmlElement(HTML_META, "meta"),
CNameToHtmlElement(HTML_METER, "meter"),
CNameToHtmlElement(HTML_NAV, "nav"),
CNameToHtmlElement(HTML_NOEMBED, "noembed"),
CNameToHtmlElement(HTML_NOSCRIPT, "noscript"),
CNameToHtmlElement(HTML_OBJECT, "object"),
CNameToHtmlElement(HTML_OL, "ol"),
CNameToHtmlElement(HTML_OPTGROUP, "optgroup"),
CNameToHtmlElement(HTML_OPTION, "option"),
CNameToHtmlElement(HTML_OUTPUT, "output"),
CNameToHtmlElement(HTML_P, "p"),
CNameToHtmlElement(HTML_PARAM, "param"),
CNameToHtmlElement(HTML_PICTURE, "picture"),
CNameToHtmlElement(HTML_PRE, "pre"),
CNameToHtmlElement(HTML_PROGRESS, "progress"),
CNameToHtmlElement(HTML_Q, "q"),
CNameToHtmlElement(HTML_RB, "rb"),
CNameToHtmlElement(HTML_RP, "rp"),
CNameToHtmlElement(HTML_RT, "rt"),
CNameToHtmlElement(HTML_RTC, "rtc"),
CNameToHtmlElement(HTML_RUBY, "ruby"),
CNameToHtmlElement(HTML_S, "s"),
CNameToHtmlElement(HTML_SAMP, "samp"),
CNameToHtmlElement(HTML_SCRIPT, "script"),
CNameToHtmlElement(HTML_SECTION, "section"),
CNameToHtmlElement(HTML_SELECT, "select"),
CNameToHtmlElement(HTML_SMALL, "small"),
CNameToHtmlElement(HTML_SOURCE, "source"),
CNameToHtmlElement(HTML_SPAN, "span"),
CNameToHtmlElement(HTML_STRONG, "strong"),
CNameToHtmlElement(HTML_STYLE, "style"),
CNameToHtmlElement(HTML_SUB, "sub"),
CNameToHtmlElement(HTML_SUMMARY, "summary"),
CNameToHtmlElement(HTML_SUP, "sup"),
CNameToHtmlElement(HTML_TABLE, "table"),
CNameToHtmlElement(HTML_TBODY, "tbody"),
CNameToHtmlElement(HTML_TD, "td"),
CNameToHtmlElement(HTML_TEXTAREA, "textarea"),
CNameToHtmlElement(HTML_TFOOT, "tfoot"),
CNameToHtmlElement(HTML_TH, "th"),
CNameToHtmlElement(HTML_THEAD, "thead"),
CNameToHtmlElement(HTML_TIME, "time"),
CNameToHtmlElement(HTML_TITLE, "title"),
CNameToHtmlElement(HTML_TR, "tr"),
CNameToHtmlElement(HTML_TRACK, "track"),
CNameToHtmlElement(HTML_TT, "tt"),
CNameToHtmlElement(HTML_U, "u"),
CNameToHtmlElement(HTML_UL, "ul"),
CNameToHtmlElement(HTML_VAR, "var"),
CNameToHtmlElement(HTML_VIDEO, "video"),
CNameToHtmlElement(HTML_WBR, "wbr")
};
HTMLElement htmlElementLookup(const char* name)
{
uint end = sizeofarray(htmlElementToName);
uint mid = end >> 1;
sint ret;
while(mid < end)
{
sint ret = nlstricmp(name, htmlElementToName[mid].Name);
if (ret == 0)
{
return htmlElementToName[mid].ID;
}
else if (ret < 0)
{
// lower half
end = mid;
mid = end >> 1;
}
else
{
// upper half
mid++;
mid += (end - mid) >> 1;
}
}
// not found
return HTML_NB_ELEMENTS;
}
// *************************************************************************** // ***************************************************************************
@ -40,258 +201,6 @@ namespace NLGUI
// *************************************************************************** // ***************************************************************************
// Some DTD table
// Here, modify the DTD table to change the HTML parser (add new tags for examples)
#undef HTML_ATTR
#define HTML_ATTR(a,b) { (char*) #b }
HTAttr html_attr[] =
{
HTML_ATTR(HTML,DIR),
HTML_ATTR(HTML,LANG),
HTML_ATTR(HTML,VERSION),
HTML_ATTR(HTML,STYLE),
{ 0 }
};
HTAttr a_attr[] =
{
HTML_ATTR(A,ACCESSKEY),
HTML_ATTR(A,CHARSET),
HTML_ATTR(A,CLASS),
HTML_ATTR(A,COORDS),
HTML_ATTR(A,DIR),
HTML_ATTR(A,HREF),
HTML_ATTR(A,HREFLANG),
HTML_ATTR(A,ID),
HTML_ATTR(A,NAME),
HTML_ATTR(A,REL),
HTML_ATTR(A,REV),
HTML_ATTR(A,SHAPE),
HTML_ATTR(A,STYLE),
HTML_ATTR(A,TABINDEX),
HTML_ATTR(A,TARGET),
HTML_ATTR(A,TYPE),
HTML_ATTR(A,TITLE),
HTML_ATTR(A,Z_ACTION_CATEGORY),
HTML_ATTR(A,Z_ACTION_PARAMS),
HTML_ATTR(A,Z_ACTION_SHORTCUT),
{ 0 }
};
HTAttr table_attr[] =
{
HTML_ATTR(TABLE,ALIGN),
HTML_ATTR(TABLE,BGCOLOR),
HTML_ATTR(TABLE,BORDER),
HTML_ATTR(TABLE,BORDERCOLOR),
HTML_ATTR(TABLE,CELLPADDING),
HTML_ATTR(TABLE,CELLSPACING),
HTML_ATTR(TABLE,CLASS),
HTML_ATTR(TABLE,DIR),
HTML_ATTR(TABLE,FRAME),
HTML_ATTR(TABLE,ID),
HTML_ATTR(TABLE,L_MARGIN),
HTML_ATTR(TABLE,LANG),
HTML_ATTR(TABLE,NOWRAP),
HTML_ATTR(TABLE,RULES),
HTML_ATTR(TABLE,SUMMARY),
HTML_ATTR(TABLE,STYLE),
HTML_ATTR(TABLE,TITLE),
HTML_ATTR(TABLE,VALIGN),
HTML_ATTR(TABLE,WIDTH),
{ 0 }
};
HTAttr tr_attr[] =
{
HTML_ATTR(TR,ALIGN),
HTML_ATTR(TR,BGCOLOR),
HTML_ATTR(TR,L_MARGIN),
HTML_ATTR(TR,NOWRAP),
HTML_ATTR(TR,VALIGN),
HTML_ATTR(TR,STYLE),
{ 0 }
};
HTAttr td_attr[] =
{
HTML_ATTR(TD,ABBR),
HTML_ATTR(TD,ALIGN),
HTML_ATTR(TD,AXIS),
HTML_ATTR(TD,BGCOLOR),
HTML_ATTR(TD,CHAR),
HTML_ATTR(TD,CHAROFF),
HTML_ATTR(TD,CLASS),
HTML_ATTR(TD,COLSPAN),
HTML_ATTR(TD,DIR),
HTML_ATTR(TD,ID),
HTML_ATTR(TD,HEADERS),
HTML_ATTR(TD,HEIGHT),
HTML_ATTR(TD,L_MARGIN),
HTML_ATTR(TD,LANG),
HTML_ATTR(TD,NOWRAP),
HTML_ATTR(TD,ROWSPAN),
HTML_ATTR(TD,SCOPE),
HTML_ATTR(TD,STYLE),
HTML_ATTR(TD,TITLE),
HTML_ATTR(TD,VALIGN),
HTML_ATTR(TD,WIDTH),
{ 0 }
};
HTAttr img_attr[] =
{
HTML_ATTR(IMG,ALIGN),
HTML_ATTR(IMG,ALT),
HTML_ATTR(IMG,BORDER),
HTML_ATTR(IMG,CLASS),
HTML_ATTR(IMG,DIR),
HTML_ATTR(IMG,GLOBAL_COLOR),
HTML_ATTR(IMG,HEIGHT),
HTML_ATTR(IMG,HSPACE),
HTML_ATTR(IMG,ID),
HTML_ATTR(IMG,ISMAP),
HTML_ATTR(IMG,LANG),
HTML_ATTR(IMG,LONGDESC),
HTML_ATTR(IMG,SRC),
HTML_ATTR(IMG,STYLE),
HTML_ATTR(IMG,TITLE),
HTML_ATTR(IMG,USEMAP),
HTML_ATTR(IMG,VSPACE),
HTML_ATTR(IMG,WIDTH),
// not sorted to keep enum values
HTML_ATTR(IMG,DATA-OVER-SRC),
{ 0 }
};
HTAttr input_attr[] =
{
HTML_ATTR(INPUT,ACCEPT),
HTML_ATTR(INPUT,ACCESSKEY),
HTML_ATTR(INPUT,ALIGN),
HTML_ATTR(INPUT,ALT),
HTML_ATTR(INPUT,CHECKED),
HTML_ATTR(INPUT,CLASS),
HTML_ATTR(INPUT,DIR),
HTML_ATTR(INPUT,DISABLED),
HTML_ATTR(INPUT,GLOBAL_COLOR),
HTML_ATTR(INPUT,ID),
HTML_ATTR(INPUT,LANG),
HTML_ATTR(INPUT,MAXLENGTH),
HTML_ATTR(INPUT,NAME),
HTML_ATTR(INPUT,READONLY),
HTML_ATTR(INPUT,SIZE),
HTML_ATTR(INPUT,SRC),
HTML_ATTR(INPUT,STYLE),
HTML_ATTR(INPUT,TABINDEX),
HTML_ATTR(INPUT,TITLE),
HTML_ATTR(INPUT,TYPE),
HTML_ATTR(INPUT,USEMAP),
HTML_ATTR(INPUT,VALUE),
HTML_ATTR(INPUT,Z_BTN_TMPL),
HTML_ATTR(INPUT,Z_INPUT_TMPL),
HTML_ATTR(INPUT,Z_INPUT_WIDTH),
{ 0 }
};
HTAttr textarea_attr[] =
{
HTML_ATTR(TEXTAREA,CLASS),
HTML_ATTR(TEXTAREA,COLS),
HTML_ATTR(TEXTAREA,DIR),
HTML_ATTR(TEXTAREA,DISABLED),
HTML_ATTR(TEXTAREA,ID),
HTML_ATTR(TEXTAREA,LANG),
HTML_ATTR(TEXTAREA,MAXLENGTH),
HTML_ATTR(TEXTAREA,NAME),
HTML_ATTR(TEXTAREA,READONLY),
HTML_ATTR(TEXTAREA,ROWS),
HTML_ATTR(TEXTAREA,STYLE),
HTML_ATTR(TEXTAREA,TABINDEX),
HTML_ATTR(TEXTAREA,TITLE),
HTML_ATTR(TEXTAREA,Z_INPUT_TMPL),
{ 0 }
};
HTAttr p_attr[] =
{
HTML_ATTR(P,QUICK_HELP_CONDITION),
HTML_ATTR(P,QUICK_HELP_EVENTS),
HTML_ATTR(P,QUICK_HELP_LINK),
HTML_ATTR(P,NAME),
HTML_ATTR(P,STYLE),
{ 0 }
};
HTAttr div_attr[] =
{
HTML_ATTR(DIV,CLASS),
HTML_ATTR(DIV,ID),
HTML_ATTR(DIV,NAME),
HTML_ATTR(DIV,STYLE),
{ 0 }
};
HTAttr span_attr[] =
{
HTML_ATTR(SPAN,CLASS),
HTML_ATTR(SPAN,ID),
HTML_ATTR(SPAN,STYLE),
{ 0 }
};
HTAttr h1_attr[] =
{
HTML_ATTR(H1,CLASS),
HTML_ATTR(H1,ID),
HTML_ATTR(H1,STYLE),
{ 0 }
};
HTAttr h2_attr[] =
{
HTML_ATTR(H2,CLASS),
HTML_ATTR(H2,ID),
HTML_ATTR(H2,STYLE),
{ 0 }
};
HTAttr h3_attr[] =
{
HTML_ATTR(H3,CLASS),
HTML_ATTR(H3,ID),
HTML_ATTR(H3,STYLE),
{ 0 }
};
HTAttr h4_attr[] =
{
HTML_ATTR(H4,CLASS),
HTML_ATTR(H4,ID),
HTML_ATTR(H4,STYLE),
{ 0 }
};
HTAttr h5_attr[] =
{
HTML_ATTR(H5,CLASS),
HTML_ATTR(H5,ID),
HTML_ATTR(H5,STYLE),
{ 0 }
};
HTAttr h6_attr[] =
{
HTML_ATTR(H6,CLASS),
HTML_ATTR(H6,ID),
HTML_ATTR(H6,STYLE),
{ 0 }
};
// *************************************************************************** // ***************************************************************************
bool getCssLength (float &value, std::string &unit, const std::string &str) bool getCssLength (float &value, std::string &unit, const std::string &str)
{ {
@ -873,58 +782,6 @@ namespace NLGUI
} }
} }
void initLibWWW()
{
static bool initialized = false;
if (!initialized)
{
// Change the HTML DTD
SGML_dtd *HTML_DTD = HTML_dtd ();
HTML_DTD->tags[HTML_HTML].attributes = html_attr;
HTML_DTD->tags[HTML_HTML].number_of_attributes = sizeof(html_attr) / sizeof(HTAttr) - 1;
HTML_DTD->tags[HTML_TABLE].attributes = table_attr;
HTML_DTD->tags[HTML_TABLE].number_of_attributes = sizeof(table_attr) / sizeof(HTAttr) - 1;
HTML_DTD->tags[HTML_TR].attributes = tr_attr;
HTML_DTD->tags[HTML_TR].number_of_attributes = sizeof(tr_attr) / sizeof(HTAttr) - 1;
HTML_DTD->tags[HTML_TD].attributes = td_attr;
HTML_DTD->tags[HTML_TD].number_of_attributes = sizeof(td_attr) / sizeof(HTAttr) - 1;
HTML_DTD->tags[HTML_TH].attributes = td_attr;
HTML_DTD->tags[HTML_TH].number_of_attributes = sizeof(td_attr) / sizeof(HTAttr) - 1;
HTML_DTD->tags[HTML_IMG].attributes = img_attr;
HTML_DTD->tags[HTML_IMG].number_of_attributes = sizeof(img_attr) / sizeof(HTAttr) - 1;
HTML_DTD->tags[HTML_INPUT].attributes = input_attr;
HTML_DTD->tags[HTML_INPUT].number_of_attributes = sizeof(input_attr) / sizeof(HTAttr) - 1;
HTML_DTD->tags[HTML_TEXTAREA].attributes = textarea_attr;
HTML_DTD->tags[HTML_TEXTAREA].number_of_attributes = sizeof(textarea_attr) / sizeof(HTAttr) - 1;
HTML_DTD->tags[HTML_P].attributes = p_attr;
HTML_DTD->tags[HTML_P].number_of_attributes = sizeof(p_attr) / sizeof(HTAttr) - 1;
HTML_DTD->tags[HTML_A].attributes = a_attr;
HTML_DTD->tags[HTML_A].number_of_attributes = sizeof(a_attr) / sizeof(HTAttr) - 1;
//HTML_DTD->tags[HTML_I].attributes = a_attr;
HTML_DTD->tags[HTML_I].number_of_attributes = 0;
HTML_DTD->tags[HTML_DIV].attributes = div_attr;
HTML_DTD->tags[HTML_DIV].number_of_attributes = sizeof(div_attr) / sizeof(HTAttr) - 1;
HTML_DTD->tags[HTML_SPAN].attributes = span_attr;
HTML_DTD->tags[HTML_SPAN].number_of_attributes = sizeof(span_attr) / sizeof(HTAttr) - 1;
HTML_DTD->tags[HTML_H1].attributes = h1_attr;
HTML_DTD->tags[HTML_H1].number_of_attributes = sizeof(h1_attr) / sizeof(HTAttr) - 1;
HTML_DTD->tags[HTML_H2].attributes = h2_attr;
HTML_DTD->tags[HTML_H2].number_of_attributes = sizeof(h2_attr) / sizeof(HTAttr) - 1;
HTML_DTD->tags[HTML_H3].attributes = h3_attr;
HTML_DTD->tags[HTML_H3].number_of_attributes = sizeof(h3_attr) / sizeof(HTAttr) - 1;
HTML_DTD->tags[HTML_H4].attributes = h4_attr;
HTML_DTD->tags[HTML_H4].number_of_attributes = sizeof(h4_attr) / sizeof(HTAttr) - 1;
HTML_DTD->tags[HTML_H5].attributes = h5_attr;
HTML_DTD->tags[HTML_H5].number_of_attributes = sizeof(h5_attr) / sizeof(HTAttr) - 1;
HTML_DTD->tags[HTML_H6].attributes = h6_attr;
HTML_DTD->tags[HTML_H6].number_of_attributes = sizeof(h6_attr) / sizeof(HTAttr) - 1;
// Initialized
initialized = true;
}
}
// *************************************************************************** // ***************************************************************************
} }

View file

@ -1,804 +0,0 @@
/**
libwww Copyright Notice
[This notice should be placed within redistributed or derivative software
code when appropriate. This particular formulation of W3C's notice for
inclusion in libwww code became active on August 14 1998.]
LIBWWW COPYRIGHT NOTICE
libwww: W3C's implementation of HTTP can be found at:
http://www.w3.org/Library/
Copyright ¨ 1995-2002 World Wide Web Consortium,
(Massachusetts Institute of Technology, Institut
National de Recherche en Informatique et en
Automatique, Keio University). All Rights Reserved.
This program is distributed under the W3C's
Intellectual Property License. This program is
distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied
warranty of MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE. See W3C License
http://www.w3.org/Consortium/Legal/ for more details.
Copyright ¨ 1995 CERN. "This product includes computer
software created and made available by CERN. This
acknowledgment shall be mentioned in full in any
product which includes the CERN computer software
included herein or parts thereof."
****************************************************************************/
#include "stdpch.h"
#include "nel/gui/libwww_types.h"
#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif
namespace NLGUI
{
/*
** ATTRIBUTE DEFINITION MACROS (see HTMLPDTD.h)
*/
/*
* redefine the macros, so that the "stringized" attribute name
* is generated
*/
#undef HTML_ATTR
#define HTML_ATTR(t,a) { (char *) #a }
#undef HTML_ATTRIBUTES
#define HTML_ATTRIBUTES(t) { 0 }
/*
** ATTRIBUTE LISTS
*/
static HTAttr no_attr[1] = {
{ 0 }
};
static HTAttr body_attr[HTML_BODY_ATTRIBUTES+1] = { /* to catch images */
HTML_ATTR(BODY,ALINK),
HTML_ATTR(BODY,BACKGROUND),
HTML_ATTR(BODY,BGCOLOR),
HTML_ATTR(BODY,CLASS),
HTML_ATTR(BODY,DIR),
HTML_ATTR(BODY,ID),
HTML_ATTR(BODY,LANG),
HTML_ATTR(BODY,LINK),
HTML_ATTR(BODY,STYLE),
HTML_ATTR(BODY,TEXT),
HTML_ATTR(BODY,TITLE),
HTML_ATTR(BODY,VLINK),
HTML_ATTRIBUTES(BODY)
};
static HTAttr frame_attr[HTML_FRAME_ATTRIBUTES+1] = { /* frame attributes */
HTML_ATTR(FRAME,CLASS),
HTML_ATTR(FRAME,FRAMEBORDER),
HTML_ATTR(FRAME,ID),
HTML_ATTR(FRAME,NAME),
HTML_ATTR(FRAME,MARGINHEIGHT),
HTML_ATTR(FRAME,MARGINWIDTH),
HTML_ATTR(FRAME,NORESIZE),
HTML_ATTR(FRAME,LONGDESC),
HTML_ATTR(FRAME,SCROLLING),
HTML_ATTR(FRAME,SRC),
HTML_ATTR(FRAME,STYLE),
HTML_ATTR(FRAME,TARGET),
HTML_ATTR(FRAME,TITLE),
HTML_ATTRIBUTES(FRAME)
};
static HTAttr frameset_attr[HTML_FRAMESET_ATTRIBUTES+1] = { /* frameset attributes */
HTML_ATTR(FRAMESET,CLASS),
HTML_ATTR(FRAMESET,COLS),
HTML_ATTR(FRAMESET,ID),
HTML_ATTR(FRAMESET,ROWS),
HTML_ATTR(FRAMESET,STYLE),
HTML_ATTR(FRAMESET,TITLE),
HTML_ATTRIBUTES(FRAMESET)
};
static HTAttr a_attr[HTML_A_ATTRIBUTES+1] = { /* Anchor attributes */
HTML_ATTR(A,ACCESSKEY),
HTML_ATTR(A,CHARSET),
HTML_ATTR(A,CLASS),
HTML_ATTR(A,COORDS),
HTML_ATTR(A,DIR),
HTML_ATTR(A,HREF),
HTML_ATTR(A,HREFLANG),
HTML_ATTR(A,ID),
HTML_ATTR(A,NAME),
HTML_ATTR(A,REL),
HTML_ATTR(A,REV),
HTML_ATTR(A,SHAPE),
HTML_ATTR(A,STYLE),
HTML_ATTR(A,TABINDEX),
HTML_ATTR(A,TARGET),
HTML_ATTR(A,TYPE),
HTML_ATTR(A,TITLE),
HTML_ATTRIBUTES(A)
};
static HTAttr applet_attr[HTML_APPLET_ATTRIBUTES+1] = {
HTML_ATTR(APPLET,ALIGN),
HTML_ATTR(APPLET,ALT),
HTML_ATTR(APPLET,ARCHIVE),
HTML_ATTR(APPLET,CLASS),
HTML_ATTR(APPLET,CODE),
HTML_ATTR(APPLET,CODEBASE),
HTML_ATTR(APPLET,HEIGHT),
HTML_ATTR(APPLET,HSPACE),
HTML_ATTR(APPLET,ID),
HTML_ATTR(APPLET,NAME),
HTML_ATTR(APPLET,OBJECT),
HTML_ATTR(APPLET,STYLE),
HTML_ATTR(APPLET,TITLE),
HTML_ATTR(APPLET,VSPACE),
HTML_ATTR(APPLET,WIDTH),
HTML_ATTRIBUTES(APPLET)
};
static HTAttr area_attr[HTML_AREA_ATTRIBUTES+1] = { /* Area attributes */
HTML_ATTR(AREA,ACCESSKEY),
HTML_ATTR(AREA,ALT),
HTML_ATTR(AREA,CLASS),
HTML_ATTR(AREA,COORDS),
HTML_ATTR(AREA,DIR),
HTML_ATTR(AREA,HREF),
HTML_ATTR(AREA,ID),
HTML_ATTR(AREA,NAME),
HTML_ATTR(AREA,NOHREF),
HTML_ATTR(AREA,LANG),
HTML_ATTR(AREA,SHAPE),
HTML_ATTR(AREA,STYLE),
HTML_ATTR(AREA,TABINDEX),
HTML_ATTR(AREA,TARGET),
HTML_ATTR(AREA,TITLE),
HTML_ATTRIBUTES(AREA)
};
static HTAttr base_attr[HTML_BASE_ATTRIBUTES+1] = { /* BASE attributes */
HTML_ATTR(BASE,HREF),
HTML_ATTR(BASE,TARGET),
HTML_ATTRIBUTES(BASE)
};
static HTAttr bdo_attr[HTML_BDO_ATTRIBUTES+1] = {
HTML_ATTR(BDO,CLASS),
HTML_ATTR(BDO,DIR),
HTML_ATTR(BDO,ID),
HTML_ATTR(BDO,LANG),
HTML_ATTR(BDO,STYLE),
HTML_ATTR(BDO,TITLE),
HTML_ATTRIBUTES(BDO)
};
static HTAttr bq_attr[HTML_BQ_ATTRIBUTES+1] = {
HTML_ATTR(BQ,CITE),
HTML_ATTR(BQ,CLASS),
HTML_ATTR(BQ,DIR),
HTML_ATTR(BQ,ID),
HTML_ATTR(BQ,LANG),
HTML_ATTR(BQ,STYLE),
HTML_ATTR(BQ,TITLE),
HTML_ATTRIBUTES(BQ)
};
static HTAttr br_attr[HTML_BR_ATTRIBUTES+1] = {
HTML_ATTR(BR,CLASS),
HTML_ATTR(BR,CLEAR),
HTML_ATTR(BR,ID),
HTML_ATTR(BR,STYLE),
HTML_ATTR(BR,TITLE),
HTML_ATTRIBUTES(BR)
};
static HTAttr button_attr[HTML_BUTTON_ATTRIBUTES+1] = {
HTML_ATTR(BUTTON,ACCESSKEY),
HTML_ATTR(BUTTON,CLASS),
HTML_ATTR(BUTTON,DIR),
HTML_ATTR(BUTTON,DISABLED),
HTML_ATTR(BUTTON,ID),
HTML_ATTR(BUTTON,LANG),
HTML_ATTR(BUTTON,NAME),
HTML_ATTR(BUTTON,STYLE),
HTML_ATTR(BUTTON,TABINDEX),
HTML_ATTR(BUTTON,TITLE),
HTML_ATTR(BUTTON,TYPE),
HTML_ATTR(BUTTON,VALUE),
HTML_ATTRIBUTES(BUTTON),
};
static HTAttr col_attr[HTML_COL_ATTRIBUTES+1] = {
HTML_ATTR(COL,CLASS),
HTML_ATTR(COL,DIR),
HTML_ATTR(COL,ID),
HTML_ATTR(COL,LANG),
HTML_ATTR(COL,SPAN),
HTML_ATTR(COL,STYLE),
HTML_ATTR(COL,TITLE),
HTML_ATTR(COL,WIDTH),
HTML_ATTRIBUTES(COL)
};
static HTAttr changes_attr[HTML_CHANGES_ATTRIBUTES+1] = {
HTML_ATTR(CHANGES,CITE),
HTML_ATTR(CHANGES,CLASS),
HTML_ATTR(CHANGES,DATETIME),
HTML_ATTR(CHANGES,DIR),
HTML_ATTR(CHANGES,ID),
HTML_ATTR(CHANGES,LANG),
HTML_ATTR(CHANGES,STYLE),
HTML_ATTR(CHANGES,TITLE),
HTML_ATTRIBUTES(CHANGES)
};
static HTAttr font_attr[HTML_FONT_ATTRIBUTES+1] = {
HTML_ATTR(FONT,CLASS),
HTML_ATTR(FONT,COLOR),
HTML_ATTR(FONT,DIR),
HTML_ATTR(FONT,FACE),
HTML_ATTR(FONT,ID),
HTML_ATTR(FONT,LANG),
HTML_ATTR(FONT,SIZE),
HTML_ATTR(FONT,STYLE),
HTML_ATTR(FONT,TITLE),
HTML_ATTRIBUTES(FONT)
};
static HTAttr form_attr[HTML_FORM_ATTRIBUTES+1] = {
HTML_ATTR(FORM,ACCEPT),
{ (char *) "ACCEPT-CHARSET" }, /* HTML_ATTR(FORM,ACCEPT_CHARSET) */
HTML_ATTR(FORM,ACTION),
HTML_ATTR(FORM,CLASS),
HTML_ATTR(FORM,DIR),
HTML_ATTR(FORM,ENCTYPE),
HTML_ATTR(FORM,ID),
HTML_ATTR(FORM,LANG),
HTML_ATTR(FORM,METHOD),
HTML_ATTR(FORM,STYLE),
HTML_ATTR(FORM,TARGET),
HTML_ATTR(FORM,TITLE),
HTML_ATTRIBUTES(FORM)
};
static HTAttr gen_attr[HTML_GEN_ATTRIBUTES+1] = { /* General, for many things */
HTML_ATTR(GEN,CLASS),
HTML_ATTR(GEN,DIR),
HTML_ATTR(GEN,ID),
HTML_ATTR(GEN,LANG),
HTML_ATTR(GEN,STYLE),
HTML_ATTR(GEN,TITLE),
HTML_ATTRIBUTES(GEN)
};
static HTAttr block_attr[HTML_BLOCK_ATTRIBUTES+1] = { /* DIV, SPAN, H1-H6 */
HTML_ATTR(BLOCK,ALIGN),
HTML_ATTR(BLOCK,CLASS),
HTML_ATTR(BLOCK,DIR),
HTML_ATTR(BLOCK,ID),
HTML_ATTR(BLOCK,LANG),
HTML_ATTR(BLOCK,STYLE),
HTML_ATTR(BLOCK,TITLE),
HTML_ATTRIBUTES(BLOCK)
};
static HTAttr head_attr[HTML_HEAD_ATTRIBUTES+1] = {
HTML_ATTR(HEAD,DIR),
HTML_ATTR(HEAD,LANG),
HTML_ATTR(HEAD,PROFILE),
HTML_ATTRIBUTES(HEAD)
};
static HTAttr hr_attr[HTML_HR_ATTRIBUTES+1] = {
HTML_ATTR(HR,ALIGN),
HTML_ATTR(HR,CLASS),
HTML_ATTR(HR,DIR),
HTML_ATTR(HR,ID),
HTML_ATTR(HR,LANG),
HTML_ATTR(HR,NOSHADE),
HTML_ATTR(HR,SIZE),
HTML_ATTR(HR,STYLE),
HTML_ATTR(HR,TITLE),
HTML_ATTR(HR,WIDTH),
HTML_ATTRIBUTES(HR)
};
static HTAttr html_attr[HTML_HTML_ATTRIBUTES+1] = {
HTML_ATTR(HTML,DIR),
HTML_ATTR(HTML,LANG),
HTML_ATTR(HTML,VERSION),
HTML_ATTRIBUTES(HTML)
};
static HTAttr iframe_attr[HTML_IFRAME_ATTRIBUTES+1] = {
HTML_ATTR(IFRAME,ALIGN),
HTML_ATTR(IFRAME,CLASS),
HTML_ATTR(IFRAME,FRAMEBORDER),
HTML_ATTR(IFRAME,HEIGHT),
HTML_ATTR(IFRAME,ID),
HTML_ATTR(IFRAME,LONGDESC),
HTML_ATTR(IFRAME,MARGINHEIGHT),
HTML_ATTR(IFRAME,MARGINWIDTH),
HTML_ATTR(IFRAME,NAME),
HTML_ATTR(IFRAME,SCROLLING),
HTML_ATTR(IFRAME,SRC),
HTML_ATTR(IFRAME,STYLE),
HTML_ATTR(IFRAME,TARGET),
HTML_ATTR(IFRAME,TITLE),
HTML_ATTR(IFRAME,WIDTH),
HTML_ATTRIBUTES(IFRAME)
};
static HTAttr img_attr[HTML_IMG_ATTRIBUTES+1] = { /* IMG attributes */
HTML_ATTR(IMG,ALIGN),
HTML_ATTR(IMG,ALT),
HTML_ATTR(IMG,BORDER),
HTML_ATTR(IMG,CLASS),
HTML_ATTR(IMG,DIR),
HTML_ATTR(IMG,HEIGHT),
HTML_ATTR(IMG,HSPACE),
HTML_ATTR(IMG,ID),
HTML_ATTR(IMG,ISMAP),
HTML_ATTR(IMG,LANG),
HTML_ATTR(IMG,LONGDESC),
HTML_ATTR(IMG,SRC),
HTML_ATTR(IMG,STYLE),
HTML_ATTR(IMG,TITLE),
HTML_ATTR(IMG,USEMAP),
HTML_ATTR(IMG,VSPACE),
HTML_ATTR(IMG,WIDTH),
HTML_ATTRIBUTES(IMG)
};
static HTAttr input_attr[HTML_INPUT_ATTRIBUTES+1] = {
HTML_ATTR(INPUT,ACCEPT),
HTML_ATTR(INPUT,ACCESSKEY),
HTML_ATTR(INPUT,ALIGN),
HTML_ATTR(INPUT,ALT),
HTML_ATTR(INPUT,CHECKED),
HTML_ATTR(INPUT,CLASS),
HTML_ATTR(INPUT,DIR),
HTML_ATTR(INPUT,DISABLED),
HTML_ATTR(INPUT,ID),
HTML_ATTR(INPUT,LANG),
HTML_ATTR(INPUT,MAXLENGTH),
HTML_ATTR(INPUT,NAME),
HTML_ATTR(INPUT,READONLY),
HTML_ATTR(INPUT,SIZE),
HTML_ATTR(INPUT,SRC),
HTML_ATTR(INPUT,STYLE),
HTML_ATTR(INPUT,TABINDEX),
HTML_ATTR(INPUT,TITLE),
HTML_ATTR(INPUT,TYPE),
HTML_ATTR(INPUT,USEMAP),
HTML_ATTR(INPUT,VALUE),
HTML_ATTRIBUTES(INPUT)
};
static HTAttr isindex_attr[HTML_ISINDEX_ATTRIBUTES+1] = {
HTML_ATTR(ISINDEX,CLASS),
HTML_ATTR(ISINDEX,DIR),
HTML_ATTR(ISINDEX,ID),
HTML_ATTR(ISINDEX,LANG),
HTML_ATTR(ISINDEX,PROMPT),
HTML_ATTR(ISINDEX,STYLE),
HTML_ATTR(ISINDEX,TITLE),
HTML_ATTRIBUTES(ISINDEX)
};
static HTAttr label_attr[HTML_LABEL_ATTRIBUTES+1] = {
HTML_ATTR(LABEL,ACCESSKEY),
HTML_ATTR(LABEL,CLASS),
HTML_ATTR(LABEL,DIR),
HTML_ATTR(LABEL,FOR),
HTML_ATTR(LABEL,ID),
HTML_ATTR(LABEL,LANG),
HTML_ATTR(LABEL,STYLE),
HTML_ATTR(LABEL,TITLE),
HTML_ATTRIBUTES(LABEL)
};
static HTAttr legend_attr[HTML_LEGEND_ATTRIBUTES+1] = {
HTML_ATTR(LEGEND,ACCESSKEY),
HTML_ATTR(LEGEND,ALIGN),
HTML_ATTR(LEGEND,CLASS),
HTML_ATTR(LEGEND,DIR),
HTML_ATTR(LEGEND,ID),
HTML_ATTR(LEGEND,LANG),
HTML_ATTR(LEGEND,STYLE),
HTML_ATTR(LEGEND,TITLE),
HTML_ATTRIBUTES(LEGEND)
};
static HTAttr li_attr[HTML_LI_ATTRIBUTES+1] = {
HTML_ATTR(LI,CLASS),
HTML_ATTR(LI,COMPACT),
HTML_ATTR(LI,DIR),
HTML_ATTR(LI,ID),
HTML_ATTR(LI,LANG),
HTML_ATTR(LI,STYLE),
HTML_ATTR(LI,TITLE),
HTML_ATTR(LI,TYPE),
HTML_ATTR(LI,VALUE),
HTML_ATTRIBUTES(LI)
};
static HTAttr link_attr[HTML_LINK_ATTRIBUTES+1] = { /* link attributes */
HTML_ATTR(LINK,CHARSET),
HTML_ATTR(LINK,CLASS),
HTML_ATTR(LINK,DIR),
HTML_ATTR(LINK,HREF),
HTML_ATTR(LINK,HREFLANG),
HTML_ATTR(LINK,ID),
HTML_ATTR(LINK,LANG),
HTML_ATTR(LINK,MEDIA),
HTML_ATTR(LINK,REL),
HTML_ATTR(LINK,REV),
HTML_ATTR(LINK,STYLE),
HTML_ATTR(LINK,TARGET),
HTML_ATTR(LINK,TITLE),
HTML_ATTR(LINK,TYPE),
HTML_ATTRIBUTES(LINK)
};
static HTAttr map_attr[HTML_MAP_ATTRIBUTES+1] = {
HTML_ATTR(MAP,CLASS),
HTML_ATTR(MAP,DIR),
HTML_ATTR(MAP,ID),
HTML_ATTR(MAP,LANG),
HTML_ATTR(MAP,NAME),
HTML_ATTR(MAP,STYLE),
HTML_ATTR(MAP,TITLE),
HTML_ATTRIBUTES(MAP)
};
static HTAttr meta_attr[HTML_META_ATTRIBUTES+1] = {
HTML_ATTR(META,CONTENT),
HTML_ATTR(META,DIR),
{ (char *)"HTTP-EQUIV" }, /* HTML_ATTR(META,HTTP_EQUIV) */
HTML_ATTR(META,LANG),
HTML_ATTR(META,NAME),
HTML_ATTR(META,SCHEME),
HTML_ATTRIBUTES(META)
};
static HTAttr nextid_attr[HTML_NEXTID_ATTRIBUTES+1] = {
{ (char *)"N" },
{ 0 } /* Terminate list */
};
static HTAttr object_attr[HTML_OBJECT_ATTRIBUTES+1] = { /* object attributes */
HTML_ATTR(OBJECT,ALIGN),
HTML_ATTR(OBJECT,ARCHIVE),
HTML_ATTR(OBJECT,BORDER),
HTML_ATTR(OBJECT,CLASS),
HTML_ATTR(OBJECT,CLASSID),
HTML_ATTR(OBJECT,CODEBASE),
HTML_ATTR(OBJECT,CODETYPE),
HTML_ATTR(OBJECT,DATA),
HTML_ATTR(OBJECT,DECLARE),
HTML_ATTR(OBJECT,DIR),
HTML_ATTR(OBJECT,HEIGHT),
HTML_ATTR(OBJECT,HSPACE),
HTML_ATTR(OBJECT,ID),
HTML_ATTR(OBJECT,LANG),
HTML_ATTR(OBJECT,NAME),
HTML_ATTR(OBJECT,STANDBY),
HTML_ATTR(OBJECT,STYLE),
HTML_ATTR(OBJECT,TABINDEX),
HTML_ATTR(OBJECT,TITLE),
HTML_ATTR(OBJECT,TYPE),
HTML_ATTR(OBJECT,USEMAP),
HTML_ATTR(OBJECT,VSPACE),
HTML_ATTR(OBJECT,WIDTH),
HTML_ATTRIBUTES(OBJECT)
};
static HTAttr ol_attr[HTML_OL_ATTRIBUTES+1] = {
HTML_ATTR(OL,CLASS),
HTML_ATTR(OL,COMPACT),
HTML_ATTR(OL,DIR),
HTML_ATTR(OL,ID),
HTML_ATTR(OL,LANG),
HTML_ATTR(OL,START),
HTML_ATTR(OL,STYLE),
HTML_ATTR(OL,TITLE),
HTML_ATTR(OL,TYPE),
HTML_ATTRIBUTES(OL)
};
static HTAttr optgroup_attr[HTML_OPTGROUP_ATTRIBUTES+1] = {
HTML_ATTR(OPTGROUP,CLASS),
HTML_ATTR(OPTGROUP,DISABLED),
HTML_ATTR(OPTGROUP,DIR),
HTML_ATTR(OPTGROUP,ID),
HTML_ATTR(OPTGROUP,LABEL),
HTML_ATTR(OPTGROUP,LANG),
HTML_ATTR(OPTGROUP,STYLE),
HTML_ATTR(OPTGROUP,TITLE),
HTML_ATTRIBUTES(OPTGROUP)
};
static HTAttr option_attr[HTML_OPTION_ATTRIBUTES+1] = {
HTML_ATTR(OPTION,CLASS),
HTML_ATTR(OPTION,DISABLED),
HTML_ATTR(OPTION,DIR),
HTML_ATTR(OPTION,ID),
HTML_ATTR(OPTION,LABEL),
HTML_ATTR(OPTION,LANG),
HTML_ATTR(OPTION,SELECTED),
HTML_ATTR(OPTION,STYLE),
HTML_ATTR(OPTION,TITLE),
HTML_ATTR(OPTION,VALUE),
HTML_ATTRIBUTES(OPTION)
};
static HTAttr param_attr[HTML_PARAM_ATTRIBUTES+1] = {
HTML_ATTR(PARAM,ID),
HTML_ATTR(PARAM,NAME),
HTML_ATTR(PARAM,TYPE),
HTML_ATTR(PARAM,VALUE),
HTML_ATTR(PARAM,VALUETYPE),
HTML_ATTRIBUTES(PARAM)
};
static HTAttr pre_attr[HTML_PRE_ATTRIBUTES+1] = {
HTML_ATTR(PRE,CLASS),
HTML_ATTR(PRE,DIR),
HTML_ATTR(PRE,ID),
HTML_ATTR(PRE,LANG),
HTML_ATTR(PRE,STYLE),
HTML_ATTR(PRE,TITLE),
HTML_ATTR(PRE,WIDTH),
HTML_ATTRIBUTES(PRE)
};
static HTAttr script_attr[HTML_SCRIPT_ATTRIBUTES+1] = {
HTML_ATTR(SCRIPT,CHARSET),
HTML_ATTR(SCRIPT,DEFER),
HTML_ATTR(SCRIPT,LANGUAGE),
HTML_ATTR(SCRIPT,SRC),
HTML_ATTR(SCRIPT,TYPE),
HTML_ATTRIBUTES(SCRIPT)
};
static HTAttr select_attr[HTML_SELECT_ATTRIBUTES+1] = {
HTML_ATTR(SELECT,CLASS),
HTML_ATTR(SELECT,DIR),
HTML_ATTR(SELECT,DISABLED),
HTML_ATTR(SELECT,ID),
HTML_ATTR(SELECT,LANG),
HTML_ATTR(SELECT,MULTIPLE),
HTML_ATTR(SELECT,NAME),
HTML_ATTR(SELECT,SIZE),
HTML_ATTR(SELECT,STYLE),
HTML_ATTR(SELECT,TABINDEX),
HTML_ATTR(SELECT,TITLE),
HTML_ATTRIBUTES(SELECT)
};
static HTAttr style_attr[HTML_STYLE_ATTRIBUTES+1] = {
HTML_ATTR(STYLE,DIR),
HTML_ATTR(STYLE,LANG),
HTML_ATTR(STYLE,MEDIA),
HTML_ATTR(STYLE,TITLE),
HTML_ATTR(STYLE,TYPE),
HTML_ATTRIBUTES(STYLE)
};
static HTAttr table_attr[HTML_TABLE_ATTRIBUTES+1] = {
HTML_ATTR(TABLE,ALIGN),
HTML_ATTR(TABLE,BGCOLOR),
HTML_ATTR(TABLE,BORDER),
HTML_ATTR(TABLE,CELLPADDING),
HTML_ATTR(TABLE,CELLSPACING),
HTML_ATTR(TABLE,CLASS),
HTML_ATTR(TABLE,DIR),
HTML_ATTR(TABLE,FRAME),
HTML_ATTR(TABLE,ID),
HTML_ATTR(TABLE,LANG),
HTML_ATTR(TABLE,RULES),
HTML_ATTR(TABLE,SUMMARY),
HTML_ATTR(TABLE,STYLE),
HTML_ATTR(TABLE,TITLE),
HTML_ATTR(TABLE,WIDTH),
HTML_ATTRIBUTES(TABLE)
};
static HTAttr tele_attr[HTML_TELE_ATTRIBUTES+1] = {
HTML_ATTR(TELE,ALIGN),
HTML_ATTR(TELE,CHAR),
HTML_ATTR(TELE,CHAROFF),
HTML_ATTR(TELE,CLASS),
HTML_ATTR(TELE,DIR),
HTML_ATTR(TELE,ID),
HTML_ATTR(TELE,LANG),
HTML_ATTR(TELE,STYLE),
HTML_ATTR(TELE,TITLE),
HTML_ATTR(TELE,VALIGN),
HTML_ATTRIBUTES(TELE)
};
static HTAttr td_attr[HTML_TD_ATTRIBUTES+1] = {
HTML_ATTR(TD,ABBR),
HTML_ATTR(TD,ALIGN),
HTML_ATTR(TD,AXIS),
HTML_ATTR(TD,BGCOLOR),
HTML_ATTR(TD,CHAR),
HTML_ATTR(TD,CHAROFF),
HTML_ATTR(TD,CLASS),
HTML_ATTR(TD,COLSPAN),
HTML_ATTR(TD,DIR),
HTML_ATTR(TD,ID),
HTML_ATTR(TD,HEADERS),
HTML_ATTR(TD,HEIGHT),
HTML_ATTR(TD,LANG),
HTML_ATTR(TD,NOWRAP),
HTML_ATTR(TD,ROWSPAN),
HTML_ATTR(TD,SCOPE),
HTML_ATTR(TD,STYLE),
HTML_ATTR(TD,TITLE),
HTML_ATTR(TD,VALIGN),
HTML_ATTR(TD,WIDTH),
HTML_ATTRIBUTES(TD)
};
static HTAttr textarea_attr[HTML_TEXTAREA_ATTRIBUTES+1] = {
HTML_ATTR(TEXTAREA,CLASS),
HTML_ATTR(TEXTAREA,COLS),
HTML_ATTR(TEXTAREA,DIR),
HTML_ATTR(TEXTAREA,DISABLED),
HTML_ATTR(TEXTAREA,ID),
HTML_ATTR(TEXTAREA,LANG),
HTML_ATTR(TEXTAREA,NAME),
HTML_ATTR(TEXTAREA,READONLY),
HTML_ATTR(TEXTAREA,ROWS),
HTML_ATTR(TEXTAREA,STYLE),
HTML_ATTR(TEXTAREA,TABINDEX),
HTML_ATTR(TEXTAREA,TITLE),
HTML_ATTRIBUTES(TEXTAREA)
};
static HTAttr title_attr[HTML_TITLE_ATTRIBUTES+1] = {
HTML_ATTR(TITLE,DIR),
HTML_ATTR(TITLE,LANG),
HTML_ATTRIBUTES(TITLE)
};
static HTAttr ul_attr[HTML_UL_ATTRIBUTES+1] = {
HTML_ATTR(UL,CLASS),
HTML_ATTR(UL,COMPACT),
HTML_ATTR(UL,DIR),
HTML_ATTR(UL,ID),
HTML_ATTR(UL,LANG),
HTML_ATTR(UL,STYLE),
HTML_ATTR(UL,TITLE),
HTML_ATTR(UL,TYPE),
HTML_ATTRIBUTES(UL)
};
/*
** ELEMENTS
** Must match definitions in HTMLPDTD.html!
** Must be in alphabetical order.
**
** Name, Attributes, content
*/
static HTTag tags[HTML_ELEMENTS] = {
{ "A" , a_attr, HTML_A_ATTRIBUTES },
{ "ABBR" , gen_attr, HTML_GEN_ATTRIBUTES },
{ "ACRONYM" , gen_attr, HTML_GEN_ATTRIBUTES },
{ "ADDRESS" , gen_attr, HTML_GEN_ATTRIBUTES },
{ "APPLET" , applet_attr, HTML_APPLET_ATTRIBUTES },
{ "AREA" , area_attr, HTML_AREA_ATTRIBUTES },
{ "B" , gen_attr, HTML_GEN_ATTRIBUTES },
{ "BASE" , base_attr, HTML_BASE_ATTRIBUTES },
{ "BASEFONT", font_attr, HTML_FONT_ATTRIBUTES },
{ "BDO" , bdo_attr, HTML_BDO_ATTRIBUTES },
{ "BIG" , gen_attr, HTML_GEN_ATTRIBUTES },
{ "BLOCKQUOTE", bq_attr, HTML_BQ_ATTRIBUTES },
{ "BODY" , body_attr, HTML_BODY_ATTRIBUTES },
{ "BR" , br_attr, HTML_BR_ATTRIBUTES },
{ "BUTTON" , button_attr, HTML_BUTTON_ATTRIBUTES },
{ "CAPTION" , block_attr, HTML_BLOCK_ATTRIBUTES },
{ "CENTER" , no_attr, 0 },
{ "CITE" , gen_attr, HTML_GEN_ATTRIBUTES },
{ "CODE" , gen_attr, HTML_GEN_ATTRIBUTES },
{ "COL" , col_attr, HTML_COL_ATTRIBUTES },
{ "COLGROUP", col_attr, HTML_COL_ATTRIBUTES },
{ "DD" , gen_attr, HTML_GEN_ATTRIBUTES },
{ "DEL" , changes_attr, HTML_CHANGES_ATTRIBUTES },
{ "DFN" , gen_attr, HTML_GEN_ATTRIBUTES },
{ "DIR" , gen_attr, HTML_GEN_ATTRIBUTES },
{ "DIV" , block_attr, HTML_BLOCK_ATTRIBUTES },
{ "DL" , gen_attr, HTML_GEN_ATTRIBUTES },
{ "DT" , gen_attr, HTML_GEN_ATTRIBUTES },
{ "EM" , gen_attr, HTML_GEN_ATTRIBUTES },
{ "FIELDSET", gen_attr, HTML_GEN_ATTRIBUTES },
{ "FONT" , font_attr, HTML_FONT_ATTRIBUTES },
{ "FORM" , form_attr, HTML_FORM_ATTRIBUTES },
{ "FRAME" , frame_attr, HTML_FRAME_ATTRIBUTES },
{ "FRAMESET", frameset_attr,HTML_FRAMESET_ATTRIBUTES },
{ "H1" , block_attr, HTML_BLOCK_ATTRIBUTES },
{ "H2" , block_attr, HTML_BLOCK_ATTRIBUTES },
{ "H3" , block_attr, HTML_BLOCK_ATTRIBUTES },
{ "H4" , block_attr, HTML_BLOCK_ATTRIBUTES },
{ "H5" , block_attr, HTML_BLOCK_ATTRIBUTES },
{ "H6" , block_attr, HTML_BLOCK_ATTRIBUTES },
{ "HEAD" , head_attr, HTML_HEAD_ATTRIBUTES },
{ "HR" , hr_attr, HTML_HR_ATTRIBUTES },
{ "HTML" , html_attr, HTML_HTML_ATTRIBUTES },
{ "I" , gen_attr, HTML_GEN_ATTRIBUTES },
{ "IFRAME" , iframe_attr, HTML_IFRAME_ATTRIBUTES },
{ "IMG" , img_attr, HTML_IMG_ATTRIBUTES },
{ "INPUT" , input_attr, HTML_INPUT_ATTRIBUTES },
{ "INS" , changes_attr, HTML_CHANGES_ATTRIBUTES },
{ "ISINDEX" , isindex_attr, HTML_ISINDEX_ATTRIBUTES },
{ "KBD" , gen_attr, HTML_GEN_ATTRIBUTES },
{ "LABEL" , label_attr, HTML_LABEL_ATTRIBUTES },
{ "LEGEND" , legend_attr, HTML_LEGEND_ATTRIBUTES },
{ "LI" , li_attr, HTML_LI_ATTRIBUTES },
{ "LINK" , link_attr, HTML_LINK_ATTRIBUTES },
{ "MAP" , map_attr, HTML_MAP_ATTRIBUTES },
{ "MENU" , gen_attr, HTML_GEN_ATTRIBUTES },
{ "META" , meta_attr, HTML_META_ATTRIBUTES },
{ "NEXTID" , nextid_attr, 1 },
{ "NOFRAMES", gen_attr, HTML_GEN_ATTRIBUTES },
{ "NOSCRIPT", gen_attr, HTML_GEN_ATTRIBUTES },
{ "OBJECT" , object_attr, HTML_OBJECT_ATTRIBUTES },
{ "OL" , ol_attr, HTML_OL_ATTRIBUTES },
{ "OPTGROUP", optgroup_attr,HTML_OPTGROUP_ATTRIBUTES },
{ "OPTION" , option_attr, HTML_OPTION_ATTRIBUTES },
{ "P" , block_attr, HTML_BLOCK_ATTRIBUTES },
{ "PARAM" , param_attr, HTML_PARAM_ATTRIBUTES },
{ "PRE" , pre_attr, HTML_PRE_ATTRIBUTES },
{ "Q" , gen_attr, HTML_GEN_ATTRIBUTES },
{ "S" , gen_attr, HTML_GEN_ATTRIBUTES },
{ "SAMP" , gen_attr, HTML_GEN_ATTRIBUTES },
{ "SCRIPT" , script_attr, HTML_SCRIPT_ATTRIBUTES },
{ "SELECT" , select_attr, HTML_SELECT_ATTRIBUTES },
{ "SMALL" , gen_attr, HTML_GEN_ATTRIBUTES },
{ "SPAN" , block_attr, HTML_BLOCK_ATTRIBUTES },
{ "STRIKE" , gen_attr, HTML_GEN_ATTRIBUTES },
{ "STRONG" , gen_attr, HTML_GEN_ATTRIBUTES },
{ "STYLE" , style_attr, HTML_STYLE_ATTRIBUTES },
{ "SUB" , gen_attr, HTML_GEN_ATTRIBUTES },
{ "SUP" , gen_attr, HTML_GEN_ATTRIBUTES },
{ "TABLE" , table_attr, HTML_TABLE_ATTRIBUTES },
{ "TBODY" , tele_attr, HTML_TELE_ATTRIBUTES },
{ "TD" , td_attr, HTML_TD_ATTRIBUTES },
{ "TEXTAREA", textarea_attr,HTML_TEXTAREA_ATTRIBUTES },
{ "TFOOT" , tele_attr, HTML_TELE_ATTRIBUTES },
{ "TH" , td_attr, HTML_TD_ATTRIBUTES },
{ "THEAD" , tele_attr, HTML_TELE_ATTRIBUTES },
{ "TITLE" , title_attr, HTML_TITLE_ATTRIBUTES },
{ "TR" , tele_attr, HTML_TELE_ATTRIBUTES },
{ "TT" , gen_attr, HTML_GEN_ATTRIBUTES },
{ "U" , gen_attr, HTML_GEN_ATTRIBUTES },
{ "UL" , ul_attr, HTML_UL_ATTRIBUTES },
{ "VAR" , gen_attr, HTML_GEN_ATTRIBUTES },
//
{ "LUA" , gen_attr, HTML_GEN_ATTRIBUTES },
};
static SGML_dtd HTMLP_dtd = {
tags,
HTML_ELEMENTS
};
static SGML_dtd * DTD = &HTMLP_dtd;
SGML_dtd * HTML_dtd (void)
{
return DTD;
}
}// namespace