125 if (index < 1 || index > 52) {
139 zBuf[0] = seed +
index;
143 zBuf[0] = seed +
index;
144 zBuf[1] = seed +
index;
186 if (index < 1 || index >= 5000) {
190 for (j = 0;
index > 0 && j <
sizeof(values)/
sizeof(values[0]); j++) {
193 for (k = 0; values[j].name[k]; k++) {
194 zBuf[i++] = values[j].name[k];
196 index -= values[j].value;
201 for (i = 0; zBuf[i]; i++) {
202 zBuf[i] +=
'A' -
'a';
225 xLeft = pBlock->
fLeft -
x;
230 if (font == 0)
return;
241 if (font == 0)
return;
248 yTop = pBlock->
fTop -
y;
265 int x,
int y,
int w,
int h,
int depth,
int relief)
296 for (i = 0; i < depth && i <
h/2; i++) {
301 if (
h > depth*2 &&
w > depth*2) {
316 int drawableLeft,
int drawableTop,
317 int drawableWidth,
int drawableHeight,
327 if (pBlock == 0)
return;
332 if (
src == 0)
return;
334 if (pBlock->
fN > 0) {
349 if (font == 0)
return;
351 x - drawableLeft,
y - drawableTop);
354 x - drawableLeft,
y-drawableTop, 0, pBlock->
fN);
357 x = pBlock->
fLeft - drawableLeft;
364 if (fInsIndex < pBlock->fN) {
366 x = tsrc->
fX - drawableLeft;
369 x = pBlock->
fRight - drawableLeft;
379 constexpr std::size_t zBufSize = 30;
383 switch (
src->fType) {
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);
456 hr->
fW, hr->
fH, 1, relief);
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) {
652 p->fTop = hr->
fY - hr->
fH;
655 p->fRight = hr->
fX + hr->
fW;
663 p->fLeft = li->
fX - 10;
664 p->fRight = li->
fX + 10;
672 p->fBottom = cell->
fY + cell->
fH;
674 p->fRight = cell->
fX + cell->
fW;
681 p->fBottom = table->
fY + table->
fH;
682 p->fLeft = table->
fX;
683 p->fRight = table->
fX + table->
fW;
691 p->fLeft = image->
fX;
692 p->fRight = image->
fX + image->
fW;
707 p->fTop =
y -
text->fAscent;
708 p->fBottom =
y +
text->fDescent;
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;
905 gVirtualX->FillRectangle(pixmap,
gc, left - dl, top - dt,
w,
h);
Handle_t Pixmap_t
Pixmap handle.
Handle_t GContext_t
Graphics context handle.
Handle_t Drawable_t
Drawable handle.
static void GetLetterIndex(char(&zBuf)[30], int index, int isUpper)
Print an ordered list index into the given buffer.
static void GetRomanIndex(char(&zBuf)[30], 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
winID h TVirtualViewer3D TVirtualGLPainter p
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t index
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void value
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t src
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t height
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void gc
Option_t Option_t TPoint TPoint const char text
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char mx
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.
~TGHtmlBlock() override
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.
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