X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;f=src%2Fredisplay-tty.c;h=e1a60634222085596207c6f8b314bcb32d97c937;hb=762383636a99307282c2d93d26c35c046ec24da1;hp=6f6c1978bf80c9eb48e858f763f9daaf6696f10b;hpb=2fd9701a4f902054649dde9143a3f77809afee8f;p=chise%2Fxemacs-chise.git.1 diff --git a/src/redisplay-tty.c b/src/redisplay-tty.c index 6f6c197..e1a6063 100644 --- a/src/redisplay-tty.c +++ b/src/redisplay-tty.c @@ -53,17 +53,12 @@ Boston, MA 02111-1307, USA. */ invoking them correctly. */ /* # include */ /* # include */ -#ifdef __cplusplus -extern "C" { -#endif -extern int tgetent (const char *, const char *); -extern int tgetflag (const char *); -extern int tgetnum (const char *); -extern char *tgetstr (const char *, char **); -extern void tputs (const char *, int, void (*)(int)); -#ifdef __cplusplus -} -#endif +EXTERN_C int tgetent (const char *, const char *); +EXTERN_C int tgetflag (const char *); +EXTERN_C int tgetnum (const char *); +EXTERN_C char *tgetstr (const char *, char **); +EXTERN_C void tputs (const char *, int, void (*)(int)); + #define FORCE_CURSOR_UPDATE(c) send_string_to_tty_console (c, 0, 0) #define OUTPUTN(c, a, n) \ do { \ @@ -138,39 +133,40 @@ tty_eol_cursor_width (void) } /***************************************************************************** - tty_output_begin + tty_frame_output_begin Perform any necessary initialization prior to an update. ****************************************************************************/ #ifdef DEBUG_XEMACS -void tty_output_begin (struct device *d); +void tty_frame_output_begin (struct frame *f); void #else static void #endif -tty_output_begin (struct device *d) +tty_frame_output_begin (struct frame *f) { #ifndef HAVE_TERMIOS /* Termcap requires `ospeed' to be a global variable so we have to always set it for whatever tty console we are actually currently working with. */ - ospeed = DEVICE_TTY_DATA (d)->ospeed; + ospeed = DEVICE_TTY_DATA (XDEVICE (FRAME_DEVICE (f)))->ospeed; #endif } /***************************************************************************** - tty_output_end + tty_frame_output_end Perform any necessary flushing of queues when an update has completed. ****************************************************************************/ #ifdef DEBUG_XEMACS -void tty_output_end (struct device *d); +void tty_frame_output_end (struct frame *f); void #else static void #endif -tty_output_end (struct device *d) +tty_frame_output_end (struct frame *f) { + struct device *d = XDEVICE (FRAME_DEVICE (f)); struct console *c = XCONSOLE (DEVICE_CONSOLE (d)); CONSOLE_TTY_CURSOR_X (c) = CONSOLE_TTY_FINAL_CURSOR_X (c); @@ -336,78 +332,23 @@ tty_output_display_block (struct window *w, struct display_line *dl, int block, { switch (XIMAGE_INSTANCE_TYPE (instance)) { - case IMAGE_TEXT: - { - Bufbyte *temptemp; - Lisp_Object string = - XIMAGE_INSTANCE_TEXT_STRING (instance); - Bytecount len = XSTRING_LENGTH (string); - - /* In the unlikely instance that a garbage-collect - occurs during encoding, we at least need to - copy the string. - */ - temptemp = (Bufbyte *) alloca (len); - memcpy (temptemp, XSTRING_DATA (string), len); - { - int i; - - /* Now truncate the first rb->object.dglyph.xoffset - columns. */ - for (i = 0; i < rb->object.dglyph.xoffset;) - { -#ifdef MULE - Emchar ch = charptr_emchar (temptemp); - i += XCHARSET_COLUMNS (CHAR_CHARSET (ch)); -#else - i++; /* telescope this */ -#endif - INC_CHARPTR (temptemp); - } - - /* If we truncated one column too many, then - add a space at the beginning. */ - if (i > rb->object.dglyph.xoffset) - { - assert (i > 0); - *--temptemp = ' '; - i--; - } - len -= i; - } - - tty_output_bufbyte_string (w, dl, temptemp, len, - xpos, findex, 0); - - if (xpos >= cursor_start - && (cursor_start < - xpos + (bufbyte_string_displayed_columns - (temptemp, len)))) - { - cmgoto (f, dl->ypos - 1, cursor_start); - } - } - break; - case IMAGE_MONO_PIXMAP: case IMAGE_COLOR_PIXMAP: case IMAGE_SUBWINDOW: case IMAGE_WIDGET: - case IMAGE_LAYOUT: /* just do nothing here */ break; - - case IMAGE_POINTER: - abort (); - + case IMAGE_NOTHING: /* nothing is as nothing does */ break; - + + case IMAGE_TEXT: + case IMAGE_POINTER: default: abort (); } - IMAGE_INSTANCE_OPTIMIZE_OUTPUT + IMAGE_INSTANCE_OPTIMIZE_OUTPUT (XIMAGE_INSTANCE (instance)) = 0; } @@ -941,7 +882,7 @@ reset_tty_modes (struct console *c) OUTPUT1_IF (c, TTY_SD (c).keypad_off); OUTPUT1_IF (c, TTY_SD (c).cursor_normal); OUTPUT1_IF (c, TTY_SD (c).end_motion); - tty_output_end (XDEVICE (CONSOLE_SELECTED_DEVICE (c))); + tty_frame_output_end (XFRAME (CONSOLE_SELECTED_FRAME (c))); } /***************************************************************************** @@ -968,7 +909,7 @@ tty_redisplay_shutdown (struct console *c) /* And then stick the cursor there. */ tty_set_final_cursor_coords (f, f->height, 0); - tty_output_end (XDEVICE (dev)); + tty_frame_output_end (f); } } } @@ -979,7 +920,7 @@ tty_redisplay_shutdown (struct console *c) /* FLAGS - these don't need to be console local since only one console - can be being updated at a time. */ + can be being updated at a time. */ static int insert_mode_on; /* nonzero if in insert mode */ static int standout_mode_on; /* nonzero if in standout mode */ static int underline_mode_on; /* nonzero if in underline mode */ @@ -1113,12 +1054,12 @@ init_tty_for_redisplay (struct device *d, char *terminal_type) CONSOLE_TTY_DATA (c)->term_entry_buffer = (char *) xmalloc (2044); bufptr = CONSOLE_TTY_DATA (c)->term_entry_buffer; -#if !defined(WIN32) +#ifdef SIGTTOU /* SIGTT* don't exist under win32 */ EMACS_BLOCK_SIGNAL (SIGTTOU); #endif status = tgetent (entry_buffer, terminal_type); -#if !defined(WIN32) +#ifdef SIGTTOU EMACS_UNBLOCK_SIGNAL (SIGTTOU); #endif #if 0 @@ -1545,8 +1486,8 @@ console_type_create_redisplay_tty (void) CONSOLE_HAS_METHOD (tty, clear_to_window_end); CONSOLE_HAS_METHOD (tty, clear_region); CONSOLE_HAS_METHOD (tty, clear_frame); - CONSOLE_HAS_METHOD (tty, output_begin); - CONSOLE_HAS_METHOD (tty, output_end); + CONSOLE_HAS_METHOD (tty, frame_output_begin); + CONSOLE_HAS_METHOD (tty, frame_output_end); CONSOLE_HAS_METHOD (tty, flash); CONSOLE_HAS_METHOD (tty, ring_bell); CONSOLE_HAS_METHOD (tty, set_final_cursor_coords);