Lines Matching refs:dlPtr
314 DLine *dlPtr, DLine *prevPtr, Pixmap pixmap));
316 DLine *dlPtr, DLine *prevPtr, Pixmap pixmap));
318 static DLine * FindDLine _ANSI_ARGS_((DLine *dlPtr,
719 register DLine *dlPtr; /* New display line. */
765 dlPtr = (DLine *) ckalloc(sizeof(DLine));
766 dlPtr->index = *indexPtr;
767 dlPtr->count = 0;
768 dlPtr->y = 0;
769 dlPtr->oldY = -1;
770 dlPtr->height = 0;
771 dlPtr->baseline = 0;
772 dlPtr->chunkPtr = NULL;
773 dlPtr->nextPtr = NULL;
774 dlPtr->flags = NEW_LAYOUT;
900 dlPtr->chunkPtr = chunkPtr;
1012 dlPtr->length = lastChunkPtr->x + lastChunkPtr->width;
1016 jIndent = maxX - dlPtr->length;
1018 jIndent = (maxX - dlPtr->length)/2;
1021 for (chunkPtr = dlPtr->chunkPtr; chunkPtr != NULL;
1024 dlPtr->count += chunkPtr->numChars;
1031 if (chunkPtr->minHeight > dlPtr->height) {
1032 dlPtr->height = chunkPtr->minHeight;
1037 dlPtr->flags |= HAS_3D_BORDER;
1040 if (dlPtr->height < (ascent + descent)) {
1041 dlPtr->height = ascent + descent;
1042 dlPtr->baseline = ascent;
1044 dlPtr->baseline = ascent + (dlPtr->height - ascent - descent)/2;
1046 sValuePtr = dlPtr->chunkPtr->stylePtr->sValuePtr;
1047 if (dlPtr->index.charIndex == 0) {
1048 dlPtr->spaceAbove = sValuePtr->spacing1;
1050 dlPtr->spaceAbove = sValuePtr->spacing2 - sValuePtr->spacing2/2;
1053 dlPtr->spaceBelow = sValuePtr->spacing3;
1055 dlPtr->spaceBelow = sValuePtr->spacing2/2;
1057 dlPtr->height += dlPtr->spaceAbove + dlPtr->spaceBelow;
1058 dlPtr->baseline += dlPtr->spaceAbove;
1064 dlPtr->length = lastChunkPtr->x + lastChunkPtr->width;
1065 return dlPtr;
1102 register DLine *dlPtr, *prevPtr;
1117 dlPtr = FindDLine(dInfoPtr->dLinePtr, &index);
1118 if ((dlPtr != NULL) && (dlPtr != dInfoPtr->dLinePtr)) {
1119 FreeDLines(textPtr, dInfoPtr->dLinePtr, dlPtr, 1);
1131 dlPtr = dInfoPtr->dLinePtr;
1144 * (a) the next DLine (dlPtr) corresponds exactly to the next
1164 if ((dlPtr == NULL) || (dlPtr->index.linePtr != index.linePtr)) {
1193 newPtr->nextPtr = dlPtr;
1194 dlPtr = newPtr;
1201 if (index.charIndex == dlPtr->index.charIndex) {
1206 if ((dlPtr->flags & HAS_3D_BORDER) && (prevPtr != NULL)
1208 dlPtr->oldY = -1;
1212 if (index.charIndex < dlPtr->index.charIndex) {
1217 * Case (c) -- dlPtr is useless. Discard it and start
1221 newPtr = dlPtr->nextPtr;
1222 FreeDLines(textPtr, dlPtr, newPtr, 0);
1223 dlPtr = newPtr;
1237 dlPtr->y = y;
1238 y += dlPtr->height;
1239 TkTextIndexForwChars(&index, dlPtr->count, &index);
1240 prevPtr = dlPtr;
1241 dlPtr = dlPtr->nextPtr;
1251 nextPtr = dlPtr;
1256 if (nextPtr != dlPtr) {
1257 FreeDLines(textPtr, dlPtr, nextPtr, 0);
1259 dlPtr = nextPtr;
1279 FreeDLines(textPtr, dlPtr, (DLine *) NULL, 1);
1313 dlPtr = LayoutDLine(textPtr, &index);
1314 dlPtr->nextPtr = lowestPtr;
1315 lowestPtr = dlPtr;
1316 TkTextIndexForwChars(&index, dlPtr->count, &index);
1317 charsToCount -= dlPtr->count;
1327 dlPtr = lowestPtr;
1328 spaceLeft -= dlPtr->height;
1332 lowestPtr = dlPtr->nextPtr;
1333 dlPtr->nextPtr = dInfoPtr->dLinePtr;
1334 dInfoPtr->dLinePtr = dlPtr;
1338 TkTextPrintIndex(&dlPtr->index, string);
1356 for (dlPtr = dInfoPtr->dLinePtr; dlPtr != NULL;
1357 dlPtr = dlPtr->nextPtr) {
1361 dlPtr->y = y;
1362 y += dlPtr->height;
1378 dlPtr = dInfoPtr->dLinePtr;
1379 if ((dlPtr->flags & HAS_3D_BORDER) && !(dlPtr->flags & TOP_LINE)) {
1380 dlPtr->oldY = -1;
1383 if ((dlPtr->flags & TOP_LINE) && (dlPtr != dInfoPtr->dLinePtr)
1384 && (dlPtr->flags & HAS_3D_BORDER)) {
1385 dlPtr->oldY = -1;
1387 if ((dlPtr->flags & BOTTOM_LINE) && (dlPtr->nextPtr != NULL)
1388 && (dlPtr->flags & HAS_3D_BORDER)) {
1389 dlPtr->oldY = -1;
1391 if (dlPtr->nextPtr == NULL) {
1392 if ((dlPtr->flags & HAS_3D_BORDER)
1393 && !(dlPtr->flags & BOTTOM_LINE)) {
1394 dlPtr->oldY = -1;
1396 dlPtr->flags &= ~TOP_LINE;
1397 dlPtr->flags |= BOTTOM_LINE;
1400 dlPtr->flags &= ~(TOP_LINE|BOTTOM_LINE);
1401 dlPtr = dlPtr->nextPtr;
1424 for (dlPtr = dInfoPtr->dLinePtr; dlPtr != NULL;
1425 dlPtr = dlPtr->nextPtr) {
1426 if (dlPtr->length > dInfoPtr->maxLength) {
1427 dInfoPtr->maxLength = dlPtr->length;
1441 for (dlPtr = dInfoPtr->dLinePtr; dlPtr != NULL;
1442 dlPtr = dlPtr->nextPtr) {
1443 dlPtr->oldY = -1;
1525 * The line given by dlPtr is drawn at its correct position in
1533 DisplayDLine(textPtr, dlPtr, prevPtr, pixmap)
1535 register DLine *dlPtr; /* Information about line to draw. */
1537 * if dlPtr is the top line. */
1554 Tk_Width(textPtr->tkwin), dlPtr->height, 0, TK_RELIEF_FLAT);
1560 DisplayLineBackground(textPtr, dlPtr, prevPtr, pixmap);
1571 for (chunkPtr = dlPtr->chunkPtr; (chunkPtr != NULL);
1575 (*chunkPtr->displayProc)(chunkPtr, x, dlPtr->spaceAbove,
1576 dlPtr->height - dlPtr->spaceAbove - dlPtr->spaceBelow,
1577 dlPtr->baseline - dlPtr->spaceAbove, display, pixmap,
1578 dlPtr->y + dlPtr->spaceAbove);
1591 for (chunkPtr = dlPtr->chunkPtr; (chunkPtr != NULL);
1614 dlPtr->spaceAbove,
1615 dlPtr->height - dlPtr->spaceAbove - dlPtr->spaceBelow,
1616 dlPtr->baseline - dlPtr->spaceAbove, display, pixmap,
1617 dlPtr->y + dlPtr->spaceAbove);
1619 (*chunkPtr->displayProc)(chunkPtr, x, dlPtr->spaceAbove,
1620 dlPtr->height - dlPtr->spaceAbove - dlPtr->spaceBelow,
1621 dlPtr->baseline - dlPtr->spaceAbove, display, pixmap,
1622 dlPtr->y + dlPtr->spaceAbove);
1638 height = dlPtr->height;
1639 if ((height + dlPtr->y) > dInfoPtr->maxY) {
1640 height = dInfoPtr->maxY - dlPtr->y;
1644 (unsigned) height, dInfoPtr->x, dlPtr->y);
1662 * information for dlPtr.
1671 DisplayLineBackground(textPtr, dlPtr, prevPtr, pixmap)
1673 register DLine *dlPtr; /* Information about line to draw. */
1674 DLine *prevPtr; /* Line just above dlPtr, or NULL if dlPtr
1709 * Pass 1: scan through dlPtr from left to right. For each range of
1719 chunkPtr = dlPtr->chunkPtr;
1735 (unsigned int) dlPtr->height);
1739 dlPtr->height, 1, sValuePtr->relief);
1742 0, sValuePtr->borderWidth, dlPtr->height, 0,
1751 * do this, scan through dlPtr from left to right while simultaneously
1752 * scanning through the line just above dlPtr. ChunkPtr2 and nextPtr2
1756 chunkPtr = dlPtr->chunkPtr;
1877 chunkPtr = dlPtr->chunkPtr;
1885 if (dlPtr->nextPtr != NULL) {
1890 nextPtr2 = dlPtr->nextPtr->chunkPtr;
1919 dlPtr->height - sValuePtr->borderWidth,
1946 dlPtr->height - sValuePtr->borderWidth,
1955 rightX2 + xOffset, dlPtr->height - sValuePtr->borderWidth,
1959 leftX + xOffset, dlPtr->height - sValuePtr->borderWidth,
2004 register DLine *dlPtr;
2090 for (dlPtr = dInfoPtr->dLinePtr; dlPtr != NULL; dlPtr = dlPtr->nextPtr) {
2095 if ((dlPtr->oldY == -1) || (dlPtr->y == dlPtr->oldY)
2096 || ((dlPtr->oldY + dlPtr->height) > dInfoPtr->maxY)) {
2106 offset = dlPtr->y - dlPtr->oldY;
2107 height = dlPtr->height;
2108 y = dlPtr->y;
2109 for (dlPtr2 = dlPtr->nextPtr; dlPtr2 != NULL;
2127 oldY = dlPtr->oldY;
2135 dlPtr->oldY = dlPtr->y;
2136 if (dlPtr->nextPtr == dlPtr2) {
2139 dlPtr = dlPtr->nextPtr;
2260 for (dlPtr = dInfoPtr->dLinePtr; dlPtr != NULL;
2261 dlPtr = dlPtr->nextPtr) {
2262 if ((dlPtr->height > maxHeight) && (dlPtr->oldY != dlPtr->y)) {
2263 maxHeight = dlPtr->height;
2265 bottomY = dlPtr->y + dlPtr->height;
2274 for (prevPtr = NULL, dlPtr = textPtr->dInfoPtr->dLinePtr;
2275 (dlPtr != NULL) && (dlPtr->y < dInfoPtr->maxY);
2276 prevPtr = dlPtr, dlPtr = dlPtr->nextPtr) {
2277 if (dlPtr->oldY != dlPtr->y) {
2280 TkTextPrintIndex(&dlPtr->index, string);
2285 DisplayDLine(textPtr, dlPtr, prevPtr, pixmap);
2290 dlPtr->oldY = dlPtr->y;
2291 dlPtr->flags &= ~NEW_LAYOUT;
2468 register DLine *dlPtr;
2480 for (dlPtr = dInfoPtr->dLinePtr; dlPtr != NULL;
2481 dlPtr = dlPtr->nextPtr) {
2482 if ((dlPtr->oldY != -1) && (TkRectInRegion(region, rect.x, dlPtr->y,
2483 rect.width, (unsigned int) dlPtr->height) != RectangleOut)) {
2484 dlPtr->oldY = -1;
2622 register DLine *dlPtr;
2635 dlPtr = dInfoPtr->dLinePtr;
2636 if (dlPtr == NULL) {
2639 if ((index1Ptr == NULL) || (TkTextIndexCmp(&dlPtr->index, index1Ptr) > 0)) {
2640 index1Ptr = &dlPtr->index;
2703 dlPtr = FindDLine(dlPtr, curIndexPtr);
2709 dlPtr = FindDLine(dlPtr, &tmp);
2711 if (dlPtr == NULL) {
2725 endPtr = FindDLine(dlPtr, endIndexPtr);
2736 FreeDLines(textPtr, dlPtr, endPtr, 1);
2737 dlPtr = endPtr;
2884 register DLine *dlPtr;
2925 dlPtr = FindDLine(dInfoPtr->dLinePtr, indexPtr);
2926 if (dlPtr != NULL) {
2927 if ((dlPtr->y + dlPtr->height) > dInfoPtr->maxY) {
2933 dlPtr = NULL;
2934 } else if ((dlPtr->index.linePtr == indexPtr->linePtr)
2935 && (dlPtr->index.charIndex <= indexPtr->charIndex)) {
2955 if (dlPtr != NULL) {
3038 DLine *dlPtr, *lowestPtr;
3059 dlPtr = LayoutDLine(textPtr, &index);
3060 dlPtr->nextPtr = lowestPtr;
3061 lowestPtr = dlPtr;
3062 TkTextIndexForwChars(&index, dlPtr->count, &index);
3063 charsToCount -= dlPtr->count;
3064 } while ((charsToCount > 0) && (index.linePtr == dlPtr->index.linePtr));
3072 for (dlPtr = lowestPtr; dlPtr != NULL; dlPtr = dlPtr->nextPtr) {
3073 distance -= dlPtr->height;
3075 *dstPtr = (noBestYet) ? dlPtr->index : bestIndex;
3078 bestIndex = dlPtr->index;
3133 DLine *dlPtr;
3176 dlPtr = FindDLine(dInfoPtr->dLinePtr, &index);
3177 charCount = index.charIndex - dlPtr->index.charIndex;
3178 for (chunkPtr = dlPtr->chunkPtr; ; chunkPtr = chunkPtr->nextPtr) {
3190 (*chunkPtr->bboxProc)(chunkPtr, charCount, dlPtr->y + dlPtr->spaceAbove,
3191 dlPtr->height - dlPtr->spaceAbove - dlPtr->spaceBelow,
3192 dlPtr->baseline - dlPtr->spaceAbove, &x, &y, &width,
3334 DLine *dlPtr, *lowestPtr;
3352 dlPtr = LayoutDLine(textPtr, &index);
3353 dlPtr->nextPtr = lowestPtr;
3354 lowestPtr = dlPtr;
3355 TkTextIndexForwChars(&index, dlPtr->count, &index);
3356 charsToCount -= dlPtr->count;
3358 && (index.linePtr == dlPtr->index.linePtr));
3360 for (dlPtr = lowestPtr; dlPtr != NULL; dlPtr = dlPtr->nextPtr) {
3363 textPtr->topIndex = dlPtr->index;
3395 dlPtr = LayoutDLine(textPtr, &textPtr->topIndex);
3396 dlPtr->nextPtr = NULL;
3397 TkTextIndexForwChars(&textPtr->topIndex, dlPtr->count, &new);
3398 FreeDLines(textPtr, dlPtr, (DLine *) NULL, 0);
3448 DLine *dlPtr;
3554 dlPtr = LayoutDLine(textPtr, &textPtr->topIndex);
3555 dlPtr->nextPtr = NULL;
3556 TkTextIndexForwChars(&textPtr->topIndex, dlPtr->count,
3558 pixels -= dlPtr->height;
3559 FreeDLines(textPtr, dlPtr, (DLine *) NULL, 0);
3790 DLine *dlPtr;
3793 dlPtr = dInfoPtr->dLinePtr;
3795 first = ((double) TkBTreeLineIndex(dlPtr->index.linePtr))
3796 + ((double) dlPtr->index.charIndex)
3797 / (TkBTreeCharsInLine(dlPtr->index.linePtr));
3800 if ((dlPtr->y + dlPtr->height) > dInfoPtr->maxY) {
3808 if (dlPtr->nextPtr == NULL) {
3809 count = dlPtr->count;
3812 dlPtr = dlPtr->nextPtr;
3814 last = ((double) TkBTreeLineIndex(dlPtr->index.linePtr))
3815 + ((double) (dlPtr->index.charIndex + count))
3816 / (TkBTreeCharsInLine(dlPtr->index.linePtr));
3848 * list headed by dlPtr that displays information at or after the
3859 FindDLine(dlPtr, indexPtr)
3860 register DLine *dlPtr; /* Pointer to first in list of DLines
3866 if (dlPtr == NULL) {
3870 < TkBTreeLineIndex(dlPtr->index.linePtr)) {
3874 return dlPtr;
3881 linePtr = dlPtr->index.linePtr;
3883 while (dlPtr->index.linePtr == linePtr) {
3884 dlPtr = dlPtr->nextPtr;
3885 if (dlPtr == NULL) {
3894 if (indexPtr->linePtr != dlPtr->index.linePtr) {
3895 return dlPtr;
3902 while (indexPtr->charIndex >= (dlPtr->index.charIndex + dlPtr->count)) {
3903 dlPtr = dlPtr->nextPtr;
3904 if ((dlPtr == NULL) || (dlPtr->index.linePtr != indexPtr->linePtr)) {
3908 return dlPtr;
3939 register DLine *dlPtr;
3972 for (dlPtr = dInfoPtr->dLinePtr; y >= (dlPtr->y + dlPtr->height);
3973 dlPtr = dlPtr->nextPtr) {
3974 if (dlPtr->nextPtr == NULL) {
3992 *indexPtr = dlPtr->index;
3994 for (chunkPtr = dlPtr->chunkPtr; x >= (chunkPtr->x + chunkPtr->width);
4045 DLine *dlPtr;
4061 dlPtr = FindDLine(dInfoPtr->dLinePtr, indexPtr);
4062 if ((dlPtr == NULL) || (TkTextIndexCmp(&dlPtr->index, indexPtr) > 0)) {
4071 index = indexPtr->charIndex - dlPtr->index.charIndex;
4072 for (chunkPtr = dlPtr->chunkPtr; ; chunkPtr = chunkPtr->nextPtr) {
4090 (*chunkPtr->bboxProc)(chunkPtr, index, dlPtr->y + dlPtr->spaceAbove,
4091 dlPtr->height - dlPtr->spaceAbove - dlPtr->spaceBelow,
4092 dlPtr->baseline - dlPtr->spaceAbove, xPtr, yPtr, widthPtr,
4157 DLine *dlPtr;
4171 dlPtr = FindDLine(dInfoPtr->dLinePtr, indexPtr);
4172 if ((dlPtr == NULL) || (TkTextIndexCmp(&dlPtr->index, indexPtr) > 0)) {
4176 *xPtr = dInfoPtr->x - dInfoPtr->curPixelOffset + dlPtr->chunkPtr->x;
4177 *widthPtr = dlPtr->length - dlPtr->chunkPtr->x;
4178 *yPtr = dlPtr->y;
4179 if ((dlPtr->y + dlPtr->height) > dInfoPtr->maxY) {
4180 *heightPtr = dInfoPtr->maxY - dlPtr->y;
4182 *heightPtr = dlPtr->height;
4184 *basePtr = dlPtr->baseline;