113 if (
type != tag && priority[
type] > priority[tag]) {
118 if (
type == tag)
break;
133 }
else if (size > 6) {
137 pStyle->
fFont += delta;
145 if (p_first == 0)
return;
146 p_first = p_first->
fPNext;
147 while (p_first && p_first != p_last) {
149 p_first = p_first->
fPNext;
168 const char *cp = str;
170 int *cr, i,
n = 0, sz = 4;
174 while (*cp && (!isdigit(*cp))) cp++;
175 if ((!*cp) || (!isdigit(*cp)))
break;
176 cr[
n] = (
int) strtol(cp, &ncp, 10);
177 if (cp == ncp)
break;
181 int *tmp =
new int[sz+4];
182 for (i = 0; i < sz; ++i) tmp[i] = cr[i];
223 int useNextStyle = 0;
227 static int header_sizes[] = { +2, +1, 1, 1, -1, -1 };
280 if (strcasecmp(z,
"circle") == 0) {
282 }
else if (strcasecmp(z,
"poly") == 0) {
349 SetupBackgroundPic(img->GetPicture());
550 }
else if (*z ==
'+') {
555 if (size <= 0) size = 1;
578 if (zUrl == 0) zUrl =
fZBase;
580 if (zUrl == 0) zUrl =
StrDup(
"");
613 if (i >= 1 && i <= 6) {
680 p->
fFlags &= ~HTML_Visible;
735 if (
n > 0) list->
fCnt =
n;
776 if (e2)
while (e2->fPNext) e2 = e2->
fPNext;
778 if (e2 && e2 != p && ((e3 = b3 = e2->fPNext))) {
779 while (e3->fPNext) e3 = e3->fPNext;
781 e2->fPNext = 0; b2->
fPPrev = e3;
837 if (
style.fSubscript > -6 )
style.fSubscript--;
851 nextStyle.
fFlags &= ~STY_Preformatted;
1002 (
"Style font=%02d color=%02d bg=%02d "
1003 "align=%d flags=0x%04x token=%s\n",
1015 fFlags &= ~STYLER_RUNNING;
1053 if (img)
delete img;
1094 for (; !stop && p; p = p ? p->
fPNext : 0) {
1096 p->
fFlags &= ~HTML_Visible;
1112 if (spaceWidth == 0) spaceWidth = font->
TextWidth(
" ", 1);
1113 text->fSpaceWidth = spaceWidth;
1119 if (spaceWidth == 0) spaceWidth = font->
TextWidth(
" ", 1);
1120 space->
fW = spaceWidth;
1123 p->
fFlags &= ~HTML_Visible;
1149 if (z && *z ==
'#') {
1163 if (image->
fZAlt == 0) image->
fZAlt =
"<image>";
1176 if ((z = p->
MarkupArg(
"width", 0)) != 0) {
1178 if (z[strlen(z)-1] ==
'%') w = 0;
1179 if (w > 0) image->
fW = w;
1181 if ((z = p->
MarkupArg(
"height", 0)) != 0) {
1183 if (
h > 0) image->
fH =
h;
1232 p->
fFlags &= ~HTML_Visible;
static void ScaleFont(SHtmlStyle_t *pStyle, int delta)
Change the font size on the given style by the delta-amount given.
static int * GetCoords(const char *str, int *nptr)
Returns coordinates of string str.
#define TRACE(Flag, Args)
char * StrDup(const char *str)
Duplicate the string str.
void GetFontMetrics(FontMetrics_t *m) const
Get font metrics.
Int_t TextWidth(const char *string, Int_t numChars=-1) const
A wrapper function for the more complicated interface of MeasureChars.
virtual const char * MarkupArg(const char *, const char *)
virtual int GetAlignment(int dflt)
TGHtmlImageMarkup * fINext
TGHtmlImageMarkup * fPList
virtual int GetAlignment(int dflt)
Return an alignment or justification flag associated with the given markup.
virtual const char * MarkupArg(const char *tag, const char *zDefault)
Lookup an argument in the given markup with the name given.
virtual int GetOrderedListType(int dflt)
The "type" argument to the given element might describe the type for an ordered list.
virtual int GetUnorderedListType(int dflt)
The "type" argument to the given element might describe a type for an unordered list.
TGHtmlElement * GetMap(const char *name)
Returns html map element.
virtual int FormCreate(TGHtmlForm *, const char *, const char *)
void TokenizerAppend(const char *text)
Append text to the tokenizer engine.
void AddStyle(TGHtmlElement *p)
This routine adds information to the input texts that doesn't change when the display is resized or w...
virtual char * ProcessScript(TGHtmlScript *)
virtual TGFont * GetFont(int iFont)
The rendering and layout routines should call this routine in order to get a font structure.
TGHtmlElement * fLastSized
int GetColorByName(const char *zColor)
This routine returns an index between 0 and N_COLOR-1 which indicates which ColorStruct_t structure i...
SHtmlStyleStack_t * fStyleStack
TGHtmlListStart * fInnerList
void AppendArglist(TGString *str, TGHtmlMarkupElement *pElem)
Append all the arguments of the given markup to the given TGString.
void TableBgndImage(TGHtmlElement *p)
Set background picture of a html table.
virtual TImage * LoadImage(const char *uri, int w=0, int h=0)
This is the default LoadImage() procedure.
void MakeInvisible(TGHtmlElement *p_first, TGHtmlElement *p_last)
Add the STY_Invisible style to every token between p_first and p_last.
ColorStruct_t * AllocColor(const char *name)
Allocate system color by name.
int GetImageAlignment(TGHtmlElement *p)
Find the alignment for an image.
int GetLinkColor(const char *zURL)
For the markup , find out if the URL has been visited before or not.
TGHtmlAnchor * fAnchorStart
void Sizer()
Compute the size of all elements in the widget.
SHtmlStyle_t PopStyleStack(int tag)
Pop a rendering style off of the stack.
virtual int IsVisited(const char *)
virtual char * ResolveUri(const char *uri)
This function resolves the specified URI and returns the result in a newly allocated string.
void PushStyleStack(int tag, SHtmlStyle_t style)
Push a new rendering style onto the stack.
int ControlSize(TGHtmlInput *p)
This routine implements the Sizer() function for <INPUT>, <SELECT> and <TEXTAREA> markup.
char * DumpToken(TGHtmlElement *p)
For debugging purposes, print information about a token.
SHtmlStyle_t GetCurrentStyle()
Get the current rendering style.
TGHtmlImage * GetImage(TGHtmlImageMarkup *p)
Given an.
TGHtmlInput * fFormElemStart
ColorStruct_t * fApColor[N_COLOR]
const char * GetString() const
virtual void SetBackgroundColor(Pixel_t)
Set background color of the canvas frame.
virtual void SetBackgroundPixmap(Pixmap_t p)
Set backgound pixmap.
virtual void SetBackgroundPixmap(Pixmap_t pixmap)
set background pixmap
An abstract interface to image processing library.
virtual UInt_t GetWidth() const
virtual Pixmap_t GetPixmap()
virtual UInt_t GetHeight() const
TString & Append(const char *cs)
Bool_t fGraphicsExposures
SHtmlStyleStack_t * fPNext