ask for LC_* in addition to LANG if weird spacing errors crop up. add
authorNalin Dahyabhai <nalin@src.gnome.org>
Thu, 11 Sep 2003 20:45:04 +0000 (20:45 +0000)
committerNalin Dahyabhai <nalin@src.gnome.org>
Thu, 11 Sep 2003 20:45:04 +0000 (20:45 +0000)
* README: ask for LC_* in addition to LANG if weird spacing errors crop up.
* src/vteconv.c,src/vteconv.h: add wrappers for _vte_conv which weed out some
compiler warnings.
* src/iso2022.c: use _vte_conv_cu instead of _vte_conv.
* src/trie.c: use _vte_conv_cu instead of _vte_conv.
* src/vte.c: give _vte_terminal_fudge_pango_colors a return type again.
* src/vtebg.c: ifdef out vte_bg_source_name, which is unused.
* src/vtebg.c,src/vterdb.c: wrap calls to gdk_property_get to weed out some
compiler warnings.

ChangeLog
README
src/iso2022.c
src/trie.c
src/vte.c
src/vtebg.c
src/vteconv.c
src/vteconv.h
src/vterdb.c

index 5415991..a267bd3 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+2003-09-11 nalin
+       * README: ask for LC_* in addition to LANG if weird spacing errors
+       crop up.
+       * src/vteconv.c,src/vteconv.h: add wrappers for _vte_conv which weed
+       out some warnings.
+       * src/iso2022.c: use _vte_conv_cu instead of _vte_conv.
+       * src/trie.c: use _vte_conv_cu instead of _vte_conv.
+       * src/vte.c: give _vte_terminal_fudge_pango_colors a return type again.
+       * src/vtebg.c: ifdef out vte_bg_source_name, which is unused.
+       * src/vtebg.c,src/vterdb.c: wrap calls to gdk_property_get to weed out
+       some compiler warnings.
+
 2003-09-11 nalin
        * src/vte.c(vte_terminal_draw_cells_with_attributes): properly resolve
        colors and cell properties to drawing colors.
diff --git a/README b/README
index 514e101..10aefa3 100644 (file)
--- a/README
+++ b/README
@@ -55,4 +55,4 @@
   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.
