diff options
author | Kristian Rietveld <kristian@planet.nl> | 2001-10-03 21:50:58 +0000 |
---|---|---|
committer | Kristian Rietveld <kristian@src.gnome.org> | 2001-10-03 21:50:58 +0000 |
commit | 3c09d348d307f4dc61de16ef8163856ebc34022f (patch) | |
tree | cd2fc72b41f2d4a57109436b6ed7c2717bb2ea95 /gtk/gtkeditable.c | |
parent | 77dc57e96019d5badb9292e03edead804bc6d8ec (diff) | |
download | gdk-pixbuf-3c09d348d307f4dc61de16ef8163856ebc34022f.tar.gz |
move insert_text and delete_text virtual functions to do_insert_text and
Wed Oct 3 23:47:25 Kristian Rietveld <kristian@planet.nl>
* gtk/gtkeditable.[ch]: move insert_text and delete_text virtual
functions to do_insert_text and do_delete_text, add signals
insert_text, delete_text and changed
* gtk/gtkentry.[ch]: remove signals insert_text, delete_text
and changed. Updates to match new situation.
* gtk/gtkspinbutton.c: updates to match new situation
* gtk/gtkoldeditable.h: remove signals changed, insert_text
and delete_text
* gtk/gtkoldeditable.c: updates to match new situation
* gtk/gtktext.c: updates to match new situation
Fixes bug #59803
Diffstat (limited to 'gtk/gtkeditable.c')
-rw-r--r-- | gtk/gtkeditable.c | 48 |
1 files changed, 45 insertions, 3 deletions
diff --git a/gtk/gtkeditable.c b/gtk/gtkeditable.c index d12e1d518..8b41572e1 100644 --- a/gtk/gtkeditable.c +++ b/gtk/gtkeditable.c @@ -29,6 +29,10 @@ #include "gtkeditable.h" #include "gtksignal.h" + +static void gtk_editable_base_init (gpointer g_class); + + GtkType gtk_editable_get_type (void) { @@ -39,7 +43,7 @@ gtk_editable_get_type (void) static const GTypeInfo editable_info = { sizeof (GtkEditableClass), /* class_size */ - NULL, /* base_init */ + gtk_editable_base_init, /* base_init */ NULL, /* base_finalize */ }; @@ -49,6 +53,44 @@ gtk_editable_get_type (void) return editable_type; } +static void +gtk_editable_base_init (gpointer g_class) +{ + static gboolean initialized = FALSE; + + if (! initialized) + { + g_signal_new ("insert_text", + GTK_TYPE_EDITABLE, + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (GtkEditableClass, insert_text), + NULL, NULL, + gtk_marshal_VOID__STRING_INT_POINTER, + G_TYPE_NONE, 3, + GTK_TYPE_STRING, + GTK_TYPE_INT, + GTK_TYPE_POINTER); + g_signal_new ("delete_text", + GTK_TYPE_EDITABLE, + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (GtkEditableClass, delete_text), + NULL, NULL, + gtk_marshal_VOID__INT_INT, + GTK_TYPE_NONE, 2, + GTK_TYPE_INT, + GTK_TYPE_INT); + g_signal_new ("changed", + GTK_TYPE_EDITABLE, + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (GtkEditableClass, changed), + NULL, NULL, + gtk_marshal_VOID__VOID, + GTK_TYPE_NONE, 0); + + initialized = TRUE; + } +} + void gtk_editable_insert_text (GtkEditable *editable, const gchar *new_text, @@ -61,7 +103,7 @@ gtk_editable_insert_text (GtkEditable *editable, if (new_text_length < 0) new_text_length = strlen (new_text); - GTK_EDITABLE_GET_CLASS (editable)->insert_text (editable, new_text, new_text_length, position); + GTK_EDITABLE_GET_CLASS (editable)->do_insert_text (editable, new_text, new_text_length, position); } void @@ -71,7 +113,7 @@ gtk_editable_delete_text (GtkEditable *editable, { g_return_if_fail (GTK_IS_EDITABLE (editable)); - GTK_EDITABLE_GET_CLASS (editable)->delete_text (editable, start_pos, end_pos); + GTK_EDITABLE_GET_CLASS (editable)->do_delete_text (editable, start_pos, end_pos); } gchar * |