From: Emmanuel Rodriguez Date: Mon, 11 May 2009 20:07:52 +0000 (+0200) Subject: champlain_marker_set_font_name() resets the font when NULL is used. X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c60c4551c441c5cd9505bd629467166f121cffcf;p=libchamplain champlain_marker_set_font_name() resets the font when NULL is used. - Fix the documentation for the function (wrong name). - Update the documentation for champlain_marker_set_image(). --- diff --git a/champlain/champlain-marker.c b/champlain/champlain-marker.c index e8a17b5..26b84c8 100644 --- a/champlain/champlain-marker.c +++ b/champlain/champlain-marker.c @@ -53,6 +53,8 @@ #include #include +#define DEFAULT_FONT_NAME "Sans 11" + static ClutterColor DEFAULT_COLOR = {0x33, 0x33, 0x33, 0xff}; static ClutterColor DEFAULT_TEXT_COLOR = {0xee, 0xee, 0xee, 0xff}; @@ -664,7 +666,7 @@ champlain_marker_init (ChamplainMarker *marker) priv->attributes = NULL; priv->color = clutter_color_copy (&DEFAULT_COLOR); priv->text_color = clutter_color_copy (&DEFAULT_TEXT_COLOR); - priv->font_name = g_strdup ("Sans 11"); + priv->font_name = g_strdup (DEFAULT_FONT_NAME); priv->wrap = FALSE; priv->wrap_mode = PANGO_WRAP_WORD; priv->single_line_mode = TRUE; @@ -818,8 +820,8 @@ champlain_marker_set_text (ChamplainMarker *marker, /** * champlain_marker_set_image: - * @marker: The marker - * @image: The image as a @ClutterActor + * @marker: The marker. + * @image: The image as a @ClutterActor or NULL to remove the current image. * * Sets the marker's image. * @@ -951,9 +953,10 @@ champlain_marker_set_text_color (ChamplainMarker *marker, } /** - * champlain_marker_set_text_color: + * champlain_marker_set_font_name: * @marker: The marker - * @font_name: The marker's font name. + * @font_name: The marker's font name or NULL to reset the font to the default + * value. * * Set the marker's font name such as "Sans 12". * @@ -970,6 +973,9 @@ champlain_marker_set_font_name (ChamplainMarker *marker, if (priv->font_name != NULL) g_free (priv->font_name); + if (font_name == NULL) + font_name = DEFAULT_FONT_NAME; + priv->font_name = g_strdup (font_name); g_object_notify (G_OBJECT (marker), "font-name"); queue_redraw (marker);