gucharmap r1753 - trunk/gucharmap



Author: chpe
Date: Mon Mar 31 12:43:06 2008
New Revision: 1753
URL: http://svn.gnome.org/viewvc/gucharmap?rev=1753&view=rev

Log:
Add gucharmap_charmap_get_font_desc(), and remove gucharmap_charmap_set_font().


Modified:
   trunk/gucharmap/gucharmap-charmap.c
   trunk/gucharmap/gucharmap-charmap.h

Modified: trunk/gucharmap/gucharmap-charmap.c
==============================================================================
--- trunk/gucharmap/gucharmap-charmap.c	(original)
+++ trunk/gucharmap/gucharmap-charmap.c	Mon Mar 31 12:43:06 2008
@@ -104,7 +104,7 @@
       g_value_set_uint (value, gucharmap_charmap_get_active_character (charmap));
       break;
     case PROP_FONT_DESC:
-      g_value_set_boxed (value, priv->font_desc);
+      g_value_set_boxed (value, gucharmap_charmap_get_font_desc (charmap));
       break;
     default:
       G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
@@ -1063,36 +1063,6 @@
 }
 
 /**
- * gucharmap_chartable_set_font:
- * @chartable: a #GucharmapChartable
- * @font_name:
- *
- * Sets @font_name as the font to use to display the character table.
- */
-void
-gucharmap_charmap_set_font (GucharmapCharmap *charmap, 
-                            const gchar *font_name)
-{
-  GucharmapCharmapPrivate *priv;
-  PangoFontDescription *font_desc;
-
-  g_return_if_fail (GUCHARMAP_IS_CHARMAP (charmap));
-  g_return_if_fail (font_name != NULL);
-
-  priv = charmap->priv;
-
-  font_desc = pango_font_description_from_string (font_name);
-  if (priv->font_desc &&
-      pango_font_description_equal (font_desc, priv->font_desc))
-    {
-      pango_font_description_free (font_desc);
-      return;
-    }
-
-  gucharmap_charmap_set_font_desc_internal (charmap, font_desc /* adopting */);
-}
-
-/**
  * gucharmap_chartable_set_font_desc:
  * @chartable: a #GucharmapChartable
  * @font_desc: a #PangoFontDescription
@@ -1117,6 +1087,21 @@
                                             pango_font_description_copy (font_desc));
 }
 
+/**
+ * gucharmap_charmap_get_font_desc:
+ * @charmap: a #GucharmapCharmap
+ *
+ * Returns: the #PangoFontDescription used to display the character table.
+ *   The returned object is owned by @charmap and must not be modified or freed.
+ */
+PangoFontDescription *
+gucharmap_charmap_get_font_desc (GucharmapCharmap *charmap)
+{
+  g_return_val_if_fail (GUCHARMAP_IS_CHARMAP (charmap), NULL);
+
+  return charmap->priv->font_desc;
+}
+
 void
 gucharmap_charmap_set_active_character (GucharmapCharmap *charmap,
                                         gunichar          wc)

Modified: trunk/gucharmap/gucharmap-charmap.h
==============================================================================
--- trunk/gucharmap/gucharmap-charmap.h	(original)
+++ trunk/gucharmap/gucharmap-charmap.h	Mon Mar 31 12:43:06 2008
@@ -76,12 +76,11 @@
                                                 const gchar *chapter);
 char *    gucharmap_charmap_get_active_chapter (GucharmapCharmap *charmap);
 
-void                     gucharmap_charmap_set_font           (GucharmapCharmap  *charmap,
-                                                               const gchar       *font_name);
-
 void                     gucharmap_charmap_set_font_desc      (GucharmapCharmap  *charmap,
                                                                PangoFontDescription *font_desc);
 
+PangoFontDescription *   gucharmap_charmap_get_font_desc      (GucharmapCharmap  *charmap);
+
 GucharmapChartable *     gucharmap_charmap_get_chartable      (GucharmapCharmap  *charmap);
 
 GucharmapChaptersView *  gucharmap_charmap_get_chapters_view  (GucharmapCharmap       *charmap);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]