diff options
author | Christian Persch <chpe@gnome.org> | 2011-09-05 13:26:49 +0200 |
---|---|---|
committer | Christian Persch <chpe@gnome.org> | 2011-09-13 12:55:21 +0200 |
commit | eb9efc9fd2f23217cb4f1053737d27c8b0e22f6a (patch) | |
tree | 6fe1a48522a6edf94f85c4012c4fa2bbc2088aaf /gtk | |
parent | 5452525143ce10628080ceabf19cb1f68d5708a9 (diff) | |
download | gtk+-eb9efc9fd2f23217cb4f1053737d27c8b0e22f6a.tar.gz |
Rename GtkFontChooser:font-name to :font
GtkFontButton already has a property named "font-name" which may
conflict / be an ABI break when moving GtkFontButton to implement
GtkFontChooser. Also, this is more in line with how other parts in
gtk (e.g. GtkCellRendererText) call a font string property.
Diffstat (limited to 'gtk')
-rw-r--r-- | gtk/gtk.symbols | 6 | ||||
-rw-r--r-- | gtk/gtkfontbutton.c | 8 | ||||
-rw-r--r-- | gtk/gtkfontchooser.c | 20 | ||||
-rw-r--r-- | gtk/gtkfontchooser.h | 8 | ||||
-rw-r--r-- | gtk/gtkfontchooserutils.c | 16 | ||||
-rw-r--r-- | gtk/gtkfontchooserutils.h | 2 | ||||
-rw-r--r-- | gtk/gtkfontchooserwidget.c | 36 |
7 files changed, 47 insertions, 49 deletions
diff --git a/gtk/gtk.symbols b/gtk/gtk.symbols index 0be971c562..217e295b5b 100644 --- a/gtk/gtk.symbols +++ b/gtk/gtk.symbols @@ -1049,17 +1049,15 @@ gtk_font_button_set_use_font gtk_font_button_set_use_size gtk_font_chooser_dialog_get_type gtk_font_chooser_dialog_new -gtk_font_chooser_dialog_set_font_name -gtk_font_chooser_dialog_set_preview_text gtk_font_chooser_get_face gtk_font_chooser_get_family -gtk_font_chooser_get_font_name +gtk_font_chooser_get_font gtk_font_chooser_get_preview_text gtk_font_chooser_get_show_preview_entry gtk_font_chooser_get_size gtk_font_chooser_get_type gtk_font_chooser_set_filter_func -gtk_font_chooser_set_font_name +gtk_font_chooser_set_font gtk_font_chooser_set_preview_text gtk_font_chooser_set_show_preview_entry gtk_font_chooser_widget_get_type diff --git a/gtk/gtkfontbutton.c b/gtk/gtkfontbutton.c index 67a9ef3363..05a5ee41d3 100644 --- a/gtk/gtkfontbutton.c +++ b/gtk/gtkfontbutton.c @@ -690,8 +690,8 @@ gtk_font_button_set_font_name (GtkFontButton *font_button, gtk_font_button_update_font_info (font_button); if (font_button->priv->font_dialog) - result = gtk_font_chooser_set_font_name (GTK_FONT_CHOOSER (font_button->priv->font_dialog), - font_button->priv->fontname); + result = gtk_font_chooser_set_font (GTK_FONT_CHOOSER (font_button->priv->font_dialog), + font_button->priv->fontname); else result = FALSE; @@ -736,7 +736,7 @@ gtk_font_button_clicked (GtkButton *button) if (!gtk_widget_get_visible (font_button->priv->font_dialog)) { font_dialog = GTK_FONT_CHOOSER (font_button->priv->font_dialog); - gtk_font_chooser_set_font_name (font_dialog, font_button->priv->fontname); + gtk_font_chooser_set_font (font_dialog, font_button->priv->fontname); } gtk_window_present (GTK_WINDOW (font_button->priv->font_dialog)); @@ -755,7 +755,7 @@ response_cb (GtkDialog *dialog, return; g_free (font_button->priv->fontname); - font_button->priv->fontname = gtk_font_chooser_get_font_name (GTK_FONT_CHOOSER (font_button->priv->font_dialog)); + font_button->priv->fontname = gtk_font_chooser_get_font (GTK_FONT_CHOOSER (font_button->priv->font_dialog)); /* Set label font */ gtk_font_button_update_font_info (font_button); diff --git a/gtk/gtkfontchooser.c b/gtk/gtkfontchooser.c index 66944dc1a3..d041787e74 100644 --- a/gtk/gtkfontchooser.c +++ b/gtk/gtkfontchooser.c @@ -61,8 +61,8 @@ gtk_font_chooser_default_init (GtkFontChooserInterface *iface) { g_object_interface_install_property (iface, - g_param_spec_string ("font-name", - P_("Font name"), + g_param_spec_string ("font", + P_("Font"), P_("The string that represents this font"), DEFAULT_FONT_NAME, GTK_PARAM_READWRITE)); @@ -166,7 +166,7 @@ gtk_font_chooser_get_size (GtkFontChooser *fontchooser) } /** - * gtk_font_chooser_get_font_name: + * gtk_font_chooser_get_font: * @fontchooser: a #GtkFontChooser * * Gets the currently-selected font name. @@ -187,15 +187,15 @@ gtk_font_chooser_get_size (GtkFontChooser *fontchooser) * Since: 3.2 */ gchar * -gtk_font_chooser_get_font_name (GtkFontChooser *fontchooser) +gtk_font_chooser_get_font (GtkFontChooser *fontchooser) { g_return_val_if_fail (GTK_IS_FONT_CHOOSER (fontchooser), NULL); - return GTK_FONT_CHOOSER_GET_IFACE (fontchooser)->get_font_name (fontchooser); + return GTK_FONT_CHOOSER_GET_IFACE (fontchooser)->get_font (fontchooser); } /** - * gtk_font_chooser_set_font_name: + * gtk_font_chooser_set_font: * @fontchooser: a #GtkFontChooser * @fontname: a font name like "Helvetica 12" or "Times Bold 18" * @@ -208,14 +208,14 @@ gtk_font_chooser_get_font_name (GtkFontChooser *fontchooser) * Since: 3.2 */ gboolean -gtk_font_chooser_set_font_name (GtkFontChooser *fontchooser, - const gchar *fontname) +gtk_font_chooser_set_font (GtkFontChooser *fontchooser, + const gchar *fontname) { g_return_val_if_fail (GTK_IS_FONT_CHOOSER (fontchooser), FALSE); g_return_val_if_fail (fontname != NULL, FALSE); - return GTK_FONT_CHOOSER_GET_IFACE (fontchooser)->set_font_name (fontchooser, - fontname); + return GTK_FONT_CHOOSER_GET_IFACE (fontchooser)->set_font (fontchooser, + fontname); } /** diff --git a/gtk/gtkfontchooser.h b/gtk/gtkfontchooser.h index f7df871966..39c503ce48 100644 --- a/gtk/gtkfontchooser.h +++ b/gtk/gtkfontchooser.h @@ -59,8 +59,8 @@ struct _GtkFontChooserIface GTypeInterface base_iface; /* Methods */ - gchar * (* get_font_name) (GtkFontChooser *chooser); - gboolean (* set_font_name) (GtkFontChooser *chooser, + gchar * (* get_font) (GtkFontChooser *chooser); + gboolean (* set_font) (GtkFontChooser *chooser, const gchar *fontname); PangoFontFamily * (* get_font_family) (GtkFontChooser *chooser); PangoFontFace * (* get_font_face) (GtkFontChooser *chooser); @@ -83,9 +83,9 @@ GType gtk_font_chooser_get_type (void) G_GNUC_CONST; PangoFontFamily *gtk_font_chooser_get_family (GtkFontChooser *fontchooser); PangoFontFace *gtk_font_chooser_get_face (GtkFontChooser *fontchooser); gint gtk_font_chooser_get_size (GtkFontChooser *fontchooser); -gchar* gtk_font_chooser_get_font_name (GtkFontChooser *fontchooser); +gchar* gtk_font_chooser_get_font (GtkFontChooser *fontchooser); -gboolean gtk_font_chooser_set_font_name (GtkFontChooser *fontchooser, +gboolean gtk_font_chooser_set_font (GtkFontChooser *fontchooser, const gchar *font_name); gchar* gtk_font_chooser_get_preview_text (GtkFontChooser *fontchooser); void gtk_font_chooser_set_preview_text (GtkFontChooser *fontchooser, diff --git a/gtk/gtkfontchooserutils.c b/gtk/gtkfontchooserutils.c index 4dbec90922..5cef3a0747 100644 --- a/gtk/gtkfontchooserutils.c +++ b/gtk/gtkfontchooserutils.c @@ -36,16 +36,16 @@ get_delegate (GtkFontChooser *receiver) } static gchar * -delegate_get_font_name (GtkFontChooser *chooser) +delegate_get_font (GtkFontChooser *chooser) { - return gtk_font_chooser_get_font_name (get_delegate (chooser)); + return gtk_font_chooser_get_font (get_delegate (chooser)); } static gboolean -delegate_set_font_name (GtkFontChooser *chooser, +delegate_set_font (GtkFontChooser *chooser, const gchar *fontname) { - return gtk_font_chooser_set_font_name (get_delegate (chooser), fontname); + return gtk_font_chooser_set_font (get_delegate (chooser), fontname); } static PangoFontFamily * @@ -125,8 +125,8 @@ void _gtk_font_chooser_install_properties (GObjectClass *klass) { g_object_class_override_property (klass, - GTK_FONT_CHOOSER_PROP_FONT_NAME, - "font-name"); + GTK_FONT_CHOOSER_PROP_FONT, + "font"); g_object_class_override_property (klass, GTK_FONT_CHOOSER_PROP_PREVIEW_TEXT, "preview-text"); @@ -149,8 +149,8 @@ _gtk_font_chooser_install_properties (GObjectClass *klass) void _gtk_font_chooser_delegate_iface_init (GtkFontChooserIface *iface) { - iface->get_font_name = delegate_get_font_name; - iface->set_font_name = delegate_set_font_name; + 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; diff --git a/gtk/gtkfontchooserutils.h b/gtk/gtkfontchooserutils.h index 54511582e3..f574f14550 100644 --- a/gtk/gtkfontchooserutils.h +++ b/gtk/gtkfontchooserutils.h @@ -35,7 +35,7 @@ G_BEGIN_DECLS typedef enum { GTK_FONT_CHOOSER_PROP_FIRST = 0x4000, - GTK_FONT_CHOOSER_PROP_FONT_NAME, + GTK_FONT_CHOOSER_PROP_FONT, GTK_FONT_CHOOSER_PROP_PREVIEW_TEXT, GTK_FONT_CHOOSER_PROP_SHOW_PREVIEW_ENTRY, GTK_FONT_CHOOSER_PROP_LAST diff --git a/gtk/gtkfontchooserwidget.c b/gtk/gtkfontchooserwidget.c index 6d669bdd4c..fcc3672f3d 100644 --- a/gtk/gtkfontchooserwidget.c +++ b/gtk/gtkfontchooserwidget.c @@ -62,12 +62,12 @@ * selecting fonts. * * To set the font which is initially selected, use - * gtk_font_chooser_widget_set_font_name(). + * gtk_font_chooser_set_font(). * - * To get the selected font use gtk_font_chooser_widget_get_font_name(). + * To get the selected font use gtk_font_chooser_get_font(). * * To change the text which is shown in the preview area, use - * gtk_font_chooser_widget_set_preview_text(). + * gtk_font_chooser_set_preview_text(). * * Since: 3.2 */ @@ -148,8 +148,8 @@ static void gtk_font_chooser_widget_bootstrap_fontlist (GtkFontChooserWidget * static gboolean gtk_font_chooser_widget_select_font_name (GtkFontChooserWidget *fontchooser); -static gchar *gtk_font_chooser_widget_get_font_name (GtkFontChooser *chooser); -static gboolean gtk_font_chooser_widget_set_font_name (GtkFontChooser *chooser, +static gchar *gtk_font_chooser_widget_get_font (GtkFontChooser *chooser); +static gboolean gtk_font_chooser_widget_set_font (GtkFontChooser *chooser, const gchar *fontname); static const gchar *gtk_font_chooser_widget_get_preview_text (GtkFontChooserWidget *fontchooser); @@ -195,8 +195,8 @@ gtk_font_chooser_widget_set_property (GObject *object, switch (prop_id) { - case GTK_FONT_CHOOSER_PROP_FONT_NAME: - gtk_font_chooser_widget_set_font_name (GTK_FONT_CHOOSER (fontchooser), g_value_get_string (value)); + case GTK_FONT_CHOOSER_PROP_FONT: + gtk_font_chooser_widget_set_font (GTK_FONT_CHOOSER (fontchooser), g_value_get_string (value)); break; case GTK_FONT_CHOOSER_PROP_PREVIEW_TEXT: gtk_font_chooser_widget_set_preview_text (fontchooser, g_value_get_string (value)); @@ -220,8 +220,8 @@ gtk_font_chooser_widget_get_property (GObject *object, switch (prop_id) { - case GTK_FONT_CHOOSER_PROP_FONT_NAME: - g_value_take_string (value, gtk_font_chooser_widget_get_font_name (GTK_FONT_CHOOSER (fontchooser))); + case GTK_FONT_CHOOSER_PROP_FONT: + g_value_take_string (value, gtk_font_chooser_widget_get_font (GTK_FONT_CHOOSER (fontchooser))); break; case GTK_FONT_CHOOSER_PROP_PREVIEW_TEXT: g_value_set_string (value, gtk_font_chooser_widget_get_preview_text (fontchooser)); @@ -316,7 +316,7 @@ spin_change_cb (GtkAdjustment *adjustment, pango_font_description_set_size (desc, priv->size); gtk_widget_override_font (priv->preview, desc); - g_object_notify (G_OBJECT (fontchooser), "font-name"); + g_object_notify (G_OBJECT (fontchooser), "font"); /* If the new value is lower than the lower bound of the slider, we set * the slider adjustment to the lower bound value if it is not already set @@ -383,7 +383,7 @@ row_activated_cb (GtkTreeView *view, GtkFontChooser *chooser = user_data; gchar *fontname; - fontname = gtk_font_chooser_widget_get_font_name (chooser); + fontname = gtk_font_chooser_widget_get_font (chooser); _gtk_font_chooser_font_activated (chooser, fontname); g_free (fontname); } @@ -458,7 +458,7 @@ cursor_changed_cb (GtkTreeView *treeview, pango_font_description_free (desc); - g_object_notify (G_OBJECT (fontchooser), "font-name"); + g_object_notify (G_OBJECT (fontchooser), "font"); } static gboolean @@ -986,7 +986,7 @@ gtk_font_chooser_widget_get_size (GtkFontChooser *chooser) } static gchar * -gtk_font_chooser_widget_get_font_name (GtkFontChooser *chooser) +gtk_font_chooser_widget_get_font (GtkFontChooser *chooser) { GtkFontChooserWidget *fontchooser = GTK_FONT_CHOOSER_WIDGET (chooser); gchar *font_name; @@ -1007,8 +1007,8 @@ gtk_font_chooser_widget_get_font_name (GtkFontChooser *chooser) } static gboolean -gtk_font_chooser_widget_set_font_name (GtkFontChooser *chooser, - const gchar *fontname) +gtk_font_chooser_widget_set_font (GtkFontChooser *chooser, + const gchar *fontname) { GtkFontChooserWidget *fontchooser = GTK_FONT_CHOOSER_WIDGET (chooser); GtkFontChooserWidgetPrivate *priv = fontchooser->priv; @@ -1021,7 +1021,7 @@ gtk_font_chooser_widget_set_font_name (GtkFontChooser *chooser, if (gtk_widget_has_screen (GTK_WIDGET (fontchooser))) found = gtk_font_chooser_widget_select_font_name (fontchooser); - g_object_notify (G_OBJECT (fontchooser), "font-name"); + g_object_notify (G_OBJECT (fontchooser), "font"); return found; } @@ -1189,8 +1189,8 @@ gtk_font_chooser_widget_set_filter_func (GtkFontChooser *chooser, static void gtk_font_chooser_widget_iface_init (GtkFontChooserIface *iface) { - iface->get_font_name = gtk_font_chooser_widget_get_font_name; - iface->set_font_name = gtk_font_chooser_widget_set_font_name; + 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; |