Commit 371fbaeb authored by Jim Blandy's avatar Jim Blandy

* term.c (set_vertical_scrollbar_hook, condemn_scrollbars_hook,

	redeem_scrollbar_hook, judge_scrollbars_hook): Removed dumbo
	"externs" from these.  They're supposed to be real definitions.

	* termhooks.h (mouse_position_hook): Doc fix.
	(set_vertical_scrollbar_hook): This doesn't return anything any
	more, and doesn't take a struct scrollbar * argument any more.
	(condemn_scrollbars_hook, redeem_scrollbar_hook,
	judge_scrollbars_hook): Doc fixes.
	* term.c (mouse_position_hook): Doc fix.
	(set_vertical_scrollbar_hook): This doesn't return
	anything any more.  Doc fixes.
	* keyboard.c (kbd_buffer_get_event): Receive the scrollbar's
	window from *mouse_position_hook and pass it to
	make_lispy_movement, instead of working with a pointer to a struct
	scrollbar.
	(make_lispy_event): We don't need a window_from_scrollbar function
	anymore; we are given the window directly in *EVENT.
	Unify the code which generates
	text-area mouse clicks and scrollbar clicks; use the same code to
	distinguish clicks from drags on the scrollbar as in the text area.
	Distinguish clicks from drags by storing a copy of the lispy
	position list returned as part of the event.
	(button_down_location): Make this a lisp vector, rather than an
	array of random structures.
	(struct mouse_position): Remove this; it's been replaced by a lisp
	list.
	(make_lispy_movement): Accept the scrollbar's window as a
	parameter, rather than the scrollbar itself.
	If FRAME is zero, assume that the other arguments are garbage.
	(syms_of_keyboard): No need to staticpro each window of
	button_down_location now; just initialize and staticpro it.
	* window.c (window_from_scrollbar): Function deleted; no longer
	needed.
	* xdisp.c (redisplay_window): Just pass the window to
	set_vertical_scrollbar hook; don't pass the scrollbar object too.
	* xterm.c (XTmouse_position): Don't return a pointer to the
	scrollbar for scrollbar motion; instead, return the scrollbar's
	window.
