summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Persch <chpe@gnome.org>2011-09-05 13:26:49 +0200
committerChristian Persch <chpe@gnome.org>2011-09-13 12:55:21 +0200
commiteb9efc9fd2f23217cb4f1053737d27c8b0e22f6a (patch)
tree6fe1a48522a6edf94f85c4012c4fa2bbc2088aaf
parent5452525143ce10628080ceabf19cb1f68d5708a9 (diff)
downloadgtk+-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.
-rw-r--r--docs/reference/gtk/gtk3-sections.txt4
-rw-r--r--gtk/gtk.symbols6
-rw-r--r--gtk/gtkfontbutton.c8
-rw-r--r--gtk/gtkfontchooser.c20
-rw-r--r--gtk/gtkfontchooser.h8
-rw-r--r--gtk/gtkfontchooserutils.c16
-rw-r--r--gtk/gtkfontchooserutils.h2
-rw-r--r--gtk/gtkfontchooserwidget.c36
-rw-r--r--tests/testfontchooser.c4
9 files changed, 51 insertions, 53 deletions
diff --git a/docs/reference/gtk/gtk3-sections.txt b/docs/reference/gtk/gtk3-sections.txt
index 6507540af5..e8ab675702 100644
--- a/docs/reference/gtk/gtk3-sections.txt
+++ b/docs/reference/gtk/gtk3-sections.txt
@@ -1483,8 +1483,8 @@ GtkFontChooser
gtk_font_chooser_get_family
gtk_font_chooser_get_face
gtk_font_chooser_get_size
-gtk_font_chooser_get_font_name
-gtk_font_chooser_set_font_name
+gtk_font_chooser_get_font
+gtk_font_chooser_set_font
gtk_font_chooser_get_preview_text
gtk_font_chooser_set_preview_text
gtk_font_chooser_get_show_preview_entry
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;
diff --git a/tests/testfontchooser.c b/tests/testfontchooser.c
index e92815ce65..4c6f42c4a8 100644
--- a/tests/testfontchooser.c
+++ b/tests/testfontchooser.c
@@ -22,7 +22,7 @@
static void
notify_font_name_cb (GObject *fontchooser, GParamSpec *pspec, gpointer data)
{
- g_debug ("Changed font name %s", gtk_font_chooser_get_font_name (GTK_FONT_CHOOSER (fontchooser)));
+ g_debug ("Changed font name %s", gtk_font_chooser_get_font (GTK_FONT_CHOOSER (fontchooser)));
}
static void
@@ -57,7 +57,7 @@ main (int argc, char *argv[])
g_signal_connect (fontchooser, "notify::preview-text",
G_CALLBACK (notify_preview_text_cb), NULL);
- gtk_font_chooser_set_font_name (GTK_FONT_CHOOSER (fontchooser), "Bitstream Vera Sans 45");
+ gtk_font_chooser_set_font (GTK_FONT_CHOOSER (fontchooser), "Bitstream Vera Sans 45");
gtk_font_chooser_set_preview_text (GTK_FONT_CHOOSER (fontchooser), "[user@host ~]$ &>>");
gtk_font_chooser_set_show_preview_entry (GTK_FONT_CHOOSER (fontchooser), FALSE);