+  the contents of your LANG/LC_* environment variables.
index a866424..7689d46 100644 (file)
@@ -1263,9 +1263,9 @@ process_cdata(struct _vte_iso2022_state *state, guchar *cdata, gsize length,
                outbuf = (gunichar*)buf;
                outbytes = sizeof(gunichar) * length * 2;
                do {
-                       converted = _vte_conv(state->conv,
-                                             &inbuf, &inbytes,
-                                             (gchar**) &outbuf, &outbytes);
+                       converted = _vte_conv_cu(state->conv,
+                                                &inbuf, &inbytes,
+                                                &outbuf, &outbytes);
                        stop = FALSE;
                        switch (converted) {
                        case ((size_t)-1):
index 2aabe12..3a92f19 100644 (file)
@@ -847,7 +847,7 @@ convert_mbstowcs(const char *i, size_t ilen,
 
        memset(o, 0, max_olen);
        outlen = max_olen;
-       _vte_conv(conv, (char**)&i, &ilen, (char**)&o, &outlen);
+       _vte_conv_cu(conv, (char**)&i, &ilen, &o, &outlen);
        _vte_conv_close(conv);
 
        *olen = (max_olen - outlen) / sizeof(gunichar);
index 7ab2477..b210c6e 100644 (file)
--- a/src/vte.c
+++ b/src/vte.c
@@ -13005,6 +13005,7 @@ _vte_terminal_map_pango_color(VteTerminal *terminal, PangoColor *color)
  * is using "black-on-white" to signify "inverse".  Pick up on that state and
  * fix things.  Do this here, so that if we suddenly get red-on-black, we'll do
  * the right thing. */
+static void
 _vte_terminal_fudge_pango_colors(VteTerminal *terminal, GSList *attributes,
                                 struct vte_charcell *cells, gssize n)
 {
index 5a4ba0d..9b6e4b0 100644 (file)
@@ -40,6 +40,7 @@ static VteBg *singleton_bg = NULL;
 static void vte_bg_set_root_pixmap(VteBg *bg, GdkPixmap *pixmap);
 static void vte_bg_init(VteBg *bg, gpointer *klass);
 
+#if 0
 static const char *
 vte_bg_source_name(enum VteBgSourceType type)
 {
@@ -59,6 +60,7 @@ vte_bg_source_name(enum VteBgSourceType type)
        }
        return "unknown";
 }
+#endif
 
 #ifndef X_DISPLAY_MISSING
 
@@ -101,6 +103,18 @@ _vte_bg_display_sync(VteBg *bg)
 #endif
 }
 
+static gboolean
+_vte_property_get_pixmaps(GdkWindow *window, GdkAtom atom,
+                         GdkAtom *type, int *size,
+                         XID **pixmaps)
+{
+       return gdk_property_get(window, atom, GDK_TARGET_PIXMAP,
+                               0, INT_MAX,
+                               FALSE,
+                               type, NULL, size,
+                               (guchar**) pixmaps);
+}
+
 static GdkPixmap *
 vte_bg_root_pixmap(VteBg *bg)
 {
@@ -112,16 +126,9 @@ vte_bg_root_pixmap(VteBg *bg)
        pixmap = NULL;
        pixmaps = NULL;
        gdk_error_trap_push();
-       if (gdk_property_get(bg->native->window,
-                            bg->native->atom,
-                            GDK_TARGET_PIXMAP,
-                            0,
-                            INT_MAX,
-                            FALSE,
-                            &prop_type,
-                            NULL,
-                            &prop_size,
-                            (guchar**) &pixmaps)) {
+       if (_vte_property_get_pixmaps(bg->native->window, bg->native->atom,
+                                     &prop_type, &prop_size,
+                                     &pixmaps)) {
                if ((prop_type == GDK_TARGET_PIXMAP) &&
                    (prop_size >= sizeof(XID) &&
                    (pixmaps != NULL))) {
index 119f169..8667f61 100644 (file)
@@ -345,6 +345,36 @@ _vte_conv(VteConv converter,
        return ret;
 }
 
+size_t
+_vte_conv_cu(VteConv converter,
+            char **inbuf, gsize *inbytes_left,
+            gunichar **outbuf, gsize *outbytes_left)
+{
+       return _vte_conv(converter,
+                        inbuf, inbytes_left,
+                        (char**)outbuf, outbytes_left);
+}
+
+size_t
+_vte_conv_uu(VteConv converter,
+            gunichar **inbuf, gsize *inbytes_left,
+            gunichar **outbuf, gsize *outbytes_left)
+{
+       return _vte_conv(converter,
+                        (char**)inbuf, inbytes_left,
+                        (char**)outbuf, outbytes_left);
+}
+
+size_t
+_vte_conv_uc(VteConv converter,
+            gunichar **inbuf, gsize *inbytes_left,
+            char **outbuf, gsize *outbytes_left)
+{
+       return _vte_conv(converter,
+                        (char**)inbuf, inbytes_left,
+                        outbuf, outbytes_left);
+}
+
 #ifdef VTECONV_MAIN
 static void
 clear(gunichar wide[5], gchar narrow[5])
index 30d1204..05c4699 100644 (file)
@@ -36,6 +36,15 @@ VteConv _vte_conv_open(const char *target, const char *source);
 size_t _vte_conv(VteConv converter,
                 gchar **inbuf, gsize *inbytes_left,
                 gchar **outbuf, gsize *outbytes_left);
+size_t _vte_conv_uc(VteConv converter,
+                   gunichar **inbuf, gsize *inbytes_left,
+                   gchar **outbuf, gsize *outbytes_left);
+size_t _vte_conv_uu(VteConv converter,
+                   gunichar **inbuf, gsize *inbytes_left,
+                   gunichar **outbuf, gsize *outbytes_left);
+size_t _vte_conv_cu(VteConv converter,
+                   gchar **inbuf, gsize *inbytes_left,
+                   gunichar **outbuf, gsize *outbytes_left);
 gint _vte_conv_close(VteConv converter);
 
 G_END_DECLS
index 82816b8..26f9361 100644 (file)
 #define DEFAULT_HINTING                TRUE
 #define DEFAULT_HINTSTYLE      "hintfull"
 
+static gboolean
+_vte_property_get_string(GdkWindow *window, GdkAtom atom,
+                        GdkAtom *type, int *size,
+                        char **retval)
+{
+       return gdk_property_get(window, atom, GDK_TARGET_STRING,
+                               0, INT_MAX,
+                               FALSE,
+                               type, NULL, size,
+                               (guchar**) retval);
+}
+
 static gchar **
 _vte_rdb_get(GtkWidget *widget, gboolean screen_setting)
 {
@@ -76,9 +88,9 @@ _vte_rdb_get(GtkWidget *widget, gboolean screen_setting)
        /* Read the string property off of the window. */
        prop_data = NULL;
        gdk_error_trap_push();
-       gdk_property_get(root, atom, GDK_TARGET_STRING, 0, INT_MAX, FALSE,
-                        &prop_type, NULL, &prop_length,
-                        (guchar**) &prop_data);
+       _vte_property_get_string(root, atom,
+                                &prop_type, &prop_length,
+                                &prop_data);
 #if GTK_CHECK_VERSION(2,2,0)
        gdk_display_sync(display);
 #else