summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNalin Dahyabhai <nalin@src.gnome.org>2002-05-21 15:36:52 +0000
committerNalin Dahyabhai <nalin@src.gnome.org>2002-05-21 15:36:52 +0000
commit13a2a609868858fb30ee68ba9baddcb31ad91480 (patch)
tree1f11bdd49e036dfc8c5c6d6daae498d4c39c6022
parent0b343b1d7b1aae735b86ef5eb0760c91d5b867ed (diff)
Patch from Hidetoshi Tajima to fix building on Solaris systems, remove use
* autogen.sh, src/termcap.c, src/utf8echo.c, src/vte.c: Patch from Hidetoshi Tajima to fix building on Solaris systems, remove use of syntax that might be specific to gcc, and fix an overrun in vte_termcap_generate(). (#82433)
-rw-r--r--ChangeLog9
-rw-r--r--README8
-rwxr-xr-xautogen.sh99
-rw-r--r--configure.in2
-rw-r--r--src/Makefile.am1
-rw-r--r--src/termcap.c6
-rw-r--r--src/utf8echo.c12
-rw-r--r--src/vte.c45
8 files changed, 142 insertions, 40 deletions
diff --git a/ChangeLog b/ChangeLog
index 2d7cf1d..7197dda 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,11 +1,19 @@
+2002-05-21 nalin
+ * autogen.sh, src/termcap.c, src/utf8echo.c, src/vte.c: Patch from
+ Hidetoshi Tajima to fix building on Solaris systems, remove use of
+ syntax that might be specific to gcc, and fix an overrun in
+ vte_termcap_generate(). (#82433)
+
2002-05-18 andersca
* src/vte.c: Don't queue a background update if the background isn't
transparent.
+
2002-05-16 nalin
* src/vte.c: Snip trailing whitespace off of copied lines, insert
an end-of-line only when the copied line doesn't go to the right edge,
don't overrun right edge, even in insert mode. Fix displaying of
underlined text. Finish implementing matching.
+
2002-05-15 nalin
* src/vte.c: Send kI on insert key. Don't send drag events when the
child has only asked for click events. Fix crashbugs in selection.
@@ -13,6 +21,7 @@
of performing a history scroll if the child wants mouse events. Start
adding match support, merging how selection views the buffer with how
matching views the buffer, though matching doesn't work yet.
+
2002-05-14 nalin
* src/vte.c: Don't try to draw nul characters, most fonts can't. Don't
send motion-tracking events to the child unless we're dragging. Fix
diff --git a/README b/README
index 3daf1e5..5351abb 100644
--- a/README
+++ b/README
@@ -26,6 +26,14 @@
implemented (ff, fs, i1, i3, is, iP, LF, LO, MC, mh, ML, mm, mo, nw, pf,
pk, pl, pf, po, pO, ps, px, r1, r2, r3, RA, RF, rp, rs, RX, SA, SX, wi,
several more from the XTerm set).
+- Currently doesn't handle children exiting quite right (if the child spawned
+ a background process which keeps its stdio open, we don't close because we
+ don't get an EOF).
+- Small dingus bug -- if the string is at the end of the buffer, too much
+ is hilited.
+- Sequence matching is greedy, so that C=AB matches C and not A and then B.
+- Bold doesn't work right if the default foreground color isn't gray. Need
+ to move to 20-color palette to fix this right.
- I'm not sure the widget implementation itself is correct. There are many
changes in going from GTK+ 1.2 to 2.0, and examples of the proper way to do
things is currently scarce, so some of it's guesswork.
diff --git a/autogen.sh b/autogen.sh
index cff48d6..0ccd417 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -1,12 +1,87 @@
-#!/bin/bash -e
-CFLAGS="${CFLAGS:--g3 -O -Wall}" ; export CFLAGS
-set -x
-libtoolize -f -c
-autoheader-2.13 || autoheader
-aclocal-1.5 || aclocal
-automake-1.5 -a || automake -a
-autoconf-2.13 || autoconf
-if test -f config.cache ; then
- rm -f config.cache
-fi
-./configure $@
+#!/bin/sh
+# Run this to generate all the initial makefiles, etc.
+
+srcdir=`dirname $0`
+test -z "$srcdir" && srcdir=.
+
+ORIGDIR=`pwd`
+cd $srcdir
+PROJECT=GLib
+TEST_TYPE=-f
+
+DIE=0
+
+have_libtool=false
+if libtool --version < /dev/null > /dev/null 2>&1 ; then
+ libtool_version=`libtoolize --version | libtoolize --version | sed 's/^[^0-9]*\([0-9.][0-9.]*\).*/\1/'`
+ case $libtool_version in
+ 1.4*)
+ have_libtool=true
+ ;;
+ esac
+fi
+if $have_libtool ; then : ; else
+ echo
+ echo "You must have libtool 1.4 installed to compile $PROJECT."
+ echo "Install the appropriate package for your distribution,"
+ echo "or get the source tarball at ftp://ftp.gnu.org/pub/gnu/"
+ DIE=1
+fi
+
+(autoconf --version) < /dev/null > /dev/null 2>&1 || {
+ echo
+ echo "You must have autoconf installed to compile $PROJECT."
+ echo "libtool the appropriate package for your distribution,"
+ echo "or get the source tarball at ftp://ftp.gnu.org/pub/gnu/"
+ DIE=1
+}
+
+have_automake=false
+if automake --version < /dev/null > /dev/null 2>&1 ; then
+ automake_version=`automake --version | grep 'automake (GNU automake)' | sed 's/^[^0-9]*\(.*\)/\1/'`
+ case $automake_version in
+ 1.2*|1.3*|1.4)
+ ;;
+ *)
+ have_automake=true
+ ;;
+ esac
+fi
+if $have_automake ; then : ; else
+ echo
+ echo "You must have automake 1.4-p1 installed to compile $PROJECT."
+ echo "Get ftp://ftp.gnu.org/pub/gnu/automake/automake-1.4-p1.tar.gz"
+ echo "(or a newer version if it is available)"
+ DIE=1
+fi
+
+if test "$DIE" -eq 1; then
+ exit 1
+fi
+
+if test -z "$AUTOGEN_SUBDIR_MODE"; then
+ if test -z "$*"; then
+ echo "I am going to run ./configure with no arguments - if you wish "
+ echo "to pass any to it, please specify them on the $0 command line."
+ fi
+fi
+
+case $CC in
+*xlc | *xlc\ * | *lcc | *lcc\ *) am_opt=--include-deps;;
+esac
+
+aclocal $ACLOCAL_FLAGS
+
+# optionally feature autoheader
+(autoheader --version) < /dev/null > /dev/null 2>&1 && autoheader
+
+automake -a $am_opt
+autoconf
+cd $ORIGDIR
+
+if test -z "$AUTOGEN_SUBDIR_MODE"; then
+ $srcdir/configure --enable-maintainer-mode --enable-gtk-doc "$@"
+
+ echo
+ echo "Now type 'make' to compile $PROJECT."
+fi
diff --git a/configure.in b/configure.in
index 0af3dff..e03857d 100644
--- a/configure.in
+++ b/configure.in
@@ -36,7 +36,7 @@ AM_MAINTAINER_MODE
if test x$USE_MAINTAINER_MODE != x ; then
if test x$USE_MAINTAINER_MODE != xno ; then
- if test x$GCC != xno ; then
+ if test x$GCC = xyes ; then
CFLAGS="${CFLAGS} -Wunused"
CFLAGS="${CFLAGS} -Wuninitialized"
CFLAGS="${CFLAGS} -Wimplicit"
diff --git a/src/Makefile.am b/src/Makefile.am
index e7deff8..9661cd1 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -52,6 +52,7 @@ interpret_LDADD = @GLIB_LIBS@
utf8echo_SOURCES = \
utf8echo.c
+utf8echo_LDADD = @GLIB_LIBS@
ring_CFLAGS = @CFLAGS@ @GLIB_CFLAGS@ -DRING_MAIN
ring_SOURCES = \
diff --git a/src/termcap.c b/src/termcap.c
index 40f645e..4c8f317 100644
--- a/src/termcap.c
+++ b/src/termcap.c
@@ -611,10 +611,10 @@ vte_termcap_generate(struct vte_termcap *termcap)
ssize_t size;
char *ret = NULL;
struct vte_termcap_entry *entry;
- size = strlen(termcap->comment ?: "");
+ size = strlen(termcap->comment ? termcap->comment: "");
for (entry = termcap->entries; entry != NULL; entry = entry->next) {
- size += strlen(entry->comment ?: "");
- size += (strlen(entry->string ?: "") + 1);
+ size += (entry->comment ? strlen(entry->comment) : 0);
+ size += (entry->string ? strlen(entry->string) : 0) + 1;
}
ret = g_malloc(size + 1);
if (ret == NULL) {
diff --git a/src/utf8echo.c b/src/utf8echo.c
index 361db8c..209a9a4 100644
--- a/src/utf8echo.c
+++ b/src/utf8echo.c
@@ -18,7 +18,7 @@
#ident "$Id$"
#include "../config.h"
-#include <iconv.h>
+#include <glib/gconvert.h>
#include <limits.h>
#include <stdio.h>
#include <stdlib.h>
@@ -29,7 +29,7 @@ int
main(int argc, char **argv)
{
int i;
- iconv_t conv;
+ GIConv conv;
char buf[LINE_MAX];
wchar_t w;
char *inbuf, *outbuf;
@@ -40,26 +40,26 @@ main(int argc, char **argv)
return 1;
}
- conv = iconv_open("UTF-8", "WCHAR_T");
+ conv = g_iconv_open("UTF-8", "WCHAR_T");
if (conv == NULL) {
return 1;
}
printf(ESC "%%G");
for (i = 1; i < argc; i++) {
- w = (wint_t)atol(argv[i]);
+ w = (wchar_t)atol(argv[i]);
inbuf = (char*)&w;
insize = sizeof(w);
memset(buf, 0, sizeof(buf));
outbuf = buf;
outsize = sizeof(buf);
- if (iconv(conv, &inbuf, &insize, &outbuf, &outsize) != -1) {
+ if (g_iconv(conv, &inbuf, &insize, &outbuf, &outsize) != -1) {
printf("%*s", outbuf - buf, buf);
}
}
printf(ESC "%%@\n");
- iconv_close(conv);
+ g_iconv_close(conv);
return 0;
}
diff --git a/src/vte.c b/src/vte.c
index 695346c..39cb878 100644
--- a/src/vte.c
+++ b/src/vte.c
@@ -160,8 +160,8 @@ struct _VteTerminalPrivate {
XFontSet fontset;
#ifdef HAVE_XFT
XftFont *ftfont;
- gboolean use_xft;
#endif
+ gboolean use_xft;
PangoFontDescription *fontdesc;
PangoLayout *layout;
gboolean use_pango;
@@ -449,8 +449,8 @@ vte_invalidate_cursor_once(gpointer data)
screen = terminal->pvt->screen;
columns = 1;
cell = vte_terminal_find_charcell(terminal,
- screen->cursor_current.col,
- screen->cursor_current.row);
+ screen->cursor_current.col,
+ screen->cursor_current.row);
if (cell != NULL) {
columns = cell->columns;
}
@@ -4034,7 +4034,7 @@ vte_sequence_handler_complain_key(VteTerminal *terminal,
{
g_return_if_fail(VTE_IS_TERMINAL(terminal));
g_warning("Got unexpected (key?) sequence `%s'.\n",
- match ?: "???");
+ match ? match : "???");
}
/* The table of handlers. Primarily used at initialization time. */
@@ -4855,10 +4855,12 @@ vte_terminal_fork_command(VteTerminal *terminal, const char *command,
}
#endif
env_add[2] = NULL;
+ if (command == NULL) {
+ command = terminal->pvt->shell;
+ }
terminal->pvt->pty_master = vte_pty_open(&pid,
env_add,
- command ?:
- terminal->pvt->shell,
+ command,
argv);
g_free(term);
g_free(colorterm);
@@ -5543,7 +5545,7 @@ vte_terminal_io_write(GIOChannel *channel,
for (i = 0; i < count; i++) {
fprintf(stderr, "Wrote %c%c\n",
terminal->pvt->outgoing[i] > 32 ?
- ' ' : '^',
+ ' ' : '^',
terminal->pvt->outgoing[i] > 32 ?
terminal->pvt->outgoing[i] :
terminal->pvt->outgoing[i] + 64);
@@ -6361,7 +6363,7 @@ vte_terminal_send_mouse_button(VteTerminal *terminal, GdkEventButton *event)
/* Encode the parameters and send them to the app. */
vte_terminal_send_mouse_button_int(terminal,
- (event->type == GDK_BUTTON_PRESS) ?
+ (event->type == GDK_BUTTON_PRESS) ?
event->button : 0,
event->x,
event->y,
@@ -7053,6 +7055,7 @@ vte_terminal_font_complain(const char *font,
}
}
+#ifdef HAVE_XFT
static int
xft_weight_from_pango_weight (int weight)
{
@@ -7087,7 +7090,6 @@ xft_slant_from_pango_style (int style)
return XFT_SLANT_ROMAN;
}
-#ifdef HAVE_XFT
/* Create an Xft pattern from a Pango font description. */
static XftPattern *
xft_pattern_from_pango_font_description(const PangoFontDescription *font_desc)
@@ -7669,6 +7671,7 @@ vte_terminal_set_emulation(VteTerminal *terminal, const char *emulation)
const char *code, *value;
char *stripped;
size_t stripped_length;
+ int columns, rows;
GQuark quark;
char *tmp;
int i;
@@ -7754,13 +7757,15 @@ vte_terminal_set_emulation(VteTerminal *terminal, const char *emulation)
"ul");
/* Resize to the given default. */
+ columns = vte_termcap_find_numeric(terminal->pvt->termcap,
+ terminal->pvt->terminal,
+ "co");
+ rows = vte_termcap_find_numeric(terminal->pvt->termcap,
+ terminal->pvt->terminal,
+ "li");
vte_terminal_set_size(terminal,
- vte_termcap_find_numeric(terminal->pvt->termcap,
- terminal->pvt->terminal,
- "co") ?: 80,
- vte_termcap_find_numeric(terminal->pvt->termcap,
- terminal->pvt->terminal,
- "li") ?: 24);
+ columns ? columns : 80,
+ rows ? rows : 24);
}
/* Set the path to the termcap file we read, and read it in. */
@@ -7773,7 +7778,8 @@ vte_terminal_set_termcap(VteTerminal *terminal, const char *path)
if (path == NULL) {
snprintf(path_default, sizeof(path_default),
DATADIR "/" PACKAGE "/termcap/%s",
- terminal->pvt->terminal ?: VTE_DEFAULT_EMULATION);
+ terminal->pvt->terminal ?
+ terminal->pvt->terminal : VTE_DEFAULT_EMULATION);
if (stat(path_default, &st) == 0) {
path = path_default;
} else {
@@ -7892,7 +7898,7 @@ vte_terminal_init(VteTerminal *terminal, gpointer *klass)
pvt->cursor_blinks = FALSE;
pvt->cursor_blink_tag = g_timeout_add(0,
- vte_invalidate_cursor_periodic,
+ vte_invalidate_cursor_periodic,
terminal);
pvt->last_keypress_time = 0;
@@ -7917,12 +7923,12 @@ vte_terminal_init(VteTerminal *terminal, gpointer *klass)
}
}
+ pvt->use_xft = FALSE;
#ifdef HAVE_XFT
/* Try to use Xft if the user requests it. Provide both the original
* variable we consulted (which we should stop consulting at some
* point) and the one GTK itself uses. */
pvt->ftfont = NULL;
- pvt->use_xft = FALSE;
if (getenv("VTE_USE_XFT") != NULL) {
if (atol(getenv("VTE_USE_XFT")) != 0) {
pvt->use_xft = TRUE;
@@ -8424,6 +8430,7 @@ vte_terminal_determine_colors(VteTerminal *terminal,
}
}
+#if HAVE_XFT
/* Try to map some common characters which are frequently missing from fonts
* to others which look the same and may be there. */
static XftChar32
@@ -8457,6 +8464,8 @@ vte_terminal_xft_remap_char(Display *display, XftFont *font, XftChar32 orig)
return orig;
}
}
+#endif
+
/* Draw a particular character on the screen. */
static void
vte_terminal_draw_char(VteTerminal *terminal,