summaryrefslogtreecommitdiff
path: root/gtk/gtktext.c
diff options
context:
space:
mode:
authorKristian Rietveld <kristian@planet.nl>2001-10-03 21:50:58 +0000
committerKristian Rietveld <kristian@src.gnome.org>2001-10-03 21:50:58 +0000
commit3c09d348d307f4dc61de16ef8163856ebc34022f (patch)
treecd2fc72b41f2d4a57109436b6ed7c2717bb2ea95 /gtk/gtktext.c
parent77dc57e96019d5badb9292e03edead804bc6d8ec (diff)
downloadgdk-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/gtktext.c')
-rw-r--r--gtk/gtktext.c32
1 files changed, 24 insertions, 8 deletions
diff --git a/gtk/gtktext.c b/gtk/gtktext.c
index f57309197..d5b5987ab 100644
--- a/gtk/gtktext.c
+++ b/gtk/gtktext.c
@@ -204,6 +204,7 @@ static void gtk_text_get_property (GObject *object,
guint prop_id,
GValue *value,
GParamSpec *pspec);
+static void gtk_text_editable_init (GtkEditableClass *iface);
static void gtk_text_init (GtkText *text);
static void gtk_text_destroy (GtkObject *object);
static void gtk_text_finalize (GObject *object);
@@ -220,11 +221,11 @@ static void gtk_text_size_allocate (GtkWidget *widget,
GtkAllocation *allocation);
static void gtk_text_adjustment (GtkAdjustment *adjustment,
GtkText *text);
-static void gtk_text_insert_text (GtkOldEditable *old_editable,
+static void gtk_text_insert_text (GtkEditable *editable,
const gchar *new_text,
gint new_text_length,
gint *position);
-static void gtk_text_delete_text (GtkOldEditable *old_editable,
+static void gtk_text_delete_text (GtkEditable *editable,
gint start_pos,
gint end_pos);
static void gtk_text_update_text (GtkOldEditable *old_editable,
@@ -526,8 +527,18 @@ gtk_text_get_type (void)
/* reserved_2 */ NULL,
(GtkClassInitFunc) NULL,
};
+
+ static const GInterfaceInfo editable_info =
+ {
+ (GInterfaceInitFunc) gtk_text_editable_init, /* interface_init */
+ NULL, /* interface_finalize */
+ NULL /* interface_data */
+ };
text_type = gtk_type_unique (GTK_TYPE_OLD_EDITABLE, &text_info);
+ g_type_add_interface_static (text_type,
+ GTK_TYPE_EDITABLE,
+ &editable_info);
}
return text_type;
@@ -568,8 +579,6 @@ gtk_text_class_init (GtkTextClass *class)
widget_class->focus_out_event = gtk_text_focus_out;
old_editable_class->set_editable = gtk_text_real_set_editable;
- old_editable_class->insert_text = gtk_text_insert_text;
- old_editable_class->delete_text = gtk_text_delete_text;
old_editable_class->move_cursor = gtk_text_move_cursor;
old_editable_class->move_word = gtk_text_move_word;
@@ -694,6 +703,13 @@ gtk_text_get_property (GObject *object,
}
static void
+gtk_text_editable_init (GtkEditableClass *iface)
+{
+ iface->insert_text = gtk_text_insert_text;
+ iface->delete_text = gtk_text_delete_text;
+}
+
+static void
gtk_text_init (GtkText *text)
{
GTK_WIDGET_SET_FLAGS (text, GTK_CAN_FOCUS);
@@ -1861,12 +1877,12 @@ gtk_text_motion_notify (GtkWidget *widget,
}
static void
-gtk_text_insert_text (GtkOldEditable *old_editable,
+gtk_text_insert_text (GtkEditable *editable,
const gchar *new_text,
gint new_text_length,
gint *position)
{
- GtkText *text = GTK_TEXT (old_editable);
+ GtkText *text = GTK_TEXT (editable);
GdkFont *font;
GdkColor *fore, *back;
@@ -1885,7 +1901,7 @@ gtk_text_insert_text (GtkOldEditable *old_editable,
}
static void
-gtk_text_delete_text (GtkOldEditable *old_editable,
+gtk_text_delete_text (GtkEditable *editable,
gint start_pos,
gint end_pos)
{
@@ -1893,7 +1909,7 @@ gtk_text_delete_text (GtkOldEditable *old_editable,
g_return_if_fail (start_pos >= 0);
- text = GTK_TEXT (old_editable);
+ text = GTK_TEXT (editable);
gtk_text_set_point (text, start_pos);
if (end_pos < 0)