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