forked from AuroraMiddleware/gtk
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.
This commit is contained in:
parent
0b7db6888a
commit
1b818f2e46
@ -193,23 +193,6 @@ gtk_font_button_set_show_preview_entry (GtkFontButton *font_button,
|
|||||||
priv->show_preview_entry = show != FALSE;
|
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 *
|
static PangoFontFamily *
|
||||||
gtk_font_button_font_chooser_get_font_family (GtkFontChooser *chooser)
|
gtk_font_button_font_chooser_get_font_family (GtkFontChooser *chooser)
|
||||||
{
|
{
|
||||||
@ -275,8 +258,6 @@ gtk_font_button_font_chooser_notify (GObject *object,
|
|||||||
static void
|
static void
|
||||||
gtk_font_button_font_chooser_iface_init (GtkFontChooserIface *iface)
|
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_family = gtk_font_button_font_chooser_get_font_family;
|
||||||
iface->get_font_face = gtk_font_button_font_chooser_get_font_face;
|
iface->get_font_face = gtk_font_button_font_chooser_get_font_face;
|
||||||
iface->get_font_size = gtk_font_button_font_chooser_get_font_size;
|
iface->get_font_size = gtk_font_button_font_chooser_get_font_size;
|
||||||
|
@ -186,9 +186,14 @@ gtk_font_chooser_get_size (GtkFontChooser *fontchooser)
|
|||||||
gchar *
|
gchar *
|
||||||
gtk_font_chooser_get_font (GtkFontChooser *fontchooser)
|
gtk_font_chooser_get_font (GtkFontChooser *fontchooser)
|
||||||
{
|
{
|
||||||
|
gchar *fontname;
|
||||||
|
|
||||||
g_return_val_if_fail (GTK_IS_FONT_CHOOSER (fontchooser), NULL);
|
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 (GTK_IS_FONT_CHOOSER (fontchooser));
|
||||||
g_return_if_fail (fontname != NULL);
|
g_return_if_fail (fontname != NULL);
|
||||||
|
|
||||||
GTK_FONT_CHOOSER_GET_IFACE (fontchooser)->set_font (fontchooser,
|
g_object_set (fontchooser, "font", fontname, NULL);
|
||||||
fontname);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -59,12 +59,10 @@ struct _GtkFontChooserIface
|
|||||||
GTypeInterface base_iface;
|
GTypeInterface base_iface;
|
||||||
|
|
||||||
/* Methods */
|
/* Methods */
|
||||||
gchar * (* get_font) (GtkFontChooser *chooser);
|
|
||||||
void (* set_font) (GtkFontChooser *chooser,
|
|
||||||
const gchar *fontname);
|
|
||||||
PangoFontFamily * (* get_font_family) (GtkFontChooser *chooser);
|
PangoFontFamily * (* get_font_family) (GtkFontChooser *chooser);
|
||||||
PangoFontFace * (* get_font_face) (GtkFontChooser *chooser);
|
PangoFontFace * (* get_font_face) (GtkFontChooser *chooser);
|
||||||
gint (* get_font_size) (GtkFontChooser *chooser);
|
gint (* get_font_size) (GtkFontChooser *chooser);
|
||||||
|
|
||||||
void (* set_filter_func) (GtkFontChooser *chooser,
|
void (* set_filter_func) (GtkFontChooser *chooser,
|
||||||
GtkFontFilterFunc filter,
|
GtkFontFilterFunc filter,
|
||||||
gpointer data,
|
gpointer data,
|
||||||
|
@ -35,19 +35,6 @@ get_delegate (GtkFontChooser *receiver)
|
|||||||
GTK_FONT_CHOOSER_DELEGATE_QUARK);
|
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 *
|
static PangoFontFamily *
|
||||||
delegate_get_font_family (GtkFontChooser *chooser)
|
delegate_get_font_family (GtkFontChooser *chooser)
|
||||||
{
|
{
|
||||||
@ -149,8 +136,6 @@ _gtk_font_chooser_install_properties (GObjectClass *klass)
|
|||||||
void
|
void
|
||||||
_gtk_font_chooser_delegate_iface_init (GtkFontChooserIface *iface)
|
_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_family = delegate_get_font_family;
|
||||||
iface->get_font_face = delegate_get_font_face;
|
iface->get_font_face = delegate_get_font_face;
|
||||||
iface->get_font_size = delegate_get_font_size;
|
iface->get_font_size = delegate_get_font_size;
|
||||||
|
@ -1187,8 +1187,6 @@ gtk_font_chooser_widget_set_filter_func (GtkFontChooser *chooser,
|
|||||||
static void
|
static void
|
||||||
gtk_font_chooser_widget_iface_init (GtkFontChooserIface *iface)
|
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_family = gtk_font_chooser_widget_get_family;
|
||||||
iface->get_font_face = gtk_font_chooser_widget_get_face;
|
iface->get_font_face = gtk_font_chooser_widget_get_face;
|
||||||
iface->get_font_size = gtk_font_chooser_widget_get_size;
|
iface->get_font_size = gtk_font_chooser_widget_get_size;
|
||||||
|
Loading…
Reference in New Issue
Block a user