diff src/console-tty-impl.h @ 3571:f6cd5fe9bf4c

[xemacs-hg @ 2006-08-24 21:21:34 by aidan] Vary support for multiple-width characters on a per-console basis.
author aidan
date Thu, 24 Aug 2006 21:21:36 +0000
parents 141c2920ea48
children e0db3c197671
line wrap: on
line diff
--- a/src/console-tty-impl.h	Wed Aug 23 21:51:03 2006 +0000
+++ b/src/console-tty-impl.h	Thu Aug 24 21:21:36 2006 +0000
@@ -200,6 +200,8 @@
   /* Is this TTY our controlling terminal? */
   unsigned int controlling_terminal :1;
   unsigned int is_stdio :1;
+  /* Do East Asian chars take up two columns? */
+  unsigned int multiple_width :1; 
 };
 
 #ifdef NEW_GC
@@ -221,6 +223,17 @@
 #define CONSOLE_TTY_FINAL_CURSOR_X(c) (CONSOLE_TTY_DATA (c)->final_cursor_x)
 #define CONSOLE_TTY_FINAL_CURSOR_Y(c) (CONSOLE_TTY_DATA (c)->final_cursor_y)
 
+/* In a more ideal world where available terminfo files actually included
+   information on whether a given TTY supports double-width characters or
+   not, oh, and where Mule was not conditional, SUPPORTS_MULTIPLE_WIDTH
+   would be as console-specific as its syntax implies.
+
+   In this world, this is overengineering more than it is anything. */
+#define CONSOLE_TTY_SUPPORTS_MULTIPLE_WIDTH(c) (1 != MAX_ICHAR_LEN)
+#define CONSOLE_TTY_MULTIPLE_WIDTH(c)			\
+	(CONSOLE_TTY_SUPPORTS_MULTIPLE_WIDTH(c) ?	\
+	 CONSOLE_TTY_DATA (c)->multiple_width : (0))
+
 #define TTY_CM(c) (CONSOLE_TTY_DATA (c)->cm)
 #define TTY_SE(c) (CONSOLE_TTY_DATA (c)->se)
 #define TTY_SD(c) (CONSOLE_TTY_DATA (c)->sd)