~ubuntu-branches/ubuntu/trusty/pango1.0/trusty-proposed

« back to all changes in this revision

Viewing changes to pango/pangofc-fontmap.c

  • Committer: Package Import Robot
  • Author(s): Michael Biebl
  • Date: 2012-03-09 10:39:11 UTC
  • mfrom: (1.6.4) (63.3.30 sid)
  • Revision ID: package-import@ubuntu.com-20120309103911-0jpxqwnix351v3se
Tags: 1.29.5-1
* New upstream release.
  - Fix GI annotation syntax. Closes: #640855
* debian/control.in: Bump Build-Depends on libglib2.0-dev to (>= 2.31.0).
* debian/patches/00git_transfer_annotations.patch: Removed, merged upstream.
* Set pkg-gnome-maintainers@lists.alioth.debian.org as Maintainer.

Show diffs side-by-side

added added

removed removed

Lines of Context:
790
790
 */
791
791
 
792
792
static void              pango_fc_fontset_finalize     (GObject                 *object);
793
 
static void              pango_fc_fontset_init         (PangoFcFontset      *fontset);
794
793
static PangoLanguage *   pango_fc_fontset_get_language (PangoFontset            *fontset);
795
794
static  PangoFont *      pango_fc_fontset_get_font     (PangoFontset            *fontset,
796
795
                                                        guint                    wc);
814
813
};
815
814
 
816
815
typedef PangoFontsetClass PangoFcFontsetClass;
817
 
 
818
 
static PangoFontsetClass *fc_fontset_parent_class;      /* Parent class structure for PangoFcFontset */
 
816
G_DEFINE_TYPE (PangoFcFontset, pango_fc_fontset, PANGO_TYPE_FONTSET);
819
817
 
820
818
static PangoFcFontset *
821
819
pango_fc_fontset_new (PangoFcFontsetKey *key,
892
890
  GObjectClass *object_class = G_OBJECT_CLASS (class);
893
891
  PangoFontsetClass *fontset_class = PANGO_FONTSET_CLASS (class);
894
892
 
895
 
  fc_fontset_parent_class = g_type_class_peek_parent (class);
896
 
 
897
893
  object_class->finalize = pango_fc_fontset_finalize;
 
894
 
898
895
  fontset_class->get_font = pango_fc_fontset_get_font;
899
896
  fontset_class->get_language = pango_fc_fontset_get_language;
900
897
  fontset_class->foreach = pango_fc_fontset_foreach;
935
932
  if (fontset->patterns)
936
933
    pango_fc_patterns_unref (fontset->patterns);
937
934
 
938
 
  G_OBJECT_CLASS (fc_fontset_parent_class)->finalize (object);
 
935
  G_OBJECT_CLASS (pango_fc_fontset_parent_class)->finalize (object);
939
936
}
940
937
 
941
938
static PangoLanguage *
959
956
  unsigned int i;
960
957
 
961
958
  for (i = 0;
962
 
       (font = pango_fc_fontset_get_font_at (fcfontset, i));
 
959
       pango_fc_fontset_get_font_at (fcfontset, i);
963
960
       i++)
964
961
    {
965
962
      coverage = g_ptr_array_index (fcfontset->coverages, i);
1008
1005
    }
1009
1006
}
1010
1007
 
1011
 
static PANGO_DEFINE_TYPE (PangoFcFontset, pango_fc_fontset,
1012
 
                          pango_fc_fontset_class_init, pango_fc_fontset_init,
1013
 
                          PANGO_TYPE_FONTSET)
1014
1008
 
1015
1009
/*
1016
1010
 * PangoFcFontMap
1125
1119
 * characters to glyphs.  This will allow applications to have
1126
1120
 * application-specific encodings for various fonts.
1127
1121
 *
1128
 
 * Since: 1.6.
 
1122
 * Since: 1.6
1129
1123
 **/
