diff options
author | Behdad Esfahbod <behdad@behdad.org> | 2011-04-15 18:45:24 -0400 |
---|---|---|
committer | Behdad Esfahbod <behdad@behdad.org> | 2011-04-15 18:45:24 -0400 |
commit | 9ac5bce958cb2ac500148dcd80c0d2c6877f7e4c (patch) | |
tree | d2a207b07ae2cedae0ba2f4d007fa7be405b2fb7 | |
parent | dff1f2b0d6c353f0839a7a38115c69cd915f9cbd (diff) | |
parent | 08fd5cf33d875c161dd5280b92d1633469943620 (diff) | |
download | pango-9ac5bce958cb2ac500148dcd80c0d2c6877f7e4c.tar.gz |
Merge branch 'master' into harfbuzz-ng-external
Conflicts:
pango/opentype/hb-buffer-private.h
pango/opentype/hb-buffer.c
pango/opentype/hb-buffer.h
pango/opentype/hb-open-type-private.hh
pango/opentype/hb-ot-layout-gpos-private.hh
-rwxr-xr-x | autogen.sh | 38 | ||||
-rw-r--r-- | configure.in | 4 | ||||
-rw-r--r-- | docs/Makefile.am | 2 | ||||
-rw-r--r-- | git.mk | 17 | ||||
-rw-r--r-- | modules/hangul/hangul-fc.c | 7 | ||||
-rw-r--r-- | pango/Makefile.am | 13 | ||||
-rw-r--r-- | pango/fonts.c | 32 | ||||
-rw-r--r-- | pango/glyphstring.c | 15 | ||||
-rw-r--r-- | pango/pango-attributes.c | 19 | ||||
-rw-r--r-- | pango/pango-color.c | 15 | ||||
-rw-r--r-- | pango/pango-glyph-item.c | 28 | ||||
-rw-r--r-- | pango/pango-item.c | 14 | ||||
-rw-r--r-- | pango/pango-language.c | 14 | ||||
-rw-r--r-- | pango/pango-layout.c | 130 | ||||
-rw-r--r-- | pango/pango-markup.c | 6 | ||||
-rw-r--r-- | pango/pango-matrix.c | 15 | ||||
-rw-r--r-- | pango/pango-tabs.c | 14 | ||||
-rw-r--r-- | pango/pangocairo-font.c | 2 | ||||
-rw-r--r-- | pango/pangoft2-render.c | 16 |
19 files changed, 161 insertions, 240 deletions
@@ -1,24 +1,28 @@ #!/bin/sh # Run this to generate all the initial makefiles, etc. -srcdir=`dirname $0` -test -z "$srcdir" && srcdir=. +test -n "$srcdir" || srcdir=`dirname "$0"` +test -n "$srcdir" || srcdir=. -REQUIRED_AUTOMAKE_VERSION=1.9 +olddir=`pwd` +cd "$srcdir" -PKG_NAME="pango" -#REQUIRED_M4MACROS=introspection.m4 +GTKDOCIZE=`which gtkdocize` +if test -z $GTKDOCIZE; then + echo "*** No GTK-Doc found, please install it ***" + exit 1 +else + gtkdocize || exit $? +fi -(test -f $srcdir/configure.in \ - && test -f $srcdir/README \ - && test -d $srcdir/pango) || { - echo -n "**Error**: Directory "\`$srcdir\'" does not look like the" - echo " top-level $PKG_NAME directory" - exit 1 -} +AUTORECONF=`which autoreconf` +if test -z $AUTORECONF; then + echo "*** No autoreconf found, please install it ***" + exit 1 +else + ACLOCAL="aclocal $ACLOCAL_FLAGS" autoreconf --force --install || exit $? +fi -which gnome-autogen.sh || { - echo "You need to install gnome-common from the GNOME SVN" - exit 1 -} -USE_GNOME2_MACROS=1 USE_COMMON_DOC_BUILD=yes . gnome-autogen.sh + +cd "$olddir" +test -n "$NOCONFIGURE" || "$srcdir/configure" "$@" diff --git a/configure.in b/configure.in index b24c4a75..8850e743 100644 --- a/configure.in +++ b/configure.in @@ -451,7 +451,7 @@ fi # # Checks for GLib # -GLIB_REQUIRED_VERSION=2.17.3 +GLIB_REQUIRED_VERSION=2.26.0 GLIB_MODULES="glib-2.0 >= $GLIB_REQUIRED_VERSION gobject-2.0 gmodule-no-export-2.0" PKG_CHECK_MODULES(GLIB, $GLIB_MODULES, :, @@ -486,7 +486,7 @@ PKG_CHECK_MODULES(LIBTHAI, libthai >= $LIBTHAI_REQUIRED_VERSION, have_libthai=tr # Checks for GObject Introspection # -GOBJECT_INTROSPECTION_CHECK([0.6.14]) +GOBJECT_INTROSPECTION_CHECK([0.9.5]) # # Modules to build diff --git a/docs/Makefile.am b/docs/Makefile.am index 28f76263..b398e811 100644 --- a/docs/Makefile.am +++ b/docs/Makefile.am @@ -75,6 +75,8 @@ if HAVE_CAIRO GTKDOC_LIBS += $(top_builddir)/pango/libpangocairo-1.0.la endif +GTKDOC_LIBS += $(GLIB_LIBS) + # Extra options to supply to gtkdoc-mkdb MKDB_OPTIONS=--sgml-mode --output-format=xml @@ -40,7 +40,7 @@ # build dir. # # This file knows how to handle autoconf, automake, libtool, gtk-doc, -# gnome-doc-utils, intltool. +# gnome-doc-utils, mallard, intltool, gsettings. # # # KNOWN ISSUES: @@ -52,6 +52,10 @@ # And add those files to git. See vte/gnome-pty-helper/git.mk for # example. # +# ChangeLog +# +# - 2010-12-06 Add support for Mallard docs +# - 2010-12-06 Start this change log git-all: git-mk-install @@ -93,18 +97,26 @@ $(srcdir)/.gitignore: Makefile.am $(top_srcdir)/git.mk xml html \ ; do echo /$$x; done; \ fi; \ - if test "x$(DOC_MODULE)" = x -o "x$(DOC_LINGUAS)" = x; then :; else \ + if test "x$(DOC_MODULE)$(DOC_ID)" = x -o "x$(DOC_LINGUAS)" = x; then :; else \ for x in \ $(_DOC_C_DOCS) \ $(_DOC_LC_DOCS) \ $(_DOC_OMF_ALL) \ $(_DOC_DSK_ALL) \ $(_DOC_HTML_ALL) \ + $(_DOC_MOFILES) \ $(_DOC_POFILES) \ + $(DOC_H_FILE) \ "*/.xml2po.mo" \ "*/*.omf.out" \ ; do echo /$$x; done; \ fi; \ + if test "x$(gsettings_SCHEMAS)" = x; then :; else \ + for x in \ + $(gsettings_SCHEMAS:.xml=.valid) \ + $(gsettings__enum_file) \ + ; do echo /$$x; done; \ + fi; \ if test -f $(srcdir)/po/Makefile.in.in; then \ for x in \ po/Makefile.in.in \ @@ -159,6 +171,7 @@ $(srcdir)/.gitignore: Makefile.am $(top_srcdir)/git.mk "*.bak" \ "*~" \ ".*.sw[nop]" \ + ".dirstamp" \ ; do echo /$$x; done; \ } | \ sed "s@^/`echo "$(srcdir)" | sed 's/\(.\)/[\1]/g'`/@/@" | \ diff --git a/modules/hangul/hangul-fc.c b/modules/hangul/hangul-fc.c index 7692a843..2ef56ec9 100644 --- a/modules/hangul/hangul-fc.c +++ b/modules/hangul/hangul-fc.c @@ -338,15 +338,16 @@ render_syllable (PangoFont *font, const char *str, int length, oldlen = *n_glyphs; for (j = 0; j < 3 && (__jamo_to_ksc5601[jindex][j] != 0); j++) { - wc = __jamo_to_ksc5601[jindex][j] - KSC_JAMOBASE + UNI_JAMOBASE; - index = (wc >= 0x3131) ? find_char (font, wc) : 0; + gunichar comp_wc; + comp_wc = __jamo_to_ksc5601[jindex][j] - KSC_JAMOBASE + UNI_JAMOBASE; + index = (comp_wc >= 0x3131) ? find_char (font, comp_wc) : 0; pango_glyph_string_set_size (glyphs, *n_glyphs + 1); if (!index) { *n_glyphs = oldlen; pango_glyph_string_set_size (glyphs, *n_glyphs + 1); set_glyph (font, glyphs, *n_glyphs, cluster_offset, - PANGO_GET_UNKNOWN_GLYPH (text[i])); + PANGO_GET_UNKNOWN_GLYPH (wc)); (*n_glyphs)++; break; } diff --git a/pango/Makefile.am b/pango/Makefile.am index 7e033b42..de866d2c 100644 --- a/pango/Makefile.am +++ b/pango/Makefile.am @@ -164,7 +164,7 @@ Pango_1_0_gir_PACKAGES = gobject-2.0 cairo freetype2 Pango_1_0_gir_INCLUDES = GObject-2.0 cairo-1.0 Pango_1_0_gir_LIBS = libpango-1.0.la Pango_1_0_gir_CFLAGS = -I$(top_srcdir) $(PANGO_CFLAGS) -Pango_1_0_gir_FILES = $(filter-out %-private.h, $(pango_introspection_files)) +Pango_1_0_gir_FILES = $(filter-out %-private.h pango-color-table.h, $(pango_introspection_files)) # ------------------- libpangox ------------------- @@ -267,10 +267,11 @@ pangoft2_introspection_files = \ PangoFT2-1.0.gir: libpangoft2-1.0.la PangoFT2-1.0.gir: Pango-1.0.gir -PangoFT2_1_0_gir_PACKAGES = gobject-2.0 freetype2 pangoft2 -PangoFT2_1_0_gir_INCLUDES = GObject-2.0 cairo-1.0 Pango-1.0 freetype2-2.0 fontconfig-2.0 +PangoFT2_1_0_gir_PACKAGES = freetype2 +PangoFT2_1_0_gir_INCLUDES = GObject-2.0 cairo-1.0 freetype2-2.0 fontconfig-2.0 PangoFT2_1_0_gir_LIBS = libpangoft2-1.0.la PangoFT2_1_0_gir_CFLAGS = -I$(top_srcdir) +PangoFT2_1_0_gir_SCANNERFLAGS = --include-uninstalled=$(builddir)/Pango-1.0.gir PangoFT2_1_0_gir_FILES = $(filter-out %-private.h, $(addprefix $(srcdir)/,$(pangoft2_introspection_files))) # ------------------- libpangoxft ------------------- @@ -317,9 +318,10 @@ PangoXft-1.0.gir: libpangoxft-1.0.la PangoXft-1.0.gir: PangoFT2-1.0.gir PangoXft_1_0_gir_PACKAGES = gobject-2.0 freetype2 -PangoXft_1_0_gir_INCLUDES = GObject-2.0 PangoFT2-1.0 xft-2.0 xlib-2.0 +PangoXft_1_0_gir_INCLUDES = GObject-2.0 xft-2.0 xlib-2.0 PangoXft_1_0_gir_LIBS = libpangoxft-1.0.la PangoXft_1_0_gir_CFLAGS = -I$(top_srcdir) $(PANGO_CFLAGS) +PangoXft_1_0_gir_SCANNERFLAGS = --include-uninstalled=$(builddir)/PangoFT2-1.0.gir PangoXft_1_0_gir_FILES = $(filter-out %-private.h, $(addprefix $(srcdir)/,$(pangoxft_introspection_files))) # ------------------- libpangocairo ------------------- @@ -404,9 +406,10 @@ PangoCairo-1.0.gir: libpangocairo-1.0.la PangoCairo-1.0.gir: Pango-1.0.gir $(PANGOCAIRO_FONT_BACKEND_GI_MODULE).gir PangoCairo_1_0_gir_PACKAGES = gobject-2.0 cairo -PangoCairo_1_0_gir_INCLUDES = GObject-2.0 cairo-1.0 Pango-1.0 $(PANGOCAIRO_FONT_BACKEND_GI_MODULE) +PangoCairo_1_0_gir_INCLUDES = GObject-2.0 cairo-1.0 $(PANGOCAIRO_FONT_BACKEND_GI_MODULE) PangoCairo_1_0_gir_LIBS = libpangocairo-1.0.la PangoCairo_1_0_gir_CFLAGS = -I$(top_srcdir) $(PANGO_CFLAGS) +PangoCairo_1_0_gir_SCANNERFLAGS = --include-uninstalled=$(builddir)/Pango-1.0.gir --include-uninstalled=$(builddir)/$(PANGOCAIRO_FONT_BACKEND_GI_MODULE).gir PangoCairo_1_0_gir_FILES = $(filter-out %-private.h, $(addprefix $(srcdir)/,$(pangocairo_introspection_files))) # ------------------- libpangowin32 ------------------- diff --git a/pango/fonts.c b/pango/fonts.c index ab5397a8..34cd67c3 100644 --- a/pango/fonts.c +++ b/pango/fonts.c @@ -46,19 +46,9 @@ struct _PangoFontDescription int size; }; -GType -pango_font_description_get_type (void) -{ - static GType our_type = 0; - - if (G_UNLIKELY (our_type == 0)) - our_type = g_boxed_type_register_static (I_("PangoFontDescription"), - (GBoxedCopyFunc)pango_font_description_copy, - (GBoxedFreeFunc)pango_font_description_free); - - return our_type; -} - +G_DEFINE_BOXED_TYPE (PangoFontDescription, pango_font_description, + pango_font_description_copy, + pango_font_description_free); static const PangoFontDescription pfd_defaults = { NULL, /* family_name */ @@ -1670,19 +1660,9 @@ pango_font_get_font_map (PangoFont *font) return NULL; } -GType -pango_font_metrics_get_type (void) -{ - static GType our_type = 0; - - if (G_UNLIKELY (our_type == 0)) - our_type = g_boxed_type_register_static (I_("PangoFontMetrics"), - (GBoxedCopyFunc)pango_font_metrics_ref, - (GBoxedFreeFunc)pango_font_metrics_unref); - - return our_type; -} - +G_DEFINE_BOXED_TYPE (PangoFontMetrics, pango_font_metrics, + pango_font_metrics_ref, + pango_font_metrics_unref); /** * pango_font_metrics_new: diff --git a/pango/glyphstring.c b/pango/glyphstring.c index dedd822c..e407bd6a 100644 --- a/pango/glyphstring.c +++ b/pango/glyphstring.c @@ -91,18 +91,9 @@ pango_glyph_string_set_size (PangoGlyphString *string, gint new_len) string->num_glyphs = new_len; } -GType -pango_glyph_string_get_type (void) -{ - static GType our_type = 0; - - if (G_UNLIKELY (our_type == 0)) - our_type = g_boxed_type_register_static (I_("PangoGlyphString"), - (GBoxedCopyFunc)pango_glyph_string_copy, - (GBoxedFreeFunc)pango_glyph_string_free); - - return our_type; -} +G_DEFINE_BOXED_TYPE (PangoGlyphString, pango_glyph_string, + pango_glyph_string_copy, + pango_glyph_string_free); /** * pango_glyph_string_copy: diff --git a/pango/pango-attributes.c b/pango/pango-attributes.c index 961bb330..a253a67c 100644 --- a/pango/pango-attributes.c +++ b/pango/pango-attributes.c @@ -1084,18 +1084,9 @@ pango_attr_gravity_hint_new (PangoGravityHint hint) * Attribute List */ -GType -pango_attr_list_get_type (void) -{ - static GType our_type = 0; - - if (G_UNLIKELY (our_type == 0)) - our_type = g_boxed_type_register_static (I_("PangoAttrList"), - (GBoxedCopyFunc) pango_attr_list_copy, - (GBoxedFreeFunc) pango_attr_list_unref); - - return our_type; -} +G_DEFINE_BOXED_TYPE (PangoAttrList, pango_attr_list, + pango_attr_list_copy, + pango_attr_list_unref); /** * pango_attr_list_new: @@ -1793,7 +1784,7 @@ pango_attr_iterator_get (PangoAttrIterator *iterator, * <literal>pango_font_description_set_family (desc, pango_font_description_get_family (desc))</literal>. * @language: if non-%NULL, location to store language tag for item, or %NULL * if none is found. - * @extra_attrs: (element type Pango.Attribute): (transfer full): if non-%NULL, + * @extra_attrs: (element type Pango.Attribute) (transfer full): if non-%NULL, * location in which to store a list of non-font * attributes at the the current position; only the highest priority * value of each attribute will be added to this list. In order @@ -2014,7 +2005,7 @@ pango_attr_list_filter (PangoAttrList *list, * Gets a list of all attributes at the current position of the * iterator. * - * Return value: (element-type Pango.Attribute): (transfer full): a list of + * Return value: (element-type Pango.Attribute) (transfer full): a list of * all attributes for the current range. * To free this value, call pango_attribute_destroy() on * each value and g_slist_free() on the list. diff --git a/pango/pango-color.c b/pango/pango-color.c index 271638a3..e0577291 100644 --- a/pango/pango-color.c +++ b/pango/pango-color.c @@ -27,18 +27,9 @@ #include "pango-attributes.h" #include "pango-impl-utils.h" -GType -pango_color_get_type (void) -{ - static GType our_type = 0; - - if (G_UNLIKELY (our_type == 0)) - our_type = g_boxed_type_register_static (I_("PangoColor"), - (GBoxedCopyFunc) pango_color_copy, - (GBoxedFreeFunc) pango_color_free); - - return our_type; -} +G_DEFINE_BOXED_TYPE (PangoColor, pango_color, + pango_color_copy, + pango_color_free); /** * pango_color_copy: diff --git a/pango/pango-glyph-item.c b/pango/pango-glyph-item.c index d60e7be7..49d4b07d 100644 --- a/pango/pango-glyph-item.c +++ b/pango/pango-glyph-item.c @@ -179,17 +179,9 @@ pango_glyph_item_free (PangoGlyphItem *glyph_item) g_slice_free (PangoGlyphItem, glyph_item); } -GType -pango_glyph_item_get_type (void) -{ - static GType our_type = 0; - - if (G_UNLIKELY (our_type == 0)) - our_type = g_boxed_type_register_static (I_("PangoGlyphItem"), - (GBoxedCopyFunc) pango_glyph_item_copy, - (GBoxedFreeFunc) pango_glyph_item_free); - return our_type; -} +G_DEFINE_BOXED_TYPE (PangoGlyphItem, pango_glyph_item, + pango_glyph_item_copy, + pango_glyph_item_free); /** @@ -236,17 +228,9 @@ pango_glyph_item_iter_free (PangoGlyphItemIter *iter) g_slice_free (PangoGlyphItemIter, iter); } -GType -pango_glyph_item_iter_get_type (void) -{ - static GType our_type = 0; - - if (G_UNLIKELY (our_type == 0)) - our_type = g_boxed_type_register_static (I_("PangoGlyphItemIter"), - (GBoxedCopyFunc) pango_glyph_item_iter_copy, - (GBoxedFreeFunc) pango_glyph_item_iter_free); - return our_type; -} +G_DEFINE_BOXED_TYPE (PangoGlyphItemIter, pango_glyph_item_iter, + pango_glyph_item_iter_copy, + pango_glyph_item_iter_free) /** * pango_glyph_item_iter_next_cluster: diff --git a/pango/pango-item.c b/pango/pango-item.c index 9d8edd03..0437d9ce 100644 --- a/pango/pango-item.c +++ b/pango/pango-item.c @@ -106,17 +106,9 @@ pango_item_free (PangoItem *item) g_slice_free (PangoItem, item); } -GType -pango_item_get_type (void) -{ - static GType our_type = 0; - - if (G_UNLIKELY (our_type == 0)) - our_type = g_boxed_type_register_static (I_("PangoItem"), - (GBoxedCopyFunc) pango_item_copy, - (GBoxedFreeFunc) pango_item_free); - return our_type; -} +G_DEFINE_BOXED_TYPE (PangoItem, pango_item, + pango_item_copy, + pango_item_free); /** * pango_item_split: diff --git a/pango/pango-language.c b/pango/pango-language.c index bfde3087..a1675886 100644 --- a/pango/pango-language.c +++ b/pango/pango-language.c @@ -129,17 +129,9 @@ pango_language_free (PangoLanguage *language G_GNUC_UNUSED) return; /* nothing */ } -GType -pango_language_get_type (void) -{ - static GType our_type = 0; - - if (G_UNLIKELY (our_type == 0)) - our_type = g_boxed_type_register_static (I_("PangoLanguage"), - (GBoxedCopyFunc)pango_language_copy, - (GBoxedFreeFunc)pango_language_free); - return our_type; -} +G_DEFINE_BOXED_TYPE (PangoLanguage, pango_language, + pango_language_copy, + pango_language_free); /** * _pango_get_lc_ctype: diff --git a/pango/pango-layout.c b/pango/pango-layout.c index c60c7e8f..02fdf193 100644 --- a/pango/pango-layout.c +++ b/pango/pango-layout.c @@ -133,7 +133,7 @@ struct _PangoLayoutClass }; -#define LINE_IS_VALID(line) ((line)->layout != NULL) +#define LINE_IS_VALID(line) ((line) && (line)->layout != NULL) #ifdef G_DISABLE_CHECKS #define ITER_IS_INVALID(iter) FALSE @@ -319,9 +319,9 @@ pango_layout_copy (PangoLayout *src) * * Retrieves the #PangoContext used for this layout. * - * Return value: the #PangoContext for the layout. This does not - * have an additional refcount added, so if you want to keep - * a copy of this around, you must reference it yourself. + * Return value: (transfer none): the #PangoContext for the layout. + * This does not have an additional refcount added, so if you want to + * keep a copy of this around, you must reference it yourself. **/ PangoContext * pango_layout_get_context (PangoLayout *layout) @@ -1245,7 +1245,8 @@ pango_layout_context_changed (PangoLayout *layout) /** * pango_layout_get_log_attrs: * @layout: a #PangoLayout - * @attrs: location to store a pointer to an array of logical attributes + * @attrs: (out)(array length=n_attrs)(transfer container): + * location to store a pointer to an array of logical attributes * This value must be freed with g_free(). * @n_attrs: location to store the number of the attributes in the * array. (The stored value will be one more than the total number @@ -1302,7 +1303,7 @@ pango_layout_get_line_count (PangoLayout *layout) * Use the faster pango_layout_get_lines_readonly() if you do not plan * to modify the contents of the lines (glyphs, glyph widths, etc.). * - * Return value: (element-type Pango.LayoutLine): (transfer none): a #GSList containing + * Return value: (element-type Pango.LayoutLine) (transfer none): a #GSList containing * the lines in the layout. This points to internal data of the #PangoLayout * and must be used with care. It will become invalid on any change to the layout's * text or properties. @@ -1337,7 +1338,7 @@ pango_layout_get_lines (PangoLayout *layout) * but the user is not expected * to modify the contents of the lines (glyphs, glyph widths, etc.). * - * Return value: (element-type Pango.LayoutLine): (transfer none): a #GSList containing + * Return value: (element-type Pango.LayoutLine) (transfer none): a #GSList containing * the lines in the layout. This points to internal data of the #PangoLayout and * must be used with care. It will become invalid on any change to the layout's * text or properties. No changes should be made to the lines. @@ -1445,7 +1446,7 @@ pango_layout_get_line_readonly (PangoLayout *layout, * @trailing: an integer indicating the edge of the grapheme to retrieve * the position of. If > 0, the trailing edge of the grapheme, * if 0, the leading of the grapheme. - * @x_pos: location to store the x_offset (in Pango unit) + * @x_pos: (out): location to store the x_offset (in Pango unit) * * Converts an index within a line to a X position. * @@ -1596,10 +1597,10 @@ pango_layout_index_to_line_and_extents (PangoLayout *layout, * @trailing: an integer indicating the edge of the grapheme to retrieve the * position of. If 0, the trailing edge of the grapheme, if > 0, * the leading of the grapheme. - * @line: location to store resulting line index. (which will - * between 0 and pango_layout_get_line_count(layout) - 1) - * @x_pos: location to store resulting position within line - * (%PANGO_SCALE units per device unit) + * @line: (out): location to store resulting line index. (which will + * between 0 and pango_layout_get_line_count(layout) - 1) + * @x_pos (out): location to store resulting position within line + * (%PANGO_SCALE units per device unit) * * Converts from byte @index_ within the @layout to line and X position. * (X position is measured from the left edge of the line) @@ -1655,7 +1656,7 @@ pango_layout_index_to_line_x (PangoLayout *layout, * was at the leading edge. * @direction: direction to move cursor. A negative * value indicates motion to the left. - * @new_index: location to store the new cursor byte index. A value of -1 + * @new_index: (out): location to store the new cursor byte index. A value of -1 * indicates that the cursor has been moved off the beginning * of the layout. A value of %G_MAXINT indicates that * the cursor has been moved off the end of the layout. @@ -1836,8 +1837,8 @@ pango_layout_move_cursor_visually (PangoLayout *layout, * from the left edge of the layout. * @y: the Y offset (in Pango units) * from the top edge of the layout - * @index_: location to store calculated byte index - * @trailing: location to store a integer indicating where + * @index_: (out): location to store calculated byte index + * @trailing: (out): location to store a integer indicating where * in the grapheme the user clicked. It will either * be zero, or the number of characters in the * grapheme. 0 represents the trailing edge of the grapheme. @@ -1938,7 +1939,7 @@ pango_layout_xy_to_index (PangoLayout *layout, * pango_layout_index_to_pos: * @layout: a #PangoLayout * @index_: byte index within @layout - * @pos: rectangle in which to store the position of the grapheme + * @pos: (out): rectangle in which to store the position of the grapheme * * Converts from an index within a #PangoLayout to the onscreen position * corresponding to the grapheme at that index, which is represented @@ -2165,8 +2166,9 @@ pango_layout_line_get_char_direction (PangoLayoutLine *layout_line, * pango_layout_get_cursor_pos: * @layout: a #PangoLayout * @index_: the byte index of the cursor - * @strong_pos: location to store the strong cursor position (may be %NULL) - * @weak_pos: location to store the weak cursor position (may be %NULL) + * @strong_pos: (out): location to store the strong cursor position + * (may be %NULL) + * @weak_pos: (out): location to store the weak cursor position (may be %NULL) * * Given an index within a layout, determines the positions that of the * strong and weak cursors if the insertion point is at that @@ -2586,10 +2588,11 @@ pango_layout_get_extents_internal (PangoLayout *layout, /** * pango_layout_get_extents: * @layout: a #PangoLayout - * @ink_rect: rectangle used to store the extents of the layout as drawn - * or %NULL to indicate that the result is not needed. - * @logical_rect: rectangle used to store the logical extents of the layout - or %NULL to indicate that the result is not needed. + * @ink_rect: (out): rectangle used to store the extents of the layout as drawn + * or %NULL to indicate that the result is not needed. + * @logical_rect: (out):rectangle used to store the logical extents of the + * layout or %NULL to indicate that the result is not + * needed. * * Computes the logical and ink extents of @layout. Logical extents * are usually what you want for positioning things. Note that both extents @@ -2614,10 +2617,11 @@ pango_layout_get_extents (PangoLayout *layout, /** * pango_layout_get_pixel_extents: * @layout: a #PangoLayout - * @ink_rect: rectangle used to store the extents of the layout as drawn - * or %NULL to indicate that the result is not needed. - * @logical_rect: rectangle used to store the logical extents of the - * layout or %NULL to indicate that the result is not needed. + * @ink_rect: (out): rectangle used to store the extents of the layout as drawn + * or %NULL to indicate that the result is not needed. + * @logical_rect: (out): rectangle used to store the logical extents of the + * layout or %NULL to indicate that the result is not + * needed. * * Computes the logical and ink extents of @layout in device units. * This function just calls pango_layout_get_extents() followed by @@ -2640,8 +2644,8 @@ pango_layout_get_pixel_extents (PangoLayout *layout, /** * pango_layout_get_size: * @layout: a #PangoLayout - * @width: location to store the logical width, or %NULL - * @height: location to store the logical height, or %NULL + * @width: (out): location to store the logical width, or %NULL + * @height: (out): location to store the logical height, or %NULL * * Determines the logical width and height of a #PangoLayout * in Pango units (device units scaled by %PANGO_SCALE). This @@ -2665,8 +2669,8 @@ pango_layout_get_size (PangoLayout *layout, /** * pango_layout_get_pixel_size: * @layout: a #PangoLayout - * @width: location to store the logical width, or %NULL - * @height: location to store the logical height, or %NULL + * @width: (out): location to store the logical width, or %NULL + * @height: (out): location to store the logical height, or %NULL * * Determines the logical width and height of a #PangoLayout * in device units. (pango_layout_get_size() returns the width @@ -3932,29 +3936,21 @@ pango_layout_line_unref (PangoLayoutLine *line) } } -GType -pango_layout_line_get_type (void) -{ - static GType our_type = 0; - - if (G_UNLIKELY (our_type == 0)) - our_type = g_boxed_type_register_static (I_("PangoLayoutLine"), - (GBoxedCopyFunc) pango_layout_line_ref, - (GBoxedFreeFunc) pango_layout_line_unref); - return our_type; -} +G_DEFINE_BOXED_TYPE (PangoLayoutLine, pango_layout_line, + pango_layout_line_ref, + pango_layout_line_unref); /** * pango_layout_line_x_to_index: * @line: a #PangoLayoutLine * @x_pos: the X offset (in Pango units) * from the left edge of the line. - * @index_: location to store calculated byte index for - * the grapheme in which the user clicked. - * @trailing: location to store an integer indicating where - * in the grapheme the user clicked. It will either - * be zero, or the number of characters in the - * grapheme. 0 represents the leading edge of the grapheme. + * @index_: (out): location to store calculated byte index for + * the grapheme in which the user clicked. + * @trailing: (out): location to store an integer indicating where + * in the grapheme the user clicked. It will either + * be zero, or the number of characters in the + * grapheme. 0 represents the leading edge of the grapheme. * * Converts from x offset to the byte index of the corresponding * character within the text of the layout. If @x_pos is outside the line, @@ -3987,12 +3983,8 @@ pango_layout_line_x_to_index (PangoLayoutLine *line, gint last_trailing; gboolean suppress_last_trailing; - g_return_val_if_fail (line != NULL, FALSE); g_return_val_if_fail (LINE_IS_VALID (line), FALSE); - if (!LINE_IS_VALID (line)) - return FALSE; - layout = line->layout; /* Find the last index in the line @@ -4184,7 +4176,7 @@ pango_layout_line_get_width (PangoLayoutLine *line) * the last range will extend all the way to the trailing * edge of the layout. Otherwise, it will end at the * trailing edge of the last character. - * @ranges: (out): (array length=n_ranges): (transfer=full): + * @ranges: (out) (array length=n_ranges) (transfer=full): * location to store a pointer to an array of ranges. * The array will be of length <literal>2*n_ranges</literal>, * with each range starting at <literal>(*ranges)[2*n]</literal> @@ -4536,10 +4528,10 @@ pango_layout_run_get_extents (PangoLayoutRun *run, /** * pango_layout_line_get_extents: * @line: a #PangoLayoutLine - * @ink_rect: rectangle used to store the extents of the glyph string - * as drawn, or %NULL - * @logical_rect: rectangle used to store the logical extents of the glyph - * string, or %NULL + * @ink_rect: (out): rectangle used to store the extents of the glyph string + * as drawn, or %NULL + * @logical_rect: (out):rectangle used to store the logical extents of the glyph + * string, or %NULL * * Computes the logical and ink extents of a layout line. See * pango_font_get_glyph_extents() for details about the interpretation @@ -4557,9 +4549,6 @@ pango_layout_line_get_extents (PangoLayoutLine *line, g_return_if_fail (LINE_IS_VALID (line)); - if (!LINE_IS_VALID (line)) - return; - if (G_UNLIKELY (!ink_rect && !logical_rect)) return; @@ -4687,10 +4676,10 @@ pango_layout_line_new (PangoLayout *layout) /** * pango_layout_line_get_pixel_extents: * @layout_line: a #PangoLayoutLine - * @ink_rect: rectangle used to store the extents of the glyph string - * as drawn, or %NULL - * @logical_rect: rectangle used to store the logical extents of the glyph - * string, or %NULL + * @ink_rect: (out): rectangle used to store the extents of the glyph string + * as drawn, or %NULL + * @logical_rect: (out): rectangle used to store the logical extents of the + * glyph string, or %NULL * * Computes the logical and ink extents of @layout_line in device units. * This function just calls pango_layout_line_get_extents() followed by @@ -5469,18 +5458,9 @@ pango_layout_iter_copy (PangoLayoutIter *iter) return new; } -GType -pango_layout_iter_get_type (void) -{ - static GType our_type = 0; - - if (G_UNLIKELY (our_type == 0)) - our_type = g_boxed_type_register_static (I_("PangoLayoutIter"), - (GBoxedCopyFunc) pango_layout_iter_copy, - (GBoxedFreeFunc) pango_layout_iter_free); - - return our_type; -} +G_DEFINE_BOXED_TYPE (PangoLayoutIter, pango_layout_iter, + pango_layout_iter_copy, + pango_layout_iter_free); /** * pango_layout_get_iter: diff --git a/pango/pango-markup.c b/pango/pango-markup.c index b1a8c9c1..abefaf82 100644 --- a/pango/pango-markup.c +++ b/pango/pango-markup.c @@ -552,9 +552,9 @@ static const GMarkupParser pango_markup_parser = { * @markup_text: markup to parse (see <link linkend="PangoMarkupFormat">markup format</link>) * @length: length of @markup_text, or -1 if nul-terminated * @accel_marker: character that precedes an accelerator, or 0 for none - * @attr_list: address of return location for a #PangoAttrList, or %NULL - * @text: address of return location for text with tags stripped, or %NULL - * @accel_char: address of return location for accelerator char, or %NULL + * @attr_list: (out) (allow-none): address of return location for a #PangoAttrList, or %NULL + * @text: (out) (allow-none): address of return location for text with tags stripped, or %NULL + * @accel_char: (out) (allow-none): address of return location for accelerator char, or %NULL * @error: address of return location for errors, or %NULL * * Parses marked-up text (see diff --git a/pango/pango-matrix.c b/pango/pango-matrix.c index 70a1698e..f3a47e4b 100644 --- a/pango/pango-matrix.c +++ b/pango/pango-matrix.c @@ -26,18 +26,9 @@ #include "pango-matrix.h" #include "pango-impl-utils.h" -GType -pango_matrix_get_type (void) -{ - static GType our_type = 0; - - if (G_UNLIKELY (our_type == 0)) - our_type = g_boxed_type_register_static (I_("PangoMatrix"), - (GBoxedCopyFunc) pango_matrix_copy, - (GBoxedFreeFunc) pango_matrix_free); - - return our_type; -} +G_DEFINE_BOXED_TYPE (PangoMatrix, pango_matrix, + pango_matrix_copy, + pango_matrix_free); /** * pango_matrix_copy: diff --git a/pango/pango-tabs.c b/pango/pango-tabs.c index 6091d275..aec86129 100644 --- a/pango/pango-tabs.c +++ b/pango/pango-tabs.c @@ -156,17 +156,9 @@ pango_tab_array_new_with_positions (gint size, return array; } -GType -pango_tab_array_get_type (void) -{ - static GType our_type = 0; - - if (G_UNLIKELY (our_type == 0)) - our_type = g_boxed_type_register_static (I_("PangoTabArray"), - (GBoxedCopyFunc)pango_tab_array_copy, - (GBoxedFreeFunc)pango_tab_array_free); - return our_type; -} +G_DEFINE_BOXED_TYPE (PangoTabArray, pango_tab_array, + pango_tab_array_copy, + pango_tab_array_free); /** * pango_tab_array_copy: diff --git a/pango/pangocairo-font.c b/pango/pangocairo-font.c index 1f6382b8..df0a7777 100644 --- a/pango/pangocairo-font.c +++ b/pango/pangocairo-font.c @@ -433,6 +433,8 @@ _pango_cairo_font_private_get_hex_box_info (PangoCairoFontPrivate *cf_priv) pango_ctm.x0 = cairo_ctm.x0; pango_ctm.y0 = cairo_ctm.y0; + size /= pango_matrix_get_font_scale_factor (&pango_ctm); + if (is_hinted) { /* prepare for some hinting */ diff --git a/pango/pangoft2-render.c b/pango/pangoft2-render.c index bd3b7d40..42923f49 100644 --- a/pango/pangoft2-render.c +++ b/pango/pangoft2-render.c @@ -121,9 +121,14 @@ pango_ft2_font_render_box_glyph (int width, box->bitmap.width = width; box->bitmap.rows = height; - box->bitmap.pitch = height; + box->bitmap.pitch = width; - box->bitmap.buffer = g_malloc0 (box->bitmap.rows * box->bitmap.pitch); + box->bitmap.buffer = g_malloc0_n (box->bitmap.rows, box->bitmap.pitch); + + if (G_UNLIKELY (!box->bitmap.buffer)) { + g_slice_free (PangoFT2RenderedGlyph, box); + return NULL; + } /* draw the box */ for (j = 0; j < line_width; j++) @@ -226,6 +231,11 @@ pango_ft2_font_render_glyph (PangoFont *font, rendered->bitmap_left = face->glyph->bitmap_left; rendered->bitmap_top = face->glyph->bitmap_top; + if (G_UNLIKELY (!rendered->bitmap.buffer)) { + g_slice_free (PangoFT2RenderedGlyph, rendered); + return NULL; + } + return rendered; } else @@ -276,6 +286,8 @@ pango_ft2_renderer_draw_glyph (PangoRenderer *renderer, if (rendered_glyph == NULL) { rendered_glyph = pango_ft2_font_render_glyph (font, glyph); + if (rendered_glyph == NULL) + return; add_glyph_to_cache = TRUE; } |