diff options
| author | Richard M. Stallman | 2003-06-03 11:12:48 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 2003-06-03 11:12:48 +0000 |
| commit | c99a9eb33f02b1a444a8070d0d0297f0a0d4f0ec (patch) | |
| tree | 97d0f1069ee5475d14217fb59302ad931a7ea470 /src | |
| parent | 01aa0b2e3b548ce976c215ce94f35b7299aee597 (diff) | |
| download | emacs-c99a9eb33f02b1a444a8070d0d0297f0a0d4f0ec.tar.gz emacs-c99a9eb33f02b1a444a8070d0d0297f0a0d4f0ec.zip | |
(Fwindow_edges): Doc fix.
(Fwindow_pixel_edges, Fwindow_inside_edges)
(Fwindow_inside_pixel_edges): New functions.
(syms_of_window): defsubr them.
Diffstat (limited to 'src')
| -rw-r--r-- | src/window.c | 79 |
1 files changed, 76 insertions, 3 deletions
diff --git a/src/window.c b/src/window.c index 81b089017e0..f5f67a627f6 100644 --- a/src/window.c +++ b/src/window.c | |||
| @@ -481,9 +481,11 @@ Afterwards the end-trigger value is reset to nil. */) | |||
| 481 | DEFUN ("window-edges", Fwindow_edges, Swindow_edges, 0, 1, 0, | 481 | DEFUN ("window-edges", Fwindow_edges, Swindow_edges, 0, 1, 0, |
| 482 | doc: /* Return a list of the edge coordinates of WINDOW. | 482 | doc: /* Return a list of the edge coordinates of WINDOW. |
| 483 | \(LEFT TOP RIGHT BOTTOM), all relative to 0, 0 at top left corner of frame. | 483 | \(LEFT TOP RIGHT BOTTOM), all relative to 0, 0 at top left corner of frame. |
| 484 | RIGHT is one more than the rightmost column used by WINDOW, | 484 | RIGHT is one more than the rightmost column occupied by WINDOW, |
| 485 | and BOTTOM is one more than the bottommost row used by WINDOW | 485 | and BOTTOM is one more than the bottommost row occupied by WINDOW. |
| 486 | and its mode-line. */) | 486 | The edges include the space used by the window's scroll bar, |
| 487 | display margins, fringes, header line, and mode line, if it has them. | ||
| 488 | To get the edges of the actual text area, use `window-inside-edges'. */) | ||
| 487 | (window) | 489 | (window) |
| 488 | Lisp_Object window; | 490 | Lisp_Object window; |
| 489 | { | 491 | { |
| @@ -496,6 +498,74 @@ and BOTTOM is one more than the bottommost row used by WINDOW | |||
| 496 | Qnil)))); | 498 | Qnil)))); |
| 497 | } | 499 | } |
| 498 | 500 | ||
| 501 | DEFUN ("window-pixel-edges", Fwindow_pixel_edges, Swindow_pixel_edges, 0, 1, 0, | ||
| 502 | doc: /* Return a list of the edge pixel coordinates of WINDOW. | ||
| 503 | \(LEFT TOP RIGHT BOTTOM), all relative to 0, 0 at top left corner of frame. | ||
| 504 | RIGHT is one more than the rightmost x position occupied by WINDOW, | ||
| 505 | and BOTTOM is one more than the bottommost y position occupied by WINDOW. | ||
| 506 | The pixel edges include the space used by the window's scroll bar, | ||
| 507 | display margins, fringes, header line, and mode line, if it has them. | ||
| 508 | To get the edges of the actual text area, use `window-inside-pixel-edges'. */) | ||
| 509 | (window) | ||
| 510 | Lisp_Object window; | ||
| 511 | { | ||
| 512 | register struct window *w = decode_window (window); | ||
| 513 | |||
| 514 | return Fcons (make_number (WINDOW_LEFT_EDGE_X (w)), | ||
| 515 | Fcons (make_number (WINDOW_TOP_EDGE_Y (w)), | ||
| 516 | Fcons (make_number (WINDOW_RIGHT_EDGE_X (w)), | ||
| 517 | Fcons (make_number (WINDOW_BOTTOM_EDGE_Y (w)), | ||
| 518 | Qnil)))); | ||
| 519 | } | ||
| 520 | |||
| 521 | DEFUN ("window-inside-edges", Fwindow_inside_edges, Swindow_inside_edges, 0, 1, 0, | ||
| 522 | doc: /* Return a list of the edge coordinates of WINDOW. | ||
| 523 | \(LEFT TOP RIGHT BOTTOM), all relative to 0, 0 at top left corner of frame. | ||
| 524 | RIGHT is one more than the rightmost column used by text in WINDOW, | ||
| 525 | and BOTTOM is one more than the bottommost row used by text in WINDOW. | ||
| 526 | The inside edges do not include the space used by the window's scroll bar, | ||
| 527 | display margins, fringes, header line, and/or mode line. */) | ||
| 528 | (window) | ||
| 529 | Lisp_Object window; | ||
| 530 | { | ||
| 531 | register struct window *w = decode_window (window); | ||
| 532 | |||
| 533 | return list4 (make_number (WINDOW_BOX_LEFT_EDGE_COL (w) | ||
| 534 | + WINDOW_LEFT_MARGIN_COLS (w) | ||
| 535 | + WINDOW_LEFT_FRINGE_COLS (w)), | ||
| 536 | make_number (WINDOW_TOP_EDGE_LINE (w) | ||
| 537 | + WINDOW_HEADER_LINE_LINES (w)), | ||
| 538 | make_number (WINDOW_RIGHT_EDGE_COL (w) | ||
| 539 | - WINDOW_RIGHT_MARGIN_COLS (w) | ||
| 540 | - WINDOW_RIGHT_FRINGE_COLS (w)), | ||
| 541 | make_number (WINDOW_BOTTOM_EDGE_LINE (w) | ||
| 542 | - WINDOW_MODE_LINE_LINES (w))); | ||
| 543 | } | ||
| 544 | |||
| 545 | DEFUN ("window-inside-pixel-edges", Fwindow_inside_pixel_edges, Swindow_inside_pixel_edges, 0, 1, 0, | ||
| 546 | doc: /* Return a list of the edge coordinates of WINDOW. | ||
| 547 | \(LEFT TOP RIGHT BOTTOM), all relative to 0, 0 at top left corner of frame. | ||
| 548 | RIGHT is one more than the rightmost x position used by text in WINDOW, | ||
| 549 | and BOTTOM is one more than the bottommost y position used by text in WINDOW. | ||
| 550 | The inside edges do not include the space used by the window's scroll bar, | ||
| 551 | display margins, fringes, header line, and/or mode line. */) | ||
| 552 | (window) | ||
| 553 | Lisp_Object window; | ||
| 554 | { | ||
| 555 | register struct window *w = decode_window (window); | ||
| 556 | |||
| 557 | return list4 (make_number (WINDOW_BOX_LEFT_EDGE_X (w) | ||
| 558 | + WINDOW_LEFT_MARGIN_WIDTH (w) | ||
| 559 | + WINDOW_LEFT_FRINGE_WIDTH (w)), | ||
| 560 | make_number (WINDOW_TOP_EDGE_Y (w) | ||
| 561 | + WINDOW_HEADER_LINE_HEIGHT (w)), | ||
| 562 | make_number (WINDOW_RIGHT_EDGE_X (w) | ||
| 563 | - WINDOW_RIGHT_MARGIN_WIDTH (w) | ||
| 564 | - WINDOW_RIGHT_FRINGE_WIDTH (w)), | ||
| 565 | make_number (WINDOW_BOTTOM_EDGE_Y (w) | ||
| 566 | - WINDOW_MODE_LINE_HEIGHT (w))); | ||
| 567 | } | ||
| 568 | |||
| 499 | /* Test if the character at column *X, row *Y is within window W. | 569 | /* Test if the character at column *X, row *Y is within window W. |
| 500 | If it is not, return ON_NOTHING; | 570 | If it is not, return ON_NOTHING; |
| 501 | if it is in the window's text area, | 571 | if it is in the window's text area, |
| @@ -6347,6 +6417,9 @@ This variable automatically becomes buffer-local when set. */); | |||
| 6347 | defsubr (&Swindow_redisplay_end_trigger); | 6417 | defsubr (&Swindow_redisplay_end_trigger); |
| 6348 | defsubr (&Sset_window_redisplay_end_trigger); | 6418 | defsubr (&Sset_window_redisplay_end_trigger); |
| 6349 | defsubr (&Swindow_edges); | 6419 | defsubr (&Swindow_edges); |
| 6420 | defsubr (&Swindow_pixel_edges); | ||
| 6421 | defsubr (&Swindow_inside_edges); | ||
| 6422 | defsubr (&Swindow_inside_pixel_edges); | ||
| 6350 | defsubr (&Scoordinates_in_window_p); | 6423 | defsubr (&Scoordinates_in_window_p); |
| 6351 | defsubr (&Swindow_at); | 6424 | defsubr (&Swindow_at); |
| 6352 | defsubr (&Swindow_point); | 6425 | defsubr (&Swindow_point); |