104 *pIndex = p->
fCount - isLast;
109 *pIndex = p->
fCount - isLast;
142 if (x <= pBlock->fLeft) {
146 }
else if (
x >= pBlock->
fRight) {
159 if (pBlock->
fN == 0) {
166 while (p &&
n >= 0) {
215 if (sIndex.
fP == 0) {
254 int i,
x, cnt, ccnt[2], cflag[2];
256 if (pp == 0 || !*pp)
return -1;
257 ccnt[0] = ccnt[1] = cflag[0] = cflag[1] = 0;
259 while (*cp &&
x < 2) {
262 while (i < 45 && isdigit(cp[i])) {
269 if (cnt < 0)
return -1;
272 case '+':
if (i == 1) ccnt[
x] = 1;
else ccnt[
x] = cnt;
break;
273 case '-':
if (i == 1) ccnt[
x] = -1;
else ccnt[
x] = -cnt;
break;
274 case '=': ccnt[
x] = 0; cflag[
x] = 1;
break;
281 for (i = 0; i < ccnt[0] && (*pp)->fPNext; ++i) {
283 while ((*pp)->fType ==
Html_Block && (*pp)->fPNext) {
287 }
else if (ccnt[0] < 0) {
288 for (i = 0; ccnt[0] < i && (*pp)->fPPrev; --i) {
291 while ((*pp)->fType ==
Html_Block && (*pp)->fPPrev) {
297 for (i = 0; i < ccnt[1]; ++i) (*ip)++;
298 }
else if (ccnt[1] < 0) {
299 for (i = 0; i > ccnt[1]; --i) (*ip)--;
351 char buf[200], *base = buf, *suffix, *ep;
353 strlcpy(buf, baseIx,
sizeof(buf));
355 while (isspace((
unsigned char)*base)) base++;
357 while (*ep && !isspace((
unsigned char)*ep)) ep++;
360 if ((suffix = strchr(base,
':'))) *suffix = 0;
363 case '1':
case '2':
case '3':
case '4':
case '5':
364 case '6':
case '7':
case '8':
case '9':
case '0':
366 n = sscanf(base,
"%d.%d", &
x, &
y);
373 for (i = 1; isdigit(base[i]); ++i) {}
376 }
else if (strcmp(&base[i],
".last") == 0) {
378 }
else if (strcmp(&base[i],
".end") == 0) {
382 if (
n == 1 && p && p->
IsMarkup() && base[i] ==
'.' &&
393 if (strcmp(base,
"begin") == 0) {
402 if (strcmp(base,
"end") == 0) {
411 if (strcmp(base,
"last") == 0) {
420 if (strcmp(base,
"sel.first") == 0) {
423 }
else if (strcmp(base,
"sel.last") == 0) {
426 }
else if (strcmp(base,
"sel.end") == 0) {
435 if (strcmp(baseIx,
"insert") == 0) {
446 if (DomIdLookup(
"id", base + 1, ppToken)) rc = 1;
451 n = sscanf(base,
"@%d,%d", &
x, &
y);
463 if (pBlock->
fN == 0) {
482 if (pBlock->
fLeft -
x < dist) {
486 }
else if (pBlock->
fRight <
x) {
487 if (
x - pBlock->
fRight < dist) {
502 distY = pBlock->
fTop -
y;
505 distX = pBlock->
fLeft -
x;
506 }
else if (pBlock->
fRight <
x) {
511 if (distX + 4*distY < dist) {
512 dist = distX + 4*distY;
529 if (suffix)
IndexMod(ppToken, pIndex, suffix + 1);
Encapsulate fonts used in the GUI system.
Int_t MeasureChars(const char *source, Int_t numChars, Int_t maxLength, Int_t flags, Int_t *length) const
Determine the number of characters from the string that will fit in the given horizontal span.
virtual const char * MarkupArg(const char *, const char *)
virtual int IsMarkup() const
virtual TGFont * GetFont(int iFont)
The rendering and layout routines should call this routine in order to get a font structure.
void IndexToBlockIndex(SHtmlIndex_t sIndex, TGHtmlBlock **ppBlock, int *piIndex)
Convert an Element-based index into a Block-based index.
void MaxIndex(TGHtmlElement *p, int *pIndex, int isLast)
Find the maximum index for the given token.
int IndexMod(TGHtmlElement **pp, int *ip, char *cp)
Modify an index for both pointer and char +/-/=N.
void FindIndexInBlock(TGHtmlBlock *pBlock, int x, TGHtmlElement **ppToken, int *pIndex)
Given a Block and an x coordinate, find the Index of the character that is closest to the given x coo...
TGHtmlElement * TokenByIndex(int N, int flag)
Return a pointer to the Nth TGHtmlElement in the list.
TGHtmlBlock * fFirstBlock
int TokenNumber(TGHtmlElement *p)
Return the token number for the given TGHtmlElement.
int GetIndex(const char *zIndex, TGHtmlElement **ppToken, int *pIndex)
This routine decodes a complete index specification.
int DecodeBaseIndex(const char *zBase, TGHtmlElement **ppToken, int *pIndex)
Given a base index name (without any modifiers) return a pointer to the token described,...
TGLongPosition fVisible
position of visible region