diff options
author | Johan Dahlin <jdahlin@async.com.br> | 2009-01-20 22:38:14 +0000 |
---|---|---|
committer | Johan Dahlin <johan@src.gnome.org> | 2009-01-20 22:38:14 +0000 |
commit | 2dcbf7e1775b3bccd56eed84ec20f4f91bbe5a55 (patch) | |
tree | 87a432393878a5cc6a26319b5336b1bb12211660 | |
parent | 4a5be24fea9af2b4a49bf331d6dc50efeb89735a (diff) | |
download | pango-2dcbf7e1775b3bccd56eed84ec20f4f91bbe5a55.tar.gz |
Bug 567934 – Add introspection support inside pango
2009-01-20 Johan Dahlin <jdahlin@async.com.br>
Bug 567934 – Add introspection support inside pango
* configure.in:
* pango/Makefile.am:
* pango/pango-attributes.c:
* pango/pango-layout.c:
svn path=/trunk/; revision=2798
-rw-r--r-- | ChangeLog | 9 | ||||
-rw-r--r-- | configure.in | 29 | ||||
-rw-r--r-- | pango/Makefile.am | 169 | ||||
-rw-r--r-- | pango/pango-attributes.c | 6 | ||||
-rw-r--r-- | pango/pango-layout.c | 15 |
5 files changed, 202 insertions, 26 deletions
@@ -1,3 +1,12 @@ +2009-01-20 Johan Dahlin <jdahlin@async.com.br> + + Bug 567934 – Add introspection support inside pango + + * configure.in: + * pango/Makefile.am: + * pango/pango-attributes.c: + * pango/pango-layout.c: + 2009-01-08 Behdad Esfahbod <behdad@gnome.org> * pango/pangofc-fontmap.c (pango_fc_font_map_get_patterns): diff --git a/configure.in b/configure.in index d09e6f8d..1abed9bc 100644 --- a/configure.in +++ b/configure.in @@ -44,7 +44,9 @@ AC_INIT(pango, pango_version(), AC_CONFIG_SRCDIR([ChangeLog]) -AM_INIT_AUTOMAKE(1.9 gnits dist-bzip2 no-dist-gzip) +dnl -Wno-portability tells automake to stop complaining about the +dnl usage of GNU Make specific features. +AM_INIT_AUTOMAKE(1.9 gnits dist-bzip2 no-dist-gzip -Wno-portability) AM_CONFIG_HEADER([config.h]) @@ -463,6 +465,31 @@ LIBTHAI_REQUIRED_VERSION=0.1.9 PKG_CHECK_MODULES(LIBTHAI, libthai >= $LIBTHAI_REQUIRED_VERSION, have_libthai=true, AC_MSG_RESULT([no])) # +# Checks for GObject Introspection +# +have_introspection=false +PKG_CHECK_MODULES(INTROSPECTION, gobject-introspection-1.0 >= 0.6.2, have_introspection=true, have_introspection=false) +AM_CONDITIONAL(HAVE_INTROSPECTION, $have_introspection) + +G_IR_SCANNER= +G_IR_COMPILER= +G_IR_GENERATE= +GIRDIR= +TYPELIBDIR= +if test $have_introspection; then + G_IR_SCANNER=`$PKG_CONFIG --variable=g_ir_scanner gobject-introspection-1.0` + G_IR_COMPILER=`$PKG_CONFIG --variable=g_ir_compiler gobject-introspection-1.0` + G_IR_GENERATE=`$PKG_CONFIG --variable=g_ir_generate gobject-introspection-1.0` + GIRDIR=`$PKG_CONFIG --variable=girdir gobject-introspection-1.0` + TYPELIBDIR="$($PKG_CONFIG --variable=typelibdir gobject-introspection-1.0)" +fi +AC_SUBST(G_IR_SCANNER) +AC_SUBST(G_IR_COMPILER) +AC_SUBST(G_IR_GENERATE) +AC_SUBST(GIRDIR) +AC_SUBST(TYPELIBDIR) + +# # Modules to build # arabic_modules="arabic-fc,arabic-lang" diff --git a/pango/Makefile.am b/pango/Makefile.am index 9b316105..619e0071 100644 --- a/pango/Makefile.am +++ b/pango/Makefile.am @@ -8,6 +8,9 @@ if HAVE_FREETYPE OPENTYPE_SUBDIR=opentype endif +EXTRA_DIST = +BUILT_GIRSOURCES = + FRIBIDI_SUBDIR=mini-fribidi SUBDIRS = $(OPENTYPE_SUBDIR) $(FRIBIDI_SUBDIR) @@ -40,6 +43,7 @@ endif # ------------------- libpango ------------------- lib_LTLIBRARIES = libpango-1.0.la +BUILT_GIRSOURCES += Pango-1.0.gir libpango_1_0_la_LDFLAGS = $(LIBRARY_LIBTOOL_OPTIONS) libpango_1_0_la_LIBADD = \ @@ -155,15 +159,39 @@ s-enum-types-c: @REBUILD@ $(pango_headers) Makefile pango-features.h: cd $(top_builddir) && ./config.status pango/pango-features.h +Pango-1.0.gir: $(libpango_1_0_la_SOURCES) +Pango-1.0.gir: $(pango_headers) +Pango-1.0.gir: libpango-1.0.la +Pango-1.0.gir: $(G_IR_SCANNER) + $(G_IR_SCANNER) -v --namespace Pango --nsversion=1.0 \ + --add-include-path=$(srcdir) --add-include-path=. \ + --include=GObject-2.0 \ + --include=cairo-1.0 \ + --library=pango-1.0 \ + --libtool="$(LIBTOOL)" \ + --output $@ \ + --pkg gobject-2.0 \ + --pkg cairo \ + --pkg freetype2 \ + -I$(top_srcdir) \ + $(PANGO_CFLAGS) \ + $(libpango_1_0_la_SOURCES) \ + $(pango_headers) \ + pango-enum-types.h + # ------------------- libpangox ------------------- if HAVE_X -pangoinclude_HEADERS += pangox.h +pangoinclude_HEADERS += $(pangox_headers) lib_LTLIBRARIES += libpangox-1.0.la aliasdir = $(sysconfdir)/pango alias_DATA = pangox.aliases +BUILT_GIRSOURCES += PangoX-1.0.gir endif +pangox_headers = pangox.h +pangox_public_sources = pangox.c + libpangox_1_0_la_LDFLAGS = $(LIBRARY_LIBTOOL_OPTIONS) libpangox_1_0_la_LIBADD = \ libpango-$(PANGO_API_VERSION).la \ @@ -174,23 +202,54 @@ libpangox_1_0_la_LIBADD = \ libpangox_1_0_la_DEPENDENCIES = \ libpango-$(PANGO_API_VERSION).la \ $(INCLUDED_X_MODULES) -libpangox_1_0_la_SOURCES = \ - modules.h \ - module-defs-x.c \ - pangox.c \ - pangox-private.h \ - pangox-fontcache.c \ +libpangox_1_0_la_SOURCES = \ + $(pangox_public_sources) \ + modules.h \ + module-defs-x.c \ + pangox-private.h \ + pangox-fontcache.c \ pangox-fontmap.c +PangoX-1.0.gir: $(libpangox_1_0_la_SOURCES) +PangoX-1.0.gir: $(pangox_headers) +PangoX-1.0.gir: libpangox-1.0.la +PangoX-1.0.gir: Pango-1.0.gir $(G_IR_SCANNER) + $(G_IR_SCANNER) -v --namespace PangoX --nsversion=1.0 \ + --add-include-path=$(srcdir) --add-include-path=. \ + --include=GObject-2.0 \ + --include=xlib-2.0 \ + --include=Pango-1.0 \ + --library=pangox-1.0 \ + --libtool="$(LIBTOOL)" \ + --output $@ \ + --pkg gobject-2.0 \ + --pkg freetype2 \ + --pkg pangox \ + -I$(top_srcdir) \ + $(pangox_public_sources) \ + $(pangox_headers) # ------------------- libpangoft2 ------------------- if HAVE_FREETYPE -pangoinclude_HEADERS += pangofc-font.h pangofc-fontmap.h -pangoinclude_HEADERS += pangoft2.h pango-ot.h pangofc-decoder.h +pangoinclude_HEADERS += $(pangoft2_headers) lib_LTLIBRARIES += libpangoft2-1.0.la +BUILT_GIRSOURCES += PangoFT2-1.0.gir endif +pangoft2_headers = \ + pango-ot.h \ + pangofc-font.h \ + pangofc-fontmap.h \ + pangofc-decoder.h \ + pangoft2.h + +pangoft2_public_sources = \ + pangofc-font.c \ + pangofc-fontmap.c \ + pangofc-decoder.c \ + pangoft2.c + libpangoft2_1_0_la_LDFLAGS = $(LIBRARY_LIBTOOL_OPTIONS) libpangoft2_1_0_la_LIBADD = \ opentype/libharfbuzz-1.la \ @@ -204,14 +263,11 @@ libpangoft2_1_0_la_DEPENDENCIES = \ libpango-$(PANGO_API_VERSION).la \ $(INCLUDED_FC_MODULES) libpangoft2_1_0_la_SOURCES = \ + $(pangoft2_public_sources) \ modules.h \ module-defs-fc.c \ - pangofc-font.c \ - pangofc-fontmap.c \ - pangofc-decoder.c \ pangofc-private.h \ pangoft2.h \ - pangoft2.c \ pangoft2-private.h \ pangoft2-fontmap.c \ pangoft2-render.c \ @@ -229,14 +285,36 @@ endif pangoft2-win32-res.o: pangoft2.rc $(WINDRES) $< $@ +PangoFT2-1.0.gir: $(pangoft2_headers) +PangoFT2-1.0.gir: $(libpangoft2_1_0_la_SOURCES) +PangoFT2-1.0.gir: libpangoft2-1.0.la +PangoFT2-1.0.gir: Pango-1.0.gir $(G_IR_SCANNER) + $(G_IR_SCANNER) -v --namespace PangoFT2 --nsversion=1.0 \ + --add-include-path=$(srcdir) --add-include-path=. \ + --include=GObject-2.0 \ + --include=Pango-1.0 \ + --include=freetype2-2.0 \ + --include=fontconfig-2.0 \ + --library=pangoft2-1.0 \ + --libtool="$(LIBTOOL)" \ + --output $@ \ + --pkg gobject-2.0 \ + --pkg freetype2 \ + --pkg pangoft2 \ + -I$(top_srcdir) \ + $(pangoft2_headers) \ + $(pangoft2_public_sources) # ------------------- libpangoxft ------------------- if HAVE_XFT -pangoinclude_HEADERS += pangoxft.h pangoxft-render.h pango-ot.h +pangoinclude_HEADERS += $(pangoxft_headers) lib_LTLIBRARIES += libpangoxft-1.0.la +BUILT_GIRSOURCES += PangoXft-1.0.gir endif +pangoxft_headers = pangoxft.h pangoxft-render.h pango-ot.h + libpangoxft_1_0_la_LDFLAGS = $(LIBRARY_LIBTOOL_OPTIONS) libpangoxft_1_0_la_LIBADD = \ libpangoft2-$(PANGO_API_VERSION).la \ @@ -256,13 +334,36 @@ libpangoxft_1_0_la_SOURCES = \ pangoxft-render.c +PangoXft-1.0.gir: $(pangoxft_headers) +PangoXft-1.0.gir: $(libpangoxft_1_0_la_SOURCES) +PangoXft-1.0.gir: libpangoxft-1.0.la +PangoXft-1.0.gir: Pango-1.0.gir PangoFT2-1.0.gir $(G_IR_SCANNER) + $(G_IR_SCANNER) -v --namespace PangoXft --nsversion=1.0 \ + --add-include-path=$(srcdir) --add-include-path=. \ + --include=GObject-2.0 \ + --include=xft-2.0 \ + --include=xlib-2.0 \ + --include=PangoFT2-1.0 \ + --library=pangoxft-1.0 \ + --libtool="$(LIBTOOL)" \ + --output $@ \ + --pkg gobject-2.0 \ + --pkg freetype2 \ + -I$(top_srcdir) \ + $(PANGO_CFLAGS) \ + $(pangoxft_headers) \ + $(libpangoxft_1_0_la_SOURCES) + # ------------------- libpangocairo ------------------- if HAVE_CAIRO -pangoinclude_HEADERS += pangocairo.h +pangoinclude_HEADERS += $(pangocairo_headers) lib_LTLIBRARIES += libpangocairo-1.0.la +BUILT_GIRSOURCES += PangoCairo-1.0.gir endif +pangocairo_headers = pangocairo.h + libpangocairo_1_0_la_LDFLAGS = $(LIBRARY_LIBTOOL_OPTIONS) libpangocairo_1_0_la_LIBADD = \ libpango-$(PANGO_API_VERSION).la \ @@ -319,6 +420,25 @@ libpangocairo_1_0_la_LDFLAGS += -framework CoreFoundation -framework Carbon -fra libpangocairo_1_0_la_LIBADD += $(INCLUDED_ATSUI_MODULES) endif +PangoCairo-1.0.gir: $(libpangocairo_1_0_la_SOURCES) +PangoCairo-1.0.gir: $(pangocairo_headers) +PangoCairo-1.0.gir: libpangocairo-1.0.la +PangoCairo-1.0.gir: Pango-1.0.gir $(G_IR_SCANNER) + $(G_IR_SCANNER) -v --namespace PangoCairo --nsversion=1.0 \ + --add-include-path=$(srcdir) --add-include-path=. \ + --include=GObject-2.0 \ + --include=cairo-1.0 \ + --include=Pango-1.0 \ + --library=pangocairo-1.0 \ + --libtool="$(LIBTOOL)" \ + --output $@ \ + --pkg gobject-2.0 \ + --pkg cairo \ + -I$(top_srcdir) \ + $(PANGO_CFLAGS) \ + $(libpangocairo_1_0_la_SOURCES) \ + $(pangocairo_headers) + # ------------------- libpangowin32 ------------------- if HAVE_WIN32 @@ -416,6 +536,23 @@ pangocairo-$(PANGO_API_VERSION).lib: libpangocairo-$(PANGO_API_VERSION).la $(src lib -machine:$(LIB_EXE_MACHINE_FLAG) -name:libpangocairo-$(PANGO_API_VERSION)-$(PANGO_CURRENT_MINUS_AGE).dll -def:$(srcdir)/pangocairo.def -out:$@ +# ------------------- introspection ------------------- + +if HAVE_INTROSPECTION + +girdir = $(GIRDIR) +dist_gir_DATA = $(BUILT_GIRSOURCES) + +EXTRA_DIST += $(BUILT_GIRSOURCES) + +typelibsdir = $(TYPELIBDIR) +typelibs_DATA = $(BUILT_GIRSOURCES:.gir=.typelib) + +%.typelib: %.gir $(G_IR_COMPILER) + LD_LIBRARY_PATH=$${LD_LIBRARY_PATH:+$$LD_LIBRARY_PATH:}. $(G_IR_COMPILER) --includedir=$(srcdir) --includedir=. $(G_IR_COMPILER_OPTS) $< -o $(builddir)/$(@F) + +endif # HAVE_INTROSPECTION + # ------------------- pango-querymodules ------------------- bin_PROGRAMS = pango-querymodules @@ -441,7 +578,7 @@ pango_querymodules_LDADD += libpangowin32-$(PANGO_API_VERSION).la endif pango_querymodules_LDADD += libpango-$(PANGO_API_VERSION).la $(GLIB_LIBS) -EXTRA_DIST = \ +EXTRA_DIST += \ pango-enum-types.h \ module-defs.h \ module-defs-fc.c.win32 \ diff --git a/pango/pango-attributes.c b/pango/pango-attributes.c index 2ca8f2c1..961bb330 100644 --- a/pango/pango-attributes.c +++ b/pango/pango-attributes.c @@ -1793,7 +1793,8 @@ 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: if non-%NULL, location in which to store a list of non-font + * @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 * to free this value, you must call pango_attribute_destroy() on @@ -2013,7 +2014,8 @@ pango_attr_list_filter (PangoAttrList *list, * Gets a list of all attributes at the current position of the * iterator. * - * Return value: a list of all attributes for the current range. + * 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 dd5b26b8..b2dae0a4 100644 --- a/pango/pango-layout.c +++ b/pango/pango-layout.c @@ -1315,9 +1315,9 @@ 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: 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 + * 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. **/ GSList * @@ -1350,9 +1350,9 @@ 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: 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 + * 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. * * Since: 1.16 @@ -4188,7 +4188,8 @@ 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: location to store a pointer to an array of ranges. + * @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> * and of width <literal>(*ranges)[2*n + 1] - (*ranges)[2*n]</literal>. |