41 extern void HtmlTranslateEscapes(
char *z);
42 extern void ToLower(
char *z);
48 TGHtmlElement::TGHtmlElement(
int etype)
53 fStyle.fSubscript = 0;
68 TGHtmlTextElement::TGHtmlTextElement(
int size) : TGHtmlElement(Html_Text)
70 fZText =
new char[size + 1];
71 fX = 0; fY = 0; fW = 0;
80 TGHtmlTextElement::~TGHtmlTextElement()
88 TGHtmlMarkupElement::TGHtmlMarkupElement(
int type2,
int argc,
int arglen[],
89 char *av[]) : TGHtmlElement(type2)
94 fArgv =
new char*[argc+1];
95 for (
int i = 1; i < argc; i++) {
97 fArgv[i-1] =
new char[arglen[i]+1];
99 strncpy(fArgv[i-1], av[i], arglen[i]);
100 fArgv[i-1][arglen[i]] = 0;
101 HtmlTranslateEscapes(fArgv[i-1]);
102 if ((i & 1) == 1) ToLower(fArgv[i-1]);
104 fArgv[i-1] = StrDup(av[i]);
105 HtmlTranslateEscapes(fArgv[i-1]);
106 if ((i & 1) == 1) ToLower(fArgv[i-1]);
112 fArgv[argc] = (
char *) fArgv;
122 TGHtmlMarkupElement::~TGHtmlMarkupElement()
125 for (
int i = 0; i < fCount; ++i)
delete [] fArgv[i];
135 const char *TGHtmlMarkupElement::MarkupArg(
const char *tag,
const char *zDefault)
139 for (i = 0; i < fCount; i += 2) {
140 if (strcmp(fArgv[i], tag) == 0)
return fArgv[i+1];
150 int TGHtmlMarkupElement::GetAlignment(
int dflt)
152 const char *z = MarkupArg(
"align", 0);
156 if (strcasecmp(z,
"left") == 0) {
158 }
else if (strcasecmp(z,
"right") == 0) {
160 }
else if (strcasecmp(z,
"center") == 0) {
174 int TGHtmlMarkupElement::GetOrderedListType(
int dflt)
176 const char *z = MarkupArg(
"type", 0);
179 case 'A': dflt = LI_TYPE_Enum_A;
break;
180 case 'a': dflt = LI_TYPE_Enum_a;
break;
181 case '1': dflt = LI_TYPE_Enum_1;
break;
182 case 'I': dflt = LI_TYPE_Enum_I;
break;
183 case 'i': dflt = LI_TYPE_Enum_i;
break;
196 int TGHtmlMarkupElement::GetUnorderedListType(
int dflt)
198 const char *z = MarkupArg(
"type", 0);
200 if (strcasecmp(z,
"disc") == 0) {
201 dflt = LI_TYPE_Bullet1;
202 }
else if (strcasecmp(z,
"circle") == 0) {
203 dflt = LI_TYPE_Bullet2;
204 }
else if (strcasecmp(z,
"square") == 0) {
205 dflt = LI_TYPE_Bullet3;
217 TGHtmlTable::TGHtmlTable(
int type2,
int argc,
int arglen[],
char *argv2[]) :
218 TGHtmlMarkupElement(type2, argc, arglen, argv2)
223 fX = 0; fY = 0; fW = 0; fH = 0;
227 for (
int i=0;i<=HTML_MAX_COLUMNS;++i) {
228 fMinW[i] = fMaxW[i] = 0;
235 TGHtmlTable::~TGHtmlTable()
237 if (fBgImage)
delete fBgImage;
243 TGHtmlCell::TGHtmlCell(
int type2,
int argc,
int arglen[],
char *argv2[]) :
244 TGHtmlMarkupElement(type2, argc, arglen, argv2)
248 fX = 0; fY = 0; fW = 0; fH = 0;
258 TGHtmlCell::~TGHtmlCell()
260 if (fBgImage)
delete fBgImage;
266 TGHtmlRef::TGHtmlRef(
int type2,
int argc,
int arglen[],
char *argv2[]) :
267 TGHtmlMarkupElement(type2, argc, arglen, argv2)
276 TGHtmlRef::~TGHtmlRef()
278 if (fBgImage)
delete fBgImage;
284 TGHtmlLi::TGHtmlLi(
int type2,
int argc,
int arglen[],
char *argv2[]) :
285 TGHtmlMarkupElement(type2, argc, arglen, argv2)
297 TGHtmlListStart::TGHtmlListStart(
int type2,
int argc,
int arglen[],
char *argv2[]) :
298 TGHtmlMarkupElement(type2, argc, arglen, argv2)
310 TGHtmlImageMarkup::TGHtmlImageMarkup(
int type2,
int argc,
311 int arglen[],
char *argv2[]) :
312 TGHtmlMarkupElement(type2, argc, arglen, argv2)
318 fX = 0; fY = 0; fW = 0; fH = 0;
330 TGHtmlForm::TGHtmlForm(
int type2,
int argc,
int arglen[],
char *argv2[]) :
331 TGHtmlMarkupElement(type2, argc, arglen, argv2)
343 TGHtmlHr::TGHtmlHr(
int type2,
int argc,
int arglen[],
char *argv2[]) :
344 TGHtmlMarkupElement(type2, argc, arglen, argv2)
346 fX = 0; fY = 0; fW = 0; fH = 0;
353 TGHtmlAnchor::TGHtmlAnchor(
int type2,
int argc,
int arglen[],
char *argv2[]) :
354 TGHtmlMarkupElement(type2, argc, arglen, argv2)
362 TGHtmlScript::TGHtmlScript(
int type2,
int argc,
int arglen[],
char *argv2[]) :
363 TGHtmlMarkupElement(type2, argc, arglen, argv2)
372 TGHtmlMapArea::TGHtmlMapArea(
int type2,
int argc,
int arglen[],
char *argv2[]) :
373 TGHtmlMarkupElement(type2, argc, arglen, argv2)
384 TGHtmlBlock::TGHtmlBlock()
389 TGHtmlBlock::~TGHtmlBlock()
398 TGHtmlInput::TGHtmlInput(
int type2,
int argc,
int arglen[],
char *argv2[]) :
399 TGHtmlMarkupElement(type2, argc, arglen, argv2)
406 fInpId = 0; fSubId = 0;
407 fX = 0; fY = 0; fW = 0; fH = 0;
424 void TGHtmlInput::Empty()
429 fFlags &= ~HTML_Visible;
430 fStyle.fFlags |= STY_Invisible;