Updated
Thu Mar 15 15:23:11 2001 Owen Taylor <otaylor@redhat.com> * NEWS: Updated * configure.in (GTK_BINARY_AGE): Up micro => 10, binary => 10, interface => 1. * INSTALL.in: Add some discouraging words about --with-xinput=gxi. * configure.in (x_ldflags): Make --with-xinput be --with-xinput=xfree, and warn for --with-xinput=gxi. Thu Mar 15 14:29:47 2001 Owen Taylor <otaylor@redhat.com> * gdk/gdkselection.c (sanitize_ctext): Handle extended segments, which can contain arbitrary octets, properly. (Fixes problems with cut-and-paste and, e.g., KOI8-R.) * gtk/gtktext.c gtk/gtkeditable.c: Patch from Vlad Harchev to avoid using gdk_draw_text_wc() on text that is really chars, not wchars. (Cannot convert between chars and wide chars with assignment!)
This commit is contained in:
25
ChangeLog
25
ChangeLog
@@ -1,3 +1,28 @@
|
||||
Thu Mar 15 15:23:11 2001 Owen Taylor <otaylor@redhat.com>
|
||||
|
||||
* NEWS: Updated
|
||||
|
||||
* configure.in (GTK_BINARY_AGE): Up micro => 10,
|
||||
binary => 10, interface => 1.
|
||||
|
||||
* INSTALL.in: Add some discouraging words about
|
||||
--with-xinput=gxi.
|
||||
|
||||
* configure.in (x_ldflags): Make --with-xinput be
|
||||
--with-xinput=xfree, and warn for --with-xinput=gxi.
|
||||
|
||||
Thu Mar 15 14:29:47 2001 Owen Taylor <otaylor@redhat.com>
|
||||
|
||||
* gdk/gdkselection.c (sanitize_ctext): Handle
|
||||
extended segments, which can contain arbitrary octets,
|
||||
properly. (Fixes problems with cut-and-paste and,
|
||||
e.g., KOI8-R.)
|
||||
|
||||
* gtk/gtktext.c gtk/gtkeditable.c: Patch from
|
||||
Vlad Harchev to avoid using gdk_draw_text_wc()
|
||||
on text that is really chars, not wchars. (Cannot
|
||||
convert between chars and wide chars with assignment!)
|
||||
|
||||
Thu Mar 15 01:31:07 2001 Owen Taylor <otaylor@redhat.com>
|
||||
|
||||
* gdk/gdkim.c (_gdk_wcstombs_len): Make somewhat more
|
||||
|
||||
@@ -1,3 +1,28 @@
|
||||
Thu Mar 15 15:23:11 2001 Owen Taylor <otaylor@redhat.com>
|
||||
|
||||
* NEWS: Updated
|
||||
|
||||
* configure.in (GTK_BINARY_AGE): Up micro => 10,
|
||||
binary => 10, interface => 1.
|
||||
|
||||
* INSTALL.in: Add some discouraging words about
|
||||
--with-xinput=gxi.
|
||||
|
||||
* configure.in (x_ldflags): Make --with-xinput be
|
||||
--with-xinput=xfree, and warn for --with-xinput=gxi.
|
||||
|
||||
Thu Mar 15 14:29:47 2001 Owen Taylor <otaylor@redhat.com>
|
||||
|
||||
* gdk/gdkselection.c (sanitize_ctext): Handle
|
||||
extended segments, which can contain arbitrary octets,
|
||||
properly. (Fixes problems with cut-and-paste and,
|
||||
e.g., KOI8-R.)
|
||||
|
||||
* gtk/gtktext.c gtk/gtkeditable.c: Patch from
|
||||
Vlad Harchev to avoid using gdk_draw_text_wc()
|
||||
on text that is really chars, not wchars. (Cannot
|
||||
convert between chars and wide chars with assignment!)
|
||||
|
||||
Thu Mar 15 01:31:07 2001 Owen Taylor <otaylor@redhat.com>
|
||||
|
||||
* gdk/gdkim.c (_gdk_wcstombs_len): Make somewhat more
|
||||
|
||||
@@ -1,3 +1,28 @@
|
||||
Thu Mar 15 15:23:11 2001 Owen Taylor <otaylor@redhat.com>
|
||||
|
||||
* NEWS: Updated
|
||||
|
||||
* configure.in (GTK_BINARY_AGE): Up micro => 10,
|
||||
binary => 10, interface => 1.
|
||||
|
||||
* INSTALL.in: Add some discouraging words about
|
||||
--with-xinput=gxi.
|
||||
|
||||
* configure.in (x_ldflags): Make --with-xinput be
|
||||
--with-xinput=xfree, and warn for --with-xinput=gxi.
|
||||
|
||||
Thu Mar 15 14:29:47 2001 Owen Taylor <otaylor@redhat.com>
|
||||
|
||||
* gdk/gdkselection.c (sanitize_ctext): Handle
|
||||
extended segments, which can contain arbitrary octets,
|
||||
properly. (Fixes problems with cut-and-paste and,
|
||||
e.g., KOI8-R.)
|
||||
|
||||
* gtk/gtktext.c gtk/gtkeditable.c: Patch from
|
||||
Vlad Harchev to avoid using gdk_draw_text_wc()
|
||||
on text that is really chars, not wchars. (Cannot
|
||||
convert between chars and wide chars with assignment!)
|
||||
|
||||
Thu Mar 15 01:31:07 2001 Owen Taylor <otaylor@redhat.com>
|
||||
|
||||
* gdk/gdkim.c (_gdk_wcstombs_len): Make somewhat more
|
||||
|
||||
@@ -1,3 +1,28 @@
|
||||
Thu Mar 15 15:23:11 2001 Owen Taylor <otaylor@redhat.com>
|
||||
|
||||
* NEWS: Updated
|
||||
|
||||
* configure.in (GTK_BINARY_AGE): Up micro => 10,
|
||||
binary => 10, interface => 1.
|
||||
|
||||
* INSTALL.in: Add some discouraging words about
|
||||
--with-xinput=gxi.
|
||||
|
||||
* configure.in (x_ldflags): Make --with-xinput be
|
||||
--with-xinput=xfree, and warn for --with-xinput=gxi.
|
||||
|
||||
Thu Mar 15 14:29:47 2001 Owen Taylor <otaylor@redhat.com>
|
||||
|
||||
* gdk/gdkselection.c (sanitize_ctext): Handle
|
||||
extended segments, which can contain arbitrary octets,
|
||||
properly. (Fixes problems with cut-and-paste and,
|
||||
e.g., KOI8-R.)
|
||||
|
||||
* gtk/gtktext.c gtk/gtkeditable.c: Patch from
|
||||
Vlad Harchev to avoid using gdk_draw_text_wc()
|
||||
on text that is really chars, not wchars. (Cannot
|
||||
convert between chars and wide chars with assignment!)
|
||||
|
||||
Thu Mar 15 01:31:07 2001 Owen Taylor <otaylor@redhat.com>
|
||||
|
||||
* gdk/gdkim.c (_gdk_wcstombs_len): Make somewhat more
|
||||
|
||||
@@ -1,3 +1,28 @@
|
||||
Thu Mar 15 15:23:11 2001 Owen Taylor <otaylor@redhat.com>
|
||||
|
||||
* NEWS: Updated
|
||||
|
||||
* configure.in (GTK_BINARY_AGE): Up micro => 10,
|
||||
binary => 10, interface => 1.
|
||||
|
||||
* INSTALL.in: Add some discouraging words about
|
||||
--with-xinput=gxi.
|
||||
|
||||
* configure.in (x_ldflags): Make --with-xinput be
|
||||
--with-xinput=xfree, and warn for --with-xinput=gxi.
|
||||
|
||||
Thu Mar 15 14:29:47 2001 Owen Taylor <otaylor@redhat.com>
|
||||
|
||||
* gdk/gdkselection.c (sanitize_ctext): Handle
|
||||
extended segments, which can contain arbitrary octets,
|
||||
properly. (Fixes problems with cut-and-paste and,
|
||||
e.g., KOI8-R.)
|
||||
|
||||
* gtk/gtktext.c gtk/gtkeditable.c: Patch from
|
||||
Vlad Harchev to avoid using gdk_draw_text_wc()
|
||||
on text that is really chars, not wchars. (Cannot
|
||||
convert between chars and wide chars with assignment!)
|
||||
|
||||
Thu Mar 15 01:31:07 2001 Owen Taylor <otaylor@redhat.com>
|
||||
|
||||
* gdk/gdkim.c (_gdk_wcstombs_len): Make somewhat more
|
||||
|
||||
@@ -1,3 +1,28 @@
|
||||
Thu Mar 15 15:23:11 2001 Owen Taylor <otaylor@redhat.com>
|
||||
|
||||
* NEWS: Updated
|
||||
|
||||
* configure.in (GTK_BINARY_AGE): Up micro => 10,
|
||||
binary => 10, interface => 1.
|
||||
|
||||
* INSTALL.in: Add some discouraging words about
|
||||
--with-xinput=gxi.
|
||||
|
||||
* configure.in (x_ldflags): Make --with-xinput be
|
||||
--with-xinput=xfree, and warn for --with-xinput=gxi.
|
||||
|
||||
Thu Mar 15 14:29:47 2001 Owen Taylor <otaylor@redhat.com>
|
||||
|
||||
* gdk/gdkselection.c (sanitize_ctext): Handle
|
||||
extended segments, which can contain arbitrary octets,
|
||||
properly. (Fixes problems with cut-and-paste and,
|
||||
e.g., KOI8-R.)
|
||||
|
||||
* gtk/gtktext.c gtk/gtkeditable.c: Patch from
|
||||
Vlad Harchev to avoid using gdk_draw_text_wc()
|
||||
on text that is really chars, not wchars. (Cannot
|
||||
convert between chars and wide chars with assignment!)
|
||||
|
||||
Thu Mar 15 01:31:07 2001 Owen Taylor <otaylor@redhat.com>
|
||||
|
||||
* gdk/gdkim.c (_gdk_wcstombs_len): Make somewhat more
|
||||
|
||||
@@ -1,3 +1,28 @@
|
||||
Thu Mar 15 15:23:11 2001 Owen Taylor <otaylor@redhat.com>
|
||||
|
||||
* NEWS: Updated
|
||||
|
||||
* configure.in (GTK_BINARY_AGE): Up micro => 10,
|
||||
binary => 10, interface => 1.
|
||||
|
||||
* INSTALL.in: Add some discouraging words about
|
||||
--with-xinput=gxi.
|
||||
|
||||
* configure.in (x_ldflags): Make --with-xinput be
|
||||
--with-xinput=xfree, and warn for --with-xinput=gxi.
|
||||
|
||||
Thu Mar 15 14:29:47 2001 Owen Taylor <otaylor@redhat.com>
|
||||
|
||||
* gdk/gdkselection.c (sanitize_ctext): Handle
|
||||
extended segments, which can contain arbitrary octets,
|
||||
properly. (Fixes problems with cut-and-paste and,
|
||||
e.g., KOI8-R.)
|
||||
|
||||
* gtk/gtktext.c gtk/gtkeditable.c: Patch from
|
||||
Vlad Harchev to avoid using gdk_draw_text_wc()
|
||||
on text that is really chars, not wchars. (Cannot
|
||||
convert between chars and wide chars with assignment!)
|
||||
|
||||
Thu Mar 15 01:31:07 2001 Owen Taylor <otaylor@redhat.com>
|
||||
|
||||
* gdk/gdkim.c (_gdk_wcstombs_len): Make somewhat more
|
||||
|
||||
14
INSTALL
14
INSTALL
@@ -7,8 +7,8 @@ you got this package.
|
||||
Simple install procedure
|
||||
========================
|
||||
|
||||
% gzip -cd gtk+-1.2.9.tar.gz | tar xvf - # unpack the sources
|
||||
% cd gtk+-1.2.9 # change to the toplevel directory
|
||||
% gzip -cd gtk+-1.2.10.tar.gz | tar xvf - # unpack the sources
|
||||
% cd gtk+-1.2.10 # change to the toplevel directory
|
||||
% ./configure # run the `configure' script
|
||||
% make # build GTK
|
||||
|
||||
@@ -52,11 +52,15 @@ for the XInput extension (mainly used for graphics tablets), and
|
||||
which form of support to use:
|
||||
|
||||
no : no support
|
||||
gxi : Use generic XInput support
|
||||
xfree : Use special features in the Wacom drivers in XFree86 3.3.1
|
||||
and later.
|
||||
gxi : Use generic XInput support (not recommended)
|
||||
|
||||
For more information, follow the link from http://www.gtk.org
|
||||
The XInput support is not known to work with any other XServer than
|
||||
XFree86. For more information about XInput, see:
|
||||
|
||||
http://www.gtk.org/~otaylor/xinput/howto/index.html
|
||||
http://www.lepied.com/xfree86/
|
||||
|
||||
* --disable-nls do not use Native Language Support
|
||||
|
||||
@@ -145,7 +149,7 @@ You can compile GTK+ against a copy of GLIB that you have not
|
||||
yet installed. To do this, give the --with-glib=DIR options
|
||||
to ./configure. For instance:
|
||||
|
||||
./configure --with-glib=../glib-1.2.9
|
||||
./configure --with-glib=../glib-1.2.10
|
||||
|
||||
This, however, will not work if you built GLIB with different
|
||||
source and build directories.
|
||||
|
||||
@@ -52,11 +52,15 @@ for the XInput extension (mainly used for graphics tablets), and
|
||||
which form of support to use:
|
||||
|
||||
no : no support
|
||||
gxi : Use generic XInput support
|
||||
xfree : Use special features in the Wacom drivers in XFree86 3.3.1
|
||||
and later.
|
||||
gxi : Use generic XInput support (not recommended)
|
||||
|
||||
For more information, follow the link from http://www.gtk.org
|
||||
The XInput support is not known to work with any other XServer than
|
||||
XFree86. For more information about XInput, see:
|
||||
|
||||
http://www.gtk.org/~otaylor/xinput/howto/index.html
|
||||
http://www.lepied.com/xfree86/
|
||||
|
||||
* --disable-nls do not use Native Language Support
|
||||
|
||||
|
||||
10
NEWS
10
NEWS
@@ -1,3 +1,13 @@
|
||||
Overview of Changes in GTK+ 1.2.10:
|
||||
|
||||
* Fix focus drawing with no window manager
|
||||
* Fix cut-and-paste with no current event
|
||||
* Fix compilation using --with-xinput=gxi
|
||||
* Fix problem with cut-and-paste and KOI8-R
|
||||
* Fix rare problem with enter events and menus
|
||||
* Fix problem with --with-native-locale and GNU libc-2.1
|
||||
* Further fixes for using fonts, not fontsets, with non iso-8859-1.
|
||||
|
||||
Overview of Changes in GTK+ 1.2.9:
|
||||
|
||||
* Move include files into a gtk-1-2/ subdir to support parallel
|
||||
|
||||
2
README
2
README
@@ -1,7 +1,7 @@
|
||||
General Information
|
||||
===================
|
||||
|
||||
This is GTK+ version 1.2.9. GTK+, which stands for the Gimp ToolKit,
|
||||
This is GTK+ version 1.2.10. GTK+, which stands for the Gimp ToolKit,
|
||||
is a library for creating graphical user interfaces for the X Window
|
||||
System. It is designed to be small, efficient, and flexible. GTK+ is
|
||||
written in C with a very object-oriented approach.
|
||||
|
||||
13
configure.in
13
configure.in
@@ -29,9 +29,9 @@ AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)dnl
|
||||
#
|
||||
GTK_MAJOR_VERSION=1
|
||||
GTK_MINOR_VERSION=2
|
||||
GTK_MICRO_VERSION=9
|
||||
GTK_INTERFACE_AGE=0
|
||||
GTK_BINARY_AGE=9
|
||||
GTK_MICRO_VERSION=10
|
||||
GTK_INTERFACE_AGE=1
|
||||
GTK_BINARY_AGE=10
|
||||
GTK_VERSION=$GTK_MAJOR_VERSION.$GTK_MINOR_VERSION.$GTK_MICRO_VERSION
|
||||
dnl
|
||||
AC_DIVERT_POP()dnl
|
||||
@@ -379,11 +379,14 @@ x_ldflags="$X_LDFLAGS $X_LIBS"
|
||||
|
||||
# set up things for XInput
|
||||
|
||||
if test "x$with_xinput" = "xgxi" || test "x$with_xinput" = "xyes"; then
|
||||
if test "x$with_xinput" = "xgxi"; then
|
||||
AC_MSG_WARN([
|
||||
*** The generic XInput support has not been tested for several years
|
||||
*** and is not known to work with any currently available X servers])
|
||||
AC_DEFINE(XINPUT_GXI)
|
||||
xinput_progs=gxid
|
||||
x_libs="-lXi $x_libs"
|
||||
elif test "x$with_xinput" = "xxfree"; then
|
||||
elif test "x$with_xinput" = "xxfree" || test "x$with_xinput" = "xyes"; then
|
||||
AC_DEFINE(XINPUT_XFREE)
|
||||
x_libs="-lXi $x_libs"
|
||||
else
|
||||
|
||||
@@ -1511,7 +1511,7 @@ _gdk_wcstombs_len (const GdkWChar *src,
|
||||
for (i=0; (src_len < 0 || i < src_len) && src[i]; i++)
|
||||
{
|
||||
int charlen = wctomb (p, src[i]);
|
||||
g_return_if_fail (charlen < 0, NULL);
|
||||
g_return_val_if_fail (charlen >= 0, NULL);
|
||||
|
||||
len += charlen;
|
||||
}
|
||||
|
||||
@@ -208,17 +208,41 @@ sanitize_ctext (const char *str,
|
||||
gchar *result = g_malloc (*length + 1);
|
||||
gint out_length = 0;
|
||||
gint i;
|
||||
const guchar *ustr = (const guchar *)str;
|
||||
|
||||
for (i=0; i < *length; i++)
|
||||
{
|
||||
guchar c = ((guchar *)str)[i];
|
||||
guchar c = ustr[i];
|
||||
|
||||
if (c == '\r')
|
||||
{
|
||||
result[out_length++] = '\n';
|
||||
if (i + 1 < *length && str[i + 1] == '\n')
|
||||
if (i + 1 < *length && ustr[i + 1] == '\n')
|
||||
i++;
|
||||
}
|
||||
else if (c == 27 /* ESC */)
|
||||
{
|
||||
/* Check for "extended segments, which can contain arbitrary
|
||||
* octets. See CTEXT spec, section 6.
|
||||
*/
|
||||
|
||||
if (i + 5 < *length &&
|
||||
ustr[i + 1] == '%' &&
|
||||
ustr[i + 2] == '/' &&
|
||||
(ustr[i + 3] >= 48 && ustr[i + 3] <= 52) &&
|
||||
ustr[i + 4] >= 128 &&
|
||||
ustr[i + 5] >= 128)
|
||||
{
|
||||
int extra_len = 6 + (ustr[i + 4] - 128) * 128 + ustr[i + 5] - 128;
|
||||
extra_len = MAX (extra_len, *length - i);
|
||||
|
||||
memcpy (result + out_length, ustr + i, extra_len);
|
||||
out_length += extra_len;
|
||||
i += extra_len - 1;
|
||||
}
|
||||
else
|
||||
result[out_length++] = c;
|
||||
}
|
||||
else if (c == '\n' || c == '\t' || c == 27 /* ESC */ ||
|
||||
(c >= 32 && c <= 127) || /* GL */
|
||||
c == 155 /* CONTROL SEQUENCE INTRODUCER */ ||
|
||||
|
||||
127
gtk/gtkentry.c
127
gtk/gtkentry.c
@@ -374,6 +374,48 @@ gtk_entry_new (void)
|
||||
return GTK_WIDGET (gtk_type_new (GTK_TYPE_ENTRY));
|
||||
}
|
||||
|
||||
static GdkWChar
|
||||
gtk_entry_get_invisible_char (GtkEntry *entry)
|
||||
{
|
||||
GdkWChar ch;
|
||||
|
||||
if (entry->use_wchar)
|
||||
gdk_mbstowcs (&ch, "*", 1);
|
||||
else
|
||||
ch = '*';
|
||||
|
||||
return ch;
|
||||
}
|
||||
|
||||
/*
|
||||
* Draws the string, noting that if entry->use_wchar is false, then
|
||||
* the text is not really wide characters, but narrow characters
|
||||
* stored as wide characters.
|
||||
*/
|
||||
static void
|
||||
gtk_entry_draw_wchars (GtkEntry *entry,
|
||||
GdkDrawable *drawable,
|
||||
GdkFont *font,
|
||||
GdkGC *gc,
|
||||
gint x,
|
||||
gint y,
|
||||
const GdkWChar *text,
|
||||
gint text_length)
|
||||
{
|
||||
if (entry->use_wchar)
|
||||
gdk_draw_text_wc (drawable, font, gc, x, y, text, text_length);
|
||||
else
|
||||
{
|
||||
gint i;
|
||||
gchar *mbstr = g_new (gchar, text_length);
|
||||
|
||||
for (i = 0; i < text_length; i++)
|
||||
mbstr[i] = text[i];
|
||||
gdk_draw_text (drawable, font, gc, x, y, mbstr, text_length);
|
||||
g_free(mbstr);
|
||||
}
|
||||
}
|
||||
|
||||
GtkWidget*
|
||||
gtk_entry_new_with_max_length (guint16 max)
|
||||
{
|
||||
@@ -1398,19 +1440,20 @@ gtk_entry_draw_text (GtkEntry *entry)
|
||||
else
|
||||
{
|
||||
gint i;
|
||||
GdkWChar invisible_char = gtk_entry_get_invisible_char (entry);
|
||||
|
||||
stars = g_new (GdkWChar, end_pos - start_pos);
|
||||
for (i = 0; i < end_pos - start_pos; i++)
|
||||
stars[i] = '*';
|
||||
stars[i] = invisible_char;
|
||||
toprint = stars;
|
||||
}
|
||||
|
||||
if (selection_start_pos > start_pos)
|
||||
gdk_draw_text_wc (drawable, widget->style->font,
|
||||
widget->style->fg_gc[GTK_WIDGET_STATE (widget)],
|
||||
INNER_BORDER + start_xoffset, y,
|
||||
toprint,
|
||||
selection_start_pos - start_pos);
|
||||
gtk_entry_draw_wchars (entry, drawable, widget->style->font,
|
||||
widget->style->fg_gc[GTK_WIDGET_STATE (widget)],
|
||||
INNER_BORDER + start_xoffset, y,
|
||||
toprint,
|
||||
selection_start_pos - start_pos);
|
||||
|
||||
if ((selection_end_pos >= start_pos) &&
|
||||
(selection_start_pos < end_pos) &&
|
||||
@@ -1423,19 +1466,19 @@ gtk_entry_draw_text (GtkEntry *entry)
|
||||
INNER_BORDER,
|
||||
selection_end_xoffset - selection_start_xoffset,
|
||||
height - 2*INNER_BORDER);
|
||||
gdk_draw_text_wc (drawable, widget->style->font,
|
||||
widget->style->fg_gc[selected_state],
|
||||
INNER_BORDER + selection_start_xoffset, y,
|
||||
toprint + selection_start_pos - start_pos,
|
||||
selection_end_pos - selection_start_pos);
|
||||
gtk_entry_draw_wchars (entry, drawable, widget->style->font,
|
||||
widget->style->fg_gc[selected_state],
|
||||
INNER_BORDER + selection_start_xoffset, y,
|
||||
toprint + selection_start_pos - start_pos,
|
||||
selection_end_pos - selection_start_pos);
|
||||
}
|
||||
|
||||
if (selection_end_pos < end_pos)
|
||||
gdk_draw_text_wc (drawable, widget->style->font,
|
||||
widget->style->fg_gc[GTK_WIDGET_STATE (widget)],
|
||||
INNER_BORDER + selection_end_xoffset, y,
|
||||
toprint + selection_end_pos - start_pos,
|
||||
end_pos - selection_end_pos);
|
||||
gtk_entry_draw_wchars (entry, drawable, widget->style->font,
|
||||
widget->style->fg_gc[GTK_WIDGET_STATE (widget)],
|
||||
INNER_BORDER + selection_end_xoffset, y,
|
||||
toprint + selection_end_pos - start_pos,
|
||||
end_pos - selection_end_pos);
|
||||
/* free the space allocated for the stars if it's neccessary. */
|
||||
if (!editable->visible)
|
||||
g_free (toprint);
|
||||
@@ -1510,9 +1553,9 @@ gtk_entry_draw_cursor_on_drawable (GtkEntry *entry, GdkDrawable *drawable)
|
||||
*(entry->text + editable->current_pos) :
|
||||
'*';
|
||||
|
||||
gdk_draw_text_wc (drawable, widget->style->font,
|
||||
widget->style->fg_gc[GTK_WIDGET_STATE (widget)],
|
||||
xoffset, yoffset, &c, 1);
|
||||
gtk_entry_draw_wchars (entry, drawable, widget->style->font,
|
||||
widget->style->fg_gc[GTK_WIDGET_STATE (widget)],
|
||||
xoffset, yoffset, &c, 1);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1780,21 +1823,23 @@ gtk_entry_insert_text (GtkEditable *editable,
|
||||
gint offset = 0;
|
||||
|
||||
for (i = last_pos; i >= end_pos; i--)
|
||||
entry->char_offset[i]
|
||||
= entry->char_offset[i - insertion_length];
|
||||
entry->char_offset[i] = entry->char_offset[i - insertion_length];
|
||||
|
||||
for (i=start_pos; i<end_pos; i++)
|
||||
{
|
||||
GdkWChar ch;
|
||||
|
||||
entry->char_offset[i] = entry->char_offset[start_pos] + offset;
|
||||
|
||||
if (editable->visible)
|
||||
{
|
||||
offset += gdk_char_width_wc (GTK_WIDGET (entry)->style->font,
|
||||
entry->text[i]);
|
||||
}
|
||||
ch = entry->text[i];
|
||||
else
|
||||
ch = gtk_entry_get_invisible_char (entry);
|
||||
|
||||
if (entry->use_wchar)
|
||||
offset += gdk_char_width_wc (GTK_WIDGET (entry)->style->font, ch);
|
||||
else
|
||||
{
|
||||
offset += gdk_char_width (GTK_WIDGET (entry)->style->font, '*');
|
||||
}
|
||||
offset += gdk_char_width (GTK_WIDGET (entry)->style->font, ch);
|
||||
}
|
||||
for (i = end_pos; i <= last_pos; i++)
|
||||
entry->char_offset[i] += offset;
|
||||
@@ -1813,21 +1858,25 @@ gtk_entry_recompute_offsets (GtkEntry *entry)
|
||||
{
|
||||
gint i;
|
||||
gint offset = 0;
|
||||
GtkEditable *editable = GTK_EDITABLE (entry);
|
||||
|
||||
for (i=0; i<entry->text_length; i++)
|
||||
{
|
||||
entry->char_offset[i] = offset;
|
||||
if (GTK_EDITABLE (entry)->visible)
|
||||
{
|
||||
offset += gdk_char_width_wc (GTK_WIDGET (entry)->style->font,
|
||||
entry->text[i]);
|
||||
}
|
||||
else
|
||||
{
|
||||
offset += gdk_char_width (GTK_WIDGET (entry)->style->font, '*');
|
||||
}
|
||||
}
|
||||
GdkWChar ch;
|
||||
|
||||
entry->char_offset[i] = offset;
|
||||
|
||||
if (editable->visible)
|
||||
ch = entry->text[i];
|
||||
else
|
||||
ch = gtk_entry_get_invisible_char (entry);
|
||||
|
||||
if (entry->use_wchar)
|
||||
offset += gdk_char_width_wc (GTK_WIDGET (entry)->style->font, ch);
|
||||
else
|
||||
offset += gdk_char_width (GTK_WIDGET (entry)->style->font, ch);
|
||||
}
|
||||
|
||||
entry->char_offset[i] = offset;
|
||||
}
|
||||
|
||||
|
||||
@@ -5041,7 +5041,7 @@ draw_line (GtkText* text,
|
||||
pixel_width = gdk_text_width_wc (gc_values.font,
|
||||
buffer.wc, len);
|
||||
else
|
||||
pixel_width = gdk_text_width (gc_values.font,
|
||||
pixel_width = gdk_text_width (gc_values.font,
|
||||
buffer.ch, len);
|
||||
}
|
||||
else
|
||||
@@ -5205,15 +5205,26 @@ undraw_cursor (GtkText* text, gint absolute)
|
||||
{
|
||||
if (font->type == GDK_FONT_FONT)
|
||||
gdk_gc_set_font (text->gc, font);
|
||||
|
||||
|
||||
gdk_gc_set_foreground (text->gc, MARK_CURRENT_FORE (text, &text->cursor_mark));
|
||||
|
||||
gdk_draw_text_wc (text->text_area, font,
|
||||
text->gc,
|
||||
text->cursor_pos_x,
|
||||
text->cursor_pos_y - text->cursor_char_offset,
|
||||
&text->cursor_char,
|
||||
1);
|
||||
|
||||
if (text->use_wchar)
|
||||
gdk_draw_text_wc (text->text_area, font,
|
||||
text->gc,
|
||||
text->cursor_pos_x,
|
||||
text->cursor_pos_y - text->cursor_char_offset,
|
||||
&text->cursor_char,
|
||||
1);
|
||||
else
|
||||
{
|
||||
guchar ch = text->cursor_char;
|
||||
gdk_draw_text (text->text_area, font,
|
||||
text->gc,
|
||||
text->cursor_pos_x,
|
||||
text->cursor_pos_y - text->cursor_char_offset,
|
||||
(gchar *)&ch,
|
||||
1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user