diff options
author | Nalin Dahyabhai <nalin@src.gnome.org> | 2002-05-02 19:55:29 +0000 |
---|---|---|
committer | Nalin Dahyabhai <nalin@src.gnome.org> | 2002-05-02 19:55:29 +0000 |
commit | 7df826f2358df847542716ad585d9982ff141cef (patch) | |
tree | 7657da23ce5e85bf8038ee3bccca189aa2976611 | |
parent | 386e1b45a5e205f28a29f1c3da82c7fcd6342c91 (diff) |
Fix a crashbug due to mismatch between parent field in the object'svte_0_3_4
* src/vteaccess.h: Fix a crashbug due to mismatch between parent field
in the object's structure and its inherited object's type. More to go.
* src/trie.c: Fix a logic bug which caused intermittent escape sequence
recognition errors in the trie partial-match code.
* src/vte.c: Don't use $SHELL, which might have been set by a libtool wrapper,
as a default shell when we get NULL as a command. Use 80x24 as the
default window size -- I'm pretty sure the termcap parsing is correct
now, so no need to use 60x18 to detect when it's broken.
-rw-r--r-- | ChangeLog | 22 | ||||
-rw-r--r-- | src/trie.c | 29 | ||||
-rw-r--r-- | src/vte.c | 50 | ||||
-rw-r--r-- | src/vteaccess.c | 10 | ||||
-rw-r--r-- | src/vteaccess.h | 4 | ||||
-rw-r--r-- | vte.spec | 6 |
6 files changed, 67 insertions, 54 deletions
@@ -1,13 +1,21 @@ 2002-05-02 nalin * src/trie.c: Rework trie matching to return the address of the character which ended the match attempt, which should cut down on - useless initial-substring checks. Remove several gdk_window_scroll() - calls which apparently aren't buffered. Convert invalid multibyte - characters to '?' instead of just dropping them. Provide a means of - setting the backspace/delete bindings. Add a poor xlfd_from_pango - mapping function which would need serious work to be useful. Get rid - of warnings when we're transparent and the root widnow pixmap isn't as - big as the root window because it's tiled. + useless initial-substring checks. Fix a subtle bug which caused + intermittent off-by-somenumber errors in the return address. + * src/vte.c: Remove several gdk_window_scroll() calls which apparently + aren't buffered. Convert invalid multibyte characters to '?' instead of + just dropping them. Provide a means of setting the backspace/delete + bindings. Add a poor xlfd_from_pango mapping function which would need + serious work to be useful. Get rid of warnings when we're transparent + and the root window pixmap isn't as big as the root window because it's + been tiled. Setup bindings using the export functions. Set the default + terminal size to 80x24 instead of 60x18, which was originally chosen for + debugging purposes. Don't use $SHELL as the command to invoke when + starting up a default command (as in the test app) -- libtool wrappers + keep screwing this up. + * src/vteaccess.h: Fix a crashbug due to mismatch between parent field + in the object's structure and its inherited object's type. More to go. 2002-05-01 nalin * src/vte.c: Try @pkgdatadir@/termcap/$TERM when reading termcap files. This fixes the app on systems with no /etc/termcap, and also speeds up @@ -490,26 +490,25 @@ vte_trie_matchx(struct vte_trie *trie, const wchar_t *pattern, size_t length, res = &hres; } - /* Trivial cases. We've matched the entire pattern, or we're out of + /* Trivial cases. We've matched an entire pattern, or we're out of * pattern to match. */ + if (trie->result) { + *res = trie->result; + *quark = trie->quark; + *consumed = pattern; + return *res; + } if (length <= 0) { - if (trie->result) { - *res = trie->result; - *quark = trie->quark; + if (trie->trie_path_count > 0) { + *res = ""; + *quark = g_quark_from_static_string(""); *consumed = pattern; return *res; } else { - if (trie->trie_path_count > 0) { - *res = ""; - *quark = g_quark_from_static_string(""); - *consumed = pattern; - return *res; - } else { - *res = NULL; - *quark = 0; - *consumed = pattern; - return *res; - } + *res = NULL; + *quark = 0; + *consumed = pattern; + return *res; } } @@ -3438,7 +3438,7 @@ vte_terminal_process_incoming(gpointer data) * clear that up if possible. */ if ((match != NULL) && (match[0] == '\0')) { #ifdef VTE_DEBUG - fprintf(stderr, "Ambiguous sequence (%d/%d). " + fprintf(stderr, "Ambiguous sequence at %d of %d. " "Resolving.\n", start, wcount); #endif /* Try to match the *entire* string. This will set @@ -3457,7 +3457,8 @@ vte_terminal_process_incoming(gpointer data) if (match == NULL) { #ifdef VTE_DEBUG fprintf(stderr, - "Looks like a sequence (%d).\n", + "Looks like a sequence at %d, " + "length = %d.\n", start, next - (wbuf + start)); #endif free_params_array(params); @@ -3469,20 +3470,13 @@ vte_terminal_process_incoming(gpointer data) &next, &quark, ¶ms); - if ((match != NULL) && (match[0] == '\0')) { - vte_trie_match(terminal->pvt->trie, - &wbuf[start], - next - (wbuf + start) + 1, - &match, - &next, - &quark, - ¶ms); - } } #ifdef VTE_DEBUG if ((match != NULL) && (match[0] != '\0')) { fprintf(stderr, - "Ambiguity resolved -- sequence "); + "Ambiguity resolved -- sequence at %d, " + "length = %d.\n", start, + next - (wbuf + start)); } if ((match != NULL) && (match[0] == '\0')) { int i; @@ -3491,6 +3485,9 @@ vte_terminal_process_incoming(gpointer data) for (i = 0; i < wcount; i++) { if (i == start) { fprintf(stderr, "=>"); + } else + if (i == (next - wbuf)) { + fprintf(stderr, "<="); } if ((wbuf[i] < 32) || (wbuf[i] > 127)) { fprintf(stderr, "{%ld}", @@ -3499,20 +3496,16 @@ vte_terminal_process_incoming(gpointer data) fprintf(stderr, "%lc", (wint_t) wbuf[i]); } - if (i == (next - wbuf)) { - fprintf(stderr, "<="); - } } if (i == (next - wbuf)) { fprintf(stderr, "<="); } - fprintf(stderr, "'.\n"); + fprintf(stderr, "' at %d.\n", start); } if (match == NULL) { - fprintf(stderr, - "Ambiguity resolved -- plain data "); + fprintf(stderr, "Ambiguity resolved -- " + "plain data (%d).\n", start); } - fprintf(stderr, "(%d).\n", next - wbuf); #endif } @@ -5532,6 +5525,7 @@ vte_terminal_set_emulation(VteTerminal *terminal, const char *emulation) vte_trie_add(terminal->pvt->trie, code, strlen(code), value, 0); } #ifdef VTE_DEBUG + /* vte_trie_print(terminal->pvt->trie); */ fprintf(stderr, "\n"); #endif @@ -5544,10 +5538,10 @@ vte_terminal_set_emulation(VteTerminal *terminal, const char *emulation) vte_terminal_set_size(terminal, vte_termcap_find_numeric(terminal->pvt->termcap, terminal->pvt->terminal, - "co") ?: 60, + "co") ?: 80, vte_termcap_find_numeric(terminal->pvt->termcap, terminal->pvt->terminal, - "li") ?: 18); + "li") ?: 24); } /* Set the path to the termcap file we read, and read it in. */ @@ -5615,15 +5609,22 @@ vte_terminal_init(VteTerminal *terminal, gpointer *klass) /* Initialize data members with settings from the environment and * structures to use for these. */ pvt = terminal->pvt = g_malloc0(sizeof(*terminal->pvt)); - pvt->shell = getenv("SHELL"); if (pvt->shell == NULL) { pwd = getpwuid(getuid()); if (pwd != NULL) { pvt->shell = pwd->pw_shell; +#ifdef VTE_DEBUG + fprintf(stderr, "Using user's shell (%s).\n", + pvt->shell); +#endif } } if (pvt->shell == NULL) { pvt->shell = "/bin/sh"; +#ifdef VTE_DEBUG + fprintf(stderr, "Using hard-coded default shell (%s).\n", + pvt->shell); +#endif } pvt->shell = g_quark_to_string(g_quark_from_string(pvt->shell)); pvt->pty_master = -1; @@ -5752,8 +5753,8 @@ vte_terminal_init(VteTerminal *terminal, gpointer *klass) pvt->im_context = NULL; /* Set backspace/delete bindings. */ - pvt->backspace_binding = VTE_ERASE_AUTO; - pvt->delete_binding = VTE_ERASE_AUTO; + vte_terminal_set_backspace_binding(terminal, VTE_ERASE_AUTO); + vte_terminal_set_delete_binding(terminal, VTE_ERASE_AUTO); } /* Tell GTK+ how much space we need. */ @@ -7726,6 +7727,7 @@ vte_terminal_set_backspace_binding(VteTerminal *terminal, VteTerminalEraseBinding binding) { g_return_if_fail(VTE_IS_TERMINAL(terminal)); + /* FIXME: should we set the pty mode to match? */ terminal->pvt->backspace_binding = binding; } diff --git a/src/vteaccess.c b/src/vteaccess.c index 9e2dfcf..51a01c5 100644 --- a/src/vteaccess.c +++ b/src/vteaccess.c @@ -161,9 +161,11 @@ AtkObject * vte_terminal_accessible_new(VteTerminal *terminal) { GtkAccessible *access; + GObject *object; g_return_val_if_fail(VTE_IS_TERMINAL(terminal), NULL); - access = GTK_ACCESSIBLE(g_object_new(VTE_TYPE_TERMINAL_ACCESSIBLE, - NULL)); + object = g_object_new(VTE_TYPE_TERMINAL_ACCESSIBLE, NULL); + g_return_val_if_fail(GTK_IS_ACCESSIBLE(object), NULL); + access = GTK_ACCESSIBLE(object); atk_object_initialize(ATK_OBJECT(access), G_OBJECT(terminal)); access->widget = GTK_WIDGET(terminal); @@ -622,12 +624,10 @@ static void vte_terminal_accessible_class_init(gpointer *klass) { GObjectClass *gobject_class; - AtkObjectClass *atk_object_class; GtkAccessibleClass *gtk_accessible_class; GInterfaceInfo text; gobject_class = G_OBJECT_CLASS(klass); - atk_object_class = ATK_OBJECT_CLASS(klass); gtk_accessible_class = GTK_ACCESSIBLE_CLASS(klass); /* Add a text interface to this object class. */ @@ -660,7 +660,7 @@ vte_terminal_accessible_get_type(void) (GClassFinalizeFunc)NULL, (gconstpointer)NULL, - sizeof(VteTerminal), + sizeof(VteTerminalAccessible), 0, (GInstanceInitFunc)vte_terminal_accessible_init, diff --git a/src/vteaccess.h b/src/vteaccess.h index 6ee06f9..cb1d492 100644 --- a/src/vteaccess.h +++ b/src/vteaccess.h @@ -29,14 +29,14 @@ G_BEGIN_DECLS /* The terminal accessibility object itself. */ typedef struct _VteTerminalAccessible { - AtkObject object; + GtkAccessible parent; } VteTerminalAccessible; /* The object's class structure. */ typedef struct _VteTerminalAccessibleClass { /*< public > */ /* Inherited parent class. */ - AtkObjectClass parent_class; + GtkAccessibleClass parent_class; } VteTerminalAccessibleClass; /* The object's type. */ @@ -1,5 +1,5 @@ Name: vte -Version: 0.3.3 +Version: 0.3.4 Release: 1 Summary: An experimental terminal emulator. License: LGPL @@ -53,6 +53,10 @@ make install DESTDIR=$RPM_BUILD_ROOT %{_libdir}/pkgconfig/* %changelog +* Thu May 2 2002 Nalin Dahyabhai <nalin@redhat.com> 0.3.4-1 +- try to speed up sequence recognition a bit +- disable some window_scroll speedups that appear to cause flickering + * Wed May 1 2002 Nalin Dahyabhai <nalin@redhat.com> 0.3.2-1 - include a small default termcap for systems without termcap files |