[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemacs-commit] qemacs qe.h qe.c shell.c tty.c
From: |
Charlie Gordon |
Subject: |
[Qemacs-commit] qemacs qe.h qe.c shell.c tty.c |
Date: |
Sat, 12 Apr 2008 12:40:24 +0000 |
CVSROOT: /cvsroot/qemacs
Module name: qemacs
Changes by: Charlie Gordon <chqrlie> 08/04/12 12:40:24
Modified files:
. : qe.h qe.c shell.c tty.c
Log message:
use blink for high intensity background color
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/qemacs/qe.h?cvsroot=qemacs&r1=1.81&r2=1.82
http://cvs.savannah.gnu.org/viewcvs/qemacs/qe.c?cvsroot=qemacs&r1=1.81&r2=1.82
http://cvs.savannah.gnu.org/viewcvs/qemacs/shell.c?cvsroot=qemacs&r1=1.55&r2=1.56
http://cvs.savannah.gnu.org/viewcvs/qemacs/tty.c?cvsroot=qemacs&r1=1.43&r2=1.44
Patches:
Index: qe.h
===================================================================
RCS file: /cvsroot/qemacs/qemacs/qe.h,v
retrieving revision 1.81
retrieving revision 1.82
diff -u -b -r1.81 -r1.82
--- qe.h 10 Apr 2008 21:21:14 -0000 1.81
+++ qe.h 12 Apr 2008 12:40:23 -0000 1.82
@@ -1082,11 +1082,11 @@
/* special bit to indicate tty styles (for shell mode) */
#define QE_STYLE_TTY 0x800
#define TTY_BOLD (1 << 7)
+#define TTY_BLINK (1 << 3)
#define TTY_MAKE_COLOR(fg, bg) (((fg) << 4) | (bg))
#define TTY_SET_FG_COLOR(color, fg) ((color) = ((color) & ~(15 << 4)) |
((fg) << 4))
#define TTY_SET_BG_COLOR(color, bg) ((color) = ((color) & ~(15)) | ((bg)))
-#define TTY_GET_XFG(color) (((color) >> 4) & 15)
-#define TTY_GET_FG(color) (((color) >> 4) & 7)
+#define TTY_GET_FG(color) (((color) >> 4) & 15)
#define TTY_GET_BG(color) (((color) >> 0) & 15)
/* from tty.c */
Index: qe.c
===================================================================
RCS file: /cvsroot/qemacs/qemacs/qe.c,v
retrieving revision 1.81
retrieving revision 1.82
diff -u -b -r1.81 -r1.82
--- qe.c 10 Apr 2008 21:21:14 -0000 1.81
+++ qe.c 12 Apr 2008 12:40:23 -0000 1.82
@@ -2134,7 +2134,7 @@
#ifndef CONFIG_WIN32
if (style_index & QE_STYLE_TTY) {
- style->fg_color = tty_fg_colors[TTY_GET_XFG(style_index)];
+ style->fg_color = tty_fg_colors[TTY_GET_FG(style_index)];
style->bg_color = tty_bg_colors[TTY_GET_BG(style_index)];
} else
#endif
Index: shell.c
===================================================================
RCS file: /cvsroot/qemacs/qemacs/shell.c,v
retrieving revision 1.55
retrieving revision 1.56
diff -u -b -r1.55 -r1.56
--- shell.c 12 Apr 2008 08:14:00 -0000 1.55
+++ shell.c 12 Apr 2008 12:40:23 -0000 1.56
@@ -467,10 +467,16 @@
s->bold = 0;
break;
case 1: /* enter_bold_mode */
- s->bold = TTY_BOLD;
+ s->bold |= TTY_BOLD;
break;
case 22: /* exit_bold_mode */
- s->bold = 0;
+ s->bold &= ~TTY_BOLD;
+ break;
+ case 5: /* enter_blink_mode */
+ s->bold |= TTY_BLINK;
+ break;
+ case 25: /* exit_blink_mode */
+ s->bold &= ~TTY_BLINK;
break;
case 7: /* enter_reverse_mode, enter_standout_mode */
case 27: /* exit_reverse_mode, exit_standout_mode */
@@ -478,8 +484,6 @@
break;
case 4: /* enter_underline_mode */
case 24: /* exit_underline_mode */
- case 5: /* enter_blink_mode */
- case 25: /* exit_blink_mode */
case 8: /* enter_secure_mode */
case 28: /* exit_secure_mode */
case 39: /* orig_pair(1) */
Index: tty.c
===================================================================
RCS file: /cvsroot/qemacs/qemacs/tty.c,v
retrieving revision 1.43
retrieving revision 1.44
diff -u -b -r1.43 -r1.44
--- tty.c 10 Apr 2008 21:15:18 -0000 1.43
+++ tty.c 12 Apr 2008 12:40:24 -0000 1.44
@@ -788,10 +788,12 @@
#ifdef CONFIG_CYGWIN
int tty_use_bold_as_bright = 1;
+int tty_use_blink_as_bright = 1;
unsigned int const *tty_bg_colors = tty_full_colors;
int tty_bg_colors_count = 8;
#else
int tty_use_bold_as_bright = 0;
+int tty_use_blink_as_bright = 0;
unsigned int const *tty_bg_colors = tty_putty_colors;
int tty_bg_colors_count = 16;
#endif
@@ -1024,6 +1026,8 @@
TTYChar *ptr, *ptr1, *ptr2, *ptr3, *ptr4, cc, blankcc;
int y, shadow, ch, bgcolor, fgcolor, shifted;
+ TTY_FPRINTF(s->STDOUT, "\033[H\033[0m\033(B");
+
bgcolor = -1;
fgcolor = -1;
shifted = 0;
@@ -1103,18 +1107,23 @@
if (ch != 0xffff) {
/* output attributes */
if (bgcolor != (int)TTYCHAR_GETBG(cc)) {
- /* should use array of strings */
bgcolor = TTYCHAR_GETBG(cc);
+ /* should use array of strings */
+ if (tty_use_blink_as_bright) {
+ TTY_FPRINTF(s->STDOUT, "\033[%dm",
+ (bgcolor > 7) ? 5 : 25);
+ TTY_FPRINTF(s->STDOUT, "\033[%dm",
+ 40 + (bgcolor & 7));
+ } else {
TTY_FPRINTF(s->STDOUT, "\033[%dm",
bgcolor > 7 ? 100 + bgcolor - 8 :
40 + bgcolor);
}
+ }
if (fgcolor != (int)TTYCHAR_GETFG(cc) && ch != ' ') {
fgcolor = TTYCHAR_GETFG(cc);
- /* should use reverse for some colors */
/* should use array of strings */
if (tty_use_bold_as_bright) {
- /* use bold for high color */
TTY_FPRINTF(s->STDOUT, "\033[%dm",
(fgcolor > 7) ? 1 : 22);
TTY_FPRINTF(s->STDOUT, "\033[%dm",
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Qemacs-commit] qemacs qe.h qe.c shell.c tty.c,
Charlie Gordon <=