comparison src/redisplay-tty.c @ 5398:5256fedd50e6

issue 757 - tty device metric for num-color-cells -------------------- ChangeLog entries follow: -------------------- src/ChangeLog addition: 2011-03-28 Jeff Sparkes <jsparkes@gmail.com> * console-tty-impl.h (struct tty_console): Add field for number of displayable colors. * device-tty.c (tty_device_system_metrics): Return metrics for num-color-cells and num-bit-planes. Tracker issue 757. * device.c: There are two required args for device-system-metric. * redisplay-tty.c (init_tty_for_redisplay): Retrieve number of colors from terminal description. Default to 2 if none found.
author Jeff Sparkes <jsparkes@gmail.com>
date Mon, 28 Mar 2011 09:25:15 -0400
parents 97eb4942aec8
children 248176c74e6b
comparison
equal deleted inserted replaced
5382:d363790fd936 5398:5256fedd50e6
1114 CONSOLE_TTY_DATA (c)->height = tgetnum ("li"); 1114 CONSOLE_TTY_DATA (c)->height = tgetnum ("li");
1115 1115
1116 if (CONSOLE_TTY_DATA (c)->width <= 0 || CONSOLE_TTY_DATA (c)->height <= 0) 1116 if (CONSOLE_TTY_DATA (c)->width <= 0 || CONSOLE_TTY_DATA (c)->height <= 0)
1117 return TTY_SIZE_UNSPECIFIED; 1117 return TTY_SIZE_UNSPECIFIED;
1118 1118
1119 CONSOLE_TTY_DATA (c)->colors = tgetnum("Co");
1120 if (CONSOLE_TTY_DATA (c)->colors == 0)
1121 CONSOLE_TTY_DATA (c)->colors = tgetnum("colors");
1122 if (CONSOLE_TTY_DATA (c)->colors == 0)
1123 /* There is always foreground and background. */
1124 CONSOLE_TTY_DATA (c)->colors = 2;
1125
1119 /* 1126 /*
1120 * Initialize cursor motion information. 1127 * Initialize cursor motion information.
1121 */ 1128 */
1122 1129
1123 /* local cursor movement */ 1130 /* local cursor movement */