]> Pileus Git - ~andy/gtk/commitdiff
Rename GtkFontChooser:font-name to :font
authorChristian Persch <chpe@gnome.org>
Mon, 5 Sep 2011 11:26:49 +0000 (13:26 +0200)
committerChristian Persch <chpe@gnome.org>
Tue, 13 Sep 2011 10:55:21 +0000 (12:55 +0200)
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.

docs/reference/gtk/gtk3-sections.txt
gtk/gtk.symbols
gtk/gtkfontbutton.c
gtk/gtkfontchooser.c
gtk/gtkfontchooser.h
gtk/gtkfontchooserutils.c
gtk/gtkfontchooserutils.h
gtk/gtkfontchooserwidget.c
tests/testfontchooser.c

index 6507540af59bd82285e32935d77b949ee36379b7..e8ab675702649911391c6c794f74b8564b2d9906 100644 (file)
@@ -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
index 0be971c562640dfaa63652175608e853d9f8edff..217e295b5b8148f01c4e6c53cd600b072840c174 100644 (file)
@@ -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
index 67a9ef33633730532429b803f78b58cf8ecbd3e8..05a5ee41d31709c419ecb9e99b58878671f3a382 100644 (file)
@@ -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);
index 66944dc1a3f7013c247e08a1c4b71bd001a53eba..d041787e748a3c7404cf5a825c920faca7cd335a 100644 (file)
@@ -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);
 }
 
 /**
index f7df8719665fbf3d5085deee29c0987fde663a04..39c503ce48811b7a9952033f4de6d0115aeb2200 100644 (file)
@@ -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,
index 4dbec9092292418bd16be95ead49f15bc15b65f8..5cef3a0747e25ec8a9230119bbf1a23795bdd32b 100644 (file)
@@ -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;
index 54511582e3abf9e013162a291300acd8a6dc103b..f574f14550d6f39876abdb703b61146555644a20 100644 (file)
@@ -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
index 6d669bdd4cf0a69ef8541bb833a2b4c1a8ce7550..fcc3672f3da4e207968f0feb0737d10c9d43126e 100644 (file)
  * 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;
index e92815ce65510a87214dfdb46c2d18f279d38e09..4c6f42c4a8f92ceac24be4b7adc528ead25454d4 100644 (file)
@@ -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);