96 pBlock->
fBPrev = fLastBlock;
99 fLastBlock->
fBNext = pBlock;
101 fFirstBlock = pBlock;
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++) {
193 while (index >= values[j].value) {
194 for (k = 0; values[j].name[k]; k++) {
195 zBuf[i++] = values[j].name[k];
197 index -= values[j].value;
202 for (i = 0; zBuf[i]; i++) {
203 zBuf[i] +=
'A' -
'a';
226 xLeft = pBlock->
fLeft -
x;
227 if (pBlock == fPSelStartBlock && fSelStartIndex > 0) {
228 if (fSelStartIndex >= pBlock->
fN)
return;
231 if (font == 0)
return;
234 xLeft = tp->
fX - x + font->
TextWidth(pBlock->
fZ, fSelStartIndex);
238 if (pBlock == fPSelEndBlock && fSelEndIndex < pBlock->
fN) {
242 if (font == 0)
return;
246 xRight = tp->
fX - x + font->
TextWidth(pBlock->
fZ, fSelEndIndex);
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) {
346 DrawSelectionBackground(pBlock, drawable, drawableLeft, drawableTop);
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);
364 if (pBlock == fPInsBlock && fInsStatus > 0) {
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);
446 int relief = fRuleRelief;
455 DrawRect(drawable, src, hr->
fX - drawableLeft, hr->
fY - drawableTop,
456 hr->
fW, hr->
fH, 1, relief);
462 int relief = fTableRelief;
473 DrawRect(drawable, src, table->
fX - drawableLeft,
474 table->
fY - drawableTop, table->
fW, table->
fH,
479 DrawTableBgnd(table->
fX, table->
fY, table->
fW, table->
fH, pixmap,
493 switch (fTableRelief) {
498 DrawRect(drawable, src,
499 cell->
fX - drawableLeft, cell->
fY - drawableTop,
500 cell->
fW, cell->
fH, depth, relief);
504 DrawTableBgnd(cell->
fX, cell->
fY, cell->
fW, cell->
fH, pixmap,
507 DrawTableBgnd(cell->
fX, cell->
fY, cell->
fW, cell->
fH, pixmap, bgImg);
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;
835 pElem = FillOutBlock(fLastBlock);
841 pElem = FindStartOfNextBlock(pElem, &cnt);
845 fLastBlock->fCount +=
cnt;
847 AppendBlock(pElem, pNew);
848 pElem = FillOutBlock(pNew);
860 int dl, dt, dr, db, left, top, right, bottom;
862 left = l - fVisible.fX;
863 top = t - fVisible.fY;
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);
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.
virtual UInt_t GetHeight() const
virtual UInt_t GetWidth() const
static void GetRomanIndex(char *zBuf, int index, int isUpper)
Print an ordered list index into the given buffer.
void DrawTableBgnd(int x, int y, int w, int h, Drawable_t d, TImage *image)
Draw table background.
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.
Int_t TextWidth(const char *string, Int_t numChars=-1) const
A wrapper function for the more complicated interface of MeasureChars.
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.
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 ...
void AnimateImage(TGHtmlImage *image)
TGImage *img = image->image;.
TGHtmlElement * FindStartOfNextBlock(TGHtmlElement *p, int *pCnt)
Scan ahead looking for a place to put a block.
#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...
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.
#define LI_TYPE_Undefined