Commit 1b818f2e authored by Christian Persch's avatar Christian Persch

Remove GtkFontChooser:[sg]et_font

Now that the setter doesn't return a value anymore, we can just use
g_object_[sg]et instead of having these vfuncs.
parent 0b7db688
......@@ -193,23 +193,6 @@ gtk_font_button_set_show_preview_entry (GtkFontButton *font_button,
priv->show_preview_entry = show != FALSE;
}
static gchar *
gtk_font_button_font_chooser_get_font (GtkFontChooser *chooser)
{
GtkFontButton *font_button = GTK_FONT_BUTTON (chooser);
return g_strdup (gtk_font_button_get_font_name (font_button));
}
static void
gtk_font_button_font_chooser_set_font (GtkFontChooser *chooser,
const gchar *fontname)
{
GtkFontButton *font_button = GTK_FONT_BUTTON (chooser);
gtk_font_button_set_font_name (font_button, fontname);
}
static PangoFontFamily *
gtk_font_button_font_chooser_get_font_family (GtkFontChooser *chooser)
{
......@@ -275,8 +258,6 @@ gtk_font_button_font_chooser_notify (GObject *object,
static void
gtk_font_button_font_chooser_iface_init (GtkFontChooserIface *iface)
{
iface->get_font = gtk_font_button_font_chooser_get_font;
iface->set_font = gtk_font_button_font_chooser_set_font;
iface->get_font_family = gtk_font_button_font_chooser_get_font_family;
iface->get_font_face = gtk_font_button_font_chooser_get_font_face;
iface->get_font_size = gtk_font_button_font_chooser_get_font_size;
......
......@@ -186,9 +186,14 @@ gtk_font_chooser_get_size (GtkFontChooser *fontchooser)
gchar *
gtk_font_chooser_get_font (GtkFontChooser *fontchooser)
{
gchar *fontname;
g_return_val_if_fail (GTK_IS_FONT_CHOOSER (fontchooser), NULL);
return GTK_FONT_CHOOSER_GET_IFACE (fontchooser)->get_font (fontchooser);
g_object_get (fontchooser, "font", &fontname, NULL);
return fontname;
}
/**
......@@ -207,8 +212,7 @@ gtk_font_chooser_set_font (GtkFontChooser *fontchooser,
g_return_if_fail (GTK_IS_FONT_CHOOSER (fontchooser));
g_return_if_fail (fontname != NULL);
GTK_FONT_CHOOSER_GET_IFACE (fontchooser)->set_font (fontchooser,
fontname);
g_object_set (fontchooser, "font", fontname, NULL);
}
/**
......
......@@ -59,12 +59,10 @@ struct _GtkFontChooserIface
GTypeInterface base_iface;
/* Methods */
gchar * (* get_font) (GtkFontChooser *chooser);
void (* set_font) (GtkFontChooser *chooser,
const gchar *fontname);
PangoFontFamily * (* get_font_family) (GtkFontChooser *chooser);
PangoFontFace * (* get_font_face) (GtkFontChooser *chooser);
gint (* get_font_size) (GtkFontChooser *chooser);
void (* set_filter_func) (GtkFontChooser *chooser,
GtkFontFilterFunc filter,
gpointer data,
......
......@@ -35,19 +35,6 @@ get_delegate (GtkFontChooser *receiver)
GTK_FONT_CHOOSER_DELEGATE_QUARK);
}
static gchar *
delegate_get_font (GtkFontChooser *chooser)
{
return gtk_font_chooser_get_font (get_delegate (chooser));
}
static void
delegate_set_font (GtkFontChooser *chooser,
const gchar *fontname)
{
gtk_font_chooser_set_font (get_delegate (chooser), fontname);
}
static PangoFontFamily *
delegate_get_font_family (GtkFontChooser *chooser)
{
......@@ -149,8 +136,6 @@ _gtk_font_chooser_install_properties (GObjectClass *klass)
void
_gtk_font_chooser_delegate_iface_init (GtkFontChooserIface *iface)
{
iface->get_font = delegate_get_font;
iface->set_font = delegate_set_font;
iface->get_font_family = delegate_get_font_family;
iface->get_font_face = delegate_get_font_face;
iface->get_font_size = delegate_get_font_size;
......
......@@ -1187,8 +1187,6 @@ gtk_font_chooser_widget_set_filter_func (GtkFontChooser *chooser,
static void
gtk_font_chooser_widget_iface_init (GtkFontChooserIface *iface)
{
iface->get_font = gtk_font_chooser_widget_get_font;
iface->set_font = gtk_font_chooser_widget_set_font;
iface->get_font_family = gtk_font_chooser_widget_get_family;
iface->get_font_face = gtk_font_chooser_widget_get_face;
iface->get_font_size = gtk_font_chooser_widget_get_size;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment