Commit 77672669 authored by Nalin Dahyabhai's avatar Nalin Dahyabhai

add options for exercising the cursor and highlight colors. flush output

* src/vteapp.c: add options for exercising the cursor and highlight colors.
* src/debug.c: flush output streams when we check if debugging is enabled,
	because we'll probably output a string next.
* src/iso2022.c: don't print a zero-length string.  Yay compiler warnings.
* src/interpret.c: use g_print() instead of fprintf() to print.
* src/keymap.c,src/ssfe.c: include <stdarg.h>, hopefully fixing bug #121880
	(or not).
parent 47c5f6d0
2003-09-15 nalin
* src/vteapp.c: add options for exercising the cursor and highlight
colors.
* src/debug.c: flush output streams when we check if debugging is
enabled, because we'll probably output a string next.
* src/iso2022.c: don't print a zero-length string. Yay compiler
warnings.
* src/interpret.c: use g_print() instead of fprintf() to print.
* src/keymap.c,src/ssfe.c: include <stdarg.h>, hopefully fixing
bug #121880 (or not).
2003-09-15 nalin
* python/vte.defs: add specs for set_color_cursor and
set_color_highlight.
......
ctlseqs.ms From the xterm source tree [1].
vttest.tar.gz From Thomas E. Dickey's site [2].
openi18n/ From the Openi18n web site [3].
rfc/ From the IETF web site [4].
[0] http://www.invisible-island.net/xterm/
[1] ftp://invisible-island.net/xterm/xterm.tar.gz
[2] http://www.invisible-island.net/vttest/vttest.html
[3] http://www.openi18n.org/subgroups/testsuites/interactive/terminal-tests/terminal-emulator-test-scenario.html
[4] http://www.ietf.org/
/*
* Copyright (C) 2002 Red Hat, Inc.
* Copyright (C) 2002,2003 Red Hat, Inc.
*
* This is free software; you can redistribute it and/or modify it under
* the terms of the GNU Library General Public License as published by
......@@ -19,6 +19,7 @@
#ident "$Id$"
#include "../config.h"
#include <glib.h>
#include <stdio.h>
#include "debug.h"
static VteDebugFlags _vte_debug_flags = 0;
......@@ -82,5 +83,8 @@ _vte_debug_parse_string(const char *string)
gboolean
_vte_debug_on(VteDebugFlags flags)
{
#ifdef VTE_DEBUG
fflush(NULL);
#endif
return (_vte_debug_flags & flags) == flags;
}
/*
* Copyright (C) 2001,2002 Red Hat, Inc.
* Copyright (C) 2001,2002,2003 Red Hat, Inc.
*
* This is free software; you can redistribute it and/or modify it under
* the terms of the GNU Library General Public License as published by
......@@ -55,7 +55,7 @@ main(int argc, char **argv)
_vte_debug_parse_string(getenv("VTE_DEBUG_FLAGS"));
if (argc < 2) {
printf("usage: %s terminal [file]\n", argv[0]);
g_print("usage: %s terminal [file]\n", argv[0]);
return 1;
}
......@@ -139,33 +139,33 @@ main(int argc, char **argv)
c &= ~VTE_ISO2022_ENCODED_WIDTH_MASK;
}
if (c < 32) {
printf("`^%c'\n", c + 64);
g_print("`^%c'\n", c + 64);
} else
if (c < 127) {
printf("`%c'\n", c);
g_print("`%c'\n", c);
} else {
printf("`0x%x'\n", c);
g_print("`0x%x'\n", c);
}
i++;
continue;
}
l = j;
printf("%s(", g_quark_to_string(quark));
g_print("%s(", g_quark_to_string(quark));
for (j = 0; (values != NULL) && (j < values->n_values); j++) {
if (j > 0) {
printf(", ");
g_print(", ");
}
value = g_value_array_get_nth(values, j);
if (G_VALUE_HOLDS_LONG(value)) {
printf("%ld", g_value_get_long(value));
g_print("%ld", g_value_get_long(value));
}
if (G_VALUE_HOLDS_STRING(value)) {
printf("`%s'",
g_print("`%s'",
g_value_get_string(value));
}
if (G_VALUE_HOLDS_POINTER(value)) {
printf("`%ls'",
g_print("`%ls'",
(wchar_t*)
g_value_get_pointer(value));
}
......@@ -173,7 +173,7 @@ main(int argc, char **argv)
if (values != NULL) {
_vte_matcher_free_params_array(values);
}
printf(")\n");
g_print(")\n");
i += l;
}
......
......@@ -1777,9 +1777,6 @@ _vte_iso2022_process(struct _vte_iso2022_state *state,
}
break;
case _vte_iso2022_control:
if (i >= blocks->len - 20) {
fprintf(stderr, "");
}
#ifdef VTE_DEBUG
if (_vte_debug_on(VTE_DEBUG_SUBSTITUTION)) {
fprintf(stderr, "%3ld %3ld CONTROL ",
......
......@@ -19,6 +19,7 @@
#ident "$Id$"
#include "../config.h"
#include <stdlib.h>
#include <stdarg.h>
#include <stdio.h>
#include <string.h>
#include <glib.h>
......
......@@ -20,6 +20,8 @@
#include "../config.h"
#include <stdarg.h>
#ifdef HAVE_NCURSES
#include <ncurses.h>
#include <term.h>
......
......@@ -397,7 +397,8 @@ main(int argc, char **argv)
gboolean transparent = FALSE, audible = TRUE, blink = TRUE,
debug = FALSE, dingus = FALSE, geometry = TRUE, dbuffer = TRUE,
console = FALSE, scroll = FALSE, keep = FALSE,
icon_title = FALSE, shell = TRUE;
icon_title = FALSE, shell = TRUE, highlight_set = FALSE,
cursor_set = FALSE;
long lines = 100;
const char *message = "Launching interactive shell...\r\n";
const char *font = NULL;
......@@ -408,9 +409,10 @@ main(int argc, char **argv)
int opt;
int i, j;
GList *args = NULL;
GdkColor fore, back, tint;
GdkColor fore, back, tint, highlight, cursor;
const char *usage = "Usage: %s "
"[ [-B image] | [-T] ] "
"[-C] "
"[-D] "
"[-2] "
"[-a] "
......@@ -423,9 +425,14 @@ main(int argc, char **argv)
"[-i] "
"[-k] "
"[-n] "
"[-r] "
"[-s] "
"[-t terminaltype]\n";
back.red = back.green = back.blue = 0xffff;
fore.red = fore.green = fore.blue = 0x0000;
highlight.red = highlight.green = highlight.blue = 0xc000;
cursor.red = 0xffff;
cursor.green = cursor.blue = 0x8000;
tint.red = tint.green = tint.blue = 0;
tint = back;
......@@ -456,7 +463,7 @@ main(int argc, char **argv)
g_assert(i < (g_list_length(args) + 2));
/* Parse some command-line options. */
while ((opt = getopt(argc, argv, "B:CDST2abc:df:ghkn:st:w:-")) != -1) {
while ((opt = getopt(argc, argv, "B:CDST2abc:df:ghkn:rst:w:-")) != -1) {
gboolean bail = FALSE;
switch (opt) {
case 'B':
......@@ -495,6 +502,9 @@ main(int argc, char **argv)
case 'g':
geometry = !geometry;
break;
case 'h':
highlight_set = !highlight_set;
break;
case 'i':
icon_title = !icon_title;
break;
......@@ -507,6 +517,9 @@ main(int argc, char **argv)
lines = 100;
}
break;
case 'r':
cursor_set = !cursor_set;
break;
case 's':
scroll = !scroll;
break;
......@@ -519,7 +532,6 @@ main(int argc, char **argv)
case '-':
bail = TRUE;
break;
case 'h':
default:
g_print(usage, argv[0]);
exit(1);
......@@ -632,6 +644,13 @@ main(int argc, char **argv)
}
vte_terminal_set_background_tint_color(VTE_TERMINAL(widget), &tint);
vte_terminal_set_colors(VTE_TERMINAL(widget), &fore, &back, NULL, 0);
if (highlight_set) {
vte_terminal_set_color_highlight(VTE_TERMINAL(widget),
&highlight);
}
if (cursor_set) {
vte_terminal_set_color_cursor(VTE_TERMINAL(widget), &cursor);
}
if (terminal != NULL) {
vte_terminal_set_emulation(VTE_TERMINAL(widget), terminal);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment