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