Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
emacs
emacs
Commits
ff11dfa1
Commit
ff11dfa1
authored
Jul 13, 1992
by
Jim Blandy
Browse files
*** empty log message ***
parent
502b9b64
Changes
7
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
970 additions
and
970 deletions
+970
-970
src/frame.c
src/frame.c
+542
-542
src/frame.h
src/frame.h
+177
-177
src/keyboard.c
src/keyboard.c
+71
-71
src/lisp.h
src/lisp.h
+30
-30
src/minibuf.c
src/minibuf.c
+21
-21
src/process.c
src/process.c
+6
-6
src/term.c
src/term.c
+123
-123
No files found.
src/frame.c
View file @
ff11dfa1
This diff is collapsed.
Click to expand it.
src/frame.h
View file @
ff11dfa1
/* Define
screen
-object for GNU Emacs.
/* Define
frame
-object for GNU Emacs.
Copyright (C) 1988, 1992 Free Software Foundation, Inc.
This file is part of GNU Emacs.
...
...
@@ -18,132 +18,132 @@ along with GNU Emacs; see the file COPYING. If not, write to
the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
/* The structure representing a
screen
.
/* The structure representing a
frame
.
We declare this even if MULTI_
SCREEN
is not defined, because when
we lack multi-
screen
support, we use one instance of this structure
to represent the one
screen
we support. This is cleaner than
We declare this even if MULTI_
FRAME
is not defined, because when
we lack multi-
frame
support, we use one instance of this structure
to represent the one
frame
we support. This is cleaner than
having miscellaneous random variables scattered about. */
enum
output_method
{
output_termcap
,
output_x_window
};
struct
screen
struct
frame
{
int
size
;
struct
Lisp_Vector
*
next
;
/* glyphs as they appear on the
screen
*/
struct
screen
_glyphs
*
current_glyphs
;
/* glyphs as they appear on the
frame
*/
struct
frame
_glyphs
*
current_glyphs
;
/* glyphs we'd like to appear on the
screen
*/
struct
screen
_glyphs
*
desired_glyphs
;
/* glyphs we'd like to appear on the
frame
*/
struct
frame
_glyphs
*
desired_glyphs
;
/* See do_line_insertion_deletion_costs for info on these arrays. */
/* Cost of inserting 1 line on this
screen
*/
/* Cost of inserting 1 line on this
frame
*/
int
*
insert_line_cost
;
/* Cost of deleting 1 line on this
screen
*/
/* Cost of deleting 1 line on this
frame
*/
int
*
delete_line_cost
;
/* Cost of inserting n lines on this
screen
*/
/* Cost of inserting n lines on this
frame
*/
int
*
insert_n_lines_cost
;
/* Cost of deleting n lines on this
screen
*/
/* Cost of deleting n lines on this
frame
*/
int
*
delete_n_lines_cost
;
/* glyphs for the mode line */
struct
screen
_glyphs
*
temp_glyphs
;
struct
frame
_glyphs
*
temp_glyphs
;
/* Intended cursor position of this
screen
.
/* Intended cursor position of this
frame
.
Measured in characters, counting from upper left corner
within the
screen
. */
within the
frame
. */
int
cursor_x
;
int
cursor_y
;
/* Actual cursor position of this
screen
, and the character under it.
(Not used for terminal
screen
s.) */
/* Actual cursor position of this
frame
, and the character under it.
(Not used for terminal
frame
s.) */
int
phys_cursor_x
;
int
phys_cursor_y
;
/* This is handy for undrawing the cursor, because current_glyphs is
not always accurate when in do_scrolling. */
GLYPH
phys_cursor_glyph
;
/* Size of this
screen
, in units of characters. */
/* Size of this
frame
, in units of characters. */
int
height
;
int
width
;
/* New height and width for pending size change. 0 if no change pending. */
int
new_height
,
new_width
;
/* Name of this
screen
: a Lisp string. */
/* Name of this
frame
: a Lisp string. */
Lisp_Object
name
;
/* The
screen
which should recieve keystrokes that occur in this
screen
. This is usually the
screen
itself, but if the
screen
is
minibufferless, this points to the minibuffer
screen
when it is
/* The
frame
which should recieve keystrokes that occur in this
frame
. This is usually the
frame
itself, but if the
frame
is
minibufferless, this points to the minibuffer
frame
when it is
active. */
Lisp_Object
focus_
screen
;
Lisp_Object
focus_
frame
;
/* This
screen
's root window. Every
screen
has one.
If the
screen
has only a minibuffer window, this is it.
Otherwise, if the
screen
has a minibuffer window, this is its sibling. */
/* This
frame
's root window. Every
frame
has one.
If the
frame
has only a minibuffer window, this is it.
Otherwise, if the
frame
has a minibuffer window, this is its sibling. */
Lisp_Object
root_window
;
/* This
screen
's selected window.
Each
screen
has its own window hierarchy
and one of the windows in it is selected within the
screen
.
The selected window of the selected
screen
is Emacs's selected window. */
/* This
frame
's selected window.
Each
frame
has its own window hierarchy
and one of the windows in it is selected within the
frame
.
The selected window of the selected
frame
is Emacs's selected window. */
Lisp_Object
selected_window
;
/* This
screen
's minibuffer window.
Most
screen
s have their own minibuffer windows,
but only the selected
screen
's minibuffer window
/* This
frame
's minibuffer window.
Most
frame
s have their own minibuffer windows,
but only the selected
frame
's minibuffer window
can actually appear to exist. */
Lisp_Object
minibuffer_window
;
/* Parameter alist of this
screen
.
These are the parameters specified when creating the
screen
or modified with modify-
screen
-parameters. */
/* Parameter alist of this
frame
.
These are the parameters specified when creating the
frame
or modified with modify-
frame
-parameters. */
Lisp_Object
param_alist
;
/* The output method says how the contents of this
screen
/* The output method says how the contents of this
frame
are displayed. It could be using termcap, or using an X window. */
enum
output_method
output_method
;
/* A structure of auxiliary data used for displaying the contents.
struct x_display is used for X window
screen
s;
struct x_display is used for X window
frame
s;
it is defined in xterm.h. */
union
display
{
struct
x_display
*
x
;
int
nothing
;
}
display
;
/* Nonzero if last attempt at redisplay on this
screen
was preempted. */
/* Nonzero if last attempt at redisplay on this
frame
was preempted. */
char
display_preempted
;
/* Nonzero if
screen
is currently displayed. */
/* Nonzero if
frame
is currently displayed. */
char
visible
;
/* Nonzero if window is currently iconified.
This and visible are mutually exclusive. */
char
iconified
;
/* Nonzero if this
screen
should be redrawn. */
/* Nonzero if this
frame
should be redrawn. */
char
garbaged
;
/* True if
screen
actually has a minibuffer window on it.
0 if using a minibuffer window that isn't on this
screen
. */
/* True if
frame
actually has a minibuffer window on it.
0 if using a minibuffer window that isn't on this
frame
. */
char
has_minibuffer
;
/* 0 means, if this
screen
has just one window,
/* 0 means, if this
frame
has just one window,
show no modeline for that window. */
char
wants_modeline
;
/* Non-0 means raise this
screen
to the top of the heap when selected. */
/* Non-0 means raise this
frame
to the top of the heap when selected. */
char
auto_raise
;
/* Non-0 means lower this
screen
to the bottom of the stack when left. */
/* Non-0 means lower this
frame
to the bottom of the stack when left. */
char
auto_lower
;
/* True if
screen
's root window can't be split. */
/* True if
frame
's root window can't be split. */
char
no_split
;
/* Storage for messages to this
screen
. */
/* Storage for messages to this
frame
. */
char
*
message_buf
;
/* Nonnegative if current redisplay should not do scroll computation
...
...
@@ -151,162 +151,162 @@ struct screen
int
scroll_bottom_vpos
;
};
#ifdef MULTI_
SCREEN
typedef
struct
screen
*
SCREEN
_PTR
;
#define X
SCREEN
(p) ((struct
screen
*) XPNTR (p))
#define XSET
SCREEN
(p, v) ((struct
screen
*) XSETPNTR (p, v))
#define WINDOW_
SCREEN
(w) (w)->
screen
#define
SCREEN
P(
s
) (XTYPE(
s
) == Lisp_
Screen
)
#define
SCREEN
_LIVE_P(
s
) ((
s
)->display.nothing != 0)
#define
SCREEN
_IS_TERMCAP(
s
) ((
s
)->output_method == output_termcap)
#define
SCREEN
_IS_X(
s
) ((
s
)->output_method == output_x_window)
#define
SCREEN
_MINIBUF_ONLY_P(
s
) \
EQ (
SCREEN
_ROOT_WINDOW (
s
),
SCREEN
_MINIBUF_WINDOW (
s
))
#define
SCREEN
_HAS_MINIBUF(
s
) ((
s
)->has_minibuffer)
#define
SCREEN
_CURRENT_GLYPHS(
s
) (
s
)->current_glyphs
#define
SCREEN
_DESIRED_GLYPHS(
s
) (
s
)->desired_glyphs
#define
SCREEN
_TEMP_GLYPHS(
s
) (
s
)->temp_glyphs
#define
SCREEN
_HEIGHT(
s
) (
s
)->height
#define
SCREEN
_WIDTH(
s
) (
s
)->width
#define
SCREEN
_NEW_HEIGHT(
s
) (
s
)->new_height
#define
SCREEN
_NEW_WIDTH(
s
) (
s
)->new_width
#define
SCREEN
_CURSOR_X(
s
) (
s
)->cursor_x
#define
SCREEN
_CURSOR_Y(
s
) (
s
)->cursor_y
#define
SCREEN
_VISIBLE_P(
s
) (
s
)->visible
#define SET_
SCREEN
_GARBAGED(
s
) (
screen
_garbaged = 1,
s
->garbaged = 1)
#define
SCREEN
_GARBAGED_P(
s
) (
s
)->garbaged
#define
SCREEN
_NO_SPLIT_P(
s
) (
s
)->no_split
#define
SCREEN
_WANTS_MODELINE_P(
s
) (
s
)->wants_modeline
#define
SCREEN
_ICONIFIED_P(
s
) (
s
)->iconified
#define
SCREEN
_MINIBUF_WINDOW(
s
) (
s
)->minibuffer_window
#define
SCREEN
_ROOT_WINDOW(
s
) (
s
)->root_window
#define
SCREEN
_SELECTED_WINDOW(
s
) (
s
)->selected_window
#define SET_GLYPHS_
SCREEN
(glyphs,
screen
) ((glyphs)->
screen = (screen
))
#define
SCREEN
_INSERT_COST(
s
) (
s
)->insert_line_cost
#define
SCREEN
_DELETE_COST(
s
) (
s
)->delete_line_cost
#define
SCREEN
_INSERTN_COST(
s
) (
s
)->insert_n_lines_cost
#define
SCREEN
_DELETEN_COST(
s
) (
s
)->delete_n_lines_cost
#define
SCREEN
_MESSAGE_BUF(
s
) (
s
)->message_buf
#define
SCREEN
_SCROLL_BOTTOM_VPOS(
s
) (
s
)->scroll_bottom_vpos
#define
SCREEN
_FOCUS_
SCREEN(s
) (
s
)->focus_
screen
#define CHECK_
SCREEN
(x, i) \
#ifdef MULTI_
FRAME
typedef
struct
frame
*
FRAME
_PTR
;
#define X
FRAME
(p) ((struct
frame
*) XPNTR (p))
#define XSET
FRAME
(p, v) ((struct
frame
*) XSETPNTR (p, v))
#define WINDOW_
FRAME
(w) (w)->
frame
#define
FRAME
P(
f
) (XTYPE(
f
) == Lisp_
Frame
)
#define
FRAME
_LIVE_P(
f
) ((
f
)->display.nothing != 0)
#define
FRAME
_IS_TERMCAP(
f
) ((
f
)->output_method == output_termcap)
#define
FRAME
_IS_X(
f
) ((
f
)->output_method == output_x_window)
#define
FRAME
_MINIBUF_ONLY_P(
f
) \
EQ (
FRAME
_ROOT_WINDOW (
f
),
FRAME
_MINIBUF_WINDOW (
f
))
#define
FRAME
_HAS_MINIBUF(
f
) ((
f
)->has_minibuffer)
#define
FRAME
_CURRENT_GLYPHS(
f
) (
f
)->current_glyphs
#define
FRAME
_DESIRED_GLYPHS(
f
) (
f
)->desired_glyphs
#define
FRAME
_TEMP_GLYPHS(
f
) (
f
)->temp_glyphs
#define
FRAME
_HEIGHT(
f
) (
f
)->height
#define
FRAME
_WIDTH(
f
) (
f
)->width
#define
FRAME
_NEW_HEIGHT(
f
) (
f
)->new_height
#define
FRAME
_NEW_WIDTH(
f
) (
f
)->new_width
#define
FRAME
_CURSOR_X(
f
) (
f
)->cursor_x
#define
FRAME
_CURSOR_Y(
f
) (
f
)->cursor_y
#define
FRAME
_VISIBLE_P(
f
) (
f
)->visible
#define SET_
FRAME
_GARBAGED(
f
) (
frame
_garbaged = 1,
f
->garbaged = 1)
#define
FRAME
_GARBAGED_P(
f
) (
f
)->garbaged
#define
FRAME
_NO_SPLIT_P(
f
) (
f
)->no_split
#define
FRAME
_WANTS_MODELINE_P(
f
) (
f
)->wants_modeline
#define
FRAME
_ICONIFIED_P(
f
) (
f
)->iconified
#define
FRAME
_MINIBUF_WINDOW(
f
) (
f
)->minibuffer_window
#define
FRAME
_ROOT_WINDOW(
f
) (
f
)->root_window
#define
FRAME
_SELECTED_WINDOW(
f
) (
f
)->selected_window
#define SET_GLYPHS_
FRAME
(glyphs,
frame
) ((glyphs)->
frame = (frame
))
#define
FRAME
_INSERT_COST(
f
) (
f
)->insert_line_cost
#define
FRAME
_DELETE_COST(
f
) (
f
)->delete_line_cost
#define
FRAME
_INSERTN_COST(
f
) (
f
)->insert_n_lines_cost
#define
FRAME
_DELETEN_COST(
f
) (
f
)->delete_n_lines_cost
#define
FRAME
_MESSAGE_BUF(
f
) (
f
)->message_buf
#define
FRAME
_SCROLL_BOTTOM_VPOS(
f
) (
f
)->scroll_bottom_vpos
#define
FRAME
_FOCUS_
FRAME(f
) (
f
)->focus_
frame
#define CHECK_
FRAME
(x, i) \
{ \
if (!
SCREEN
P (x)) \
x = wrong_type_argument (Q
screen
p, (x)); \
if (!
FRAME
P (x)) \
x = wrong_type_argument (Q
frame
p, (x)); \
}
#define CHECK_LIVE_
SCREEN
(x, i) \
#define CHECK_LIVE_
FRAME
(x, i) \
{ \
if (!
SCREEN
P (x) \
|| !
SCREEN
_LIVE_P (X
SCREEN
(x))) \
x = wrong_type_argument (Qlive_
screen
_p, (x)); \
if (!
FRAME
P (x) \
|| !
FRAME
_LIVE_P (X
FRAME
(x))) \
x = wrong_type_argument (Qlive_
frame
_p, (x)); \
}
/* FOR_EACH_
SCREEN
(LIST_VAR,
SCREEN
_VAR) followed by a statement is a
`for' loop which iterates over the elements of V
screen
_list. The
loop will set
SCREEN
_VAR, a
SCREEN
_PTR, to each
screen
in
V
screen
_list in succession and execute the statement. LIST_VAR
/* FOR_EACH_
FRAME
(LIST_VAR,
FRAME
_VAR) followed by a statement is a
`for' loop which iterates over the elements of V
frame
_list. The
loop will set
FRAME
_VAR, a
FRAME
_PTR, to each
frame
in
V
frame
_list in succession and execute the statement. LIST_VAR
should be a Lisp_Object; it is used to iterate through the
V
screen
_list.
V
frame
_list.
If MULTI_
SCREEN
isn't defined, then this loop expands to something which
If MULTI_
FRAME
isn't defined, then this loop expands to something which
executes the statement once. */
#define FOR_EACH_
SCREEN
(list_var,
screen
_var) \
for ((list_var) = V
screen
_list; \
#define FOR_EACH_
FRAME
(list_var,
frame
_var) \
for ((list_var) = V
frame
_list; \
(CONSP (list_var) \
&& (
screen
_var = X
SCREEN
(XCONS (list_var)->car), 1)); \
&& (
frame
_var = X
FRAME
(XCONS (list_var)->car), 1)); \
list_var = XCONS (list_var)->cdr)
extern
Lisp_Object
Q
screen
p
,
Qlive_
screen
_p
;
extern
Lisp_Object
Q
frame
p
,
Qlive_
frame
_p
;
extern
struct
screen
*
selected_
screen
;
extern
struct
screen
*
last_nonminibuf_
screen
;
extern
struct
frame
*
selected_
frame
;
extern
struct
frame
*
last_nonminibuf_
frame
;
extern
struct
screen
*
make_terminal_
screen
();
extern
struct
screen
*
make_
screen
();
extern
struct
screen
*
make_minibuffer_
screen
();
extern
struct
screen
*
make_
screen
_without_minibuffer
();
extern
struct
frame
*
make_terminal_
frame
();
extern
struct
frame
*
make_
frame
();
extern
struct
frame
*
make_minibuffer_
frame
();
extern
struct
frame
*
make_
frame
_without_minibuffer
();
/* Nonzero means
SCREEN
_MESSAGE_BUF (selected_
screen
) is being used by
/* Nonzero means
FRAME
_MESSAGE_BUF (selected_
frame
) is being used by
print. */
extern
int
message_buf_print
;
extern
Lisp_Object
V
screen
_list
;
extern
Lisp_Object
Vdefault_
screen
_alist
;
extern
Lisp_Object
V
frame
_list
;
extern
Lisp_Object
Vdefault_
frame
_alist
;
extern
Lisp_Object
Vterminal_
screen
;
extern
Lisp_Object
Vterminal_
frame
;
#else
/* not MULTI_
SCREEN
*/
#else
/* not MULTI_
FRAME
*/
/* These definitions are used in a single-
screen
version of Emacs. */
/* These definitions are used in a single-
frame
version of Emacs. */
#define
SCREEN
_PTR int
#define
FRAME
_PTR int
extern
struct
screen
the_only_
screen
;
extern
struct
frame
the_only_
frame
;
extern
int
selected_
screen
;
extern
int
last_nonminibuf_
screen
;
extern
int
selected_
frame
;
extern
int
last_nonminibuf_
frame
;
/* Nonzero means
SCREEN
_MESSAGE_BUF (selected_
screen
) is being used by
/* Nonzero means
FRAME
_MESSAGE_BUF (selected_
frame
) is being used by
print. */
extern
int
message_buf_print
;
#define X
SCREEN(s
) selected_
screen
#define WINDOW_
SCREEN
(w) selected_
screen
#define
SCREEN
P(
s
) (XTYPE(
s
) == Lisp_
Screen
)
#define
SCREEN
_LIVE_P(
s
) 1
#define
SCREEN
_IS_TERMCAP(
s
) 1
#define
SCREEN
_IS_X(
s
) 0
#define
SCREEN
_MINIBUF_ONLY_P(
s
) 0
#define
SCREEN
_HAS_MINIBUF(
s
) 1
#define
SCREEN
_CURRENT_GLYPHS(
s
) the_only_
screen
.current_glyphs
#define
SCREEN
_DESIRED_GLYPHS(
s
) the_only_
screen
.desired_glyphs
#define
SCREEN
_TEMP_GLYPHS(
s
) the_only_
screen
.temp_glyphs
#define
SCREEN
_HEIGHT(
s
) the_only_
screen
.height
#define
SCREEN
_WIDTH(
s
) the_only_
screen
.width
#define
SCREEN
_NEW_HEIGHT(
s
) the_only_
screen
.new_height
#define
SCREEN
_NEW_WIDTH(
s
) the_only_
screen
.new_width
#define
SCREEN
_CURSOR_X(
s
) the_only_
screen
.cursor_x
#define
SCREEN
_CURSOR_Y(
s
) the_only_
screen
.cursor_y
#define
SCREEN
_VISIBLE_P(
s
) 1
#define SET_
SCREEN
_GARBAGED(
s
) (
screen
_garbaged = 1)
#define
SCREEN
_GARBAGED_P(
s
)
screen
_garbaged
#define
SCREEN
_NO_SPLIT_P(
s
) 0
#define
SCREEN
_WANTS_MODELINE_P(
s
) 1
#define
SCREEN
_ICONIFIED_P(
s
) 0
#define
SCREEN
_MINIBUF_WINDOW(
s
) minibuf_window
#define
SCREEN
_ROOT_WINDOW(
s
) the_only_
screen
.root_window
#define
SCREEN
_SELECTED_WINDOW(
s
) selected_window
#define SET_GLYPHS_
SCREEN
(glyphs,
screen
)
#define
SCREEN
_INSERT_COST(
screen
) the_only_
screen
.insert_line_cost
#define
SCREEN
_DELETE_COST(
screen
) the_only_
screen
.delete_line_cost
#define
SCREEN
_INSERTN_COST(
screen
) the_only_
screen
.insert_n_lines_cost
#define
SCREEN
_DELETEN_COST(
screen
) the_only_
screen
.delete_n_lines_cost
#define
SCREEN
_MESSAGE_BUF(
s
) the_only_
screen
.message_buf
#define
SCREEN
_SCROLL_BOTTOM_VPOS(
s
) the_only_
screen
.scroll_bottom_vpos
#define
SCREEN
_FOCUS_
SCREEN(s
) 0
#define CHECK_
SCREEN
(x, i) { ; }
#define CHECK_LIVE_
SCREEN
(x, y) { ; }
/* FOR_EACH_
SCREEN
(LIST_VAR,
SCREEN
_VAR) followed by a statement is a
`for' loop which iterates over the elements of V
screen
_list. The
loop will set
SCREEN
_VAR, a
SCREEN
_PTR, to each
screen
in
V
screen
_list in succession and execute the statement. LIST_VAR
#define X
FRAME(f
) selected_
frame
#define WINDOW_
FRAME
(w) selected_
frame
#define
FRAME
P(
f
) (XTYPE(
f
) == Lisp_
Frame
)
#define
FRAME
_LIVE_P(
f
) 1
#define
FRAME
_IS_TERMCAP(
f
) 1
#define
FRAME
_IS_X(
f
) 0
#define
FRAME
_MINIBUF_ONLY_P(
f
) 0
#define
FRAME
_HAS_MINIBUF(
f
) 1
#define
FRAME
_CURRENT_GLYPHS(
f
) the_only_
frame
.current_glyphs
#define
FRAME
_DESIRED_GLYPHS(
f
) the_only_
frame
.desired_glyphs
#define
FRAME
_TEMP_GLYPHS(
f
) the_only_
frame
.temp_glyphs
#define
FRAME
_HEIGHT(
f
) the_only_
frame
.height
#define
FRAME
_WIDTH(
f
) the_only_
frame
.width
#define
FRAME
_NEW_HEIGHT(
f
) the_only_
frame
.new_height
#define
FRAME
_NEW_WIDTH(
f
) the_only_
frame
.new_width
#define
FRAME
_CURSOR_X(
f
) the_only_
frame
.cursor_x
#define
FRAME
_CURSOR_Y(
f
) the_only_
frame
.cursor_y
#define
FRAME
_VISIBLE_P(
f
) 1
#define SET_
FRAME
_GARBAGED(
f
) (
frame
_garbaged = 1)
#define
FRAME
_GARBAGED_P(
f
)
frame
_garbaged
#define
FRAME
_NO_SPLIT_P(
f
) 0
#define
FRAME
_WANTS_MODELINE_P(
f
) 1
#define
FRAME
_ICONIFIED_P(
f
) 0
#define
FRAME
_MINIBUF_WINDOW(
f
) minibuf_window
#define
FRAME
_ROOT_WINDOW(
f
) the_only_
frame
.root_window
#define
FRAME
_SELECTED_WINDOW(
f
) selected_window
#define SET_GLYPHS_
FRAME
(glyphs,
frame
)
#define
FRAME
_INSERT_COST(
frame
) the_only_
frame
.insert_line_cost
#define
FRAME
_DELETE_COST(
frame
) the_only_
frame
.delete_line_cost
#define
FRAME
_INSERTN_COST(
frame
) the_only_
frame
.insert_n_lines_cost
#define
FRAME
_DELETEN_COST(
frame
) the_only_
frame
.delete_n_lines_cost
#define
FRAME
_MESSAGE_BUF(
f
) the_only_
frame
.message_buf
#define
FRAME
_SCROLL_BOTTOM_VPOS(
f
) the_only_
frame
.scroll_bottom_vpos
#define
FRAME
_FOCUS_
FRAME(f
) 0
#define CHECK_
FRAME
(x, i) { ; }
#define CHECK_LIVE_
FRAME
(x, y) { ; }
/* FOR_EACH_
FRAME
(LIST_VAR,
FRAME
_VAR) followed by a statement is a
`for' loop which iterates over the elements of V
frame
_list. The
loop will set
FRAME
_VAR, a
FRAME
_PTR, to each
frame
in
V
frame
_list in succession and execute the statement. LIST_VAR
should be a Lisp_Object; it is used to iterate through the
V
screen
_list.
V
frame
_list.
If MULTI_
SCREEN
_is_ defined, then this loop expands to a real
`for' loop which traverses V
screen
_list using LIST_VAR and
SCREEN
_VAR. */
#define FOR_EACH_
SCREEN
(list_var,
screen
_var) \
for (
screen
_var = (
SCREEN
_PTR) 1;
screen_var; screen
_var = (
SCREEN
_PTR) 0)
If MULTI_
FRAME
_is_ defined, then this loop expands to a real
`for' loop which traverses V
frame
_list using LIST_VAR and
FRAME
_VAR. */
#define FOR_EACH_
FRAME
(list_var,
frame
_var) \
for (
frame
_var = (
FRAME
_PTR) 1;
frame_var; frame
_var = (
FRAME
_PTR) 0)
#endif
/* not MULTI_
SCREEN
*/
#endif
/* not MULTI_
FRAME
*/
src/keyboard.c
View file @
ff11dfa1
...
...
@@ -28,7 +28,7 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
#include "lisp.h"
#include "termhooks.h"
#include "macros.h"
#include "
screen
.h"
#include "
frame
.h"
#include "window.h"
#include "commands.h"
#include "buffer.h"
...
...
@@ -191,24 +191,24 @@ extern Lisp_Object Vmouse_event;
/* Hook to call on each mouse event after running its definition. */
Lisp_Object Vmouse_event_function;
/* Hook to call when mouse leaves
screen
. */
/* Hook to call when mouse leaves
frame
. */
Lisp_Object Vmouse_left_hook;
/* Hook to call when a
screen
is mapped. */
Lisp_Object
Vmap_
screen
_hook
;
/* Hook to call when a
frame
is mapped. */
Lisp_Object Vmap_
frame
_hook;
/* Hook to call when a
screen
is unmapped. */
Lisp_Object
Vunmap_
screen
_hook
;
/* Hook to call when a
frame
is unmapped. */
Lisp_Object Vunmap_
frame
_hook;
/* Handler for non-grabbed (no keys depressed) mouse motion. */
Lisp_Object Vmouse_motion_handler;
/* The
screen
in which the last input event occurred.
command_loop_1 will select this
screen
before running the
/* The
frame
in which the last input event occurred.
command_loop_1 will select this
frame
before running the
command bound to an event sequence, and read_key_sequence will
toss the existing prefix if the user starts typing at a
new
screen
. */
Lisp_Object
Vlast_event_
screen
;
new
frame
. */
Lisp_Object Vlast_event_
frame
;
/* The timestamp of the last input event we received from the X server.
X Windows wants this for selection ownership. */
...
...
@@ -494,7 +494,7 @@ echo_length ()
/* Truncate the current echo message to its first LEN chars.
This and echo_char get used by read_key_sequence when the user
switches
screen
s while entering a key sequence. */
switches
frame
s while entering a key sequence. */
static void
echo_truncate (len)
...
...
@@ -600,10 +600,10 @@ cmd_error (data)
Vexecuting_macro = Qnil;
echo_area_glyphs = 0;
/* If the window system or terminal
screen
hasn't been initialized
/* If the window system or terminal
frame
hasn't been initialized
yet, or we're not interactive, it's best to dump this message out
to stderr and exit. */
if
(
!
SCREEN
_MESSAGE_BUF
(
selected_
screen
)
if (!
FRAME
_MESSAGE_BUF (selected_
frame
)
|| noninteractive)
stream = Qexternal_debugging_output;
else
...
...
@@ -657,9 +657,9 @@ cmd_error (data)
}
UNGCPRO;
/* If the window system or terminal
screen
hasn't been initialized
/* If the window system or terminal
frame
hasn't been initialized
yet, or we're in -batch mode, this error should cause Emacs to exit. */
if
(
!
SCREEN
_MESSAGE_BUF
(
selected_
screen
)
if (!
FRAME
_MESSAGE_BUF (selected_
frame
)
|| noninteractive)
{
Fterpri (stream);
...
...
@@ -836,11 +836,11 @@ command_loop_1 ()
++num_input_keys;
#ifdef MULTI_
SCREEN
/* Select the
screen
that the key sequence came from. */
if
(
XTYPE
(
Vlast_event_
screen
)
==
Lisp_
Screen
&&
X
SCREEN
(
Vlast_event_
screen
)
!=
selected_
screen
)
Fselect_
screen
(
Vlast_event_
screen
,
Qnil
);
#ifdef MULTI_
FRAME
/* Select the
frame
that the key sequence came from. */
if (XTYPE (Vlast_event_
frame
) == Lisp_
Frame
&& X
FRAME
(Vlast_event_
frame
) != selected_
frame
)
Fselect_
frame
(Vlast_event_
frame
, Qnil);
#endif
/* Now we have read a key sequence of length I,
...
...
@@ -851,7 +851,7 @@ command_loop_1 ()
#if 0
#ifdef HAVE_X_WINDOWS
if (
SCREEN
_IS_X (selected_
screen
))
if (
FRAME
_IS_X (selected_
frame
))
{
if (i == -1) /* Mouse event */
{
...
...
@@ -1159,8 +1159,8 @@ read_char (commandflag)
if (_setjmp (getcjmp))
{
XSET (c, Lisp_Int, quit_char);
#ifdef MULTI_
SCREEN
XSET
(
Vlast_event_
screen
,
Lisp_
Screen
,
selected_
screen
);
#ifdef MULTI_
FRAME
XSET (Vlast_event_
frame
, Lisp_
Frame
, selected_
frame
);
#endif
goto non_reread;
...
...
@@ -1345,7 +1345,7 @@ read_char (commandflag)
cancel_echoing ();
c = read_char (0);
/* Remove the help from the
screen
*/
/* Remove the help from the
frame
*/
unbind_to (count, Qnil);
redisplay ();
if (EQ (c, make_number (040)))
...
...
@@ -1393,7 +1393,7 @@ restore_getcjmp (temp)
/* Set this for debugging, to have a way to get out */
int stop_character;
extern
int
screen
_garbaged
;
extern int
frame
_garbaged;
/* Return true iff there are any events in the queue that read-char
would return. If this returns false, a read-char would block. */
...
...
@@ -1487,11 +1487,11 @@ kbd_buffer_store_event (event)
|| ((c == (0200 | quit_char)) && !meta_key))
{
/* If this results in a quit_char being returned to Emacs as
input, set last-event-
screen
properly. If this doesn't
input, set last-event-
frame
properly. If this doesn't
get returned to Emacs as an event, the next event read
will set Vlast_event_
screen
again, so this is safe to do. */
will set Vlast_event_
frame
again, so this is safe to do. */
extern SIGTYPE interrupt_signal ();
Vlast_event_
screen
=
SCREEN
_FOCUS_
SCREEN
(
event
->
screen
);
Vlast_event_
frame = FRAME
_FOCUS_
FRAME
(event->
frame
);
last_event_timestamp = event->timestamp;
interrupt_signal ();
return;
...
...
@@ -1518,7 +1518,7 @@ kbd_buffer_store_event (event)
kbd_store_ptr->kind = event->kind;
kbd_store_ptr->code = event->code;
kbd_store_ptr->part = event->part;
kbd_store_ptr
->
screen
=
event
->
screen
;
kbd_store_ptr->
frame
= event->
frame
;
kbd_store_ptr->modifiers = event->modifiers;
kbd_store_ptr->x = event->x;
kbd_store_ptr->y = event->y;
...
...
@@ -1610,11 +1610,11 @@ kbd_buffer_get_event ()
{
if (kbd_fetch_ptr == kbd_buffer + KBD_BUFFER_SIZE)
kbd_fetch_ptr = kbd_buffer;
/* Do the redirection specified by the focus_
screen
/* Do the redirection specified by the focus_
frame
member now, before we return this event. */
kbd_fetch_ptr
->
screen
=
X
SCREEN
(
SCREEN
_FOCUS_
SCREEN
(
kbd_fetch_ptr
->
screen
));
XSET
(
Vlast_event_
screen
,
Lisp_
Screen
,
kbd_fetch_ptr
->
screen
);
kbd_fetch_ptr->
frame
=
X
FRAME (FRAME
_FOCUS_
FRAME
(kbd_fetch_ptr->
frame
));
XSET (Vlast_event_
frame
, Lisp_
Frame
, kbd_fetch_ptr->
frame
);
last_event_timestamp = kbd_fetch_ptr->timestamp;
obj = make_lispy_event (kbd_fetch_ptr);