Logo ROOT  
Reference Guide
TGHtml.h
Go to the documentation of this file.
1 // $Id: TGHtml.h,v 1.1 2007/05/04 17:07:01 brun Exp $
2 // Author: Valeriy Onuchin 03/05/2007
3 
4 /*************************************************************************
5  * Copyright (C) 1995-2001, Rene Brun, Fons Rademakers and Reiner Rohlfs *
6  * All rights reserved. *
7  * *
8  * For the licensing terms see $ROOTSYS/LICENSE. *
9  * For the list of contributors see $ROOTSYS/README/CREDITS. *
10  *************************************************************************/
11 
12 /**************************************************************************
13 
14  HTML widget for xclass. Based on tkhtml 1.28
15  Copyright (C) 1997-2000 D. Richard Hipp <drh@acm.org>
16  Copyright (C) 2002-2003 Hector Peraza.
17 
18  This library is free software; you can redistribute it and/or
19  modify it under the terms of the GNU Library General Public
20  License as published by the Free Software Foundation; either
21  version 2 of the License, or (at your option) any later version.
22 
23  This library is distributed in the hope that it will be useful,
24  but WITHOUT ANY WARRANTY; without even the implied warranty of
25  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
26  Library General Public License for more details.
27 
28  You should have received a copy of the GNU Library General Public
29  License along with this library; if not, write to the Free
30  Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
31 
32 **************************************************************************/
33 
34 #ifndef ROOT_TGHtml
35 #define ROOT_TGHtml
36 
37 #include "TGView.h"
38 
39 #include "TGHtmlTokens.h"
40 
41 class TGClient;
42 class TImage;
43 class TGFont;
44 class TGIdleHandler;
45 class THashTable;
46 class TTimer;
47 
48 //----------------------------------------------------------------------
49 
50 #define HTML_RELIEF_FLAT 0
51 #define HTML_RELIEF_SUNKEN 1
52 #define HTML_RELIEF_RAISED 2
53 
54 //#define TABLE_TRIM_BLANK 1
55 
56 // Debug must be turned on for testing to work.
57 //#define DEBUG
58 
59 #define CANT_HAPPEN \
60  fprintf(stderr, \
61  "Unplanned behavior in the HTML Widget in file %s line %d\n", \
62  __FILE__, __LINE__)
63 
64 #define UNTESTED \
65  fprintf(stderr, \
66  "Untested code executed in the HTML Widget in file %s line %d\n", \
67  __FILE__, __LINE__)
68 
69 // Sanity checking macros.
70 
71 #ifdef DEBUG
72 #define HtmlAssert(X) \
73  if(!(X)){ \
74  fprintf(stderr,"Assertion failed on line %d of %s\n",__LINE__,__FILE__); \
75  }
76 #define HtmlCantHappen \
77  fprintf(stderr,"Can't happen on line %d of %s\n",__LINE__,__FILE__);
78 #else
79 #define HtmlAssert(X)
80 #define HtmlCantHappen
81 #endif
82 
83 // Bitmasks for the HtmlTraceMask global variable
84 
85 #define HtmlTrace_Table1 0x00000001
86 #define HtmlTrace_Table2 0x00000002
87 #define HtmlTrace_Table3 0x00000004
88 #define HtmlTrace_Table4 0x00000008
89 #define HtmlTrace_Table5 0x00000010
90 #define HtmlTrace_Table6 0x00000020
91 #define HtmlTrace_GetLine 0x00000100
92 #define HtmlTrace_GetLine2 0x00000200
93 #define HtmlTrace_FixLine 0x00000400
94 #define HtmlTrace_BreakMarkup 0x00001000
95 #define HtmlTrace_Style 0x00002000
96 #define HtmlTrace_Input1 0x00004000
97 
98 // The TRACE macro is used to print internal information about the
99 // HTML layout engine during testing and debugging. The amount of
100 // information printed is governed by a global variable named
101 // HtmlTraceMask. If bits in the first argument to the TRACE macro
102 // match any bits in HtmlTraceMask variable, then the trace message
103 // is printed.
104 //
105 // All of this is completely disabled, of course, if the DEBUG macro
106 // is not defined.
107 
108 #ifdef DEBUG
109 extern int HtmlTraceMask;
110 extern int HtmlDepth;
111 # define TRACE_INDENT printf("%*s",HtmlDepth-3,"")
112 # define TRACE(Flag, Args) \
113  if( (Flag)&HtmlTraceMask ){ \
114  TRACE_INDENT; printf Args; fflush(stdout); \
115  }
116 # define TRACE_PUSH(Flag) if( (Flag)&HtmlTraceMask ){ HtmlDepth+=3; }
117 # define TRACE_POP(Flag) if( (Flag)&HtmlTraceMask ){ HtmlDepth-=3; }
118 #else
119 # define TRACE_INDENT
120 # define TRACE(Flag, Args)
121 # define TRACE_PUSH(Flag)
122 # define TRACE_POP(Flag)
123 #endif
124 
125 
126 //----------------------------------------------------------------------
127 
128 // Various data types. This code is designed to run on a modern cached
129 // architecture where the CPU runs a lot faster than the memory bus. Hence
130 // we try to pack as much data into as small a space as possible so that it
131 // is more likely to fit in cache. The extra CPU instruction or two needed
132 // to unpack the data is not normally an issue since we expect the speed of
133 // the memory bus to be the limiting factor.
134 
135 typedef unsigned char Html_u8_t; // 8-bit unsigned integer
136 typedef short Html_16_t; // 16-bit signed integer
137 typedef unsigned short Html_u16_t; // 16-bit unsigned integer
138 typedef int Html_32_t; // 32-bit signed integer
139 
140 // An instance of the following structure is used to record style
141 // information on each Html element.
142 
143 struct SHtmlStyle_t {
144  unsigned int fFont : 6; // Font to use for display
145  unsigned int fColor : 6; // Foreground color
146  signed int fSubscript : 4; // Positive for <sup>, negative for <sub>
147  unsigned int fAlign : 2; // Horizontal alignment
148  unsigned int fBgcolor : 6; // Background color
149  unsigned int fExpbg : 1; // Set to 1 if bgcolor explicitly set
150  unsigned int fFlags : 7; // the STY_ flags below
151 };
152 
153 
154 // We allow 8 different font families: Normal, Bold, Italic and Bold-Italic
155 // in either variable or constant width. Within each family there can be up
156 // to 7 font sizes from 1 (the smallest) up to 7 (the largest). Hence, the
157 // widget can use a maximum of 56 fonts. The ".font" field of the style is
158 // an integer between 0 and 55 which indicates which font to use.
159 
160 // HP: we further subdivide the .font field into two 3-bit subfields (size
161 // and family). That makes easier to manipulate the family field.
162 
163 #define N_FONT_FAMILY 8
164 #define N_FONT_SIZE 7
165 #define N_FONT 71
166 #define NormalFont(X) (X)
167 #define BoldFont(X) ((X) | 8)
168 #define ItalicFont(X) ((X) | 16)
169 #define CWFont(X) ((X) | 32)
170 #define FontSize(X) ((X) & 007)
171 #define FontFamily(X) ((X) & 070)
172 #define FONT_Any -1
173 #define FONT_Default 3
174 #define FontSwitch(Size, Bold, Italic, Cw) \
175  ((Size) | ((Bold+(Italic)*2+(Cw)*4) << 3))
176 
177 // Macros for manipulating the fontValid bitmap of an TGHtml object.
178 
179 #define FontIsValid(I) ((fFontValid[(I)>>3] & (1<<((I)&3)))!=0)
180 #define FontSetValid(I) (fFontValid[(I)>>3] |= (1<<((I)&3)))
181 #define FontClearValid(I) (fFontValid[(I)>>3] &= ~(1<<((I)&3)))
182 
183 
184 // Information about available colors.
185 //
186 // The widget will use at most N_COLOR colors. 4 of these colors are
187 // predefined. The rest are user selectable by options to various markups.
188 // (Ex: <font color=red>)
189 //
190 // All colors are stored in the apColor[] array of the main widget object.
191 // The ".color" field of the SHtmlStyle_t is an integer between 0 and
192 // N_COLOR-1 which indicates which of these colors to use.
193 
194 #define N_COLOR 32 // Total number of colors
195 
196 #define COLOR_Normal 0 // Index for normal color (black)
197 #define COLOR_Unvisited 1 // Index for unvisited hyperlinks
198 #define COLOR_Visited 2 // Color for visited hyperlinks
199 #define COLOR_Selection 3 // Background color for the selection
200 #define COLOR_Background 4 // Default background color
201 #define N_PREDEFINED_COLOR 5 // Number of predefined colors
202 
203 
204 // The "align" field of the style determines how text is justified
205 // horizontally. ALIGN_None means that the alignment is not specified.
206 // (It should probably default to ALIGN_Left in this case.)
207 
208 #define ALIGN_Left 1
209 #define ALIGN_Right 2
210 #define ALIGN_Center 3
211 #define ALIGN_None 0
212 
213 
214 // Possible value of the "flags" field of SHtmlStyle_t are shown below.
215 //
216 // STY_Preformatted If set, the current text occurred within
217 // <pre>..</pre>
218 //
219 // STY_StrikeThru Draw a solid line thru the middle of this text.
220 //
221 // STY_Underline This text should drawn with an underline.
222 //
223 // STY_NoBreak This text occurs within <nobr>..</nobr>
224 //
225 // STY_Anchor This text occurs within <a href=X>..</a>.
226 //
227 // STY_DT This text occurs within <dt>..</dt>.
228 //
229 // STY_Invisible This text should not appear in the main HTML
230 // window. (For example, it might be within
231 // <title>..</title> or <marquee>..</marquee>.)
232 
233 #define STY_Preformatted 0x001
234 #define STY_StrikeThru 0x002
235 #define STY_Underline 0x004
236 #define STY_NoBreak 0x008
237 #define STY_Anchor 0x010
238 #define STY_DT 0x020
239 #define STY_Invisible 0x040
240 #define STY_FontMask (STY_StrikeThru|STY_Underline)
241 
242 
243 //----------------------------------------------------------------------
244 // The first thing done with input HTML text is to parse it into
245 // TGHtmlElements. All sizing and layout is done using these elements.
246 
247 // Every element contains at least this much information:
248 
249 class TGHtmlElement : public TObject {
250 public:
251  TGHtmlElement(int etype = 0);
252 
253  virtual int IsMarkup() const { return (fType > Html_Block); }
254  virtual const char *MarkupArg(const char * /*tag*/, const char * /*zDefault*/) { return 0; }
255  virtual int GetAlignment(int dflt) { return dflt; }
256  virtual int GetOrderedListType(int dflt) { return dflt; }
257  virtual int GetUnorderedListType(int dflt) { return dflt; }
258  virtual int GetVerticalAlignment(int dflt) { return dflt; }
259 
260 public:
261  TGHtmlElement *fPNext; // Next input token in a list of them all
262  TGHtmlElement *fPPrev; // Previous token in a list of them all
263  SHtmlStyle_t fStyle; // The rendering style for this token
264  Html_u8_t fType; // The token type.
265  Html_u8_t fFlags; // The HTML_ flags below
266  Html_16_t fCount; // Various uses, depending on "type"
267  int fElId; // Unique identifier
268  int fOffs; // Offset within zText
269 };
270 
271 
272 // Bitmasks for the "flags" field of the TGHtmlElement
273 
274 #define HTML_Visible 0x01 // This element produces "ink"
275 #define HTML_NewLine 0x02 // type == Html_Space and ends with newline
276 #define HTML_Selected 0x04 // Some or all of this Html_Block is selected
277  // Used by Html_Block elements only.
278 
279 
280 // Each text element holds additional information as shown here. Notice that
281 // extra space is allocated so that zText[] will be large enough to hold the
282 // complete text of the element. X and y coordinates are relative to the
283 // virtual canvas. The y coordinate refers to the baseline.
284 
286 private:
287  TGHtmlTextElement(const TGHtmlTextElement&); // Not implemented.
288  TGHtmlTextElement &operator=(const TGHtmlTextElement&); // Not implemented.
289 
290 public:
291  TGHtmlTextElement(int size);
292  virtual ~TGHtmlTextElement();
293 
294  Html_32_t fY; // y coordinate where text should be rendered
295  Html_16_t fX; // x coordinate where text should be rendered
296  Html_16_t fW; // width of this token in pixels
297  Html_u8_t fAscent; // height above the baseline
298  Html_u8_t fDescent; // depth below the baseline
299  Html_u8_t fSpaceWidth; // Width of one space in the current font
300  char *fZText; // Text for this element. Null terminated
301 };
302 
303 
304 // Each space element is represented like this:
305 
307 public:
308  Html_16_t fW; // Width of a single space in current font
309  Html_u8_t fAscent; // height above the baseline
310  Html_u8_t fDescent; // depth below the baseline
311 
312 public:
314 };
315 
316 // Most markup uses this class. Some markup extends this class with
317 // additional information, but most use it as is, at the very least.
318 //
319 // If the markup doesn't have arguments (the "count" field of
320 // TGHtmlElement is 0) then the extra "argv" field of this class
321 // is not allocated and should not be used.
322 
324 public:
325  TGHtmlMarkupElement(int type, int argc, int arglen[], char *argv[]);
326  virtual ~TGHtmlMarkupElement();
327 
328  virtual const char *MarkupArg(const char *tag, const char *zDefault);
329  virtual int GetAlignment(int dflt);
330  virtual int GetOrderedListType(int dflt);
331  virtual int GetUnorderedListType(int dflt);
332  virtual int GetVerticalAlignment(int dflt);
333 
334 public://protected:
335  char **fArgv;
336 };
337 
338 
339 // The maximum number of columns allowed in a table. Any columns beyond
340 // this number are ignored.
341 
342 #define HTML_MAX_COLUMNS 40
343 
344 
345 // This class is used for each <table> element.
346 //
347 // In the minW[] and maxW[] arrays, the [0] element is the overall
348 // minimum and maximum width, including cell padding, spacing and
349 // the "hspace". All other elements are the minimum and maximum
350 // width for the contents of individual cells without any spacing or
351 // padding.
352 
354 public:
355  TGHtmlTable(int type, int argc, int arglen[], char *argv[]);
356  ~TGHtmlTable();
357 
358 public:
359  Html_u8_t fBorderWidth; // Width of the border
360  Html_u8_t fNCol; // Number of columns
361  Html_u16_t fNRow; // Number of rows
362  Html_32_t fY; // top edge of table border
363  Html_32_t fH; // height of the table border
364  Html_16_t fX; // left edge of table border
365  Html_16_t fW; // width of the table border
366  int fMinW[HTML_MAX_COLUMNS+1]; // minimum width of each column
367  int fMaxW[HTML_MAX_COLUMNS+1]; // maximum width of each column
368  TGHtmlElement *fPEnd; // Pointer to the end tag element
369  TImage *fBgImage; // A background for the entire table
370  int fHasbg; // 1 if a table above has bgImage
371 };
372 
373 
374 // Each <td> or <th> markup is represented by an instance of the
375 // following class.
376 //
377 // Drawing for a cell is a sunken 3D border with the border width given
378 // by the borderWidth field in the associated <table> object.
379 
381 public:
382  TGHtmlCell(int type, int argc, int arglen[], char *argv[]);
383  ~TGHtmlCell();
384 
385 public:
386  Html_16_t fRowspan; // Number of rows spanned by this cell
387  Html_16_t fColspan; // Number of columns spanned by this cell
388  Html_16_t fX; // X coordinate of left edge of border
389  Html_16_t fW; // Width of the border
390  Html_32_t fY; // Y coordinate of top of border indentation
391  Html_32_t fH; // Height of the border
392  TGHtmlTable *fPTable; // Pointer back to the <table>
393  TGHtmlElement *fPRow; // Pointer back to the <tr>
394  TGHtmlElement *fPEnd; // Element that ends this cell
395  TImage *fBgImage; // Background for the cell
396 };
397 
398 
399 // This class is used for </table>, </td>, <tr>, </tr> and </th> elements.
400 // It points back to the <table> element that began the table. It is also
401 // used by </a> to point back to the original <a>. I'll probably think of
402 // other uses before all is said and done...
403 
405 public:
406  TGHtmlRef(int type, int argc, int arglen[], char *argv[]);
407  ~TGHtmlRef();
408 
409 public:
410  TGHtmlElement *fPOther; // Pointer to some other Html element
411  TImage *fBgImage; // A background for the entire row
412 };
413 
414 
415 // An instance of the following class is used to represent
416 // each <LI> markup.
417 
419 public:
420  TGHtmlLi(int type, int argc, int arglen[], char *argv[]);
421 
422 public:
423  Html_u8_t fLtype; // What type of list is this?
424  Html_u8_t fAscent; // height above the baseline
425  Html_u8_t fDescent; // depth below the baseline
426  Html_16_t fCnt; // Value for this element (if inside <OL>)
427  Html_16_t fX; // X coordinate of the bullet
428  Html_32_t fY; // Y coordinate of the bullet
429 };
430 
431 
432 // The ltype field of an TGHtmlLi or TGHtmlListStart object can take on
433 // any of the following values to indicate what type of bullet to draw.
434 // The value in TGHtmlLi will take precedence over the value in
435 // TGHtmlListStart if the two values differ.
436 
437 #define LI_TYPE_Undefined 0 // If in TGHtmlLi, use the TGHtmlListStart value
438 #define LI_TYPE_Bullet1 1 // A solid circle
439 #define LI_TYPE_Bullet2 2 // A hollow circle
440 #define LI_TYPE_Bullet3 3 // A hollow square
441 #define LI_TYPE_Enum_1 4 // Arabic numbers
442 #define LI_TYPE_Enum_A 5 // A, B, C, ...
443 #define LI_TYPE_Enum_a 6 // a, b, c, ...
444 #define LI_TYPE_Enum_I 7 // Capitalized roman numerals
445 #define LI_TYPE_Enum_i 8 // Lower-case roman numerals
446 
447 
448 // An instance of this class is used for <UL> or <OL> markup.
449 
451 public:
452  TGHtmlListStart(int type, int argc, int arglen[], char *argv[]);
453 
454 public:
455  Html_u8_t fLtype; // One of the LI_TYPE_ defines above
456  Html_u8_t fCompact; // True if the COMPACT flag is present
457  Html_u16_t fCnt; // Next value for <OL>
458  Html_u16_t fWidth; // How much space to allow for indentation
459  TGHtmlListStart *fLPrev; // Next higher level list, or NULL
460 };
461 
462 
463 #define HTML_MAP_RECT 1
464 #define HTML_MAP_CIRCLE 2
465 #define HTML_MAP_POLY 3
466 
468 public:
469  TGHtmlMapArea(int type, int argc, int arglen[], char *argv[]);
470 
471 public:
472  int fMType;
473  int *fCoords;
474  int fNum;
475 };
476 
477 
478 //----------------------------------------------------------------------
479 
480 // Structure to chain extension data onto.
481 
483  void *fExts;
484  int fTyp;
485  int fFlags;
487 };
488 
489 
490 //----------------------------------------------------------------------
491 
492 // Information about each image on the HTML widget is held in an instance
493 // of the following class. All images are held on a list attached to the
494 // main widget object.
495 //
496 // This class is NOT an element. The <IMG> element is represented by an
497 // TGHtmlImageMarkup object below. There is one TGHtmlImageMarkup for each
498 // <IMG> in the source HTML. There is one of these objects for each unique
499 // image loaded. (If two <IMG> specify the same image, there are still two
500 // TGHtmlImageMarkup objects but only one TGHtmlImage object that is shared
501 // between them.)
502 
503 class TGHtml;
504 class TGHtmlImageMarkup;
505 
506 class TGHtmlImage : public TObject {
507 private:
508  TGHtmlImage(const TGHtmlImage&); // Not implemented.
509  TGHtmlImage &operator=(const TGHtmlImage&); // Not implemented.
510 
511 public:
512  TGHtmlImage(TGHtml *htm, const char *url, const char *width,
513  const char *height);
514  virtual ~TGHtmlImage();
515 
516 public:
517  TGHtml *fHtml; // The owner of this image
518  TImage *fImage; // The image token
519  Html_32_t fW; // Requested width of this image (0 if none)
520  Html_32_t fH; // Requested height of this image (0 if none)
521  char *fZUrl; // The URL for this image.
522  char *fZWidth, *fZHeight; // Width and height in the <img> markup.
523  TGHtmlImage *fPNext; // Next image on the list
524  TGHtmlImageMarkup *fPList; // List of all <IMG> markups that use this
525  // same image
526  TTimer *fTimer; // for animations
527 };
528 
529 // Each <img> markup is represented by an instance of the following
530 // class.
531 //
532 // If pImage == 0, then we use the alternative text in zAlt.
533 
535 public:
536  TGHtmlImageMarkup(int type, int argc, int arglen[], char *argv[]);
537 
538 public:
539  Html_u8_t fAlign; // Alignment. See IMAGE_ALIGN_ defines below
540  Html_u8_t fTextAscent; // Ascent of text font in force at the <IMG>
541  Html_u8_t fTextDescent; // Descent of text font in force at the <IMG>
542  Html_u8_t fRedrawNeeded; // Need to redraw this image because the image
543  // content changed.
544  Html_16_t fH; // Actual height of the image
545  Html_16_t fW; // Actual width of the image
546  Html_16_t fAscent; // How far image extends above "y"
547  Html_16_t fDescent; // How far image extends below "y"
548  Html_16_t fX; // X coordinate of left edge of the image
549  Html_32_t fY; // Y coordinate of image baseline
550  const char *fZAlt; // Alternative text
551  TGHtmlImage *fPImage; // Corresponding TGHtmlImage object
552  TGHtmlElement *fPMap; // usemap
553  TGHtmlImageMarkup *fINext; // Next markup using the same TGHtmlImage object
554 };
555 
556 
557 // Allowed alignments for images. These represent the allowed arguments
558 // to the "align=" field of the <IMG> markup.
559 
560 #define IMAGE_ALIGN_Bottom 0
561 #define IMAGE_ALIGN_Middle 1
562 #define IMAGE_ALIGN_Top 2
563 #define IMAGE_ALIGN_TextTop 3
564 #define IMAGE_ALIGN_AbsMiddle 4
565 #define IMAGE_ALIGN_AbsBottom 5
566 #define IMAGE_ALIGN_Left 6
567 #define IMAGE_ALIGN_Right 7
568 
569 
570 // All kinds of form markup, including <INPUT>, <TEXTAREA> and <SELECT>
571 // are represented by instances of the following class.
572 //
573 // (later...) We also use this for the <APPLET> markup. That way,
574 // the window we create for an <APPLET> responds to the TGHtml::MapControls()
575 // and TGHtml::UnmapControls() function calls. For an <APPLET>, the
576 // pForm field is NULL. (Later still...) <EMBED> works just like
577 // <APPLET> so it uses this class too.
578 
579 class TGHtmlForm;
580 
582 public:
583  TGHtmlInput(int type, int argc, int arglen[], char *argv[]);
584 
585  void Empty();
586 
587 public:
588  TGHtmlForm *fPForm; // The <FORM> to which this belongs
589  TGHtmlInput *fINext; // Next element in a list of all input elements
590  TGFrame *fFrame; // The xclass window that implements this control
591  TGHtml *fHtml; // The HTML widget this control is attached to
592  TGHtmlElement *fPEnd; // End tag for <TEXTAREA>, etc.
593  Html_u16_t fInpId; // Unique id for this element
594  Html_u16_t fSubId; // For radio - an id, for select - option count
595  Html_32_t fY; // Baseline for this input element
596  Html_u16_t fX; // Left edge
597  Html_u16_t fW, fH; // Width and height of this control
598  Html_u8_t fPadLeft; // Extra padding on left side of the control
599  Html_u8_t fAlign; // One of the IMAGE_ALIGN_xxx types
600  Html_u8_t fTextAscent; // Ascent for the current font
601  Html_u8_t fTextDescent; // descent for the current font
602  Html_u8_t fItype; // What type of input is this?
603  Html_u8_t fSized; // True if this input has been sized already
604  Html_u16_t fCnt; // Used to derive widget name. 0 if no widget
605 };
606 
607 
608 // An input control can be one of the following types. See the
609 // comment about <APPLET> on the TGHtmlInput class insight into
610 // INPUT_TYPE_Applet.
611 
612 #define INPUT_TYPE_Unknown 0
613 #define INPUT_TYPE_Checkbox 1
614 #define INPUT_TYPE_File 2
615 #define INPUT_TYPE_Hidden 3
616 #define INPUT_TYPE_Image 4
617 #define INPUT_TYPE_Password 5
618 #define INPUT_TYPE_Radio 6
619 #define INPUT_TYPE_Reset 7
620 #define INPUT_TYPE_Select 8
621 #define INPUT_TYPE_Submit 9
622 #define INPUT_TYPE_Text 10
623 #define INPUT_TYPE_TextArea 11
624 #define INPUT_TYPE_Applet 12
625 #define INPUT_TYPE_Button 13
626 
627 
628 // There can be multiple <FORM> entries on a single HTML page.
629 // Each one must be given a unique number for identification purposes,
630 // and so we can generate unique state variable names for radiobuttons,
631 // checkbuttons, and entry boxes.
632 
634 public:
635  TGHtmlForm(int type, int argc, int arglen[], char *argv[]);
636 
637 public:
638  Html_u16_t fFormId; // Unique number assigned to this form
639  unsigned int fElements; // Number of elements
640  unsigned int fHasctl; // Has controls
641  TGHtmlElement *fPFirst; // First form element
642  TGHtmlElement *fPEnd; // Pointer to end tag element
643 };
644 
645 
646 // Information used by a <HR> markup
647 
649 public:
650  TGHtmlHr(int type, int argc, int arglen[], char *argv[]);
651 
652 public:
653  Html_32_t fY; // Baseline for this input element
654  Html_u16_t fX; // Left edge
655  Html_u16_t fW, fH; // Width and height of this control
656  Html_u8_t fIs3D; // Is it drawn 3D?
657 };
658 
659 
660 // Information used by a <A> markup
661 
663 public:
664  TGHtmlAnchor(int type, int argc, int arglen[], char *argv[]);
665 
666 public:
667  Html_32_t fY; // Top edge for this element
668 };
669 
670 
671 // Information about the <SCRIPT> markup. The parser treats <SCRIPT>
672 // specially. All text between <SCRIPT> and </SCRIPT> is captured and
673 // is indexed to by the nStart field of this class.
674 //
675 // The nStart field indexs to a spot in the zText field of the TGHtml object.
676 // The nScript field determines how long the script is.
677 
679 public:
680  TGHtmlScript(int type, int argc, int arglen[], char *argv[]);
681 
682 public:
683  int fNStart; // Start of the script (index into TGHtml::zText)
684  int fNScript; // Number of characters of text in zText holding
685  // the complete text of this script
686 };
687 
688 
689 // A block is a single unit of display information. This can be one or more
690 // text elements, or the border of table, or an image, etc.
691 //
692 // Blocks are used to improve display speed and to improve the speed of
693 // linear searchs through the token list. A single block will typically
694 // contain enough information to display a dozen or more Text and Space
695 // elements all with a single call to OXFont::DrawChars(). The blocks are
696 // linked together on their own list, so we can search them much faster than
697 // elements (since there are fewer of them.)
698 //
699 // Of course, you can construct pathological HTML that has as many Blocks as
700 // it has normal tokens. But you haven't lost anything. Using blocks just
701 // speeds things up in the common case.
702 //
703 // Much of the information needed for display is held in the original
704 // TGHtmlElement objects. "fPNext" points to the first object in the list
705 // which can be used to find the "style" "x" and "y".
706 //
707 // If n is zero, then "fPNext" might point to a special TGHtmlElement
708 // that defines some other kind of drawing, like <LI> or <IMG> or <INPUT>.
709 
710 class TGHtmlBlock : public TGHtmlElement {
711 public:
712  TGHtmlBlock();
713  virtual ~TGHtmlBlock();
714 
715 public:
716  char *fZ; // Space to hold text when n > 0
717  int fTop, fBottom; // Extremes of y coordinates
718  Html_u16_t fLeft, fRight; // Left and right boundry of this object
719  Html_u16_t fN; // Number of characters in z[]
720  TGHtmlBlock *fBPrev, *fBNext; // Linked list of all Blocks
721 };
722 
723 
724 // A stack of these structures is used to keep track of nested font and
725 // style changes. This allows us to easily revert to the previous style
726 // when we encounter and end-tag like </em> or </h3>.
727 //
728 // This stack is used to keep track of the current style while walking
729 // the list of elements. After all elements have been assigned a style,
730 // the information in this stack is no longer used.
731 
733  SHtmlStyleStack_t *fPNext; // Next style on the stack
734  int fType; // A markup that ends this style. Ex: Html_EndEM
735  SHtmlStyle_t fStyle; // The currently active style.
736 };
737 
738 
739 // A stack of the following structures is used to remember the
740 // left and right margins within a layout context.
741 
743  int fIndent; // Size of the current margin
744  int fBottom; // Y value at which this margin expires
745  int fTag; // Markup that will cancel this margin
746  SHtmlMargin_t *fPNext; // Previous margin
747 };
748 
749 
750 // How much space (in pixels) used for a single level of indentation due
751 // to a <UL> or <DL> or <BLOCKQUOTE>, etc.
752 
753 #define HTML_INDENT 36
754 
755 
756 //----------------------------------------------------------------------
757 
758 // A layout context holds all state information used by the layout engine.
759 
760 class TGHtmlLayoutContext : public TObject {
761 public:
763 
764  void LayoutBlock();
765  void Reset();
766 
767  void PopIndent();
768  void PushIndent();
769 
770 protected:
771  void PushMargin(SHtmlMargin_t **ppMargin, int indent, int bottom, int tag);
772  void PopOneMargin(SHtmlMargin_t **ppMargin);
773  void PopMargin(SHtmlMargin_t **ppMargin, int tag);
774  void PopExpiredMargins(SHtmlMargin_t **ppMarginStack, int y);
775  void ClearMarginStack(SHtmlMargin_t **ppMargin);
776 
778  int width, int minX, int *actualWidth);
779 
780  void FixAnchors(TGHtmlElement *p, TGHtmlElement *pEnd, int y);
781  int FixLine(TGHtmlElement *pStart, TGHtmlElement *pEnd,
782  int bottom, int width, int actualWidth, int leftMargin,
783  int *maxX);
784  void Paragraph(TGHtmlElement *p);
785  void ComputeMargins(int *pX, int *pY, int *pW);
786  void ClearObstacle(int mode);
788  int InWrapAround();
789  void WidenLine(int reqWidth, int *pX, int *pY, int *pW);
790 
792 
793 public:
794  TGHtml *fHtml; // The html widget undergoing layout
795  TGHtmlElement *fPStart; // Start of elements to layout
796  TGHtmlElement *fPEnd; // Stop when reaching this element
797  int fHeadRoom; // Extra space wanted above this line
798  int fTop; // Absolute top of drawing area
799  int fBottom; // Bottom of previous line
800  int fLeft, fRight; // Left and right extremes of drawing area
801  int fPageWidth; // Width of the layout field, including
802  // the margins
803  int fMaxX, fMaxY; // Maximum X and Y values of paint
804  SHtmlMargin_t *fLeftMargin; // Stack of left margins
805  SHtmlMargin_t *fRightMargin; // Stack of right margins
806 };
807 
808 
809 // With 28 different fonts and 16 colors, we could in principle have
810 // as many as 448 different GCs. But in practice, a single page of
811 // HTML will typically have much less than this. So we won't try to
812 // keep all GCs on hand. Instead, we'll keep around the most recently
813 // used GCs and allocate new ones as necessary.
814 //
815 // The following structure is used to build a cache of GCs in the
816 // main widget object.
817 
818 #define N_CACHE_GC 32
819 
820 struct GcCache_t {
821  GContext_t fGc; // The graphics context
822  Html_u8_t fFont; // Font used for this context
823  Html_u8_t fColor; // Color used for this context
824  Html_u8_t fIndex; // Index used for LRU replacement
825 };
826 
827 
828 // An SHtmlIndex_t is a reference to a particular character within a
829 // particular Text or Space token.
830 
831 struct SHtmlIndex_t {
832  TGHtmlElement *fP; // The token containing the character
833  int fI; // Index of the character
834 };
835 
836 
837 // Used by the tokenizer
838 
840  const char *fZName; // Name of a markup
841  Html_16_t fType; // Markup type code
842  Html_16_t fObjType; // Which kind of TGHtml... object to alocate
843  SHtmlTokenMap_t *fPCollide; // Hash table collision chain
844 };
845 
846 
847 // Markup element types to be allocated by the tokenizer.
848 // Do not confuse with .type field in TGHtmlElement
849 
850 #define O_HtmlMarkupElement 0
851 #define O_HtmlCell 1
852 #define O_HtmlTable 2
853 #define O_HtmlRef 3
854 #define O_HtmlLi 4
855 #define O_HtmlListStart 5
856 #define O_HtmlImageMarkup 6
857 #define O_HtmlInput 7
858 #define O_HtmlForm 8
859 #define O_HtmlHr 9
860 #define O_HtmlAnchor 10
861 #define O_HtmlScript 11
862 #define O_HtmlMapArea 12
863 
864 
865 //----------------------------------------------------------------------
866 
867 // The HTML widget. A derivate of TGView.
868 
869 class TGListBox;
870 class THashTable;
871 
872 class TGHtml : public TGView {
873 public:
874  TGHtml(const TGWindow *p, int w, int h, int id = -1);
875  virtual ~TGHtml();
876 
877  virtual Bool_t HandleFocusChange(Event_t *event);
878  virtual Bool_t HandleButton(Event_t *event);
879  virtual Bool_t HandleMotion(Event_t *event);
880 
882  virtual Bool_t HandleTimer(TTimer *timer);
883 
885 
886  virtual void DrawRegion(Int_t x, Int_t y, UInt_t w, UInt_t h);
887  virtual Bool_t ItemLayout();
888 
891 
892 public: // user commands
893 
894  int ParseText(char *text, const char *index = 0);
895 
896  void SetTableRelief(int relief);
897  int GetTableRelief() const { return fTableRelief; }
898 
899  void SetRuleRelief(int relief);
900  int GetRuleRelief() const { return fRuleRelief; }
901  int GetRulePadding() const { return fRulePadding; }
902 
903  void UnderlineLinks(int onoff);
904 
905  void SetBaseUri(const char *uri);
906  const char *GetBaseUri() const { return fZBase; }
907 
908  int GotoAnchor(const char *name);
909 
910 public: // reloadable methods
911 
912  // called when the widget is cleared
913  virtual void Clear(Option_t * = "");
914 
915  // User function to resolve URIs
916  virtual char *ResolveUri(const char *uri);
917 
918  // User function to get an image from a URL
919  virtual TImage *LoadImage(const char *uri, int w = 0, int h = 0) ;//
920  // { return 0; }
921 
922  // User function to tell if a hyperlink has already been visited
923  virtual int IsVisited(const char * /*url*/)
924  { return kFALSE; }
925 
926  // User function to process tokens of the given type
927  virtual int ProcessToken(TGHtmlElement * /*pElem*/, const char * /*name*/, int /*type*/)
928  { return kFALSE; }
929 
930  virtual TGFont *GetFont(int iFont);
931 
932  // The HTML parser will invoke the following methods from time
933  // to time to find out information it needs to complete formatting of
934  // the document.
935 
936  // Method for handling <frameset> markup
937  virtual int ProcessFrame()
938  { return kFALSE; }
939 
940  // Method to process applets
941  virtual TGFrame *ProcessApplet(TGHtmlInput * /*input*/)
942  { return 0; }
943 
944  // Called when parsing forms
945  virtual int FormCreate(TGHtmlForm * /*form*/, const char * /*zUrl*/, const char * /*args*/)
946  { return kFALSE; }
947 
948  // Called when user presses Submit
949  virtual int FormAction(TGHtmlForm * /*form*/, int /*id*/)
950  { return kFALSE; }
951 
952  // Invoked to find font names
953  virtual char *GetFontName()
954  { return 0; }
955 
956  // Invoked for each <SCRIPT> markup
957  virtual char *ProcessScript(TGHtmlScript * /*script*/)
958  { return 0; }
959 
960 public:
961  const char *GetText() const { return fZText; }
962 
963  int GetMarginWidth() { return fMargins.fL + fMargins.fR; }
964  int GetMarginHeight() { return fMargins.fT + fMargins.fB; }
965 
966  TGHtmlInput *GetInputElement(int x, int y);
967  const char *GetHref(int x, int y, const char **target = 0);
968 
970 
971  int InArea(TGHtmlMapArea *p, int left, int top, int x, int y);
972  TGHtmlElement *GetMap(const char *name);
973 
975  int ElementCoords(TGHtmlElement *p, int i, int pct, int *coords);
976 
977  TGHtmlElement *TableDimensions(TGHtmlTable *pStart, int lineWidth);
978  int CellSpacing(TGHtmlElement *pTable);
979  void MoveVertically(TGHtmlElement *p, TGHtmlElement *pLast, int dy);
980 
982 
983  char *GetTokenName(TGHtmlElement *p);
984  char *DumpToken(TGHtmlElement *p);
985 
986  void EncodeText(TGString *str, const char *z);
987 
988 protected:
989  void HClear();
990  void ClearGcCache();
991  void ResetLayoutContext();
992  void Redraw();
993  void ComputeVirtualSize();
994 
995  void ScheduleRedraw();
996 
997  void RedrawArea(int left, int top, int right, int bottom);
998  void RedrawBlock(TGHtmlBlock *p);
999  void RedrawEverything();
1000  void RedrawText(int y);
1001 
1002  float ColorDistance(ColorStruct_t *pA, ColorStruct_t *pB);
1003  int IsDarkColor(ColorStruct_t *p);
1004  int IsLightColor(ColorStruct_t *p);
1005  int GetColorByName(const char *zColor);
1006  int GetDarkShadowColor(int iBgColor);
1007  int GetLightShadowColor(int iBgColor);
1008  int GetColorByValue(ColorStruct_t *pRef);
1009 
1010  void FlashCursor();
1011 
1012  GContext_t GetGC(int color, int font);
1013  GContext_t GetAnyGC();
1014 
1015  void AnimateImage(TGHtmlImage *image);
1016  void ImageChanged(TGHtmlImage *image, int newWidth, int newHeight);
1018  int GetImageAt(int x, int y);
1019  const char *GetPctWidth(TGHtmlElement *p, char *opt, char *ret);
1020  void TableBgndImage(TGHtmlElement *p);
1021 
1023  void UnlinkAndFreeBlock(TGHtmlBlock *pBlock);
1024  void AppendBlock(TGHtmlElement *pToken, TGHtmlBlock *pBlock);
1025 
1026  void StringHW(const char *str, int *h, int *w);
1027  TGHtmlElement *MinMax(TGHtmlElement *p, int *pMin, int *pMax,
1028  int lineWidth, int hasbg);
1029 
1031  int x, int y);
1032  void DrawRect(Drawable_t drawable, TGHtmlElement *src,
1033  int x, int y, int w, int h, int depth, int relief);
1034  void BlockDraw(TGHtmlBlock *pBlock, Drawable_t wid,
1035  int left, int top,
1036  int width, int height, Pixmap_t pixmap);
1037  void DrawImage(TGHtmlImageMarkup *image, Drawable_t wid,
1038  int left, int top,
1039  int right, int bottom);
1040  void DrawTableBgnd(int x, int y, int w, int h, Drawable_t d, TImage *image);
1041 
1043  void FormBlocks();
1044 
1045  void AppendElement(TGHtmlElement *pElem);
1046  int Tokenize();
1047  void AppToken(TGHtmlElement *pNew, TGHtmlElement *p, int offs);
1048  TGHtmlMarkupElement *MakeMarkupEntry(int objType, int type, int argc,
1049  int arglen[], char *argv[]);
1050  void TokenizerAppend(const char *text);
1052  char *zType, char *zArgs, int offs);
1053  SHtmlTokenMap_t *NameToPmap(char *zType);
1054  int NameToType(char *zType);
1055  const char *TypeToName(int type);
1056  int TextInsertCmd(int argc, char **argv);
1058 
1059  TGHtmlElement *TokenByIndex(int N, int flag);
1060  int TokenNumber(TGHtmlElement *p);
1061 
1062  void MaxIndex(TGHtmlElement *p, int *pIndex, int isLast);
1063  int IndexMod(TGHtmlElement **pp, int *ip, char *cp);
1064  void FindIndexInBlock(TGHtmlBlock *pBlock, int x,
1065  TGHtmlElement **ppToken, int *pIndex);
1066  void IndexToBlockIndex(SHtmlIndex_t sIndex,
1067  TGHtmlBlock **ppBlock, int *piIndex);
1068  int DecodeBaseIndex(const char *zBase,
1069  TGHtmlElement **ppToken, int *pIndex);
1070  int GetIndex(const char *zIndex, TGHtmlElement **ppToken, int *pIndex);
1071 
1072  void LayoutDoc();
1073 
1074  int MapControls();
1075  void UnmapControls();
1076  void DeleteControls();
1077  int ControlSize(TGHtmlInput *p);
1078  void SizeAndLink(TGFrame *frame, TGHtmlInput *pElem);
1079  int FormCount(TGHtmlInput *p, int radio);
1080  void AddFormInfo(TGHtmlElement *p);
1082  void AppendText(TGString *str, TGHtmlElement *pFirst, TGHtmlElement *pEnd);
1083 
1084  void UpdateSelection(int forceUpdate);
1085  void UpdateSelectionDisplay();
1086  void LostSelection();
1087  int SelectionSet(const char *startIx, const char *endIx);
1088  void UpdateInsert();
1089  int SetInsert(const char *insIx);
1090 
1091  const char *GetUid(const char *string);
1092  ColorStruct_t *AllocColor(const char *name);
1094  void FreeColor(ColorStruct_t *color);
1095 
1097  void PushStyleStack(int tag, SHtmlStyle_t style);
1098  SHtmlStyle_t PopStyleStack(int tag);
1099 
1100  void MakeInvisible(TGHtmlElement *p_first, TGHtmlElement *p_last);
1101  int GetLinkColor(const char *zURL);
1102  void AddStyle(TGHtmlElement *p);
1103  void Sizer();
1104 
1105  int NextMarkupType(TGHtmlElement *p);
1106 
1107  TGHtmlElement *AttrElem(const char *name, char *value);
1108 
1109 public:
1110  void AppendArglist(TGString *str, TGHtmlMarkupElement *pElem);
1113  TGString *TableText(TGHtmlTable *pTable, int flags);
1114 
1115  virtual void MouseOver(const char *uri) { Emit("MouseOver(const char *)",uri); } // *SIGNAL*
1116  virtual void MouseDown(const char *uri) { Emit("MouseDown(const char *)",uri); } // *SIGNAL*
1117  virtual void ButtonClicked(const char *name, const char *val); // *SIGNAL*
1118  virtual void SubmitClicked(const char *val); // *SIGNAL*
1119  virtual void CheckToggled(const char *name, Bool_t on, const char *val); // *SIGNAL*
1120  virtual void RadioChanged(const char *name, const char *val); // *SIGNAL*
1121  virtual void InputSelected(const char *name, const char *val); //*SIGNAL*
1122  virtual void SavePrimitive(std::ostream &out, Option_t * = "");
1123 
1124 protected:
1125  virtual void UpdateBackgroundStart();
1126 
1127 protected:
1128  TGHtmlElement *fPFirst; // First HTML token on a list of them all
1129  TGHtmlElement *fPLast; // Last HTML token on the list
1130  int fNToken; // Number of HTML tokens on the list.
1131  // Html_Block tokens don't count.
1132  TGHtmlElement *fLastSized; // Last HTML element that has been sized
1133  TGHtmlElement *fNextPlaced; // Next HTML element that needs to be
1134  // positioned on canvas.
1135  TGHtmlBlock *fFirstBlock; // List of all TGHtmlBlock tokens
1136  TGHtmlBlock *fLastBlock; // Last TGHtmlBlock in the list
1137  TGHtmlInput *fFirstInput; // First <INPUT> element
1138  TGHtmlInput *fLastInput; // Last <INPUT> element
1139  int fNInput; // The number of <INPUT> elements
1140  int fNForm; // The number of <FORM> elements
1141  int fVarId; // Used to construct a unique name for a
1142  // global array used by <INPUT> elements
1143  int fInputIdx; // Unique input index
1144  int fRadioIdx; // Unique radio index
1145 
1146  // Information about the selected region of text
1147 
1148  SHtmlIndex_t fSelBegin; // Start of the selection
1149  SHtmlIndex_t fSelEnd; // End of the selection
1150  TGHtmlBlock *fPSelStartBlock; // Block in which selection starts
1151  Html_16_t fSelStartIndex; // Index in pSelStartBlock of first selected
1152  // character
1153  Html_16_t fSelEndIndex; // Index of last selecte char in pSelEndBlock
1154  TGHtmlBlock *fPSelEndBlock; // Block in which selection ends
1155 
1156  // Information about the insertion cursor
1157 
1158  int fInsOnTime; // How long the cursor states one (millisec)
1159  int fInsOffTime; // How long it is off (milliseconds)
1160  int fInsStatus; // Is it visible?
1161  TTimer *fInsTimer; // Timer used to flash the insertion cursor
1162  SHtmlIndex_t fIns; // The insertion cursor position
1163  TGHtmlBlock *fPInsBlock; // The TGHtmlBlock containing the cursor
1164  int fInsIndex; // Index in pInsBlock of the cursor
1165 
1166  // The following fields hold state information used by the tokenizer.
1167 
1168  char *fZText; // Complete text of the unparsed HTML
1169  int fNText; // Number of characters in zText
1170  int fNAlloc; // Space allocated for zText
1171  int fNComplete; // How much of zText has actually been
1172  // converted into tokens
1173  int fICol; // The column in which zText[nComplete]
1174  // occurs. Used to resolve tabs in input
1175  int fIPlaintext; // If not zero, this is the token type that
1176  // caused us to go into plaintext mode. One
1177  // of Html_PLAINTEXT, Html_LISTING or
1178  // Html_XMP
1179  TGHtmlScript *fPScript; // <SCRIPT> currently being parsed
1180 
1182 
1183  // These fields hold state information used by the HtmlAddStyle routine.
1184  // We have to store this state information here since HtmlAddStyle
1185  // operates incrementally. This information must be carried from
1186  // one incremental execution to the next.
1187 
1188  SHtmlStyleStack_t *fStyleStack; // The style stack
1189  int fParaAlignment; // Justification associated with <p>
1190  int fRowAlignment; // Justification associated with <tr>
1191  int fAnchorFlags; // Style flags associated with <A>...</A>
1192  int fInDt; // Style flags associated with <DT>...</DT>
1193  int fInTr; // True if within <tr>..</tr>
1194  int fInTd; // True if within <td>..</td> or <th>..</th>
1195  TGHtmlAnchor *fAnchorStart; // Most recent <a href=...>
1196  TGHtmlForm *fFormStart; // Most recent <form>
1197  TGHtmlInput *fFormElemStart; // Most recent <textarea> or <select>
1198  TGHtmlInput *fFormElemLast; // Most recent <input>, <textarea> or <select>
1199  TGHtmlListStart *fInnerList; // The inner most <OL> or <UL>
1200  TGHtmlElement *fLoEndPtr; // How far AddStyle has gone to
1201  TGHtmlForm *fLoFormStart; // For AddStyle
1202 
1203  // These fields are used to hold the state of the layout engine.
1204  // Because the layout is incremental, this state must be held for
1205  // the life of the widget.
1206 
1208 
1209  // Information used when displaying the widget:
1210 
1211  int fHighlightWidth; // Width in pixels of highlight to draw
1212  // around widget when it has the focus.
1213  // <= 0 means don't draw a highlight.
1214  TGInsets fMargins; // document margins (separation between the
1215  // edge of the clip window and rendered HTML).
1216  ColorStruct_t *fHighlightBgColorPtr; // Color for drawing traversal highlight
1217  // area when highlight is off.
1218  ColorStruct_t *fHighlightColorPtr; // Color for drawing traversal highlight.
1219  TGFont *fAFont[N_FONT]; // Information about all screen fonts
1220  char fFontValid[(N_FONT+7)/8]; // If bit N%8 of work N/8 of this field is 0
1221  // if aFont[N] needs to be reallocated before
1222  // being used.
1223  ColorStruct_t *fApColor[N_COLOR]; // Information about all colors
1224  Long_t fColorUsed; // bit N is 1 if color N is in use. Only
1225  // applies to colors that aren't predefined
1226  int fIDark[N_COLOR]; // Dark 3D shadow of color K is iDark[K]
1227  int fILight[N_COLOR]; // Light 3D shadow of color K is iLight[K]
1228  ColorStruct_t *fBgColor; // Background color of the HTML document
1229  ColorStruct_t *fFgColor; // Color of normal text. apColor[0]
1230  ColorStruct_t *fNewLinkColor; // Color of unvisitied links. apColor[1]
1231  ColorStruct_t *fOldLinkColor; // Color of visitied links. apColor[2]
1232  ColorStruct_t *fSelectionColor; // Background color for selections
1233  GcCache_t fAGcCache[N_CACHE_GC]; // A cache of GCs for general use
1235  int fLastGC; // Index of recently used GC
1236  TGHtmlImage *fImageList; // A list of all images
1237  TImage *fBgImage; // Background image
1238 
1239  int fFormPadding; // Amount to pad form elements by
1240  int fOverrideFonts; // TRUE if we should override fonts
1241  int fOverrideColors; // TRUE if we should override colors
1242  int fUnderlineLinks; // TRUE if we should underline hyperlinks
1243  int fHasScript; // TRUE if we can do scripts for this page
1244  int fHasFrames; // TRUE if we can do frames for this page
1245  int fAddEndTags; // TRUE if we add /LI etc.
1246  int fTableBorderMin; // Force tables to have min border size
1247  int fVarind; // Index suffix for unique global var name
1248 
1249  // Information about the selection
1250 
1251  int fExportSelection; // True if the selection is automatically
1252  // exported to the clipboard
1253 
1254  // Miscellaneous information:
1255 
1256  int fTableRelief; // 3d effects on <TABLE>
1257  int fRuleRelief; // 3d effects on <HR>
1258  int fRulePadding; // extra pixels above and below <HR>
1259  const char *fZBase; // The base URI
1260  char *fZBaseHref; // zBase as modified by <BASE HREF=..> markup
1261  Cursor_t fCursor; // Current cursor for window, or None.
1262  int fMaxX, fMaxY; // Maximum extent of any "paint" that appears
1263  // on the virtual canvas. Used to compute
1264  // scrollbar positions.
1265  int fDirtyLeft, fDirtyTop; // Top left corner of region to redraw. These
1266  // are physical screen coordinates relative to
1267  // the clip win, not main window.
1268  int fDirtyRight, fDirtyBottom; // Bottom right corner of region to redraw
1269  int fFlags; // Various flags; see below for definitions.
1270  int fIdind;
1271  int fInParse; // Prevent update if parsing
1272  char *fZGoto; // Label to goto right after layout
1273 
1274  SHtmlExtensions_t *fExts; // Pointer to user extension data
1275 
1276  THashTable *fUidTable; // Hash table for some used string values
1277  // like color names, etc.
1278  const char *fLastUri; // Used in HandleMotion
1279  int fExiting; // True if the widget is being destroyed
1280 
1281  ClassDef(TGHtml, 0); // HTML widget
1282 };
1283 
1284 
1285 // Flag bits "flags" field of the Html widget:
1286 //
1287 // REDRAW_PENDING An idle handler has already been queued to
1288 // call the TGHtml::Redraw() method.
1289 //
1290 // GOT_FOCUS This widget currently has input focus.
1291 //
1292 // HSCROLL Horizontal scrollbar position needs to be
1293 // recomputed.
1294 //
1295 // VSCROLL Vertical scrollbar position needs to be
1296 // recomputed.
1297 //
1298 // RELAYOUT We need to reposition every element on the
1299 // virtual canvas. (This happens, for example,
1300 // when the size of the widget changes and we
1301 // need to recompute the line breaks.)
1302 //
1303 // RESIZE_ELEMENTS We need to recompute the size of every element.
1304 // This happens, for example, when the fonts
1305 // change.
1306 //
1307 // REDRAW_FOCUS We need to repaint the focus highlight border.
1308 //
1309 // REDRAW_TEXT Everything in the clipping window needs to be redrawn.
1310 //
1311 // STYLER_RUNNING There is a call to HtmlAddStyle() in process.
1312 // Used to prevent a recursive call to HtmlAddStyle().
1313 //
1314 // INSERT_FLASHING True if there is a timer scheduled that will toggle
1315 // the state of the insertion cursor.
1316 //
1317 // REDRAW_IMAGES One or more TGHtmlImageMarkup objects have their
1318 // redrawNeeded flag set.
1319 
1320 #define REDRAW_PENDING 0x000001
1321 #define GOT_FOCUS 0x000002
1322 #define HSCROLL 0x000004
1323 #define VSCROLL 0x000008
1324 #define RELAYOUT 0x000010
1325 #define RESIZE_ELEMENTS 0x000020
1326 #define REDRAW_FOCUS 0x000040
1327 #define REDRAW_TEXT 0x000080
1328 #define EXTEND_LAYOUT 0x000100
1329 #define STYLER_RUNNING 0x000200
1330 #define INSERT_FLASHING 0x000400
1331 #define REDRAW_IMAGES 0x000800
1332 #define ANIMATE_IMAGES 0x001000
1333 
1334 
1335 // Macros to set, clear or test bits of the "flags" field.
1336 
1337 #define HtmlHasFlag(A,F) (((A)->flags&(F))==(F))
1338 #define HtmlHasAnyFlag(A,F) (((A)->flags&(F))!=0)
1339 #define HtmlSetFlag(A,F) ((A)->flags|=(F))
1340 #define HtmlClearFlag(A,F) ((A)->flags&=~(F))
1341 
1342 
1343 // No coordinate is ever as big as this number
1344 
1345 #define LARGE_NUMBER 100000000
1346 
1347 
1348 // Default values for configuration options
1349 
1350 #define DEF_HTML_BG_COLOR DEF_FRAME_BG_COLOR
1351 #define DEF_HTML_BG_MONO DEF_FRAME_BG_MONO
1352 #define DEF_HTML_EXPORT_SEL 1
1353 #define DEF_HTML_FG DEF_BUTTON_FG
1354 #define DEF_HTML_HIGHLIGHT_BG DEF_BUTTON_HIGHLIGHT_BG
1355 #define DEF_HTML_HIGHLIGHT DEF_BUTTON_HIGHLIGHT
1356 #define DEF_HTML_HIGHLIGHT_WIDTH "0"
1357 #define DEF_HTML_INSERT_OFF_TIME 300
1358 #define DEF_HTML_INSERT_ON_TIME 600
1359 #define DEF_HTML_PADX (HTML_INDENT / 4)
1360 #define DEF_HTML_PADY (HTML_INDENT / 4)
1361 #define DEF_HTML_RELIEF "raised"
1362 #define DEF_HTML_SELECTION_COLOR "skyblue"
1363 #define DEF_HTML_TAKE_FOCUS "0"
1364 #define DEF_HTML_UNVISITED "blue2"
1365 #define DEF_HTML_VISITED "purple4"
1366 
1367 #ifdef NAVIGATOR_TABLES
1368 
1369 #define DEF_HTML_TABLE_BORDER "0"
1370 #define DEF_HTML_TABLE_CELLPADDING "2"
1371 #define DEF_HTML_TABLE_CELLSPACING "5"
1372 #define DEF_HTML_TABLE_BORDER_LIGHT_COLOR "gray80"
1373 #define DEF_HTML_TABLE_BORDER_DARK_COLOR "gray40"
1374 
1375 #endif // NAVIGATOR_TABLES
1376 
1377 
1378 //----------------------------------------------------------------------
1379 
1380 // Messages generated by the HTML widget
1381 /*
1382 class TGHtmlMessage : public OWidgetMessage {
1383 public:
1384  TGHtmlMessage(int t, int a, int i, const char *u, int rx, int ry) :
1385  OWidgetMessage(t, a, i) {
1386  uri = u;
1387  x_root = rx;
1388  y_root = ry;
1389  }
1390 
1391 public:
1392  const char *uri;
1393  //ORectangle bbox;
1394  int x_root, y_root;
1395 };
1396 */
1397 
1398 #endif // ROOT_TGHtml
TGHtmlBlock::TGHtmlBlock
TGHtmlBlock()
ctor.
Definition: TGHtmlDraw.cxx:47
TGHtml::ScheduleRedraw
void ScheduleRedraw()
Make sure that a call to the Redraw() routine has been queued.
Definition: TGHtml.cxx:751
TGHtmlLayoutContext::Reset
void Reset()
Reset the layout context.
Definition: TGHtmlLayout.cxx:56
TGHtml::DrawTableBgnd
void DrawTableBgnd(int x, int y, int w, int h, Drawable_t d, TImage *image)
Draw table background.
Definition: TGHtmlDraw.cxx:857
TGHtml::MakeMarkupEntry
TGHtmlMarkupElement * MakeMarkupEntry(int objType, int type, int argc, int arglen[], char *argv[])
Make one markup entry.
Definition: TGHtmlParse.cxx:1019
SHtmlTokenMap_t::fPCollide
SHtmlTokenMap_t * fPCollide
Definition: TGHtml.h:843
TGHtmlImageMarkup::fDescent
Html_16_t fDescent
Definition: TGHtml.h:547
TGListBox
Definition: TGListBox.h:288
TGHtmlMapArea::fMType
int fMType
Definition: TGHtml.h:472
TGHtml::PushStyleStack
void PushStyleStack(int tag, SHtmlStyle_t style)
Push a new rendering style onto the stack.
Definition: TGHtmlSizer.cxx:66
TGHtml::TokenizerAppend
void TokenizerAppend(const char *text)
Append text to the tokenizer engine.
Definition: TGHtmlParse.cxx:1084
TGHtmlLi
Definition: TGHtml.h:418
n
const Int_t n
Definition: legend1.C:16
TGHtmlImageMarkup::fINext
TGHtmlImageMarkup * fINext
Definition: TGHtml.h:553
SHtmlStyleStack_t::fPNext
SHtmlStyleStack_t * fPNext
Definition: TGHtml.h:733
TGHtmlLayoutContext::fTop
int fTop
Definition: TGHtml.h:798
TGHtmlBlock::fTop
int fTop
Definition: TGHtml.h:717
TGHtml::fHasScript
int fHasScript
Definition: TGHtml.h:1243
TGHtml::AllocColor
ColorStruct_t * AllocColor(const char *name)
Allocate system color by name.
Definition: TGHtml.cxx:261
Html_16_t
short Html_16_t
Definition: TGHtml.h:136
TGHtml::EncodeText
void EncodeText(TGString *str, const char *z)
Append to the given TString an encoded version of the given text.
Definition: TGHtmlForm.cxx:642
TGHtml::fApColor
ColorStruct_t * fApColor[N_COLOR]
Definition: TGHtml.h:1223
first
Definition: first.py:1
TGHtml::fPScript
TGHtmlScript * fPScript
Definition: TGHtml.h:1179
SHtmlIndex_t
Definition: TGHtml.h:831
TGHtmlElement::GetOrderedListType
virtual int GetOrderedListType(int dflt)
Definition: TGHtml.h:256
TGHtml::UnderlineLinks
void UnderlineLinks(int onoff)
Set/reset html links underline.
Definition: TGHtml.cxx:397
TGHtml::ElementCoords
int ElementCoords(TGHtmlElement *p, int i, int pct, int *coords)
Return coordinates of item.
Definition: TGHtml.cxx:1819
TGHtmlImage::operator=
TGHtmlImage & operator=(const TGHtmlImage &)
TGWindow
Definition: TGWindow.h:31
TGHtmlCell::fRowspan
Html_16_t fRowspan
Definition: TGHtml.h:386
Pixmap_t
Handle_t Pixmap_t
Definition: GuiTypes.h:29
TGHtmlElement::fPNext
TGHtmlElement * fPNext
Definition: TGHtml.h:261
TGHtml::CellSpacing
int CellSpacing(TGHtmlElement *pTable)
Return the appropriate cell spacing for the given table.
Definition: TGHtmlTable.cxx:53
TGHtmlRef::~TGHtmlRef
~TGHtmlRef()
HTML ref element destructor.
Definition: TGHtmlElement.cxx:276
TGHtml::fInTd
int fInTd
Definition: TGHtml.h:1194
TGHtml::ListTokens
TGString * ListTokens(TGHtmlElement *p, TGHtmlElement *pEnd)
Return all tokens between the two elements as a string list.
Definition: TGHtmlParse.cxx:1469
TGHtmlLayoutContext::fMaxX
int fMaxX
Definition: TGHtml.h:803
TGHtml::fRadioIdx
int fRadioIdx
Definition: TGHtml.h:1144
TGHtml::TableDimensions
TGHtmlElement * TableDimensions(TGHtmlTable *pStart, int lineWidth)
pStart points to a
Definition: TGHtmlTable.cxx:374
TGHtml::RedrawArea
void RedrawArea(int left, int top, int right, int bottom)
If any part of the screen needs to be redrawn, then call this routine with the values of a box (in wi...
Definition: TGHtml.cxx:778
TGHtmlLayoutContext::PushMargin
void PushMargin(SHtmlMargin_t **ppMargin, int indent, int bottom, int tag)
Push a new margin onto the given margin stack.
Definition: TGHtmlLayout.cxx:81
TGHtml::fIdle
TGIdleHandler * fIdle
Definition: TGHtml.h:1181
TGHtml::AllocColorByValue
ColorStruct_t * AllocColorByValue(ColorStruct_t *color)
Allocate system color by value.
Definition: TGHtml.cxx:280
TGHtml::fImageList
TGHtmlImage * fImageList
Definition: TGHtml.h:1236
TGHtmlLayoutContext::DoBreakMarkup
TGHtmlElement * DoBreakMarkup(TGHtmlElement *p)
Break markup is any kind of markup that might force a line-break.
Definition: TGHtmlLayout.cxx:829
TGHtmlElement
Definition: TGHtml.h:249
TGHtmlLi::fDescent
Html_u8_t fDescent
Definition: TGHtml.h:425
TGHtml::GetGC
GContext_t GetGC(int color, int font)
Return a GC from the cache.
Definition: TGHtml.cxx:1036
TGHtml::ButtonClicked
virtual void ButtonClicked(const char *name, const char *val)
Emit ButtonClicked() signal.
Definition: TGHtml.cxx:1275
TGHtml::HandleMotion
virtual Bool_t HandleMotion(Event_t *event)
handle mouse motion events
Definition: TGHtml.cxx:1380
TGHtml::fAnchorFlags
int fAnchorFlags
Definition: TGHtml.h:1191
TGHtml::FreeColor
void FreeColor(ColorStruct_t *color)
Free system color.
Definition: TGHtml.cxx:252
TGHtml::fLastSized
TGHtmlElement * fLastSized
Definition: TGHtml.h:1132
TGHtml::fIns
SHtmlIndex_t fIns
Definition: TGHtml.h:1162
TGHtmlCell::fH
Html_32_t fH
Definition: TGHtml.h:391
TGHtml::PopStyleStack
SHtmlStyle_t PopStyleStack(int tag)
Pop a rendering style off of the stack.
Definition: TGHtmlSizer.cxx:87
TGHtml::fFormElemStart
TGHtmlInput * fFormElemStart
Definition: TGHtml.h:1197
TGHtml::fNForm
int fNForm
Definition: TGHtml.h:1140
TGHtml::fHighlightColorPtr
ColorStruct_t * fHighlightColorPtr
Definition: TGHtml.h:1218
TGHtml::fLoEndPtr
TGHtmlElement * fLoEndPtr
Definition: TGHtml.h:1200
TGHtml::FormBlocks
void FormBlocks()
Add additional blocks to the block list in order to cover all elements on the element list.
Definition: TGHtmlDraw.cxx:831
TGHtmlTable::fNRow
Html_u16_t fNRow
Definition: TGHtml.h:361
TGHtmlMapArea::fCoords
int * fCoords
Definition: TGHtml.h:473
Option_t
const char Option_t
Definition: RtypesCore.h:66
TGHtmlLayoutContext::fPStart
TGHtmlElement * fPStart
Definition: TGHtml.h:795
TGHtml::SetRuleRelief
void SetRuleRelief(int relief)
Sets relief mode of html rule.
Definition: TGHtml.cxx:385
TGHtml::fPInsBlock
TGHtmlBlock * fPInsBlock
Definition: TGHtml.h:1163
HtmlDepth
int HtmlDepth
Definition: TGHtml.cxx:62
TGHtmlListStart::fWidth
Html_u16_t fWidth
Definition: TGHtml.h:458
SHtmlIndex_t::fI
int fI
Definition: TGHtml.h:833
TGIdleHandler
Definition: TGIdleHandler.h:29
TGHtml::fDirtyLeft
int fDirtyLeft
Definition: TGHtml.h:1265
SHtmlStyle_t::fColor
unsigned int fColor
Definition: TGHtml.h:145
TGHtmlMarkupElement::GetVerticalAlignment
virtual int GetVerticalAlignment(int dflt)
Return the vertical alignment specified by the given element.
Definition: TGHtmlTable.cxx:1091
TGHtml::fMargins
TGInsets fMargins
Definition: TGHtml.h:1214
TGHtmlImageMarkup::fTextAscent
Html_u8_t fTextAscent
Definition: TGHtml.h:540
TGHtml::ProcessScript
virtual char * ProcessScript(TGHtmlScript *)
Definition: TGHtml.h:957
ColorStruct_t
Definition: GuiTypes.h:309
TGHtmlAnchor::TGHtmlAnchor
TGHtmlAnchor(int type, int argc, int arglen[], char *argv[])
HTML anchor element constructor.
Definition: TGHtmlElement.cxx:353
TGHtmlImageMarkup::fAscent
Html_16_t fAscent
Definition: TGHtml.h:546
TGHtmlImageMarkup::fW
Html_16_t fW
Definition: TGHtml.h:545
SHtmlTokenMap_t::fObjType
Html_16_t fObjType
Definition: TGHtml.h:842
SHtmlExtensions_t::fTyp
int fTyp
Definition: TGHtml.h:484
TGHtmlCell::fPTable
TGHtmlTable * fPTable
Definition: TGHtml.h:392
TGHtml::fOldLinkColor
ColorStruct_t * fOldLinkColor
Definition: TGHtml.h:1231
TGInsets
Definition: TGDimension.h:81
TGHtml::ResetBlocks
void ResetBlocks()
Definition: TGHtml.h:974
TGHtmlLayoutContext::PushIndent
void PushIndent()
Adjust (push) ident.
Definition: TGHtmlLayout.cxx:1158
TGHtml::NextMarkupType
int NextMarkupType(TGHtmlElement *p)
Return the next markup type [TGHtmlElement::NextMarkupType].
Definition: TGHtmlLayout.cxx:814
TGHtmlTable::fY
Html_32_t fY
Definition: TGHtml.h:362
TGHtmlMarkupElement::MarkupArg
virtual const char * MarkupArg(const char *tag, const char *zDefault)
Lookup an argument in the given markup with the name given.
Definition: TGHtmlElement.cxx:135
TGHtml::fInDt
int fInDt
Definition: TGHtml.h:1192
TGHtmlCell::TGHtmlCell
TGHtmlCell(int type, int argc, int arglen[], char *argv[])
HTML cell element constructor.
Definition: TGHtmlElement.cxx:243
TGHtmlForm::TGHtmlForm
TGHtmlForm(int type, int argc, int arglen[], char *argv[])
HTML form element constructor.
Definition: TGHtmlElement.cxx:330
TGHtml::TableText
TGString * TableText(TGHtmlTable *pTable, int flags)
Return text and images from a table as lists.
Definition: TGHtmlTable.cxx:108
TGHtmlTable::fH
Html_32_t fH
Definition: TGHtml.h:363
TGHtml::GetIndex
int GetIndex(const char *zIndex, TGHtmlElement **ppToken, int *pIndex)
This routine decodes a complete index specification.
Definition: TGHtmlIndex.cxx:538
TGHtmlLayoutContext::PopIndent
void PopIndent()
Adjust (pop) ident.
Definition: TGHtmlLayout.cxx:1170
TGHtmlImageMarkup::fX
Html_16_t fX
Definition: TGHtml.h:548
TGHtml::AppendText
void AppendText(TGString *str, TGHtmlElement *pFirst, TGHtmlElement *pEnd)
Append all text and space tokens between pStart and pEnd to the given TString.
Definition: TGHtmlForm.cxx:246
Html_u8_t
unsigned char Html_u8_t
Definition: TGHtml.h:135
TGHtmlTable::fBorderWidth
Html_u8_t fBorderWidth
Definition: TGHtml.h:359
TGHtml::MouseDown
virtual void MouseDown(const char *uri)
Definition: TGHtml.h:1116
TGHtml::NameToPmap
SHtmlTokenMap_t * NameToPmap(char *zType)
Returns token map matching zType name.
Definition: TGHtmlParse.cxx:1297
TGHtml::DumpToken
char * DumpToken(TGHtmlElement *p)
For debugging purposes, print information about a token.
Definition: TGHtmlParse.cxx:1339
TGHtmlInput::fSubId
Html_u16_t fSubId
Definition: TGHtml.h:594
TGHtml::GetDarkShadowColor
int GetDarkShadowColor(int iBgColor)
Given that the background color is iBgColor, figure out an appropriate color for the dark part of a 3...
Definition: TGHtml.cxx:1634
TGHtml::fLayoutContext
TGHtmlLayoutContext fLayoutContext
Definition: TGHtml.h:1207
TGHtml::fSelEndIndex
Html_16_t fSelEndIndex
Definition: TGHtml.h:1153
TGInsets::fT
Int_t fT
Definition: TGDimension.h:85
TGHtml::fTableBorderMin
int fTableBorderMin
Definition: TGHtml.h:1246
TGHtml::IsDarkColor
int IsDarkColor(ColorStruct_t *p)
Check to see if the given color is too dark to be easily distinguished from black.
Definition: TGHtml.cxx:1620
TGHtmlRef::fPOther
TGHtmlElement * fPOther
Definition: TGHtml.h:410
TGHtml::fSelEnd
SHtmlIndex_t fSelEnd
Definition: TGHtml.h:1149
TGHtmlBlock::fZ
char * fZ
Definition: TGHtml.h:716
TGHtmlCell::fW
Html_16_t fW
Definition: TGHtml.h:389
TGHtmlBlock::fBPrev
TGHtmlBlock * fBPrev
Definition: TGHtml.h:720
TGHtml::InputSelected
virtual void InputSelected(const char *name, const char *val)
Emit Selected() signal.
Definition: TGHtml.cxx:1315
TGHtml::MaxIndex
void MaxIndex(TGHtmlElement *p, int *pIndex, int isLast)
Find the maximum index for the given token.
Definition: TGHtmlIndex.cxx:97
TGHtmlHr::fY
Html_32_t fY
Definition: TGHtml.h:653
width
include TDocParser_001 C image html pict1_TDocParser_001 png width
Definition: TDocParser.cxx:121
TGHtml::DrawImage
void DrawImage(TGHtmlImageMarkup *image, Drawable_t wid, int left, int top, int right, int bottom)
Draw all or part of an image.
Definition: TGHtmlDraw.cxx:539
TGHtml::fSelBegin
SHtmlIndex_t fSelBegin
Definition: TGHtml.h:1148
SHtmlStyle_t::fFont
unsigned int fFont
Definition: TGHtml.h:144
TGHtmlScript
Definition: TGHtml.h:678
TGHtmlElement::fOffs
int fOffs
Definition: TGHtml.h:268
TGHtmlTable::fHasbg
int fHasbg
Definition: TGHtml.h:370
TGHtmlLi::fAscent
Html_u8_t fAscent
Definition: TGHtml.h:424
TGHtml::fFormStart
TGHtmlForm * fFormStart
Definition: TGHtml.h:1196
TGHtml::LayoutDoc
void LayoutDoc()
Advance the layout as far as possible.
Definition: TGHtmlLayout.cxx:1180
N
#define N
TGHtml::SavePrimitive
virtual void SavePrimitive(std::ostream &out, Option_t *="")
Save a html widget as a C++ statement(s) on output stream out.
Definition: TGHtml.cxx:2064
TGInsets::fB
Int_t fB
Definition: TGDimension.h:86
TGHtml::fColorUsed
Long_t fColorUsed
Definition: TGHtml.h:1224
TGHtmlTextElement::~TGHtmlTextElement
virtual ~TGHtmlTextElement()
HTML element destructor.
Definition: TGHtmlElement.cxx:80
TGHtmlTable
Definition: TGHtml.h:353
TImage
An abstract interface to image processing library.
Definition: TImage.h:29
SHtmlStyle_t::fSubscript
signed int fSubscript
Definition: TGHtml.h:146
TGHtmlLayoutContext::fPEnd
TGHtmlElement * fPEnd
Definition: TGHtml.h:796
TGHtmlElement::fFlags
Html_u8_t fFlags
Definition: TGHtml.h:265
TGHtmlLayoutContext::WidenLine
void WidenLine(int reqWidth, int *pX, int *pY, int *pW)
Move past obstacles until a linewidth of reqWidth is obtained, or until all obstacles are cleared.
Definition: TGHtmlLayout.cxx:1060
TGHtmlLayoutContext::fPageWidth
int fPageWidth
Definition: TGHtml.h:801
x
Double_t x[n]
Definition: legend1.C:17
SHtmlStyleStack_t::fStyle
SHtmlStyle_t fStyle
Definition: TGHtml.h:735
TGHtmlCell::~TGHtmlCell
~TGHtmlCell()
HTML cell element destructor.
Definition: TGHtmlElement.cxx:258
TGView.h
TGHtml::fInputIdx
int fInputIdx
Definition: TGHtml.h:1143
TGHtml::GetAnyGC
GContext_t GetAnyGC()
Retrieve any valid GC.
Definition: TGHtml.cxx:1106
TGHtml::GetMarkupMap
SHtmlTokenMap_t * GetMarkupMap(int n)
Returns token map at location n.
Definition: TGHtmlParse.cxx:1461
TGHtml::DrawSelectionBackground
void DrawSelectionBackground(TGHtmlBlock *pBlock, Drawable_t Drawable_t, int x, int y)
Draw the selection background for the given block.
Definition: TGHtmlDraw.cxx:216
TGHtmlSpaceElement::fAscent
Html_u8_t fAscent
Definition: TGHtml.h:309
TGHtmlImage::fTimer
TTimer * fTimer
Definition: TGHtml.h:526
TGHtmlHr::fIs3D
Html_u8_t fIs3D
Definition: TGHtml.h:656
TGHtml::Clear
virtual void Clear(Option_t *="")
Erase all HTML from this widget and clear the screen.
Definition: TGHtml.cxx:299
indent
static void indent(ostringstream &buf, int indent_level)
Definition: TClingCallFunc.cxx:87
TGHtmlInput::fY
Html_32_t fY
Definition: TGHtml.h:595
GcCache_t::fColor
Html_u8_t fColor
Definition: TGHtml.h:823
TGHtml::TokenNumber
int TokenNumber(TGHtmlElement *p)
Return the token number for the given TGHtmlElement.
Definition: TGHtmlIndex.cxx:79
TGHtml::RedrawEverything
void RedrawEverything()
Call this routine to force the entire widget to be redrawn.
Definition: TGHtml.cxx:866
TGHtml::fExportSelection
int fExportSelection
Definition: TGHtml.h:1251
TGHtmlLayoutContext::fBottom
int fBottom
Definition: TGHtml.h:799
TGHtmlLayoutContext::PopExpiredMargins
void PopExpiredMargins(SHtmlMargin_t **ppMarginStack, int y)
Pop all expired margins from the stack.
Definition: TGHtmlLayout.cxx:152
TGHtmlScript::TGHtmlScript
TGHtmlScript(int type, int argc, int arglen[], char *argv[])
HTML script element constructor.
Definition: TGHtmlElement.cxx:362
TGHtmlBlock::fRight
Html_u16_t fRight
Definition: TGHtml.h:718
TGHtml::TableBgndImage
void TableBgndImage(TGHtmlElement *p)
Set background picture of a html table.
Definition: TGHtmlSizer.cxx:1022
TGHtml::fOverrideColors
int fOverrideColors
Definition: TGHtml.h:1241
TGHtml::GotoAnchor
int GotoAnchor(const char *name)
Go to anchor position.
Definition: TGHtml.cxx:450
TGHtmlForm::fFormId
Html_u16_t fFormId
Definition: TGHtml.h:638
TGHtml::Sizer
void Sizer()
Compute the size of all elements in the widget.
Definition: TGHtmlSizer.cxx:1076
TGHtml::GetInputElement
TGHtmlInput * GetInputElement(int x, int y)
This routine searchs for a hyperlink beneath the coordinates x,y and returns a pointer to the HREF fo...
Definition: TGHtml.cxx:1140
TGInsets::fR
Int_t fR
Definition: TGDimension.h:84
TGHtmlLayoutContext::fLeft
int fLeft
Definition: TGHtml.h:800
TGHtml::FormAction
virtual int FormAction(TGHtmlForm *, int)
Definition: TGHtml.h:949
TGHtmlHr::fW
Html_u16_t fW
Definition: TGHtml.h:655
TGHtml::SizeAndLink
void SizeAndLink(TGFrame *frame, TGHtmlInput *pElem)
'frame' is the child widget that is used to implement an input element.
Definition: TGHtmlForm.cxx:192
TGHtml::UnlinkAndFreeBlock
void UnlinkAndFreeBlock(TGHtmlBlock *pBlock)
Destroy the given Block after first unlinking it from the element list.
Definition: TGHtmlDraw.cxx:70
TGHtml::AppendElement
void AppendElement(TGHtmlElement *pElem)
Append the given TGHtmlElement to the tokenizers list of elements.
Definition: TGHtmlParse.cxx:480
Html_u16_t
unsigned short Html_u16_t
Definition: TGHtml.h:137
TGFrame
Definition: TGFrame.h:105
TGHtml::RedrawBlock
void RedrawBlock(TGHtmlBlock *p)
Redraw the TGHtmlBlock given.
Definition: TGHtml.cxx:855
TGHtml::HandleTimer
virtual Bool_t HandleTimer(TTimer *timer)
Handle timer event.
Definition: TGHtml.cxx:993
Bool_t
bool Bool_t
Definition: RtypesCore.h:63
TGHtml::SelectionSet
int SelectionSet(const char *startIx, const char *endIx)
Set selection.
Definition: TGHtml.cxx:1984
TGHtml::fILight
int fILight[N_COLOR]
Definition: TGHtml.h:1227
TGHtml::fAnchorStart
TGHtmlAnchor * fAnchorStart
Definition: TGHtml.h:1195
TGHtml::LoadImage
virtual TImage * LoadImage(const char *uri, int w=0, int h=0)
This is the default LoadImage() procedure.
Definition: TGHtmlImage.cxx:292
TGHtmlTable::fMaxW
int fMaxW[HTML_MAX_COLUMNS+1]
Definition: TGHtml.h:367
TGHtml::fPSelEndBlock
TGHtmlBlock * fPSelEndBlock
Definition: TGHtml.h:1154
N_COLOR
#define N_COLOR
Definition: TGHtml.h:194
text
TText * text
Definition: entrylist_figure1.C:10
TGHtml::UpdateSelectionDisplay
void UpdateSelectionDisplay()
The fPSelStartBlock and fPSelEndBlock values have been changed.
Definition: TGHtml.cxx:1923
TGHtmlMapArea::fNum
int fNum
Definition: TGHtml.h:474
TGHtmlCell
Definition: TGHtml.h:380
TGHtml::GetFontName
virtual char * GetFontName()
Definition: TGHtml.h:953
TGHtmlInput::fSized
Html_u8_t fSized
Definition: TGHtml.h:603
TGHtml::SetTableRelief
void SetTableRelief(int relief)
Sets relief mode of html table.
Definition: TGHtml.cxx:373
TGHtml::fGcNextToFree
int fGcNextToFree
Definition: TGHtml.h:1234
TGHtml::fInsIndex
int fInsIndex
Definition: TGHtml.h:1164
GcCache_t::fIndex
Html_u8_t fIndex
Definition: TGHtml.h:824
TGHtmlLi::TGHtmlLi
TGHtmlLi(int type, int argc, int arglen[], char *argv[])
HTML li element constructor.
Definition: TGHtmlElement.cxx:284
TGHtmlLayoutContext::LayoutBlock
void LayoutBlock()
Do as much layout as possible on the block of text defined by the HtmlLayoutContext.
Definition: TGHtmlLayout.cxx:1078
TGHtmlCell::fPEnd
TGHtmlElement * fPEnd
Definition: TGHtml.h:394
bool
TGHtml::fHighlightWidth
int fHighlightWidth
Definition: TGHtml.h:1211
Cursor_t
Handle_t Cursor_t
Definition: GuiTypes.h:33
TGHtml::GetTokenName
char * GetTokenName(TGHtmlElement *p)
Returns token name of html element p.
Definition: TGHtmlParse.cxx:1424
SHtmlMargin_t
Definition: TGHtml.h:742
TGHtmlTable::fBgImage
TImage * fBgImage
Definition: TGHtml.h:369
SHtmlStyle_t::fBgcolor
unsigned int fBgcolor
Definition: TGHtml.h:148
TGHtml::InsertToken
TGHtmlElement * InsertToken(TGHtmlElement *pToken, char *zType, char *zArgs, int offs)
This routine takes a text representation of a token, converts it into an TGHtmlElement object and ins...
Definition: TGHtmlParse.cxx:1128
TGHtml::fFormPadding
int fFormPadding
Definition: TGHtml.h:1239
TGHtml::TypeToName
const char * TypeToName(int type)
Convert a type into a symbolic name.
Definition: TGHtmlParse.cxx:1326
TGHtmlInput::fAlign
Html_u8_t fAlign
Definition: TGHtml.h:599
Drawable_t
Handle_t Drawable_t
Definition: GuiTypes.h:30
TGHtml::HandleFocusChange
virtual Bool_t HandleFocusChange(Event_t *event)
Handle focus change event.
Definition: TGHtml.cxx:1121
TGHtmlLayoutContext::FixAnchors
void FixAnchors(TGHtmlElement *p, TGHtmlElement *pEnd, int y)
Set the y coordinate for every anchor in the given list.
Definition: TGHtmlLayout.cxx:428
SHtmlStyle_t::fExpbg
unsigned int fExpbg
Definition: TGHtml.h:149
TGHtml::AppendArglist
void AppendArglist(TGString *str, TGHtmlMarkupElement *pElem)
Append all the arguments of the given markup to the given TGString.
Definition: TGHtmlParse.cxx:1409
HTML_MAX_COLUMNS
#define HTML_MAX_COLUMNS
Definition: TGHtml.h:342
TGHtmlTable::fNCol
Html_u8_t fNCol
Definition: TGHtml.h:360
TGHtmlLayoutContext::ClearObstacle
void ClearObstacle(int mode)
Clear a wrap-around obstacle.
Definition: TGHtmlLayout.cxx:735
SHtmlMargin_t::fBottom
int fBottom
Definition: TGHtml.h:744
TGHtmlCell::fPRow
TGHtmlElement * fPRow
Definition: TGHtml.h:393
TGHtmlElement::fStyle
SHtmlStyle_t fStyle
Definition: TGHtml.h:263
SHtmlIndex_t::fP
TGHtmlElement * fP
Definition: TGHtml.h:832
Html_Block
@ Html_Block
Definition: TGHtmlTokens.h:45
GContext_t
Handle_t GContext_t
Definition: GuiTypes.h:37
TGHtml::GetTableRelief
int GetTableRelief() const
Definition: TGHtml.h:897
TGHtmlBlock::fBNext
TGHtmlBlock * fBNext
Definition: TGHtml.h:720
TGHtml::fFormElemLast
TGHtmlInput * fFormElemLast
Definition: TGHtml.h:1198
TGHtml::ControlSize
int ControlSize(TGHtmlInput *p)
This routine implements the Sizer() function for <INPUT>, <SELECT> and <TEXTAREA> markup.
Definition: TGHtmlForm.cxx:357
TGHtmlImageMarkup::fRedrawNeeded
Html_u8_t fRedrawNeeded
Definition: TGHtml.h:542
TGHtml::DrawRegion
virtual void DrawRegion(Int_t x, Int_t y, UInt_t w, UInt_t h)
Draw region defined by [x,y] [w,h].
Definition: TGHtml.cxx:794
style
TCanvas * style()
Definition: style.C:1
TGHtml::fPLast
TGHtmlElement * fPLast
Definition: TGHtml.h:1129
TGHtmlImageMarkup::fY
Html_32_t fY
Definition: TGHtml.h:549
SHtmlTokenMap_t::fType
Html_16_t fType
Definition: TGHtml.h:841
TGHtml::fBgColor
ColorStruct_t * fBgColor
Definition: TGHtml.h:1228
TGHtml::fNewLinkColor
ColorStruct_t * fNewLinkColor
Definition: TGHtml.h:1230
N_CACHE_GC
#define N_CACHE_GC
Definition: TGHtml.h:818
TGHtml::fIPlaintext
int fIPlaintext
Definition: TGHtml.h:1175
HtmlTraceMask
int HtmlTraceMask
Definition: TGHtml.cxx:61
SHtmlMargin_t::fPNext
SHtmlMargin_t * fPNext
Definition: TGHtml.h:746
TGHtml::HClear
void HClear()
Erase all data from the HTML widget. Bring it back to an empty screen.
Definition: TGHtml.cxx:890
TGHtml::fRowAlignment
int fRowAlignment
Definition: TGHtml.h:1190
TGHtmlLayoutContext::TGHtmlLayoutContext
TGHtmlLayoutContext()
Html Layout Context constructor.
Definition: TGHtmlLayout.cxx:38
TGHtmlLayoutContext::GetLine
TGHtmlElement * GetLine(TGHtmlElement *pStart, TGHtmlElement *pEnd, int width, int minX, int *actualWidth)
This routine gathers as many tokens as will fit on one line.
Definition: TGHtmlLayout.cxx:203
SHtmlExtensions_t::fFlags
int fFlags
Definition: TGHtml.h:485
TGHtml::fOverrideFonts
int fOverrideFonts
Definition: TGHtml.h:1240
TTimer
Handles synchronous and a-synchronous timer events.
Definition: TTimer.h:51
TGHtml::MapControls
int MapControls()
Map any control that should be visible according to the current scroll position.
Definition: TGHtmlForm.cxx:71
TGHtml
Definition: TGHtml.h:872
TGHtml::fNextPlaced
TGHtmlElement * fNextPlaced
Definition: TGHtml.h:1133
TGHtml::fFlags
int fFlags
Definition: TGHtml.h:1269
TGHtml::fCursor
Cursor_t fCursor
Definition: TGHtml.h:1261
TGHtmlElement::IsMarkup
virtual int IsMarkup() const
Definition: TGHtml.h:253
TGHtml::IndexMod
int IndexMod(TGHtmlElement **pp, int *ip, char *cp)
Modify an index for both pointer and char +/-/=N.
Definition: TGHtmlIndex.cxx:251
TGHtmlElement::fPPrev
TGHtmlElement * fPPrev
Definition: TGHtml.h:262
TGHtml::fLastGC
int fLastGC
Definition: TGHtml.h:1235
TGHtmlLayoutContext::ComputeMargins
void ComputeMargins(int *pX, int *pY, int *pW)
Compute the current margins for layout.
Definition: TGHtmlLayout.cxx:698
SHtmlExtensions_t::fExts
void * fExts
Definition: TGHtml.h:483
TGHtmlTable::fX
Html_16_t fX
Definition: TGHtml.h:364
TGHtmlInput::fInpId
Html_u16_t fInpId
Definition: TGHtml.h:593
TGHtmlRef::TGHtmlRef
TGHtmlRef(int type, int argc, int arglen[], char *argv[])
HTML ref element constructor.
Definition: TGHtmlElement.cxx:266
TGHtmlLayoutContext::fRightMargin
SHtmlMargin_t * fRightMargin
Definition: TGHtml.h:805
TGHtmlRef
Definition: TGHtml.h:404
TGHtmlImage
Definition: TGHtml.h:506
GcCache_t::fFont
Html_u8_t fFont
Definition: TGHtml.h:822
TGHtmlImageMarkup::fAlign
Html_u8_t fAlign
Definition: TGHtml.h:539
TGHtml::HandleIdleEvent
virtual Bool_t HandleIdleEvent(TGIdleHandler *i)
Handles idle event.
Definition: TGHtml.cxx:762
TGHtml::fAGcCache
GcCache_t fAGcCache[N_CACHE_GC]
Definition: TGHtml.h:1233
TGHtml::fUidTable
THashTable * fUidTable
Definition: TGHtml.h:1276
TGHtml::HandleRadioButton
Bool_t HandleRadioButton(TGHtmlInput *p)
Handle radio button event.
Definition: TGHtml.cxx:1256
TGHtml::GetImageAt
int GetImageAt(int x, int y)
This routine searchs for an image beneath the coordinates x,y and returns the token number of the the...
Definition: TGHtmlImage.cxx:368
TGHtml::HandleHtmlInput
Bool_t HandleHtmlInput(TGHtmlInput *pr, Event_t *event)
Handle html input (button, checkbox, ...) event.
Definition: TGHtml.cxx:1165
TGHtmlLi::fLtype
Html_u8_t fLtype
Definition: TGHtml.h:423
TGHtmlTextElement::fX
Html_16_t fX
Definition: TGHtml.h:295
TGHtml::GetLinkColor
int GetLinkColor(const char *zURL)
For the markup <a href=XXX>, find out if the URL has been visited before or not.
Definition: TGHtmlSizer.cxx:159
THashTable
THashTable implements a hash table to store TObject's.
Definition: THashTable.h:35
TGHtmlLi::fY
Html_32_t fY
Definition: TGHtml.h:428
TGHtmlLayoutContext::fLeftMargin
SHtmlMargin_t * fLeftMargin
Definition: TGHtml.h:804
TGHtmlMarkupElement::GetOrderedListType
virtual int GetOrderedListType(int dflt)
The "type" argument to the given element might describe the type for an ordered list.
Definition: TGHtmlElement.cxx:174
TGHtmlSpaceElement::fW
Html_16_t fW
Definition: TGHtml.h:308
N_FONT
#define N_FONT
Definition: TGHtml.h:165
TGHtml::CheckToggled
virtual void CheckToggled(const char *name, Bool_t on, const char *val)
Emit CheckToggled() signal.
Definition: TGHtml.cxx:1288
TGHtmlSpaceElement
Definition: TGHtml.h:306
TGHtml::TextInsertCmd
int TextInsertCmd(int argc, char **argv)
Insert text into text token, or break token into two text tokens.
Definition: TGHtmlParse.cxx:1199
TGHtmlAnchor
Definition: TGHtml.h:662
TGHtmlElement::fType
Html_u8_t fType
Definition: TGHtml.h:264
GcCache_t::fGc
GContext_t fGc
Definition: TGHtml.h:821
h
#define h(i)
Definition: RSha256.hxx:106
TGHtml::fZBaseHref
char * fZBaseHref
Definition: TGHtml.h:1260
TGHtml::fLastUri
const char * fLastUri
Definition: TGHtml.h:1278
TGHtmlTextElement::fAscent
Html_u8_t fAscent
Definition: TGHtml.h:297
TGHtml::FindEndNest
TGHtmlElement * FindEndNest(TGHtmlElement *sp, int en, TGHtmlElement *lp)
Find End tag en, but ignore intervening begin/end tag pairs.
Definition: TGHtmlTable.cxx:315
TGHtml::DeleteControls
void DeleteControls()
Delete all input controls.
Definition: TGHtmlForm.cxx:103
TGHtmlInput
Definition: TGHtml.h:581
TGHtmlImage::fZWidth
char * fZWidth
Definition: TGHtml.h:522
TGInsets::fL
Int_t fL
Definition: TGDimension.h:83
TGHtml::GetFont
virtual TGFont * GetFont(int iFont)
The rendering and layout routines should call this routine in order to get a font structure.
Definition: TGHtml.cxx:1407
TGHtmlImageMarkup::fTextDescent
Html_u8_t fTextDescent
Definition: TGHtml.h:541
TGHtml::FindStartOfNextBlock
TGHtmlElement * FindStartOfNextBlock(TGHtmlElement *p, int *pCnt)
Scan ahead looking for a place to put a block.
Definition: TGHtmlDraw.cxx:806
TGHtml::fTableRelief
int fTableRelief
Definition: TGHtml.h:1256
TGHtml::GetPctWidth
const char * GetPctWidth(TGHtmlElement *p, char *opt, char *ret)
Return the height and width, converting to percent if required ret must be at least 16 characters lon...
Definition: TGHtmlImage.cxx:322
TGHtml::ProcessApplet
virtual TGFrame * ProcessApplet(TGHtmlInput *)
Definition: TGHtml.h:941
TGHtmlLayoutContext::PopMargin
void PopMargin(SHtmlMargin_t **ppMargin, int tag)
Pop as many margins as necessary until the margin that was created with "tag" is popped off.
Definition: TGHtmlLayout.cxx:119
TGHtmlForm::fPEnd
TGHtmlElement * fPEnd
Definition: TGHtml.h:642
TGHtmlInput::fCnt
Html_u16_t fCnt
Definition: TGHtml.h:604
TGHtml::fICol
int fICol
Definition: TGHtml.h:1173
TGHtmlInput::fX
Html_u16_t fX
Definition: TGHtml.h:596
kFALSE
const Bool_t kFALSE
Definition: RtypesCore.h:92
GcCache_t
Definition: TGHtml.h:820
TGHtmlMarkupElement::~TGHtmlMarkupElement
virtual ~TGHtmlMarkupElement()
HTML markup element destructor.
Definition: TGHtmlElement.cxx:122
TGHtml::UnmapControls
void UnmapControls()
Unmap any input control that is currently mapped.
Definition: TGHtmlForm.cxx:51
TGHtmlListStart::fCompact
Html_u8_t fCompact
Definition: TGHtml.h:456
Long_t
long Long_t
Definition: RtypesCore.h:54
TGHtmlImageMarkup::fH
Html_16_t fH
Definition: TGHtml.h:544
TGHtmlBlock::fN
Html_u16_t fN
Definition: TGHtml.h:719
TGHtmlCell::fBgImage
TImage * fBgImage
Definition: TGHtml.h:395
TGHtmlHr::fX
Html_u16_t fX
Definition: TGHtml.h:654
TGHtml::fFirstBlock
TGHtmlBlock * fFirstBlock
Definition: TGHtml.h:1135
SHtmlExtensions_t
Definition: TGHtml.h:482
TGHtml::GetRulePadding
int GetRulePadding() const
Definition: TGHtml.h:901
TGHtml::GetCurrentStyle
SHtmlStyle_t GetCurrentStyle()
Get the current rendering style.
Definition: TGHtmlSizer.cxx:41
TGHtml::AddSelectOptions
void AddSelectOptions(TGListBox *lb, TGHtmlElement *p, TGHtmlElement *pEnd)
The "p" argument points to a <select>.
Definition: TGHtmlForm.cxx:303
TGHtml::fInnerList
TGHtmlListStart * fInnerList
Definition: TGHtml.h:1199
TGHtmlTextElement::fZText
char * fZText
Definition: TGHtml.h:300
TGHtmlImageMarkup
Definition: TGHtml.h:534
TGHtml::fLastInput
TGHtmlInput * fLastInput
Definition: TGHtml.h:1138
TGHtml::GetText
const char * GetText() const
Definition: TGHtml.h:961
TGHtmlMarkupElement
Definition: TGHtml.h:323
TGHtml::TokenByIndex
TGHtmlElement * TokenByIndex(int N, int flag)
Return a pointer to the Nth TGHtmlElement in the list.
Definition: TGHtmlIndex.cxx:48
TGHtml::GetLightShadowColor
int GetLightShadowColor(int iBgColor)
Given that the background color is iBgColor, figure out an appropriate color for the bright part of t...
Definition: TGHtml.cxx:1676
TGHtmlMarkupElement::fArgv
char ** fArgv
Definition: TGHtml.h:335
TGHtmlLayoutContext::fMaxY
int fMaxY
Definition: TGHtml.h:803
SHtmlStyle_t::fFlags
unsigned int fFlags
Definition: TGHtml.h:150
TGHtml::fZBase
const char * fZBase
Definition: TGHtml.h:1259
TGHtml::fLoFormStart
TGHtmlForm * fLoFormStart
Definition: TGHtml.h:1201
TGHtml::fParaAlignment
int fParaAlignment
Definition: TGHtml.h:1189
TGHtml::GetColorByValue
int GetColorByValue(ColorStruct_t *pRef)
Find a color integer for the color whose color components are given by pRef.
Definition: TGHtml.cxx:1709
TGHtml::fInTr
int fInTr
Definition: TGHtml.h:1193
TGHtml::UpdateBackgroundStart
virtual void UpdateBackgroundStart()
Start background update.
Definition: TGHtml.cxx:239
TGHtmlInput::fPadLeft
Html_u8_t fPadLeft
Definition: TGHtml.h:598
TGHtmlImage::fImage
TImage * fImage
Definition: TGHtml.h:518
TGHtml::DrawRect
void DrawRect(Drawable_t drawable, TGHtmlElement *src, int x, int y, int w, int h, int depth, int relief)
Draw a rectangle.
Definition: TGHtmlDraw.cxx:266
TGHtmlInput::fW
Html_u16_t fW
Definition: TGHtml.h:597
y
Double_t y[n]
Definition: legend1.C:17
TGHtmlScript::fNStart
int fNStart
Definition: TGHtml.h:683
TGHtmlTextElement
Definition: TGHtml.h:285
TGHtmlLayoutContext::fHtml
TGHtml * fHtml
Definition: TGHtml.h:794
TGHtml::TGHtml
TGHtml(const TGWindow *p, int w, int h, int id=-1)
HTML Widget constructor.
Definition: TGHtml.cxx:74
TGHtmlLayoutContext::InWrapAround
int InWrapAround()
Return TRUE (non-zero) if we are currently wrapping text around one or more images.
Definition: TGHtmlLayout.cxx:1046
TGHtml::fSelectionColor
ColorStruct_t * fSelectionColor
Definition: TGHtml.h:1232
TGHtmlImageMarkup::fPImage
TGHtmlImage * fPImage
Definition: TGHtml.h:551
TGHtml::InArea
int InArea(TGHtmlMapArea *p, int left, int top, int x, int y)
Only support rect and circles for now.
Definition: TGHtml.cxx:1516
TGHtml::ImageChanged
void ImageChanged(TGHtmlImage *image, int newWidth, int newHeight)
This routine is called when an image changes.
Definition: TGHtmlImage.cxx:127
TGHtmlForm::fPFirst
TGHtmlElement * fPFirst
Definition: TGHtml.h:641
TGHtml::fIdind
int fIdind
Definition: TGHtml.h:1270
TGHtmlHr::fH
Html_u16_t fH
Definition: TGHtml.h:655
SHtmlTokenMap_t::fZName
const char * fZName
Definition: TGHtml.h:840
TGHtml::fPSelStartBlock
TGHtmlBlock * fPSelStartBlock
Definition: TGHtml.h:1150
TGHtml::fExiting
int fExiting
Definition: TGHtml.h:1279
TGHtml::IsLightColor
int IsLightColor(ColorStruct_t *p)
Check to see if the given color is too light to be easily distinguished from white.
Definition: TGHtml.cxx:1667
TGHtmlTextElement::operator=
TGHtmlTextElement & operator=(const TGHtmlTextElement &)
TGHtml::fHasFrames
int fHasFrames
Definition: TGHtml.h:1244
TGHtmlMarkupElement::GetUnorderedListType
virtual int GetUnorderedListType(int dflt)
The "type" argument to the given element might describe a type for an unordered list.
Definition: TGHtmlElement.cxx:196
TGHtml::fLastBlock
TGHtmlBlock * fLastBlock
Definition: TGHtml.h:1136
TGHtml::GetMap
TGHtmlElement * GetMap(const char *name)
Returns html map element.
Definition: TGHtml.cxx:1535
TGHtmlInput::fPForm
TGHtmlForm * fPForm
Definition: TGHtml.h:588
TGHtml::fRulePadding
int fRulePadding
Definition: TGHtml.h:1258
TGHtmlElement::GetUnorderedListType
virtual int GetUnorderedListType(int dflt)
Definition: TGHtml.h:257
TGHtml::fNComplete
int fNComplete
Definition: TGHtml.h:1171
TGHtml::HandleButton
virtual Bool_t HandleButton(Event_t *event)
Handle mouse button event.
Definition: TGHtml.cxx:1336
TGHtmlCell::fX
Html_16_t fX
Definition: TGHtml.h:388
TGHtml::FillOutBlock
TGHtmlElement * FillOutBlock(TGHtmlBlock *p)
Recompute the following fields of the given block structure:
Definition: TGHtmlDraw.cxx:617
TGHtmlTokens.h
TGHtmlElement::TGHtmlElement
TGHtmlElement(int etype=0)
HTML element constructor.
Definition: TGHtmlElement.cxx:48
TGHtml::Tokenize
int Tokenize()
Process as much of the input HTML as possible.
Definition: TGHtmlParse.cxx:563
unsigned int
TGHtmlInput::fTextAscent
Html_u8_t fTextAscent
Definition: TGHtml.h:600
TGHtmlTextElement::fSpaceWidth
Html_u8_t fSpaceWidth
Definition: TGHtml.h:299
TGHtml::fNAlloc
int fNAlloc
Definition: TGHtml.h:1170
TGHtml::fMaxY
int fMaxY
Definition: TGHtml.h:1262
TGHtmlCell::fY
Html_32_t fY
Definition: TGHtml.h:390
TGHtmlElement::fCount
Html_16_t fCount
Definition: TGHtml.h:266
TGHtml::fNToken
int fNToken
Definition: TGHtml.h:1130
TGHtmlTable::fW
Html_16_t fW
Definition: TGHtml.h:365
TGHtmlBlock::~TGHtmlBlock
virtual ~TGHtmlBlock()
dtor.
Definition: TGHtmlDraw.cxx:60
TGHtmlBlock::fBottom
int fBottom
Definition: TGHtml.h:717
TGHtml::ColorDistance
float ColorDistance(ColorStruct_t *pA, ColorStruct_t *pB)
Compute the squared distance between two colors.
Definition: TGHtml.cxx:1555
TGHtml::StringHW
void StringHW(const char *str, int *h, int *w)
Return the height and width of string.
Definition: TGHtmlTable.cxx:77
SHtmlMargin_t::fTag
int fTag
Definition: TGHtml.h:745
TGHtmlImageMarkup::fZAlt
const char * fZAlt
Definition: TGHtml.h:550
SHtmlStyle_t
Definition: TGHtml.h:143
TGHtmlInput::fTextDescent
Html_u8_t fTextDescent
Definition: TGHtml.h:601
TGHtml::FormCreate
virtual int FormCreate(TGHtmlForm *, const char *, const char *)
Definition: TGHtml.h:945
TGHtml::fMaxX
int fMaxX
Definition: TGHtml.h:1262
TGHtml::fNText
int fNText
Definition: TGHtml.h:1169
TGHtml::Redraw
void Redraw()
This routine is invoked in order to redraw all or part of the HTML widget.
Definition: TGHtml.cxx:533
TGHtml::fIDark
int fIDark[N_COLOR]
Definition: TGHtml.h:1226
TGHtml::fDirtyTop
int fDirtyTop
Definition: TGHtml.h:1265
TGHtml::fInsOnTime
int fInsOnTime
Definition: TGHtml.h:1158
TGHtml::GetRuleRelief
int GetRuleRelief() const
Definition: TGHtml.h:900
TGHtml::MakeInvisible
void MakeInvisible(TGHtmlElement *p_first, TGHtmlElement *p_last)
Add the STY_Invisible style to every token between p_first and p_last.
Definition: TGHtmlSizer.cxx:144
TGHtml::fFgColor
ColorStruct_t * fFgColor
Definition: TGHtml.h:1229
TGHtmlHr::TGHtmlHr
TGHtmlHr(int type, int argc, int arglen[], char *argv[])
HTML hr element constructor.
Definition: TGHtmlElement.cxx:343
TGHtml::fInsOffTime
int fInsOffTime
Definition: TGHtml.h:1159
TGHtmlLayoutContext::fRight
int fRight
Definition: TGHtml.h:800
TGHtml::ProcessMessage
virtual Bool_t ProcessMessage(Long_t, Long_t, Long_t)
Process messages (GUI events) in the html widget.
Definition: TGHtmlForm.cxx:670
TGHtmlInput::fFrame
TGFrame * fFrame
Definition: TGHtml.h:590
TGHtmlScript::fNScript
int fNScript
Definition: TGHtml.h:684
TGHtml::ResolveUri
virtual char * ResolveUri(const char *uri)
This function resolves the specified URI and returns the result in a newly allocated string.
Definition: TGHtmlUri.cxx:307
TGHtml::MoveVertically
void MoveVertically(TGHtmlElement *p, TGHtmlElement *pLast, int dy)
Move all elements in the given list vertically by the amount dy.
Definition: TGHtmlTable.cxx:1542
TGHtml::fStyleStack
SHtmlStyleStack_t * fStyleStack
Definition: TGHtml.h:1188
TGHtmlCell::fColspan
Html_16_t fColspan
Definition: TGHtml.h:387
TGHtml::fDirtyRight
int fDirtyRight
Definition: TGHtml.h:1268
SHtmlTokenMap_t
Definition: TGHtml.h:839
TGHtmlMarkupElement::GetAlignment
virtual int GetAlignment(int dflt)
Return an alignment or justification flag associated with the given markup.
Definition: TGHtmlElement.cxx:150
TGHtmlImage::fPNext
TGHtmlImage * fPNext
Definition: TGHtml.h:523
TGHtml::FormCount
int FormCount(TGHtmlInput *p, int radio)
Return the number of elments of type p in a form.
Definition: TGHtmlForm.cxx:543
TGHtmlTextElement::fW
Html_16_t fW
Definition: TGHtml.h:296
TGHtml::PrintList
void PrintList(TGHtmlElement *first, TGHtmlElement *last)
Print a list of tokens.
Definition: TGHtmlParse.cxx:1524
TGHtmlImage::TGHtmlImage
TGHtmlImage(const TGHtmlImage &)
TGHtml::fInParse
int fInParse
Definition: TGHtml.h:1271
TGHtmlTable::fMinW
int fMinW[HTML_MAX_COLUMNS+1]
Definition: TGHtml.h:366
TGHtmlLayoutContext::ClearMarginStack
void ClearMarginStack(SHtmlMargin_t **ppMargin)
Clear a margin stack to reclaim memory.
Definition: TGHtmlLayout.cxx:165
TGHtmlForm::fHasctl
unsigned int fHasctl
Definition: TGHtml.h:640
TGHtml::ProcessFrame
virtual int ProcessFrame()
Definition: TGHtml.h:937
TGHtmlLayoutContext::FixLine
int FixLine(TGHtmlElement *pStart, TGHtmlElement *pEnd, int bottom, int width, int actualWidth, int leftMargin, int *maxX)
This routine computes the X and Y coordinates for all elements of a line that has been gathered using...
Definition: TGHtmlLayout.cxx:453
TGHtml::IndexToBlockIndex
void IndexToBlockIndex(SHtmlIndex_t sIndex, TGHtmlBlock **ppBlock, int *piIndex)
Convert an Element-based index into a Block-based index.
Definition: TGHtmlIndex.cxx:209
TGHtml::ClearGcCache
void ClearGcCache()
Clear the cache of GCs.
Definition: TGHtml.cxx:505
TGHtmlBlock::fLeft
Html_u16_t fLeft
Definition: TGHtml.h:718
TGHtml::ItemLayout
virtual Bool_t ItemLayout()
Layout html widget.
Definition: TGHtml.cxx:823
TGHtmlLayoutContext::Paragraph
void Paragraph(TGHtmlElement *p)
Increase the headroom to create a paragraph break at the current token.
Definition: TGHtmlLayout.cxx:659
TGHtml::FlashCursor
void FlashCursor()
Flash the insertion cursor.
Definition: TGHtml.cxx:1015
TGHtml::AppendBlock
void AppendBlock(TGHtmlElement *pToken, TGHtmlBlock *pBlock)
Append a block to the block list and insert the block into the element list immediately prior to the ...
Definition: TGHtmlDraw.cxx:93
TGHtmlTable::fPEnd
TGHtmlElement * fPEnd
Definition: TGHtml.h:368
TGHtml::fSelStartIndex
Html_16_t fSelStartIndex
Definition: TGHtml.h:1151
TGHtmlAnchor::fY
Html_32_t fY
Definition: TGHtml.h:667
TGHtml::ComputeVirtualSize
void ComputeVirtualSize()
Computes virtual size of html area.
Definition: TGHtml.cxx:497
TObject
Mother of all ROOT objects.
Definition: TObject.h:37
TGHtml::AddStyle
void AddStyle(TGHtmlElement *p)
This routine adds information to the input texts that doesn't change when the display is resized or w...
Definition: TGHtmlSizer.cxx:216
SHtmlMargin_t::fIndent
int fIndent
Definition: TGHtml.h:743
TGHtmlInput::Empty
void Empty()
Mark this element as being empty.
Definition: TGHtmlElement.cxx:424
ClassDef
#define ClassDef(name, id)
Definition: Rtypes.h:325
TGHtmlTable::~TGHtmlTable
~TGHtmlTable()
HTML table element destructor.
Definition: TGHtmlElement.cxx:235
TGHtml::fFirstInput
TGHtmlInput * fFirstInput
Definition: TGHtml.h:1137
TGHtmlInput::fH
Html_u16_t fH
Definition: TGHtml.h:597
Event_t
Definition: GuiTypes.h:173
TGHtml::GetHref
const char * GetHref(int x, int y, const char **target=0)
This routine searchs for a hyperlink beneath the coordinates x,y and returns a pointer to the HREF fo...
Definition: TGHtml.cxx:1773
TGHtml::fUnderlineLinks
int fUnderlineLinks
Definition: TGHtml.h:1242
name
char name[80]
Definition: TGX11.cxx:110
TGHtml::fExts
SHtmlExtensions_t * fExts
Definition: TGHtml.h:1274
TGHtml::GetMarginHeight
int GetMarginHeight()
Definition: TGHtml.h:964
TGHtml::LostSelection
void LostSelection()
Clear selection.
Definition: TGHtml.cxx:1969
TGHtmlImage::fW
Html_32_t fW
Definition: TGHtml.h:519
SHtmlStyleStack_t::fType
int fType
Definition: TGHtml.h:734
TGHtmlImage::~TGHtmlImage
virtual ~TGHtmlImage()
dtor.
Definition: TGHtmlImage.cxx:71
TGHtml::SetInsert
int SetInsert(const char *insIx)
Set the position of the insertion cursor.
Definition: TGHtml.cxx:2039
TGHtml::fZText
char * fZText
Definition: TGHtml.h:1168
TGHtmlLayoutContext
Definition: TGHtml.h:760
TGHtml::ParseText
int ParseText(char *text, const char *index=0)
Appends (or insert at the specified position) the given HTML text to the end of any HTML text that ma...
Definition: TGHtml.cxx:314
TGHtml::GetMarginWidth
int GetMarginWidth()
Definition: TGHtml.h:963
TGHtmlElement::GetAlignment
virtual int GetAlignment(int dflt)
Definition: TGHtml.h:255
d
#define d(i)
Definition: RSha256.hxx:102
TGHtml::RedrawText
void RedrawText(int y)
Call this routine to cause all of the rendered HTML at the virtual canvas coordinate of Y and beyond ...
Definition: TGHtml.cxx:876
TGHtml::fZGoto
char * fZGoto
Definition: TGHtml.h:1272
TGHtml::SetBaseUri
void SetBaseUri(const char *uri)
Sets base URI.
Definition: TGHtml.cxx:440
TGHtmlHr
Definition: TGHtml.h:648
TGHtml::ProcessToken
virtual int ProcessToken(TGHtmlElement *, const char *, int)
Definition: TGHtml.h:927
TGHtml::fInsStatus
int fInsStatus
Definition: TGHtml.h:1160
TGHtmlElement::GetVerticalAlignment
virtual int GetVerticalAlignment(int dflt)
Definition: TGHtml.h:258
TGHtmlSpaceElement::TGHtmlSpaceElement
TGHtmlSpaceElement()
Definition: TGHtml.h:313
TGHtml::MinMax
TGHtmlElement * MinMax(TGHtmlElement *p, int *pMin, int *pMax, int lineWidth, int hasbg)
Given a list of elements, compute the minimum and maximum width needed to render the list.
Definition: TGHtmlTable.cxx:878
TGHtml::fDirtyBottom
int fDirtyBottom
Definition: TGHtml.h:1268
TGHtml::ResetLayoutContext
void ResetLayoutContext()
Reset the main layout context in the main widget.
Definition: TGHtml.cxx:522
TGHtml::FindIndexInBlock
void FindIndexInBlock(TGHtmlBlock *pBlock, int x, TGHtmlElement **ppToken, int *pIndex)
Given a Block and an x coordinate, find the Index of the character that is closest to the given x coo...
Definition: TGHtmlIndex.cxx:132
TGHtmlLayoutContext::PopOneMargin
void PopOneMargin(SHtmlMargin_t **ppMargin)
Pop one margin off of the given margin stack.
Definition: TGHtmlLayout.cxx:99
TGHtml::BlockDraw
void BlockDraw(TGHtmlBlock *pBlock, Drawable_t wid, int left, int top, int width, int height, Pixmap_t pixmap)
Display a single HtmlBlock. This is where all the drawing happens.
Definition: TGHtmlDraw.cxx:317
TGHtmlForm::fElements
unsigned int fElements
Definition: TGHtml.h:639
TGHtml::fVarind
int fVarind
Definition: TGHtml.h:1247
TGHtmlImage::fH
Html_32_t fH
Definition: TGHtml.h:520
SHtmlStyleStack_t
Definition: TGHtml.h:732
TGHtml::NameToType
int NameToType(char *zType)
Convert a markup name into a type integer.
Definition: TGHtmlParse.cxx:1317
TGHtml::fRuleRelief
int fRuleRelief
Definition: TGHtml.h:1257
TGHtml::IsVisited
virtual int IsVisited(const char *)
Definition: TGHtml.h:923
TGHtmlInput::fItype
Html_u8_t fItype
Definition: TGHtml.h:602
TGHtml::fInsTimer
TTimer * fInsTimer
Definition: TGHtml.h:1161
TGHtml::fBgImage
TImage * fBgImage
Definition: TGHtml.h:1237
TGHtmlElement::fElId
int fElId
Definition: TGHtml.h:267
type
int type
Definition: TGX11.cxx:121
TGHtmlSpaceElement::fDescent
Html_u8_t fDescent
Definition: TGHtml.h:310
TGHtml::GetBaseUri
const char * GetBaseUri() const
Definition: TGHtml.h:906
TGHtml::UpdateSelection
void UpdateSelection(int forceUpdate)
Given the selection end-points in fSelBegin and fSelEnd, recompute pSelBeginBlock and fPSelEndBlock,...
Definition: TGHtml.cxx:1870
TGFont
Definition: TGFont.h:149
TGHtmlForm
Definition: TGHtml.h:633
TGHtml::SubmitClicked
virtual void SubmitClicked(const char *val)
Emit SubmitClicked() signal.
Definition: TGHtml.cxx:1328
TGHtmlInput::fINext
TGHtmlInput * fINext
Definition: TGHtml.h:589
TGHtmlInput::fHtml
TGHtml * fHtml
Definition: TGHtml.h:591
TGHtml::AttrElem
TGHtmlElement * AttrElem(const char *name, char *value)
Returns html element matching attribute name and value.
Definition: TGHtml.cxx:1849
TGHtml::GetColorByName
int GetColorByName(const char *zColor)
This routine returns an index between 0 and N_COLOR-1 which indicates which ColorStruct_t structure i...
Definition: TGHtml.cxx:1571
TGHtmlImage::fHtml
TGHtml * fHtml
Definition: TGHtml.h:517
TGHtmlListStart::fLPrev
TGHtmlListStart * fLPrev
Definition: TGHtml.h:459
TGHtml::~TGHtml
virtual ~TGHtml()
HTML widget destructor.
Definition: TGHtml.cxx:221
TGHtmlImageMarkup::fPMap
TGHtmlElement * fPMap
Definition: TGHtml.h:552
TGHtmlLi::fCnt
Html_16_t fCnt
Definition: TGHtml.h:426
TGHtmlMapArea
Definition: TGHtml.h:467
TGHtmlImageMarkup::TGHtmlImageMarkup
TGHtmlImageMarkup(int type, int argc, int arglen[], char *argv[])
HTML image element constructor.
Definition: TGHtmlElement.cxx:310
TGHtml::GetImage
TGHtmlImage * GetImage(TGHtmlImageMarkup *p)
Given an.
Definition: TGHtmlImage.cxx:162
TGHtml::AnimateImage
void AnimateImage(TGHtmlImage *image)
TGImage *img = image->image;.
Definition: TGHtmlDraw.cxx:591
TGHtml::fVarId
int fVarId
Definition: TGHtml.h:1141
TGHtmlListStart::fLtype
Html_u8_t fLtype
Definition: TGHtml.h:455
TGHtmlMarkupElement::TGHtmlMarkupElement
TGHtmlMarkupElement(int type, int argc, int arglen[], char *argv[])
HTML mrkup element constructor.
Definition: TGHtmlElement.cxx:88
SHtmlExtensions_t::fNext
SHtmlExtensions_t * fNext
Definition: TGHtml.h:486
Html_32_t
int Html_32_t
Definition: TGHtml.h:138
TGHtmlTextElement::TGHtmlTextElement
TGHtmlTextElement(const TGHtmlTextElement &)
TGHtmlLayoutContext::TableLayout
TGHtmlElement * TableLayout(TGHtmlTable *p)
Do all layout for a single table.
Definition: TGHtmlTable.cxx:1118
TGHtmlListStart::TGHtmlListStart
TGHtmlListStart(int type, int argc, int arglen[], char *argv[])
HTML list start element constructor.
Definition: TGHtmlElement.cxx:297
TGHtmlLayoutContext::fHeadRoom
int fHeadRoom
Definition: TGHtml.h:797
TGString
Definition: TGString.h:30
TGHtmlLi::fX
Html_16_t fX
Definition: TGHtml.h:427
TGHtmlRef::fBgImage
TImage * fBgImage
Definition: TGHtml.h:411
TGHtml::MouseOver
virtual void MouseOver(const char *uri)
Definition: TGHtml.h:1115
TGHtml::RadioChanged
virtual void RadioChanged(const char *name, const char *val)
Emit RadioChanged() signal.
Definition: TGHtml.cxx:1302
TGHtmlListStart
Definition: TGHtml.h:450
TGClient
Definition: TGClient.h:46
TGHtml::DecodeBaseIndex
int DecodeBaseIndex(const char *zBase, TGHtmlElement **ppToken, int *pIndex)
Given a base index name (without any modifiers) return a pointer to the token described,...
Definition: TGHtmlIndex.cxx:342
TGHtmlMapArea::TGHtmlMapArea
TGHtmlMapArea(int type, int argc, int arglen[], char *argv[])
HTML map area constructor.
Definition: TGHtmlElement.cxx:372
TGHtml::fAFont
TGFont * fAFont[N_FONT]
Definition: TGHtml.h:1219
TGHtml::AddFormInfo
void AddFormInfo(TGHtmlElement *p)
Add the DOM control information for form elements.
Definition: TGHtmlForm.cxx:565
TGHtmlElement::MarkupArg
virtual const char * MarkupArg(const char *, const char *)
Definition: TGHtml.h:254
Html_Space
@ Html_Space
Definition: TGHtmlTokens.h:43
TGHtml::fFontValid
char fFontValid[(N_FONT+7)/8]
Definition: TGHtml.h:1220
TGView
Definition: TGView.h:43
TGHtmlImage::fZUrl
char * fZUrl
Definition: TGHtml.h:521
TGHtml::fAddEndTags
int fAddEndTags
Definition: TGHtml.h:1245
TGHtmlBlock
Definition: TGHtml.h:710
SHtmlStyle_t::fAlign
unsigned int fAlign
Definition: TGHtml.h:147
TGHtmlTextElement::fY
Html_32_t fY
Definition: TGHtml.h:294
TQObject::Emit
void Emit(const char *signal, const T &arg)
Activate signal with single parameter.
Definition: TQObject.h:164
TGHtmlInput::fPEnd
TGHtmlElement * fPEnd
Definition: TGHtml.h:592
TGHtmlTable::TGHtmlTable
TGHtmlTable(int type, int argc, int arglen[], char *argv[])
HTML table element constructor.
Definition: TGHtmlElement.cxx:217
TGHtml::GetImageAlignment
int GetImageAlignment(TGHtmlElement *p)
Find the alignment for an image.
Definition: TGHtmlImage.cxx:84
TGHtml::GetUid
const char * GetUid(const char *string)
Given a string, this procedure returns a unique identifier for the string.
Definition: TGHtml.cxx:479
TGHtmlInput::TGHtmlInput
TGHtmlInput(int type, int argc, int arglen[], char *argv[])
HTML input element constructor.
Definition: TGHtmlElement.cxx:398
TGHtmlListStart::fCnt
Html_u16_t fCnt
Definition: TGHtml.h:457
TGHtmlImage::fZHeight
char * fZHeight
Definition: TGHtml.h:522
TGHtmlTextElement::fDescent
Html_u8_t fDescent
Definition: TGHtml.h:298
int
TGHtml::fPFirst
TGHtmlElement * fPFirst
Definition: TGHtml.h:1128
TGHtml::AppToken
void AppToken(TGHtmlElement *pNew, TGHtmlElement *p, int offs)
Insert token pNew before token p.
Definition: TGHtmlParse.cxx:496
TGHtml::fNInput
int fNInput
Definition: TGHtml.h:1139
TGHtml::UpdateInsert
void UpdateInsert()
Recompute the position of the insertion cursor based on the position in fIns.
Definition: TGHtml.cxx:2026
TGHtmlImage::fPList
TGHtmlImageMarkup * fPList
Definition: TGHtml.h:524
TGHtml::fHighlightBgColorPtr
ColorStruct_t * fHighlightBgColorPtr
Definition: TGHtml.h:1216