diff options
author | Niels De Graef <nielsdegraef@gmail.com> | 2020-04-04 11:11:23 +0200 |
---|---|---|
committer | Niels De Graef <nielsdegraef@gmail.com> | 2020-04-04 11:11:23 +0200 |
commit | 02a06f2c674785de9661a6e2badfc62ada2dffb0 (patch) | |
tree | db08696bd98fe56af82325f0079224ad6e13e133 | |
parent | 776499307df42204785f84cdc9596d63a1ebccd4 (diff) | |
download | gtk+-02a06f2c674785de9661a6e2badfc62ada2dffb0.tar.gz |
celleditable: Use G_DECLARE_INTERFACE
-rw-r--r-- | docs/reference/gtk/gtk4-sections.txt | 2 | ||||
-rw-r--r-- | gtk/gtk-autocleanups.h | 1 | ||||
-rw-r--r-- | gtk/gtkcelleditable.c | 5 | ||||
-rw-r--r-- | gtk/gtkcelleditable.h | 18 | ||||
-rw-r--r-- | gtk/gtkcellrendereraccel.c | 4 | ||||
-rw-r--r-- | gtk/gtkcombobox.c | 4 | ||||
-rw-r--r-- | gtk/gtkentry.c | 4 | ||||
-rw-r--r-- | gtk/gtkspinbutton.c | 4 |
8 files changed, 16 insertions, 26 deletions
diff --git a/docs/reference/gtk/gtk4-sections.txt b/docs/reference/gtk/gtk4-sections.txt index ae58c0160c..e06c903b38 100644 --- a/docs/reference/gtk/gtk4-sections.txt +++ b/docs/reference/gtk/gtk4-sections.txt @@ -3635,7 +3635,7 @@ gtk_cell_renderer_state_get_type <FILE>gtkcelleditable</FILE> <TITLE>GtkCellEditable</TITLE> GtkCellEditable -GtkCellEditableIface +GtkCellEditableInterface gtk_cell_editable_start_editing gtk_cell_editable_editing_done gtk_cell_editable_remove_widget diff --git a/gtk/gtk-autocleanups.h b/gtk/gtk-autocleanups.h index 4f5630831c..0309ac9481 100644 --- a/gtk/gtk-autocleanups.h +++ b/gtk/gtk-autocleanups.h @@ -39,7 +39,6 @@ G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkCalendar, g_object_unref) G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkCellArea, g_object_unref) G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkCellAreaBox, g_object_unref) G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkCellAreaContext, g_object_unref) -G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkCellEditable, g_object_unref) G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkCellLayout, g_object_unref) G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkCellRenderer, g_object_unref) G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkCellRendererAccel, g_object_unref) diff --git a/gtk/gtkcelleditable.c b/gtk/gtkcelleditable.c index df3c0ddf9c..1ed528211a 100644 --- a/gtk/gtkcelleditable.c +++ b/gtk/gtkcelleditable.c @@ -33,7 +33,6 @@ #include "gtkintl.h" -typedef GtkCellEditableIface GtkCellEditableInterface; G_DEFINE_INTERFACE(GtkCellEditable, gtk_cell_editable, GTK_TYPE_WIDGET) static void @@ -70,7 +69,7 @@ gtk_cell_editable_default_init (GtkCellEditableInterface *iface) g_signal_new (I_("editing-done"), GTK_TYPE_CELL_EDITABLE, G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (GtkCellEditableIface, editing_done), + G_STRUCT_OFFSET (GtkCellEditableInterface, editing_done), NULL, NULL, NULL, G_TYPE_NONE, 0); @@ -95,7 +94,7 @@ gtk_cell_editable_default_init (GtkCellEditableInterface *iface) g_signal_new (I_("remove-widget"), GTK_TYPE_CELL_EDITABLE, G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (GtkCellEditableIface, remove_widget), + G_STRUCT_OFFSET (GtkCellEditableInterface, remove_widget), NULL, NULL, NULL, G_TYPE_NONE, 0); diff --git a/gtk/gtkcelleditable.h b/gtk/gtkcelleditable.h index dfd3a51e35..7ea7b3deea 100644 --- a/gtk/gtkcelleditable.h +++ b/gtk/gtkcelleditable.h @@ -26,24 +26,19 @@ G_BEGIN_DECLS -#define GTK_TYPE_CELL_EDITABLE (gtk_cell_editable_get_type ()) -#define GTK_CELL_EDITABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_CELL_EDITABLE, GtkCellEditable)) -#define GTK_CELL_EDITABLE_CLASS(obj) (G_TYPE_CHECK_CLASS_CAST ((obj), GTK_TYPE_CELL_EDITABLE, GtkCellEditableIface)) -#define GTK_IS_CELL_EDITABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_CELL_EDITABLE)) -#define GTK_CELL_EDITABLE_GET_IFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GTK_TYPE_CELL_EDITABLE, GtkCellEditableIface)) - -typedef struct _GtkCellEditable GtkCellEditable; /* Dummy typedef */ -typedef struct _GtkCellEditableIface GtkCellEditableIface; +#define GTK_TYPE_CELL_EDITABLE (gtk_cell_editable_get_type ()) +GDK_AVAILABLE_IN_ALL +G_DECLARE_INTERFACE (GtkCellEditable, gtk_cell_editable, GTK, CELL_EDITABLE, GtkWidget) /** - * GtkCellEditableIface: + * GtkCellEditableInterface: * @editing_done: Signal is a sign for the cell renderer to update its * value from the cell_editable. * @remove_widget: Signal is meant to indicate that the cell is * finished editing, and the widget may now be destroyed. * @start_editing: Begins editing on a cell_editable. */ -struct _GtkCellEditableIface +struct _GtkCellEditableInterface { /*< private >*/ GTypeInterface g_iface; @@ -61,9 +56,6 @@ struct _GtkCellEditableIface GDK_AVAILABLE_IN_ALL -GType gtk_cell_editable_get_type (void) G_GNUC_CONST; - -GDK_AVAILABLE_IN_ALL void gtk_cell_editable_start_editing (GtkCellEditable *cell_editable, GdkEvent *event); GDK_AVAILABLE_IN_ALL diff --git a/gtk/gtkcellrendereraccel.c b/gtk/gtkcellrendereraccel.c index c589320cab..434b0eae1e 100644 --- a/gtk/gtkcellrendereraccel.c +++ b/gtk/gtkcellrendereraccel.c @@ -500,7 +500,7 @@ enum { }; GType gtk_cell_editable_widget_get_type (void); -static void gtk_cell_editable_widget_cell_editable_init (GtkCellEditableIface *iface); +static void gtk_cell_editable_widget_cell_editable_init (GtkCellEditableInterface *iface); G_DEFINE_TYPE_WITH_CODE (GtkCellEditableWidget, gtk_cell_editable_widget, GTK_TYPE_WIDGET, G_IMPLEMENT_INTERFACE (GTK_TYPE_CELL_EDITABLE, gtk_cell_editable_widget_cell_editable_init)) @@ -513,7 +513,7 @@ gtk_cell_editable_widget_start_editing (GtkCellEditable *cell_editable, } static void -gtk_cell_editable_widget_cell_editable_init (GtkCellEditableIface *iface) +gtk_cell_editable_widget_cell_editable_init (GtkCellEditableInterface *iface) { iface->start_editing = gtk_cell_editable_widget_start_editing; } diff --git a/gtk/gtkcombobox.c b/gtk/gtkcombobox.c index c1e97debb0..f270d55d3d 100644 --- a/gtk/gtkcombobox.c +++ b/gtk/gtkcombobox.c @@ -198,7 +198,7 @@ static guint combo_box_signals[LAST_SIGNAL] = {0,}; /* common */ static void gtk_combo_box_cell_layout_init (GtkCellLayoutIface *iface); -static void gtk_combo_box_cell_editable_init (GtkCellEditableIface *iface); +static void gtk_combo_box_cell_editable_init (GtkCellEditableInterface *iface); static void gtk_combo_box_constructed (GObject *object); static void gtk_combo_box_dispose (GObject *object); static void gtk_combo_box_unmap (GtkWidget *widget); @@ -823,7 +823,7 @@ gtk_combo_box_cell_layout_init (GtkCellLayoutIface *iface) } static void -gtk_combo_box_cell_editable_init (GtkCellEditableIface *iface) +gtk_combo_box_cell_editable_init (GtkCellEditableInterface *iface) { iface->start_editing = gtk_combo_box_start_editing; } diff --git a/gtk/gtkentry.c b/gtk/gtkentry.c index 13fd885acf..596012dbb5 100644 --- a/gtk/gtkentry.c +++ b/gtk/gtkentry.c @@ -245,7 +245,7 @@ typedef enum /* GObject methods */ static void gtk_entry_editable_init (GtkEditableInterface *iface); -static void gtk_entry_cell_editable_init (GtkCellEditableIface *iface); +static void gtk_entry_cell_editable_init (GtkCellEditableInterface *iface); static void gtk_entry_set_property (GObject *object, guint prop_id, const GValue *value, @@ -908,7 +908,7 @@ gtk_entry_editable_init (GtkEditableInterface *iface) } static void -gtk_entry_cell_editable_init (GtkCellEditableIface *iface) +gtk_entry_cell_editable_init (GtkCellEditableInterface *iface) { iface->start_editing = gtk_entry_start_editing; } diff --git a/gtk/gtkspinbutton.c b/gtk/gtkspinbutton.c index 6d610e7ef3..f38bc12500 100644 --- a/gtk/gtkspinbutton.c +++ b/gtk/gtkspinbutton.c @@ -259,7 +259,7 @@ enum }; static void gtk_spin_button_editable_init (GtkEditableInterface *iface); -static void gtk_spin_button_cell_editable_init (GtkCellEditableIface *iface); +static void gtk_spin_button_cell_editable_init (GtkCellEditableInterface *iface); static void gtk_spin_button_finalize (GObject *object); static void gtk_spin_button_set_property (GObject *object, guint prop_id, @@ -622,7 +622,7 @@ gtk_spin_button_start_editing (GtkCellEditable *cell_editable, } static void -gtk_spin_button_cell_editable_init (GtkCellEditableIface *iface) +gtk_spin_button_cell_editable_init (GtkCellEditableInterface *iface) { iface->start_editing = gtk_spin_button_start_editing; } |