1130
1124
void
1131
1125
pango_fc_font_map_add_decoder_find_func (PangoFcFontMap        *fcfontmap,
1160
1154
 * Returns: a newly created #PangoFcDecoder object or %NULL if
1161
1155
 *          no decoder is set for @pattern.
1162
1156
 *
1163
 
 * Since: 1.26.
 
1157
 * Since: 1.26
1164
1158
 **/
1165
1159
PangoFcDecoder *
1166
1160
pango_fc_font_map_find_decoder  (PangoFcFontMap *fcfontmap,
1760
1754
 
1761
1755
/**
1762
1756
 * pango_fc_font_map_cache_clear:
1763
 
 * @fcfontmap: a #PangoFcFontmap
 
1757
 * @fcfontmap: a #PangoFcFontMap
1764
1758
 *
1765
1759
 * Clear all cached information and fontsets for this font map;
1766
1760
 * this should be called whenever there is a change in the
1833
1827
_pango_fc_font_map_get_cmap_cache (PangoFcFontMap *fcfontmap,
1834
1828
                                   PangoFcFont    *fcfont)
1835
1829
{
1836
 
  PangoFcFontMapPrivate *priv;
1837
1830
  PangoFcFontFaceData *data;
1838
1831
 
1839
1832
  if (G_UNLIKELY (fcfontmap == NULL))
1842
1835
  if (G_UNLIKELY (!fcfont->font_pattern))
1843
1836
    return NULL;
1844
1837
 
1845
 
  priv = fcfontmap->priv;
1846
 
 
1847
1838
  data = pango_fc_font_map_get_font_face_data (fcfontmap, fcfont->font_pattern);
1848
1839
  if (G_UNLIKELY (!data))
1849
1840
    return NULL;
1952
1943
 * @fcfontmap: a #PangoFcFontMap
1953
1944
 *
1954
1945
 * Creates a new context for this fontmap. This function is intended
1955
 
 * only for backend implementations deriving from #PangoFcFontmap;
 
1946
 * only for backend implementations deriving from #PangoFcFontMap;
1956
1947
 * it is possible that a backend will store additional information
1957
1948
 * needed for correct operation on the #PangoContext after calling
1958
1949
 * this function.
1984
1975
 
1985
1976
/**
1986
1977
 * pango_fc_font_map_shutdown:
1987
 
 * @fcfontmap: a #PangoFcFontmap
 
1978
 * @fcfontmap: a #PangoFcFontMap
1988
1979
 *
1989
1980
 * Clears all cached information for the fontmap and marks
1990
1981
 * all fonts open for the fontmap as dead. (See the shutdown()
1991
1982
 * virtual function of #PangoFcFont.) This function might be used
1992
1983
 * by a backend when the underlying windowing system for the font
1993
1984
 * map exits. This function is only intended to be called
1994
 
 * only for backend implementations deriving from #PangoFcFontmap.
 
1985
 * only for backend implementations deriving from #PangoFcFontMap.
1995
1986
 *
1996
1987
 * Since: 1.4
1997
1988
 **/
2180
2171
 * PangoFcFace
2181
2172
 */
2182
2173
 
2183
 
static GObjectClass *pango_fc_face_parent_class = NULL;
 
2174
typedef PangoFontFaceClass PangoFcFaceClass;
 
2175
G_DEFINE_TYPE (PangoFcFace, pango_fc_face, PANGO_TYPE_FONT_FACE);
2184
2176
 
2185
2177
static PangoFontDescription *
2186
2178
make_alias_description (PangoFcFamily *fcfamily,
2359
2351
 
2360
2352
  g_free (fcface->style);
2361
2353
 
2362
 
  pango_fc_face_parent_class->finalize (object);
 
2354
  G_OBJECT_CLASS (pango_fc_face_parent_class)->finalize (object);
2363
2355
}
2364
2356
 
2365
 
typedef PangoFontFaceClass PangoFcFaceClass;
 
2357
static void
 
2358
pango_fc_face_init (PangoFcFace *self)
 
2359
{
 
2360
}
2366
2361
 
2367
2362
static void
2368
2363
pango_fc_face_class_init (PangoFcFaceClass *class)
2369
2364
{
2370
2365
  GObjectClass *object_class = G_OBJECT_CLASS (class);
2371
2366
 
2372
 
  pango_fc_face_parent_class = g_type_class_peek_parent (class);
2373
2367
  object_class->finalize = pango_fc_face_finalize;
2374
2368
 
2375
2369
  class->describe = pango_fc_face_describe;
2378
2372
  class->is_synthesized = pango_fc_face_is_synthesized;
2379
2373
}
2380
2374
 
2381
 
static PANGO_DEFINE_TYPE (PangoFcFace, pango_fc_face,
2382
 
                          pango_fc_face_class_init, NULL,
2383
 
                          PANGO_TYPE_FONT_FACE)
2384
2375
 
2385
2376
/*
2386
2377
 * PangoFcFamily
2387
2378
 */
2388
2379
 
2389
 
static GObjectClass *pango_fc_family_parent_class = NULL;
 
2380
typedef PangoFontFamilyClass PangoFcFamilyClass;
 
2381
G_DEFINE_TYPE (PangoFcFamily, pango_fc_family, PANGO_TYPE_FONT_FAMILY);
2390
2382
 
2391
2383
static PangoFcFace *
2392
2384
create_face (PangoFcFamily *fcfamily,
2567
2559
    }
2568
2560
  g_free (fcfamily->faces);
2569
2561
 
2570
 
  pango_fc_family_parent_class->finalize (object);
 
2562
  G_OBJECT_CLASS (pango_fc_family_parent_class)->finalize (object);
2571
2563
}
2572
2564
 
2573
 
typedef PangoFontFamilyClass PangoFcFamilyClass;
2574
 
 
2575
2565
static void
2576
2566
pango_fc_family_class_init (PangoFcFamilyClass *class)
2577
2567
{
2578
2568
  GObjectClass *object_class = G_OBJECT_CLASS (class);
2579
2569
 
2580
 
  pango_fc_family_parent_class = g_type_class_peek_parent (class);
2581
2570
  object_class->finalize = pango_fc_family_finalize;
2582
2571
 
2583
2572
  class->list_faces = pango_fc_family_list_faces;
2590
2579
{
2591
2580
  fcfamily->n_faces = -1;
2592
2581
}
2593
 
 
2594
 
static PANGO_DEFINE_TYPE (PangoFcFamily, pango_fc_family,
2595
 
                          pango_fc_family_class_init, pango_fc_family_init,
2596
 
                          PANGO_TYPE_FONT_FAMILY)