/* Updating of data structures for redisplay.
-Copyright (C) 1985-1988, 1993-1995, 1997-2012 Free Software Foundation, Inc.
+Copyright (C) 1985-1988, 1993-1995, 1997-2013 Free Software Foundation,
+Inc.
This file is part of GNU Emacs.
#define DISPEXTERN_INLINE EXTERN_INLINE
#include <stdio.h>
-#include <setjmp.h>
#include <unistd.h>
#include "lisp.h"
#include "termchar.h"
-#include "termopts.h"
/* cm.h must come after dispextern.h on Windows. */
#include "dispextern.h"
#include "cm.h"
#if defined (HAVE_TERM_H) && defined (GNU_LINUX)
#include <term.h> /* for tgetent */
#endif
+
+#ifdef WINDOWSNT
+#include "w32.h"
+#endif
\f
/* Structure to pass dimensions around. Used for character bounding
boxes, glyph matrix dimensions and alike. */
these should all go together for the row's hash value to be
correct. */
-static inline void
+static void
swap_glyph_pointers (struct glyph_row *a, struct glyph_row *b)
{
int i;
that glyph pointers, the `used' counts, and the hash values in the
structures are left unchanged. */
-static inline void
+static void
copy_row_except_pointers (struct glyph_row *to, struct glyph_row *from)
{
struct glyph *pointers[1 + LAST_AREA];
exchanged between TO and FROM. Pointers must be exchanged to avoid
a memory leak. */
-static inline void
+static void
assign_row (struct glyph_row *to, struct glyph_row *from)
{
swap_glyph_pointers (to, from);
/* Return true if the glyph rows A and B have equal contents.
MOUSE_FACE_P means compare the mouse_face_p flags of A and B, too. */
-static inline bool
+static bool
row_equal_p (struct glyph_row *a, struct glyph_row *b, bool mouse_face_p)
{
eassert (verify_row_hash (a));
{
/* Block input so that expose events and other events that access
glyph matrices are not processed while we are changing them. */
- BLOCK_INPUT;
+ block_input ();
if (f)
adjust_frame_glyphs (f);
adjust_frame_glyphs (XFRAME (lisp_frame));
}
- UNBLOCK_INPUT;
+ unblock_input ();
}
{
/* Block interrupt input so that we don't get surprised by an X
event while we're in an inconsistent state. */
- BLOCK_INPUT;
+ block_input ();
f->glyphs_initialized_p = 0;
/* Release window sub-matrices. */
f->desired_pool = f->current_pool = NULL;
}
- UNBLOCK_INPUT;
+ unblock_input ();
}
}
function must be called before updates to make explicit that we are
working on frame matrices or not. */
-static inline void
+static void
set_frame_matrix_frame (struct frame *f)
{
frame_matrix_frame = f;
done in frame matrices, and that we have to perform analogous
operations in window matrices of frame_matrix_frame. */
-static inline void
+static void
make_current (struct glyph_matrix *desired_matrix, struct glyph_matrix *current_matrix, int row)
{
struct glyph_row *current_row = MATRIX_ROW (current_matrix, row);
/* Add glyph row ROW to the scrolling hash table. */
-static inline struct row_entry *
+static struct row_entry *
add_row_entry (struct glyph_row *row)
{
struct row_entry *entry;
int width, height;
struct tty_display_info *tty;
- struct sigaction action;
- emacs_sigaction_init (&action, deliver_window_change_signal);
- sigaction (SIGWINCH, &action, 0);
-
/* The frame size change obviously applies to a single
termcap-controlled terminal, but we can't decide which.
Therefore, we resize the frames corresponding to each tty.
static void
deliver_window_change_signal (int sig)
{
- handle_on_main_thread (sig, handle_window_change_signal);
+ deliver_process_signal (sig, handle_window_change_signal);
}
#endif /* SIGWINCH */
&& new_frame_total_cols == FRAME_TOTAL_COLS (f))
return;
- BLOCK_INPUT;
+ block_input ();
#ifdef MSDOS
/* We only can set screen dimensions to certain values supported
SET_FRAME_GARBAGED (f);
f->resized_p = 1;
- UNBLOCK_INPUT;
+ unblock_input ();
record_unwind_current_buffer ();
if (tty->termscript != 0)
{
- BLOCK_INPUT;
+ block_input ();
fclose (tty->termscript);
- UNBLOCK_INPUT;
+ unblock_input ();
}
tty->termscript = 0;
/* ??? Perhaps we should do something special for multibyte strings here. */
CHECK_STRING (string);
- BLOCK_INPUT;
+ block_input ();
if (!t)
error ("Unknown terminal device");
}
fwrite (SDATA (string), 1, SBYTES (string), out);
fflush (out);
- UNBLOCK_INPUT;
+ unblock_input ();
return Qnil;
}
TIMEOUT is number of seconds to wait (float or integer),
or t to wait forever.
READING is true if reading input.
- If DO_DISPLAY is >0 display process output while waiting.
- If DO_DISPLAY is >1 perform an initial redisplay before waiting.
+ If DISPLAY_OPTION is >0 display process output while waiting.
+ If DISPLAY_OPTION is >1 perform an initial redisplay before waiting.
*/
Lisp_Object
-sit_for (Lisp_Object timeout, bool reading, int do_display)
+sit_for (Lisp_Object timeout, bool reading, int display_option)
{
intmax_t sec;
int nsec;
+ bool do_display = display_option > 0;
swallow_events (do_display);
|| !NILP (Vexecuting_kbd_macro))
return Qnil;
- if (do_display >= 2)
+ if (display_option > 1)
redisplay_preserve_echo_area (2);
if (INTEGERP (timeout))
#ifdef USABLE_SIGIO
- gobble_input (0);
+ gobble_input ();
#endif
wait_reading_process_output (sec, nsec, reading ? -1 : 1, do_display,
struct terminal *t;
struct frame *f = XFRAME (selected_frame);
+ init_foreground_group ();
+
/* Open a display on the controlling tty. */
t = init_tty (0, terminal_type, 1); /* Errors are fatal. */