aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRichard M. Stallman2003-06-03 11:12:48 +0000
committerRichard M. Stallman2003-06-03 11:12:48 +0000
commitc99a9eb33f02b1a444a8070d0d0297f0a0d4f0ec (patch)
tree97d0f1069ee5475d14217fb59302ad931a7ea470 /src
parent01aa0b2e3b548ce976c215ce94f35b7299aee597 (diff)
downloademacs-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.c79
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. */)
481DEFUN ("window-edges", Fwindow_edges, Swindow_edges, 0, 1, 0, 481DEFUN ("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.
484RIGHT is one more than the rightmost column used by WINDOW, 484RIGHT is one more than the rightmost column occupied by WINDOW,
485and BOTTOM is one more than the bottommost row used by WINDOW 485and BOTTOM is one more than the bottommost row occupied by WINDOW.
486 and its mode-line. */) 486The edges include the space used by the window's scroll bar,
487display margins, fringes, header line, and mode line, if it has them.
488To 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
501DEFUN ("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.
504RIGHT is one more than the rightmost x position occupied by WINDOW,
505and BOTTOM is one more than the bottommost y position occupied by WINDOW.
506The pixel edges include the space used by the window's scroll bar,
507display margins, fringes, header line, and mode line, if it has them.
508To 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
521DEFUN ("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.
524RIGHT is one more than the rightmost column used by text in WINDOW,
525and BOTTOM is one more than the bottommost row used by text in WINDOW.
526The inside edges do not include the space used by the window's scroll bar,
527display 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
545DEFUN ("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.
548RIGHT is one more than the rightmost x position used by text in WINDOW,
549and BOTTOM is one more than the bottommost y position used by text in WINDOW.
550The inside edges do not include the space used by the window's scroll bar,
551display 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);