gtk/gtkentry.[ch] gtktext.c gtkeditable.[ch]

Sat Feb 28 23:58:54 1998  Owen Taylor  <owt1@cornell.edu>

	* gtk/gtkentry.[ch] gtktext.c gtkeditable.[ch]

	Created a new base widget type Editable for the entry and
	text widgets, which encapsulates most of the selection and
	clipboard handling stuff, plus some common signals.

	Changed the Entry widget extensively to support this,
	but the interface and appearance should be the same.

	Changed the Text widget moderately to support this.

	It now supports:

	- Selection style cut and paste
	- Clipboard style cut and paste
	- Emacs style key bindings (~same as Entry)
	- Word motion
	- "changed" signal

	There are definitely still some bugs in the new stuff.

	* gtkfilesel.c gtkspinbutton.c testgtk.c: small changes
	to fit the new interface more exactly.
This commit is contained in:
Owen Taylor
1998-03-01 05:11:05 +00:00
committed by Owen Taylor
parent d491547e86
commit 9205edae41
18 changed files with 1973 additions and 913 deletions

View File

@ -20,7 +20,7 @@
#include <gdk/gdk.h>
#include <gtk/gtkwidget.h>
#include <gtk/gtkeditable.h>
#ifdef __cplusplus
@ -38,7 +38,7 @@ typedef struct _GtkEntryClass GtkEntryClass;
struct _GtkEntry
{
GtkWidget widget;
GtkEditable editable;
GdkWindow *text_area;
GdkPixmap *backing_pixmap;
@ -48,32 +48,15 @@ struct _GtkEntry
guint16 text_size;
guint16 text_length;
guint16 text_max_length;
gint16 current_pos;
gint16 selection_start_pos;
gint16 selection_end_pos;
gint16 scroll_offset;
guint have_selection : 1;
guint visible : 1;
guint editable : 1;
guint32 timer;
GdkIC ic;
gchar *clipboard_text;
};
struct _GtkEntryClass
{
GtkWidgetClass parent_class;
GtkEditableClass parent_class;
void (* insert_text) (GtkEntry *entry,
const gchar *text,
gint length,
gint *position);
void (* delete_text) (GtkEntry *entry,
gint start_pos,
gint end_pos);
void (* changed) (GtkEntry *entry);
void (* set_text) (GtkEntry *entry);
void (* activate) (GtkEntry *entry);
};
@ -90,8 +73,8 @@ void gtk_entry_set_position (GtkEntry *entry,
gint position);
gchar* gtk_entry_get_text (GtkEntry *entry);
void gtk_entry_select_region (GtkEntry *entry,
gint start,
gint end);
guint start,
guint end);
void gtk_entry_set_visibility (GtkEntry *entry,
gboolean visible);
void gtk_entry_set_editable (GtkEntry *entry,