* src/buffer.c: add a short test program.
* src/iso2022.c: use hard values instead of GDK defines in the 0 map. Add
_vte_iso2022_substitute_single() for performing a single mapping
operation.
* src/vte.c: use _vte_iso2022_substitute_single() instead of a local mapping
table when mapping line-drawing charset data, simplifies maintenance
of the mapping.
+2002-12-13 nalin
+ * src/buffer.c: add a short test program.
+ * src/iso2022.c: use hard values instead of GDK defines in the 0 map.
+ Add _vte_iso2022_substitute_single() for performing a single mapping
+ operation.
+ * src/vte.c: use _vte_iso2022_substitute_single() instead of a local
+ mapping table when mapping line-drawing charset data, simplifies
+ maintenance of the mapping.
+
2002-12-12 Pablo Saratxaga <pablo@mandrakesoft.com>
* configure.in: Added Catalan (ca), Spanish (es)
and Hebrew (he) to ALL_LINGUAS
trying to run it, to avoid SIGPIPE failures when it's not installed.
* src/vte.c: never grab focus -- let the shell app deal with it.
Return TRUE from mouse motion and press/release events to keep them
- from being passed up.
+ from being passed up. (#101089)
2002-12-09 nalin
* configure.in: add "uk" to the list of languages.
http://www.debian.org/doc/manuals/intro-i18n/ch-output.en.html
- Depending on your locale, the current encoding, and possibly the strengh
of cosmic rays, the display width of certain Unicode characters changes.
+ For the most part this works correctly now, but if you find that it
+ doesn't, please file a bug report including a screenshot, the typescript
+ file produced by the incorrectly displayed program run under "script", and
+ the contents of your LANG environment variable.
lib_LTLIBRARIES = libvte.la
pkglib_PROGRAMS = interpret utf8echo nativeecho utf8mode iso8859mode slowcat
pkglib_SCRIPTS = decset osc window
-noinst_PROGRAMS = dumpkeys iso2022 pty reaper ring table termcap trie
+noinst_PROGRAMS = buffer dumpkeys iso2022 pty reaper ring table termcap trie
EXTRA_DIST = \
$(pkglib_SCRIPTS) \
genkeysyms.py \
reaper.h
reaper_LDADD = @LIBS@ @GOBJECT_LIBS@
+buffer_CFLAGS = @CFLAGS@ -DBUFFER_MAIN
+buffer_SOURCES = buffer.c
+buffer_LDADD = @GOBJECT_LIBS@
+
dumpkeys_CFLAGS = @CFLAGS@
dumpkeys_SOURCES = dumpkeys.c
dumpkeys_LDADD = @LIBS@ @GOBJECT_LIBS@
_vte_buffer_check(struct _vte_buffer *buffer, size_t length)
{
struct _vte_real_buffer *buf = (struct _vte_real_buffer*) buffer;
+ if (length > 0) {
+ g_assert(buf->bytes != NULL);
+ }
g_assert(buf->buf_length >= length);
g_assert(buf->buf_length >= buf->buf_used);
}
_vte_buffer_append(buffer, buf->bytes, buf->buf_used);
}
+void
+_vte_buffer_append_buffer_contents(struct _vte_buffer *buffer,
+ struct _vte_buffer *s)
+{
+ _vte_buffer_append(buffer, s->bytes, _vte_buffer_length(s));
+}
+
struct _vte_buffer *
_vte_buffer_peek_buffer(struct _vte_buffer *buffer)
{
_vte_buffer_consume(buffer, i);
return ret;
}
+
+#ifdef BUFFER_MAIN
+int
+main(int argc, char **argv)
+{
+ struct _vte_buffer *buffer, *tmp;
+ GString *string;
+ guint16 i16 = 0x1632;
+ guint32 i32 = 0x20406080;
+
+ string = g_string_new("Hello!");
+ buffer = _vte_buffer_new();
+ _vte_buffer_append_guint16(buffer, i16);
+ _vte_buffer_append_guint32(buffer, i32);
+ _vte_buffer_append_gstring(buffer, string);
+ tmp = _vte_buffer_new();
+ _vte_buffer_append_buffer_contents(tmp, buffer);
+ _vte_buffer_append_buffer(tmp, buffer);
+
+ /* Check the original buffer. */
+ i16 = _vte_buffer_peek_guint16(buffer);
+ g_print("%x ", i16);
+ i16 = _vte_buffer_read_guint16(buffer);
+ g_print("%x ", i16);
+ i32 = _vte_buffer_peek_guint32(buffer);
+ g_print("%x ", i32);
+ i32 = _vte_buffer_read_guint32(buffer);
+ g_print("%x ", i32);
+ string = _vte_buffer_peek_gstring(buffer);
+ g_print("'%s' ", string->str);
+ g_string_free(string, TRUE);
+ string = _vte_buffer_read_gstring(buffer);
+ g_print("'%s'\n", string->str);
+ g_string_free(string, TRUE);
+ _vte_buffer_free(buffer);
+
+ /* Check the first copy in the new buffer. */
+ i16 = _vte_buffer_peek_guint16(tmp);
+ g_print("%x ", i16);
+ i16 = _vte_buffer_read_guint16(tmp);
+ g_print("%x ", i16);
+ i32 = _vte_buffer_peek_guint32(tmp);
+ g_print("%x ", i32);
+ i32 = _vte_buffer_read_guint32(tmp);
+ g_print("%x ", i32);
+ string = _vte_buffer_peek_gstring(tmp);
+ g_print("'%s' ", string->str);
+ g_string_free(string, TRUE);
+ string = _vte_buffer_read_gstring(tmp);
+ g_print("'%s'\n", string->str);
+ g_string_free(string, TRUE);
+
+ /* Peek at the second copy in the new buffer. */
+ buffer = _vte_buffer_peek_buffer(tmp);
+ i16 = _vte_buffer_peek_guint16(buffer);
+ g_print("%x ", i16);
+ i16 = _vte_buffer_read_guint16(buffer);
+ g_print("%x ", i16);
+ i32 = _vte_buffer_peek_guint32(buffer);
+ g_print("%x ", i32);
+ i32 = _vte_buffer_read_guint32(buffer);
+ g_print("%x ", i32);
+ string = _vte_buffer_peek_gstring(buffer);
+ g_print("'%s' ", string->str);
+ g_string_free(string, TRUE);
+ string = _vte_buffer_read_gstring(buffer);
+ g_print("'%s'\n", string->str);
+ g_string_free(string, TRUE);
+ _vte_buffer_free(buffer);
+
+ /* Check the second copy in the new buffer. */
+ buffer = _vte_buffer_read_buffer(tmp);
+ i16 = _vte_buffer_peek_guint16(buffer);
+ g_print("%x ", i16);
+ i16 = _vte_buffer_read_guint16(buffer);
+ g_print("%x ", i16);
+ i32 = _vte_buffer_peek_guint32(buffer);
+ g_print("%x ", i32);
+ i32 = _vte_buffer_read_guint32(buffer);
+ g_print("%x ", i32);
+ string = _vte_buffer_peek_gstring(buffer);
+ g_print("'%s' ", string->str);
+ g_string_free(string, TRUE);
+ string = _vte_buffer_read_gstring(buffer);
+ g_print("'%s'\n", string->str);
+ g_string_free(string, TRUE);
+ _vte_buffer_free(buffer);
+
+ _vte_buffer_free(tmp);
+
+ return 0;
+}
+#endif
void _vte_buffer_append_buffer(struct _vte_buffer *buffer,
struct _vte_buffer *s);
+void _vte_buffer_append_buffer_contents(struct _vte_buffer *buffer,
+ struct _vte_buffer *s);
struct _vte_buffer *_vte_buffer_peek_buffer(struct _vte_buffer *buffer);
struct _vte_buffer *_vte_buffer_read_buffer(struct _vte_buffer *buffer);
{'c', 0x240c}, /* FF symbol */
{'d', 0x240d}, /* CR symbol */
{'e', 0x240a}, /* LF symbol */
- {'f', GDK_degree}, /* degree */
- {'g', GDK_plusminus}, /* plus/minus */
+ {'f', 0x00b0}, /* degree */
+ {'g', 0x00b1}, /* plus/minus */
{'h', 0x2424}, /* NL symbol */
{'i', 0x240b}, /* VT symbol */
{'j', 0x2518}, /* downright corner */
return c;
}
+gunichar
+_vte_iso2022_substitute_single(gunichar mapname, gunichar c)
+{
+ GTree *charmap;
+ gunichar result = c;
+ gssize width;
+ charmap = _vte_iso2022_map_get(mapname);
+ if (charmap) {
+ c = GPOINTER_TO_INT(g_tree_lookup(charmap, GINT_TO_POINTER(c)));
+ if (c != 0) {
+ result = c;
+ }
+ }
+ /* Calculate width for ambiguous characters. */
+ switch (result) {
+ /* To be filled in some time, I guess. */
+ default:
+ /* For nonambiguous characters, just use
+ * the width glib has later on. */
+ width = 0;
+ break;
+ }
+ /* Override for drawing characters. */
+ if (mapname == '0') {
+ if ((result >= 0x2500) && (result <= 0x257f)) {
+ width = 1;
+ }
+ }
+ /* Save the width if one was set. */
+ if (width != 0) {
+ result = _vte_iso2022_set_width(result, width);
+ }
+ return result;
+}
+
gssize
_vte_iso2022_substitute(struct _vte_iso2022 *outside_state,
- gunichar *instring, gssize length,
- gunichar *outstring, struct _vte_matcher *specials)
+ gunichar *instring, gssize length,
+ gunichar *outstring, struct _vte_matcher *specials)
{
int i, j, k, g;
struct _vte_iso2022 state;
struct _vte_iso2022 *_vte_iso2022_new(void);
struct _vte_iso2022 *_vte_iso2022_copy(struct _vte_iso2022 *original);
void _vte_iso2022_free(struct _vte_iso2022 *p);
+gunichar _vte_iso2022_substitute_single(gunichar mapname, gunichar c);
gssize _vte_iso2022_substitute(struct _vte_iso2022 *state,
gunichar *instring, gssize length,
gunichar *outstring,
"for 0x%04x.\n", c);
}
#endif
- switch (c) {
- case 95:
- c = 0x0020; /* empty space */
- forced_width = 1;
- break;
- case 96:
- c = 0x25c6; /* diamond */
- forced_width = 1;
- break;
- case 'a':
- c = 0x2592; /* checkerboard */
- forced_width = 1;
- break;
- case 'b':
- c = 0x2409; /* ht */
- forced_width = 1;
- break;
- case 'c':
- c = 0x240c; /* ff */
- forced_width = 1;
- break;
- case 'd':
- c = 0x240d; /* cr */
- forced_width = 1;
- break;
- case 'e':
- c = 0x240a; /* lf */
- forced_width = 1;
- break;
- case 'f':
- c = 0x00b0; /* degree */
- forced_width = 1;
- break;
- case 'g':
- c = 0x00b1; /* plus/minus */
+ /* See if there's a mapping for it, and if there is, force
+ * the result's width to 1. */
+ cell.c = _vte_iso2022_substitute_single('0', c);
+ if (cell.c != c) {
+ c = cell.c & ~(VTE_ISO2022_WIDTH_MASK);
forced_width = 1;
- break;
- case 'h':
- c = 0x2424; /* nl */
- forced_width = 1;
- break;
- case 'i':
- c = 0x240b; /* vt */
- forced_width = 1;
- break;
- case 'j':
- c = 0x2518; /* downright corner */
- forced_width = 1;
- break;
- case 'k':
- c = 0x2510; /* upright corner */
- forced_width = 1;
- break;
- case 'l':
- c = 0x250c; /* upleft corner */
- forced_width = 1;
- break;
- case 'm':
- c = 0x2514; /* downleft corner */
- forced_width = 1;
- break;
- case 'n':
- c = 0x253c; /* cross */
- forced_width = 1;
- break;
- case 'o':
- c = 0x23ba; /* scanline 1/9 */
- forced_width = 1;
- break;
- case 'p':
- c = 0x23bb; /* scanline 3/9 */
- forced_width = 1;
- break;
- case 'q':
- c = 0x2500; /* horizontal line */
- forced_width = 1;
- break;
- case 'r':
- c = 0x23bc; /* scanline 7/9 */
- forced_width = 1;
- break;
- case 's':
- c = 0x23bd; /* scanline 9/9 */
- forced_width = 1;
- break;
- case 't':
- c = 0x251c; /* left t (points right) */
- forced_width = 1;
- break;
- case 'u':
- c = 0x2524; /* right t (points left) */
- forced_width = 1;
- break;
- case 'v':
- c = 0x2534; /* bottom tee (points up) */
- forced_width = 1;
- break;
- case 'w':
- c = 0x252c; /* top tee (points down) */
- forced_width = 1;
- break;
- case 'x':
- c = 0x2502; /* vertical line */
- forced_width = 1;
- break;
- case 'y':
- c = 0x2264; /* <= */
- forced_width = 1;
- break;
- case 'z':
- c = 0x2265; /* >= */
- forced_width = 1;
- break;
- case '{':
- c = 0x03c0; /* pi */
- forced_width = 1;
- break;
- case '|':
- c = 0x2260; /* != */
- forced_width = 1;
- break;
- case '}':
- c = 0x00a3; /* british pound */
- forced_width = 1;
- break;
- case '~':
- c = 0x00b7; /* bullet */
- forced_width = 1;
- break;
- case 127:
- ; /* delete */
- forced_width = 1;
- break;
- default:
- break;
}
}
Name: vte
Version: 0.10.7
-Release: 1
+Release: 2
Summary: An experimental terminal emulator.
License: LGPL
Group: User Interface/X
%{_libdir}/pkgconfig/*
%changelog
+* Fri Dec 13 2002 Nalin Dahyabhai <nalin@redhat.com> 0.10.7-2
+- rebuild
+
* Wed Dec 11 2002 Nalin Dahyabhai <nalin@redhat.com> 0.10.7-1
- distinguish line-drawing character set code points from the same code points
received from the local encoding