~ubuntu-branches/ubuntu/hardy/pango1.0/hardy-security

« back to all changes in this revision

Viewing changes to pango/pango-color.c

  • Committer: Bazaar Package Importer
  • Author(s): Loic Minier
  • Date: 2007-11-01 17:34:39 UTC
  • mfrom: (1.2.42 upstream)
  • Revision ID: james.westby@ubuntu.com-20071101173439-q1o9mzlj8fiad7cd
Tags: 1.19.0-1ubuntu1
* Sync with Debian; Ubuntu changes are:
  - Add patch 30_anymetrics, turns on FC_ANY_METRICS whenever looking up
    fonts with fontconfig; lets fontconfig's configuration know that we
    don't care about getting a font with exactly the same shape as the
    family we asked for and fixes (eg) a firefox vs. evince font metrics
    ugliness issue.

Show diffs side-by-side

added added

removed removed

Lines of Context:
42
42
 
43
43
/**
44
44
 * pango_color_copy:
45
 
 * @src: color to copy
 
45
 * @src: color to copy, may be %NULL
46
46
 *
47
47
 * Creates a copy of @src, which should be freed with
48
48
 * pango_color_free(). Primarily used by language bindings,
50
50
 * by assignment in C).
51
51
 *
52
52
 * Return value: the newly allocated #PangoColor, which should
53
 
 *               be freed with pango_color_free().
 
53
 *               be freed with pango_color_free(), or %NULL
 
54
 *               if @src was %NULL.
54
55
 **/
55
56
PangoColor*
56
57
pango_color_copy (const PangoColor *src)
57
58
{
58
59
  PangoColor *ret;
59
60
 
60
 
  g_return_val_if_fail (src != NULL, NULL);
 
61
  if (src == NULL)
 
62
    return NULL;
61
63
 
62
64
  ret = g_slice_new (PangoColor);
63
65
 
68
70
 
69
71
/**
70
72
 * pango_color_free:
71
 
 * @color: an allocated #PangoColor
 
73
 * @color: an allocated #PangoColor, may be %NULL
72
74
 *
73
75
 * Frees a color allocated by pango_color_copy().
74
76
 **/
75
77
void
76
78
pango_color_free (PangoColor *color)
77
79
{
78
 
  g_return_if_fail (color != NULL);
 
80
  if (color == NULL)
 
81
    return;
79
82
 
80
83
  g_slice_free (PangoColor, color);
81
84
}