#define max(a, b) ((a) > (b) ? (a) : (b))
#define min(a, b) ((a) < (b) ? (a) : (b))
-#define OUTPUT(a) tputs (a, (int) (FRAME_HEIGHT (selected_frame) - curY), cmputc)
+#define OUTPUT(a) \
+ tputs (a, (int) (FRAME_HEIGHT (XFRAME (selected_frame)) - curY), cmputc)
#define OUTPUT1(a) tputs (a, 1, cmputc)
#define OUTPUTL(a, lines) tputs (a, lines, cmputc)
-#define OUTPUT_IF(a) \
- if (a) \
- tputs (a, (int) (FRAME_HEIGHT (selected_frame) - curY), cmputc); \
- else \
+#define OUTPUT_IF(a) \
+ if (a) \
+ tputs (a, (int) (FRAME_HEIGHT (XFRAME (selected_frame)) \
+ - curY), cmputc); \
+ else \
(void) 0
#define OUTPUT1_IF(a) if (a) tputs (a, 1, cmputc); else (void) 0
return;
}
- if (! FRAME_TERMCAP_P (selected_frame))
+ if (! FRAME_TERMCAP_P (XFRAME (selected_frame)))
{
(*ring_bell_hook) ();
return;
void
set_terminal_modes ()
{
- if (! FRAME_TERMCAP_P (selected_frame))
+ if (! FRAME_TERMCAP_P (XFRAME (selected_frame)))
{
(*set_terminal_modes_hook) ();
return;
void
reset_terminal_modes ()
{
- if (! FRAME_TERMCAP_P (selected_frame))
+ if (! FRAME_TERMCAP_P (XFRAME (selected_frame)))
{
if (reset_terminal_modes_hook)
(*reset_terminal_modes_hook) ();
(*set_terminal_window_hook) (size);
return;
}
- specified_window = size ? size : FRAME_HEIGHT (selected_frame);
+ specified_window = size ? size : FRAME_HEIGHT (XFRAME (selected_frame));
if (!scroll_region_ok)
return;
set_scroll_region (0, specified_window);
int start, stop;
{
char *buf;
+ struct frame *sf = XFRAME (selected_frame);
+
if (TS_set_scroll_region)
{
buf = tparam (TS_set_scroll_region, 0, 0, start, stop - 1);
else if (TS_set_scroll_region_1)
{
buf = tparam (TS_set_scroll_region_1, 0, 0,
- FRAME_HEIGHT (selected_frame), start,
- FRAME_HEIGHT (selected_frame) - stop,
- FRAME_HEIGHT (selected_frame));
+ FRAME_HEIGHT (sf), start,
+ FRAME_HEIGHT (sf) - stop,
+ FRAME_HEIGHT (sf));
}
else
{
- buf = tparam (TS_set_window, 0, 0, start, 0, stop, FRAME_WIDTH (selected_frame));
+ buf = tparam (TS_set_window, 0, 0, start, 0, stop, FRAME_WIDTH (sf));
}
OUTPUT (buf);
xfree (buf);
int highlight;
int vpos;
{
- if (! FRAME_TERMCAP_P ((updating_frame ? updating_frame : selected_frame)))
+ struct frame *f = updating_frame ? updating_frame : XFRAME (selected_frame);
+ if (! FRAME_TERMCAP_P (f))
{
(*reassert_line_highlight_hook) (highlight, vpos);
return;
/* On Teleray, make sure to erase the SO marker. */
if (TF_teleray)
{
- cmgoto (curY - 1, FRAME_WIDTH (selected_frame) - 4);
+ cmgoto (curY - 1, FRAME_WIDTH (XFRAME (selected_frame)) - 4);
OUTPUT ("\033S");
curY++; /* ESC S moves to next line where the TS_standout_mode was */
curX = 0;
cursor_to (vpos, hpos)
int vpos, hpos;
{
- if (! FRAME_TERMCAP_P ((updating_frame ? updating_frame : selected_frame))
- && cursor_to_hook)
+ struct frame *f = updating_frame ? updating_frame : XFRAME (selected_frame);
+
+ if (! FRAME_TERMCAP_P (f) && cursor_to_hook)
{
(*cursor_to_hook) (vpos, hpos);
return;
raw_cursor_to (row, col)
int row, col;
{
- if (! FRAME_TERMCAP_P ((updating_frame ? updating_frame : selected_frame)))
+ struct frame *f = updating_frame ? updating_frame : XFRAME (selected_frame);
+ if (! FRAME_TERMCAP_P (f))
{
(*raw_cursor_to_hook) (row, col);
return;
{
background_highlight ();
OUTPUT (TS_clr_to_bottom);
- bzero (chars_wasted + curY, FRAME_HEIGHT (selected_frame) - curY);
+ bzero (chars_wasted + curY,
+ FRAME_HEIGHT (XFRAME (selected_frame)) - curY);
}
else
{
- for (i = curY; i < FRAME_HEIGHT (selected_frame); i++)
+ for (i = curY; i < FRAME_HEIGHT (XFRAME (selected_frame)); i++)
{
cursor_to (i, 0);
- clear_end_of_line_raw (FRAME_WIDTH (selected_frame));
+ clear_end_of_line_raw (FRAME_WIDTH (XFRAME (selected_frame)));
}
}
}
void
clear_frame ()
{
+ struct frame *sf = XFRAME (selected_frame);
+
if (clear_frame_hook
- && ! FRAME_TERMCAP_P ((updating_frame ? updating_frame : selected_frame)))
+ && ! FRAME_TERMCAP_P ((updating_frame ? updating_frame : sf)))
{
(*clear_frame_hook) ();
return;
{
background_highlight ();
OUTPUT (TS_clr_frame);
- bzero (chars_wasted, FRAME_HEIGHT (selected_frame));
+ bzero (chars_wasted, FRAME_HEIGHT (sf));
cmat (0, 0);
}
else
clear_end_of_line (first_unused_hpos)
int first_unused_hpos;
{
- if (FRAME_TERMCAP_P (selected_frame)
+ if (FRAME_TERMCAP_P (XFRAME (selected_frame))
&& chars_wasted != 0
&& TN_standout_width == 0 && curX == 0 && chars_wasted[curY] != 0)
write_glyphs (&space_glyph, 1);
if (clear_end_of_line_hook
&& ! FRAME_TERMCAP_P ((updating_frame
? updating_frame
- : selected_frame)))
+ : XFRAME (selected_frame))))
{
(*clear_end_of_line_hook) (first_unused_hpos);
return;
}
else
{ /* have to do it the hard way */
+ struct frame *sf = XFRAME (selected_frame);
turn_off_insert ();
/* Do not write in last row last col with Auto-wrap on. */
- if (AutoWrap && curY == FRAME_HEIGHT (selected_frame) - 1
- && first_unused_hpos == FRAME_WIDTH (selected_frame))
+ if (AutoWrap && curY == FRAME_HEIGHT (sf) - 1
+ && first_unused_hpos == FRAME_WIDTH (sf))
first_unused_hpos--;
for (i = curX; i < first_unused_hpos; i++)
/* We must skip glyphs to be padded for a wide character. */
if (! CHAR_GLYPH_PADDING_P (*src))
{
+ struct frame *sf = XFRAME (selected_frame);
+
c = src->u.ch.code;
if (! GLYPH_CHAR_VALID_P (c))
{
c = ' ';
- g = MAKE_GLYPH (selected_frame, c,
- GLYPH_FACE (selected_frame, g));
+ g = MAKE_GLYPH (sf, c, GLYPH_FACE (sf, g));
}
if (COMPOSITE_CHAR_P (c))
{
/* If C is a composite character, we can display
only the first component. */
g = cmpchar_table[COMPOSITE_CHAR_ID (c)]->glyph[0],
- c = GLYPH_CHAR (selected_frame, g);
+ c = GLYPH_CHAR (sf, g);
}
if (c < tlen)
{
/* G has an entry in Vglyph_table,
so process any alias before testing for simpleness. */
GLYPH_FOLLOW_ALIASES (tbase, tlen, g);
- c = GLYPH_CHAR (selected_frame, g);
+ c = GLYPH_CHAR (sf, g);
}
if (GLYPH_SIMPLE_P (tbase, tlen, g))
/* We set the multi-byte form of C at BUF. */
register int len;
{
int produced, consumed;
- struct frame *f = updating_frame ? updating_frame : selected_frame;
+ struct frame *sf = XFRAME (selected_frame);
+ struct frame *f = updating_frame ? updating_frame : sf;
if (write_glyphs_hook
&& ! FRAME_TERMCAP_P (f))
since that would scroll the whole frame on some terminals. */
if (AutoWrap
- && curY + 1 == FRAME_HEIGHT (selected_frame)
- && (curX + len - (chars_wasted[curY] & 077)
- == FRAME_WIDTH (selected_frame)))
+ && curY + 1 == FRAME_HEIGHT (sf)
+ && (curX + len - (chars_wasted[curY] & 077) == FRAME_WIDTH (sf)))
len --;
if (len <= 0)
return;
{
char *buf;
GLYPH g;
- struct frame *f;
+ struct frame *f, *sf;
if (len <= 0)
return;
return;
}
- f = updating_frame ? updating_frame : selected_frame;
+ sf = XFRAME (selected_frame);
+ f = updating_frame ? updating_frame : sf;
highlight_if_desired ();
if (TS_ins_multi_chars)
char *multi = n > 0 ? TS_ins_multi_lines : TS_del_multi_lines;
char *single = n > 0 ? TS_ins_line : TS_del_line;
char *scroll = n > 0 ? TS_rev_scroll : TS_fwd_scroll;
+ struct frame *sf;
register int i = n > 0 ? n : -n;
register char *buf;
return;
}
+ sf = XFRAME (selected_frame);
+
/* If the lines below the insertion are being pushed
into the end of the window, this is the same as clearing;
and we know the lines are already clear, since the matching
as there will be a matching inslines later that will flush them. */
if (scroll_region_ok && vpos + i >= specified_window)
return;
- if (!memory_below_frame && vpos + i >= FRAME_HEIGHT (selected_frame))
+ if (!memory_below_frame && vpos + i >= FRAME_HEIGHT (sf))
return;
if (multi)
register int lower_limit
= (scroll_region_ok
? specified_window
- : FRAME_HEIGHT (selected_frame));
+ : FRAME_HEIGHT (sf));
if (n < 0)
{
}
if (!scroll_region_ok && memory_below_frame && n < 0)
{
- cursor_to (FRAME_HEIGHT (selected_frame) + n, 0);
+ cursor_to (FRAME_HEIGHT (sf) + n, 0);
clear_to_end ();
}
}
char buffer[2044];
register char *p;
int status;
+ struct frame *sf = XFRAME (selected_frame);
#ifdef WINDOWSNT
initialize_w32_display ();
if (area == 0)
abort ();
- FrameRows = FRAME_HEIGHT (selected_frame);
- FrameCols = FRAME_WIDTH (selected_frame);
- specified_window = FRAME_HEIGHT (selected_frame);
+ FrameRows = FRAME_HEIGHT (sf);
+ FrameCols = FRAME_WIDTH (sf);
+ specified_window = FRAME_HEIGHT (sf);
delete_in_insert_mode = 1;
baud_rate = 19200;
- FRAME_CAN_HAVE_SCROLL_BARS (selected_frame) = 0;
- FRAME_VERTICAL_SCROLL_BAR_TYPE (selected_frame) = vertical_scroll_bar_none;
+ FRAME_CAN_HAVE_SCROLL_BARS (sf) = 0;
+ FRAME_VERTICAL_SCROLL_BAR_TYPE (sf) = vertical_scroll_bar_none;
return;
#else /* not WINDOWSNT */
{
int height, width;
get_frame_size (&width, &height);
- FRAME_WIDTH (selected_frame) = width;
- FRAME_HEIGHT (selected_frame) = height;
+ FRAME_WIDTH (sf) = width;
+ FRAME_HEIGHT (sf) = height;
}
- if (FRAME_WIDTH (selected_frame) <= 0)
- SET_FRAME_WIDTH (selected_frame, tgetnum ("co"));
+ if (FRAME_WIDTH (sf) <= 0)
+ SET_FRAME_WIDTH (sf, tgetnum ("co"));
else
/* Keep width and external_width consistent */
- SET_FRAME_WIDTH (selected_frame, FRAME_WIDTH (selected_frame));
- if (FRAME_HEIGHT (selected_frame) <= 0)
- FRAME_HEIGHT (selected_frame) = tgetnum ("li");
+ SET_FRAME_WIDTH (sf, FRAME_WIDTH (sf));
+ if (FRAME_HEIGHT (sf) <= 0)
+ FRAME_HEIGHT (sf) = tgetnum ("li");
- if (FRAME_HEIGHT (selected_frame) < 3
- || FRAME_WIDTH (selected_frame) < 3)
+ if (FRAME_HEIGHT (sf) < 3 || FRAME_WIDTH (sf) < 3)
fatal ("Screen size %dx%d is too small",
- FRAME_HEIGHT (selected_frame), FRAME_WIDTH (selected_frame));
+ FRAME_HEIGHT (sf), FRAME_WIDTH (sf));
min_padding_speed = tgetnum ("pb");
TN_standout_width = tgetnum ("sg");
}
}
- FrameRows = FRAME_HEIGHT (selected_frame);
- FrameCols = FRAME_WIDTH (selected_frame);
- specified_window = FRAME_HEIGHT (selected_frame);
+ FrameRows = FRAME_HEIGHT (sf);
+ FrameCols = FRAME_WIDTH (sf);
+ specified_window = FRAME_HEIGHT (sf);
if (Wcm_init () == -1) /* can't do cursor motion */
#ifdef VMS
terminal_type);
# endif /* TERMINFO */
#endif /*VMS */
- if (FRAME_HEIGHT (selected_frame) <= 0
- || FRAME_WIDTH (selected_frame) <= 0)
+ if (FRAME_HEIGHT (sf) <= 0
+ || FRAME_WIDTH (sf) <= 0)
fatal ("The frame size has not been specified");
delete_in_insert_mode
/* Remove width of standout marker from usable width of line */
if (TN_standout_width > 0)
- SET_FRAME_WIDTH (selected_frame,
- FRAME_WIDTH (selected_frame) - TN_standout_width);
+ SET_FRAME_WIDTH (sf, FRAME_WIDTH (sf) - TN_standout_width);
UseTabs = tabs_safe_p () && TabWidth == 8;
/* meaningless in this case */
baud_rate = 9600;
- FRAME_CAN_HAVE_SCROLL_BARS (selected_frame) = 0;
- FRAME_VERTICAL_SCROLL_BAR_TYPE (selected_frame) = vertical_scroll_bar_none;
+ FRAME_CAN_HAVE_SCROLL_BARS (sf) = 0;
+ FRAME_VERTICAL_SCROLL_BAR_TYPE (sf) = vertical_scroll_bar_none;
#endif /* WINDOWSNT */
}