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