summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog33
-rw-r--r--ChangeLog.pre-2-033
-rw-r--r--ChangeLog.pre-2-1033
-rw-r--r--ChangeLog.pre-2-233
-rw-r--r--ChangeLog.pre-2-433
-rw-r--r--ChangeLog.pre-2-633
-rw-r--r--ChangeLog.pre-2-833
-rw-r--r--gdk/gdk.c20
-rw-r--r--gdk/gdkcc.c21
-rw-r--r--gdk/gdkvisual.c4
-rw-r--r--gdk/x11/gdkcc-x11.c21
-rw-r--r--gdk/x11/gdkmain-x11.c20
-rw-r--r--gdk/x11/gdkvisual-x11.c4
-rw-r--r--gtk/gtkcombo.c4
-rw-r--r--gtk/gtkcontainer.c2
-rw-r--r--gtk/gtkdebug.h3
-rw-r--r--gtk/gtkeditable.c5
-rw-r--r--gtk/gtkentry.c151
-rw-r--r--gtk/gtkmain.c31
-rw-r--r--gtk/gtkobject.c2
-rw-r--r--gtk/gtkprivate.h6
-rw-r--r--gtk/gtktext.c2
22 files changed, 432 insertions, 95 deletions
diff --git a/ChangeLog b/ChangeLog
index 5f87c10811..205cf09ad9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,35 @@
+Tue Mar 17 01:55:00 1998 Owen Taylor <owt1@cornell.edu>
+
+ * gtk/gtkmain.c gtk/gtkentry.c: Try to guess if we can
+ use the mb* functions safely. (For glibc, they do
+ UTF-8). Heuristic is (X_LOCALE && locale != C/POSIX)
+ || (mblen("\xc0", MB_CUR_MAX) == 1).
+
+ (From: "Richard Lloyd" <rkl@csc.liv.ac.uk>)
+
+ * gdk/gdk.c (gdk_ic_get_attr): Use an intermediate
+ variable to avoid taking the address of the result
+ of va_arg.
+
+ * gtk/gtkentry.c gtk/gtkeditable.c gtkobject.c
+ gtk/testselection.c: signedness fixups
+
+ * gtk/gtkcontainer.c: Fixed implicit cast between
+ gpointer and func pointer by changing.
+
+ * gtk/gtkcombo.c, gtk/gtkentry.c, gtk/gtktext.c:
+ static void forward declaration vs. void actual fixed
+
+ * gtk/testgtk.c: Limit total number of tree items to 10,000
+
+Mon Mar 16 21:14:52 1998 Owen Taylor <owt1@cornell.edu>
+
+ * gdk/gdkvisual.c: Put visual names into #ifdef G_ENABLE_DEBUG
+ gtk-jbuhler-980315-0.patch
+
+ * gdk/gdkcc.c: Changed DEBUG => G_ENABLE_DEBUG, eliminate
+ unused variable warnings.
+
Tue Mar 17 16:19:47 1998 Tim Janik <timj@gimp.org>
* gdk/gdk.c:
@@ -52,7 +84,6 @@ Mon Mar 16 18:19:31 GMT 1998 Tony Gale <gale@gimp.org>
- new question on updating progressbars
- update all the links to gtk.org
->>>>>>> 1.255
Mon Mar 16 09:15:03 GMT 1998 Tony Gale <gale@gimp.org>
* docs/gtk_tut.sgml:
diff --git a/ChangeLog.pre-2-0 b/ChangeLog.pre-2-0
index 5f87c10811..205cf09ad9 100644
--- a/ChangeLog.pre-2-0
+++ b/ChangeLog.pre-2-0
@@ -1,3 +1,35 @@
+Tue Mar 17 01:55:00 1998 Owen Taylor <owt1@cornell.edu>
+
+ * gtk/gtkmain.c gtk/gtkentry.c: Try to guess if we can
+ use the mb* functions safely. (For glibc, they do
+ UTF-8). Heuristic is (X_LOCALE && locale != C/POSIX)
+ || (mblen("\xc0", MB_CUR_MAX) == 1).
+
+ (From: "Richard Lloyd" <rkl@csc.liv.ac.uk>)
+
+ * gdk/gdk.c (gdk_ic_get_attr): Use an intermediate
+ variable to avoid taking the address of the result
+ of va_arg.
+
+ * gtk/gtkentry.c gtk/gtkeditable.c gtkobject.c
+ gtk/testselection.c: signedness fixups
+
+ * gtk/gtkcontainer.c: Fixed implicit cast between
+ gpointer and func pointer by changing.
+
+ * gtk/gtkcombo.c, gtk/gtkentry.c, gtk/gtktext.c:
+ static void forward declaration vs. void actual fixed
+
+ * gtk/testgtk.c: Limit total number of tree items to 10,000
+
+Mon Mar 16 21:14:52 1998 Owen Taylor <owt1@cornell.edu>
+
+ * gdk/gdkvisual.c: Put visual names into #ifdef G_ENABLE_DEBUG
+ gtk-jbuhler-980315-0.patch
+
+ * gdk/gdkcc.c: Changed DEBUG => G_ENABLE_DEBUG, eliminate
+ unused variable warnings.
+
Tue Mar 17 16:19:47 1998 Tim Janik <timj@gimp.org>
* gdk/gdk.c:
@@ -52,7 +84,6 @@ Mon Mar 16 18:19:31 GMT 1998 Tony Gale <gale@gimp.org>
- new question on updating progressbars
- update all the links to gtk.org
->>>>>>> 1.255
Mon Mar 16 09:15:03 GMT 1998 Tony Gale <gale@gimp.org>
* docs/gtk_tut.sgml:
diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10
index 5f87c10811..205cf09ad9 100644
--- a/ChangeLog.pre-2-10
+++ b/ChangeLog.pre-2-10
@@ -1,3 +1,35 @@
+Tue Mar 17 01:55:00 1998 Owen Taylor <owt1@cornell.edu>
+
+ * gtk/gtkmain.c gtk/gtkentry.c: Try to guess if we can
+ use the mb* functions safely. (For glibc, they do
+ UTF-8). Heuristic is (X_LOCALE && locale != C/POSIX)
+ || (mblen("\xc0", MB_CUR_MAX) == 1).
+
+ (From: "Richard Lloyd" <rkl@csc.liv.ac.uk>)
+
+ * gdk/gdk.c (gdk_ic_get_attr): Use an intermediate
+ variable to avoid taking the address of the result
+ of va_arg.
+
+ * gtk/gtkentry.c gtk/gtkeditable.c gtkobject.c
+ gtk/testselection.c: signedness fixups
+
+ * gtk/gtkcontainer.c: Fixed implicit cast between
+ gpointer and func pointer by changing.
+
+ * gtk/gtkcombo.c, gtk/gtkentry.c, gtk/gtktext.c:
+ static void forward declaration vs. void actual fixed
+
+ * gtk/testgtk.c: Limit total number of tree items to 10,000
+
+Mon Mar 16 21:14:52 1998 Owen Taylor <owt1@cornell.edu>
+
+ * gdk/gdkvisual.c: Put visual names into #ifdef G_ENABLE_DEBUG
+ gtk-jbuhler-980315-0.patch
+
+ * gdk/gdkcc.c: Changed DEBUG => G_ENABLE_DEBUG, eliminate
+ unused variable warnings.
+
Tue Mar 17 16:19:47 1998 Tim Janik <timj@gimp.org>
* gdk/gdk.c:
@@ -52,7 +84,6 @@ Mon Mar 16 18:19:31 GMT 1998 Tony Gale <gale@gimp.org>
- new question on updating progressbars
- update all the links to gtk.org
->>>>>>> 1.255
Mon Mar 16 09:15:03 GMT 1998 Tony Gale <gale@gimp.org>
* docs/gtk_tut.sgml:
diff --git a/ChangeLog.pre-2-2 b/ChangeLog.pre-2-2
index 5f87c10811..205cf09ad9 100644
--- a/ChangeLog.pre-2-2
+++ b/ChangeLog.pre-2-2
@@ -1,3 +1,35 @@
+Tue Mar 17 01:55:00 1998 Owen Taylor <owt1@cornell.edu>
+
+ * gtk/gtkmain.c gtk/gtkentry.c: Try to guess if we can
+ use the mb* functions safely. (For glibc, they do
+ UTF-8). Heuristic is (X_LOCALE && locale != C/POSIX)
+ || (mblen("\xc0", MB_CUR_MAX) == 1).
+
+ (From: "Richard Lloyd" <rkl@csc.liv.ac.uk>)
+
+ * gdk/gdk.c (gdk_ic_get_attr): Use an intermediate
+ variable to avoid taking the address of the result
+ of va_arg.
+
+ * gtk/gtkentry.c gtk/gtkeditable.c gtkobject.c
+ gtk/testselection.c: signedness fixups
+
+ * gtk/gtkcontainer.c: Fixed implicit cast between
+ gpointer and func pointer by changing.
+
+ * gtk/gtkcombo.c, gtk/gtkentry.c, gtk/gtktext.c:
+ static void forward declaration vs. void actual fixed
+
+ * gtk/testgtk.c: Limit total number of tree items to 10,000
+
+Mon Mar 16 21:14:52 1998 Owen Taylor <owt1@cornell.edu>
+
+ * gdk/gdkvisual.c: Put visual names into #ifdef G_ENABLE_DEBUG
+ gtk-jbuhler-980315-0.patch
+
+ * gdk/gdkcc.c: Changed DEBUG => G_ENABLE_DEBUG, eliminate
+ unused variable warnings.
+
Tue Mar 17 16:19:47 1998 Tim Janik <timj@gimp.org>
* gdk/gdk.c:
@@ -52,7 +84,6 @@ Mon Mar 16 18:19:31 GMT 1998 Tony Gale <gale@gimp.org>
- new question on updating progressbars
- update all the links to gtk.org
->>>>>>> 1.255
Mon Mar 16 09:15:03 GMT 1998 Tony Gale <gale@gimp.org>
* docs/gtk_tut.sgml:
diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4
index 5f87c10811..205cf09ad9 100644
--- a/ChangeLog.pre-2-4
+++ b/ChangeLog.pre-2-4
@@ -1,3 +1,35 @@
+Tue Mar 17 01:55:00 1998 Owen Taylor <owt1@cornell.edu>
+
+ * gtk/gtkmain.c gtk/gtkentry.c: Try to guess if we can
+ use the mb* functions safely. (For glibc, they do
+ UTF-8). Heuristic is (X_LOCALE && locale != C/POSIX)
+ || (mblen("\xc0", MB_CUR_MAX) == 1).
+
+ (From: "Richard Lloyd" <rkl@csc.liv.ac.uk>)
+
+ * gdk/gdk.c (gdk_ic_get_attr): Use an intermediate
+ variable to avoid taking the address of the result
+ of va_arg.
+
+ * gtk/gtkentry.c gtk/gtkeditable.c gtkobject.c
+ gtk/testselection.c: signedness fixups
+
+ * gtk/gtkcontainer.c: Fixed implicit cast between
+ gpointer and func pointer by changing.
+
+ * gtk/gtkcombo.c, gtk/gtkentry.c, gtk/gtktext.c:
+ static void forward declaration vs. void actual fixed
+
+ * gtk/testgtk.c: Limit total number of tree items to 10,000
+
+Mon Mar 16 21:14:52 1998 Owen Taylor <owt1@cornell.edu>
+
+ * gdk/gdkvisual.c: Put visual names into #ifdef G_ENABLE_DEBUG
+ gtk-jbuhler-980315-0.patch
+
+ * gdk/gdkcc.c: Changed DEBUG => G_ENABLE_DEBUG, eliminate
+ unused variable warnings.
+
Tue Mar 17 16:19:47 1998 Tim Janik <timj@gimp.org>
* gdk/gdk.c:
@@ -52,7 +84,6 @@ Mon Mar 16 18:19:31 GMT 1998 Tony Gale <gale@gimp.org>
- new question on updating progressbars
- update all the links to gtk.org
->>>>>>> 1.255
Mon Mar 16 09:15:03 GMT 1998 Tony Gale <gale@gimp.org>
* docs/gtk_tut.sgml:
diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6
index 5f87c10811..205cf09ad9 100644
--- a/ChangeLog.pre-2-6
+++ b/ChangeLog.pre-2-6
@@ -1,3 +1,35 @@
+Tue Mar 17 01:55:00 1998 Owen Taylor <owt1@cornell.edu>
+
+ * gtk/gtkmain.c gtk/gtkentry.c: Try to guess if we can
+ use the mb* functions safely. (For glibc, they do
+ UTF-8). Heuristic is (X_LOCALE && locale != C/POSIX)
+ || (mblen("\xc0", MB_CUR_MAX) == 1).
+
+ (From: "Richard Lloyd" <rkl@csc.liv.ac.uk>)
+
+ * gdk/gdk.c (gdk_ic_get_attr): Use an intermediate
+ variable to avoid taking the address of the result
+ of va_arg.
+
+ * gtk/gtkentry.c gtk/gtkeditable.c gtkobject.c
+ gtk/testselection.c: signedness fixups
+
+ * gtk/gtkcontainer.c: Fixed implicit cast between
+ gpointer and func pointer by changing.
+
+ * gtk/gtkcombo.c, gtk/gtkentry.c, gtk/gtktext.c:
+ static void forward declaration vs. void actual fixed
+
+ * gtk/testgtk.c: Limit total number of tree items to 10,000
+
+Mon Mar 16 21:14:52 1998 Owen Taylor <owt1@cornell.edu>
+
+ * gdk/gdkvisual.c: Put visual names into #ifdef G_ENABLE_DEBUG
+ gtk-jbuhler-980315-0.patch
+
+ * gdk/gdkcc.c: Changed DEBUG => G_ENABLE_DEBUG, eliminate
+ unused variable warnings.
+
Tue Mar 17 16:19:47 1998 Tim Janik <timj@gimp.org>
* gdk/gdk.c:
@@ -52,7 +84,6 @@ Mon Mar 16 18:19:31 GMT 1998 Tony Gale <gale@gimp.org>
- new question on updating progressbars
- update all the links to gtk.org
->>>>>>> 1.255
Mon Mar 16 09:15:03 GMT 1998 Tony Gale <gale@gimp.org>
* docs/gtk_tut.sgml:
diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8
index 5f87c10811..205cf09ad9 100644
--- a/ChangeLog.pre-2-8
+++ b/ChangeLog.pre-2-8
@@ -1,3 +1,35 @@
+Tue Mar 17 01:55:00 1998 Owen Taylor <owt1@cornell.edu>
+
+ * gtk/gtkmain.c gtk/gtkentry.c: Try to guess if we can
+ use the mb* functions safely. (For glibc, they do
+ UTF-8). Heuristic is (X_LOCALE && locale != C/POSIX)
+ || (mblen("\xc0", MB_CUR_MAX) == 1).
+
+ (From: "Richard Lloyd" <rkl@csc.liv.ac.uk>)
+
+ * gdk/gdk.c (gdk_ic_get_attr): Use an intermediate
+ variable to avoid taking the address of the result
+ of va_arg.
+
+ * gtk/gtkentry.c gtk/gtkeditable.c gtkobject.c
+ gtk/testselection.c: signedness fixups
+
+ * gtk/gtkcontainer.c: Fixed implicit cast between
+ gpointer and func pointer by changing.
+
+ * gtk/gtkcombo.c, gtk/gtkentry.c, gtk/gtktext.c:
+ static void forward declaration vs. void actual fixed
+
+ * gtk/testgtk.c: Limit total number of tree items to 10,000
+
+Mon Mar 16 21:14:52 1998 Owen Taylor <owt1@cornell.edu>
+
+ * gdk/gdkvisual.c: Put visual names into #ifdef G_ENABLE_DEBUG
+ gtk-jbuhler-980315-0.patch
+
+ * gdk/gdkcc.c: Changed DEBUG => G_ENABLE_DEBUG, eliminate
+ unused variable warnings.
+
Tue Mar 17 16:19:47 1998 Tim Janik <timj@gimp.org>
* gdk/gdk.c:
@@ -52,7 +84,6 @@ Mon Mar 16 18:19:31 GMT 1998 Tony Gale <gale@gimp.org>
- new question on updating progressbars
- update all the links to gtk.org
->>>>>>> 1.255
Mon Mar 16 09:15:03 GMT 1998 Tony Gale <gale@gimp.org>
* docs/gtk_tut.sgml:
diff --git a/gdk/gdk.c b/gdk/gdk.c
index 9dcb75bde8..445b7ce069 100644
--- a/gdk/gdk.c
+++ b/gdk/gdk.c
@@ -3430,6 +3430,7 @@ gdk_ic_new (GdkWindow* client_window,
GdkIMStyle style, ...)
{
va_list list;
+ void *argsptr;
GdkICPrivate *private;
XVaNestedList preedit_attr;
@@ -3440,7 +3441,8 @@ gdk_ic_new (GdkWindow* client_window,
private = g_new (GdkICPrivate, 1);
va_start (list, style);
- preedit_attr = (XVaNestedList) & (va_arg (list, void *));
+ argsptr = va_arg (list, void *);
+ preedit_attr = (XVaNestedList)&argsptr;
va_end (list);
private->style = gdk_im_decide_style (style);
@@ -3500,6 +3502,7 @@ void
gdk_ic_set_values (GdkIC ic, ...)
{
va_list list;
+ void *argsptr;
XVaNestedList args;
GdkICPrivate *private;
@@ -3508,7 +3511,8 @@ gdk_ic_set_values (GdkIC ic, ...)
private = (GdkICPrivate *) ic;
va_start (list, ic);
- args = (XVaNestedList) & (va_arg (list, void *));
+ argsptr = va_arg (list, void *);
+ args = (XVaNestedList)&argsptr;
va_end (list);
XSetICValues (private->xic, XNVaNestedList, args, NULL);
@@ -3518,6 +3522,7 @@ void
gdk_ic_get_values (GdkIC ic, ...)
{
va_list list;
+ void *argsptr;
XVaNestedList args;
GdkICPrivate *private;
@@ -3526,7 +3531,8 @@ gdk_ic_get_values (GdkIC ic, ...)
private = (GdkICPrivate *) ic;
va_start (list, ic);
- args = (XVaNestedList) & (va_arg (list, void *));
+ argsptr = va_arg (list, void *);
+ args = (XVaNestedList)&argsptr;
va_end (list);
XGetICValues (private->xic, XNVaNestedList, args, NULL);
@@ -3536,6 +3542,7 @@ void
gdk_ic_set_attr (GdkIC ic, const char *target, ...)
{
va_list list;
+ void *argsptr;
XVaNestedList attr;
GdkICPrivate *private;
@@ -3545,7 +3552,8 @@ gdk_ic_set_attr (GdkIC ic, const char *target, ...)
private = (GdkICPrivate *) ic;
va_start (list, target);
- attr = (XVaNestedList) & (va_arg (list, void *));
+ argsptr = va_arg (list, void *);
+ attr = (XVaNestedList)&argsptr;
va_end (list);
XSetICValues (private->xic, target, attr, NULL);
@@ -3555,6 +3563,7 @@ void
gdk_ic_get_attr (GdkIC ic, const char *target, ...)
{
va_list list;
+ void *argsptr;
XVaNestedList attr;
GdkICPrivate *private;
@@ -3564,7 +3573,8 @@ gdk_ic_get_attr (GdkIC ic, const char *target, ...)
private = (GdkICPrivate *) ic;
va_start (list, target);
- attr = (XVaNestedList) & (va_arg (list, void *));
+ argsptr = va_arg (list, void *);
+ attr = (XVaNestedList)&argsptr;
va_end (list);
XGetICValues (private->xic, target, attr, NULL);
diff --git a/gdk/gdkcc.c b/gdk/gdkcc.c
index 28ecad7feb..d55756874a 100644
--- a/gdk/gdkcc.c
+++ b/gdk/gdkcc.c
@@ -851,8 +851,9 @@ gdk_color_context_get_pixels (GdkColorContext *cc,
gint bad_alloc = FALSE;
gint failed[MAX_IMAGE_COLORS], allocated[MAX_IMAGE_COLORS];
GdkColor defs[MAX_IMAGE_COLORS], cmap[MAX_IMAGE_COLORS];
+#ifdef G_ENABLE_DEBUG
gint exact_col = 0, subst_col = 0, close_col = 0, black_col = 0;
-
+#endif
g_assert (cc != NULL);
g_assert (reds != NULL);
g_assert (greens != NULL);
@@ -934,7 +935,7 @@ gdk_color_context_get_pixels (GdkColorContext *cc,
return;
}
-#ifdef DEBUG
+#ifdef G_ENABLE_DEBUG
exact_col = ncols;
#endif
@@ -1012,7 +1013,7 @@ gdk_color_context_get_pixels (GdkColorContext *cc,
defs[i] = cmap[close];
defs[i].pixel = colors[i];
allocated[ncols++] = colors[i];
-#ifdef DEBUG
+#ifdef G_ENABLE_DEBUG
close_col++;
#endif
} else
@@ -1086,14 +1087,14 @@ gdk_color_context_get_pixels (GdkColorContext *cc,
defs[i].pixel = cc->black_pixel;
defs[i].red = defs[i].green = defs[i].blue = 0;
-#ifdef DEBUG
+#ifdef G_ENABLE_DEBUG
black_col++;
#endif
}
else
{
defs[i] = defs[close];
-#ifdef DEBUG
+#ifdef G_ENABLE_DEBUG
subst_col++;
#endif
}
@@ -1123,7 +1124,9 @@ gdk_color_context_get_pixels_incremental (GdkColorContext *cc,
gint bad_alloc = FALSE;
gint failed[MAX_IMAGE_COLORS], allocated[MAX_IMAGE_COLORS];
GdkColor defs[MAX_IMAGE_COLORS], cmap[MAX_IMAGE_COLORS];
+#ifdef G_ENABLE_DEBUG
gint exact_col = 0, subst_col = 0, close_col = 0, black_col = 0;
+#endif
g_assert (cc != NULL);
g_assert (reds != NULL);
@@ -1204,7 +1207,7 @@ gdk_color_context_get_pixels_incremental (GdkColorContext *cc,
return;
}
-#ifdef DEBUG
+#ifdef G_ENABLE_DEBUG
exact_col = ncols;
#endif
@@ -1276,7 +1279,7 @@ gdk_color_context_get_pixels_incremental (GdkColorContext *cc,
defs[i] = cmap[close];
defs[i].pixel = colors[i];
allocated[ncols++] = colors[i];
-#ifdef DEBUG
+#ifdef G_ENABLE_DEBUG
close_col++;
#endif
}
@@ -1348,14 +1351,14 @@ gdk_color_context_get_pixels_incremental (GdkColorContext *cc,
defs[i].pixel = cc->black_pixel;
defs[i].red = defs[i].green = defs[i].blue = 0;
-#ifdef DEBUG
+#ifdef G_ENABLE_DEBUG
black_col++;
#endif
}
else
{
defs[i] = defs[close];
-#ifdef DEBUG
+#ifdef G_ENABLE_DEBUG
subst_col++;
#endif
}
diff --git a/gdk/gdkvisual.c b/gdk/gdkvisual.c
index 4a86e37739..65b347dd98 100644
--- a/gdk/gdkvisual.c
+++ b/gdk/gdkvisual.c
@@ -40,6 +40,8 @@ static gint navailable_depths;
static GdkVisualType available_types[6];
static gint navailable_types;
+#ifdef G_ENABLE_DEBUG
+
static gchar* visual_names[] =
{
"static gray",
@@ -50,6 +52,8 @@ static gchar* visual_names[] =
"direct color",
};
+#endif /* G_ENABLE_DEBUG */
+
static GHashTable *visual_hash = NULL;
void
diff --git a/gdk/x11/gdkcc-x11.c b/gdk/x11/gdkcc-x11.c
index 28ecad7feb..d55756874a 100644
--- a/gdk/x11/gdkcc-x11.c
+++ b/gdk/x11/gdkcc-x11.c
@@ -851,8 +851,9 @@ gdk_color_context_get_pixels (GdkColorContext *cc,
gint bad_alloc = FALSE;
gint failed[MAX_IMAGE_COLORS], allocated[MAX_IMAGE_COLORS];
GdkColor defs[MAX_IMAGE_COLORS], cmap[MAX_IMAGE_COLORS];
+#ifdef G_ENABLE_DEBUG
gint exact_col = 0, subst_col = 0, close_col = 0, black_col = 0;
-
+#endif
g_assert (cc != NULL);
g_assert (reds != NULL);
g_assert (greens != NULL);
@@ -934,7 +935,7 @@ gdk_color_context_get_pixels (GdkColorContext *cc,
return;
}
-#ifdef DEBUG
+#ifdef G_ENABLE_DEBUG
exact_col = ncols;
#endif
@@ -1012,7 +1013,7 @@ gdk_color_context_get_pixels (GdkColorContext *cc,
defs[i] = cmap[close];
defs[i].pixel = colors[i];
allocated[ncols++] = colors[i];
-#ifdef DEBUG
+#ifdef G_ENABLE_DEBUG
close_col++;
#endif
} else
@@ -1086,14 +1087,14 @@ gdk_color_context_get_pixels (GdkColorContext *cc,
defs[i].pixel = cc->black_pixel;
defs[i].red = defs[i].green = defs[i].blue = 0;
-#ifdef DEBUG
+#ifdef G_ENABLE_DEBUG
black_col++;
#endif
}
else
{
defs[i] = defs[close];
-#ifdef DEBUG
+#ifdef G_ENABLE_DEBUG
subst_col++;
#endif
}
@@ -1123,7 +1124,9 @@ gdk_color_context_get_pixels_incremental (GdkColorContext *cc,
gint bad_alloc = FALSE;
gint failed[MAX_IMAGE_COLORS], allocated[MAX_IMAGE_COLORS];
GdkColor defs[MAX_IMAGE_COLORS], cmap[MAX_IMAGE_COLORS];
+#ifdef G_ENABLE_DEBUG
gint exact_col = 0, subst_col = 0, close_col = 0, black_col = 0;
+#endif
g_assert (cc != NULL);
g_assert (reds != NULL);
@@ -1204,7 +1207,7 @@ gdk_color_context_get_pixels_incremental (GdkColorContext *cc,
return;
}
-#ifdef DEBUG
+#ifdef G_ENABLE_DEBUG
exact_col = ncols;
#endif
@@ -1276,7 +1279,7 @@ gdk_color_context_get_pixels_incremental (GdkColorContext *cc,
defs[i] = cmap[close];
defs[i].pixel = colors[i];
allocated[ncols++] = colors[i];
-#ifdef DEBUG
+#ifdef G_ENABLE_DEBUG
close_col++;
#endif
}
@@ -1348,14 +1351,14 @@ gdk_color_context_get_pixels_incremental (GdkColorContext *cc,
defs[i].pixel = cc->black_pixel;
defs[i].red = defs[i].green = defs[i].blue = 0;
-#ifdef DEBUG
+#ifdef G_ENABLE_DEBUG
black_col++;
#endif
}
else
{
defs[i] = defs[close];
-#ifdef DEBUG
+#ifdef G_ENABLE_DEBUG
subst_col++;
#endif
}
diff --git a/gdk/x11/gdkmain-x11.c b/gdk/x11/gdkmain-x11.c
index 9dcb75bde8..445b7ce069 100644
--- a/gdk/x11/gdkmain-x11.c
+++ b/gdk/x11/gdkmain-x11.c
@@ -3430,6 +3430,7 @@ gdk_ic_new (GdkWindow* client_window,
GdkIMStyle style, ...)
{
va_list list;
+ void *argsptr;
GdkICPrivate *private;
XVaNestedList preedit_attr;
@@ -3440,7 +3441,8 @@ gdk_ic_new (GdkWindow* client_window,
private = g_new (GdkICPrivate, 1);
va_start (list, style);
- preedit_attr = (XVaNestedList) & (va_arg (list, void *));
+ argsptr = va_arg (list, void *);
+ preedit_attr = (XVaNestedList)&argsptr;
va_end (list);
private->style = gdk_im_decide_style (style);
@@ -3500,6 +3502,7 @@ void
gdk_ic_set_values (GdkIC ic, ...)
{
va_list list;
+ void *argsptr;
XVaNestedList args;
GdkICPrivate *private;
@@ -3508,7 +3511,8 @@ gdk_ic_set_values (GdkIC ic, ...)
private = (GdkICPrivate *) ic;
va_start (list, ic);
- args = (XVaNestedList) & (va_arg (list, void *));
+ argsptr = va_arg (list, void *);
+ args = (XVaNestedList)&argsptr;
va_end (list);
XSetICValues (private->xic, XNVaNestedList, args, NULL);
@@ -3518,6 +3522,7 @@ void
gdk_ic_get_values (GdkIC ic, ...)
{
va_list list;
+ void *argsptr;
XVaNestedList args;
GdkICPrivate *private;
@@ -3526,7 +3531,8 @@ gdk_ic_get_values (GdkIC ic, ...)
private = (GdkICPrivate *) ic;
va_start (list, ic);
- args = (XVaNestedList) & (va_arg (list, void *));
+ argsptr = va_arg (list, void *);
+ args = (XVaNestedList)&argsptr;
va_end (list);
XGetICValues (private->xic, XNVaNestedList, args, NULL);
@@ -3536,6 +3542,7 @@ void
gdk_ic_set_attr (GdkIC ic, const char *target, ...)
{
va_list list;
+ void *argsptr;
XVaNestedList attr;
GdkICPrivate *private;
@@ -3545,7 +3552,8 @@ gdk_ic_set_attr (GdkIC ic, const char *target, ...)
private = (GdkICPrivate *) ic;
va_start (list, target);
- attr = (XVaNestedList) & (va_arg (list, void *));
+ argsptr = va_arg (list, void *);
+ attr = (XVaNestedList)&argsptr;
va_end (list);
XSetICValues (private->xic, target, attr, NULL);
@@ -3555,6 +3563,7 @@ void
gdk_ic_get_attr (GdkIC ic, const char *target, ...)
{
va_list list;
+ void *argsptr;
XVaNestedList attr;
GdkICPrivate *private;
@@ -3564,7 +3573,8 @@ gdk_ic_get_attr (GdkIC ic, const char *target, ...)
private = (GdkICPrivate *) ic;
va_start (list, target);
- attr = (XVaNestedList) & (va_arg (list, void *));
+ argsptr = va_arg (list, void *);
+ attr = (XVaNestedList)&argsptr;
va_end (list);
XGetICValues (private->xic, target, attr, NULL);
diff --git a/gdk/x11/gdkvisual-x11.c b/gdk/x11/gdkvisual-x11.c
index 4a86e37739..65b347dd98 100644
--- a/gdk/x11/gdkvisual-x11.c
+++ b/gdk/x11/gdkvisual-x11.c
@@ -40,6 +40,8 @@ static gint navailable_depths;
static GdkVisualType available_types[6];
static gint navailable_types;
+#ifdef G_ENABLE_DEBUG
+
static gchar* visual_names[] =
{
"static gray",
@@ -50,6 +52,8 @@ static gchar* visual_names[] =
"direct color",
};
+#endif /* G_ENABLE_DEBUG */
+
static GHashTable *visual_hash = NULL;
void
diff --git a/gtk/gtkcombo.c b/gtk/gtkcombo.c
index de6fb76aae..d48684a66a 100644
--- a/gtk/gtkcombo.c
+++ b/gtk/gtkcombo.c
@@ -71,7 +71,7 @@ static void gtk_combo_size_allocate (GtkWidget *widget,
static GtkHBoxClass *parent_class = NULL;
-void
+static void
gtk_combo_class_init (GtkComboClass * klass)
{
GtkObjectClass *oclass;
@@ -437,7 +437,7 @@ gtk_combo_list_key_press (GtkWidget * widget, GdkEventKey * event, GtkCombo * co
return FALSE;
}
-void
+static void
gtk_combo_init (GtkCombo * combo)
{
GtkWidget *arrow;
diff --git a/gtk/gtkcontainer.c b/gtk/gtkcontainer.c
index 87f78886d0..af6f96cac3 100644
--- a/gtk/gtkcontainer.c
+++ b/gtk/gtkcontainer.c
@@ -42,7 +42,7 @@ typedef void (*GtkContainerSignal1) (GtkObject *object,
gpointer arg1,
gpointer data);
typedef void (*GtkContainerSignal2) (GtkObject *object,
- gpointer arg1,
+ GtkFunction arg1,
gpointer arg2,
gpointer data);
typedef gint (*GtkContainerSignal3) (GtkObject *object,
diff --git a/gtk/gtkdebug.h b/gtk/gtkdebug.h
index 3940f8f1f0..a4b8cb6d34 100644
--- a/gtk/gtkdebug.h
+++ b/gtk/gtkdebug.h
@@ -23,7 +23,8 @@ extern "C" {
#endif /* __cplusplus */
typedef enum {
- GTK_DEBUG_OBJECTS = 1<<0
+ GTK_DEBUG_OBJECTS = 1<<0,
+ GTK_DEBUG_MISC = 1<<1
} GtkDebugFlag;
#ifdef G_ENABLE_DEBUG
diff --git a/gtk/gtkeditable.c b/gtk/gtkeditable.c
index 8702e69fbc..15b506876d 100644
--- a/gtk/gtkeditable.c
+++ b/gtk/gtkeditable.c
@@ -360,7 +360,7 @@ gtk_editable_selection_handler (GtkWidget *widget,
{
gtk_selection_data_set (selection_data,
GDK_SELECTION_TYPE_STRING,
- 8*sizeof(gchar), str, length);
+ 8*sizeof(gchar), (guchar *)str, length);
}
else if (selection_data->target == text_atom ||
selection_data->target == ctext_atom)
@@ -441,7 +441,8 @@ gtk_editable_selection_received (GtkWidget *widget,
case STRING:
selection_data->data[selection_data->length] = 0;
gtk_editable_insert_text (editable, selection_data->data,
- strlen (selection_data->data), &tmp_pos);
+ strlen ((gchar *)selection_data->data),
+ &tmp_pos);
editable->current_pos = tmp_pos;
break;
case CTEXT:
diff --git a/gtk/gtkentry.c b/gtk/gtkentry.c
index d54f618eda..19dffce030 100644
--- a/gtk/gtkentry.c
+++ b/gtk/gtkentry.c
@@ -26,6 +26,7 @@
#include "gtkmain.h"
#include "gtkselection.h"
#include "gtksignal.h"
+#include "gtkprivate.h"
#define MIN_ENTRY_WIDTH 150
#define DRAW_TIMEOUT 20
@@ -861,7 +862,6 @@ gtk_entry_key_press (GtkWidget *widget,
gint return_val;
gint key;
guint initial_pos;
- guint tmp_pos;
gint extend_selection;
gint extend_start;
@@ -995,6 +995,8 @@ gtk_entry_key_press (GtkWidget *widget,
}
if (event->length > 0)
{
+ gint tmp_pos;
+
extend_selection = FALSE;
gtk_editable_delete_selection (editable);
@@ -1508,7 +1510,7 @@ gtk_entry_update_text (GtkEditable *editable,
gtk_entry_queue_draw (GTK_ENTRY(editable));
}
-gchar *
+static gchar *
gtk_entry_get_chars (GtkEditable *editable,
gint start_pos,
gint end_pos)
@@ -1551,13 +1553,21 @@ gtk_move_forward_character (GtkEntry *entry)
GtkEditable *editable;
editable = GTK_EDITABLE (entry);
- if (editable->current_pos < entry->text_length)
+ if (gtk_use_mb)
+ {
+ if (editable->current_pos < entry->text_length)
+ {
+ len = mblen (entry->text+editable->current_pos, MB_CUR_MAX);
+ editable->current_pos += (len>0)? len:1;
+ }
+ if (editable->current_pos > entry->text_length)
+ editable->current_pos = entry->text_length;
+ }
+ else
{
- len = mblen (entry->text+editable->current_pos, MB_CUR_MAX);
- editable->current_pos += (len>0)? len:1;
+ if (editable->current_pos < entry->text_length)
+ editable->current_pos ++;
}
- if (editable->current_pos > entry->text_length)
- editable->current_pos = entry->text_length;
}
static gint
@@ -1583,11 +1593,14 @@ gtk_move_backward_character (GtkEntry *entry)
GtkEditable *editable;
editable = GTK_EDITABLE (entry);
- /* this routine is correct only if string is state-independent-encoded */
-
if (0 < editable->current_pos)
- editable->current_pos = move_backward_character (entry->text,
- editable->current_pos);
+ {
+ if (gtk_use_mb)
+ editable->current_pos = move_backward_character (entry->text,
+ editable->current_pos);
+ else
+ editable->current_pos--;
+ }
}
static void
@@ -1605,26 +1618,46 @@ gtk_move_forward_word (GtkEntry *entry)
{
text = entry->text;
i = editable->current_pos;
-
- len = mbtowc (&c, text+i, MB_CUR_MAX);
- if (!iswalnum(c))
- for (; i < entry->text_length; i+=len)
- {
- len = mbtowc (&c, text+i, MB_CUR_MAX);
- if (len < 1 || iswalnum(c))
- break;
- }
-
- for (; i < entry->text_length; i+=len)
+
+ if (gtk_use_mb)
{
len = mbtowc (&c, text+i, MB_CUR_MAX);
- if (len < 1 || !iswalnum(c))
- break;
+ if (!iswalnum(c))
+ for (; i < entry->text_length; i+=len)
+ {
+ len = mbtowc (&c, text+i, MB_CUR_MAX);
+ if (len < 1 || iswalnum(c))
+ break;
+ }
+
+ for (; i < entry->text_length; i+=len)
+ {
+ len = mbtowc (&c, text+i, MB_CUR_MAX);
+ if (len < 1 || !iswalnum(c))
+ break;
+ }
+
+ editable->current_pos = i;
+ if (editable->current_pos > entry->text_length)
+ editable->current_pos = entry->text_length;
}
+ else
+ {
+ if (!isalnum (text[i]))
+ for (; i < entry->text_length; i++)
+ {
+ if (isalnum(text[i]))
+ break;
+ }
+
+ for (; i < entry->text_length; i++)
+ {
+ if (!isalnum(text[i]))
+ break;
+ }
- editable->current_pos = i;
- if (editable->current_pos > entry->text_length)
- editable->current_pos = entry->text_length;
+ editable->current_pos = i;
+ }
}
}
@@ -1639,39 +1672,57 @@ gtk_move_backward_word (GtkEntry *entry)
GtkEditable *editable;
editable = GTK_EDITABLE (entry);
- if (entry->text)
+ if (entry->text && editable->current_pos > 0)
{
text = entry->text;
- i=move_backward_character(text, editable->current_pos);
- if (i < 0) /* Per */
- {
- editable->selection_start_pos = 0;
- editable->selection_end_pos = 0;
- return;
- }
-
- len = mbtowc (&c, text+i, MB_CUR_MAX);
- if (!iswalnum(c))
- for (; i >= 0; i=move_backward_character(text, i))
- {
- len = mbtowc (&c, text+i, MB_CUR_MAX);
- if (iswalnum(c))
- break;
- }
- for (; i >= 0; i=move_backward_character(text, i))
+ if (gtk_use_mb)
{
+ i=move_backward_character(text, editable->current_pos);
+
len = mbtowc (&c, text+i, MB_CUR_MAX);
if (!iswalnum(c))
+ for (; i >= 0; i=move_backward_character(text, i))
+ {
+ len = mbtowc (&c, text+i, MB_CUR_MAX);
+ if (iswalnum(c))
+ break;
+ }
+
+ for (; i >= 0; i=move_backward_character(text, i))
{
- i += len;
- break;
+ len = mbtowc (&c, text+i, MB_CUR_MAX);
+ if (!iswalnum(c))
+ {
+ i += len;
+ break;
+ }
}
}
-
+ else
+ {
+ i = editable->current_pos - 1;
+
+ if (!isalnum(text[i]))
+ for (; i >= 0; i--)
+ {
+ if (isalnum(text[i]))
+ break;
+ }
+
+ for (; i >= 0; i--)
+ {
+ if (!isalnum(text[i]))
+ {
+ i++;
+ break;
+ }
+ }
+ }
+
if (i < 0)
- i = 0;
-
+ i = 0;
+
editable->current_pos = i;
}
}
diff --git a/gtk/gtkmain.c b/gtk/gtkmain.c
index 87f2916c75..ce9ff81118 100644
--- a/gtk/gtkmain.c
+++ b/gtk/gtkmain.c
@@ -15,6 +15,7 @@
* License along with this library; if not, write to the Free
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
+#include <X11/Xlocale.h> /* so we get the right setlocale */
#include <stdio.h>
#include <stdlib.h>
#include "gtkbutton.h"
@@ -32,6 +33,7 @@
#include "gtkwidget.h"
#include "gtkwindow.h"
#include "gtkprivate.h"
+#include "gdk/gdki18n.h"
#include "../config.h"
@@ -166,11 +168,14 @@ guint gtk_debug_flags = 0; /* Global GTK debug flag */
#ifdef G_ENABLE_DEBUG
static GDebugKey gtk_debug_keys[] = {
- {"objects", GTK_DEBUG_OBJECTS}
+ {"objects", GTK_DEBUG_OBJECTS},
+ {"misc", GTK_DEBUG_MISC}
};
static const guint gtk_ndebug_keys = sizeof (gtk_debug_keys) / sizeof (GDebugKey);
+gboolean gtk_use_mb = -1;
+
#endif /* G_ENABLE_DEBUG */
@@ -180,6 +185,8 @@ void
gtk_init (int *argc,
char ***argv)
{
+ gchar *current_locale;
+
if (0)
{
g_set_error_handler (gtk_error);
@@ -255,6 +262,28 @@ gtk_init (int *argc,
#endif /* G_ENABLE_DEBUG */
+ /* Check if there is a good chance the mb functions will handle things
+ * correctly - set if either mblen("\xc0", MB_CUR_MAX) == 1 in the
+ * C locale, or were using X's mb functions. (-DX_LOCALE && locale != C)
+ */
+
+ current_locale = setlocale (LC_CTYPE, NULL);
+ setlocale (LC_CTYPE, "C");
+
+#ifdef X_LOCALE
+ if ((strcmp (current_locale, "C")) && (!strcmp (current_locale, "POSIX")))
+ gtk_use_mb = TRUE;
+ else
+#endif
+ {
+ gtk_use_mb = (mblen ("\xc0", MB_CUR_MAX) == 1);
+ }
+
+ setlocale (LC_CTYPE, current_locale);
+
+ GTK_NOTE (MISC, g_print("%s multi-byte string functions.\n",
+ gtk_use_mb ? "Using" : "Not using"));
+
/* Initialize the default visual and colormap to be
* used in creating widgets. (We want to use the system
* defaults so as to be nice to the colormap).
diff --git a/gtk/gtkobject.c b/gtk/gtkobject.c
index 0e853bb1eb..63e84f706b 100644
--- a/gtk/gtkobject.c
+++ b/gtk/gtkobject.c
@@ -348,7 +348,7 @@ gtk_object_class_add_signals (GtkObjectClass *class,
g_return_if_fail (class != NULL);
- new_signals = g_new (gint, class->nsignals + nsignals);
+ new_signals = g_new (guint, class->nsignals + nsignals);
for (i = 0; i < class->nsignals; i++)
new_signals[i] = class->signals[i];
for (i = 0; i < nsignals; i++)
diff --git a/gtk/gtkprivate.h b/gtk/gtkprivate.h
index ec4bd4d0c0..0c710ce2eb 100644
--- a/gtk/gtkprivate.h
+++ b/gtk/gtkprivate.h
@@ -60,7 +60,11 @@ enum
#define GTK_PRIVATE_SET_FLAG(wid,flag) G_STMT_START{ (GTK_PRIVATE_FLAGS (wid) |= (PRIVATE_ ## flag)); }G_STMT_END
#define GTK_PRIVATE_UNSET_FLAG(wid,flag) G_STMT_START{ (GTK_PRIVATE_FLAGS (wid) &= ~(PRIVATE_ ## flag)); }G_STMT_END
-
+/* True if there is a good chance the mb functions will handle things
+ * correctly - set if either mblen("\xc0", MB_CUR_MAX) == 1 in the
+ * C locale, or were using X's mb functions. (-DX_LOCALE && locale != C)
+ */
+extern gboolean gtk_use_mb;
#ifdef __cplusplus
}
diff --git a/gtk/gtktext.c b/gtk/gtktext.c
index 17d4d000dc..f8b4b4f97b 100644
--- a/gtk/gtktext.c
+++ b/gtk/gtktext.c
@@ -4546,7 +4546,7 @@ recompute_geometry (GtkText* text)
/* Selection */
/**********************************************************************/
-void
+static void
gtk_text_set_selection (GtkEditable *editable,
gint start,
gint end)