-#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));
+
-static void tty_output_emchar_dynarr (struct window *w,
- struct display_line *dl,
- Emchar_dynarr *buf, int xpos,
- face_index findex,
- int cursor);
+static void tty_output_charc_dynarr (struct window *w,
+ struct display_line *dl,
+ Charc_dynarr *buf, int xpos,
+ face_index findex,
+ int cursor);
Non-Mule tty's don't have fonts (that we use at least), so everything
is considered to be fixed width -- in other words, we return LEN.
Under Mule, however, a character can still cover more than one
Non-Mule tty's don't have fonts (that we use at least), so everything
is considered to be fixed width -- in other words, we return LEN.
Under Mule, however, a character can still cover more than one
- Dynarr_add (buf, rb->object.chr.ch);
- tty_output_emchar_dynarr (w, dl, buf, xpos, findex, 0);
+ Dynarr_add (buf, rb->object.cglyph);
+ tty_output_charc_dynarr (w, dl, buf, xpos, findex, 0);
- Dynarr_add (buf, ch_to_add);
- tty_output_emchar_dynarr (w, dl, buf, rb->xpos, findex, 0);
+ Dynarr_add (buf, ec_to_add);
+ tty_output_charc_dynarr (w, dl, buf, rb->xpos, findex, 0);
- 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 += CHAR_COLUMNS (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);
- }
+ case IMAGE_MONO_PIXMAP:
+ case IMAGE_COLOR_PIXMAP:
+ case IMAGE_SUBWINDOW:
+ case IMAGE_WIDGET:
+ /* just do nothing here */
+ break;
+
+ case IMAGE_NOTHING:
+ /* nothing is as nothing does */
+ break;
+
+ case IMAGE_TEXT:
+ case IMAGE_POINTER:
+ default:
+ abort ();
static void
tty_clear_region (Lisp_Object window, struct device* d, struct frame * f,
face_index findex, int x, int y,
static void
tty_clear_region (Lisp_Object window, struct device* d, struct frame * f,
face_index findex, int x, int y,
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 */
static int alternate_mode_on; /* nonzero if in alternate char set */
static int attributes_on; /* nonzero if any attributes on */
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 */
static int alternate_mode_on; /* nonzero if in alternate char set */
static int attributes_on; /* nonzero if any attributes on */
describes F10, whereas othertimes it describes F0 and "k;" describes F10.
We will attempt to politely accommodate both systems by testing for
"k;", and if it is present, assuming that "k0" denotes F0, otherwise F10.
describes F10, whereas othertimes it describes F0 and "k;" describes F10.
We will attempt to politely accommodate both systems by testing for
"k;", and if it is present, assuming that "k0" denotes F0, otherwise F10.
- {
-#define CONDITIONAL_REASSIGN(cap1, cap2, sym) \
- if (!tgetstr (cap1, address)) \
- { \
- char *sequence = tgetstr (cap2, address); \
- if (sequence) \
- Fdefine_key (function_key_map, \
- build_ext_string (sequence, FORMAT_BINARY), \
- vector1 (intern (sym))); \
- }
+#define CONDITIONAL_REASSIGN(cap1, cap2, keyname) do { \
+ if (!tgetstr (cap1, address)) \
+ { \
+ char *sequence = tgetstr (cap2, address); \
+ if (sequence) \
+ Fdefine_key (function_key_map, \
+ build_ext_string (sequence, Qbinary), \
+ vector1 (intern (keyname))); \
+ } \
+ } while (0)
- /* if there's no key_next keycap, map key_npage to `next' keysym */
- CONDITIONAL_REASSIGN ("%5", "kN", "next");
- /* if there's no key_prev keycap, map key_ppage to `previous' keysym */
- CONDITIONAL_REASSIGN ("%8", "kP", "prior");
- /* if there's no key_dc keycap, map key_ic to `insert' keysym */
- CONDITIONAL_REASSIGN ("kD", "kI", "insert");
-
- /* IBM has their own non-standard dialect of terminfo.
- If the standard name isn't found, try the IBM name. */
- CONDITIONAL_REASSIGN ("kB", "KO", "backtab");
- CONDITIONAL_REASSIGN ("@4", "kJ", "execute"); /* actually "action" */
- CONDITIONAL_REASSIGN ("@4", "kc", "execute"); /* actually "command" */
- CONDITIONAL_REASSIGN ("%7", "ki", "menu");
- CONDITIONAL_REASSIGN ("@7", "kw", "end");
- CONDITIONAL_REASSIGN ("F1", "k<", "f11");
- CONDITIONAL_REASSIGN ("F2", "k>", "f12");
- CONDITIONAL_REASSIGN ("%1", "kq", "help");
- CONDITIONAL_REASSIGN ("*6", "kU", "select");
+ /* if there's no key_next keycap, map key_npage to `next' keysym */
+ CONDITIONAL_REASSIGN ("%5", "kN", "next");
+ /* if there's no key_prev keycap, map key_ppage to `previous' keysym */
+ CONDITIONAL_REASSIGN ("%8", "kP", "prior");
+ /* if there's no key_dc keycap, map key_ic to `insert' keysym */
+ CONDITIONAL_REASSIGN ("kD", "kI", "insert");
+
+ /* IBM has their own non-standard dialect of terminfo.
+ If the standard name isn't found, try the IBM name. */
+ CONDITIONAL_REASSIGN ("kB", "KO", "backtab");
+ CONDITIONAL_REASSIGN ("@4", "kJ", "execute"); /* actually "action" */
+ CONDITIONAL_REASSIGN ("@4", "kc", "execute"); /* actually "command" */
+ CONDITIONAL_REASSIGN ("%7", "ki", "menu");
+ CONDITIONAL_REASSIGN ("@7", "kw", "end");
+ CONDITIONAL_REASSIGN ("F1", "k<", "f11");
+ CONDITIONAL_REASSIGN ("F2", "k>", "f12");
+ CONDITIONAL_REASSIGN ("%1", "kq", "help");
+ CONDITIONAL_REASSIGN ("*6", "kU", "select");
CONSOLE_HAS_METHOD (tty, clear_to_window_end);
CONSOLE_HAS_METHOD (tty, clear_region);
CONSOLE_HAS_METHOD (tty, clear_frame);
CONSOLE_HAS_METHOD (tty, clear_to_window_end);
CONSOLE_HAS_METHOD (tty, clear_region);
CONSOLE_HAS_METHOD (tty, clear_frame);