comparison src/scrollbar.c @ 280:7df0dd720c89 r21-0b38

Import from CVS: tag r21-0b38
author cvs
date Mon, 13 Aug 2007 10:32:22 +0200
parents 6330739388db
children c42ec1d1cded
comparison
equal deleted inserted replaced
279:c20b2fb5bb0a 280:7df0dd720c89
62 62
63 /* Height of the scrollbar. */ 63 /* Height of the scrollbar. */
64 Lisp_Object Vscrollbar_height; 64 Lisp_Object Vscrollbar_height;
65 65
66 Lisp_Object Vscrollbar_pointer_glyph; 66 Lisp_Object Vscrollbar_pointer_glyph;
67
68 EXFUN (Fcenter_to_window_line, 2);
67 69
68 static void update_scrollbar_instance (struct window *w, int vertical, 70 static void update_scrollbar_instance (struct window *w, int vertical,
69 struct scrollbar_instance *instance); 71 struct scrollbar_instance *instance);
70 72
71 73
539 { 541 {
540 struct device *d = XDEVICE (f->device); 542 struct device *d = XDEVICE (f->device);
541 543
542 if (HAS_DEVMETH_P (d, create_scrollbar_instance)) 544 if (HAS_DEVMETH_P (d, create_scrollbar_instance))
543 { 545 {
544 int depth = reveal_ghost_specifiers_protected (); 546 int depth = unlock_ghost_specifiers_protected ();
545 Lisp_Object frame; 547 Lisp_Object frame;
546 XSETFRAME (frame, f); 548 XSETFRAME (frame, f);
547 call_critical_lisp_code (XDEVICE (FRAME_DEVICE (f)), 549 call_critical_lisp_code (XDEVICE (FRAME_DEVICE (f)),
548 Qinit_scrollbar_from_resources, 550 Qinit_scrollbar_from_resources,
549 frame); 551 frame);
554 void 556 void
555 init_device_scrollbars (struct device *d) 557 init_device_scrollbars (struct device *d)
556 { 558 {
557 if (HAS_DEVMETH_P (d, create_scrollbar_instance)) 559 if (HAS_DEVMETH_P (d, create_scrollbar_instance))
558 { 560 {
559 int depth = reveal_ghost_specifiers_protected (); 561 int depth = unlock_ghost_specifiers_protected ();
560 Lisp_Object device; 562 Lisp_Object device;
561 XSETDEVICE (device, d); 563 XSETDEVICE (device, d);
562 call_critical_lisp_code (d, 564 call_critical_lisp_code (d,
563 Qinit_scrollbar_from_resources, 565 Qinit_scrollbar_from_resources,
564 device); 566 device);
569 void 571 void
570 init_global_scrollbars (struct device *d) 572 init_global_scrollbars (struct device *d)
571 { 573 {
572 if (HAS_DEVMETH_P (d, create_scrollbar_instance)) 574 if (HAS_DEVMETH_P (d, create_scrollbar_instance))
573 { 575 {
574 int depth = reveal_ghost_specifiers_protected (); 576 int depth = unlock_ghost_specifiers_protected ();
575 call_critical_lisp_code (d, 577 call_critical_lisp_code (d,
576 Qinit_scrollbar_from_resources, 578 Qinit_scrollbar_from_resources,
577 Qglobal); 579 Qglobal);
578 unbind_to (depth, Qnil); 580 unbind_to (depth, Qnil);
579 } 581 }
739 741
740 #### It does? Why does it take a window argument then? */ 742 #### It does? Why does it take a window argument then? */
741 bufpos = vmotion (XWINDOW (window), XINT (Fwindow_point (window)), 743 bufpos = vmotion (XWINDOW (window), XINT (Fwindow_point (window)),
742 XINT (value), 0); 744 XINT (value), 0);
743 Fset_window_point (window, make_int (bufpos)); 745 Fset_window_point (window, make_int (bufpos));
744 Frecenter (Qzero, window); 746 Fcenter_to_window_line (Qzero, window);
745 } 747 }
746 #endif /* Athena */ 748 #endif /* Athena */
747 zmacs_region_stays = 1; 749 zmacs_region_stays = 1;
748 return Qnil; 750 return Qnil;
749 } 751 }
771 #else /* Athena */ 773 #else /* Athena */
772 { 774 {
773 Lisp_Object value = Fcdr (object); 775 Lisp_Object value = Fcdr (object);
774 CHECK_INT (value); 776 CHECK_INT (value);
775 Fmove_to_window_line (value, window); 777 Fmove_to_window_line (value, window);
776 Frecenter (Qzero, window); 778 Fcenter_to_window_line (Qzero, window);
777 } 779 }
778 #endif /* Athena */ 780 #endif /* Athena */
779 zmacs_region_stays = 1; 781 zmacs_region_stays = 1;
780 return Qnil; 782 return Qnil;
781 } 783 }
789 */ 791 */
790 (window)) 792 (window))
791 { 793 {
792 Lisp_Object orig_pt = Fwindow_point (window); 794 Lisp_Object orig_pt = Fwindow_point (window);
793 Fset_window_point (window, Fpoint_min (Fwindow_buffer (window))); 795 Fset_window_point (window, Fpoint_min (Fwindow_buffer (window)));
794 Frecenter (Qzero, window); 796 Fcenter_to_window_line (Qzero, window);
795 scrollbar_reset_cursor (window, orig_pt); 797 scrollbar_reset_cursor (window, orig_pt);
796 zmacs_region_stays = 1; 798 zmacs_region_stays = 1;
797 return Qnil; 799 return Qnil;
798 } 800 }
799 801
806 */ 808 */
807 (window)) 809 (window))
808 { 810 {
809 Lisp_Object orig_pt = Fwindow_point (window); 811 Lisp_Object orig_pt = Fwindow_point (window);
810 Fset_window_point (window, Fpoint_max (Fwindow_buffer (window))); 812 Fset_window_point (window, Fpoint_max (Fwindow_buffer (window)));
811 Frecenter (make_int (-3), window); 813 Fcenter_to_window_line (make_int (-3), window);
812 scrollbar_reset_cursor (window, orig_pt); 814 scrollbar_reset_cursor (window, orig_pt);
813 zmacs_region_stays = 1; 815 zmacs_region_stays = 1;
814 return Qnil; 816 return Qnil;
815 } 817 }
816 818