Logo ROOT   6.16/01
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 <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) {
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;
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) {
104 return GetCurrentStyle();
105 }
106 while ((p = fStyleStack) != 0) {
107 type = p->fType;
108 if (type <= 0 || type > Html_TypeCount) {
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
126static 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
157int TGHtml::GetLinkColor(const char *zURL)
158{
159 return IsVisited(zURL) ? COLOR_Visited : COLOR_Unvisited;
160}
161
162////////////////////////////////////////////////////////////////////////////////
163/// Returns coordinates of string str.
164
165static 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
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) {
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;
256 }
257 break;
258
259 case Html_EndA:
260 if (fAnchorStart) {
261 ((TGHtmlRef *)p)->fPOther = fAnchorStart;
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:
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);
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();
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:
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;
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);
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);
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);
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);
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);
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(" { ");
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);
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;
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);
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);
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;
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;
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;
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;
757 break;
758
759 case Html_EndPRE:
760 case Html_EndLISTING:
761 case Html_EndXMP:
763 break;
764
765 case Html_S:
766 style.fFlags |= STY_StrikeThru;
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;
797 break;
798
799 case 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--;
838 break;
839
840 case Html_SUP:
841 ScaleFont(&style, -1);
842 if (style.fSubscript < 6) style.fSubscript++;
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 }
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) {
872 fInTd = 0;
873 }
874 if (fInTr) {
876 fInTr = 0;
877 }
879 break;
880
881 case Html_TD:
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 }
892 break;
893
894 case Html_TEXTAREA:
895 ((TGHtmlInput *)p)->fPForm = fFormStart;
896 nextStyle = style;
897 nextStyle.fFlags |= STY_Invisible;
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);
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 }
924 fInTd = 1;
925 break;
926
927 case Html_TR:
928 if (fInTd) {
930 fInTd = 0;
931 }
932 if (fInTr) {
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 }
943 fInTr = 1;
944 break;
945
946 case Html_EndTR:
947 if (fInTd) {
949 fInTd = 0;
950 }
952 fInTr = 0;
953 paraAlign = ALIGN_None;
954 rowAlign = ALIGN_None;
955 break;
956
957 case Html_EndTD:
958 case Html_EndTH:
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);
973 break;
974
975 case Html_U:
976 style.fFlags |= STY_Underline;
978 break;
979
980 case Html_VAR:
981 style.fFont = ItalicFont(style.fFont);
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",
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: {
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: {
1146 TGHtmlImageMarkup *image = (TGHtmlImageMarkup *) p;
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 {
1240 }
1241}
@ kFillTiled
Definition: GuiTypes.h:50
#define h(i)
Definition: RSha256.hxx:106
const Bool_t kTRUE
Definition: RtypesCore.h:87
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
Definition: TGHtmlTokens.h:198
@ Html_EndBODY
Definition: TGHtmlTokens.h:64
@ Html_NOEMBED
Definition: TGHtmlTokens.h:137
@ Html_SUP
Definition: TGHtmlTokens.h:170
@ Html_H3
Definition: TGHtmlTokens.h:103
@ Html_MARQUEE
Definition: TGHtmlTokens.h:129
@ Html_EndH4
Definition: TGHtmlTokens.h:106
@ Html_FORM
Definition: TGHtmlTokens.h:93
@ Html_U
Definition: TGHtmlTokens.h:186
@ Html_DFN
Definition: TGHtmlTokens.h:78
@ Html_COMMENT
Definition: TGHtmlTokens.h:74
@ Html_EndTT
Definition: TGHtmlTokens.h:185
@ Html_EndTH
Definition: TGHtmlTokens.h:179
@ Html_EndMENU
Definition: TGHtmlTokens.h:132
@ Html_BODY
Definition: TGHtmlTokens.h:63
@ Html_EM
Definition: TGHtmlTokens.h:88
@ Html_BLOCKQUOTE
Definition: TGHtmlTokens.h:61
@ Html_HR
Definition: TGHtmlTokens.h:111
@ Html_STRIKE
Definition: TGHtmlTokens.h:163
@ Html_EndTABLE
Definition: TGHtmlTokens.h:173
@ Html_I
Definition: TGHtmlTokens.h:114
@ Html_KBD
Definition: TGHtmlTokens.h:120
@ Html_DL
Definition: TGHtmlTokens.h:84
@ Html_EndTEXTAREA
Definition: TGHtmlTokens.h:177
@ Html_TEXTAREA
Definition: TGHtmlTokens.h:176
@ Html_XMP
Definition: TGHtmlTokens.h:193
@ Html_EndNOSCRIPT
Definition: TGHtmlTokens.h:142
@ Html_DT
Definition: TGHtmlTokens.h:86
@ Html_NOBR
Definition: TGHtmlTokens.h:135
@ Html_TD
Definition: TGHtmlTokens.h:174
@ Html_EMBED
Definition: TGHtmlTokens.h:90
@ Html_STYLE
Definition: TGHtmlTokens.h:167
@ Html_CENTER
Definition: TGHtmlTokens.h:68
@ Html_TITLE
Definition: TGHtmlTokens.h:180
@ Html_SCRIPT
Definition: TGHtmlTokens.h:158
@ Html_LI
Definition: TGHtmlTokens.h:122
@ Html_EndBLOCKQUOTE
Definition: TGHtmlTokens.h:62
@ Html_EndSELECT
Definition: TGHtmlTokens.h:160
@ Html_EndSTRIKE
Definition: TGHtmlTokens.h:164
@ Html_EndSUB
Definition: TGHtmlTokens.h:169
@ Html_EndNOEMBED
Definition: TGHtmlTokens.h:138
@ Html_CAPTION
Definition: TGHtmlTokens.h:66
@ Html_EndLISTING
Definition: TGHtmlTokens.h:126
@ Html_AREA
Definition: TGHtmlTokens.h:52
@ Html_S
Definition: TGHtmlTokens.h:154
@ Html_EndDFN
Definition: TGHtmlTokens.h:79
@ Html_EndADDRESS
Definition: TGHtmlTokens.h:49
@ Html_UL
Definition: TGHtmlTokens.h:188
@ Html_LISTING
Definition: TGHtmlTokens.h:125
@ Html_TABLE
Definition: TGHtmlTokens.h:172
@ Html_EndUL
Definition: TGHtmlTokens.h:189
@ Html_EndOL
Definition: TGHtmlTokens.h:144
@ Html_NOFRAMES
Definition: TGHtmlTokens.h:139
@ Html_PLAINTEXT
Definition: TGHtmlTokens.h:151
@ Html_EndS
Definition: TGHtmlTokens.h:155
@ Html_EndDIR
Definition: TGHtmlTokens.h:81
@ Html_OPTION
Definition: TGHtmlTokens.h:145
@ Html_EndI
Definition: TGHtmlTokens.h:115
@ Html_H2
Definition: TGHtmlTokens.h:101
@ Html_EndSTRONG
Definition: TGHtmlTokens.h:166
@ Html_EndNOBR
Definition: TGHtmlTokens.h:136
@ Html_APPLET
Definition: TGHtmlTokens.h:50
@ Html_EndSUP
Definition: TGHtmlTokens.h:171
@ Html_EndNOFRAMES
Definition: TGHtmlTokens.h:140
@ Html_TH
Definition: TGHtmlTokens.h:178
@ Html_EndFORM
Definition: TGHtmlTokens.h:94
@ Html_EndFONT
Definition: TGHtmlTokens.h:92
@ Html_EndTD
Definition: TGHtmlTokens.h:175
@ Html_MENU
Definition: TGHtmlTokens.h:131
@ Html_CODE
Definition: TGHtmlTokens.h:72
@ Html_TR
Definition: TGHtmlTokens.h:182
@ Html_H6
Definition: TGHtmlTokens.h:109
@ Html_ADDRESS
Definition: TGHtmlTokens.h:48
@ Html_DIV
Definition: TGHtmlTokens.h:82
@ Html_EndB
Definition: TGHtmlTokens.h:54
@ Html_Space
Definition: TGHtmlTokens.h:43
@ Html_EndVAR
Definition: TGHtmlTokens.h:191
@ Html_EndDT
Definition: TGHtmlTokens.h:87
@ Html_EndH3
Definition: TGHtmlTokens.h:104
@ Html_SAMP
Definition: TGHtmlTokens.h:156
@ Html_SELECT
Definition: TGHtmlTokens.h:159
@ Html_H5
Definition: TGHtmlTokens.h:107
@ Html_Text
Definition: TGHtmlTokens.h:42
@ Html_H1
Definition: TGHtmlTokens.h:99
@ Html_EndDIV
Definition: TGHtmlTokens.h:83
@ Html_VAR
Definition: TGHtmlTokens.h:190
@ Html_EndBASEFONT
Definition: TGHtmlTokens.h:57
@ Html_OL
Definition: TGHtmlTokens.h:143
@ Html_A
Definition: TGHtmlTokens.h:46
@ Html_P
Definition: TGHtmlTokens.h:147
@ Html_B
Definition: TGHtmlTokens.h:53
@ Html_IMG
Definition: TGHtmlTokens.h:117
@ Html_CITE
Definition: TGHtmlTokens.h:70
@ Html_EndAPPLET
Definition: TGHtmlTokens.h:51
@ Html_EndDL
Definition: TGHtmlTokens.h:85
@ Html_EndCAPTION
Definition: TGHtmlTokens.h:67
@ Html_BIG
Definition: TGHtmlTokens.h:59
@ Html_SUB
Definition: TGHtmlTokens.h:168
@ Html_EndKBD
Definition: TGHtmlTokens.h:121
@ Html_EndCODE
Definition: TGHtmlTokens.h:73
@ Html_NOSCRIPT
Definition: TGHtmlTokens.h:141
@ Html_EndCITE
Definition: TGHtmlTokens.h:71
@ Html_DIR
Definition: TGHtmlTokens.h:80
@ Html_EndSMALL
Definition: TGHtmlTokens.h:162
@ Html_H4
Definition: TGHtmlTokens.h:105
@ Html_EndH1
Definition: TGHtmlTokens.h:100
@ Html_EndH2
Definition: TGHtmlTokens.h:102
@ Html_EndH5
Definition: TGHtmlTokens.h:108
@ Html_STRONG
Definition: TGHtmlTokens.h:165
@ Html_BASE
Definition: TGHtmlTokens.h:55
@ Html_FONT
Definition: TGHtmlTokens.h:91
@ Html_DD
Definition: TGHtmlTokens.h:76
@ Html_EndBIG
Definition: TGHtmlTokens.h:60
@ Html_EndXMP
Definition: TGHtmlTokens.h:194
@ Html_EndDD
Definition: TGHtmlTokens.h:77
@ Html_EndP
Definition: TGHtmlTokens.h:148
@ Html_EndH6
Definition: TGHtmlTokens.h:110
@ Html_EndA
Definition: TGHtmlTokens.h:47
@ Html_EndPRE
Definition: TGHtmlTokens.h:153
@ Html_EndTITLE
Definition: TGHtmlTokens.h:181
@ Html_PRE
Definition: TGHtmlTokens.h:152
@ Html_TT
Definition: TGHtmlTokens.h:184
@ Html_INPUT
Definition: TGHtmlTokens.h:118
@ Html_EndMAP
Definition: TGHtmlTokens.h:128
@ Html_EndMARQUEE
Definition: TGHtmlTokens.h:130
@ Html_EndCOMMENT
Definition: TGHtmlTokens.h:75
@ Html_EndSAMP
Definition: TGHtmlTokens.h:157
@ Html_MAP
Definition: TGHtmlTokens.h:127
@ Html_SMALL
Definition: TGHtmlTokens.h:161
@ Html_EndCENTER
Definition: TGHtmlTokens.h:69
@ Html_EndU
Definition: TGHtmlTokens.h:187
@ Html_BASEFONT
Definition: TGHtmlTokens.h:56
@ Html_EndTR
Definition: TGHtmlTokens.h:183
@ Html_EndEM
Definition: TGHtmlTokens.h:89
#define STYLER_RUNNING
Definition: TGHtml.h:1329
#define HTML_MAP_CIRCLE
Definition: TGHtml.h:464
#define LI_TYPE_Bullet2
Definition: TGHtml.h:439
#define COLOR_Unvisited
Definition: TGHtml.h:197
#define HTML_Visible
Definition: TGHtml.h:274
unsigned char Html_u8_t
Definition: TGHtml.h:135
#define ALIGN_Left
Definition: TGHtml.h:208
#define STY_Invisible
Definition: TGHtml.h:239
#define HTML_MAP_RECT
Definition: TGHtml.h:463
#define LI_TYPE_Bullet1
Definition: TGHtml.h:438
#define LI_TYPE_Enum_1
Definition: TGHtml.h:441
#define CWFont(X)
Definition: TGHtml.h:169
#define HTML_MAP_POLY
Definition: TGHtml.h:465
#define STY_NoBreak
Definition: TGHtml.h:236
#define CANT_HAPPEN
Definition: TGHtml.h:59
#define COLOR_Background
Definition: TGHtml.h:200
#define ItalicFont(X)
Definition: TGHtml.h:168
#define STY_DT
Definition: TGHtml.h:238
#define BoldFont(X)
Definition: TGHtml.h:167
#define STY_Anchor
Definition: TGHtml.h:237
#define ALIGN_Center
Definition: TGHtml.h:210
#define STY_StrikeThru
Definition: TGHtml.h:234
#define N_FONT_SIZE
Definition: TGHtml.h:164
#define STY_Underline
Definition: TGHtml.h:235
#define STY_Preformatted
Definition: TGHtml.h:233
#define FontFamily(X)
Definition: TGHtml.h:171
#define HtmlTrace_Style
Definition: TGHtml.h:95
#define LI_TYPE_Bullet3
Definition: TGHtml.h:440
#define FontSize(X)
Definition: TGHtml.h:170
#define COLOR_Normal
Definition: TGHtml.h:196
#define TRACE(Flag, Args)
Definition: TGHtml.h:120
#define NormalFont(X)
Definition: TGHtml.h:166
#define ALIGN_None
Definition: TGHtml.h:211
#define COLOR_Visited
Definition: TGHtml.h:198
int type
Definition: TGX11.cxx:120
char * StrDup(const char *str)
Duplicate the string str.
Definition: TString.cxx:2465
#define gVirtualX
Definition: TVirtualX.h:345
#define snprintf
Definition: civetweb.c:1540
Definition: TGFont.h:149
void GetFontMetrics(FontMetrics_t *m) const
Get font metrics.
Definition: TGFont.cxx:274
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
GContext_t GetGC() const
Definition: TGGC.h:50
TImage * fBgImage
Definition: TGHtml.h:395
Html_16_t fColspan
Definition: TGHtml.h:387
Html_16_t fRowspan
Definition: TGHtml.h:386
Html_u8_t fFlags
Definition: TGHtml.h:265
Html_u8_t fType
Definition: TGHtml.h:264
SHtmlStyle_t fStyle
Definition: TGHtml.h:263
virtual const char * MarkupArg(const char *, const char *)
Definition: TGHtml.h:254
TGHtmlElement * fPPrev
Definition: TGHtml.h:262
Html_16_t fCount
Definition: TGHtml.h:266
virtual int GetAlignment(int dflt)
Definition: TGHtml.h:255
TGHtmlElement * fPNext
Definition: TGHtml.h:261
TGHtmlElement * fPEnd
Definition: TGHtml.h:642
Html_u16_t fFormId
Definition: TGHtml.h:638
TGHtmlImage * fPImage
Definition: TGHtml.h:551
TGHtmlImageMarkup * fINext
Definition: TGHtml.h:553
Html_16_t fAscent
Definition: TGHtml.h:546
Html_u8_t fRedrawNeeded
Definition: TGHtml.h:542
Html_16_t fW
Definition: TGHtml.h:545
Html_u8_t fTextAscent
Definition: TGHtml.h:540
TGHtmlElement * fPMap
Definition: TGHtml.h:552
Html_16_t fDescent
Definition: TGHtml.h:547
Html_16_t fH
Definition: TGHtml.h:544
Html_u8_t fAlign
Definition: TGHtml.h:539
Html_u8_t fTextDescent
Definition: TGHtml.h:541
const char * fZAlt
Definition: TGHtml.h:550
TImage * fImage
Definition: TGHtml.h:518
TGHtmlImageMarkup * fPList
Definition: TGHtml.h:524
Html_u8_t fTextAscent
Definition: TGHtml.h:600
Html_u8_t fTextDescent
Definition: TGHtml.h:601
Html_u8_t fDescent
Definition: TGHtml.h:425
Html_u8_t fAscent
Definition: TGHtml.h:424
Html_16_t fCnt
Definition: TGHtml.h:426
Html_u8_t fLtype
Definition: TGHtml.h:423
TGHtmlListStart * fLPrev
Definition: TGHtml.h:459
Html_u8_t fLtype
Definition: TGHtml.h:455
Html_u16_t fCnt
Definition: TGHtml.h:457
Html_u8_t fCompact
Definition: TGHtml.h:456
int fMType
Definition: TGHtml.h:472
int * fCoords
Definition: TGHtml.h:473
virtual int GetAlignment(int dflt)
Return an alignment or justification flag associated with the given markup.
virtual const char * MarkupArg(const char *tag, const char *zDefault)
Lookup an argument in the given markup with the name given.
virtual int GetOrderedListType(int dflt)
The "type" argument to the given element might describe the type for an ordered list.
virtual int GetUnorderedListType(int dflt)
The "type" argument to the given element might describe a type for an unordered list.
TImage * fBgImage
Definition: TGHtml.h:411
TGHtmlElement * fPOther
Definition: TGHtml.h:410
Html_u8_t fDescent
Definition: TGHtml.h:310
Html_u8_t fAscent
Definition: TGHtml.h:309
Html_16_t fW
Definition: TGHtml.h:308
TGHtmlElement * GetMap(const char *name)
Returns html map element.
Definition: TGHtml.cxx:1534
int fParaAlignment
Definition: TGHtml.h:1189
virtual int FormCreate(TGHtmlForm *, const char *, const char *)
Definition: TGHtml.h:945
const char * fZBase
Definition: TGHtml.h:1259
int fUnderlineLinks
Definition: TGHtml.h:1242
void TokenizerAppend(const char *text)
Append text to the tokenizer engine.
TGHtmlElement * fPFirst
Definition: TGHtml.h:1128
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:957
virtual TGFont * GetFont(int iFont)
The rendering and layout routines should call this routine in order to get a font structure.
Definition: TGHtml.cxx:1406
int fAnchorFlags
Definition: TGHtml.h:1191
TGHtmlElement * fLastSized
Definition: TGHtml.h:1132
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:1570
int fFlags
Definition: TGHtml.h:1269
SHtmlStyleStack_t * fStyleStack
Definition: TGHtml.h:1188
TGHtmlListStart * fInnerList
Definition: TGHtml.h:1199
int fOverrideColors
Definition: TGHtml.h:1241
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:260
int GetImageAlignment(TGHtmlElement *p)
Find the alignment for an image.
Definition: TGHtmlImage.cxx:84
int fRowAlignment
Definition: TGHtml.h:1190
int fInTr
Definition: TGHtml.h:1193
int GetLinkColor(const char *zURL)
For the markup , find out if the URL has been visited before or not.
TGHtmlAnchor * fAnchorStart
Definition: TGHtml.h:1195
void Sizer()
Compute the size of all elements in the widget.
TGHtmlElement * fPLast
Definition: TGHtml.h:1129
SHtmlStyle_t PopStyleStack(int tag)
Pop a rendering style off of the stack.
Definition: TGHtmlSizer.cxx:85
int fInTd
Definition: TGHtml.h:1194
virtual int IsVisited(const char *)
Definition: TGHtml.h:923
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
void PushStyleStack(int tag, SHtmlStyle_t style)
Push a new rendering style onto the stack.
Definition: TGHtmlSizer.cxx:64
int fOverrideFonts
Definition: TGHtml.h:1240
TImage * fBgImage
Definition: TGHtml.h:1237
int ControlSize(TGHtmlInput *p)
This routine implements the Sizer() function for <INPUT>, <SELECT> and <TEXTAREA> markup.
Definition: TGHtmlForm.cxx:357
int fInDt
Definition: TGHtml.h:1192
char * DumpToken(TGHtmlElement *p)
For debugging purposes, print information about a token.
SHtmlStyle_t GetCurrentStyle()
Get the current rendering style.
Definition: TGHtmlSizer.cxx:39
TGHtmlImage * GetImage(TGHtmlImageMarkup *p)
Given an.
TGHtmlInput * fFormElemStart
Definition: TGHtml.h:1197
ColorStruct_t * fApColor[N_COLOR]
Definition: TGHtml.h:1223
TGHtmlForm * fFormStart
Definition: TGHtml.h:1196
char * fZBaseHref
Definition: TGHtml.h:1260
const char * GetString() const
Definition: TGString.h:40
virtual void SetBackgroundColor(Pixel_t)
Set background color of the canvas frame.
Definition: TGView.cxx:580
TGViewFrame * fCanvas
Definition: TGView.h:62
TGGC fWhiteGC
Definition: TGView.h:66
virtual void SetBackgroundPixmap(Pixmap_t p)
Set backgound pixmap.
Definition: TGView.cxx:590
virtual void SetBackgroundPixmap(Pixmap_t pixmap)
Definition: TGWindow.h:102
An abstract interface to image processing library.
Definition: TImage.h:29
virtual UInt_t GetWidth() const
Definition: TImage.h:228
virtual Pixmap_t GetPixmap()
Definition: TImage.h:235
virtual UInt_t GetHeight() const
Definition: TImage.h:229
TString & Append(const char *cs)
Definition: TString.h:559
TText * text
const Int_t n
Definition: legend1.C:16
Int_t fAscent
Definition: TGFont.h:62
Int_t fDescent
Definition: TGFont.h:63
Pixmap_t fTile
Definition: GuiTypes.h:237
Bool_t fGraphicsExposures
Definition: GuiTypes.h:243
Int_t fFillStyle
Definition: GuiTypes.h:233
SHtmlStyle_t fStyle
Definition: TGHtml.h:735
SHtmlStyleStack_t * fPNext
Definition: TGHtml.h:733
unsigned int fColor
Definition: TGHtml.h:145
unsigned int fAlign
Definition: TGHtml.h:147
unsigned int fBgcolor
Definition: TGHtml.h:148
unsigned int fFont
Definition: TGHtml.h:144
unsigned int fFlags
Definition: TGHtml.h:150
TCanvas * style()
Definition: style.C:1
void table()
Definition: table.C:85