39#define DFLT_CELLSPACING_3D 5
40#define DFLT_CELLSPACING_FLAT 0
41#define DFLT_CELLPADDING 2
46#define SETMAX(A,B) if ((A) < (B)) { (A) = (B); }
47#define MAX(A,B) ((A) < (B) ? (B) : (A))
59 z =
pTable->MarkupArg(
"cellspacing", 0);
80 int nw = 0,
nh = 1,
mw = 0;
152 while (
p && (
p =
p->fPNext)) {
203 if ((!(
cp =
p->MarkupArg(
"colspan", 0))) || (
cspans = atoi(
cp)) <= 0) {
206 if ((
cp =
p->MarkupArg(
"rowspan", 0)) && (
j = atoi(
cp)) > 0 &&
260 for (
j = 0;
j <
p->fCount;
j++) {
286 while (
nest--) str->Append(
"} ");
294 str->Append(
istr.Data());
302 str->Append(
imgstr.Data());
326 if (
p ==
lp)
return 0;
330 if (
p->fPPrev)
return p->fPPrev;
333 }
else if (
p->fType ==
n) {
335 if (
p->fPPrev)
return p->fPPrev;
339 }
else if (
p->fType ==
en) {
340 if (!
lvl--)
return p;
345 default:
p =
p->fPNext;
409# define ColMin(A,B) colMin[(A)-1][(B)-1]
410# define ColReq(A,B) colMin[(B)-1][(A)-1]
418 pStart->MarkupArg(
"name",
"")));
423 z =
pStart->MarkupArg(
"border", 0);
424 if (z && *z == 0) z =
"2";
432 z =
pStart->MarkupArg(
"cellpadding", 0);
452 pStart->MarkupArg(
"hspace", 0);
456 z =
pStart->MarkupArg(
"width", 0);
459 if (
len > 0 && z[
len-1] ==
'%') {
473 for (
p =
pStart->fPNext;
p;
p = fPNext) {
516 if (
pNew == 0)
break;
519 pNew->fStyle =
p->fStyle;
520 pNew->fFlags =
p->fFlags;
522 p->fPPrev->fPNext =
pNew;
544 for (
j = 1;
j < i;
j++) {
551 noWrap = (
p->MarkupArg(
"nowrap", 0) != 0);
555 cell->fPEnd = fPNext;
557 if ((z =
p->MarkupArg(
"width", 0)) != 0) {
558 for (i = 0;
isdigit(z[i]) || z[i] ==
'.'; i++) {}
559 if (
strcmp(z,
"*") == 0) {
561 }
else if (z[i] == 0) {
563 }
else if (z[i] ==
'%') {
569 (
"Row %d Column %d: min=%d max=%d req=%d stop at %s\n",
575 if (
p->MarkupArg(
"rowspan", 0) == 0) {
583 if (
cell->fColspan == 0) {
614 if (
cell->fColspan > 1) {
616 }
else if (
cell->fColspan == 0) {
628 for (i = 1; i <=
pStart->fNCol; i++) {
636 for (i = 1; i <
pStart->fNCol; i++) {
653 for (i = 1; i <=
pStart->fNCol; i++) {
681 for (
j = i-1;
j >= 1;
j--) {
697 for (k =
j; k <= i; k++) {
704 for (k =
j; k <= i; k++) {
710 int unit =
cmin / (i -
j + 1);
711 for (k =
j; k <= i; k++) {
726 for (k =
j; k <= i; k++) {
733 for (k =
j; k <= i; k++) {
739 int unit =
creq / (i -
j + 1);
740 for (k =
j; k <= i; k++) {
753 for (i = 1; i <=
pStart->fNCol; i++) {
770 for (i = 1; i <=
pStart->fNCol; i++) {
777 z =
pStart->MarkupArg(
"width", 0);
781 if (
len > 0 && z[
len-1] ==
'%') {
807 (
"Expanding table minW from %d to %d. (reqW=%d width=%s)\n",
812 for (i = 1; i <=
pStart->fNCol; i++) {
816 }
else if (
tminW[0] > 0) {
818 for (i = 1; i <=
pStart->fNCol; i++) {
822 }
else if (
pStart->fNCol > 0) {
824 if (unit < 0) unit = 0;
825 for (i = 1; i <=
pStart->fNCol; i++) {
841 printf(
"nCol=%d minWidth=%d maxWidth=%d\n",
843 for (i = 1; i <=
pStart->fNCol; i++) {
845 printf(
"Column %d minWidth=%d maxWidth=%d\n",
852 (
"Result of TableDimensions: min=%d max=%d nCol=%d\n",
893 if (
p->MarkupArg(
"nowrap", 0) != 0) {
897 for (
p =
p->fPNext;
go &&
p;
p = fPNext) {
930 x1 += space->
fW *
p->fCount;
931 x2 += space->
fW *
p->fCount;
932 x3 += space->
fW *
p->fCount;
946 switch (
image->fAlign) {
1081#define VAlign_Unknown 0
1083#define VAlign_Bottom 2
1084#define VAlign_Center 3
1085#define VAlign_Baseline 4
1147#define N (HTML_MAX_COLUMNS+1)
1158#ifdef TABLE_TRIM_BLANK
1168 for (i=0;i<
N;i++)
ymax[i]=0;
1197 z =
pTable->MarkupArg(
"width", 0);
1200 if (
len > 0 && z[
len-1] ==
'%') {
1219 z =
pTable->MarkupArg(
"cellpadding", 0);
1223 z =
pTable->MarkupArg(
"vspace", 0);
1226 pTable->MarkupArg(
"hspace", 0);
1253 int align =
pTable->fStyle.fAlign;
1263 for (i = 2; i <=
n; i++) {
1271 for (i = 2; i <=
n; i++) {
1281 for (i = 2; i <=
n; i++) {
1287 for (i = 2; i <=
n; i++) {
1305 for (i = 1; i <=
n; i++) {
1327 if (
p)
p =
p->fPNext;
1361 fPNext =
cell->fPEnd;
1362 if (
cell->fRowspan == 0) {
1402#ifdef TABLE_TRIM_BLANK
1420 (
"Column %d top=%d bottom=%d h=%d left=%d w=%d\n",
1527 "Done with TableLayout(). x=%d y=%d w=%d h=%d Return %s\n",
1544 if (
dy == 0)
return;
static void indent(ostringstream &buf, int indent_level)
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
#define DFLT_CELLSPACING_FLAT
#define DFLT_CELLSPACING_3D
#define HTML_RELIEF_SUNKEN
#define HTML_RELIEF_RAISED
#define IMAGE_ALIGN_Right
#define TRACE(Flag, Args)
winID h TVirtualViewer3D TVirtualGLPainter p
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void input
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 Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t ULong_t unsigned char prop_list Atom_t Atom_t Atom_t Time_t UChar_t len
Option_t Option_t TPoint TPoint const char x2
Option_t Option_t TPoint TPoint const char x1
Option_t Option_t TPoint TPoint const char text
void ComputeMargins(int *pX, int *pY, int *pW)
Compute the current margins for layout.
TGHtmlElement * TableLayout(TGHtmlTable *p)
Do all layout for a single table.
SHtmlMargin_t * fRightMargin
void PushMargin(SHtmlMargin_t **ppMargin, int indent, int bottom, int tag)
Push a new margin onto the given margin stack.
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.
SHtmlMargin_t * fLeftMargin
int GetVerticalAlignment(int dflt) override
Return the vertical alignment specified by the given element.
const char * MarkupArg(const char *tag, const char *zDefault) override
Lookup an argument in the given markup with the name given.
void MoveVertically(TGHtmlElement *p, TGHtmlElement *pLast, int dy)
Move all elements in the given list vertically by the amount dy.
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.
void StringHW(const char *str, int *h, int *w)
Return the height and width of string.
int CellSpacing(TGHtmlElement *pTable)
Return the appropriate cell spacing for the given table.
void AppendArglist(TGString *str, TGHtmlMarkupElement *pElem)
Append all the arguments of the given markup to the given TGString.
TGString * TableText(TGHtmlTable *pTable, int flags)
Return text and images from a table as lists.
TGHtmlElement * FindEndNest(TGHtmlElement *sp, int en, TGHtmlElement *lp)
Find End tag en, but ignore intervening begin/end tag pairs.
char * GetTokenName(TGHtmlElement *p)
Returns token name of html element p.
TGHtmlElement * TableDimensions(TGHtmlTable *pStart, int lineWidth)
pStart points to a <table>.
TGString wraps a TString and adds some graphics routines like drawing, size of string on screen depen...