125 if (index < 1 || index > 52) {
127 sprintf(zBuf,
"%d", index);
140 zBuf[0] = seed + index;
144 zBuf[0] = seed + index;
145 zBuf[1] = seed + index;
187 if (index < 1 || index >= 5000) {
189 sprintf(zBuf,
"%d", index);
192 for (j = 0; index > 0 && j <
sizeof(values)/
sizeof(values[0]); j++) {
194 while (index >= values[j].value) {
195 for (k = 0; values[j].name[k]; k++) {
196 zBuf[i++] = values[j].name[k];
198 index -= values[j].value;
203 for (i = 0; zBuf[i]; i++) {
204 zBuf[i] +=
'A' -
'a';
227 xLeft = pBlock->
fLeft -
x;
232 if (font == 0)
return;
243 if (font == 0)
return;
250 yTop = pBlock->
fTop -
y;
256 UInt_t height = yBottom - yTop;
267 int x,
int y,
int w,
int h,
int depth,
int relief)
295 gVirtualX->FillRectangle(drawable, gcLight, xx, yy,
width, height);
297 gVirtualX->FillRectangle(drawable, gcLight, xx, yy,
width, height);
298 for (i = 0; i < depth && i <
h/2; i++) {
299 gVirtualX->DrawLine(drawable, gcLight,
x+i,
y+i,
x+w-i-1,
y+i);
303 if (
h > depth*2 && w > depth*2) {
309 height =
h - depth*2;
318 int drawableLeft,
int drawableTop,
319 int drawableWidth,
int drawableHeight,
329 if (pBlock == 0)
return;
334 if (src == 0)
return;
336 if (pBlock->
fN > 0) {
351 if (font == 0)
return;
353 x - drawableLeft,
y - drawableTop);
356 x - drawableLeft,
y-drawableTop, 0, pBlock->
fN);
359 x = pBlock->
fLeft - drawableLeft;
362 height = 1 + (pBlock->
fBottom - pBlock->
fTop > 15);
366 if (fInsIndex < pBlock->fN) {
368 x = tsrc->
fX - drawableLeft;
371 x = pBlock->
fRight - drawableLeft;
374 gVirtualX->FillRectangle(drawable, gc,
x, pBlock->
fTop - drawableTop,
384 switch (src->
fType) {
392 sprintf(zBuf,
"%d.", li->
fCnt);
426 gVirtualX->DrawRectangle(drawable, gc,
x - 7 - drawableLeft,
427 y - 8 - drawableTop, 7, 7);
437 if (font == 0)
return;
440 x - w - drawableLeft,
y - drawableTop);
456 DrawRect(drawable, src, hr->
fX - drawableLeft, hr->
fY - drawableTop,
457 hr->
fW, hr->
fH, 1, relief);
474 DrawRect(drawable, src, table->
fX - drawableLeft,
475 table->
fY - drawableTop, table->
fW, table->
fH,
500 cell->
fX - drawableLeft, cell->
fY - drawableTop,
501 cell->
fW, cell->
fH, depth, relief);
516 DrawImage(image, drawable, drawableLeft, drawableTop,
517 drawableLeft + drawableWidth,
518 drawableTop + drawableHeight);
519 }
else if (image->
fZAlt) {
522 if (font == 0)
return;
525 image->
fX - drawableLeft,
526 image->
fY - drawableTop);
540 int drawableLeft,
int drawableTop,
541 int drawableRight,
int drawableBottom)
549 y = imageTop - drawableTop;
550 if (imageTop + image->
fH > drawableBottom) {
551 imageH = drawableBottom - imageTop;
562 x = image->
fX - drawableLeft;
563 if (image->
fX + image->
fW > drawableRight) {
564 imageW = drawableRight - image->
fX;
578 imageH = imageH < 0 ? -imageH : imageH;
579 imageW = imageW < 0 ? -imageW : imageW;
581 img->
PaintImage(drawable,
x,
y, imageX, imageY, imageW, imageH);
627 if (p->
fN) p->
fN = 0;
629 if (p->
fZ)
delete[] p->
fZ;
645 if (pElem == 0)
return 0;
650 switch (pElem->
fType) {
715 switch (pElem->
fType) {
733 int nSpace = (txt->
fX -
x) / sw;
734 if (nSpace * sw +
x != txt->
fX) {
736 }
else if ((
n + nSpace + pElem->
fCount) >= (
int)
sizeof(zBuf)) {
738 for (i = 0; i < nSpace && (
n+1) < (
int)
sizeof(zBuf); ++i) {
741 strncpy(&zBuf[
n], txt->
fZText,
sizeof(zBuf) -
n - 1);
742 zBuf[
sizeof(zBuf)-1] = 0;
744 x = txt->
fX + txt->
fW;
746 for (i = 0; i < nSpace && (
n+1) < (
int)
sizeof(zBuf); ++i) {
749 strncpy(&zBuf[
n], txt->
fZText,
sizeof(zBuf) -
n - 1);
750 zBuf[
sizeof(zBuf)-1] = 0;
752 x = txt->
fX + txt->
fW;
788 while (
n > 0 && zBuf[
n-1] ==
' ')
n--;
789 p->
fZ =
new char[
n+1];
790 strlcpy(p->
fZ, zBuf,
n+1);
819 if (pCnt) *pCnt = cnt;
861 int dl, dt, dr, db, left, top, right, bottom;
871 right = left + w - 1;
872 bottom = top +
h - 1;
873 if (dr == 0 && db == 0) { dr = right; db = bottom; }
874 if (left > dr || right < dl || top > db || bottom < dt)
return;
879 if (iw < 4 && ih < 4)
return;
880 sx = (left + _visibleStart.x) % iw;
882 for (mx = left - dl; w > 0; mx += sw, sw = iw, sx = 0) {
884 sy = (top + _visibleStart.y) % ih;
886 for (my = top - dt, hd =
h; hd > 0; my += sh, sh = ih, sy = 0) {
887 if (sh > hd) sh = hd;
889 image->
Draw(pixmap,
GetAnyGC(), sx, sy, sw, sh, mx, my);
906 gVirtualX->FillRectangle(pixmap, gc, left - dl, top - dt, w,
h);
Handle_t Pixmap_t
Pixmap handle.
Handle_t Drawable_t
Drawable handle.
Handle_t GContext_t
Graphics context handle.
include TDocParser_001 C image html pict1_TDocParser_001 png width
static void GetLetterIndex(char *zBuf, int index, int isUpper)
Print an ordered list index into the given buffer.
static void GetRomanIndex(char *zBuf, int index, int isUpper)
Print an ordered list index into the given buffer.
#define HTML_RELIEF_SUNKEN
#define HTML_RELIEF_RAISED
#define LI_TYPE_Undefined
Encapsulate fonts used in the GUI system.
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.
Int_t TextWidth(const char *string, Int_t numChars=-1) const
A wrapper function for the more complicated interface of MeasureChars.
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 ~TGHtmlBlock()
dtor.
int GetLightShadowColor(int iBgColor)
Given that the background color is iBgColor, figure out an appropriate color for the bright part of t...
TGHtmlBlock * fPSelStartBlock
virtual TGFont * GetFont(int iFont)
The rendering and layout routines should call this routine in order to get a font structure.
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.
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 DrawImage(TGHtmlImageMarkup *image, Drawable_t wid, int left, int top, int right, int bottom)
Draw all or part of an image.
void AnimateImage(TGHtmlImage *image)
TGImage *img = image->image;.
TGHtmlBlock * fPSelEndBlock
void FormBlocks()
Add additional blocks to the block list in order to cover all elements on the element list.
TGHtmlElement * FillOutBlock(TGHtmlBlock *p)
Recompute the following fields of the given block structure:
void DrawRect(Drawable_t drawable, TGHtmlElement *src, int x, int y, int w, int h, int depth, int relief)
Draw a rectangle.
GContext_t GetAnyGC()
Retrieve any valid GC.
TGHtmlElement * FindStartOfNextBlock(TGHtmlElement *p, int *pCnt)
Scan ahead looking for a place to put a block.
TGHtmlBlock * fFirstBlock
void DrawTableBgnd(int x, int y, int w, int h, Drawable_t d, TImage *image)
Draw table background.
void DrawSelectionBackground(TGHtmlBlock *pBlock, Drawable_t Drawable_t, int x, int y)
Draw the selection background for the given block.
GContext_t GetGC(int color, int font)
Return a GC from the cache.
int GetDarkShadowColor(int iBgColor)
Given that the background color is iBgColor, figure out an appropriate color for the dark part of a 3...
void UnlinkAndFreeBlock(TGHtmlBlock *pBlock)
Destroy the given Block after first unlinking it from the element list.
TGLongPosition fVisible
position of visible region
An abstract interface to image processing library.
virtual UInt_t GetWidth() const
virtual Pixmap_t GetPixmap()
virtual void PaintImage(Drawable_t, Int_t, Int_t, Int_t=0, Int_t=0, UInt_t=0, UInt_t=0, Option_t *="")
virtual UInt_t GetHeight() const
virtual void Draw(Option_t *option="")
Default Draw method for all objects.
Double_t fY
Y position of text (left,center,etc..)
Double_t fX
X position of text (left,center,etc..)
Graphics context structure.
Pixmap_t fTile
tile pixmap for tiling operations
Int_t fFillStyle
kFillSolid, kFillTiled, kFillStippled, kFillOpaeueStippled
Int_t fTsXOrigin
offset for tile or stipple operations