parent 1dc77cc3
/* terminal control module for terminals described by TERMCAP /* terminal control module for terminals described by TERMCAP
Copyright (C) 1985, 1986, 1987, 1992 Free Software Foundation, Inc. Copyright (C) 1985, 1986, 1987, 1992, 1993 Free Software Foundation, Inc.
This file is part of GNU Emacs. This file is part of GNU Emacs.
...@@ -94,11 +94,25 @@ int (*set_terminal_window_hook) (); ...@@ -94,11 +94,25 @@ int (*set_terminal_window_hook) ();
int (*read_socket_hook) (); int (*read_socket_hook) ();
/* Return the current position of the mouse. /* Return the current position of the mouse.
Set `bar' to point to the scrollbar if the mouse movement started
in a scrollbar, or zero if it started elsewhere in the frame. Set *f to the frame the mouse is in, or zero if the mouse is in no
This should clear mouse_moved until the next motion event arrives. */ Emacs frame. If it is set to zero, all the other arguments are
garbage.
If the motion started in a scrollbar, set *bar_window to the
scrollbar's window, *part to the part the mouse is currently over,
*x to the position of the mouse along the scrollbar, and *y to the
overall length of the scrollbar.
Otherwise, set *bar_window to Qnil, and *x and *y to the column and
row of the character cell the mouse is over.
Set *time to the time the mouse was at the returned position.
This should clear mouse_moved until the next motion
event arrives. */
void (*mouse_position_hook) ( /* FRAME_PTR *f, void (*mouse_position_hook) ( /* FRAME_PTR *f,
struct scrollbar **bar, Lisp_Object *bar_window,
enum scrollbar_part *part, enum scrollbar_part *part,
Lisp_Object *x, Lisp_Object *x,
Lisp_Object *y, Lisp_Object *y,
...@@ -111,16 +125,16 @@ void (*mouse_position_hook) ( /* FRAME_PTR *f, ...@@ -111,16 +125,16 @@ void (*mouse_position_hook) ( /* FRAME_PTR *f,
the highlight. */ the highlight. */
void (*frame_rehighlight_hook) ( /* FRAME_PTR f */ ); void (*frame_rehighlight_hook) ( /* FRAME_PTR f */ );
/* Set vertical scollbar BAR to have its upper left corner at (TOP, /* Set the vertical scrollbar for WINDOW to have its upper left corner
LEFT), and be LENGTH rows high. Set its handle to indicate that we at (TOP, LEFT), and be LENGTH rows high. Set its handle to
are displaying PORTION characters out of a total of WHOLE indicate that we are displaying PORTION characters out of a total
characters, starting at POSITION. Return BAR. If BAR is zero, of WHOLE characters, starting at POSITION. If WINDOW doesn't yet
create a new scrollbar and return a pointer to it. */ have a scrollbar, create one for it. */
struct scrollbar *(*set_vertical_scrollbar_hook) void (*set_vertical_scrollbar_hook)
( /* struct scrollbar *BAR, ( /* struct window *window,
struct window *window,
int portion, int whole, int position */ ); int portion, int whole, int position */ );
/* The following three hooks are used when we're doing a thorough /* The following three hooks are used when we're doing a thorough
redisplay of the frame. We don't explicitly know which scrollbars redisplay of the frame. We don't explicitly know which scrollbars
are going to be deleted, because keeping track of when windows go are going to be deleted, because keeping track of when windows go
...@@ -131,16 +145,34 @@ struct scrollbar *(*set_vertical_scrollbar_hook) ...@@ -131,16 +145,34 @@ struct scrollbar *(*set_vertical_scrollbar_hook)
/* Arrange for all scrollbars on FRAME to be removed at the next call /* Arrange for all scrollbars on FRAME to be removed at the next call
to `*judge_scrollbars_hook'. A scrollbar may be spared if to `*judge_scrollbars_hook'. A scrollbar may be spared if
`*redeem_scrollbar_hook' is applied to it before the judgement. */ `*redeem_scrollbar_hook' is applied to its window before the judgement.
void (*condemn_scrollbars_hook)( /* FRAME_PTR *FRAME */ );
/* Unmark BAR for deletion in this judgement cycle. */ This should be applied to each frame each time its window tree is
void (*redeem_scrollbar_hook)( /* struct scrollbar *BAR */ ); redisplayed, even if it is not displaying scrollbars at the moment;
if the HAS_SCROLLBARS flag has just been turned off, only calling
this and the judge_scrollbars_hook will get rid of them.
If non-zero, this hook should be safe to apply to any frame,
whether or not it can support scrollbars, and whether or not it is
currently displaying them. */
void (*condemn_scrollbars_hook)( /* FRAME_PTR *frame */ );
/* Unmark WINDOW's scrollbar for deletion in this judgement cycle.
Note that it's okay to redeem a scrollbar that is not condemned. */
void (*redeem_scrollbar_hook)( /* struct window *window */ );
/* Remove all scrollbars on FRAME that haven't been saved since the /* Remove all scrollbars on FRAME that haven't been saved since the
last call to `*condemn_scrollbars_hook'. */ last call to `*condemn_scrollbars_hook'.
void (*judge_scrollbars_hook)( /* FRAME_PTR *FRAME */ );
This should be applied to each frame after each time its window
tree is redisplayed, even if it is not displaying scrollbars at the
moment; if the HAS_SCROLLBARS flag has just been turned off, only
calling this and condemn_scrollbars_hook will get rid of them.
If non-zero, this hook should be safe to apply to any frame,
whether or not it can support scrollbars, and whether or not it is
currently displaying them. */
void (*judge_scrollbars_hook)( /* FRAME_PTR *FRAME */ );
/* Strings, numbers and flags taken from the termcap entry. */ /* Strings, numbers and flags taken from the termcap entry. */
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment