diff --git a/demos/gtk-demo/combobox.c b/demos/gtk-demo/combobox.c index 8f4348c722..82588b2923 100644 --- a/demos/gtk-demo/combobox.c +++ b/demos/gtk-demo/combobox.c @@ -271,7 +271,7 @@ struct _MaskEntryClass }; -static void mask_entry_editable_init (GtkEditableClass *iface); +static void mask_entry_editable_init (GtkEditableInterface *iface); G_DEFINE_TYPE_WITH_CODE (MaskEntry, mask_entry, GTK_TYPE_ENTRY, G_IMPLEMENT_INTERFACE (GTK_TYPE_EDITABLE, @@ -316,7 +316,7 @@ mask_entry_class_init (MaskEntryClass *klass) static void -mask_entry_editable_init (GtkEditableClass *iface) +mask_entry_editable_init (GtkEditableInterface *iface) { iface->changed = mask_entry_changed; } diff --git a/demos/gtk-demo/main.c b/demos/gtk-demo/main.c index 2f16a96be0..d55ba68024 100644 --- a/demos/gtk-demo/main.c +++ b/demos/gtk-demo/main.c @@ -279,7 +279,7 @@ static gchar *types[] = "GtkTreeStore ", "GtkEntry ", "GtkEditable ", - "GtkEditableClass ", + "GtkEditableInterface ", "GdkPixmap ", "GdkEventConfigure ", "GdkEventMotion ", diff --git a/gtk/gtkeditable.c b/gtk/gtkeditable.c index 16a000370e..5f5b89e410 100644 --- a/gtk/gtkeditable.c +++ b/gtk/gtkeditable.c @@ -44,7 +44,7 @@ gtk_editable_get_type (void) { const GTypeInfo editable_info = { - sizeof (GtkEditableClass), /* class_size */ + sizeof (GtkEditableInterface), /* class_size */ gtk_editable_base_init, /* base_init */ NULL, /* base_finalize */ }; @@ -85,7 +85,7 @@ gtk_editable_base_init (gpointer g_class) g_signal_new (I_("insert-text"), GTK_TYPE_EDITABLE, G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (GtkEditableClass, insert_text), + G_STRUCT_OFFSET (GtkEditableInterface, insert_text), NULL, NULL, _gtk_marshal_VOID__STRING_INT_POINTER, G_TYPE_NONE, 3, @@ -112,7 +112,7 @@ gtk_editable_base_init (gpointer g_class) g_signal_new (I_("delete-text"), GTK_TYPE_EDITABLE, G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (GtkEditableClass, delete_text), + G_STRUCT_OFFSET (GtkEditableInterface, delete_text), NULL, NULL, _gtk_marshal_VOID__INT_INT, G_TYPE_NONE, 2, @@ -134,7 +134,7 @@ gtk_editable_base_init (gpointer g_class) g_signal_new (I_("changed"), GTK_TYPE_EDITABLE, G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (GtkEditableClass, changed), + G_STRUCT_OFFSET (GtkEditableInterface, changed), NULL, NULL, _gtk_marshal_VOID__VOID, G_TYPE_NONE, 0); @@ -168,7 +168,7 @@ gtk_editable_insert_text (GtkEditable *editable, if (new_text_length < 0) new_text_length = strlen (new_text); - GTK_EDITABLE_GET_CLASS (editable)->do_insert_text (editable, new_text, new_text_length, position); + GTK_EDITABLE_GET_IFACE (editable)->do_insert_text (editable, new_text, new_text_length, position); } /** @@ -191,7 +191,7 @@ gtk_editable_delete_text (GtkEditable *editable, { g_return_if_fail (GTK_IS_EDITABLE (editable)); - GTK_EDITABLE_GET_CLASS (editable)->do_delete_text (editable, start_pos, end_pos); + GTK_EDITABLE_GET_IFACE (editable)->do_delete_text (editable, start_pos, end_pos); } /** @@ -218,7 +218,7 @@ gtk_editable_get_chars (GtkEditable *editable, { g_return_val_if_fail (GTK_IS_EDITABLE (editable), NULL); - return GTK_EDITABLE_GET_CLASS (editable)->get_chars (editable, start_pos, end_pos); + return GTK_EDITABLE_GET_IFACE (editable)->get_chars (editable, start_pos, end_pos); } /** @@ -240,7 +240,7 @@ gtk_editable_set_position (GtkEditable *editable, { g_return_if_fail (GTK_IS_EDITABLE (editable)); - GTK_EDITABLE_GET_CLASS (editable)->set_position (editable, position); + GTK_EDITABLE_GET_IFACE (editable)->set_position (editable, position); } /** @@ -259,7 +259,7 @@ gtk_editable_get_position (GtkEditable *editable) { g_return_val_if_fail (GTK_IS_EDITABLE (editable), 0); - return GTK_EDITABLE_GET_CLASS (editable)->get_position (editable); + return GTK_EDITABLE_GET_IFACE (editable)->get_position (editable); } /** @@ -286,7 +286,7 @@ gtk_editable_get_selection_bounds (GtkEditable *editable, g_return_val_if_fail (GTK_IS_EDITABLE (editable), FALSE); - result = GTK_EDITABLE_GET_CLASS (editable)->get_selection_bounds (editable, &tmp_start, &tmp_end); + result = GTK_EDITABLE_GET_IFACE (editable)->get_selection_bounds (editable, &tmp_start, &tmp_end); if (start_pos) *start_pos = MIN (tmp_start, tmp_end); @@ -335,7 +335,7 @@ gtk_editable_select_region (GtkEditable *editable, { g_return_if_fail (GTK_IS_EDITABLE (editable)); - GTK_EDITABLE_GET_CLASS (editable)->set_selection_bounds (editable, start_pos, end_pos); + GTK_EDITABLE_GET_IFACE (editable)->set_selection_bounds (editable, start_pos, end_pos); } /** diff --git a/gtk/gtkeditable.h b/gtk/gtkeditable.h index fbbc847111..5ccebce9f3 100644 --- a/gtk/gtkeditable.h +++ b/gtk/gtkeditable.h @@ -39,15 +39,13 @@ G_BEGIN_DECLS #define GTK_TYPE_EDITABLE (gtk_editable_get_type ()) #define GTK_EDITABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_EDITABLE, GtkEditable)) -#define GTK_EDITABLE_CLASS(vtable) (G_TYPE_CHECK_CLASS_CAST ((vtable), GTK_TYPE_EDITABLE, GtkEditableClass)) #define GTK_IS_EDITABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_EDITABLE)) -#define GTK_IS_EDITABLE_CLASS(vtable) (G_TYPE_CHECK_CLASS_TYPE ((vtable), GTK_TYPE_EDITABLE)) -#define GTK_EDITABLE_GET_CLASS(inst) (G_TYPE_INSTANCE_GET_INTERFACE ((inst), GTK_TYPE_EDITABLE, GtkEditableClass)) +#define GTK_EDITABLE_GET_IFACE(inst) (G_TYPE_INSTANCE_GET_INTERFACE ((inst), GTK_TYPE_EDITABLE, GtkEditableInterface)) -typedef struct _GtkEditable GtkEditable; /* Dummy typedef */ -typedef struct _GtkEditableClass GtkEditableClass; +typedef struct _GtkEditable GtkEditable; /* Dummy typedef */ +typedef struct _GtkEditableInterface GtkEditableInterface; -struct _GtkEditableClass +struct _GtkEditableInterface { GTypeInterface base_iface; diff --git a/gtk/gtkentry.c b/gtk/gtkentry.c index 5aea1375fb..fddf25c346 100644 --- a/gtk/gtkentry.c +++ b/gtk/gtkentry.c @@ -239,7 +239,7 @@ typedef enum /* GObject, GtkObject methods */ -static void gtk_entry_editable_init (GtkEditableClass *iface); +static void gtk_entry_editable_init (GtkEditableInterface *iface); static void gtk_entry_cell_editable_init (GtkCellEditableIface *iface); static void gtk_entry_set_property (GObject *object, guint prop_id, @@ -1769,7 +1769,7 @@ gtk_entry_class_init (GtkEntryClass *class) } static void -gtk_entry_editable_init (GtkEditableClass *iface) +gtk_entry_editable_init (GtkEditableInterface *iface) { iface->do_insert_text = gtk_entry_insert_text; iface->do_delete_text = gtk_entry_delete_text; diff --git a/gtk/gtkfilechooserentry.c b/gtk/gtkfilechooserentry.c index f23f395f56..e530351828 100644 --- a/gtk/gtkfilechooserentry.c +++ b/gtk/gtkfilechooserentry.c @@ -104,7 +104,7 @@ enum #define COMPLETION_FEEDBACK_TIMEOUT_MS 2000 -static void gtk_file_chooser_entry_iface_init (GtkEditableClass *iface); +static void gtk_file_chooser_entry_iface_init (GtkEditableInterface *iface); static void gtk_file_chooser_entry_finalize (GObject *object); static void gtk_file_chooser_entry_dispose (GObject *object); @@ -168,7 +168,7 @@ static void remove_completion_feedback (GtkFileChooserEntry *chooser_entry); static void pop_up_completion_feedback (GtkFileChooserEntry *chooser_entry, const gchar *feedback); -static GtkEditableClass *parent_editable_iface; +static GtkEditableInterface *parent_editable_iface; G_DEFINE_TYPE_WITH_CODE (GtkFileChooserEntry, _gtk_file_chooser_entry, GTK_TYPE_ENTRY, G_IMPLEMENT_INTERFACE (GTK_TYPE_EDITABLE, @@ -193,7 +193,7 @@ _gtk_file_chooser_entry_class_init (GtkFileChooserEntryClass *class) } static void -gtk_file_chooser_entry_iface_init (GtkEditableClass *iface) +gtk_file_chooser_entry_iface_init (GtkEditableInterface *iface) { parent_editable_iface = g_type_interface_peek_parent (iface); diff --git a/gtk/gtkspinbutton.c b/gtk/gtkspinbutton.c index 4576435eac..bf51597b86 100644 --- a/gtk/gtkspinbutton.c +++ b/gtk/gtkspinbutton.c @@ -97,7 +97,7 @@ enum LAST_SIGNAL }; -static void gtk_spin_button_editable_init (GtkEditableClass *iface); +static void gtk_spin_button_editable_init (GtkEditableInterface *iface); static void gtk_spin_button_finalize (GObject *object); static void gtk_spin_button_destroy (GtkObject *object); static void gtk_spin_button_set_property (GObject *object, @@ -405,7 +405,7 @@ gtk_spin_button_class_init (GtkSpinButtonClass *class) } static void -gtk_spin_button_editable_init (GtkEditableClass *iface) +gtk_spin_button_editable_init (GtkEditableInterface *iface) { iface->insert_text = gtk_spin_button_insert_text; } @@ -1523,7 +1523,10 @@ gtk_spin_button_insert_text (GtkEditable *editable, GtkEntry *entry = GTK_ENTRY (editable); GtkSpinButton *spin = GTK_SPIN_BUTTON (editable); GtkSpinButtonPrivate *priv = spin->priv; - GtkEditableClass *parent_editable_iface = g_type_interface_peek (gtk_spin_button_parent_class, GTK_TYPE_EDITABLE); + GtkEditableInterface *parent_editable_iface; + + parent_editable_iface = g_type_interface_peek (gtk_spin_button_parent_class, + GTK_TYPE_EDITABLE); if (priv->numeric) {