X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;f=src%2Fscrollbar.c;h=6df936c6d0600573fb5e9f38aa10fa5b590f0cbc;hb=60d2b57b2fdc60d3a6a151a67f95b88db825084b;hp=6f2f0e94cfe31bc1b963aac5ea66b0929ba2a554;hpb=b5eeb6918c29470b36f8461c402eb0c65cb19bd2;p=chise%2Fxemacs-chise.git.1 diff --git a/src/scrollbar.c b/src/scrollbar.c index 6f2f0e9..6df936c 100644 --- a/src/scrollbar.c +++ b/src/scrollbar.c @@ -240,7 +240,8 @@ compute_scrollbar_instance_usage (struct device *d, { int total = 0; - total += DEVMETH (d, compute_scrollbar_instance_usage, (d, inst, ovstats)); + if (HAS_DEVMETH_P(d, compute_scrollbar_instance_usage)) + total += DEVMETH (d, compute_scrollbar_instance_usage, (d, inst, ovstats)); while (inst) { @@ -409,7 +410,7 @@ update_scrollbar_instance (struct window *w, int vertical, int new_minimum = -1, new_maximum = -1; int new_slider_size = -1, new_slider_position = -1; int new_width = -1, new_height = -1, new_x = -1, new_y = -1; - struct window *new_window = 0; /* kludge city */ + struct window *new_window = 0; /* #### currently unused */ end_pos = BUF_Z (b) - w->window_end_pos[CURRENT_DISP]; sb_pos = scrollbar_point (w, 0); @@ -460,14 +461,10 @@ update_scrollbar_instance (struct window *w, int vertical, if (!NILP (w->scrollbar_on_left_p)) { x_offset = WINDOW_LEFT (w); - if (window_is_leftmost (w)) - x_offset += FRAME_LEFT_GUTTER_BOUNDS (f); } - else + else { x_offset = WINDOW_RIGHT (w) - scrollbar_width; - if (window_is_rightmost (w)) - x_offset -= FRAME_RIGHT_GUTTER_BOUNDS (f); if (window_needs_vertical_divider (w)) x_offset -= window_divider_width (w); } @@ -481,8 +478,6 @@ update_scrollbar_instance (struct window *w, int vertical, if (!NILP (w->scrollbar_on_top_p)) { y_offset += WINDOW_TOP (w); - if (window_is_highest (w)) - y_offset += FRAME_TOP_GUTTER_BOUNDS (f); } else { @@ -741,26 +736,26 @@ behavior. with their standard behaviors. It is not possible to hide the differences down in lwlib because knowledge of XEmacs buffer and cursor motion routines is necessary. */ -#if defined (LWLIB_SCROLLBARS_MOTIF) || defined (LWLIB_SCROLLBARS_LUCID) || \ - defined (LWLIB_SCROLLBARS_ATHENA3D) || defined(HAVE_MS_WINDOWS) - window_scroll (window, Qnil, -1, ERROR_ME_NOT); -#else /* Athena */ - { - Bufpos bufpos; - Lisp_Object value = Fcdr (object); - CHECK_INT (value); - Fmove_to_window_line (Qzero, window); - /* can't use Fvertical_motion() because it moves the buffer point - rather than the window's point. - - #### It does? Why does it take a window argument then? */ - bufpos = vmotion (XWINDOW (window), XINT (Fwindow_point (window)), - XINT (value), 0); - Fset_window_point (window, make_int (bufpos)); - Fcenter_to_window_line (Qzero, window); - } -#endif /* Athena */ + if (NILP (XCDR (object))) + window_scroll (window, Qnil, -1, ERROR_ME_NOT); + else + { + Bufpos bufpos; + Lisp_Object value = Fcdr (object); + + CHECK_INT (value); + Fmove_to_window_line (Qzero, window); + /* can't use Fvertical_motion() because it moves the buffer point + rather than the window's point. + + #### It does? Why does it take a window argument then? */ + bufpos = vmotion (XWINDOW (window), XINT (Fwindow_point (window)), + XINT (value), 0); + Fset_window_point (window, make_int (bufpos)); + Fcenter_to_window_line (Qzero, window); + } + zmacs_region_stays = 1; return Qnil; } @@ -782,17 +777,17 @@ behavior. with their standard behaviors. It is not possible to hide the differences down in lwlib because knowledge of XEmacs buffer and cursor motion routines is necessary. */ -#if defined (LWLIB_SCROLLBARS_MOTIF) || defined (LWLIB_SCROLLBARS_LUCID) || \ - defined (LWLIB_SCROLLBARS_ATHENA3D) || defined (HAVE_MS_WINDOWS) - window_scroll (window, Qnil, 1, ERROR_ME_NOT); -#else /* Athena */ - { - Lisp_Object value = Fcdr (object); - CHECK_INT (value); - Fmove_to_window_line (value, window); - Fcenter_to_window_line (Qzero, window); - } -#endif /* Athena */ + + if (NILP (XCDR (object))) + window_scroll (window, Qnil, 1, ERROR_ME_NOT); + else + { + Lisp_Object value = Fcdr (object); + CHECK_INT (value); + Fmove_to_window_line (value, window); + Fcenter_to_window_line (Qzero, window); + } + zmacs_region_stays = 1; return Qnil; } @@ -869,7 +864,7 @@ This ensures that VALUE is in the proper range for the horizontal scrollbar. w = XWINDOW (window); wcw = window_char_width (w, 0) - 1; - /* ### We should be able to scroll further right as long as there is + /* #### We should be able to scroll further right as long as there is a visible truncation glyph. This calculation for max is bogus. */ max_len = w->max_line_len + 2; @@ -959,7 +954,7 @@ This is a specifier; use `set-specifier' to change it. offsetof (struct window, scrollbar_width), vertical_scrollbar_changed_in_window, offsetof (struct frame, scrollbar_width), - frame_size_slipped); + frame_size_slipped, 0); DEFVAR_SPECIFIER ("scrollbar-height", &Vscrollbar_height /* *Height of horizontal scrollbars. @@ -973,7 +968,7 @@ This is a specifier; use `set-specifier' to change it. offsetof (struct window, scrollbar_height), some_window_value_changed, offsetof (struct frame, scrollbar_height), - frame_size_slipped); + frame_size_slipped, 0); DEFVAR_SPECIFIER ("horizontal-scrollbar-visible-p", &Vhorizontal_scrollbar_visible_p /* *Whether the horizontal scrollbar is visible. @@ -988,7 +983,7 @@ This is a specifier; use `set-specifier' to change it. some_window_value_changed, offsetof (struct frame, horizontal_scrollbar_visible_p), - frame_size_slipped); + frame_size_slipped, 0); DEFVAR_SPECIFIER ("vertical-scrollbar-visible-p", &Vvertical_scrollbar_visible_p /* *Whether the vertical scrollbar is visible. @@ -1003,14 +998,14 @@ This is a specifier; use `set-specifier' to change it. vertical_scrollbar_changed_in_window, offsetof (struct frame, vertical_scrollbar_visible_p), - frame_size_slipped); + frame_size_slipped, 0); DEFVAR_SPECIFIER ("scrollbar-on-left-p", &Vscrollbar_on_left_p /* *Whether the vertical scrollbar is on the left side of window or frame. This is a specifier; use `set-specifier' to change it. */ ); Vscrollbar_on_left_p = Fmake_specifier (Qboolean); - + { /* Kludge. Under X, we want athena scrollbars on the left, while all other scrollbars go on the right by default. */ @@ -1029,7 +1024,7 @@ This is a specifier; use `set-specifier' to change it. offsetof (struct window, scrollbar_on_left_p), vertical_scrollbar_changed_in_window, offsetof (struct frame, scrollbar_on_left_p), - frame_size_slipped); + frame_size_slipped, 0); DEFVAR_SPECIFIER ("scrollbar-on-top-p", &Vscrollbar_on_top_p /* *Whether the horizontal scrollbar is on the top side of window or frame. @@ -1042,7 +1037,7 @@ This is a specifier; use `set-specifier' to change it. offsetof (struct window, scrollbar_on_top_p), some_window_value_changed, offsetof (struct frame, scrollbar_on_top_p), - frame_size_slipped); + frame_size_slipped, 0); } void @@ -1053,5 +1048,5 @@ complex_vars_of_scrollbar (void) set_specifier_caching (XGLYPH (Vscrollbar_pointer_glyph)->image, offsetof (struct window, scrollbar_pointer), scrollbar_pointer_changed_in_window, - 0, 0); + 0, 0, 0); }