summaryrefslogtreecommitdiff
path: root/gtk/gtkfontchooser.c
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2015-06-12 23:55:30 -0400
committerMatthias Clasen <mclasen@redhat.com>2015-06-13 00:00:51 -0400
commit6f955a7df67222b6ee4b2502eb5e1428f9c91d20 (patch)
treec7ede1be96862e105dde7a169f1b0e03c00a0cd0 /gtk/gtkfontchooser.c
parent8c6130e68a6e62980251cb19a0fbcd50505700f1 (diff)
downloadgtk+-6f955a7df67222b6ee4b2502eb5e1428f9c91d20.tar.gz
Redo font map support in GtkFontChooser
We can't add properties to the interface, since it breaks 3rd party implementations of the GtkFontChooser interface. These exist, for example in gnumeric. So, instead of a new property, add getter/setter vfuncs.
Diffstat (limited to 'gtk/gtkfontchooser.c')
-rw-r--r--gtk/gtkfontchooser.c20
1 files changed, 5 insertions, 15 deletions
diff --git a/gtk/gtkfontchooser.c b/gtk/gtkfontchooser.c
index d295ce042c..e2ed3a0188 100644
--- a/gtk/gtkfontchooser.c
+++ b/gtk/gtkfontchooser.c
@@ -106,18 +106,6 @@ gtk_font_chooser_default_init (GtkFontChooserInterface *iface)
GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY));
/**
- * GtkFontChooser:font-map:
- *
- * A custom font map to use for this widget, instead of the
- * default one.
- *
- * Since: 3.18
- */
- g_object_interface_install_property (iface,
- g_param_spec_object ("font-map", P_("Font map"), P_("A custom PangoFontMap"),
- PANGO_TYPE_FONT_MAP,
- GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY));
- /**
* GtkFontChooser::font-activated:
* @self: the object which received the signal
* @fontname: the font name
@@ -466,7 +454,8 @@ gtk_font_chooser_set_font_map (GtkFontChooser *fontchooser,
g_return_if_fail (GTK_IS_FONT_CHOOSER (fontchooser));
g_return_if_fail (fontmap == NULL || PANGO_IS_FONT_MAP (fontmap));
- g_object_set (fontchooser, "font-map", fontmap, NULL);
+ if (GTK_FONT_CHOOSER_GET_IFACE (fontchooser)->set_font_map)
+ GTK_FONT_CHOOSER_GET_IFACE (fontchooser)->set_font_map (fontchooser, fontmap);
}
/**
@@ -483,11 +472,12 @@ gtk_font_chooser_set_font_map (GtkFontChooser *fontchooser,
PangoFontMap *
gtk_font_chooser_get_font_map (GtkFontChooser *fontchooser)
{
- PangoFontMap *fontmap;
+ PangoFontMap *fontmap = NULL;
g_return_val_if_fail (GTK_IS_FONT_CHOOSER (fontchooser), NULL);
- g_object_get (fontchooser, "font-map", &fontmap, NULL);
+ if (GTK_FONT_CHOOSER_GET_IFACE (fontchooser)->get_font_map)
+ fontmap = GTK_FONT_CHOOSER_GET_IFACE (fontchooser)->get_font_map (fontchooser);
return fontmap;
}