[gtk/wip/nielsdg/g-declare-interface: 1/3] fontchooser: Use G_DECLARE_INTERFACE
- From: Niels De Graef <nielsdg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/wip/nielsdg/g-declare-interface: 1/3] fontchooser: Use G_DECLARE_INTERFACE
- Date: Fri, 3 Apr 2020 19:25:48 +0000 (UTC)
commit 57d4965ad4829e130b15c56612d59dd16f4df293
Author: Niels De Graef <nielsdegraef gmail com>
Date: Fri Apr 3 18:52:32 2020 +0200
fontchooser: Use G_DECLARE_INTERFACE
docs/reference/gtk/gtk4-sections.txt | 2 +-
gtk/gtk-autocleanups.h | 1 -
gtk/gtkfontbutton.c | 2 +-
gtk/gtkfontchooser.c | 3 +--
gtk/gtkfontchooser.h | 14 ++++----------
gtk/gtkfontchooserutils.c | 4 ++--
gtk/gtkfontchooserutils.h | 2 +-
gtk/gtkfontchooserwidget.c | 4 ++--
8 files changed, 12 insertions(+), 20 deletions(-)
---
diff --git a/docs/reference/gtk/gtk4-sections.txt b/docs/reference/gtk/gtk4-sections.txt
index c4088ea82c..5d767f608b 100644
--- a/docs/reference/gtk/gtk4-sections.txt
+++ b/docs/reference/gtk/gtk4-sections.txt
@@ -1309,7 +1309,7 @@ gtk_font_chooser_set_font_map
gtk_font_chooser_get_font_map
<SUBSECTION Standard>
-GtkFontChooserIface
+GtkFontChooserInterface
GTK_TYPE_FONT_CHOOSER
GTK_FONT_CHOOSER
GTK_FONT_CHOOSER_IFACE
diff --git a/gtk/gtk-autocleanups.h b/gtk/gtk-autocleanups.h
index 59474fc967..bf5f0f6a61 100644
--- a/gtk/gtk-autocleanups.h
+++ b/gtk/gtk-autocleanups.h
@@ -76,7 +76,6 @@ G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkFixed, g_object_unref)
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkFlowBox, g_object_unref)
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkFlowBoxChild, g_object_unref)
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkFontButton, g_object_unref)
-G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkFontChooser, g_object_unref)
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkFontChooserDialog, g_object_unref)
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkFontChooserWidget, g_object_unref)
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkFrame, g_object_unref)
diff --git a/gtk/gtkfontbutton.c b/gtk/gtkfontbutton.c
index 1e5cf9889e..3ca2a2bf9a 100644
--- a/gtk/gtkfontbutton.c
+++ b/gtk/gtkfontbutton.c
@@ -170,7 +170,7 @@ static PangoFontMap * gtk_font_button_font_chooser_get_font_map (GtkFontCh
static void
-gtk_font_button_font_chooser_iface_init (GtkFontChooserIface *iface)
+gtk_font_button_font_chooser_iface_init (GtkFontChooserInterface *iface)
{
iface->get_font_family = gtk_font_button_font_chooser_get_font_family;
iface->get_font_face = gtk_font_button_font_chooser_get_font_face;
diff --git a/gtk/gtkfontchooser.c b/gtk/gtkfontchooser.c
index 35fddc0f56..522f7cad39 100644
--- a/gtk/gtkfontchooser.c
+++ b/gtk/gtkfontchooser.c
@@ -47,7 +47,6 @@ enum
static guint chooser_signals[LAST_SIGNAL];
-typedef GtkFontChooserIface GtkFontChooserInterface;
G_DEFINE_INTERFACE (GtkFontChooser, gtk_font_chooser, G_TYPE_OBJECT);
static void
@@ -164,7 +163,7 @@ gtk_font_chooser_default_init (GtkFontChooserInterface *iface)
g_signal_new (I_("font-activated"),
GTK_TYPE_FONT_CHOOSER,
G_SIGNAL_RUN_FIRST,
- G_STRUCT_OFFSET (GtkFontChooserIface, font_activated),
+ G_STRUCT_OFFSET (GtkFontChooserInterface, font_activated),
NULL, NULL,
NULL,
G_TYPE_NONE,
diff --git a/gtk/gtkfontchooser.h b/gtk/gtkfontchooser.h
index 922258839c..fae07305d9 100644
--- a/gtk/gtkfontchooser.h
+++ b/gtk/gtkfontchooser.h
@@ -66,15 +66,11 @@ typedef enum {
GTK_FONT_CHOOSER_LEVEL_FEATURES = 1 << 3
} GtkFontChooserLevel;
-#define GTK_TYPE_FONT_CHOOSER (gtk_font_chooser_get_type ())
-#define GTK_FONT_CHOOSER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_FONT_CHOOSER,
GtkFontChooser))
-#define GTK_IS_FONT_CHOOSER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_FONT_CHOOSER))
-#define GTK_FONT_CHOOSER_GET_IFACE(inst) (G_TYPE_INSTANCE_GET_INTERFACE ((inst),
GTK_TYPE_FONT_CHOOSER, GtkFontChooserIface))
-
-typedef struct _GtkFontChooser GtkFontChooser; /* dummy */
-typedef struct _GtkFontChooserIface GtkFontChooserIface;
+#define GTK_TYPE_FONT_CHOOSER (gtk_font_chooser_get_type ())
+GDK_AVAILABLE_IN_ALL
+G_DECLARE_INTERFACE (GtkFontChooser, gtk_font_chooser, GTK, FONT_CHOOSER, GObject)
-struct _GtkFontChooserIface
+struct _GtkFontChooserInterface
{
GTypeInterface base_iface;
@@ -101,8 +97,6 @@ struct _GtkFontChooserIface
gpointer padding[10];
};
-GDK_AVAILABLE_IN_ALL
-GType gtk_font_chooser_get_type (void) G_GNUC_CONST;
GDK_AVAILABLE_IN_ALL
PangoFontFamily *gtk_font_chooser_get_font_family (GtkFontChooser *fontchooser);
diff --git a/gtk/gtkfontchooserutils.c b/gtk/gtkfontchooserutils.c
index 84079d276d..9c3d8508a7 100644
--- a/gtk/gtkfontchooserutils.c
+++ b/gtk/gtkfontchooserutils.c
@@ -147,7 +147,7 @@ _gtk_font_chooser_install_properties (GObjectClass *klass)
/**
* _gtk_font_chooser_delegate_iface_init:
- * @iface: a #GtkFontChooserIface
+ * @iface: a #GtkFontChooserInterface
*
* An interface-initialization function for use in cases where
* an object is simply delegating the methods, signals of
@@ -157,7 +157,7 @@ _gtk_font_chooser_install_properties (GObjectClass *klass)
* be found.
*/
void
-_gtk_font_chooser_delegate_iface_init (GtkFontChooserIface *iface)
+_gtk_font_chooser_delegate_iface_init (GtkFontChooserInterface *iface)
{
iface->get_font_family = delegate_get_font_family;
iface->get_font_face = delegate_get_font_face;
diff --git a/gtk/gtkfontchooserutils.h b/gtk/gtkfontchooserutils.h
index ac7bf18558..98d690a166 100644
--- a/gtk/gtkfontchooserutils.h
+++ b/gtk/gtkfontchooserutils.h
@@ -44,7 +44,7 @@ typedef enum {
} GtkFontChooserProp;
void _gtk_font_chooser_install_properties (GObjectClass *klass);
-void _gtk_font_chooser_delegate_iface_init (GtkFontChooserIface *iface);
+void _gtk_font_chooser_delegate_iface_init (GtkFontChooserInterface *iface);
void _gtk_font_chooser_set_delegate (GtkFontChooser *receiver,
GtkFontChooser *delegate);
diff --git a/gtk/gtkfontchooserwidget.c b/gtk/gtkfontchooserwidget.c
index be77f9bf5d..0e9f47b530 100644
--- a/gtk/gtkfontchooserwidget.c
+++ b/gtk/gtkfontchooserwidget.c
@@ -221,7 +221,7 @@ static void selection_changed (GtkTreeSelection *selection,
GtkFontChooserWidget *fontchooser);
static void update_font_features (GtkFontChooserWidget *fontchooser);
-static void gtk_font_chooser_widget_iface_init (GtkFontChooserIface *iface);
+static void gtk_font_chooser_widget_iface_init (GtkFontChooserInterface *iface);
G_DEFINE_TYPE_WITH_CODE (GtkFontChooserWidget, gtk_font_chooser_widget, GTK_TYPE_WIDGET,
G_ADD_PRIVATE (GtkFontChooserWidget)
@@ -2524,7 +2524,7 @@ gtk_font_chooser_widget_set_language (GtkFontChooserWidget *fontchooser,
}
static void
-gtk_font_chooser_widget_iface_init (GtkFontChooserIface *iface)
+gtk_font_chooser_widget_iface_init (GtkFontChooserInterface *iface)
{
iface->get_font_family = gtk_font_chooser_widget_get_family;
iface->get_font_face = gtk_font_chooser_widget_get_face;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]