102 *pIndex = p->
fCount - isLast;
107 *pIndex = p->
fCount - isLast;
144 }
else if (
x >= pBlock->
fRight) {
157 if (pBlock->
fN == 0) {
164 while (p &&
n >= 0) {
213 if (sIndex.
fP == 0) {
252 int i,
x, cnt, ccnt[2], cflag[2];
254 if (pp == 0 || !*pp)
return -1;
255 ccnt[0] = ccnt[1] = cflag[0] = cflag[1] = 0;
257 while (*cp &&
x < 2) {
260 while (i < 45 && isdigit(cp[i])) {
267 if (cnt < 0)
return -1;
270 case '+':
if (i == 1) ccnt[
x] = 1;
else ccnt[
x] = cnt;
break;
271 case '-':
if (i == 1) ccnt[
x] = -1;
else ccnt[
x] = -cnt;
break;
272 case '=': ccnt[
x] = 0; cflag[
x] = 1;
break;
279 for (i = 0; i < ccnt[0] && (*pp)->fPNext; ++i) {
281 while ((*pp)->fType ==
Html_Block && (*pp)->fPNext) {
285 }
else if (ccnt[0] < 0) {
286 for (i = 0; ccnt[0] < i && (*pp)->fPPrev; --i) {
289 while ((*pp)->fType ==
Html_Block && (*pp)->fPPrev) {
295 for (i = 0; i < ccnt[1]; ++i) (*ip)++;
296 }
else if (ccnt[1] < 0) {
297 for (i = 0; i > ccnt[1]; --i) (*ip)--;
349 char buf[200], *base = buf, *suffix, *ep;
351 strlcpy(buf, baseIx,
sizeof(buf));
353 while (isspace((
unsigned char)*base)) base++;
355 while (*ep && !isspace((
unsigned char)*ep)) ep++;
358 if ((suffix = strchr(base,
':'))) *suffix = 0;
361 case '1':
case '2':
case '3':
case '4':
case '5':
362 case '6':
case '7':
case '8':
case '9':
case '0':
364 n = sscanf(base,
"%d.%d", &
x, &
y);
371 for (i = 1; isdigit(base[i]); ++i) {}
374 }
else if (strcmp(&base[i],
".last") == 0) {
376 }
else if (strcmp(&base[i],
".end") == 0) {
380 if (
n == 1 && p && p->
IsMarkup() && base[i] ==
'.' &&
391 if (strcmp(base,
"begin") == 0) {
400 if (strcmp(base,
"end") == 0) {
409 if (strcmp(base,
"last") == 0) {
418 if (strcmp(base,
"sel.first") == 0) {
421 }
else if (strcmp(base,
"sel.last") == 0) {
424 }
else if (strcmp(base,
"sel.end") == 0) {
433 if (strcmp(baseIx,
"insert") == 0) {
444 if (DomIdLookup(
"id", base + 1, ppToken)) rc = 1;
449 n = sscanf(base,
"@%d,%d", &
x, &
y);
461 if (pBlock->
fN == 0) {
480 if (pBlock->
fLeft -
x < dist) {
484 }
else if (pBlock->
fRight <
x) {
485 if (
x - pBlock->
fRight < dist) {
500 distY = pBlock->
fTop -
y;
503 distX = pBlock->
fLeft -
x;
504 }
else if (pBlock->
fRight <
x) {
509 if (distX + 4*distY < dist) {
510 dist = distX + 4*distY;
527 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