gucharmap r1754 - trunk/gucharmap
- From: chpe svn gnome org
- To: svn-commits-list gnome org
- Subject: gucharmap r1754 - trunk/gucharmap
- Date: Mon, 31 Mar 2008 12:43:17 +0100 (BST)
Author: chpe
Date: Mon Mar 31 12:43:16 2008
New Revision: 1754
URL: http://svn.gnome.org/viewvc/gucharmap?rev=1754&view=rev
Log:
Add gucharmap_chartable_get_font_desc(). Remove gucharmap_chartable_set_font().
Modified:
trunk/gucharmap/gucharmap-chartable.c
trunk/gucharmap/gucharmap-chartable.h
Modified: trunk/gucharmap/gucharmap-chartable.c
==============================================================================
--- trunk/gucharmap/gucharmap-chartable.c (original)
+++ trunk/gucharmap/gucharmap-chartable.c Mon Mar 31 12:43:16 2008
@@ -2034,7 +2034,7 @@
g_value_set_object (value, gucharmap_chartable_get_codepoint_list (chartable));
break;
case PROP_FONT_DESC:
- g_value_set_boxed (value, priv->font_desc);
+ g_value_set_boxed (value, gucharmap_chartable_get_font_desc (chartable));
break;
case PROP_SNAP_POW2:
g_value_set_boolean (value, priv->snap_pow2_enabled);
@@ -2369,35 +2369,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_chartable_set_font (GucharmapChartable *chartable, const char *font_name)
-{
- GucharmapChartablePrivate *priv;
- PangoFontDescription *font_desc;
-
- g_return_if_fail (GUCHARMAP_IS_CHARTABLE (chartable));
- g_return_if_fail (font_name != NULL);
-
- priv = chartable->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_chartable_set_font_desc (chartable, font_desc /* adopting */);
-}
-
-/**
* gucharmap_chartable_set_font_desc:
* @chartable: a #GucharmapChartable
* @font_desc: a #PangoFontDescription
@@ -2424,6 +2395,21 @@
}
/**
+ * gucharmap_chartable_get_font_desc:
+ * @chartable: a #GucharmapChartable
+ *
+ * Returns: the #PangoFontDescription used to display the character table.
+ * The returned object is owned by @chartable and must not be modified or freed.
+ */
+PangoFontDescription *
+gucharmap_chartable_get_font_desc (GucharmapChartable *chartable)
+{
+ g_return_val_if_fail (GUCHARMAP_IS_CHARTABLE (chartable), NULL);
+
+ return chartable->priv->font_desc;
+}
+
+/**
* gucharmap_chartable_get_active_character:
* @chartable: a #GucharmapChartable
*
Modified: trunk/gucharmap/gucharmap-chartable.h
==============================================================================
--- trunk/gucharmap/gucharmap-chartable.h (original)
+++ trunk/gucharmap/gucharmap-chartable.h Mon Mar 31 12:43:16 2008
@@ -69,10 +69,9 @@
GType gucharmap_chartable_get_type (void);
GtkWidget * gucharmap_chartable_new (void);
-void gucharmap_chartable_set_font (GucharmapChartable *chartable,
- const gchar *font_name);
-void gucharmap_chartable_set_font_desc (GucharmapChartable *chartable,
+void gucharmap_chartable_set_font_desc (GucharmapChartable *chartable,
PangoFontDescription *font_desc);
+PangoFontDescription * gucharmap_chartable_get_font_desc (GucharmapChartable *chartable);
gunichar gucharmap_chartable_get_active_character (GucharmapChartable *chartable);
void gucharmap_chartable_set_active_character (GucharmapChartable *chartable,
gunichar uc);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]