comparison src/scrollbar.c @ 442:abe6d1db359e r21-2-36

Import from CVS: tag r21-2-36
author cvs
date Mon, 13 Aug 2007 11:35:02 +0200
parents 8de8e3f6228a
children 576fb035e263
comparison
equal deleted inserted replaced
441:72a7cfa4a488 442:abe6d1db359e
458 if (vertical) 458 if (vertical)
459 { 459 {
460 if (!NILP (w->scrollbar_on_left_p)) 460 if (!NILP (w->scrollbar_on_left_p))
461 { 461 {
462 x_offset = WINDOW_LEFT (w); 462 x_offset = WINDOW_LEFT (w);
463 if (window_is_leftmost (w))
464 x_offset += FRAME_LEFT_GUTTER_BOUNDS (f);
465 } 463 }
466 else 464 else
467 { 465 {
468 x_offset = WINDOW_RIGHT (w) - scrollbar_width; 466 x_offset = WINDOW_RIGHT (w) - scrollbar_width;
469 if (window_is_rightmost (w))
470 x_offset -= FRAME_RIGHT_GUTTER_BOUNDS (f);
471 if (window_needs_vertical_divider (w)) 467 if (window_needs_vertical_divider (w))
472 x_offset -= window_divider_width (w); 468 x_offset -= window_divider_width (w);
473 } 469 }
474 y_offset = WINDOW_TEXT_TOP (w) + f->scrollbar_y_offset; 470 y_offset = WINDOW_TEXT_TOP (w) + f->scrollbar_y_offset;
475 } 471 }
479 y_offset = f->scrollbar_y_offset; 475 y_offset = f->scrollbar_y_offset;
480 476
481 if (!NILP (w->scrollbar_on_top_p)) 477 if (!NILP (w->scrollbar_on_top_p))
482 { 478 {
483 y_offset += WINDOW_TOP (w); 479 y_offset += WINDOW_TOP (w);
484 if (window_is_highest (w))
485 y_offset += FRAME_TOP_GUTTER_BOUNDS (f);
486 } 480 }
487 else 481 else
488 { 482 {
489 y_offset += WINDOW_TEXT_BOTTOM (w); 483 y_offset += WINDOW_TEXT_BOTTOM (w);
490 } 484 }
739 CHECK_LIVE_WINDOW (window); 733 CHECK_LIVE_WINDOW (window);
740 /* Motif and Athena scrollbars behave differently, but in accordance 734 /* Motif and Athena scrollbars behave differently, but in accordance
741 with their standard behaviors. It is not possible to hide the 735 with their standard behaviors. It is not possible to hide the
742 differences down in lwlib because knowledge of XEmacs buffer and 736 differences down in lwlib because knowledge of XEmacs buffer and
743 cursor motion routines is necessary. */ 737 cursor motion routines is necessary. */
744 #if defined (LWLIB_SCROLLBARS_MOTIF) || defined (LWLIB_SCROLLBARS_LUCID) || \ 738
745 defined (LWLIB_SCROLLBARS_ATHENA3D) || defined(HAVE_MS_WINDOWS) 739 if (NILP (XCDR (object)))
746 window_scroll (window, Qnil, -1, ERROR_ME_NOT); 740 window_scroll (window, Qnil, -1, ERROR_ME_NOT);
747 #else /* Athena */ 741 else
748 { 742 {
749 Bufpos bufpos; 743 Bufpos bufpos;
750 Lisp_Object value = Fcdr (object); 744 Lisp_Object value = Fcdr (object);
751 745
752 CHECK_INT (value); 746 CHECK_INT (value);
753 Fmove_to_window_line (Qzero, window); 747 Fmove_to_window_line (Qzero, window);
754 /* can't use Fvertical_motion() because it moves the buffer point 748 /* can't use Fvertical_motion() because it moves the buffer point
755 rather than the window's point. 749 rather than the window's point.
756 750
757 #### It does? Why does it take a window argument then? */ 751 #### It does? Why does it take a window argument then? */
758 bufpos = vmotion (XWINDOW (window), XINT (Fwindow_point (window)), 752 bufpos = vmotion (XWINDOW (window), XINT (Fwindow_point (window)),
759 XINT (value), 0); 753 XINT (value), 0);
760 Fset_window_point (window, make_int (bufpos)); 754 Fset_window_point (window, make_int (bufpos));
761 Fcenter_to_window_line (Qzero, window); 755 Fcenter_to_window_line (Qzero, window);
762 } 756 }
763 #endif /* Athena */ 757
764 zmacs_region_stays = 1; 758 zmacs_region_stays = 1;
765 return Qnil; 759 return Qnil;
766 } 760 }
767 761
768 DEFUN ("scrollbar-page-down", Fscrollbar_page_down, 1, 1, 0, /* 762 DEFUN ("scrollbar-page-down", Fscrollbar_page_down, 1, 1, 0, /*
780 CHECK_LIVE_WINDOW (window); 774 CHECK_LIVE_WINDOW (window);
781 /* Motif and Athena scrollbars behave differently, but in accordance 775 /* Motif and Athena scrollbars behave differently, but in accordance
782 with their standard behaviors. It is not possible to hide the 776 with their standard behaviors. It is not possible to hide the
783 differences down in lwlib because knowledge of XEmacs buffer and 777 differences down in lwlib because knowledge of XEmacs buffer and
784 cursor motion routines is necessary. */ 778 cursor motion routines is necessary. */
785 #if defined (LWLIB_SCROLLBARS_MOTIF) || defined (LWLIB_SCROLLBARS_LUCID) || \ 779
786 defined (LWLIB_SCROLLBARS_ATHENA3D) || defined (HAVE_MS_WINDOWS) 780 if (NILP (XCDR (object)))
787 window_scroll (window, Qnil, 1, ERROR_ME_NOT); 781 window_scroll (window, Qnil, 1, ERROR_ME_NOT);
788 #else /* Athena */ 782 else
789 { 783 {
790 Lisp_Object value = Fcdr (object); 784 Lisp_Object value = Fcdr (object);
791 CHECK_INT (value); 785 CHECK_INT (value);
792 Fmove_to_window_line (value, window); 786 Fmove_to_window_line (value, window);
793 Fcenter_to_window_line (Qzero, window); 787 Fcenter_to_window_line (Qzero, window);
794 } 788 }
795 #endif /* Athena */ 789
796 zmacs_region_stays = 1; 790 zmacs_region_stays = 1;
797 return Qnil; 791 return Qnil;
798 } 792 }
799 793
800 DEFUN ("scrollbar-to-top", Fscrollbar_to_top, 1, 1, 0, /* 794 DEFUN ("scrollbar-to-top", Fscrollbar_to_top, 1, 1, 0, /*
1008 DEFVAR_SPECIFIER ("scrollbar-on-left-p", &Vscrollbar_on_left_p /* 1002 DEFVAR_SPECIFIER ("scrollbar-on-left-p", &Vscrollbar_on_left_p /*
1009 *Whether the vertical scrollbar is on the left side of window or frame. 1003 *Whether the vertical scrollbar is on the left side of window or frame.
1010 This is a specifier; use `set-specifier' to change it. 1004 This is a specifier; use `set-specifier' to change it.
1011 */ ); 1005 */ );
1012 Vscrollbar_on_left_p = Fmake_specifier (Qboolean); 1006 Vscrollbar_on_left_p = Fmake_specifier (Qboolean);
1013 1007
1014 { 1008 {
1015 /* Kludge. Under X, we want athena scrollbars on the left, 1009 /* Kludge. Under X, we want athena scrollbars on the left,
1016 while all other scrollbars go on the right by default. */ 1010 while all other scrollbars go on the right by default. */
1017 Lisp_Object fallback = list1 (Fcons (Qnil, Qnil)); 1011 Lisp_Object fallback = list1 (Fcons (Qnil, Qnil));
1018 #if defined (HAVE_X_WINDOWS) \ 1012 #if defined (HAVE_X_WINDOWS) \