From 152e0aab5bb29d691e5e69e2f375b3b42e15e48e Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Thu, 23 Sep 2010 15:49:57 -0400 Subject: Bug 626966 - SIGFPE _hb_sanitize_array Fix two div-by-zero's. Both have been fixed upstream. --- pango/opentype/hb-open-type-private.hh | 2 +- pango/opentype/hb-ot-layout-gpos-private.hh | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/pango/opentype/hb-open-type-private.hh b/pango/opentype/hb-open-type-private.hh index 9e99175a..d93b8e7a 100644 --- a/pango/opentype/hb-open-type-private.hh +++ b/pango/opentype/hb-open-type-private.hh @@ -199,7 +199,7 @@ _hb_sanitize_array (SANITIZE_ARG_DEF, unsigned int record_size, unsigned int len) { - bool overflows = len >= ((unsigned int) -1) / record_size; + bool overflows = record_size > 0 && len >= ((unsigned int) -1) / record_size; #if HB_DEBUG_SANITIZE if (sanitize_depth < HB_DEBUG_SANITIZE) \ diff --git a/pango/opentype/hb-ot-layout-gpos-private.hh b/pango/opentype/hb-ot-layout-gpos-private.hh index e68739ed..cdd28d2c 100644 --- a/pango/opentype/hb-ot-layout-gpos-private.hh +++ b/pango/opentype/hb-ot-layout-gpos-private.hh @@ -337,6 +337,7 @@ struct AnchorMatrix inline bool sanitize (SANITIZE_ARG_DEF, unsigned int cols) { TRACE_SANITIZE (); if (!SANITIZE_SELF ()) return false; + if (rows > 0 && cols >= ((unsigned int) -1) / rows) return false; unsigned int count = rows * cols; if (!SANITIZE_ARRAY (matrix, matrix[0].get_size (), count)) return false; for (unsigned int i = 0; i < count; i++) -- cgit v1.2.1 From 47ba8cfcb857d62f15f4df58d5d5c7bd5088a107 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Mon, 27 Sep 2010 21:07:34 -0400 Subject: Bug 628497 - Crash in pango_layout_line_get_extents at pango-layout.c Cleanup LINE_IS_VALID() usage. --- pango/pango-layout.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/pango/pango-layout.c b/pango/pango-layout.c index c60c7e8f..4cf00a15 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 @@ -3987,12 +3987,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 @@ -4557,9 +4553,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; -- cgit v1.2.1 From 837f1bae095f90c662fdc51fd39a0eeb2bb8f850 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Tue, 21 Sep 2010 15:53:52 -0400 Subject: Fix docs build on Ubuntu I'm guessing that Ubuntu has broken libtool by not automatically adding dependent libraries from the .la file... --- docs/Makefile.am | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/docs/Makefile.am b/docs/Makefile.am index 9e5b6062..28f76263 100644 --- a/docs/Makefile.am +++ b/docs/Makefile.am @@ -57,13 +57,15 @@ INCLUDES = \ $(FREETYPE_CFLAGS) \ $(X_CFLAGS) -# libpangoxft.la and/or libpangocairo.la pull in libpango.la -# and libpangoft2.la; # We're assuming here that we'll only regenerate the # HTML docs on Unix. We don't get introspection on Win32 # specific types, but that isn't a big deal. -GTKDOC_LIBS = +GTKDOC_LIBS = $(top_builddir)/pango/libpango-1.0.la + +if HAVE_FREETYPE +GTKDOC_LIBS += $(top_builddir)/pango/libpangoft2-1.0.la +endif if HAVE_XFT GTKDOC_LIBS += $(top_builddir)/pango/libpangoxft-1.0.la -- cgit v1.2.1 From ce7af5623349df44c4787a44296645db405c5e0c Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Wed, 22 Sep 2010 15:45:33 -0400 Subject: Doc template changes --- docs/tmpl/atsui-fonts.sgml | 3 +++ docs/tmpl/bidi.sgml | 3 +++ docs/tmpl/coverage-maps.sgml | 4 ++++ docs/tmpl/engines.sgml | 4 ++++ docs/tmpl/fonts.sgml | 4 ++++ docs/tmpl/freetype-fonts.sgml | 6 ++++++ docs/tmpl/glyphs.sgml | 4 ++++ docs/tmpl/layout.sgml | 3 +++ docs/tmpl/main.sgml | 5 +++++ docs/tmpl/modules.sgml | 3 +++ docs/tmpl/opentype.sgml | 3 +++ docs/tmpl/pango-engine-lang.sgml | 3 +++ docs/tmpl/pango-engine-shape.sgml | 3 +++ docs/tmpl/pango-renderer.sgml | 3 +++ docs/tmpl/pango-version.sgml | 5 +++++ docs/tmpl/pangocairo.sgml | 5 +++++ docs/tmpl/pangofc-decoder.sgml | 3 +++ docs/tmpl/pangofc-font.sgml | 3 +++ docs/tmpl/pangofc-fontmap.sgml | 3 +++ docs/tmpl/scripts.sgml | 4 ++++ docs/tmpl/tab-stops.sgml | 3 +++ docs/tmpl/text-attributes.sgml | 4 ++++ docs/tmpl/utils.sgml | 5 +++++ docs/tmpl/vertical.sgml | 3 +++ docs/tmpl/win32-fonts.sgml | 9 +++++++++ docs/tmpl/x-fonts.sgml | 3 +++ docs/tmpl/xft-fonts.sgml | 3 +++ 27 files changed, 104 insertions(+) diff --git a/docs/tmpl/atsui-fonts.sgml b/docs/tmpl/atsui-fonts.sgml index 19b03445..c8b6aa06 100644 --- a/docs/tmpl/atsui-fonts.sgml +++ b/docs/tmpl/atsui-fonts.sgml @@ -18,6 +18,9 @@ MacOS systems using the ATSUI text rendering subsystem. + + + A string constant identifying the ATSUI renderer. The associated quark (see diff --git a/docs/tmpl/bidi.sgml b/docs/tmpl/bidi.sgml index 7e5171e9..e02d1ec9 100644 --- a/docs/tmpl/bidi.sgml +++ b/docs/tmpl/bidi.sgml @@ -28,6 +28,9 @@ pango_itemize_with_base_dir() + + + diff --git a/docs/tmpl/coverage-maps.sgml b/docs/tmpl/coverage-maps.sgml index 69c71626..7e0ced9c 100644 --- a/docs/tmpl/coverage-maps.sgml +++ b/docs/tmpl/coverage-maps.sgml @@ -20,6 +20,9 @@ to represent that information. + + + Used to indicate how well a font can represent a particular Unicode @@ -56,6 +59,7 @@ to #PangoCoverageLevel. It is an opaque structure with no public fields. +@void: @Returns: diff --git a/docs/tmpl/engines.sgml b/docs/tmpl/engines.sgml index 20de439f..f9c56c6a 100644 --- a/docs/tmpl/engines.sgml +++ b/docs/tmpl/engines.sgml @@ -31,6 +31,9 @@ function is used when building a catalog of all available modules. + + + The #PangoEngineInfo structure contains information about a particular @@ -103,6 +106,7 @@ specific. +@void: diff --git a/docs/tmpl/fonts.sgml b/docs/tmpl/fonts.sgml index baa05584..7b55dea7 100644 --- a/docs/tmpl/fonts.sgml +++ b/docs/tmpl/fonts.sgml @@ -22,6 +22,9 @@ to load a font of a given description. + + + The #PangoFontDescription structure represents the description @@ -143,6 +146,7 @@ The #GObject type for #PangoFontMask. +@void: @Returns: diff --git a/docs/tmpl/freetype-fonts.sgml b/docs/tmpl/freetype-fonts.sgml index 06f5006c..2ed58bd3 100644 --- a/docs/tmpl/freetype-fonts.sgml +++ b/docs/tmpl/freetype-fonts.sgml @@ -18,6 +18,9 @@ text to bitmaps using the FreeType 2 library. + + + The #PangoFT2FontMap is the #PangoFontMap implementation for FreeType fonts. @@ -37,6 +40,7 @@ with the FreeType backend. See %PANGO_RENDER_TYPE_FC for the replacement. +@void: @Returns: @@ -210,6 +214,7 @@ Function type for doing final config tweaking on prepared FcPatterns. +@void: @Returns: @@ -218,5 +223,6 @@ Function type for doing final config tweaking on prepared FcPatterns. +@void: diff --git a/docs/tmpl/glyphs.sgml b/docs/tmpl/glyphs.sgml index be546c61..399319eb 100644 --- a/docs/tmpl/glyphs.sgml +++ b/docs/tmpl/glyphs.sgml @@ -20,6 +20,9 @@ glyphs. + + + The %PANGO_SCALE macro represents the scale between dimensions used @@ -476,6 +479,7 @@ The #GObject type for #PangoGlyphString. +@void: @Returns: diff --git a/docs/tmpl/layout.sgml b/docs/tmpl/layout.sgml index c60f9d5a..54e385ed 100644 --- a/docs/tmpl/layout.sgml +++ b/docs/tmpl/layout.sgml @@ -22,6 +22,9 @@ at once. + + + The #PangoLayout structure represents an entire paragraph diff --git a/docs/tmpl/main.sgml b/docs/tmpl/main.sgml index 3bfcb998..8373b123 100644 --- a/docs/tmpl/main.sgml +++ b/docs/tmpl/main.sgml @@ -20,6 +20,9 @@ various steps of this process. + + + The #PangoContext structure stores global information @@ -124,6 +127,7 @@ The #GObject type for #PangoDirection. +@void: @Returns: @@ -152,6 +156,7 @@ The #GObject type for #PangoDirection. +@void: @Returns: diff --git a/docs/tmpl/modules.sgml b/docs/tmpl/modules.sgml index 0fe8c42f..faac809a 100644 --- a/docs/tmpl/modules.sgml +++ b/docs/tmpl/modules.sgml @@ -18,6 +18,9 @@ modules that add engines to Pango at run time. + + + The #PangoIncludedModule structure for a statically linked module diff --git a/docs/tmpl/opentype.sgml b/docs/tmpl/opentype.sgml index ca4b53b8..cccc5187 100644 --- a/docs/tmpl/opentype.sgml +++ b/docs/tmpl/opentype.sgml @@ -19,6 +19,9 @@ shaping engines Unstable + + + The PangoOTTag typedef is used to represent TrueType and OpenType diff --git a/docs/tmpl/pango-engine-lang.sgml b/docs/tmpl/pango-engine-lang.sgml index a5a91bf3..73df49c2 100644 --- a/docs/tmpl/pango-engine-lang.sgml +++ b/docs/tmpl/pango-engine-lang.sgml @@ -19,6 +19,9 @@ These engines are used in pango_break(). Unstable + + + diff --git a/docs/tmpl/pango-engine-shape.sgml b/docs/tmpl/pango-engine-shape.sgml index 5e66f2db..3d5dd3b8 100644 --- a/docs/tmpl/pango-engine-shape.sgml +++ b/docs/tmpl/pango-engine-shape.sgml @@ -19,6 +19,9 @@ These engines are used in pango_shape(). Unstable + + + diff --git a/docs/tmpl/pango-renderer.sgml b/docs/tmpl/pango-renderer.sgml index 54445450..f8e524a6 100644 --- a/docs/tmpl/pango-renderer.sgml +++ b/docs/tmpl/pango-renderer.sgml @@ -21,6 +21,9 @@ destinations can be created. + + + diff --git a/docs/tmpl/pango-version.sgml b/docs/tmpl/pango-version.sgml index 230946d2..923fac87 100644 --- a/docs/tmpl/pango-version.sgml +++ b/docs/tmpl/pango-version.sgml @@ -22,6 +22,9 @@ at run-time. + + + This macro encodes the given Pango version into an integer. The numbers @@ -86,6 +89,7 @@ the provided version number. +@void: @Returns: @@ -94,6 +98,7 @@ the provided version number. +@void: @Returns: diff --git a/docs/tmpl/pangocairo.sgml b/docs/tmpl/pangocairo.sgml index 6a907827..32f3ca68 100644 --- a/docs/tmpl/pangocairo.sgml +++ b/docs/tmpl/pangocairo.sgml @@ -145,6 +145,9 @@ int main (int argc, char **argv) + + + @@ -162,6 +165,7 @@ int main (int argc, char **argv) +@void: @Returns: @@ -178,6 +182,7 @@ int main (int argc, char **argv) +@void: @Returns: diff --git a/docs/tmpl/pangofc-decoder.sgml b/docs/tmpl/pangofc-decoder.sgml index b8191c73..7b80410c 100644 --- a/docs/tmpl/pangofc-decoder.sgml +++ b/docs/tmpl/pangofc-decoder.sgml @@ -18,6 +18,9 @@ for handling a font that is encoded in a custom way. + + + diff --git a/docs/tmpl/pangofc-font.sgml b/docs/tmpl/pangofc-font.sgml index a1b055c2..80292a21 100644 --- a/docs/tmpl/pangofc-font.sgml +++ b/docs/tmpl/pangofc-font.sgml @@ -34,6 +34,9 @@ Fontconfig-based backend involves deriving from both + + + diff --git a/docs/tmpl/pangofc-fontmap.sgml b/docs/tmpl/pangofc-fontmap.sgml index ee6cca06..2896c4b8 100644 --- a/docs/tmpl/pangofc-fontmap.sgml +++ b/docs/tmpl/pangofc-fontmap.sgml @@ -34,6 +34,9 @@ Fontconfig-based backend involves deriving from both + + + diff --git a/docs/tmpl/scripts.sgml b/docs/tmpl/scripts.sgml index a87e7fb4..a70d3b40 100644 --- a/docs/tmpl/scripts.sgml +++ b/docs/tmpl/scripts.sgml @@ -19,6 +19,9 @@ and of ranges within a larger text string. + + + The #PangoScript enumeration identifies different writing @@ -252,6 +255,7 @@ The #GObject type for #PangoLanguage. +@void: @Returns: diff --git a/docs/tmpl/tab-stops.sgml b/docs/tmpl/tab-stops.sgml index 03ae3792..62b02020 100644 --- a/docs/tmpl/tab-stops.sgml +++ b/docs/tmpl/tab-stops.sgml @@ -18,6 +18,9 @@ that can be used to set tab stop positions in a #PangoLayout. + + + A #PangoTabArray struct contains an array diff --git a/docs/tmpl/text-attributes.sgml b/docs/tmpl/text-attributes.sgml index 57469b8a..98158f80 100644 --- a/docs/tmpl/text-attributes.sgml +++ b/docs/tmpl/text-attributes.sgml @@ -21,6 +21,9 @@ of attributes applied to a portion of text. + + + The #PangoAttrType @@ -653,6 +656,7 @@ The #GObject type for #PangoAttrList. +@void: @Returns: diff --git a/docs/tmpl/utils.sgml b/docs/tmpl/utils.sgml index 6ac6a66f..c42b385b 100644 --- a/docs/tmpl/utils.sgml +++ b/docs/tmpl/utils.sgml @@ -18,6 +18,9 @@ backends and modules, but may be useful for other purposes too. + + + @@ -166,6 +169,7 @@ backends and modules, but may be useful for other purposes too. +@void: @Returns: @@ -174,6 +178,7 @@ backends and modules, but may be useful for other purposes too. +@void: @Returns: diff --git a/docs/tmpl/vertical.sgml b/docs/tmpl/vertical.sgml index 83e33a1e..5d0ab511 100644 --- a/docs/tmpl/vertical.sgml +++ b/docs/tmpl/vertical.sgml @@ -73,6 +73,9 @@ pango_attr_gravity_hint_new() + + + diff --git a/docs/tmpl/win32-fonts.sgml b/docs/tmpl/win32-fonts.sgml index 8ead0d0f..eb208ade 100644 --- a/docs/tmpl/win32-fonts.sgml +++ b/docs/tmpl/win32-fonts.sgml @@ -18,6 +18,9 @@ Win32 systems and to render text in conjunction with Win32 APIs. + + + A string constant identifying the Win32 renderer. The associated quark (see @@ -31,6 +34,7 @@ g_quark_from_string()) is used to identify the renderer in pango_find_map(). +@void: @Returns: @@ -133,6 +137,7 @@ g_quark_from_string()) is used to identify the renderer in pango_find_map(). +@void: @Returns: @@ -141,6 +146,7 @@ g_quark_from_string()) is used to identify the renderer in pango_find_map(). +@void: @Returns: @@ -156,6 +162,7 @@ HFONTs by their LOGFONT descriptions. +@void: @Returns: @@ -201,6 +208,7 @@ HFONTs by their LOGFONT descriptions. +@void: @Returns: @@ -209,6 +217,7 @@ HFONTs by their LOGFONT descriptions. +@void: diff --git a/docs/tmpl/x-fonts.sgml b/docs/tmpl/x-fonts.sgml index ca76af76..33fd2f41 100644 --- a/docs/tmpl/x-fonts.sgml +++ b/docs/tmpl/x-fonts.sgml @@ -21,6 +21,9 @@ or Cairo backend instead. + + + A string constant identifying the X renderer. The associated quark (see diff --git a/docs/tmpl/xft-fonts.sgml b/docs/tmpl/xft-fonts.sgml index 76e755ab..d996eba7 100644 --- a/docs/tmpl/xft-fonts.sgml +++ b/docs/tmpl/xft-fonts.sgml @@ -42,6 +42,9 @@ overriding the #PangoXftRendererClass virtual functions + + + #PangoXftFont is an implementation of #PangoFcFont using the Xft -- cgit v1.2.1 From 1f32ac0356cfc5c961570d7291d70603d85efa8b Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Tue, 28 Sep 2010 14:16:46 -0400 Subject: Bug 630812 - Ignore gnome-doc-utils, .dirstamp and GSettings files in git.mk Patches from Philip Withnall. [PATCH 1/3] Ignore gnome-doc-utils' .mo files and generated headers gnome-doc-utils can optionally generate a header (specified in DOC_H_FILE) which is cleaned by gnome-doc-utils.make in mostlyclean. Additionally, it generates MO files for the documentation translations which are also cleaned by gnome-doc-utils.make in mostlyclean. [PATCH 2/3] Ignore .dirstamp files These are automatically removed on distclean by automake under some circumstances. [PATCH 3/3] Ignore files generated by gsettings.m4 gsettings.m4 generates .valid files and can optionally generate enum files, which are all removed on mostlyclean by gsettings.m4. --- git.mk | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/git.mk b/git.mk index 5ab41bab..894adb47 100644 --- a/git.mk +++ b/git.mk @@ -40,7 +40,7 @@ # build dir. # # This file knows how to handle autoconf, automake, libtool, gtk-doc, -# gnome-doc-utils, intltool. +# gnome-doc-utils, intltool, gsettings. # # # KNOWN ISSUES: @@ -100,11 +100,19 @@ $(srcdir)/.gitignore: Makefile.am $(top_srcdir)/git.mk $(_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 +167,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'`/@/@" | \ -- cgit v1.2.1 From 14b387aaf9ac6f0f2f2f2428233c1c62ccf13be2 Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Tue, 28 Sep 2010 15:17:53 -0400 Subject: configure.in: Add missing ; --- configure.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.in b/configure.in index d5c531c6..2e194f58 100644 --- a/configure.in +++ b/configure.in @@ -565,7 +565,7 @@ for module in $included_modules; do *-win32) INCLUDED_WIN32_MODULES="$INCLUDED_WIN32_MODULES $included_path" ;; *-atsui) INCLUDED_ATSUI_MODULES="$INCLUDED_ATSUI_MODULES $included_path" ;; *-lang) INCLUDED_LANG_MODULES="$INCLUDED_LANG_MODULES $included_path" ;; - *) IFS="$pango_save_ifs" AC_MSG_ERROR([specified module $module not recognized]) ;; + *) IFS="$pango_save_ifs"; AC_MSG_ERROR([specified module $module not recognized]) ;; esac done IFS="$pango_save_ifs" -- cgit v1.2.1 From 457f5eb78316f6a81735183a3c96c3817dcd4136 Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Tue, 28 Sep 2010 15:51:44 -0400 Subject: introspection: Use --include-uninstalled For inter-module includes we need to use --include-uninstalled, otherwise we may try to process pkg-config entries for uninstalled .pc files. Also: * Don't include pangoft2 in its own package list. * Filter out non-public pango-color-table.h https://bugzilla.gnome.org/show_bug.cgi?id=630857 --- configure.in | 2 +- pango/Makefile.am | 13 ++++++++----- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/configure.in b/configure.in index 2e194f58..d5007de9 100644 --- a/configure.in +++ b/configure.in @@ -481,7 +481,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/pango/Makefile.am b/pango/Makefile.am index 07f36753..176d70ac 100644 --- a/pango/Makefile.am +++ b/pango/Makefile.am @@ -171,7 +171,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 ------------------- @@ -275,10 +275,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 ------------------- @@ -325,9 +326,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 ------------------- @@ -412,9 +414,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 ------------------- -- cgit v1.2.1 From bcad3f2dfe3542d5d91e3172f883ca3d7943228e Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Wed, 29 Sep 2010 10:41:26 -0400 Subject: introspection: Fix some annotation syntax usage --- pango/pango-attributes.c | 4 ++-- pango/pango-layout.c | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/pango/pango-attributes.c b/pango/pango-attributes.c index 961bb330..28c11de6 100644 --- a/pango/pango-attributes.c +++ b/pango/pango-attributes.c @@ -1793,7 +1793,7 @@ pango_attr_iterator_get (PangoAttrIterator *iterator, * pango_font_description_set_family (desc, pango_font_description_get_family (desc)). * @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 +2014,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-layout.c b/pango/pango-layout.c index 4cf00a15..9bdaa1ce 100644 --- a/pango/pango-layout.c +++ b/pango/pango-layout.c @@ -1302,7 +1302,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 +1337,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. @@ -4180,7 +4180,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 2*n_ranges, * with each range starting at (*ranges)[2*n] -- cgit v1.2.1 From c06264ae25218dd72a70bf5eb93d552f2763f9aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Jard=C3=B3n?= Date: Tue, 26 Oct 2010 18:22:03 +0200 Subject: Use autoreconf instead gnome-autogen.sh Fixed https://bugzilla.gnome.org/show_bug.cgi?id=633208 --- autogen.sh | 38 +++++++++++++++++++++----------------- 1 file changed, 21 insertions(+), 17 deletions(-) diff --git a/autogen.sh b/autogen.sh index e8a3cf7a..0c99021e 100755 --- a/autogen.sh +++ b/autogen.sh @@ -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 + 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" "$@" -- cgit v1.2.1 From 807c776bf36667c697c0c9bd76d37160e9c1d8cc Mon Sep 17 00:00:00 2001 From: Christian Persch Date: Sat, 24 May 2008 16:22:06 +0200 Subject: Use G_DEFINE_BOXED_TYPE. Bug #539622. --- configure.in | 2 +- pango/fonts.c | 32 ++++++-------------------------- pango/glyphstring.c | 15 +++------------ pango/pango-attributes.c | 15 +++------------ pango/pango-color.c | 15 +++------------ pango/pango-glyph-item.c | 28 ++++++---------------------- pango/pango-item.c | 14 +++----------- pango/pango-language.c | 14 +++----------- pango/pango-layout.c | 29 ++++++----------------------- pango/pango-matrix.c | 15 +++------------ pango/pango-tabs.c | 14 +++----------- 11 files changed, 40 insertions(+), 153 deletions(-) diff --git a/configure.in b/configure.in index d5007de9..03c79a84 100644 --- a/configure.in +++ b/configure.in @@ -446,7 +446,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, :, 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 28c11de6..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: 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 9bdaa1ce..ee0e09c9 100644 --- a/pango/pango-layout.c +++ b/pango/pango-layout.c @@ -3932,17 +3932,9 @@ 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: @@ -5462,18 +5454,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-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: -- cgit v1.2.1 From 588847fe4b5ed905f3a035825567e08a3b4d516d Mon Sep 17 00:00:00 2001 From: Sven Herzberg Date: Mon, 15 Nov 2010 19:04:47 +0100 Subject: ensure gnome-autogen.sh's behaviour * autogen.sh: make sure that autoreconf calls aclocal the same way gnome-autogen.sh would have done --- autogen.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/autogen.sh b/autogen.sh index 0c99021e..bc7c59c9 100755 --- a/autogen.sh +++ b/autogen.sh @@ -20,7 +20,7 @@ if test -z $AUTORECONF; then echo "*** No autoreconf found, please install it ***" exit 1 else - autoreconf --force --install || exit $? + ACLOCAL="aclocal $ACLOCAL_FLAGS" autoreconf --force --install || exit $? fi -- cgit v1.2.1 From d4a36df5f2e1a1487d7e9f7e966c16bb167a5b96 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Mon, 6 Dec 2010 16:26:00 -0500 Subject: [git.mk] Support Mallard docs --- git.mk | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/git.mk b/git.mk index 894adb47..abd6c0a2 100644 --- a/git.mk +++ b/git.mk @@ -40,7 +40,7 @@ # build dir. # # This file knows how to handle autoconf, automake, libtool, gtk-doc, -# gnome-doc-utils, intltool, gsettings. +# 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,7 +97,7 @@ $(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) \ -- cgit v1.2.1 From 4da05d60a8c9e7f22329c58264e0ca6c683dbf0c Mon Sep 17 00:00:00 2001 From: Paolo Borelli Date: Sat, 11 Dec 2010 14:52:53 +0100 Subject: Annotate pango_layout_get_context(). --- pango/pango-layout.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pango/pango-layout.c b/pango/pango-layout.c index ee0e09c9..b088f86d 100644 --- a/pango/pango-layout.c +++ b/pango/pango-layout.c @@ -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) -- cgit v1.2.1 From 34448ab65f41dfb0c098a3e0d112b084ef84f8d8 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Tue, 28 Dec 2010 03:17:55 -0600 Subject: Bug 636348 - Hex boxes are incorrectly scaled with non identity cairo scale --- pango/pangocairo-font.c | 2 ++ 1 file changed, 2 insertions(+) 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 */ -- cgit v1.2.1 From a7a0db3caa56c9924d823017a23dbc0e71f3ba60 Mon Sep 17 00:00:00 2001 From: Laszlo Pandy Date: Fri, 4 Feb 2011 14:30:59 +0100 Subject: [GI] Annotate out arguments of pango_parse_markup(). --- pango/pango-markup.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pango/pango-markup.c b/pango/pango-markup.c index b1a8c9c1..394be34e 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 markup format) * @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): address of return location for a #PangoAttrList, or %NULL + * @text: (out): address of return location for text with tags stripped, or %NULL + * @accel_char: (out): address of return location for accelerator char, or %NULL * @error: address of return location for errors, or %NULL * * Parses marked-up text (see -- cgit v1.2.1 From 12de1ecf9ab9c925e7021288b10175af74007e94 Mon Sep 17 00:00:00 2001 From: Laszlo Pandy Date: Wed, 9 Feb 2011 16:55:36 +0100 Subject: [GI] Add (allow-none) annotations to pango_parse_markup(). --- pango/pango-markup.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pango/pango-markup.c b/pango/pango-markup.c index 394be34e..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 markup format) * @length: length of @markup_text, or -1 if nul-terminated * @accel_marker: character that precedes an accelerator, or 0 for none - * @attr_list: (out): address of return location for a #PangoAttrList, or %NULL - * @text: (out): address of return location for text with tags stripped, or %NULL - * @accel_char: (out): 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 -- cgit v1.2.1 From 4e6248d76f55c6184f28afe614d7d76b6fa3d455 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Thu, 17 Feb 2011 11:19:48 -0500 Subject: Bug 639882 - Heap corruption in font parsing with FreeType2 backend --- pango/pangoft2-render.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) 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; } -- cgit v1.2.1 From 729352cf1c328615b05e7368a5888a23f7382c4e Mon Sep 17 00:00:00 2001 From: "John (J5) Palmieri" Date: Thu, 17 Feb 2011 12:39:25 -0500 Subject: [gi] add out annotations to pango layout API https://bugzilla.gnome.org/show_bug.cgi?id=642593 --- pango/pango-layout.c | 80 +++++++++++++++++++++++++++------------------------- 1 file changed, 42 insertions(+), 38 deletions(-) diff --git a/pango/pango-layout.c b/pango/pango-layout.c index b088f86d..02fdf193 100644 --- a/pango/pango-layout.c +++ b/pango/pango-layout.c @@ -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 @@ -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 @@ -3941,12 +3945,12 @@ G_DEFINE_BOXED_TYPE (PangoLayoutLine, pango_layout_line, * @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, @@ -4524,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 @@ -4672,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 -- cgit v1.2.1 From ec69005aa8d865bc04e5a80258ee7a78bc0468ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Manuel=20J=C3=A1quez=20Leal?= Date: Mon, 14 Mar 2011 13:18:16 +0100 Subject: build: gtk-doc scanner links agains glib https://bugzilla.gnome.org/show_bug.cgi?id=644724 --- docs/Makefile.am | 2 ++ 1 file changed, 2 insertions(+) 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 -- cgit v1.2.1 From 6b522430ad65fe047b077f9cc3990a97e8869e23 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Mon, 14 Mar 2011 17:05:39 -0300 Subject: Handle realloc failure in the buffer Ported from http://cgit.freedesktop.org/harfbuzz/commit/?id=a6a79df5fe2e by Karl Tomlinson --- pango/opentype/hb-buffer-private.h | 1 + pango/opentype/hb-buffer.c | 66 ++++++++++++++++++++++---------------- pango/opentype/hb-buffer.h | 2 +- 3 files changed, 41 insertions(+), 28 deletions(-) diff --git a/pango/opentype/hb-buffer-private.h b/pango/opentype/hb-buffer-private.h index 45cdc4de..f1947860 100644 --- a/pango/opentype/hb-buffer-private.h +++ b/pango/opentype/hb-buffer-private.h @@ -72,6 +72,7 @@ struct _hb_buffer_t { unsigned int allocated; hb_bool_t have_output; /* weather we have an output buffer going on */ + hb_bool_t in_error; /* Allocation failed */ unsigned int in_length; unsigned int out_length; unsigned int in_pos; diff --git a/pango/opentype/hb-buffer.c b/pango/opentype/hb-buffer.c index 93b51e5c..e9788ad2 100644 --- a/pango/opentype/hb-buffer.c +++ b/pango/opentype/hb-buffer.c @@ -52,23 +52,21 @@ static hb_buffer_t _hb_buffer_nil = { * in_string and out_string. */ -/* XXX err handling */ - /* Internal API */ -static void +static hb_bool_t hb_buffer_ensure_separate (hb_buffer_t *buffer, unsigned int size) { - hb_buffer_ensure (buffer, size); + if (HB_UNLIKELY (!hb_buffer_ensure (buffer, size))) return FALSE; if (buffer->out_string == buffer->in_string) { assert (buffer->have_output); - if (!buffer->positions) - buffer->positions = calloc (buffer->allocated, sizeof (buffer->positions[0])); buffer->out_string = (hb_internal_glyph_info_t *) buffer->positions; memcpy (buffer->out_string, buffer->in_string, buffer->out_length * sizeof (buffer->out_string[0])); } + + return TRUE; } /* Public API */ @@ -114,6 +112,7 @@ void hb_buffer_clear (hb_buffer_t *buffer) { buffer->have_output = FALSE; + buffer->in_error = FALSE; buffer->in_length = 0; buffer->out_length = 0; buffer->in_pos = 0; @@ -122,32 +121,42 @@ hb_buffer_clear (hb_buffer_t *buffer) buffer->max_lig_id = 0; } -void +hb_bool_t hb_buffer_ensure (hb_buffer_t *buffer, unsigned int size) { - unsigned int new_allocated = buffer->allocated; - - if (size > new_allocated) + if (HB_UNLIKELY (size > buffer->allocated)) { + unsigned int new_allocated = buffer->allocated; + hb_internal_glyph_position_t *new_pos; + hb_internal_glyph_info_t *new_info; + hb_bool_t separate_out; + + if (HB_UNLIKELY (buffer->in_error)) + return FALSE; + + separate_out = buffer->out_string != buffer->in_string; + while (size > new_allocated) new_allocated += (new_allocated >> 1) + 8; - if (buffer->positions) - buffer->positions = realloc (buffer->positions, new_allocated * sizeof (buffer->positions[0])); + new_pos = (hb_internal_glyph_position_t *) realloc (buffer->positions, new_allocated * sizeof (buffer->positions[0])); + new_info = (hb_internal_glyph_info_t *) realloc (buffer->in_string, new_allocated * sizeof (buffer->in_string[0])); - if (buffer->out_string != buffer->in_string) - { - buffer->in_string = realloc (buffer->in_string, new_allocated * sizeof (buffer->in_string[0])); - buffer->out_string = (hb_internal_glyph_info_t *) buffer->positions; - } - else - { - buffer->in_string = realloc (buffer->in_string, new_allocated * sizeof (buffer->in_string[0])); - buffer->out_string = buffer->in_string; - } + if (HB_UNLIKELY (!new_pos || !new_info)) + buffer->in_error = TRUE; + + if (HB_LIKELY (new_pos)) + buffer->positions = new_pos; - buffer->allocated = new_allocated; + if (HB_LIKELY (new_info)) + buffer->in_string = new_info; + + buffer->out_string = separate_out ? (hb_internal_glyph_info_t *) buffer->positions : buffer->in_string; + if (HB_LIKELY (!buffer->in_error)) + buffer->allocated = new_allocated; } + + return HB_LIKELY (!buffer->in_error); } void @@ -158,7 +167,7 @@ hb_buffer_add_glyph (hb_buffer_t *buffer, { hb_internal_glyph_info_t *glyph; - hb_buffer_ensure (buffer, buffer->in_length + 1); + if (HB_UNLIKELY (!hb_buffer_ensure (buffer, buffer->in_length + 1))) return; glyph = &buffer->in_string[buffer->in_length]; glyph->codepoint = codepoint; @@ -213,6 +222,8 @@ _hb_buffer_swap (hb_buffer_t *buffer) assert (buffer->have_output); + if (HB_UNLIKELY (buffer->in_error)) return; + if (buffer->out_string != buffer->in_string) { hb_internal_glyph_info_t *tmp_string; @@ -265,7 +276,8 @@ _hb_buffer_add_output_glyphs (hb_buffer_t *buffer, if (buffer->out_string != buffer->in_string || buffer->out_pos + num_out > buffer->in_pos + num_in) { - hb_buffer_ensure_separate (buffer, buffer->out_pos + num_out); + if (HB_UNLIKELY (!hb_buffer_ensure_separate (buffer, buffer->out_pos + num_out))) + return; } mask = buffer->in_string[buffer->in_pos].mask; @@ -302,7 +314,7 @@ _hb_buffer_add_output_glyph (hb_buffer_t *buffer, if (buffer->out_string != buffer->in_string) { - hb_buffer_ensure (buffer, buffer->out_pos + 1); + if (HB_UNLIKELY (!hb_buffer_ensure (buffer, buffer->out_pos + 1))) return; buffer->out_string[buffer->out_pos] = buffer->in_string[buffer->in_pos]; } else if (buffer->out_pos != buffer->in_pos) @@ -332,7 +344,7 @@ _hb_buffer_next_glyph (hb_buffer_t *buffer) if (buffer->out_string != buffer->in_string) { - hb_buffer_ensure (buffer, buffer->out_pos + 1); + if (HB_UNLIKELY (!hb_buffer_ensure (buffer, buffer->out_pos + 1))) return; buffer->out_string[buffer->out_pos] = buffer->in_string[buffer->in_pos]; } else if (buffer->out_pos != buffer->in_pos) diff --git a/pango/opentype/hb-buffer.h b/pango/opentype/hb-buffer.h index b030ba9a..aaf6694e 100644 --- a/pango/opentype/hb-buffer.h +++ b/pango/opentype/hb-buffer.h @@ -94,7 +94,7 @@ hb_buffer_clear (hb_buffer_t *buffer); void hb_buffer_clear_positions (hb_buffer_t *buffer); -void +hb_bool_t hb_buffer_ensure (hb_buffer_t *buffer, unsigned int size); -- cgit v1.2.1 From 6b1910adacb133e229acde532a5a43d588d12faa Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Wed, 6 Apr 2011 16:04:15 -0400 Subject: Bug 646213 - Hangul Jamo render as U+00xx boxes and produce valgrind errors --- modules/hangul/hangul-fc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/hangul/hangul-fc.c b/modules/hangul/hangul-fc.c index 7692a843..b9ffa9ba 100644 --- a/modules/hangul/hangul-fc.c +++ b/modules/hangul/hangul-fc.c @@ -346,7 +346,7 @@ render_syllable (PangoFont *font, const char *str, int length, *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; } -- cgit v1.2.1 From 08fd5cf33d875c161dd5280b92d1633469943620 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Thu, 7 Apr 2011 13:12:33 -0400 Subject: Bug 646213 - Hangul Jamo render as U+00xx boxes and produce valgrind errors Fix the previous fix! --- modules/hangul/hangul-fc.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/modules/hangul/hangul-fc.c b/modules/hangul/hangul-fc.c index b9ffa9ba..2ef56ec9 100644 --- a/modules/hangul/hangul-fc.c +++ b/modules/hangul/hangul-fc.c @@ -338,8 +338,9 @@ 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) { -- cgit v1.2.1