comparison src/scrollbar.c @ 20:859a2309aef8 r19-15b93

Import from CVS: tag r19-15b93
author cvs
date Mon, 13 Aug 2007 08:50:05 +0200
parents 0293115a14e9
children 441bb1e64a06
comparison
equal deleted inserted replaced
19:ac1f612d5250 20:859a2309aef8
673 else 673 else
674 Fset_window_point (win, orig_pt); 674 Fset_window_point (win, orig_pt);
675 } 675 }
676 } 676 }
677 677
678 DEFUN ("scrollbar-line-up", Fscrollbar_line_up, Sscrollbar_line_up, 1, 1, 0 /* 678 DEFUN ("scrollbar-line-up", Fscrollbar_line_up, 1, 1, 0, /*
679 Function called when the line-up arrow on the scrollbar is clicked. 679 Function called when the line-up arrow on the scrollbar is clicked.
680 This is the little arrow at the top of the scrollbar. One argument, the 680 This is the little arrow at the top of the scrollbar. One argument, the
681 scrollbar's window. You can advise this function to change the scrollbar 681 scrollbar's window. You can advise this function to change the scrollbar
682 behavior. 682 behavior.
683 */ ) 683 */
684 (window) 684 (window))
685 Lisp_Object window;
686 { 685 {
687 CHECK_LIVE_WINDOW (window); 686 CHECK_LIVE_WINDOW (window);
688 window_scroll (window, make_int (1), -1, ERROR_ME_NOT); 687 window_scroll (window, make_int (1), -1, ERROR_ME_NOT);
689 zmacs_region_stays = 1; 688 zmacs_region_stays = 1;
690 return Qnil; 689 return Qnil;
691 } 690 }
692 691
693 DEFUN ("scrollbar-line-down", Fscrollbar_line_down, Sscrollbar_line_down, 692 DEFUN ("scrollbar-line-down", Fscrollbar_line_down, 1, 1, 0, /*
694 1, 1, 0 /*
695 Function called when the line-down arrow on the scrollbar is clicked. 693 Function called when the line-down arrow on the scrollbar is clicked.
696 This is the little arrow at the bottom of the scrollbar. One argument, the 694 This is the little arrow at the bottom of the scrollbar. One argument, the
697 scrollbar's window. You can advise this function to change the scrollbar 695 scrollbar's window. You can advise this function to change the scrollbar
698 behavior. 696 behavior.
699 */ ) 697 */
700 (window) 698 (window))
701 Lisp_Object window;
702 { 699 {
703 CHECK_LIVE_WINDOW (window); 700 CHECK_LIVE_WINDOW (window);
704 window_scroll (window, make_int (1), 1, ERROR_ME_NOT); 701 window_scroll (window, make_int (1), 1, ERROR_ME_NOT);
705 zmacs_region_stays = 1; 702 zmacs_region_stays = 1;
706 return Qnil; 703 return Qnil;
707 } 704 }
708 705
709 DEFUN ("scrollbar-page-up", Fscrollbar_page_up, Sscrollbar_page_up, 706 DEFUN ("scrollbar-page-up", Fscrollbar_page_up, 1, 1, 0, /*
710 1, 1, 0 /*
711 Function called when the user gives the \"page-up\" scrollbar action. 707 Function called when the user gives the \"page-up\" scrollbar action.
712 (The way this is done can vary from scrollbar to scrollbar.) One argument, 708 (The way this is done can vary from scrollbar to scrollbar.) One argument,
713 a cons containing the scrollbar's window and a value (#### document me! 709 a cons containing the scrollbar's window and a value (#### document me!
714 This value is nil for Motif/Lucid scrollbars and a number for Athena 710 This value is nil for Motif/Lucid scrollbars and a number for Athena
715 scrollbars). You can advise this function to change the scrollbar 711 scrollbars). You can advise this function to change the scrollbar
716 behavior. 712 behavior.
717 */ ) 713 */
718 (object) 714 (object))
719 Lisp_Object object;
720 { 715 {
721 Lisp_Object window = Fcar (object); 716 Lisp_Object window = Fcar (object);
722 717
723 CHECK_LIVE_WINDOW (window); 718 CHECK_LIVE_WINDOW (window);
724 /* Motif and Athena scrollbars behave differently, but in accordance 719 /* Motif and Athena scrollbars behave differently, but in accordance
747 #endif /* Athena */ 742 #endif /* Athena */
748 zmacs_region_stays = 1; 743 zmacs_region_stays = 1;
749 return Qnil; 744 return Qnil;
750 } 745 }
751 746
752 DEFUN ("scrollbar-page-down", Fscrollbar_page_down, Sscrollbar_page_down, 747 DEFUN ("scrollbar-page-down", Fscrollbar_page_down, 1, 1, 0, /*
753 1, 1, 0 /*
754 Function called when the user gives the \"page-down\" scrollbar action. 748 Function called when the user gives the \"page-down\" scrollbar action.
755 (The way this is done can vary from scrollbar to scrollbar.) One argument, 749 (The way this is done can vary from scrollbar to scrollbar.) One argument,
756 a cons containing the scrollbar's window and a value (#### document me! 750 a cons containing the scrollbar's window and a value (#### document me!
757 This value is nil for Motif/Lucid scrollbars and a number for Athena 751 This value is nil for Motif/Lucid scrollbars and a number for Athena
758 scrollbars). You can advise this function to change the scrollbar 752 scrollbars). You can advise this function to change the scrollbar
759 behavior. 753 behavior.
760 */ ) 754 */
761 (object) 755 (object))
762 Lisp_Object object;
763 { 756 {
764 Lisp_Object window = Fcar (object); 757 Lisp_Object window = Fcar (object);
765 758
766 CHECK_LIVE_WINDOW (window); 759 CHECK_LIVE_WINDOW (window);
767 /* Motif and Athena scrollbars behave differently, but in accordance 760 /* Motif and Athena scrollbars behave differently, but in accordance
781 #endif /* Athena */ 774 #endif /* Athena */
782 zmacs_region_stays = 1; 775 zmacs_region_stays = 1;
783 return Qnil; 776 return Qnil;
784 } 777 }
785 778
786 DEFUN ("scrollbar-to-top", Fscrollbar_to_top, Sscrollbar_to_top, 779 DEFUN ("scrollbar-to-top", Fscrollbar_to_top, 1, 1, 0, /*
787 1, 1, 0 /*
788 Function called when the user gives the \"to-top\" scrollbar action. 780 Function called when the user gives the \"to-top\" scrollbar action.
789 (The way this is done can vary from scrollbar to scrollbar.). One argument, 781 (The way this is done can vary from scrollbar to scrollbar.). One argument,
790 the scrollbar's window. You can advise this function to change the 782 the scrollbar's window. You can advise this function to change the
791 scrollbar behavior. 783 scrollbar behavior.
792 */ ) 784 */
793 (window) 785 (window))
794 Lisp_Object window;
795 { 786 {
796 Lisp_Object orig_pt; 787 Lisp_Object orig_pt;
797 788
798 orig_pt = Fwindow_point (window); 789 orig_pt = Fwindow_point (window);
799 Fset_window_point (window, Fpoint_min (Fwindow_buffer (window))); 790 Fset_window_point (window, Fpoint_min (Fwindow_buffer (window)));
801 scrollbar_reset_cursor (window, orig_pt); 792 scrollbar_reset_cursor (window, orig_pt);
802 zmacs_region_stays = 1; 793 zmacs_region_stays = 1;
803 return Qnil; 794 return Qnil;
804 } 795 }
805 796
806 DEFUN ("scrollbar-to-bottom", Fscrollbar_to_bottom, Sscrollbar_to_bottom, 797 DEFUN ("scrollbar-to-bottom", Fscrollbar_to_bottom, 1, 1, 0, /*
807 1, 1, 0 /*
808 Function called when the user gives the \"to-bottom\" scrollbar action. 798 Function called when the user gives the \"to-bottom\" scrollbar action.
809 (The way this is done can vary from scrollbar to scrollbar.). One argument, 799 (The way this is done can vary from scrollbar to scrollbar.). One argument,
810 the scrollbar's window. You can advise this function to change the 800 the scrollbar's window. You can advise this function to change the
811 scrollbar behavior. 801 scrollbar behavior.
812 */ ) 802 */
813 (window) 803 (window))
814 Lisp_Object window;
815 { 804 {
816 Lisp_Object orig_pt; 805 Lisp_Object orig_pt;
817 806
818 orig_pt = Fwindow_point (window); 807 orig_pt = Fwindow_point (window);
819 Fset_window_point (window, Fpoint_max (Fwindow_buffer (window))); 808 Fset_window_point (window, Fpoint_max (Fwindow_buffer (window)));
821 scrollbar_reset_cursor (window, orig_pt); 810 scrollbar_reset_cursor (window, orig_pt);
822 zmacs_region_stays = 1; 811 zmacs_region_stays = 1;
823 return Qnil; 812 return Qnil;
824 } 813 }
825 814
826 DEFUN ("scrollbar-vertical-drag", Fscrollbar_vertical_drag, 815 DEFUN ("scrollbar-vertical-drag", Fscrollbar_vertical_drag, 1, 1, 0, /*
827 Sscrollbar_vertical_drag, 1, 1, 0 /*
828 Function called when the user drags the vertical scrollbar thumb. 816 Function called when the user drags the vertical scrollbar thumb.
829 One argument, a cons containing the scrollbar's window and a value 817 One argument, a cons containing the scrollbar's window and a value
830 between point-min and point-max. You can advise this function to 818 between point-min and point-max. You can advise this function to
831 change the scrollbar behavior. 819 change the scrollbar behavior.
832 */ ) 820 */
833 (object) 821 (object))
834 Lisp_Object object;
835 { 822 {
836 Bufpos start_pos; 823 Bufpos start_pos;
837 Lisp_Object orig_pt; 824 Lisp_Object orig_pt;
838 Lisp_Object window = Fcar (object); 825 Lisp_Object window = Fcar (object);
839 Lisp_Object value = Fcdr (object); 826 Lisp_Object value = Fcdr (object);
845 scrollbar_reset_cursor (window, orig_pt); 832 scrollbar_reset_cursor (window, orig_pt);
846 zmacs_region_stays = 1; 833 zmacs_region_stays = 1;
847 return Qnil; 834 return Qnil;
848 } 835 }
849 836
850 DEFUN ("scrollbar-set-hscroll", Fscrollbar_set_hscroll, Sscrollbar_set_hscroll, 837 DEFUN ("scrollbar-set-hscroll", Fscrollbar_set_hscroll, 2, 2, 0, /*
851 2, 2, 0 /*
852 Sets WINDOW's hscroll position to VALUE. 838 Sets WINDOW's hscroll position to VALUE.
853 This ensures that VALUE is in the proper range for the horizontal scrollbar. 839 This ensures that VALUE is in the proper range for the horizontal scrollbar.
854 */ ) 840 */
855 (window, value) 841 (window, value))
856 Lisp_Object window, value;
857 { 842 {
858 struct window *w; 843 struct window *w;
859 int hscroll, wcw, max_len; 844 int hscroll, wcw, max_len;
860 845
861 CHECK_LIVE_WINDOW (window); 846 CHECK_LIVE_WINDOW (window);
909 894
910 defsymbol (&Qinit_scrollbar_from_resources, "init-scrollbar-from-resources"); 895 defsymbol (&Qinit_scrollbar_from_resources, "init-scrollbar-from-resources");
911 896
912 /* #### All these functions should be moved into Lisp. 897 /* #### All these functions should be moved into Lisp.
913 See comment above. */ 898 See comment above. */
914 defsubr (&Sscrollbar_line_up); 899 DEFSUBR (Fscrollbar_line_up);
915 defsubr (&Sscrollbar_line_down); 900 DEFSUBR (Fscrollbar_line_down);
916 defsubr (&Sscrollbar_page_up); 901 DEFSUBR (Fscrollbar_page_up);
917 defsubr (&Sscrollbar_page_down); 902 DEFSUBR (Fscrollbar_page_down);
918 defsubr (&Sscrollbar_to_top); 903 DEFSUBR (Fscrollbar_to_top);
919 defsubr (&Sscrollbar_to_bottom); 904 DEFSUBR (Fscrollbar_to_bottom);
920 defsubr (&Sscrollbar_vertical_drag); 905 DEFSUBR (Fscrollbar_vertical_drag);
921 906
922 defsubr (&Sscrollbar_set_hscroll); 907 DEFSUBR (Fscrollbar_set_hscroll);
923 } 908 }
924 909
925 void 910 void
926 vars_of_scrollbar (void) 911 vars_of_scrollbar (void)
927 { 912 {