Logo ROOT  
Reference Guide
TGHtmlSizer.cxx
Go to the documentation of this file.
1 // $Id: TGHtmlSizer.cxx,v 1.2 2007/05/04 20:33:16 rdm Exp $
2 // Author: Valeriy Onuchin 03/05/2007
3 
4 /**************************************************************************
5 
6  HTML widget for xclass. Based on tkhtml 1.28
7  Copyright (C) 1997-2000 D. Richard Hipp <drh@acm.org>
8  Copyright (C) 2002-2003 Hector Peraza.
9 
10  This library is free software; you can redistribute it and/or
11  modify it under the terms of the GNU Library General Public
12  License as published by the Free Software Foundation; either
13  version 2 of the License, or (at your option) any later version.
14 
15  This library is distributed in the hope that it will be useful,
16  but WITHOUT ANY WARRANTY; without even the implied warranty of
17  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18  Library General Public License for more details.
19 
20  You should have received a copy of the GNU Library General Public
21  License along with this library; if not, write to the Free
22  Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
23 
24 **************************************************************************/
25 
26 // Routines used to compute the style and size of individual elements.
27 
28 #include <cstring>
29 #include <cstdlib>
30 #include <cctype>
31 
32 #include "TGHtml.h"
33 #include "TImage.h"
34 #include "TVirtualX.h"
35 #include "snprintf.h"
36 
37 ////////////////////////////////////////////////////////////////////////////////
38 /// Get the current rendering style. In other words, get the style
39 /// that is currently on the top of the style stack.
40 
42 {
44 
45  if (fStyleStack) {
47  } else {
48  style.fFont = NormalFont(2);
49  style.fColor = COLOR_Normal;
50  style.fBgcolor = COLOR_Background;
51  style.fSubscript = 0;
52  style.fAlign = ALIGN_Left;
53  style.fFlags = 0;
54  style.fExpbg = 0;
55  }
56 
57  return style;
58 }
59 
60 ////////////////////////////////////////////////////////////////////////////////
61 /// Push a new rendering style onto the stack.
62 ///
63 /// tag - Tag for this style. Normally the end-tag such as </h3> or </em>.
64 /// style - The style to push
65 
67 {
69 
70  p = new SHtmlStyleStack_t;
71  p->fPNext = fStyleStack;
72  p->fType = tag;
73  p->fStyle = style;
74  fStyleStack = p;
75 }
76 
77 ////////////////////////////////////////////////////////////////////////////////
78 /// Pop a rendering style off of the stack.
79 ///
80 /// The top-most style on the stack should have a tag equal to "tag".
81 /// If not, then we have an HTML coding error. Perhaps something
82 /// like this: "Some text <em>Enphasized</i> more text". It is an
83 /// interesting problem to figure out how to respond sanely to this
84 /// kind of error. Our solution is to keep popping the stack until
85 /// we find the correct tag, or until the stack is empty.
86 
88 {
89  int i, type;
91  static Html_u8_t priority[Html_TypeCount+1];
92 
93  if (priority[Html_TABLE] == 0) {
94  for (i = 0; i <= Html_TypeCount; i++) priority[i] = 1;
95  priority[Html_TD] = 2;
96  priority[Html_EndTD] = 2;
97  priority[Html_TH] = 2;
98  priority[Html_EndTH] = 2;
99  priority[Html_TR] = 3;
100  priority[Html_EndTR] = 3;
101  priority[Html_TABLE] = 4;
102  priority[Html_EndTABLE] = 4;
103  }
104  if (tag <= 0 || tag > Html_TypeCount) {
105  CANT_HAPPEN;
106  return GetCurrentStyle();
107  }
108  while ((p = fStyleStack) != 0) {
109  type = p->fType;
110  if (type <= 0 || type > Html_TypeCount) {
111  CANT_HAPPEN;
112  return GetCurrentStyle();
113  }
114  if (type != tag && priority[type] > priority[tag]) {
115  return GetCurrentStyle();
116  }
117  fStyleStack = p->fPNext;
118  delete p;
119  if (type == tag) break;
120  }
121 
122  return GetCurrentStyle();
123 }
124 
125 ////////////////////////////////////////////////////////////////////////////////
126 /// Change the font size on the given style by the delta-amount given
127 
128 static void ScaleFont(SHtmlStyle_t *pStyle, int delta)
129 {
130  int size = FontSize(pStyle->fFont) + delta;
131 
132  if (size < 0) {
133  delta -= size;
134  } else if (size > 6) {
135  delta -= size-6;
136  }
137 
138  pStyle->fFont += delta;
139 }
140 
141 ////////////////////////////////////////////////////////////////////////////////
142 /// Add the STY_Invisible style to every token between p_first and p_last.
143 
145 {
146  if (p_first == 0) return;
147  p_first = p_first->fPNext;
148  while (p_first && p_first != p_last) {
149  p_first->fStyle.fFlags |= STY_Invisible;
150  p_first = p_first->fPNext;
151  }
152 }
153 
154 ////////////////////////////////////////////////////////////////////////////////
155 /// For the markup <a href=XXX>, find out if the URL has been visited
156 /// before or not. Return COLOR_Visited or COLOR_Unvisited, as
157 /// appropriate.
158 
159 int TGHtml::GetLinkColor(const char *zURL)
160 {
161  return IsVisited(zURL) ? COLOR_Visited : COLOR_Unvisited;
162 }
163 
164 ////////////////////////////////////////////////////////////////////////////////
165 /// Returns coordinates of string str.
166 
167 static int *GetCoords(const char *str, int *nptr)
168 {
169  const char *cp = str;
170  char *ncp;
171  int *cr, i, n = 0, sz = 4;
172 
173  cr = new int[sz];
174  while (cp) {
175  while (*cp && (!isdigit(*cp))) cp++;
176  if ((!*cp) || (!isdigit(*cp))) break;
177  cr[n] = (int) strtol(cp, &ncp, 10);
178  if (cp == ncp) break;
179  cp = ncp;
180  n++;
181  if (n >= sz) {
182  int *tmp = new int[sz+4];
183  for (i = 0; i < sz; ++i) tmp[i] = cr[i];
184  delete[] cr;
185  cr = tmp;
186  sz += 4;
187  }
188  }
189  *nptr = n;
190 
191  return cr;
192 }
193 
194 ////////////////////////////////////////////////////////////////////////////////
195 /// This routine adds information to the input texts that doesn't change
196 /// when the display is resized or when new fonts are selected, etc.
197 /// Mostly this means adding style attributes. But other constant
198 /// information (such as numbering on <li> and images used for <IMG>)
199 /// is also obtained. The key is that this routine is only called
200 /// once, where the sizer and layout routines can be called many times.
201 ///
202 /// This routine is called whenever the list of elements grows. The
203 /// style stack is stored as part of the HTML widget so that we can
204 /// always continue where we left off the last time.
205 ///
206 /// In addition to adding style, this routine will invoke methods
207 /// needed to acquire information about a markup. The IsVisitied()
208 /// method is called for each <a> and the GetImage() is called
209 /// for each <IMG> or for each <LI> that has a SRC= field.
210 ///
211 /// When a markup is inserted or deleted from the token list, the
212 /// style routine must be completely rerun from the beginning. So
213 /// what we said above, that this routine is only run once, is not
214 /// strictly true.
215 
217 {
218  SHtmlStyle_t style; // Current style
219  int size; // A new font size
220  int i; // Loop counter
221  int paraAlign; // Current paragraph alignment
222  int rowAlign; // Current table row alignment
223  SHtmlStyle_t nextStyle; // Style for next token if useNextStyle==1
224  int useNextStyle = 0; // True if nextStyle is valid
225  const char *z; // A tag parameter's value
226 
227  // The size of header fonts relative to the current font size
228  static int header_sizes[] = { +2, +1, 1, 1, -1, -1 };
229 
230  // Don't allow recursion
231  if (fFlags & STYLER_RUNNING) return;
233 
234  // Load the style state out of the TGHtml object and into local
235  // variables. This is purely a matter of convenience...
236 
238  nextStyle = style; //ia: nextStyle was not initialized
239  paraAlign = fParaAlignment;
240  rowAlign = fRowAlignment;
241 
242  // Loop over tokens
243  while (fPFirst && p) {
244  switch (p->fType) {
245  case Html_A:
246  if (fAnchorStart) {
248  fAnchorStart = 0;
249  fAnchorFlags = 0;
250  }
251  z = p->MarkupArg("href", 0);
252  if (z) {
253  style.fColor = GetLinkColor(z);
254  if (fUnderlineLinks) style.fFlags |= STY_Underline;
257  fAnchorStart = (TGHtmlAnchor *) p;
258  }
259  break;
260 
261  case Html_EndA:
262  if (fAnchorStart) {
263  ((TGHtmlRef *)p)->fPOther = fAnchorStart;
265  fAnchorStart = 0;
266  fAnchorFlags = 0;
267  }
268  break;
269 
270  case Html_MAP:
271  break;
272 
273  case Html_EndMAP:
274  break;
275 
276  case Html_AREA: {
277  TGHtmlMapArea *area = (TGHtmlMapArea *) p;
278  z = p->MarkupArg("shape", 0);
279  area->fMType = HTML_MAP_RECT;
280  if (z) {
281  if (strcasecmp(z, "circle") == 0) {
282  area->fMType = HTML_MAP_CIRCLE;
283  } else if (strcasecmp(z,"poly") == 0) {
284  area->fMType = HTML_MAP_POLY;
285  }
286  }
287  z = p->MarkupArg("coords", 0);
288  if (z) {
289  area->fCoords = GetCoords(z, &area->fNum);
290  }
291  break;
292  }
293 
294  case Html_ADDRESS:
295  case Html_EndADDRESS:
296  case Html_BLOCKQUOTE:
297  case Html_EndBLOCKQUOTE:
298  paraAlign = ALIGN_None;
299  break;
300 
301  case Html_APPLET:
302  if (0 /* has ProcessApplet() */) {
303  nextStyle = style;
304  nextStyle.fFlags |= STY_Invisible;
305  PushStyleStack(Html_EndAPPLET, nextStyle);
306  useNextStyle = 1;
307  } else {
309  }
310  break;
311 
312  case Html_B:
313  style.fFont = BoldFont(style.fFont);
315  break;
316 
317  case Html_BODY:
318  z = p->MarkupArg("text", 0);
319  if (z) {
320  //FreeColor(fApColor[COLOR_Normal]);
322  }
323  z = p->MarkupArg("bgcolor", 0);
324  if (z) {
325  //FreeColor(fApColor[COLOR_Background]);
329  }
330  z = p->MarkupArg("link", 0);
331  if (z) {
332  //FreeColor(fApColor[COLOR_Unvisited]);
334  }
335  z = p->MarkupArg("vlink", 0);
336  if (z) {
337  //FreeColor(fApColor[COLOR_Visited]);
339  }
340  z = p->MarkupArg("alink", 0);
341  if (z) {
342  }
343  z = p->MarkupArg("background", 0);
344  if (z) {
345  z = ResolveUri(z);
346  if (z) {
347  TImage *img = LoadImage(z, 0, 0);
348  if (img) {
349 #if 0
350  SetupBackgroundPic(img->GetPicture());
351 #else
352  GCValues_t gcv;
353  // unsigned int mask;
354 
355  // mask = kGCTile | kGCFillStyle | kGCGraphicsExposures;
356  gcv.fTile = img->GetPixmap();
357  gcv.fFillStyle = kFillTiled;
360 
361  gVirtualX->ChangeGC(fWhiteGC.GetGC(), &gcv);
362 
363  //NeedRedraw(TGRectangle(fVisible, fCanvas->GetSize()));
364 #endif
365  fBgImage = img;//delete img;
366  }
367  delete [] z;
368  }
369  }
370  break;
371 
372  case Html_EndBODY:
373  break;
374 
375  case Html_EndAPPLET:
376  case Html_EndB:
377  case Html_EndBIG:
378  case Html_EndCENTER:
379  case Html_EndCITE:
380  case Html_EndCODE:
381  case Html_EndCOMMENT:
382  case Html_EndDFN:
383  case Html_EndEM:
384  case Html_EndFONT:
385  case Html_EndI:
386  case Html_EndKBD:
387  case Html_EndMARQUEE:
388  case Html_EndNOBR:
389  case Html_EndNOFRAMES:
390  case Html_EndNOSCRIPT:
391  case Html_EndNOEMBED:
392  case Html_EndS:
393  case Html_EndSAMP:
394  case Html_EndSMALL:
395  case Html_EndSTRIKE:
396  case Html_EndSTRONG:
397  case Html_EndSUB:
398  case Html_EndSUP:
399  case Html_EndTITLE:
400  case Html_EndTT:
401  case Html_EndU:
402  case Html_EndVAR:
403  style = PopStyleStack(p->fType);
404  break;
405 
406  case Html_BASE:
407  z = p->MarkupArg("href", 0);
408  if (z) {
409  char *z1 = ResolveUri(z);
410  if (z1 != 0) {
411  if (fZBaseHref) delete[] fZBaseHref;
412  fZBaseHref = z1;
413  }
414  }
415  break;
416 
417  case Html_EndDIV:
418  paraAlign = ALIGN_None;
419  style = PopStyleStack(p->fType);
420  break;
421 
422  case Html_EndBASEFONT:
424  style.fFont = FontFamily(style.fFont) + 2;
425  break;
426 
427  case Html_BIG:
428  ScaleFont(&style, 1);
430  break;
431 
432  case Html_CAPTION:
433  paraAlign = p->GetAlignment(paraAlign);
434  break;
435 
436  case Html_EndCAPTION:
437  paraAlign = ALIGN_None;
438  break;
439 
440  case Html_CENTER:
441  paraAlign = ALIGN_None;
442  style.fAlign = ALIGN_Center;
444  break;
445 
446  case Html_CITE:
447  style.fFont = ItalicFont(style.fFont);
449  break;
450 
451  case Html_CODE:
452  style.fFont = CWFont(style.fFont);
454  break;
455 
456  case Html_COMMENT:
457  style.fFlags |= STY_Invisible;
459  break;
460 
461  case Html_DD:
462  if (fInnerList && fInnerList->fType == Html_DL) {
463  ((TGHtmlRef *)p)->fPOther = fInnerList;
464  } else {
465  ((TGHtmlRef *)p)->fPOther = 0;
466  }
467  fInDt = 0;
468  break;
469 
470  case Html_DFN:
471  style.fFont = ItalicFont(style.fFont);
473  break;
474 
475  case Html_DIR:
476  case Html_MENU:
477  case Html_UL: {
478  TGHtmlListStart *list = (TGHtmlListStart *) p;
479  list->fLPrev = fInnerList;
480  list->fCnt = 0;
481  fInnerList = list;
482  if (list->fLPrev == 0) {
483  list->fLtype = LI_TYPE_Bullet1;
484  list->fCompact = (list->MarkupArg("compact", 0) != 0);
485  } else if (list->fLPrev->fLPrev == 0) {
486  list->fLtype = LI_TYPE_Bullet2;
487  list->fCompact = 1;
488  } else {
489  list->fLtype = LI_TYPE_Bullet3;
490  list->fCompact = 1;
491  }
492  list->fLtype = list->GetUnorderedListType(list->fLtype);
493  break;
494  }
495 
496  case Html_EndDL:
497  fInDt = 0;
498  /* Fall thru into the next case */
499  case Html_EndDIR:
500  case Html_EndMENU:
501  case Html_EndOL:
502  case Html_EndUL:
503  ((TGHtmlRef *)p)->fPOther = fInnerList;
505  break;
506 
507  case Html_DIV:
508  paraAlign = ALIGN_None;
509  style.fAlign = p->GetAlignment(style.fAlign);
511  break;
512 
513  case Html_DT:
514  if (fInnerList && fInnerList->fType == Html_DL) {
515  ((TGHtmlRef *)p)->fPOther = fInnerList;
516  } else {
517  ((TGHtmlRef *)p)->fPOther = 0;
518  }
519  fInDt = STY_DT;
520  break;
521 
522  case Html_EndDD:
523  case Html_EndDT:
524  fInDt = 0;
525  break;
526 
527  case Html_DL: {
528  TGHtmlListStart *list = (TGHtmlListStart *) p;
529  list->fLPrev = fInnerList;
530  list->fCnt = 0;
531  fInnerList = list;
532  list->fCompact = (list->MarkupArg("compact", 0) != 0);
533  fInDt = 0;
534  break;
535  }
536 
537  case Html_EM:
538  style.fFont = ItalicFont(style.fFont);
540  break;
541 
542  case Html_EMBED:
543  break;
544 
545  case Html_BASEFONT:
546  case Html_FONT:
547  z = p->MarkupArg("size", 0);
548  if (z && !fOverrideFonts) {
549  if (*z == '-') {
550  size = FontSize(style.fFont) - atoi(&z[1]) +1;
551  } else if (*z == '+') {
552  size = FontSize(style.fFont) + atoi(&z[1]) +1;
553  } else {
554  size = atoi(z);
555  }
556  if (size <= 0) size = 1;
557  if (size >= N_FONT_SIZE) size = N_FONT_SIZE - 1;
558  style.fFont = FontFamily(style.fFont) + size - 1;
559  }
560  z = p->MarkupArg("color", 0);
561  if (z && *z && !fOverrideColors) style.fColor = GetColorByName(z);
564  break;
565 
566  case Html_FORM: {
567  TGHtmlForm *form = (TGHtmlForm *) p;
568 
569  const char *zUrl;
570  const char *zMethod;
571  TGString cmd("");
572  // int result;
573  char zToken[50];
574 
575  fFormStart = 0;
576  //form->fFormId = 0;
577 
578  zUrl = p->MarkupArg("action", 0);
579  if (zUrl == 0) zUrl = fZBase;
580  zUrl = ResolveUri(zUrl);
581  if (zUrl == 0) zUrl = StrDup("");
582  zMethod = p->MarkupArg("method", "GET");
583  snprintf(zToken, 50, " %d form ", form->fFormId);
584  cmd.Append("Form:");
585  cmd.Append(zToken);
586  cmd.Append(zUrl);
587  cmd.Append(" ");
588  cmd.Append(zMethod);
589  cmd.Append(" { ");
590  AppendArglist(&cmd, (TGHtmlMarkupElement *) p);
591  cmd.Append("} ");
592  /* result = */ FormCreate(form, zUrl, cmd.GetString());
593  delete[] zUrl;
594 
595  /*if (result)*/ fFormStart = form;
596 
597  break;
598  }
599 
600  case Html_EndFORM:
601  ((TGHtmlRef *)p)->fPOther = fFormStart;
602  if (fFormStart) fFormStart->fPEnd = p;
603  fFormStart = 0;
604  break;
605 
606  case Html_H1:
607  case Html_H2:
608  case Html_H3:
609  case Html_H4:
610  case Html_H5:
611  case Html_H6:
612  if (!fInTr) paraAlign = ALIGN_None;
613  i = (p->fType - Html_H1) / 2 + 1;
614  if (i >= 1 && i <= 6) {
615  ScaleFont(&style, header_sizes[i-1]);
616  }
617  style.fFont = BoldFont(style.fFont);
618  style.fAlign = p->GetAlignment(style.fAlign);
620  break;
621 
622  case Html_EndH1:
623  case Html_EndH2:
624  case Html_EndH3:
625  case Html_EndH4:
626  case Html_EndH5:
627  case Html_EndH6:
628  paraAlign = ALIGN_None;
630  break;
631 
632  case Html_HR:
633  nextStyle = style;
634  style.fAlign = p->GetAlignment(ALIGN_None);
635  useNextStyle = 1;
636  break;
637 
638  case Html_I:
639  style.fFont = ItalicFont(style.fFont);
641  break;
642 
643  case Html_IMG:
644  if (style.fFlags & STY_Invisible) break;
645  ((TGHtmlImageMarkup *)p)->fPImage = GetImage((TGHtmlImageMarkup *) p);
646  break;
647 
648  case Html_OPTION:
649  break;
650 
651  case Html_INPUT:
652  ((TGHtmlInput *)p)->fPForm = fFormStart;
653  ////ControlSize((TGHtmlInput *) p);
654  break;
655 
656  case Html_KBD:
657  style.fFont = CWFont(style.fFont);
659  break;
660 
661  case Html_LI:
662  if (fInnerList) {
663  TGHtmlLi *li = (TGHtmlLi *) p;
664  li->fLtype = fInnerList->fLtype;
665  if (fInnerList->fType == Html_OL) {
666  z = li->MarkupArg("value", 0);
667  if (z) {
668  int n = atoi(z);
669  if (n > 0) {
670  li->fCnt = n;
671  fInnerList->fCnt = n+1;
672  }
673  } else {
674  li->fCnt = fInnerList->fCnt++;
675  }
676  li->fLtype = li->GetOrderedListType(li->fLtype);
677  } else {
678  li->fLtype = li->GetUnorderedListType(li->fLtype);
679  }
680  } else {
681  p->fFlags &= ~HTML_Visible;
682  }
683  break;
684 
685  case Html_MARQUEE:
686  style.fFlags |= STY_Invisible;
688  break;
689 
690  case Html_NOBR:
691  style.fFlags |= STY_NoBreak;
693  break;
694 
695  case Html_NOFRAMES:
696  if (0 /* has ProcessFrame()*/) {
697  nextStyle = style;
698  nextStyle.fFlags |= STY_Invisible;
699  PushStyleStack(Html_EndNOFRAMES, nextStyle);
700  useNextStyle = 1;
701  } else {
703  }
704  break;
705 
706  case Html_NOEMBED:
707  if (0 /* has ProcessScript() && HasScript */) {
708  nextStyle = style;
709  nextStyle.fFlags |= STY_Invisible;
710  PushStyleStack(Html_EndNOEMBED, nextStyle);
711  useNextStyle = 1;
712  } else {
714  }
715  break;
716 
717  case Html_NOSCRIPT:
718  if (0 /* has ProcessScript() && HasScript */) {
719  nextStyle = style;
720  nextStyle.fFlags |= STY_Invisible;
721  PushStyleStack(Html_EndNOSCRIPT, nextStyle);
722  useNextStyle = 1;
723  } else {
725  }
726  break;
727 
728  case Html_OL: {
729  TGHtmlListStart *list = (TGHtmlListStart *) p;
730  list->fLPrev = fInnerList;
732  list->fCnt = 1;
733  z = list->MarkupArg("start", 0);
734  if (z) {
735  int n = atoi(z);
736  if (n > 0) list->fCnt = n;
737  }
738  list->fCompact = (fInnerList != 0 || list->MarkupArg("compact", 0) != 0);
739  fInnerList = list;
740  break;
741  }
742 
743  case Html_P:
744  paraAlign = p->GetAlignment(ALIGN_None);
745  break;
746 
747  case Html_EndP:
748  paraAlign = ALIGN_None;
749  break;
750 
751  case Html_PRE:
752  case Html_LISTING:
753  case Html_XMP:
754  case Html_PLAINTEXT:
755  paraAlign = ALIGN_None;
756  style.fFont = CWFont(style.fFont);
757  style.fFlags |= STY_Preformatted;
759  break;
760 
761  case Html_EndPRE:
762  case Html_EndLISTING:
763  case Html_EndXMP:
765  break;
766 
767  case Html_S:
768  style.fFlags |= STY_StrikeThru;
770  break;
771 
772  case Html_SCRIPT: {
773  char *result;
774  result = ProcessScript((TGHtmlScript *) p); // fZText[script->nStart .. script->nScript]
775  if (result) {
776  TGHtmlElement *b2 = p->fPNext, *b3, *e1 = p, *e2 = b2, *e3;
777  if (e2) while (e2->fPNext) e2 = e2->fPNext;
778  TokenizerAppend(result);
779  if (e2 && e2 != p && ((e3 = b3 = e2->fPNext))) {
780  while (e3->fPNext) e3 = e3->fPNext;
781  e1->fPNext = b3;
782  e2->fPNext = 0; b2->fPPrev = e3;
783  e3->fPNext = b2; b3->fPPrev = e1;
784  }
785  delete[] result;
786  }
787  nextStyle = style;
788  style.fFlags |= STY_Invisible;
789  useNextStyle = 1;
790  break;
791  }
792 
793  case Html_SELECT:
794  ((TGHtmlInput *)p)->fPForm = fFormStart;
795  nextStyle.fFlags |= STY_Invisible;
796  useNextStyle = 1;
798  fFormElemStart = (TGHtmlInput *) p;
799  break;
800 
801  case Html_EndSELECT:
804  ((TGHtmlRef *)p)->fPOther = fFormElemStart;
805  MakeInvisible(((TGHtmlRef *)p)->fPOther, p);
806  } else {
807  ((TGHtmlRef *)p)->fPOther = 0;
808  }
809  fFormElemStart = 0;
810  break;
811 
812  case Html_STRIKE:
813  style.fFlags |= STY_StrikeThru;
815  break;
816 
817  case Html_STYLE:
818  // Ignore style sheets
819  break;
820 
821  case Html_SAMP:
822  style.fFont = CWFont(style.fFont);
824  break;
825 
826  case Html_SMALL:
827  ScaleFont(&style, -1);
829  break;
830 
831  case Html_STRONG:
832  style.fFont = BoldFont(style.fFont);
834  break;
835 
836  case Html_SUB:
837  ScaleFont(&style, -1);
838  if (style.fSubscript > -6 ) style.fSubscript--;
840  break;
841 
842  case Html_SUP:
843  ScaleFont(&style, -1);
844  if (style.fSubscript < 6) style.fSubscript++;
846  break;
847 
848  case Html_TABLE:
849  paraAlign = ALIGN_None;
850  nextStyle = style;
851  if (style.fFlags & STY_Preformatted) {
852  nextStyle.fFlags &= ~STY_Preformatted;
853  style.fFlags |= STY_Preformatted;
854  }
855  nextStyle.fAlign = ALIGN_Left;
856  z = p->MarkupArg("bgcolor", 0);
857  if (z && *z && !fOverrideColors) {
858  style.fBgcolor = nextStyle.fBgcolor = GetColorByName(z);
859  style.fExpbg = 1;
860 // } else {
861 // nextStyle.fBgcolor = COLOR_Background;
862  }
863  TableBgndImage(p);
864  PushStyleStack(Html_EndTABLE, nextStyle);
865  useNextStyle = 1;
866  fInTd = 0;
867  fInTr = 0;
868  break;
869 
870  case Html_EndTABLE:
871  paraAlign = ALIGN_None;
872  if (fInTd) {
874  fInTd = 0;
875  }
876  if (fInTr) {
878  fInTr = 0;
879  }
880  style = PopStyleStack(p->fType);
881  break;
882 
883  case Html_TD:
885  fInTd = 1;
886  paraAlign = p->GetAlignment(rowAlign);
887  z = p->MarkupArg("bgcolor", 0);
888  if (z && *z && !fOverrideColors) {
889  style.fBgcolor = GetColorByName(z);
890  style.fExpbg = 1;
891  }
892  TableBgndImage(p);
894  break;
895 
896  case Html_TEXTAREA:
897  ((TGHtmlInput *)p)->fPForm = fFormStart;
898  nextStyle = style;
899  nextStyle.fFlags |= STY_Invisible;
900  PushStyleStack(Html_EndTEXTAREA, nextStyle);
901  fFormElemStart = (TGHtmlInput *) p;
902  useNextStyle = 1;
903  break;
904 
905  case Html_EndTEXTAREA:
908  ((TGHtmlRef *)p)->fPOther = fFormElemStart;
909  } else {
910  ((TGHtmlRef *)p)->fPOther = 0;
911  }
912  fFormElemStart = 0;
913  break;
914 
915  case Html_TH:
916  //paraAlign = p->GetAlignment(rowAlign);
918  paraAlign = p->GetAlignment(ALIGN_Center);
919  style.fFont = BoldFont(style.fFont);
920  z = p->MarkupArg("bgcolor", 0);
921  if (z && *z && !fOverrideColors) {
922  style.fBgcolor = GetColorByName(z);
923  style.fExpbg = 1;
924  }
926  fInTd = 1;
927  break;
928 
929  case Html_TR:
930  if (fInTd) {
932  fInTd = 0;
933  }
934  if (fInTr) {
936  }
937  rowAlign = p->GetAlignment(ALIGN_None);
938  z = p->MarkupArg("bgcolor", 0);
939  if (z && *z && !fOverrideColors) {
940  style.fBgcolor = GetColorByName(z);
941  style.fExpbg = 1;
942  }
943  TableBgndImage(p);
945  fInTr = 1;
946  break;
947 
948  case Html_EndTR:
949  if (fInTd) {
951  fInTd = 0;
952  }
954  fInTr = 0;
955  paraAlign = ALIGN_None;
956  rowAlign = ALIGN_None;
957  break;
958 
959  case Html_EndTD:
960  case Html_EndTH:
962  fInTd = 0;
963  paraAlign = ALIGN_None;
964  //rowAlign = ALIGN_None;
965  break;
966 
967  case Html_TITLE:
968  style.fFlags |= STY_Invisible;
970  break;
971 
972  case Html_TT:
973  style.fFont = CWFont(style.fFont);
975  break;
976 
977  case Html_U:
978  style.fFlags |= STY_Underline;
980  break;
981 
982  case Html_VAR:
983  style.fFont = ItalicFont(style.fFont);
985  break;
986 
987  default:
988  break;
989  }
990 
991  p->fStyle = style;
993  if (paraAlign != ALIGN_None) {
994  p->fStyle.fAlign = paraAlign;
995  }
996  if (useNextStyle) {
997  style = nextStyle;
998  style.fExpbg = 0;
999  useNextStyle = 0;
1000  }
1001 
1003  ("Style font=%02d color=%02d bg=%02d "
1004  "align=%d flags=0x%04x token=%s\n",
1005  p->fStyle.fFont, p->fStyle.fColor, p->fStyle.fBgcolor,
1006  p->fStyle.fAlign, p->fStyle.fFlags, DumpToken(p)));
1007 
1008  p = p->fPNext;
1009  }
1010 
1011  // Copy state information back into the TGHtml object for safe keeping.
1012 
1013  fParaAlignment = paraAlign;
1014  fRowAlignment = rowAlign;
1015 
1016  fFlags &= ~STYLER_RUNNING;
1017 }
1018 
1019 ////////////////////////////////////////////////////////////////////////////////
1020 /// Set background picture of a html table.
1021 
1023 {
1024  const char *z;
1025 
1026  z = p->MarkupArg("background", 0);
1027  if (!z) return;
1028 
1029  char *z1 = ResolveUri(z);
1030  TImage *img = LoadImage(z1, 0, 0);
1031  delete [] z1;
1032 
1033  switch (p->fType) {
1034  case Html_TABLE: {
1035  TGHtmlTable *table = (TGHtmlTable *) p;
1036  if (table->fBgImage) delete table->fBgImage;
1037  table->fBgImage = img;
1038  break;
1039  }
1040  case Html_TR: {
1041  TGHtmlRef *ref = (TGHtmlRef *) p;
1042  if (ref->fBgImage) delete ref->fBgImage;
1043  ref->fBgImage = img;
1044  break;
1045  }
1046  case Html_TH:
1047  case Html_TD: {
1048  TGHtmlCell *cell = (TGHtmlCell *) p;
1049  if (cell->fBgImage) delete cell->fBgImage;
1050  cell->fBgImage = img;
1051  break;
1052  }
1053  default:
1054  if (img) delete img;
1055  break;
1056  }
1057 }
1058 
1059 ////////////////////////////////////////////////////////////////////////////////
1060 /// Compute the size of all elements in the widget. Assume that a style has
1061 /// already been assigned to all elements.
1062 ///
1063 /// Some of the elements might have already been sized. Refer to the
1064 /// fLastSized and only compute sizes for elements that follow this one. If
1065 /// fLastSized is 0, then size everything.
1066 ///
1067 /// This routine only computes the sizes of individual elements. The size of
1068 /// aggregate elements (like tables) are computed separately.
1069 ///
1070 /// The HTML_Visible flag is also set on every element that results in ink on
1071 /// the page.
1072 ///
1073 /// This routine may invoke a callback procedure which could delete the HTML
1074 /// widget.
1075 
1077 {
1078  TGHtmlElement *p;
1079  int iFont = -1;
1080  TGFont *font=0;
1081  int spaceWidth = 0;
1082  FontMetrics_t fontMetrics;
1083  const char *z;
1084  int stop = 0;
1085 
1086  if (fPFirst == 0) return;
1087 
1088  if (fLastSized == 0) {
1089  p = fPFirst;
1090  } else {
1091  p = fLastSized->fPNext;
1092  }
1093 
1094  // coverity[dead_error_line]
1095  for (; !stop && p; p = p ? p->fPNext : 0) {
1096  if (p->fStyle.fFlags & STY_Invisible) {
1097  p->fFlags &= ~HTML_Visible;
1098  continue;
1099  }
1100  if (iFont != (int)p->fStyle.fFont) {
1101  iFont = p->fStyle.fFont;
1102  font = GetFont(iFont);
1103  font->GetFontMetrics(&fontMetrics);
1104  spaceWidth = 0;
1105  }
1106  switch (p->fType) {
1107  case Html_Text: {
1109  text->fW = font->TextWidth(text->fZText, p->fCount);
1110  p->fFlags |= HTML_Visible;
1111  text->fDescent = fontMetrics.fDescent;
1112  text->fAscent = fontMetrics.fAscent;
1113  if (spaceWidth == 0) spaceWidth = font->TextWidth(" ", 1);
1114  text->fSpaceWidth = spaceWidth;
1115  break;
1116  }
1117 
1118  case Html_Space: {
1119  TGHtmlSpaceElement *space = (TGHtmlSpaceElement *) p;
1120  if (spaceWidth == 0) spaceWidth = font->TextWidth(" ", 1);
1121  space->fW = spaceWidth;
1122  space->fDescent = fontMetrics.fDescent;
1123  space->fAscent = fontMetrics.fAscent;
1124  p->fFlags &= ~HTML_Visible;
1125  break;
1126  }
1127 
1128  case Html_TD:
1129  case Html_TH: {
1130  TGHtmlCell *cell = (TGHtmlCell *) p;
1131  z = p->MarkupArg("rowspan", "1");
1132  cell->fRowspan = z ? atoi(z) : 1;
1133  z = p->MarkupArg("colspan", "1");
1134  cell->fColspan = z ? atoi(z) : 1;
1135  p->fFlags |= HTML_Visible;
1136  break;
1137  }
1138 
1139  case Html_LI: {
1140  TGHtmlLi *li = (TGHtmlLi *) p;
1141  li->fDescent = fontMetrics.fDescent;
1142  li->fAscent = fontMetrics.fAscent;
1143  p->fFlags |= HTML_Visible;
1144  break;
1145  }
1146 
1147  case Html_IMG: {
1148  TGHtmlImageMarkup *image = (TGHtmlImageMarkup *) p;
1149  z = p->MarkupArg("usemap", 0);
1150  if (z && *z == '#') {
1151  image->fPMap = GetMap(z+1);
1152  } else {
1153  image->fPMap = 0;
1154  }
1155  p->fFlags |= HTML_Visible;
1156  image->fRedrawNeeded = 0;
1157  image->fTextAscent = fontMetrics.fAscent;
1158  image->fTextDescent = fontMetrics.fDescent;
1159  image->fAlign = GetImageAlignment(p);
1160  if (image->fPImage == 0) {
1161  image->fAscent = fontMetrics.fAscent;
1162  image->fDescent = fontMetrics.fDescent;
1163  image->fZAlt = p->MarkupArg("alt", "<image>");
1164  if (image->fZAlt == 0) image->fZAlt = "<image>";
1165  image->fW = font->TextWidth(image->fZAlt, strlen(image->fZAlt));
1166  } else {
1167  int w, h;
1168  image->fINext = image->fPImage->fPList;
1169  image->fPImage->fPList = image;
1170  w = image->fPImage->fImage->GetWidth();
1171  h = image->fPImage->fImage->GetHeight();
1172  image->fH = h;
1173  image->fW = w;
1174  image->fAscent = h / 2;
1175  image->fDescent = h - image->fAscent;
1176  }
1177  if ((z = p->MarkupArg("width", 0)) != 0) {
1178  int w = atoi(z);
1179  if (z[strlen(z)-1] == '%') w = 0; //// -- HP
1180  if (w > 0) image->fW = w;
1181  }
1182  if ((z = p->MarkupArg("height", 0)) != 0) {
1183  int h = atoi(z);
1184  if (h > 0) image->fH = h;
1185  }
1186 
1187 #if 1 // --HP
1188  if (image->fPImage == 0 && !*image->fZAlt) {
1189  image->fAscent = image->fH / 2;
1190  image->fDescent = image->fH - image->fAscent;
1191  }
1192 #endif
1193  break;
1194  }
1195 
1196  case Html_TABLE:
1197  p->fFlags |= HTML_Visible;
1198  break;
1199 
1200  case Html_HR:
1201  p->fFlags |= HTML_Visible;
1202  break;
1203 
1204  case Html_APPLET:
1205  case Html_EMBED:
1206  case Html_INPUT: {
1207  TGHtmlInput *input = (TGHtmlInput *) p;
1208  input->fTextAscent = fontMetrics.fAscent;
1209  input->fTextDescent = fontMetrics.fDescent;
1210  stop = ControlSize(input);
1211  break;
1212  }
1213 
1214  case Html_SELECT:
1215  case Html_TEXTAREA: {
1216  TGHtmlInput *input = (TGHtmlInput *) p;
1217  input->fTextAscent = fontMetrics.fAscent;
1218  input->fTextDescent = fontMetrics.fDescent;
1219  break;
1220  }
1221 
1222  case Html_EndSELECT:
1223  case Html_EndTEXTAREA: {
1224  TGHtmlRef *ref = (TGHtmlRef *) p;
1225  if (ref->fPOther) {
1226  ((TGHtmlInput *)ref->fPOther)->fPEnd = p;
1227  stop = ControlSize((TGHtmlInput *) ref->fPOther);
1228  }
1229  break;
1230  }
1231 
1232  default:
1233  p->fFlags &= ~HTML_Visible;
1234  break;
1235  }
1236  }
1237 
1238  if (p) {
1239  fLastSized = p;
1240  } else {
1241  fLastSized = fPLast;
1242  }
1243 }
Html_EndTABLE
@ Html_EndTABLE
Definition: TGHtmlTokens.h:199
Html_EndSMALL
@ Html_EndSMALL
Definition: TGHtmlTokens.h:188
COLOR_Normal
#define COLOR_Normal
Definition: TGHtml.h:196
Html_NOBR
@ Html_NOBR
Definition: TGHtmlTokens.h:161
TGHtmlImageMarkup::fDescent
Html_16_t fDescent
Definition: TGHtml.h:547
TGHtmlMapArea::fMType
int fMType
Definition: TGHtml.h:472
Html_EndTEXTAREA
@ Html_EndTEXTAREA
Definition: TGHtmlTokens.h:203
TGHtml::PushStyleStack
void PushStyleStack(int tag, SHtmlStyle_t style)
Push a new rendering style onto the stack.
Definition: TGHtmlSizer.cxx:66
TGHtml::TokenizerAppend
void TokenizerAppend(const char *text)
Append text to the tokenizer engine.
Definition: TGHtmlParse.cxx:1084
TGHtmlLi
Definition: TGHtml.h:418
n
const Int_t n
Definition: legend1.C:16
Html_EndA
@ Html_EndA
Definition: TGHtmlTokens.h:73
TGHtmlImageMarkup::fINext
TGHtmlImageMarkup * fINext
Definition: TGHtml.h:553
SHtmlStyleStack_t::fPNext
SHtmlStyleStack_t * fPNext
Definition: TGHtml.h:733
STY_Underline
#define STY_Underline
Definition: TGHtml.h:235
Html_EndMENU
@ Html_EndMENU
Definition: TGHtmlTokens.h:158
TGHtml::AllocColor
ColorStruct_t * AllocColor(const char *name)
Allocate system color by name.
Definition: TGHtml.cxx:261
FontMetrics_t
Definition: TGFont.h:61
TGHtml::fApColor
ColorStruct_t * fApColor[N_COLOR]
Definition: TGHtml.h:1223
Html_H1
@ Html_H1
Definition: TGHtmlTokens.h:125
TGHtmlCell::fRowspan
Html_16_t fRowspan
Definition: TGHtml.h:386
kTRUE
const Bool_t kTRUE
Definition: RtypesCore.h:91
Html_EndKBD
@ Html_EndKBD
Definition: TGHtmlTokens.h:147
TGHtmlElement::fPNext
TGHtmlElement * fPNext
Definition: TGHtml.h:261
Html_A
@ Html_A
Definition: TGHtmlTokens.h:72
TGHtml::fInTd
int fInTd
Definition: TGHtml.h:1194
Html_LI
@ Html_LI
Definition: TGHtmlTokens.h:148
Html_UL
@ Html_UL
Definition: TGHtmlTokens.h:214
snprintf
#define snprintf
Definition: civetweb.c:1540
TGHtmlElement
Definition: TGHtml.h:249
TGHtmlLi::fDescent
Html_u8_t fDescent
Definition: TGHtml.h:425
Html_EndBLOCKQUOTE
@ Html_EndBLOCKQUOTE
Definition: TGHtmlTokens.h:88
TGView::fWhiteGC
TGGC fWhiteGC
Definition: TGView.h:66
TGHtml::fAnchorFlags
int fAnchorFlags
Definition: TGHtml.h:1191
TGHtml::fLastSized
TGHtmlElement * fLastSized
Definition: TGHtml.h:1132
TGGC::GetGC
GContext_t GetGC() const
Definition: TGGC.h:50
TGHtml::PopStyleStack
SHtmlStyle_t PopStyleStack(int tag)
Pop a rendering style off of the stack.
Definition: TGHtmlSizer.cxx:87
TGHtml::fFormElemStart
TGHtmlInput * fFormElemStart
Definition: TGHtml.h:1197
TGHtmlMapArea::fCoords
int * fCoords
Definition: TGHtml.h:473
LI_TYPE_Bullet3
#define LI_TYPE_Bullet3
Definition: TGHtml.h:440
LI_TYPE_Bullet2
#define LI_TYPE_Bullet2
Definition: TGHtml.h:439
SHtmlStyle_t::fColor
unsigned int fColor
Definition: TGHtml.h:145
TGHtmlImageMarkup::fTextAscent
Html_u8_t fTextAscent
Definition: TGHtml.h:540
TGHtml::ProcessScript
virtual char * ProcessScript(TGHtmlScript *)
Definition: TGHtml.h:957
gVirtualX
#define gVirtualX
Definition: TVirtualX.h:338
TGHtmlImageMarkup::fAscent
Html_16_t fAscent
Definition: TGHtml.h:546
TGHtmlImageMarkup::fW
Html_16_t fW
Definition: TGHtml.h:545
Html_DIR
@ Html_DIR
Definition: TGHtmlTokens.h:106
BoldFont
#define BoldFont(X)
Definition: TGHtml.h:167
Html_SUB
@ Html_SUB
Definition: TGHtmlTokens.h:194
Html_H3
@ Html_H3
Definition: TGHtmlTokens.h:129
ALIGN_None
#define ALIGN_None
Definition: TGHtml.h:211
Html_TEXTAREA
@ Html_TEXTAREA
Definition: TGHtmlTokens.h:202
TGHtmlMarkupElement::MarkupArg
virtual const char * MarkupArg(const char *tag, const char *zDefault)
Lookup an argument in the given markup with the name given.
Definition: TGHtmlElement.cxx:135
TGHtml::fInDt
int fInDt
Definition: TGHtml.h:1192
Html_SCRIPT
@ Html_SCRIPT
Definition: TGHtmlTokens.h:184
Html_KBD
@ Html_KBD
Definition: TGHtmlTokens.h:146
STY_StrikeThru
#define STY_StrikeThru
Definition: TGHtml.h:234
CANT_HAPPEN
#define CANT_HAPPEN
Definition: TGHtml.h:59
Html_XMP
@ Html_XMP
Definition: TGHtmlTokens.h:219
Html_u8_t
unsigned char Html_u8_t
Definition: TGHtml.h:135
TGHtml::DumpToken
char * DumpToken(TGHtmlElement *p)
For debugging purposes, print information about a token.
Definition: TGHtmlParse.cxx:1339
Html_FONT
@ Html_FONT
Definition: TGHtmlTokens.h:117
Html_ADDRESS
@ Html_ADDRESS
Definition: TGHtmlTokens.h:74
GCValues_t
Definition: GuiTypes.h:223
TGHtmlRef::fPOther
TGHtmlElement * fPOther
Definition: TGHtml.h:410
TGView::SetBackgroundColor
virtual void SetBackgroundColor(Pixel_t)
Set background color of the canvas frame.
Definition: TGView.cxx:579
SHtmlStyle_t::fFont
unsigned int fFont
Definition: TGHtml.h:144
TGHtmlScript
Definition: TGHtml.h:678
TGHtmlLi::fAscent
Html_u8_t fAscent
Definition: TGHtml.h:424
TGHtml::fFormStart
TGHtmlForm * fFormStart
Definition: TGHtml.h:1196
GCValues_t::fFillStyle
Int_t fFillStyle
Definition: GuiTypes.h:233
Html_EndB
@ Html_EndB
Definition: TGHtmlTokens.h:80
LI_TYPE_Enum_1
#define LI_TYPE_Enum_1
Definition: TGHtml.h:441
TGHtmlTable
Definition: TGHtml.h:353
TImage
Definition: TImage.h:29
TGHtmlElement::fFlags
Html_u8_t fFlags
Definition: TGHtml.h:265
TGFont::TextWidth
Int_t TextWidth(const char *string, Int_t numChars=-1) const
A wrapper function for the more complicated interface of MeasureChars.
Definition: TGFont.cxx:565
SHtmlStyleStack_t::fStyle
SHtmlStyle_t fStyle
Definition: TGHtml.h:735
Html_EndCENTER
@ Html_EndCENTER
Definition: TGHtmlTokens.h:95
Html_EndNOBR
@ Html_EndNOBR
Definition: TGHtmlTokens.h:162
TGHtmlSpaceElement::fAscent
Html_u8_t fAscent
Definition: TGHtml.h:309
Html_S
@ Html_S
Definition: TGHtmlTokens.h:180
TImage::GetHeight
virtual UInt_t GetHeight() const
Definition: TImage.h:229
Html_PRE
@ Html_PRE
Definition: TGHtmlTokens.h:178
Html_EndTT
@ Html_EndTT
Definition: TGHtmlTokens.h:211
Html_EndDD
@ Html_EndDD
Definition: TGHtmlTokens.h:103
Html_AREA
@ Html_AREA
Definition: TGHtmlTokens.h:78
TVirtualX.h
Html_EndDT
@ Html_EndDT
Definition: TGHtmlTokens.h:113
TGHtml::TableBgndImage
void TableBgndImage(TGHtmlElement *p)
Set background picture of a html table.
Definition: TGHtmlSizer.cxx:1022
Html_EndSTRIKE
@ Html_EndSTRIKE
Definition: TGHtmlTokens.h:190
TGHtml::fOverrideColors
int fOverrideColors
Definition: TGHtml.h:1241
TGWindow::SetBackgroundPixmap
virtual void SetBackgroundPixmap(Pixmap_t pixmap)
set background pixmap
Definition: TGWindow.cxx:229
TGHtmlForm::fFormId
Html_u16_t fFormId
Definition: TGHtml.h:638
Html_EndSELECT
@ Html_EndSELECT
Definition: TGHtmlTokens.h:186
TGHtml::Sizer
void Sizer()
Compute the size of all elements in the widget.
Definition: TGHtmlSizer.cxx:1076
Html_EndSTRONG
@ Html_EndSTRONG
Definition: TGHtmlTokens.h:192
STY_NoBreak
#define STY_NoBreak
Definition: TGHtml.h:236
Html_B
@ Html_B
Definition: TGHtmlTokens.h:79
N_FONT_SIZE
#define N_FONT_SIZE
Definition: TGHtml.h:164
Html_U
@ Html_U
Definition: TGHtmlTokens.h:212
Html_VAR
@ Html_VAR
Definition: TGHtmlTokens.h:216
Html_MENU
@ Html_MENU
Definition: TGHtmlTokens.h:157
TGHtml::fAnchorStart
TGHtmlAnchor * fAnchorStart
Definition: TGHtml.h:1195
TGView::fCanvas
TGViewFrame * fCanvas
Definition: TGView.h:62
TGHtml::LoadImage
virtual TImage * LoadImage(const char *uri, int w=0, int h=0)
This is the default LoadImage() procedure.
Definition: TGHtmlImage.cxx:292
Html_I
@ Html_I
Definition: TGHtmlTokens.h:140
Html_CODE
@ Html_CODE
Definition: TGHtmlTokens.h:98
text
TText * text
Definition: entrylist_figure1.C:10
TGHtmlMapArea::fNum
int fNum
Definition: TGHtml.h:474
TGHtmlCell
Definition: TGHtml.h:380
Html_EndH5
@ Html_EndH5
Definition: TGHtmlTokens.h:134
Html_EndSAMP
@ Html_EndSAMP
Definition: TGHtmlTokens.h:183
Html_CAPTION
@ Html_CAPTION
Definition: TGHtmlTokens.h:92
Html_EndCOMMENT
@ Html_EndCOMMENT
Definition: TGHtmlTokens.h:101
Html_EndVAR
@ Html_EndVAR
Definition: TGHtmlTokens.h:217
TGFont::GetFontMetrics
void GetFontMetrics(FontMetrics_t *m) const
Get font metrics.
Definition: TGFont.cxx:276
TGHtmlTable::fBgImage
TImage * fBgImage
Definition: TGHtml.h:369
SHtmlStyle_t::fBgcolor
unsigned int fBgcolor
Definition: TGHtml.h:148
Html_H5
@ Html_H5
Definition: TGHtmlTokens.h:133
TImage.h
TGHtml::AppendArglist
void AppendArglist(TGString *str, TGHtmlMarkupElement *pElem)
Append all the arguments of the given markup to the given TGString.
Definition: TGHtmlParse.cxx:1409
HTML_MAP_CIRCLE
#define HTML_MAP_CIRCLE
Definition: TGHtml.h:464
Html_EndMARQUEE
@ Html_EndMARQUEE
Definition: TGHtmlTokens.h:156
Html_STRIKE
@ Html_STRIKE
Definition: TGHtmlTokens.h:189
TGHtmlElement::fStyle
SHtmlStyle_t fStyle
Definition: TGHtml.h:263
HtmlTrace_Style
#define HtmlTrace_Style
Definition: TGHtml.h:95
TGHtml::ControlSize
int ControlSize(TGHtmlInput *p)
This routine implements the Sizer() function for <INPUT>, <SELECT> and <TEXTAREA> markup.
Definition: TGHtmlForm.cxx:357
TGHtmlImageMarkup::fRedrawNeeded
Html_u8_t fRedrawNeeded
Definition: TGHtml.h:542
ALIGN_Left
#define ALIGN_Left
Definition: TGHtml.h:208
Html_EndH1
@ Html_EndH1
Definition: TGHtmlTokens.h:126
style
TCanvas * style()
Definition: style.C:1
TGHtml::fPLast
TGHtmlElement * fPLast
Definition: TGHtml.h:1129
Html_EndBASEFONT
@ Html_EndBASEFONT
Definition: TGHtmlTokens.h:83
Html_P
@ Html_P
Definition: TGHtmlTokens.h:173
STY_Invisible
#define STY_Invisible
Definition: TGHtml.h:239
Html_EndBODY
@ Html_EndBODY
Definition: TGHtmlTokens.h:90
Html_EndCAPTION
@ Html_EndCAPTION
Definition: TGHtmlTokens.h:93
Html_MAP
@ Html_MAP
Definition: TGHtmlTokens.h:153
TGHtml::fRowAlignment
int fRowAlignment
Definition: TGHtml.h:1190
Html_MARQUEE
@ Html_MARQUEE
Definition: TGHtmlTokens.h:155
GetCoords
static int * GetCoords(const char *str, int *nptr)
Returns coordinates of string str.
Definition: TGHtmlSizer.cxx:167
Html_SUP
@ Html_SUP
Definition: TGHtmlTokens.h:196
TGHtml::fOverrideFonts
int fOverrideFonts
Definition: TGHtml.h:1240
TGHtml::fFlags
int fFlags
Definition: TGHtml.h:1269
TGHtmlElement::fPPrev
TGHtmlElement * fPPrev
Definition: TGHtml.h:262
HTML_MAP_RECT
#define HTML_MAP_RECT
Definition: TGHtml.h:463
Html_EndTITLE
@ Html_EndTITLE
Definition: TGHtmlTokens.h:207
Html_EndBIG
@ Html_EndBIG
Definition: TGHtmlTokens.h:86
TGHtmlRef
Definition: TGHtml.h:404
TGHtmlImageMarkup::fAlign
Html_u8_t fAlign
Definition: TGHtml.h:539
TGHtmlLi::fLtype
Html_u8_t fLtype
Definition: TGHtml.h:423
TGView::SetBackgroundPixmap
virtual void SetBackgroundPixmap(Pixmap_t p)
Set backgound pixmap.
Definition: TGView.cxx:589
TGHtml::GetLinkColor
int GetLinkColor(const char *zURL)
For the markup <a href=XXX>, find out if the URL has been visited before or not.
Definition: TGHtmlSizer.cxx:159
FontFamily
#define FontFamily(X)
Definition: TGHtml.h:171
TGHtmlMarkupElement::GetOrderedListType
virtual int GetOrderedListType(int dflt)
The "type" argument to the given element might describe the type for an ordered list.
Definition: TGHtmlElement.cxx:174
TGHtmlSpaceElement::fW
Html_16_t fW
Definition: TGHtml.h:308
TGHtmlSpaceElement
Definition: TGHtml.h:306
TGHtmlAnchor
Definition: TGHtml.h:662
TGHtmlElement::fType
Html_u8_t fType
Definition: TGHtml.h:264
h
#define h(i)
Definition: RSha256.hxx:124
TGHtml::fZBaseHref
char * fZBaseHref
Definition: TGHtml.h:1260
Html_EndDL
@ Html_EndDL
Definition: TGHtmlTokens.h:111
Html_SMALL
@ Html_SMALL
Definition: TGHtmlTokens.h:187
TGHtmlInput
Definition: TGHtml.h:581
TGHtml::GetFont
virtual TGFont * GetFont(int iFont)
The rendering and layout routines should call this routine in order to get a font structure.
Definition: TGHtml.cxx:1407
TGHtmlImageMarkup::fTextDescent
Html_u8_t fTextDescent
Definition: TGHtml.h:541
Html_EndH6
@ Html_EndH6
Definition: TGHtmlTokens.h:136
Html_EndADDRESS
@ Html_EndADDRESS
Definition: TGHtmlTokens.h:75
TRACE
#define TRACE(Flag, Args)
Definition: TGHtml.h:120
Html_TD
@ Html_TD
Definition: TGHtmlTokens.h:200
TGHtmlForm::fPEnd
TGHtmlElement * fPEnd
Definition: TGHtml.h:642
TString::Append
TString & Append(const char *cs)
Definition: TString.h:564
Html_EndCITE
@ Html_EndCITE
Definition: TGHtmlTokens.h:97
TGHtml.h
TGHtmlListStart::fCompact
Html_u8_t fCompact
Definition: TGHtml.h:456
TGHtmlImageMarkup::fH
Html_16_t fH
Definition: TGHtml.h:544
TGHtmlCell::fBgImage
TImage * fBgImage
Definition: TGHtml.h:395
COLOR_Visited
#define COLOR_Visited
Definition: TGHtml.h:198
TGHtml::GetCurrentStyle
SHtmlStyle_t GetCurrentStyle()
Get the current rendering style.
Definition: TGHtmlSizer.cxx:41
Html_EM
@ Html_EM
Definition: TGHtmlTokens.h:114
Html_EndOL
@ Html_EndOL
Definition: TGHtmlTokens.h:170
TGHtml::fInnerList
TGHtmlListStart * fInnerList
Definition: TGHtml.h:1199
Html_STYLE
@ Html_STYLE
Definition: TGHtmlTokens.h:193
TGHtmlImageMarkup
Definition: TGHtml.h:534
Html_EndDIV
@ Html_EndDIV
Definition: TGHtmlTokens.h:109
Html_EndSUP
@ Html_EndSUP
Definition: TGHtmlTokens.h:197
TGHtmlMarkupElement
Definition: TGHtml.h:323
StrDup
char * StrDup(const char *str)
Duplicate the string str.
Definition: TString.cxx:2490
SHtmlStyle_t::fFlags
unsigned int fFlags
Definition: TGHtml.h:150
TGHtml::fZBase
const char * fZBase
Definition: TGHtml.h:1259
Html_EndNOSCRIPT
@ Html_EndNOSCRIPT
Definition: TGHtmlTokens.h:168
TGHtml::fParaAlignment
int fParaAlignment
Definition: TGHtml.h:1189
Html_EndCODE
@ Html_EndCODE
Definition: TGHtmlTokens.h:99
TGHtml::fInTr
int fInTr
Definition: TGHtml.h:1193
TGHtmlImage::fImage
TImage * fImage
Definition: TGHtml.h:518
TGHtmlTextElement
Definition: TGHtml.h:285
Html_EndP
@ Html_EndP
Definition: TGHtmlTokens.h:174
TGHtmlImageMarkup::fPImage
TGHtmlImage * fPImage
Definition: TGHtml.h:551
STY_Preformatted
#define STY_Preformatted
Definition: TGHtml.h:233
GCValues_t::fGraphicsExposures
Bool_t fGraphicsExposures
Definition: GuiTypes.h:243
HTML_Visible
#define HTML_Visible
Definition: TGHtml.h:274
Html_TITLE
@ Html_TITLE
Definition: TGHtmlTokens.h:206
TGHtmlMarkupElement::GetUnorderedListType
virtual int GetUnorderedListType(int dflt)
The "type" argument to the given element might describe a type for an unordered list.
Definition: TGHtmlElement.cxx:196
Html_EndTH
@ Html_EndTH
Definition: TGHtmlTokens.h:205
TGHtml::GetMap
TGHtmlElement * GetMap(const char *name)
Returns html map element.
Definition: TGHtml.cxx:1535
Html_DT
@ Html_DT
Definition: TGHtmlTokens.h:112
Html_DD
@ Html_DD
Definition: TGHtmlTokens.h:102
Html_H6
@ Html_H6
Definition: TGHtmlTokens.h:135
GCValues_t::fTile
Pixmap_t fTile
Definition: GuiTypes.h:237
TGHtmlInput::fTextAscent
Html_u8_t fTextAscent
Definition: TGHtml.h:600
Html_TR
@ Html_TR
Definition: TGHtmlTokens.h:208
Html_EndFORM
@ Html_EndFORM
Definition: TGHtmlTokens.h:120
Html_EndNOEMBED
@ Html_EndNOEMBED
Definition: TGHtmlTokens.h:164
TGHtmlImageMarkup::fZAlt
const char * fZAlt
Definition: TGHtml.h:550
SHtmlStyle_t
Definition: TGHtml.h:143
TGHtmlInput::fTextDescent
Html_u8_t fTextDescent
Definition: TGHtml.h:601
TImage::GetWidth
virtual UInt_t GetWidth() const
Definition: TImage.h:228
Html_FORM
@ Html_FORM
Definition: TGHtmlTokens.h:119
TGHtml::FormCreate
virtual int FormCreate(TGHtmlForm *, const char *, const char *)
Definition: TGHtml.h:945
Html_SAMP
@ Html_SAMP
Definition: TGHtmlTokens.h:182
Html_EndEM
@ Html_EndEM
Definition: TGHtmlTokens.h:115
Html_EndAPPLET
@ Html_EndAPPLET
Definition: TGHtmlTokens.h:77
Html_EndDFN
@ Html_EndDFN
Definition: TGHtmlTokens.h:105
TGHtml::MakeInvisible
void MakeInvisible(TGHtmlElement *p_first, TGHtmlElement *p_last)
Add the STY_Invisible style to every token between p_first and p_last.
Definition: TGHtmlSizer.cxx:144
Html_EndLISTING
@ Html_EndLISTING
Definition: TGHtmlTokens.h:152
kFillTiled
@ kFillTiled
Definition: GuiTypes.h:50
Html_NOFRAMES
@ Html_NOFRAMES
Definition: TGHtmlTokens.h:165
Html_NOSCRIPT
@ Html_NOSCRIPT
Definition: TGHtmlTokens.h:167
ALIGN_Center
#define ALIGN_Center
Definition: TGHtml.h:210
TGHtml::ResolveUri
virtual char * ResolveUri(const char *uri)
This function resolves the specified URI and returns the result in a newly allocated string.
Definition: TGHtmlUri.cxx:307
Html_EndTR
@ Html_EndTR
Definition: TGHtmlTokens.h:209
STY_DT
#define STY_DT
Definition: TGHtml.h:238
Html_EndNOFRAMES
@ Html_EndNOFRAMES
Definition: TGHtmlTokens.h:166
Html_BLOCKQUOTE
@ Html_BLOCKQUOTE
Definition: TGHtmlTokens.h:87
HTML_MAP_POLY
#define HTML_MAP_POLY
Definition: TGHtml.h:465
TGHtml::fStyleStack
SHtmlStyleStack_t * fStyleStack
Definition: TGHtml.h:1188
TGHtmlCell::fColspan
Html_16_t fColspan
Definition: TGHtml.h:387
Html_EMBED
@ Html_EMBED
Definition: TGHtmlTokens.h:116
TGHtmlMarkupElement::GetAlignment
virtual int GetAlignment(int dflt)
Return an alignment or justification flag associated with the given markup.
Definition: TGHtmlElement.cxx:150
COLOR_Unvisited
#define COLOR_Unvisited
Definition: TGHtml.h:197
Html_DIV
@ Html_DIV
Definition: TGHtmlTokens.h:108
Html_COMMENT
@ Html_COMMENT
Definition: TGHtmlTokens.h:100
Html_OPTION
@ Html_OPTION
Definition: TGHtmlTokens.h:171
Html_TT
@ Html_TT
Definition: TGHtmlTokens.h:210
Html_DFN
@ Html_DFN
Definition: TGHtmlTokens.h:104
Html_NOEMBED
@ Html_NOEMBED
Definition: TGHtmlTokens.h:163
Html_EndH3
@ Html_EndH3
Definition: TGHtmlTokens.h:130
Html_H2
@ Html_H2
Definition: TGHtmlTokens.h:127
Html_EndTD
@ Html_EndTD
Definition: TGHtmlTokens.h:201
Html_TypeCount
#define Html_TypeCount
Definition: TGHtmlTokens.h:198
Html_STRONG
@ Html_STRONG
Definition: TGHtmlTokens.h:191
Html_H4
@ Html_H4
Definition: TGHtmlTokens.h:131
Html_EndFONT
@ Html_EndFONT
Definition: TGHtmlTokens.h:118
TGHtml::AddStyle
void AddStyle(TGHtmlElement *p)
This routine adds information to the input texts that doesn't change when the display is resized or w...
Definition: TGHtmlSizer.cxx:216
Html_LISTING
@ Html_LISTING
Definition: TGHtmlTokens.h:151
ItalicFont
#define ItalicFont(X)
Definition: TGHtml.h:168
TImage::GetPixmap
virtual Pixmap_t GetPixmap()
Definition: TImage.h:235
TGHtml::fUnderlineLinks
int fUnderlineLinks
Definition: TGHtml.h:1242
Html_BIG
@ Html_BIG
Definition: TGHtmlTokens.h:85
SHtmlStyleStack_t::fType
int fType
Definition: TGHtml.h:734
Html_TABLE
@ Html_TABLE
Definition: TGHtmlTokens.h:198
Html_EndS
@ Html_EndS
Definition: TGHtmlTokens.h:181
TGHtmlElement::GetAlignment
virtual int GetAlignment(int dflt)
Definition: TGHtml.h:255
STYLER_RUNNING
#define STYLER_RUNNING
Definition: TGHtml.h:1329
Html_INPUT
@ Html_INPUT
Definition: TGHtmlTokens.h:144
CWFont
#define CWFont(X)
Definition: TGHtml.h:169
Html_EndH2
@ Html_EndH2
Definition: TGHtmlTokens.h:128
COLOR_Background
#define COLOR_Background
Definition: TGHtml.h:200
Html_BODY
@ Html_BODY
Definition: TGHtmlTokens.h:89
TGString::GetString
const char * GetString() const
Definition: TGString.h:46
Html_CITE
@ Html_CITE
Definition: TGHtmlTokens.h:96
SHtmlStyleStack_t
Definition: TGHtml.h:732
Html_DL
@ Html_DL
Definition: TGHtmlTokens.h:110
Html_EndSUB
@ Html_EndSUB
Definition: TGHtmlTokens.h:195
TGHtml::IsVisited
virtual int IsVisited(const char *)
Definition: TGHtml.h:923
FontMetrics_t::fAscent
Int_t fAscent
Definition: TGFont.h:62
TGHtml::fBgImage
TImage * fBgImage
Definition: TGHtml.h:1237
Html_BASEFONT
@ Html_BASEFONT
Definition: TGHtmlTokens.h:82
Html_EndMAP
@ Html_EndMAP
Definition: TGHtmlTokens.h:154
Html_EndDIR
@ Html_EndDIR
Definition: TGHtmlTokens.h:107
type
int type
Definition: TGX11.cxx:121
TGHtmlSpaceElement::fDescent
Html_u8_t fDescent
Definition: TGHtml.h:310
FontMetrics_t::fDescent
Int_t fDescent
Definition: TGFont.h:63
TGFont
Definition: TGFont.h:149
TGHtmlForm
Definition: TGHtml.h:633
Html_EndH4
@ Html_EndH4
Definition: TGHtmlTokens.h:132
LI_TYPE_Bullet1
#define LI_TYPE_Bullet1
Definition: TGHtml.h:438
Html_EndPRE
@ Html_EndPRE
Definition: TGHtmlTokens.h:179
Html_HR
@ Html_HR
Definition: TGHtmlTokens.h:137
ScaleFont
static void ScaleFont(SHtmlStyle_t *pStyle, int delta)
Change the font size on the given style by the delta-amount given.
Definition: TGHtmlSizer.cxx:128
TGHtml::GetColorByName
int GetColorByName(const char *zColor)
This routine returns an index between 0 and N_COLOR-1 which indicates which ColorStruct_t structure i...
Definition: TGHtml.cxx:1571
Html_CENTER
@ Html_CENTER
Definition: TGHtmlTokens.h:94
TGHtmlListStart::fLPrev
TGHtmlListStart * fLPrev
Definition: TGHtml.h:459
TGHtmlImageMarkup::fPMap
TGHtmlElement * fPMap
Definition: TGHtml.h:552
TGHtmlLi::fCnt
Html_16_t fCnt
Definition: TGHtml.h:426
TGHtmlMapArea
Definition: TGHtml.h:467
TGHtml::GetImage
TGHtmlImage * GetImage(TGHtmlImageMarkup *p)
Given an.
Definition: TGHtmlImage.cxx:162
TGHtmlListStart::fLtype
Html_u8_t fLtype
Definition: TGHtml.h:455
TGString
Definition: TGString.h:30
TGHtmlRef::fBgImage
TImage * fBgImage
Definition: TGHtml.h:411
Html_APPLET
@ Html_APPLET
Definition: TGHtmlTokens.h:76
Html_Text
@ Html_Text
Definition: TGHtmlTokens.h:68
STY_Anchor
#define STY_Anchor
Definition: TGHtml.h:237
TGHtmlListStart
Definition: TGHtml.h:450
TGHtmlElement::MarkupArg
virtual const char * MarkupArg(const char *, const char *)
Definition: TGHtml.h:254
Html_Space
@ Html_Space
Definition: TGHtmlTokens.h:69
Html_EndUL
@ Html_EndUL
Definition: TGHtmlTokens.h:215
Html_EndXMP
@ Html_EndXMP
Definition: TGHtmlTokens.h:220
Html_IMG
@ Html_IMG
Definition: TGHtmlTokens.h:143
Html_EndI
@ Html_EndI
Definition: TGHtmlTokens.h:141
SHtmlStyle_t::fAlign
unsigned int fAlign
Definition: TGHtml.h:147
Html_EndU
@ Html_EndU
Definition: TGHtmlTokens.h:213
FontSize
#define FontSize(X)
Definition: TGHtml.h:170
Html_OL
@ Html_OL
Definition: TGHtmlTokens.h:169
Html_TH
@ Html_TH
Definition: TGHtmlTokens.h:204
Html_BASE
@ Html_BASE
Definition: TGHtmlTokens.h:81
NormalFont
#define NormalFont(X)
Definition: TGHtml.h:166
TGHtml::GetImageAlignment
int GetImageAlignment(TGHtmlElement *p)
Find the alignment for an image.
Definition: TGHtmlImage.cxx:84
TGHtmlListStart::fCnt
Html_u16_t fCnt
Definition: TGHtml.h:457
Html_SELECT
@ Html_SELECT
Definition: TGHtmlTokens.h:185
int
TGHtml::fPFirst
TGHtmlElement * fPFirst
Definition: TGHtml.h:1128
Html_PLAINTEXT
@ Html_PLAINTEXT
Definition: TGHtmlTokens.h:177
TGHtmlImage::fPList
TGHtmlImageMarkup * fPList
Definition: TGHtml.h:524