ARGSUSED */
(textPtr, x, y, width, height)
| 1459 | * This procedure is invoked to schedule a redisplay for a given |
| 1460 | * region of a text widget. The redisplay itself may not occur |
| 1461 | * immediately: it's scheduled as a when-idle handler. |
| 1462 | * |
| 1463 | * Results: |
| 1464 | * None. |
| 1465 | * |
| 1466 | * Side effects: |
| 1467 | * Information will eventually be redrawn on the screen. |
| 1468 | * |
| 1469 | *---------------------------------------------------------------------- |
| 1470 | */ |
| 1471 | |
| 1472 | /* ARGSUSED */ |
| 1473 | void |
| 1474 | TkTextRedrawRegion(textPtr, x, y, width, height) |
| 1475 | TkText *textPtr; /* Widget record for text widget. */ |
| 1476 | int x, y; /* Coordinates of upper-left corner of area |
| 1477 | * to be redrawn, in pixels relative to |
| 1478 | * textPtr's window. */ |
| 1479 | int width, height; /* Width and height of area to be redrawn. */ |
| 1480 | { |
| 1481 | register DLine *dlPtr; |
| 1482 | DInfo *dInfoPtr = textPtr->dInfoPtr; |
| 1483 | int maxY; |
| 1484 | |
| 1485 | /* |
| 1486 | * Find all lines that overlap the given region and mark them for |
| 1487 | * redisplay. |
| 1488 | */ |
| 1489 | |
| 1490 | maxY = y + height; |
| 1491 | for (dlPtr = dInfoPtr->dLinePtr; dlPtr != NULL; |
| 1492 | dlPtr = dlPtr->nextPtr) { |
| 1493 | if (((dlPtr->y + dlPtr->height) > y) && (dlPtr->y < maxY)) { |
| 1494 | dlPtr->oldY = -1; |
| 1495 | } |
| 1496 | } |
| 1497 | if (dInfoPtr->topOfEof < maxY) { |
| 1498 | dInfoPtr->topOfEof = maxY; |
| 1499 | } |
| 1500 | |
| 1501 | /* |
| 1502 | * Schedule the redisplay operation if there isn't one already |
| 1503 | * scheduled. |
| 1504 | */ |
| 1505 | |
| 1506 | if (!(dInfoPtr->flags & REDRAW_PENDING)) { |
| 1507 | dInfoPtr->flags |= REDRAW_PENDING; |
| 1508 | // Tk_DoWhenIdle(DisplayText, (ClientData) textPtr); |
| 1509 | assert(textPtr->updateTimerToken == NULL); |
| 1510 | if (textPtr->updateTimerToken == NULL) { |
| 1511 | textPtr->updateTimerToken = |
| 1512 | Tk_CreateTimerHandler( |
| 1513 | TextUpdateTime, |
no test coverage detected