mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-12-25 05:01:09 +00:00
Change GtkEditable typedef from GtkEditableClass to GtkEditabeInterface
Fixes https://bugzilla.gnome.org/show_bug.cgi?id=323904
This commit is contained in:
parent
6e9349d858
commit
efbf04236e
@ -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;
|
||||
}
|
||||
|
@ -279,7 +279,7 @@ static gchar *types[] =
|
||||
"GtkTreeStore ",
|
||||
"GtkEntry ",
|
||||
"GtkEditable ",
|
||||
"GtkEditableClass ",
|
||||
"GtkEditableInterface ",
|
||||
"GdkPixmap ",
|
||||
"GdkEventConfigure ",
|
||||
"GdkEventMotion ",
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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;
|
||||
|
@ -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);
|
||||
|
||||
|
@ -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)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user