From 16aa9c196416f6bbb60e22f06f62cae8ab4b0196 Mon Sep 17 00:00:00 2001 From: Owen Taylor Date: Sun, 22 Mar 1998 21:31:10 +0000 Subject: fixes to locale checks Sun Mar 22 16:25:46 1998 Owen Taylor * gtk/gtkmain.c (gtk_init): fixes to locale checks * gtk/testgtk.c (create_dnd): Create the dnd icons separately to avoid strange interactions with shapes demo. * gtk/gtkentry.[ch]: - Limit the length of the text to 2048 to prevent long delays - Fix problems with buffer overruns - Draw only the onscreen portion of the text to prevent wrapping of shorts in the X drawing code. - Keep track of character positions and x-offsets to speed up algorithms. --- gtk/gtkentry.h | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'gtk/gtkentry.h') diff --git a/gtk/gtkentry.h b/gtk/gtkentry.h index e624def9db..43c895138b 100644 --- a/gtk/gtkentry.h +++ b/gtk/gtkentry.h @@ -48,10 +48,21 @@ struct _GtkEntry guint16 text_size; guint16 text_length; guint16 text_max_length; - gint16 scroll_offset; + gint scroll_offset; guint visible : 1; guint32 timer; guint button; + + /* The total number of characters (not bytes) in the entry */ + guint nchars; + + /* The byte offset of each character + * (including the last insertion position) */ + guint16 *char_pos; + + /* The x-offset of each character (including the last insertion position) + * only valid when the widget is realized */ + gint *char_offset; }; struct _GtkEntryClass -- cgit v1.2.1