Destroy widgets _after_ propagating unrealize signals through the widget

Mon Dec  7 10:27:09 1998  Owen Taylor  <otaylor@redhat.com>

	* gtk/gtkwidget.c: Destroy widgets _after_ propagating unrealize
	signals through the widget heirarchy. This is unpleasant, as it
	causes more X traffic, but is necessary, because we have to clean
	up our Input Contexts before destroying the X windows.
	(from matsu-981109-0.patch)

Mon Dec  7 10:18:18 1998  Owen Taylor  <otaylor@redhat.com>

	Applied gtk-a-higuti-981202-0 :
	[ a-higuti@math.sci.hokudai.ac.jp (Akira Higuchi) ]

	* gdk/gdk.h gdk/gdk.c
		(gdk_mbstowcs): New function. Nearly equals to mbstowcs, but
			implemented by a combination of Xlib functions, so
			it works even with X_LOCALE.
		(gdk_wcstombs): New function.
		(g_mbtowc): Removed. No longer needed.

	* gdk/gdk.h gdk/gdkfont.c gdk/gdkdraw.c:
	        Added _wc() variants to gdk_text_width(),
		gdk_char_width(), gdk_draw_text(),

	* gdk/gdki18n.h
		(mblen, mbtowc, wctomb, mbstowcs, wcstombs,
		 wcslen, wcscpy, wcsncpy):
			Removed. No longer needed.
		(iswalnum): Removed.
		(gdk_iswalnum): New macro.
		(gdk_iswspace): New macro.
	* gdk/gdktype.h
		(GdkWChar): New typedef.

	* gtk/gtkentry.h, gtk/gtkentry.c
		There are many changes according to the change of the
		internal representation of text, from multibyte string
		to wide characters.
	* gtk/gtkprivate.h, gtk/gtkmain.c
		Removed the variable gtk_use_mb and related codes.
	* gtk/gtkspinbutton.c
		Some changes according to the change of type of entry->text.
	* gtk/gtktext.h, gtk/gtktext.c
		Changed the internal representation of text. We use GdkWchar
		if a fontset is supplied. If not, we use guchar to save
		memory.
This commit is contained in:
Owen Taylor
1998-12-09 06:36:57 +00:00
committed by Owen Taylor
parent af84227184
commit 207757e70d
35 changed files with 1931 additions and 2297 deletions

View File

@ -46,26 +46,27 @@ struct _GtkEntry
GdkWindow *text_area;
GdkPixmap *backing_pixmap;
GdkCursor *cursor;
gchar *text;
GdkWChar *text;
guint16 text_size;
guint16 text_length;
guint16 text_size; /* allocated size */
guint16 text_length; /* length in use */
guint16 text_max_length;
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;
gint *char_offset;
/* Same as 'text', but in multibyte */
gchar *text_mb;
/* If true, 'text' and 'text_mb' are not coherent */
guint text_mb_dirty : 1;
/* If true, we use the encoding of wchar_t as the encoding of 'text'.
* Otherwise we use the encoding of multi-byte characters instead. */
guint use_wchar : 1;
};
struct _GtkEntryClass
@ -75,7 +76,7 @@ struct _GtkEntryClass
GtkType gtk_entry_get_type (void);
GtkWidget* gtk_entry_new (void);
GtkWidget* gtk_entry_new_with_max_length (guint16 max);
GtkWidget* gtk_entry_new_with_max_length (guint16 max);
void gtk_entry_set_text (GtkEntry *entry,
const gchar *text);
void gtk_entry_append_text (GtkEntry *entry,
@ -84,6 +85,7 @@ void gtk_entry_prepend_text (GtkEntry *entry,
const gchar *text);
void gtk_entry_set_position (GtkEntry *entry,
gint position);
/* returns a reference to the text */
gchar* gtk_entry_get_text (GtkEntry *entry);
void gtk_entry_select_region (GtkEntry *entry,
gint start,