aboutsummaryrefslogtreecommitdiffstats
path: root/src/window.h
diff options
context:
space:
mode:
authorKenichi Handa2012-08-16 21:25:17 +0900
committerKenichi Handa2012-08-16 21:25:17 +0900
commitd75ffb4ed0b2e72a9361a07d16a5c884a9459728 (patch)
tree8ac5a6a8ae033fef7fbc7fb7b09a703ef4b0ed5b /src/window.h
parent69c41c4070c86baac11a627e9c3d366420aeb7cc (diff)
parent250c8ab9b8f6322959fa3122db83944c30c3894b (diff)
downloademacs-d75ffb4ed0b2e72a9361a07d16a5c884a9459728.tar.gz
emacs-d75ffb4ed0b2e72a9361a07d16a5c884a9459728.zip
merge trunk
Diffstat (limited to 'src/window.h')
-rw-r--r--src/window.h164
1 files changed, 90 insertions, 74 deletions
diff --git a/src/window.h b/src/window.h
index 10cabed979b..77b31dafd8b 100644
--- a/src/window.h
+++ b/src/window.h
@@ -86,6 +86,10 @@ struct cursor_pos
86 int hpos, vpos; 86 int hpos, vpos;
87}; 87};
88 88
89/* Most code should use this macro to set Lisp fields in struct window. */
90
91#define WSET(w, field, value) ((w)->field = (value))
92
89struct window 93struct window
90 { 94 {
91 /* This is for Lisp; the terminal code does not refer to it. */ 95 /* This is for Lisp; the terminal code does not refer to it. */
@@ -96,13 +100,15 @@ struct window
96 100
97 /* Following (to right or down) and preceding (to left or up) child 101 /* Following (to right or down) and preceding (to left or up) child
98 at same level of tree. */ 102 at same level of tree. */
99 Lisp_Object next, prev; 103 Lisp_Object next;
104 Lisp_Object prev;
100 105
101 /* First child of this window: vchild is used if this is a vertical 106 /* First child of this window: vchild is used if this is a vertical
102 combination, hchild if this is a horizontal combination. Of the 107 combination, hchild if this is a horizontal combination. Of the
103 fields vchild, hchild and buffer, one and only one is non-nil 108 fields vchild, hchild and buffer, one and only one is non-nil
104 unless the window is dead. */ 109 unless the window is dead. */
105 Lisp_Object hchild, vchild; 110 Lisp_Object hchild;
111 Lisp_Object vchild;
106 112
107 /* The window this one is a child of. */ 113 /* The window this one is a child of. */
108 Lisp_Object parent; 114 Lisp_Object parent;
@@ -154,11 +160,13 @@ struct window
154 160
155 /* Width of left and right marginal areas. A value of nil means 161 /* Width of left and right marginal areas. A value of nil means
156 no margin. */ 162 no margin. */
157 Lisp_Object left_margin_cols, right_margin_cols; 163 Lisp_Object left_margin_cols;
164 Lisp_Object right_margin_cols;
158 165
159 /* Width of left and right fringes. 166 /* Width of left and right fringes.
160 A value of nil or t means use frame values. */ 167 A value of nil or t means use frame values. */
161 Lisp_Object left_fringe_width, right_fringe_width; 168 Lisp_Object left_fringe_width;
169 Lisp_Object right_fringe_width;
162 170
163 /* Pixel width of scroll bars. 171 /* Pixel width of scroll bars.
164 A value of nil or t means use frame values. */ 172 A value of nil or t means use frame values. */
@@ -388,13 +396,13 @@ struct window
388 This includes scroll bars and fringes. */ 396 This includes scroll bars and fringes. */
389 397
390#define WINDOW_TOTAL_COLS(W) \ 398#define WINDOW_TOTAL_COLS(W) \
391 (XFASTINT ((W)->total_cols)) 399 (XFASTINT (W->total_cols))
392 400
393/* Return the height of window W in canonical line units. 401/* Return the height of window W in canonical line units.
394 This includes header and mode lines, if any. */ 402 This includes header and mode lines, if any. */
395 403
396#define WINDOW_TOTAL_LINES(W) \ 404#define WINDOW_TOTAL_LINES(W) \
397 (XFASTINT ((W)->total_lines)) 405 (XFASTINT (W->total_lines))
398 406
399/* Return the total pixel width of window W. */ 407/* Return the total pixel width of window W. */
400 408
@@ -422,7 +430,7 @@ struct window
422 This includes a left-hand scroll bar, if any. */ 430 This includes a left-hand scroll bar, if any. */
423 431
424#define WINDOW_LEFT_EDGE_COL(W) \ 432#define WINDOW_LEFT_EDGE_COL(W) \
425 (XFASTINT ((W)->left_col)) 433 (XFASTINT (W->left_col))
426 434
427/* Return the canonical frame column before which window W ends. 435/* Return the canonical frame column before which window W ends.
428 This includes a right-hand scroll bar, if any. */ 436 This includes a right-hand scroll bar, if any. */
@@ -434,7 +442,7 @@ struct window
434 This includes a header line, if any. */ 442 This includes a header line, if any. */
435 443
436#define WINDOW_TOP_EDGE_LINE(W) \ 444#define WINDOW_TOP_EDGE_LINE(W) \
437 (XFASTINT ((W)->top_line)) 445 (XFASTINT (W->top_line))
438 446
439/* Return the canonical frame line before which window W ends. 447/* Return the canonical frame line before which window W ends.
440 This includes a mode line, if any. */ 448 This includes a mode line, if any. */
@@ -538,32 +546,32 @@ struct window
538 546
539/* Width of left margin area in columns. */ 547/* Width of left margin area in columns. */
540 548
541#define WINDOW_LEFT_MARGIN_COLS(W) \ 549#define WINDOW_LEFT_MARGIN_COLS(W) \
542 (NILP ((W)->left_margin_cols) \ 550 (NILP (W->left_margin_cols) \
543 ? 0 \ 551 ? 0 \
544 : XINT ((W)->left_margin_cols)) 552 : XINT (W->left_margin_cols))
545 553
546/* Width of right marginal area in columns. */ 554/* Width of right marginal area in columns. */
547 555
548#define WINDOW_RIGHT_MARGIN_COLS(W) \ 556#define WINDOW_RIGHT_MARGIN_COLS(W) \
549 (NILP ((W)->right_margin_cols) \ 557 (NILP (W->right_margin_cols) \
550 ? 0 \ 558 ? 0 \
551 : XINT ((W)->right_margin_cols)) 559 : XINT (W->right_margin_cols))
552 560
553/* Width of left margin area in pixels. */ 561/* Width of left margin area in pixels. */
554 562
555#define WINDOW_LEFT_MARGIN_WIDTH(W) \ 563#define WINDOW_LEFT_MARGIN_WIDTH(W) \
556 (NILP ((W)->left_margin_cols) \ 564 (NILP (W->left_margin_cols) \
557 ? 0 \ 565 ? 0 \
558 : (XINT ((W)->left_margin_cols) \ 566 : (XINT (W->left_margin_cols) \
559 * WINDOW_FRAME_COLUMN_WIDTH (W))) 567 * WINDOW_FRAME_COLUMN_WIDTH (W)))
560 568
561/* Width of right marginal area in pixels. */ 569/* Width of right marginal area in pixels. */
562 570
563#define WINDOW_RIGHT_MARGIN_WIDTH(W) \ 571#define WINDOW_RIGHT_MARGIN_WIDTH(W) \
564 (NILP ((W)->right_margin_cols) \ 572 (NILP (W->right_margin_cols) \
565 ? 0 \ 573 ? 0 \
566 : (XINT ((W)->right_margin_cols) \ 574 : (XINT (W->right_margin_cols) \
567 * WINDOW_FRAME_COLUMN_WIDTH (W))) 575 * WINDOW_FRAME_COLUMN_WIDTH (W)))
568 576
569/* Total width of fringes reserved for drawing truncation bitmaps, 577/* Total width of fringes reserved for drawing truncation bitmaps,
@@ -572,37 +580,37 @@ struct window
572 sizes aren't pixel values. If it weren't the case, we wouldn't be 580 sizes aren't pixel values. If it weren't the case, we wouldn't be
573 able to split windows horizontally nicely. */ 581 able to split windows horizontally nicely. */
574 582
575#define WINDOW_FRINGE_COLS(W) \ 583#define WINDOW_FRINGE_COLS(W) \
576 ((INTEGERP ((W)->left_fringe_width) \ 584 ((INTEGERP (W->left_fringe_width) \
577 || INTEGERP ((W)->right_fringe_width)) \ 585 || INTEGERP (W->right_fringe_width)) \
578 ? ((WINDOW_LEFT_FRINGE_WIDTH (W) \ 586 ? ((WINDOW_LEFT_FRINGE_WIDTH (W) \
579 + WINDOW_RIGHT_FRINGE_WIDTH (W) \ 587 + WINDOW_RIGHT_FRINGE_WIDTH (W) \
580 + WINDOW_FRAME_COLUMN_WIDTH (W) - 1) \ 588 + WINDOW_FRAME_COLUMN_WIDTH (W) - 1) \
581 / WINDOW_FRAME_COLUMN_WIDTH (W)) \ 589 / WINDOW_FRAME_COLUMN_WIDTH (W)) \
582 : FRAME_FRINGE_COLS (WINDOW_XFRAME (W))) 590 : FRAME_FRINGE_COLS (WINDOW_XFRAME (W)))
583 591
584/* Column-width of the left and right fringe. */ 592/* Column-width of the left and right fringe. */
585 593
586#define WINDOW_LEFT_FRINGE_COLS(W) \ 594#define WINDOW_LEFT_FRINGE_COLS(W) \
587 ((WINDOW_LEFT_FRINGE_WIDTH ((W)) \ 595 ((WINDOW_LEFT_FRINGE_WIDTH ((W)) \
588 + WINDOW_FRAME_COLUMN_WIDTH (W) - 1) \ 596 + WINDOW_FRAME_COLUMN_WIDTH (W) - 1) \
589 / WINDOW_FRAME_COLUMN_WIDTH (W)) 597 / WINDOW_FRAME_COLUMN_WIDTH (W))
590 598
591#define WINDOW_RIGHT_FRINGE_COLS(W) \ 599#define WINDOW_RIGHT_FRINGE_COLS(W) \
592 ((WINDOW_RIGHT_FRINGE_WIDTH ((W)) \ 600 ((WINDOW_RIGHT_FRINGE_WIDTH ((W)) \
593 + WINDOW_FRAME_COLUMN_WIDTH (W) - 1) \ 601 + WINDOW_FRAME_COLUMN_WIDTH (W) - 1) \
594 / WINDOW_FRAME_COLUMN_WIDTH (W)) 602 / WINDOW_FRAME_COLUMN_WIDTH (W))
595 603
596/* Pixel-width of the left and right fringe. */ 604/* Pixel-width of the left and right fringe. */
597 605
598#define WINDOW_LEFT_FRINGE_WIDTH(W) \ 606#define WINDOW_LEFT_FRINGE_WIDTH(W) \
599 (INTEGERP ((W)->left_fringe_width) \ 607 (INTEGERP (W->left_fringe_width) \
600 ? XFASTINT ((W)->left_fringe_width) \ 608 ? XFASTINT (W->left_fringe_width) \
601 : FRAME_LEFT_FRINGE_WIDTH (WINDOW_XFRAME (W))) 609 : FRAME_LEFT_FRINGE_WIDTH (WINDOW_XFRAME (W)))
602 610
603#define WINDOW_RIGHT_FRINGE_WIDTH(W) \ 611#define WINDOW_RIGHT_FRINGE_WIDTH(W) \
604 (INTEGERP ((W)->right_fringe_width) \ 612 (INTEGERP (W->right_fringe_width) \
605 ? XFASTINT ((W)->right_fringe_width) \ 613 ? XFASTINT (W->right_fringe_width) \
606 : FRAME_RIGHT_FRINGE_WIDTH (WINDOW_XFRAME (W))) 614 : FRAME_RIGHT_FRINGE_WIDTH (WINDOW_XFRAME (W)))
607 615
608/* Total width of fringes in pixels. */ 616/* Total width of fringes in pixels. */
@@ -619,36 +627,36 @@ struct window
619 and which side they are on. */ 627 and which side they are on. */
620 628
621#define WINDOW_VERTICAL_SCROLL_BAR_TYPE(w) \ 629#define WINDOW_VERTICAL_SCROLL_BAR_TYPE(w) \
622 (EQ ((w)->vertical_scroll_bar_type, Qt) \ 630 (EQ (w->vertical_scroll_bar_type, Qt) \
623 ? FRAME_VERTICAL_SCROLL_BAR_TYPE (WINDOW_XFRAME (w)) \ 631 ? FRAME_VERTICAL_SCROLL_BAR_TYPE (WINDOW_XFRAME (w)) \
624 : EQ ((w)->vertical_scroll_bar_type, Qleft) \ 632 : EQ (w->vertical_scroll_bar_type, Qleft) \
625 ? vertical_scroll_bar_left \ 633 ? vertical_scroll_bar_left \
626 : EQ ((w)->vertical_scroll_bar_type, Qright) \ 634 : EQ (w->vertical_scroll_bar_type, Qright) \
627 ? vertical_scroll_bar_right \ 635 ? vertical_scroll_bar_right \
628 : vertical_scroll_bar_none) \ 636 : vertical_scroll_bar_none) \
629 637
630#define WINDOW_HAS_VERTICAL_SCROLL_BAR(w) \ 638#define WINDOW_HAS_VERTICAL_SCROLL_BAR(w) \
631 (EQ ((w)->vertical_scroll_bar_type, Qt) \ 639 (EQ (w->vertical_scroll_bar_type, Qt) \
632 ? FRAME_HAS_VERTICAL_SCROLL_BARS (WINDOW_XFRAME (w)) \ 640 ? FRAME_HAS_VERTICAL_SCROLL_BARS (WINDOW_XFRAME (w)) \
633 : !NILP ((w)->vertical_scroll_bar_type)) 641 : !NILP (w->vertical_scroll_bar_type))
634 642
635#define WINDOW_HAS_VERTICAL_SCROLL_BAR_ON_LEFT(w) \ 643#define WINDOW_HAS_VERTICAL_SCROLL_BAR_ON_LEFT(w) \
636 (EQ ((w)->vertical_scroll_bar_type, Qt) \ 644 (EQ (w->vertical_scroll_bar_type, Qt) \
637 ? FRAME_HAS_VERTICAL_SCROLL_BARS_ON_LEFT (WINDOW_XFRAME (w)) \ 645 ? FRAME_HAS_VERTICAL_SCROLL_BARS_ON_LEFT (WINDOW_XFRAME (w)) \
638 : EQ ((w)->vertical_scroll_bar_type, Qleft)) 646 : EQ (w->vertical_scroll_bar_type, Qleft))
639 647
640#define WINDOW_HAS_VERTICAL_SCROLL_BAR_ON_RIGHT(w) \ 648#define WINDOW_HAS_VERTICAL_SCROLL_BAR_ON_RIGHT(w) \
641 (EQ ((w)->vertical_scroll_bar_type, Qt) \ 649 (EQ (w->vertical_scroll_bar_type, Qt) \
642 ? FRAME_HAS_VERTICAL_SCROLL_BARS_ON_RIGHT (WINDOW_XFRAME (w))\ 650 ? FRAME_HAS_VERTICAL_SCROLL_BARS_ON_RIGHT (WINDOW_XFRAME (w)) \
643 : EQ ((w)->vertical_scroll_bar_type, Qright)) 651 : EQ (w->vertical_scroll_bar_type, Qright))
644 652
645/* Width that a scroll bar in window W should have, if there is one. 653/* Width that a scroll bar in window W should have, if there is one.
646 Measured in pixels. If scroll bars are turned off, this is still 654 Measured in pixels. If scroll bars are turned off, this is still
647 nonzero. */ 655 nonzero. */
648 656
649#define WINDOW_CONFIG_SCROLL_BAR_WIDTH(w) \ 657#define WINDOW_CONFIG_SCROLL_BAR_WIDTH(w) \
650 (INTEGERP ((w)->scroll_bar_width) \ 658 (INTEGERP (w->scroll_bar_width) \
651 ? XFASTINT ((w)->scroll_bar_width) \ 659 ? XFASTINT (w->scroll_bar_width) \
652 : FRAME_CONFIG_SCROLL_BAR_WIDTH (WINDOW_XFRAME (w))) 660 : FRAME_CONFIG_SCROLL_BAR_WIDTH (WINDOW_XFRAME (w)))
653 661
654/* Width that a scroll bar in window W should have, if there is one. 662/* Width that a scroll bar in window W should have, if there is one.
@@ -656,8 +664,8 @@ struct window
656 this is still nonzero. */ 664 this is still nonzero. */
657 665
658#define WINDOW_CONFIG_SCROLL_BAR_COLS(w) \ 666#define WINDOW_CONFIG_SCROLL_BAR_COLS(w) \
659 (INTEGERP ((w)->scroll_bar_width) \ 667 (INTEGERP (w->scroll_bar_width) \
660 ? ((XFASTINT ((w)->scroll_bar_width) \ 668 ? ((XFASTINT (w->scroll_bar_width) \
661 + WINDOW_FRAME_COLUMN_WIDTH (w) - 1) \ 669 + WINDOW_FRAME_COLUMN_WIDTH (w) - 1) \
662 / WINDOW_FRAME_COLUMN_WIDTH (w)) \ 670 / WINDOW_FRAME_COLUMN_WIDTH (w)) \
663 : FRAME_CONFIG_SCROLL_BAR_COLS (WINDOW_XFRAME (w))) 671 : FRAME_CONFIG_SCROLL_BAR_COLS (WINDOW_XFRAME (w)))
@@ -667,14 +675,14 @@ struct window
667 the right in this frame, or there are no scroll bars, value is 0. */ 675 the right in this frame, or there are no scroll bars, value is 0. */
668 676
669#define WINDOW_LEFT_SCROLL_BAR_COLS(w) \ 677#define WINDOW_LEFT_SCROLL_BAR_COLS(w) \
670 (WINDOW_HAS_VERTICAL_SCROLL_BAR_ON_LEFT (w) \ 678 (WINDOW_HAS_VERTICAL_SCROLL_BAR_ON_LEFT (w) \
671 ? (WINDOW_CONFIG_SCROLL_BAR_COLS (w)) \ 679 ? (WINDOW_CONFIG_SCROLL_BAR_COLS (w)) \
672 : 0) 680 : 0)
673 681
674/* Width of a left scroll bar area in window W , measured in pixels. */ 682/* Width of a left scroll bar area in window W , measured in pixels. */
675 683
676#define WINDOW_LEFT_SCROLL_BAR_AREA_WIDTH(w) \ 684#define WINDOW_LEFT_SCROLL_BAR_AREA_WIDTH(w) \
677 (WINDOW_HAS_VERTICAL_SCROLL_BAR_ON_LEFT (w) \ 685 (WINDOW_HAS_VERTICAL_SCROLL_BAR_ON_LEFT (w) \
678 ? (WINDOW_CONFIG_SCROLL_BAR_COLS (w) * WINDOW_FRAME_COLUMN_WIDTH (w)) \ 686 ? (WINDOW_CONFIG_SCROLL_BAR_COLS (w) * WINDOW_FRAME_COLUMN_WIDTH (w)) \
679 : 0) 687 : 0)
680 688
@@ -683,7 +691,7 @@ struct window
683 the left in this frame, or there are no scroll bars, value is 0. */ 691 the left in this frame, or there are no scroll bars, value is 0. */
684 692
685#define WINDOW_RIGHT_SCROLL_BAR_COLS(w) \ 693#define WINDOW_RIGHT_SCROLL_BAR_COLS(w) \
686 (WINDOW_HAS_VERTICAL_SCROLL_BAR_ON_RIGHT (w) \ 694 (WINDOW_HAS_VERTICAL_SCROLL_BAR_ON_RIGHT (w) \
687 ? WINDOW_CONFIG_SCROLL_BAR_COLS (w) \ 695 ? WINDOW_CONFIG_SCROLL_BAR_COLS (w) \
688 : 0) 696 : 0)
689 697
@@ -705,7 +713,7 @@ struct window
705/* Width of a left scroll bar area in window W , measured in pixels. */ 713/* Width of a left scroll bar area in window W , measured in pixels. */
706 714
707#define WINDOW_SCROLL_BAR_AREA_WIDTH(w) \ 715#define WINDOW_SCROLL_BAR_AREA_WIDTH(w) \
708 (WINDOW_HAS_VERTICAL_SCROLL_BAR (w) \ 716 (WINDOW_HAS_VERTICAL_SCROLL_BAR (w) \
709 ? (WINDOW_CONFIG_SCROLL_BAR_COLS (w) * WINDOW_FRAME_COLUMN_WIDTH (w)) \ 717 ? (WINDOW_CONFIG_SCROLL_BAR_COLS (w) * WINDOW_FRAME_COLUMN_WIDTH (w)) \
710 : 0) 718 : 0)
711 719
@@ -726,7 +734,7 @@ struct window
726 ? CURRENT_MODE_LINE_HEIGHT (W) \ 734 ? CURRENT_MODE_LINE_HEIGHT (W) \
727 : 0) 735 : 0)
728 736
729#define WINDOW_MODE_LINE_LINES(W) \ 737#define WINDOW_MODE_LINE_LINES(W) \
730 (!! WINDOW_WANTS_MODELINE_P ((W))) 738 (!! WINDOW_WANTS_MODELINE_P ((W)))
731 739
732/* Height in pixels, and in lines, of the header line. 740/* Height in pixels, and in lines, of the header line.
@@ -737,7 +745,7 @@ struct window
737 ? CURRENT_HEADER_LINE_HEIGHT (W) \ 745 ? CURRENT_HEADER_LINE_HEIGHT (W) \
738 : 0) 746 : 0)
739 747
740#define WINDOW_HEADER_LINE_LINES(W) \ 748#define WINDOW_HEADER_LINE_LINES(W) \
741 (!! WINDOW_WANTS_HEADER_LINE_P ((W))) 749 (!! WINDOW_WANTS_HEADER_LINE_P ((W)))
742 750
743/* Pixel height of window W without mode line. */ 751/* Pixel height of window W without mode line. */
@@ -748,36 +756,36 @@ struct window
748 756
749/* Pixel height of window W without mode and header line. */ 757/* Pixel height of window W without mode and header line. */
750 758
751#define WINDOW_BOX_TEXT_HEIGHT(W) \ 759#define WINDOW_BOX_TEXT_HEIGHT(W) \
752 (WINDOW_TOTAL_HEIGHT ((W)) \ 760 (WINDOW_TOTAL_HEIGHT ((W)) \
753 - WINDOW_MODE_LINE_HEIGHT ((W)) \ 761 - WINDOW_MODE_LINE_HEIGHT ((W)) \
754 - WINDOW_HEADER_LINE_HEIGHT ((W))) 762 - WINDOW_HEADER_LINE_HEIGHT ((W)))
755 763
756 764
757/* Convert window W relative pixel X to frame pixel coordinates. */ 765/* Convert window W relative pixel X to frame pixel coordinates. */
758 766
759#define WINDOW_TO_FRAME_PIXEL_X(W, X) \ 767#define WINDOW_TO_FRAME_PIXEL_X(W, X) \
760 ((X) + WINDOW_BOX_LEFT_EDGE_X ((W))) 768 ((X) + WINDOW_BOX_LEFT_EDGE_X ((W)))
761 769
762/* Convert window W relative pixel Y to frame pixel coordinates. */ 770/* Convert window W relative pixel Y to frame pixel coordinates. */
763 771
764#define WINDOW_TO_FRAME_PIXEL_Y(W, Y) \ 772#define WINDOW_TO_FRAME_PIXEL_Y(W, Y) \
765 ((Y) + WINDOW_TOP_EDGE_Y ((W))) 773 ((Y) + WINDOW_TOP_EDGE_Y ((W)))
766 774
767/* Convert frame relative pixel X to window relative pixel X. */ 775/* Convert frame relative pixel X to window relative pixel X. */
768 776
769#define FRAME_TO_WINDOW_PIXEL_X(W, X) \ 777#define FRAME_TO_WINDOW_PIXEL_X(W, X) \
770 ((X) - WINDOW_BOX_LEFT_EDGE_X ((W))) 778 ((X) - WINDOW_BOX_LEFT_EDGE_X ((W)))
771 779
772/* Convert frame relative pixel Y to window relative pixel Y. */ 780/* Convert frame relative pixel Y to window relative pixel Y. */
773 781
774#define FRAME_TO_WINDOW_PIXEL_Y(W, Y) \ 782#define FRAME_TO_WINDOW_PIXEL_Y(W, Y) \
775 ((Y) - WINDOW_TOP_EDGE_Y ((W))) 783 ((Y) - WINDOW_TOP_EDGE_Y ((W)))
776 784
777/* Convert a text area relative x-position in window W to frame X 785/* Convert a text area relative x-position in window W to frame X
778 pixel coordinates. */ 786 pixel coordinates. */
779 787
780#define WINDOW_TEXT_TO_FRAME_PIXEL_X(W, X) \ 788#define WINDOW_TEXT_TO_FRAME_PIXEL_X(W, X) \
781 (window_box_left ((W), TEXT_AREA) + (X)) 789 (window_box_left ((W), TEXT_AREA) + (X))
782 790
783/* This is the window in which the terminal's cursor should 791/* This is the window in which the terminal's cursor should
@@ -877,17 +885,25 @@ extern void check_frame_size (struct frame *frame, int *rows, int *cols);
877 885
878struct glyph *get_phys_cursor_glyph (struct window *w); 886struct glyph *get_phys_cursor_glyph (struct window *w);
879 887
880/* Value is non-zero if WINDOW is a live window. */ 888/* Value is non-zero if WINDOW is a valid window. */
889#define WINDOW_VALID_P(WINDOW) \
890 (WINDOWP (WINDOW) \
891 && (!NILP (XWINDOW (WINDOW)->buffer) \
892 || !NILP (XWINDOW (WINDOW)->vchild) \
893 || !NILP (XWINDOW (WINDOW)->hchild)))
881 894
882#define WINDOW_LIVE_P(WINDOW) \
883 (WINDOWP ((WINDOW)) && !NILP (XWINDOW ((WINDOW))->buffer))
884 895
896/* Value is non-zero if WINDOW is a live window. */
897#define WINDOW_LIVE_P(WINDOW) \
898 (WINDOWP (WINDOW) && !NILP (XWINDOW (WINDOW)->buffer))
885 899
886/* These used to be in lisp.h. */ 900/* These used to be in lisp.h. */
887 901
888extern Lisp_Object Qwindowp, Qwindow_live_p; 902extern Lisp_Object Qwindowp, Qwindow_live_p;
889extern Lisp_Object Vwindow_list; 903extern Lisp_Object Vwindow_list;
890 904
905extern struct window *decode_valid_window (Lisp_Object);
906extern struct window *decode_live_window (Lisp_Object);
891extern int compare_window_configurations (Lisp_Object, Lisp_Object, int); 907extern int compare_window_configurations (Lisp_Object, Lisp_Object, int);
892extern void mark_window_cursors_off (struct window *); 908extern void mark_window_cursors_off (struct window *);
893extern int window_internal_height (struct window *); 909extern int window_internal_height (struct window *);