124 if (index < 1 || index > 52) {
126 sprintf(zBuf,
"%d", index);
139 zBuf[0] = seed + index;
143 zBuf[0] = seed + index;
144 zBuf[1] = seed + index;
186 if (index < 1 || index >= 5000) {
188 sprintf(zBuf,
"%d", index);
191 for (j = 0; index > 0 && j <
sizeof(
values)/
sizeof(
values[0]); j++) {
194 for (k = 0;
values[j].name[k]; k++) {
195 zBuf[i++] =
values[j].name[k];
202 for (i = 0; zBuf[i]; i++) {
203 zBuf[i] +=
'A' -
'a';
226 xLeft = pBlock->
fLeft -
x;
231 if (font == 0)
return;
242 if (font == 0)
return;
249 yTop = pBlock->
fTop -
y;
254 UInt_t width = xRight - xLeft;
255 UInt_t height = yBottom - yTop;
256 gVirtualX->FillRectangle(drawable, gc, xx, yy, width, height);
266 int x,
int y,
int w,
int h,
int depth,
int relief)
294 gVirtualX->FillRectangle(drawable, gcLight, xx, yy, width, height);
296 gVirtualX->FillRectangle(drawable, gcLight, xx, yy, width, height);
297 for (i = 0; i < depth && i < h/2; i++) {
298 gVirtualX->DrawLine(drawable, gcLight, x+i, y+i, x+w-i-1, y+i);
299 gVirtualX->DrawLine(drawable, gcDark, x+i, y+h-i-1, x+w-i-1, y+h-i-1);
302 if (h > depth*2 && w > depth*2) {
308 height = h - depth*2;
309 gVirtualX->FillRectangle(drawable, gcBg, xx, yy, width, height);
317 int drawableLeft,
int drawableTop,
318 int drawableWidth,
int drawableHeight,
328 if (pBlock == 0)
return;
333 if (src == 0)
return;
335 if (pBlock->
fN > 0) {
350 if (font == 0)
return;
352 x - drawableLeft, y - drawableTop);
355 x - drawableLeft, y-drawableTop, 0, pBlock->
fN);
358 x = pBlock->
fLeft - drawableLeft;
359 y = (pBlock->
fTop + pBlock->
fBottom) / 2 - drawableTop;
361 height = 1 + (pBlock->
fBottom - pBlock->
fTop > 15);
362 gVirtualX->FillRectangle(drawable, gc, x, y, width, height);
365 if (fInsIndex < pBlock->fN) {
367 x = tsrc->
fX - drawableLeft;
370 x = pBlock->
fRight - drawableLeft;
373 gVirtualX->FillRectangle(drawable, gc, x, pBlock->
fTop - drawableTop,
383 switch (src->
fType) {
391 sprintf(zBuf,
"%d.", li->
fCnt);
425 gVirtualX->DrawRectangle(drawable, gc, x - 7 - drawableLeft,
426 y - 8 - drawableTop, 7, 7);
436 if (font == 0)
return;
439 x - w - drawableLeft, y - drawableTop);
455 DrawRect(drawable, src, hr->
fX - drawableLeft, hr->
fY - drawableTop,
456 hr->
fW, hr->
fH, 1, relief);
473 DrawRect(drawable, src, table->
fX - drawableLeft,
474 table->
fY - drawableTop, table->
fW, table->
fH,
499 cell->
fX - drawableLeft, cell->
fY - drawableTop,
500 cell->
fW, cell->
fH, depth, relief);
515 DrawImage(image, drawable, drawableLeft, drawableTop,
516 drawableLeft + drawableWidth,
517 drawableTop + drawableHeight);
518 }
else if (image->
fZAlt) {
521 if (font == 0)
return;
524 image->
fX - drawableLeft,
525 image->
fY - drawableTop);
539 int drawableLeft,
int drawableTop,
540 int drawableRight,
int drawableBottom)
548 y = imageTop - drawableTop;
549 if (imageTop + image->
fH > drawableBottom) {
550 imageH = drawableBottom - imageTop;
561 x = image->
fX - drawableLeft;
562 if (image->
fX + image->
fW > drawableRight) {
563 imageW = drawableRight - image->
fX;
577 imageH = imageH < 0 ? -imageH : imageH;
578 imageW = imageW < 0 ? -imageW : imageW;
580 img->
PaintImage(drawable, x, y, imageX, imageY, imageW, imageH);
626 if (p->
fN) p->
fN = 0;
628 if (p->
fZ)
delete[] p->
fZ;
644 if (pElem == 0)
return 0;
649 switch (pElem->
fType) {
714 switch (pElem->
fType) {
732 int nSpace = (txt->
fX -
x) / sw;
733 if (nSpace * sw + x != txt->
fX) {
735 }
else if ((n + nSpace + pElem->
fCount) >= (int)
sizeof(zBuf)) {
737 for (i = 0; i < nSpace && (n+1) < (
int)
sizeof(zBuf); ++i) {
740 strncpy(&zBuf[n], txt->
fZText,
sizeof(zBuf) - n - 1);
741 zBuf[
sizeof(zBuf)-1] = 0;
743 x = txt->
fX + txt->
fW;
745 for (i = 0; i < nSpace && (n+1) < (
int)
sizeof(zBuf); ++i) {
748 strncpy(&zBuf[n], txt->
fZText,
sizeof(zBuf) - n - 1);
749 zBuf[
sizeof(zBuf)-1] = 0;
751 x = txt->
fX + txt->
fW;
787 while (n > 0 && zBuf[n-1] ==
' ') n--;
788 p->
fZ =
new char[n+1];
789 strlcpy(p->
fZ, zBuf, n+1);
818 if (pCnt) *pCnt =
cnt;
860 int dl, dt,
dr, db, left, top, right, bottom;
870 right = left + w - 1;
871 bottom = top + h - 1;
872 if (dr == 0 && db == 0) { dr = right; db = bottom; }
873 if (left > dr || right < dl || top > db || bottom < dt)
return;
878 if (iw < 4 && ih < 4)
return;
879 sx = (left + _visibleStart.x) % iw;
881 for (mx = left - dl; w > 0; mx += sw, sw = iw, sx = 0) {
883 sy = (top + _visibleStart.y) % ih;
885 for (my = top - dt, hd = h; hd > 0; my += sh, sh = ih, sy = 0) {
886 if (sh > hd) sh = hd;
888 image->
Draw(pixmap,
GetAnyGC(), sx, sy, sw, sh, mx, my);
905 gVirtualX->FillRectangle(pixmap, gc, left - dl, top - dt, w, h);
TGHtmlBlock * fPSelStartBlock
void UnderlineChars(Drawable_t dst, GContext_t gc, const char *string, Int_t x, Int_t y, Int_t firstChar, Int_t lastChar) const
This procedure draws an underline for a given range of characters in a given string.
void DrawChars(Drawable_t dst, GContext_t gc, const char *source, Int_t numChars, Int_t x, Int_t y) const
Perform a quick sanity check to ensure we won't overflow the X coordinate space.
TGHtmlBlock * fPSelEndBlock
static void GetRomanIndex(char *zBuf, int index, int isUpper)
Print an ordered list index into the given buffer.
std::vector< double > values
void DrawTableBgnd(int x, int y, int w, int h, Drawable_t d, TImage *image)
Draw table background.
virtual UInt_t GetWidth() const
TGHtmlBlock * fFirstBlock
virtual TGFont * GetFont(int iFont)
The rendering and layout routines should call this routine in order to get a font structure...
virtual void Draw(Option_t *option="")
Default Draw method for all objects.
An abstract interface to image processing library.
virtual Pixmap_t GetPixmap()
void DrawSelectionBackground(TGHtmlBlock *pBlock, Drawable_t Drawable_t, int x, int y)
Draw the selection background for the given block.
void DrawRect(Drawable_t drawable, TGHtmlElement *src, int x, int y, int w, int h, int depth, int relief)
Draw a rectangle.
TGHtmlElement * FillOutBlock(TGHtmlBlock *p)
Recompute the following fields of the given block structure:
static void GetLetterIndex(char *zBuf, int index, int isUpper)
Print an ordered list index into the given buffer.
GContext_t GetAnyGC()
Retrieve any valid GC.
void UnlinkAndFreeBlock(TGHtmlBlock *pBlock)
Destroy the given Block after first unlinking it from the element list.
void DrawImage(TGHtmlImageMarkup *image, Drawable_t wid, int left, int top, int right, int bottom)
Draw all or part of an image.
virtual UInt_t GetHeight() const
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.
virtual void PaintImage(Drawable_t, Int_t, Int_t, Int_t=0, Int_t=0, UInt_t=0, UInt_t=0, Option_t *="")
#define HTML_RELIEF_SUNKEN
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 ...
int GetDarkShadowColor(int iBgColor)
Given that the background color is iBgColor, figure out an appropriate color for the dark part of a 3...
void AnimateImage(TGHtmlImage *image)
TGImage *img = image->image;.
TGHtmlElement * FindStartOfNextBlock(TGHtmlElement *p, int *pCnt)
Scan ahead looking for a place to put a block.
GContext_t GetGC(int color, int font)
Return a GC from the cache.
Int_t TextWidth(const char *string, Int_t numChars=-1) const
A wrapper function for the more complicated interface of MeasureChars.
int GetLightShadowColor(int iBgColor)
Given that the background color is iBgColor, figure out an appropriate color for the bright part of t...
#define HTML_RELIEF_RAISED
virtual ~TGHtmlBlock()
dtor.
void FormBlocks()
Add additional blocks to the block list in order to cover all elements on the element list...
#define LI_TYPE_Undefined
const char Int_t const char * image