diff -Nru gobject-introspection-1.31.10/build-aux/ltmain.sh gobject-introspection-1.31.20/build-aux/ltmain.sh --- gobject-introspection-1.31.10/build-aux/ltmain.sh 2012-01-19 22:12:07.000000000 +0000 +++ gobject-introspection-1.31.20/build-aux/ltmain.sh 2012-03-05 14:47:00.000000000 +0000 @@ -8050,7 +8050,7 @@ elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; - *) func_apped perm_rpath " $libdir" ;; + *) func_append perm_rpath " $libdir" ;; esac fi done diff -Nru gobject-introspection-1.31.10/configure gobject-introspection-1.31.20/configure --- gobject-introspection-1.31.10/configure 2012-01-19 22:12:10.000000000 +0000 +++ gobject-introspection-1.31.20/configure 2012-03-05 14:47:02.000000000 +0000 @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.68 for gobject-introspection 1.31.10. +# Generated by GNU Autoconf 2.68 for gobject-introspection 1.31.20. # # Report bugs to . # @@ -571,8 +571,8 @@ # Identity of this package. PACKAGE_NAME='gobject-introspection' PACKAGE_TARNAME='gobject-introspection' -PACKAGE_VERSION='1.31.10' -PACKAGE_STRING='gobject-introspection 1.31.10' +PACKAGE_VERSION='1.31.20' +PACKAGE_STRING='gobject-introspection 1.31.20' PACKAGE_BUGREPORT='http://bugzilla.gnome.org/enter_bug.cgi?product=glib&component=introspection' PACKAGE_URL='' @@ -618,6 +618,8 @@ GLIBSRC WITH_GLIBSRC_FALSE WITH_GLIBSRC_TRUE +BUILD_DOCTOOL_FALSE +BUILD_DOCTOOL_TRUE PYTHON_LIB_LOC PYTHON_LIBS PYTHON_INCLUDES @@ -829,6 +831,7 @@ enable_gtk_doc enable_gtk_doc_html enable_gtk_doc_pdf +enable_doctool with_glib_src ' ac_precious_vars='build_alias @@ -1407,7 +1410,7 @@ # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures gobject-introspection 1.31.10 to adapt to many kinds of systems. +\`configure' configures gobject-introspection 1.31.20 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1478,7 +1481,7 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of gobject-introspection 1.31.10:";; + short | recursive ) echo "Configuration of gobject-introspection 1.31.20:";; esac cat <<\_ACEOF @@ -1501,6 +1504,7 @@ --enable-gtk-doc use gtk-doc to build documentation [[default=no]] --enable-gtk-doc-html build documentation in html format [[default=yes]] --enable-gtk-doc-pdf build documentation in pdf format [[default=no]] + --enable-doctool enable g-ir-doctool Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] @@ -1630,7 +1634,7 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -gobject-introspection configure 1.31.10 +gobject-introspection configure 1.31.20 generated by GNU Autoconf 2.68 Copyright (C) 2010 Free Software Foundation, Inc. @@ -2177,7 +2181,7 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by gobject-introspection $as_me 1.31.10, which was +It was created by gobject-introspection $as_me 1.31.20, which was generated by GNU Autoconf 2.68. Invocation command line was $ $0 $@ @@ -2997,7 +3001,7 @@ # Define the identity of the package. PACKAGE='gobject-introspection' - VERSION='1.31.10' + VERSION='1.31.20' cat >>confdefs.h <<_ACEOF @@ -14575,6 +14579,60 @@ fi +# Check whether --enable-doctool was given. +if test "${enable_doctool+set}" = set; then : + enableval=$enable_doctool; enable_doctool=$enableval +else + enable_doctool=no +fi + +if test x$enable_doctool != xno; then + +py_mod_var=`echo mako'_' | sed 'y%./+-%__p_%'` +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for python module mako" >&5 +$as_echo_n "checking for python module mako... " >&6; } +if eval \${py_cv_mod_$py_mod_var+:} false; then : + $as_echo_n "(cached) " >&6 +else + +prog=" +import sys +try: + import mako +except ImportError: + sys.exit(1) +except: + sys.exit(0) +sys.exit(0)" +if $PYTHON -c "$prog" 1>&5 2>&5 + then + eval "py_cv_mod_$py_mod_var=yes" + else + eval "py_cv_mod_$py_mod_var=no" + fi + +fi + +py_val=`eval "echo \`echo '$py_cv_mod_'$py_mod_var\`"` +if test "x$py_val" != xno; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + as_fn_error $? "Could not find python module: mako" "$LINENO" 5 +fi + +fi + if test x$enable_doctool != xno; then + BUILD_DOCTOOL_TRUE= + BUILD_DOCTOOL_FALSE='#' +else + BUILD_DOCTOOL_TRUE='#' + BUILD_DOCTOOL_FALSE= +fi + + # Glib documentation GLIBSRC= @@ -14773,6 +14831,10 @@ as_fn_error $? "conditional \"GTK_DOC_USE_REBASE\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi +if test -z "${BUILD_DOCTOOL_TRUE}" && test -z "${BUILD_DOCTOOL_FALSE}"; then + as_fn_error $? "conditional \"BUILD_DOCTOOL\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi if test -z "${WITH_GLIBSRC_TRUE}" && test -z "${WITH_GLIBSRC_FALSE}"; then as_fn_error $? "conditional \"WITH_GLIBSRC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 @@ -15186,7 +15248,7 @@ # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by gobject-introspection $as_me 1.31.10, which was +This file was extended by gobject-introspection $as_me 1.31.20, which was generated by GNU Autoconf 2.68. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -15252,7 +15314,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -gobject-introspection config.status 1.31.10 +gobject-introspection config.status 1.31.20 configured by $0, generated by GNU Autoconf 2.68, with options \\"\$ac_cs_config\\" diff -Nru gobject-introspection-1.31.10/configure.ac gobject-introspection-1.31.20/configure.ac --- gobject-introspection-1.31.10/configure.ac 2012-01-19 22:07:15.000000000 +0000 +++ gobject-introspection-1.31.20/configure.ac 2012-03-05 14:45:09.000000000 +0000 @@ -4,7 +4,7 @@ dnl the gi version number m4_define(gi_major_version, 1) m4_define(gi_minor_version, 31) -m4_define(gi_micro_version, 10) +m4_define(gi_micro_version, 20) m4_define(gi_version, gi_major_version.gi_minor_version.gi_micro_version) AC_PREREQ([2.63]) @@ -272,6 +272,12 @@ AM_CHECK_PYTHON_LIBS(, AC_MSG_ERROR([Python libs not found. Windows requires Python modules to be explicitly linked to libpython.])) fi +AC_ARG_ENABLE(doctool,[ --enable-doctool enable g-ir-doctool ], enable_doctool=$enableval,enable_doctool=no) +if test x$enable_doctool != xno; then + AM_CHECK_PYMOD(mako,,,[AC_MSG_ERROR(Could not find python module: mako)]) +fi +AM_CONDITIONAL(BUILD_DOCTOOL, test x$enable_doctool != xno) + # Glib documentation GLIBSRC= diff -Nru gobject-introspection-1.31.10/debian/changelog gobject-introspection-1.31.20/debian/changelog --- gobject-introspection-1.31.10/debian/changelog 2012-02-16 16:08:11.000000000 +0000 +++ gobject-introspection-1.31.20/debian/changelog 2012-03-05 18:56:23.000000000 +0000 @@ -1,11 +1,23 @@ -gobject-introspection (1.31.10-1ubuntu1) precise; urgency=low +gobject-introspection (1.31.20-1) unstable; urgency=low - * Add 00git_updates.patch: Some bug fixes and regression test updates from - git master. - * Drop fix-alignment.patch, now upstream and included 00git_updates.patch. - * debian/libgirepository-1.0-1.symbols: Add new symbol. + * New upstream release: + - Many g-ir-doctool improvements. + - Lots of new Regress tests. + - Some bug fixes. + * Drop fix-alignment.patch, applied upstream. + * Drop duplicate and bogus debian/libgirepository1.0-1.{install,symbols}. + * debian/libgirepository-1.0-1.symbols: Add two new symbols from this + release. + * debian/control: Bump Standards-Version to 3.9.3 (no changes necessary). + * Add glib_2.30_api.patch: Fix build with glib 2.30 by reverting to + deprecated g_value_[gs]et_char API. + * debian/rules: Explicitly configure for building g-ir-doc-tool. + * debian/control.in: Add new python-mako build/binary dependency for + g-ir-doc-tool. + * debian/gobject-introspection.install: Ship the g-ir-doc-tool templates, so + that this program can actually work. - -- Martin Pitt Thu, 16 Feb 2012 17:04:23 +0100 + -- Martin Pitt Mon, 05 Mar 2012 19:56:23 +0100 gobject-introspection (1.31.10-1) unstable; urgency=low diff -Nru gobject-introspection-1.31.10/debian/control gobject-introspection-1.31.20/debian/control --- gobject-introspection-1.31.10/debian/control 2012-02-16 16:14:43.000000000 +0000 +++ gobject-introspection-1.31.20/debian/control 2012-03-05 18:56:43.000000000 +0000 @@ -6,9 +6,8 @@ Source: gobject-introspection Section: devel Priority: optional -Maintainer: Ubuntu Developers -XSBC-Original-Maintainer: Debian GNOME Maintainers -Uploaders: Debian GNOME Maintainers , Josselin Mouette , Laurent Bigonville , Michael Biebl , Sjoerd Simons +Maintainer: Debian GNOME Maintainers +Uploaders: Josselin Mouette , Laurent Bigonville , Michael Biebl , Sjoerd Simons Build-Depends: debhelper (>= 8), cdbs (>= 0.4.90~), gnome-pkg-tools (>= 0.10), @@ -21,6 +20,7 @@ libffi-dev, libtool, gtk-doc-tools (>= 1.15), + python-mako, libglib2.0-doc Standards-Version: 3.9.2 X-Python-Version: >= 2.5 @@ -103,7 +103,8 @@ Depends: ${shlibs:Depends}, ${misc:Depends}, ${python:Depends}, - libgirepository-1.0-1 (= ${binary:Version}) + libgirepository-1.0-1 (= ${binary:Version}), + python-mako Description: Generate interface introspection data for GObject libraries GObject Introspection is a project for providing machine readable introspection data of the API of C libraries. This introspection diff -Nru gobject-introspection-1.31.10/debian/control.in gobject-introspection-1.31.20/debian/control.in --- gobject-introspection-1.31.10/debian/control.in 2012-02-16 16:08:11.000000000 +0000 +++ gobject-introspection-1.31.20/debian/control.in 2012-03-05 18:49:51.000000000 +0000 @@ -1,8 +1,7 @@ Source: gobject-introspection Section: devel Priority: optional -Maintainer: Ubuntu Developers -XSBC-Original-Maintainer: Debian GNOME Maintainers +Maintainer: Debian GNOME Maintainers Uploaders: @GNOME_TEAM@ Build-Depends: debhelper (>= 8), cdbs (>= 0.4.90~), @@ -16,6 +15,7 @@ libffi-dev, libtool, gtk-doc-tools (>= 1.15), + python-mako, libglib2.0-doc Standards-Version: 3.9.2 X-Python-Version: >= 2.5 @@ -98,7 +98,8 @@ Depends: ${shlibs:Depends}, ${misc:Depends}, ${python:Depends}, - libgirepository-1.0-1 (= ${binary:Version}) + libgirepository-1.0-1 (= ${binary:Version}), + python-mako Description: Generate interface introspection data for GObject libraries GObject Introspection is a project for providing machine readable introspection data of the API of C libraries. This introspection diff -Nru gobject-introspection-1.31.10/debian/gobject-introspection.install gobject-introspection-1.31.20/debian/gobject-introspection.install --- gobject-introspection-1.31.10/debian/gobject-introspection.install 2012-02-16 16:08:11.000000000 +0000 +++ gobject-introspection-1.31.20/debian/gobject-introspection.install 2012-03-05 18:56:18.000000000 +0000 @@ -4,5 +4,6 @@ usr/share/man usr/lib/gobject-introspection/giscanner/*.py usr/lib/gobject-introspection/giscanner/*.so +usr/lib/gobject-introspection/giscanner/*.tmpl debian/dh_girepository /usr/bin debian/gir.pm /usr/share/perl5/Debian/Debhelper/Sequence diff -Nru gobject-introspection-1.31.10/debian/libgirepository1.0-1.install gobject-introspection-1.31.20/debian/libgirepository1.0-1.install --- gobject-introspection-1.31.10/debian/libgirepository1.0-1.install 2012-02-16 16:08:11.000000000 +0000 +++ gobject-introspection-1.31.20/debian/libgirepository1.0-1.install 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -usr/lib/libgirepository-1.0.so.* diff -Nru gobject-introspection-1.31.10/debian/libgirepository-1.0-1.symbols gobject-introspection-1.31.20/debian/libgirepository-1.0-1.symbols --- gobject-introspection-1.31.10/debian/libgirepository-1.0-1.symbols 2012-02-16 16:14:38.000000000 +0000 +++ gobject-introspection-1.31.20/debian/libgirepository-1.0-1.symbols 2012-03-05 18:20:50.000000000 +0000 @@ -57,7 +57,7 @@ g_function_info_invoke@Base 0.9.2 g_function_info_prep_invoker@Base 0.9.2 g_function_invoker_destroy@Base 0.9.2 - g_function_invoker_new_for_address@Base 1.31.10-1ubuntu1~ + g_function_invoker_new_for_address@Base 1.31.20 g_info_new@Base 0.9.2 g_info_type_to_string@Base 0.9.3 g_interface_info_find_method@Base 0.9.2 @@ -103,6 +103,7 @@ g_object_info_find_method_using_interfaces@Base 0.10.0 g_object_info_find_signal@Base 0.10.0 g_object_info_find_vfunc@Base 0.9.2 + g_object_info_find_vfunc_using_interfaces@Base 1.31.20 g_object_info_get_abstract@Base 0.9.2 g_object_info_get_class_struct@Base 0.9.2 g_object_info_get_constant@Base 0.9.2 diff -Nru gobject-introspection-1.31.10/debian/libgirepository1.0-1.symbols gobject-introspection-1.31.20/debian/libgirepository1.0-1.symbols --- gobject-introspection-1.31.10/debian/libgirepository1.0-1.symbols 2012-02-16 16:08:11.000000000 +0000 +++ gobject-introspection-1.31.20/debian/libgirepository1.0-1.symbols 1970-01-01 00:00:00.000000000 +0000 @@ -1,190 +0,0 @@ -libgirepository-1.0.so.1 libgirepository1.0-1 #MINVER# - _attribute_blob_find_first@Base 0.9.2 - _g_base_info_find_method@Base 0.9.2 - _g_base_info_find_vfunc@Base 0.9.2 - _g_info_from_entry@Base 0.9.2 - _g_info_init@Base 0.9.2 - _g_info_new_full@Base 0.9.2 - _g_type_info_init@Base 0.9.2 - _g_type_info_new@Base 0.9.2 - _gi_type_tag_get_ffi_type@Base 0.9.2 - g_arg_info_get_closure@Base 0.9.2 - g_arg_info_get_destroy@Base 0.9.2 - g_arg_info_get_direction@Base 0.9.2 - g_arg_info_get_ownership_transfer@Base 0.9.2 - g_arg_info_get_scope@Base 0.9.2 - g_arg_info_get_type@Base 0.9.2 - g_arg_info_is_caller_allocates@Base 0.9.2 - g_arg_info_is_optional@Base 0.9.2 - g_arg_info_is_return_value@Base 0.9.2 - g_arg_info_load_type@Base 0.9.2 - g_arg_info_may_be_null@Base 0.9.2 - g_base_info_equal@Base 0.9.2 - g_base_info_get_attribute@Base 0.9.2 - g_base_info_get_container@Base 0.9.2 - g_base_info_get_name@Base 0.9.2 - g_base_info_get_namespace@Base 0.9.2 - g_base_info_get_type@Base 0.9.2 - g_base_info_get_typelib@Base 0.9.2 - g_base_info_is_deprecated@Base 0.9.2 - g_base_info_iterate_attributes@Base 0.9.2 - g_base_info_ref@Base 0.9.2 - g_base_info_unref@Base 0.9.2 - g_callable_info_free_closure@Base 0.9.2 - g_callable_info_get_arg@Base 0.9.2 - g_callable_info_get_caller_owns@Base 0.9.2 - g_callable_info_get_n_args@Base 0.9.2 - g_callable_info_get_return_attribute@Base 0.9.2 - g_callable_info_get_return_type@Base 0.9.2 - g_callable_info_iterate_return_attributes@Base 0.9.2 - g_callable_info_load_arg@Base 0.9.2 - g_callable_info_load_return_type@Base 0.9.2 - g_callable_info_may_return_null@Base 0.9.2 - g_callable_info_prepare_closure@Base 0.9.2 - g_constant_info_get_type@Base 0.9.2 - g_constant_info_get_value@Base 0.9.2 - g_enum_info_get_n_values@Base 0.9.2 - g_enum_info_get_storage_type@Base 0.9.2 - g_enum_info_get_value@Base 0.9.2 - g_error_domain_info_get_codes@Base 0.9.2 - g_error_domain_info_get_quark@Base 0.9.2 - g_field_info_get_field@Base 0.9.2 - g_field_info_get_flags@Base 0.9.2 - g_field_info_get_offset@Base 0.9.2 - g_field_info_get_size@Base 0.9.2 - g_field_info_get_type@Base 0.9.2 - g_field_info_set_field@Base 0.9.2 - g_function_info_get_flags@Base 0.9.2 - g_function_info_get_property@Base 0.9.2 - g_function_info_get_symbol@Base 0.9.2 - g_function_info_get_vfunc@Base 0.9.2 - g_function_info_invoke@Base 0.9.2 - g_function_info_prep_invoker@Base 0.9.2 - g_function_invoker_destroy@Base 0.9.2 - g_info_new@Base 0.9.2 - g_info_type_to_string@Base 0.9.3 - g_interface_info_find_method@Base 0.9.2 - g_interface_info_find_vfunc@Base 0.9.2 - g_interface_info_get_constant@Base 0.9.2 - g_interface_info_get_iface_struct@Base 0.9.2 - g_interface_info_get_method@Base 0.9.2 - g_interface_info_get_n_constants@Base 0.9.2 - g_interface_info_get_n_methods@Base 0.9.2 - g_interface_info_get_n_prerequisites@Base 0.9.2 - g_interface_info_get_n_properties@Base 0.9.2 - g_interface_info_get_n_signals@Base 0.9.2 - g_interface_info_get_n_vfuncs@Base 0.9.2 - g_interface_info_get_prerequisite@Base 0.9.2 - g_interface_info_get_property@Base 0.9.2 - g_interface_info_get_signal@Base 0.9.2 - g_interface_info_get_vfunc@Base 0.9.2 - g_invoke_error_quark@Base 0.9.2 - g_irepository_dump@Base 0.9.2 - g_irepository_enumerate_versions@Base 0.9.3 - g_irepository_error_quark@Base 0.9.2 - g_irepository_find_by_gtype@Base 0.9.2 - g_irepository_find_by_name@Base 0.9.2 - g_irepository_get_c_prefix@Base 0.9.2 - g_irepository_get_default@Base 0.9.2 - g_irepository_get_dependencies@Base 0.9.2 - g_irepository_get_info@Base 0.9.2 - g_irepository_get_loaded_namespaces@Base 0.9.2 - g_irepository_get_n_infos@Base 0.9.2 - g_irepository_get_option_group@Base 0.9.2 - g_irepository_get_search_path@Base 0.9.2 - g_irepository_get_shared_library@Base 0.9.2 - g_irepository_get_type@Base 0.9.2 - g_irepository_get_typelib_path@Base 0.9.2 - g_irepository_get_version@Base 0.9.2 - g_irepository_is_registered@Base 0.9.2 - g_irepository_load_typelib@Base 0.9.2 - g_irepository_prepend_search_path@Base 0.9.2 - g_irepository_require@Base 0.9.2 - g_irepository_require_private@Base 0.9.3 - g_object_info_find_method@Base 0.9.2 - g_object_info_find_vfunc@Base 0.9.2 - g_object_info_get_abstract@Base 0.9.2 - g_object_info_get_class_struct@Base 0.9.2 - g_object_info_get_constant@Base 0.9.2 - g_object_info_get_field@Base 0.9.2 - g_object_info_get_fundamental@Base 0.9.2 - g_object_info_get_get_value_function@Base 0.9.2 - g_object_info_get_get_value_function_pointer@Base 0.9.2 - g_object_info_get_interface@Base 0.9.2 - g_object_info_get_method@Base 0.9.2 - g_object_info_get_n_constants@Base 0.9.2 - g_object_info_get_n_fields@Base 0.9.2 - g_object_info_get_n_interfaces@Base 0.9.2 - g_object_info_get_n_methods@Base 0.9.2 - g_object_info_get_n_properties@Base 0.9.2 - g_object_info_get_n_signals@Base 0.9.2 - g_object_info_get_n_vfuncs@Base 0.9.2 - g_object_info_get_parent@Base 0.9.2 - g_object_info_get_property@Base 0.9.2 - g_object_info_get_ref_function@Base 0.9.2 - g_object_info_get_ref_function_pointer@Base 0.9.2 - g_object_info_get_set_value_function@Base 0.9.2 - g_object_info_get_set_value_function_pointer@Base 0.9.2 - g_object_info_get_signal@Base 0.9.2 - g_object_info_get_type_init@Base 0.9.2 - g_object_info_get_type_name@Base 0.9.2 - g_object_info_get_unref_function@Base 0.9.2 - g_object_info_get_unref_function_pointer@Base 0.9.2 - g_object_info_get_vfunc@Base 0.9.2 - g_property_info_get_flags@Base 0.9.2 - g_property_info_get_ownership_transfer@Base 0.9.2 - g_property_info_get_type@Base 0.9.2 - g_registered_type_info_get_g_type@Base 0.9.2 - g_registered_type_info_get_type_init@Base 0.9.2 - g_registered_type_info_get_type_name@Base 0.9.2 - g_signal_info_get_class_closure@Base 0.9.2 - g_signal_info_get_flags@Base 0.9.2 - g_signal_info_true_stops_emit@Base 0.9.2 - g_struct_info_find_method@Base 0.9.2 - g_struct_info_get_alignment@Base 0.9.2 - g_struct_info_get_field@Base 0.9.2 - g_struct_info_get_method@Base 0.9.2 - g_struct_info_get_n_fields@Base 0.9.2 - g_struct_info_get_n_methods@Base 0.9.2 - g_struct_info_get_size@Base 0.9.2 - g_struct_info_is_foreign@Base 0.9.2 - g_struct_info_is_gtype_struct@Base 0.9.2 - g_type_info_get_array_fixed_size@Base 0.9.2 - g_type_info_get_array_length@Base 0.9.2 - g_type_info_get_array_type@Base 0.9.2 - g_type_info_get_error_domain@Base 0.9.2 - g_type_info_get_ffi_type@Base 0.9.2 - g_type_info_get_interface@Base 0.9.2 - g_type_info_get_n_error_domains@Base 0.9.2 - g_type_info_get_param_type@Base 0.9.2 - g_type_info_get_tag@Base 0.9.2 - g_type_info_is_pointer@Base 0.9.2 - g_type_info_is_zero_terminated@Base 0.9.2 - g_type_tag_to_string@Base 0.9.2 - g_typelib_check_sanity@Base 0.9.2 - g_typelib_error_quark@Base 0.9.2 - g_typelib_free@Base 0.9.2 - g_typelib_get_dir_entry@Base 0.9.2 - g_typelib_get_namespace@Base 0.9.2 - g_typelib_new_from_const_memory@Base 0.9.2 - g_typelib_new_from_mapped_file@Base 0.9.2 - g_typelib_new_from_memory@Base 0.9.2 - g_typelib_symbol@Base 0.9.2 - g_typelib_validate@Base 0.9.2 - g_union_info_find_method@Base 0.9.2 - g_union_info_get_alignment@Base 0.9.2 - g_union_info_get_discriminator@Base 0.9.2 - g_union_info_get_discriminator_offset@Base 0.9.2 - g_union_info_get_discriminator_type@Base 0.9.2 - g_union_info_get_field@Base 0.9.2 - g_union_info_get_method@Base 0.9.2 - g_union_info_get_n_fields@Base 0.9.2 - g_union_info_get_n_methods@Base 0.9.2 - g_union_info_get_size@Base 0.9.2 - g_union_info_is_discriminated@Base 0.9.2 - g_value_info_get_value@Base 0.9.2 - g_vfunc_info_get_flags@Base 0.9.2 - g_vfunc_info_get_invoker@Base 0.9.2 - g_vfunc_info_get_offset@Base 0.9.2 - g_vfunc_info_get_signal@Base 0.9.2 - gi_cclosure_marshal_generic@Base 0.9.2 diff -Nru gobject-introspection-1.31.10/debian/patches/00git_updates.patch gobject-introspection-1.31.20/debian/patches/00git_updates.patch --- gobject-introspection-1.31.10/debian/patches/00git_updates.patch 2012-02-16 16:08:11.000000000 +0000 +++ gobject-introspection-1.31.20/debian/patches/00git_updates.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,1692 +0,0 @@ -index b5cd4c7..1384c0e 100644 ---- a/girepository/girepository.c -+++ b/girepository/girepository.c -@@ -1,5 +1,5 @@ --/* -*- Mode: C; c-file-style: "gnu"; -*- */ --/* GObject introspection: Repository implementation -+/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- -+ * GObject introspection: Repository implementation - * - * Copyright (C) 2005 Matthias Clasen - * Copyright (C) 2008 Colin Walters -@@ -93,7 +93,9 @@ g_irepository_init (GIRepository *repository) - (GDestroyNotify) NULL, - (GDestroyNotify) g_typelib_free); - repository->priv->lazy_typelibs -- = g_hash_table_new (g_str_hash, g_str_equal); -+ = g_hash_table_new_full (g_str_hash, g_str_equal, -+ (GDestroyNotify) g_free, -+ (GDestroyNotify) NULL); - repository->priv->info_by_gtype - = g_hash_table_new_full (g_direct_hash, g_direct_equal, - (GDestroyNotify) NULL, -diff --git a/girepository/girepository.h b/girepository/girepository.h -index 9e99f6e..02bd4a1 100644 ---- a/girepository/girffi.c -+++ b/girepository/girffi.c -@@ -1,4 +1,5 @@ --/* GObject introspection: Helper functions for ffi integration -+/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- -+ * GObject introspection: Helper functions for ffi integration - * - * Copyright (C) 2008 Red Hat, Inc - * Copyright (C) 2005 Matthias Clasen -@@ -230,13 +231,7 @@ g_function_info_prep_invoker (GIFunctionInfo *info, - GError **error) - { - const char *symbol; -- ffi_type *rtype; -- ffi_type **atypes; -- GITypeInfo *tinfo; -- GIArgInfo *ainfo; -- gboolean is_method; -- gboolean throws; -- gint n_args, n_invoke_args, i; -+ gpointer addr; - - g_return_val_if_fail (info != NULL, FALSE); - g_return_val_if_fail (invoker != NULL, FALSE); -@@ -244,7 +239,7 @@ g_function_info_prep_invoker (GIFunctionInfo *info, - symbol = g_function_info_get_symbol ((GIFunctionInfo*) info); - - if (!g_typelib_symbol (g_base_info_get_typelib((GIBaseInfo *) info), -- symbol, &(invoker->native_address))) -+ symbol, &addr)) - { - g_set_error (error, - G_INVOKE_ERROR, -@@ -254,15 +249,79 @@ g_function_info_prep_invoker (GIFunctionInfo *info, - return FALSE; - } - -- is_method = (g_function_info_get_flags (info) & GI_FUNCTION_IS_METHOD) != 0 -- && (g_function_info_get_flags (info) & GI_FUNCTION_IS_CONSTRUCTOR) == 0; -- throws = g_function_info_get_flags (info) & GI_FUNCTION_THROWS; -+ return g_function_invoker_new_for_address (addr, info, invoker, error); -+} -+ -+/** -+ * g_function_invoker_new_for_address: -+ * @addr: The address -+ * @info: A #GICallableInfo -+ * @invoker: Output invoker structure -+ * @error: A #GError -+ * -+ * Initialize the caller-allocated @invoker structure with a cache -+ * of information needed to invoke the C function corresponding to -+ * @info with the platform's default ABI. -+ * -+ * A primary intent of this function is that a dynamic structure allocated -+ * by a language binding could contain a #GIFunctionInvoker structure -+ * inside the binding's function mapping. -+ * -+ * Returns: %TRUE on success, %FALSE otherwise with @error set. -+ */ -+gboolean -+g_function_invoker_new_for_address (gpointer addr, -+ GICallableInfo *info, -+ GIFunctionInvoker *invoker, -+ GError **error) -+{ -+ ffi_type *rtype; -+ ffi_type **atypes; -+ GITypeInfo *tinfo; -+ GIArgInfo *ainfo; -+ GIInfoType info_type; -+ gboolean is_method; -+ gboolean throws; -+ gint n_args, n_invoke_args, i; -+ -+ g_return_val_if_fail (info != NULL, FALSE); -+ g_return_val_if_fail (invoker != NULL, FALSE); -+ -+ invoker->native_address = addr; -+ -+ info_type = g_base_info_get_type ((GIBaseInfo *) info); -+ -+ switch (info_type) -+ { -+ case GI_INFO_TYPE_FUNCTION: -+ { -+ GIFunctionInfoFlags flags; -+ flags = g_function_info_get_flags ((GIFunctionInfo *)info); -+ is_method = (flags & GI_FUNCTION_IS_METHOD) != 0; -+ throws = (flags & GI_FUNCTION_THROWS) != 0; -+ } -+ break; -+ case GI_INFO_TYPE_VFUNC: -+ { -+ GIVFuncInfoFlags flags; -+ flags = g_vfunc_info_get_flags ((GIVFuncInfo *)info); -+ throws = (flags & GI_VFUNC_THROWS) != 0; -+ } -+ is_method = TRUE; -+ break; -+ case GI_INFO_TYPE_CALLBACK: -+ is_method = TRUE; -+ throws = FALSE; -+ break; -+ default: -+ g_assert_not_reached (); -+ } - -- tinfo = g_callable_info_get_return_type ((GICallableInfo *)info); -+ tinfo = g_callable_info_get_return_type (info); - rtype = g_type_info_get_ffi_type (tinfo); - g_base_info_unref ((GIBaseInfo *)tinfo); - -- n_args = g_callable_info_get_n_args ((GICallableInfo *)info); -+ n_args = g_callable_info_get_n_args (info); - if (is_method) - n_invoke_args = n_args+1; - else -@@ -282,7 +341,7 @@ g_function_info_prep_invoker (GIFunctionInfo *info, - for (i = 0; i < n_args; i++) - { - int offset = (is_method ? 1 : 0); -- ainfo = g_callable_info_get_arg ((GICallableInfo *)info, i); -+ ainfo = g_callable_info_get_arg (info, i); - switch (g_arg_info_get_direction (ainfo)) - { - case GI_DIRECTION_IN: -diff --git a/girepository/girffi.h b/girepository/girffi.h -index a5cc9e4..e976f92 100644 ---- a/girepository/girffi.h -+++ b/girepository/girffi.h -@@ -1,4 +1,5 @@ --/* GObject introspection: Helper functions for ffi integration -+/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- -+ * GObject introspection: Helper functions for ffi integration - * - * Copyright (C) 2008 Red Hat, Inc - * -@@ -53,6 +54,11 @@ gboolean g_function_info_prep_invoker (GIFunctionInfo *info, - GIFunctionInvoker *invoker, - GError **error); - -+gboolean g_function_invoker_new_for_address (gpointer addr, -+ GICallableInfo *info, -+ GIFunctionInvoker *invoker, -+ GError **error); -+ - void g_function_invoker_destroy (GIFunctionInvoker *invoker); - - -diff --git a/girepository/girmodule.c b/girepository/girmodule.c -index f438a19..af71f36 100644 ---- a/girepository/girnode.c -+++ b/girepository/girnode.c -@@ -1,4 +1,5 @@ --/* GObject introspection: Typelib creation -+/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- -+ * GObject introspection: Typelib creation - * - * Copyright (C) 2005 Matthias Clasen - * Copyright (C) 2008,2009 Red Hat, Inc. -@@ -1784,6 +1785,7 @@ _g_ir_node_build_typelib (GIrNode *node, - blob->must_be_implemented = 0; /* FIXME */ - blob->must_not_be_implemented = 0; /* FIXME */ - blob->class_closure = 0; /* FIXME */ -+ blob->throws = vfunc->throws; - blob->reserved = 0; - - if (vfunc->invoker) -diff --git a/girepository/girnode.h b/girepository/girnode.h -index 3286345..d89847a 100644 ---- a/girepository/girnode.h -+++ b/girepository/girnode.h -@@ -1,4 +1,5 @@ --/* GObject introspection: Parsed GIR -+/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- -+ * GObject introspection: Parsed GIR - * - * Copyright (C) 2005 Matthias Clasen - * -@@ -206,6 +207,7 @@ struct _GIrNodeVFunc - gboolean must_be_implemented; - gboolean must_not_be_implemented; - gboolean is_class_closure; -+ gboolean throws; - - char *invoker; - -diff --git a/girepository/giroffsets.c b/girepository/giroffsets.c -index 2c84b70..e3c9d7f 100644 ---- a/girepository/girparser.c -+++ b/girepository/girparser.c -@@ -1,4 +1,5 @@ --/* GObject introspection: A parser for the XML GIR format -+/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- -+ * GObject introspection: A parser for the XML GIR format - * - * Copyright (C) 2005 Matthias Clasen - * Copyright (C) 2008 Philip Van Hoof -@@ -2345,6 +2346,7 @@ start_vfunc (GMarkupParseContext *context, - const gchar *is_class_closure; - const gchar *offset; - const gchar *invoker; -+ const gchar *throws; - GIrNodeInterface *iface; - GIrNodeVFunc *vfunc; - -@@ -2362,6 +2364,7 @@ start_vfunc (GMarkupParseContext *context, - is_class_closure = find_attribute ("is-class-closure", attribute_names, attribute_values); - offset = find_attribute ("offset", attribute_names, attribute_values); - invoker = find_attribute ("invoker", attribute_names, attribute_values); -+ throws = find_attribute ("throws", attribute_names, attribute_values); - - if (name == NULL) - { -@@ -2400,6 +2403,11 @@ start_vfunc (GMarkupParseContext *context, - else - vfunc->is_class_closure = FALSE; - -+ if (throws && strcmp (throws, "1") == 0) -+ vfunc->throws = TRUE; -+ else -+ vfunc->throws = FALSE; -+ - if (offset) - vfunc->offset = atoi (offset); - else -diff --git a/girepository/girparser.h b/girepository/girparser.h -index e56c63b..4f79c77 100644 ---- a/girepository/girwriter.c -+++ b/girepository/girwriter.c -@@ -1,5 +1,5 @@ --/* -*- Mode: C; c-file-style: "gnu"; -*- */ --/* GObject introspection: IDL generator -+/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- -+ * GObject introspection: IDL generator - * - * Copyright (C) 2005 Matthias Clasen - * Copyright (C) 2008,2009 Red Hat, Inc. -@@ -916,6 +916,9 @@ write_vfunc_info (const gchar *namespace, - else if (flags & GI_VFUNC_MUST_NOT_OVERRIDE) - xml_printf (file, " override=\"never\""); - -+ if (flags & GI_VFUNC_THROWS) -+ xml_printf (file, " throws=\"1\""); -+ - xml_printf (file, " offset=\"%d\"", offset); - - if (invoker) -diff --git a/girepository/girwriter.h b/girepository/girwriter.h -index 3ca7418..85f74a7 100644 ---- a/girepository/gitypelib-internal.h -+++ b/girepository/gitypelib-internal.h -@@ -1,4 +1,5 @@ --/* GObject introspection: struct definitions for the binary -+/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- -+ * GObject introspection: struct definitions for the binary - * typelib format, validation - * - * Copyright (C) 2005 Matthias Clasen -@@ -281,7 +282,7 @@ typedef struct { - guint32 sections; - - /* */ -- guint16 padding[5]; -+ guint16 padding[6]; - } Header; - - typedef enum { -@@ -433,6 +434,10 @@ typedef struct { - gint8 closure; - gint8 destroy; - -+ /* */ -+ guint16 padding; -+ /* */ -+ - SimpleTypeBlob arg_type; - } ArgBlob; - -@@ -925,7 +930,8 @@ typedef struct { - guint16 must_be_implemented : 1; - guint16 must_not_be_implemented : 1; - guint16 class_closure : 1; -- guint16 reserved :12; -+ guint16 throws : 1; -+ guint16 reserved :11; - guint16 signal; - - guint16 struct_offset; -@@ -1049,6 +1055,8 @@ typedef struct { - guint16 n_vfuncs; - guint16 n_constants; - -+ guint16 padding; -+ - guint32 reserved2; - guint32 reserved3; - -diff --git a/girepository/gitypelib.c b/girepository/gitypelib.c -index 53a4bea..ae6b845 100644 ---- a/girepository/gitypelib.h -+++ b/girepository/gitypelib.h -@@ -1,4 +1,5 @@ --/* GObject introspection: Public typelib API -+/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- -+ * GObject introspection: Public typelib API - * - * Copyright (C) 2005 Matthias Clasen - * Copyright (C) 2008,2009 Red Hat, Inc. -diff --git a/girepository/gitypes.h b/girepository/gitypes.h -index cbe4316..486f20a 100644 ---- a/girepository/gitypes.h -+++ b/girepository/gitypes.h -@@ -1,4 +1,5 @@ --/* GObject introspection: types -+/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- -+ * GObject introspection: types - * - * Copyright (C) 2005 Matthias Clasen - * Copyright (C) 2008,2009 Red Hat, Inc. -@@ -403,6 +404,7 @@ typedef enum - * @GI_VFUNC_MUST_CHAIN_UP: chains up to the parent type - * @GI_VFUNC_MUST_OVERRIDE: overrides - * @GI_VFUNC_MUST_NOT_OVERRIDE: does not override -+ * @GI_VFUNC_THROWS: Includes a #GError - * - * Flags of a #GIVFuncInfo struct. - */ -@@ -410,7 +412,8 @@ typedef enum - { - GI_VFUNC_MUST_CHAIN_UP = 1 << 0, - GI_VFUNC_MUST_OVERRIDE = 1 << 1, -- GI_VFUNC_MUST_NOT_OVERRIDE = 1 << 2 -+ GI_VFUNC_MUST_NOT_OVERRIDE = 1 << 2, -+ GI_VFUNC_THROWS = 1 << 3 - } GIVFuncInfoFlags; - - /** -diff --git a/girepository/giunioninfo.c b/girepository/giunioninfo.c -index 15a4c7d..95b7112 100644 ---- a/girepository/givfuncinfo.c -+++ b/girepository/givfuncinfo.c -@@ -1,4 +1,5 @@ --/* GObject introspection: Virtual Function implementation -+/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- -+ * GObject introspection: Virtual Function implementation - * - * Copyright (C) 2005 Matthias Clasen - * Copyright (C) 2008,2009 Red Hat, Inc. -@@ -104,6 +105,9 @@ g_vfunc_info_get_flags (GIVFuncInfo *info) - if (blob->must_not_be_implemented) - flags = flags | GI_VFUNC_MUST_NOT_OVERRIDE; - -+ if (blob->throws) -+ flags = flags | GI_VFUNC_THROWS; -+ - return flags; - } - -diff --git a/girepository/givfuncinfo.h b/girepository/givfuncinfo.h -index 3c556cb..d8a8533 100644 ---- a/giscanner/maintransformer.py -+++ b/giscanner/maintransformer.py -@@ -684,33 +684,36 @@ usage is void (*_gtk_reserved1)(void);""" - self._apply_annotations_param_ret_common(parent, return_, tag) - - def _apply_annotations_params(self, parent, params, block): -- allparams = [] -+ declparams = set([]) - if parent.instance_parameter: -- allparams.append(parent.instance_parameter.argname) -+ declparams.add(parent.instance_parameter.argname) - for param in params: - if block: - tag = block.get(param.argname) - else: - tag = None - self._apply_annotations_param(parent, param, tag) -- allparams.append(param.argname) -+ declparams.add(param.argname) - - if not block: - return -- docparams = block.params[:] -- for doc_name in docparams: -- if doc_name in allparams: -- continue -+ docparams = set(block.params) -+ -+ unknown = docparams - declparams -+ unused = declparams - docparams -+ -+ for doc_name in unknown: - # Skip varargs, see #629759 - if doc_name.lower() in ['...', 'varargs', TAG_RETURNS]: - continue -- if len(allparams) == 0: -+ if len(unused) == 0: - text = '' -- elif len(allparams) == 1: -- text = ', should be %r' % (allparams[0], ) -+ elif len(unused) == 1: -+ (param, ) = unused -+ text = ', should be %r' % (param, ) - else: - text = ', should be one of %s' % ( -- ', '.join(repr(p) for p in allparams), ) -+ ', '.join(repr(p) for p in unused), ) - - tag = block.get(doc_name) - message.warn( -@@ -1224,6 +1227,10 @@ method or constructor of some type.""" - vfunc = ast.VFunction.from_callback(callback) - vfunc.instance_parameter = callback.parameters[0] - vfunc.inherit_file_positions(callback) -+ -+ prefix = self._get_annotation_name(class_struct) -+ block = self._blocks.get('%s::%s' % (prefix, vfunc.name)) -+ self._apply_annotations_callable(vfunc, [node], block) - node.virtual_methods.append(vfunc) - - # Take the set of virtual methods we found, and try -diff --git a/tests/gimarshallingtests.c b/tests/gimarshallingtests.c -index f641c38..7afe543 100644 ---- a/tests/gimarshallingtests.c -+++ b/tests/gimarshallingtests.c -@@ -1,4 +1,4 @@ --/* -*- Mode: C; c-basic-offset: 4 -*- -+/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- - * vim: tabstop=4 shiftwidth=4 expandtab - */ - -@@ -995,12 +995,25 @@ gi_marshalling_tests_gtype_return (void) - return G_TYPE_NONE; - } - -+GType -+gi_marshalling_tests_gtype_string_return (void) -+{ -+ return G_TYPE_STRING; -+} -+ - void - gi_marshalling_tests_gtype_in (GType gtype) - { - g_assert(gtype == G_TYPE_NONE); - } - -+void -+gi_marshalling_tests_gtype_string_in (GType gtype) -+{ -+ g_assert(gtype == G_TYPE_STRING); -+} -+ -+ - /** - * gi_marshalling_tests_gtype_out: - * @gtype: (out): -@@ -1012,6 +1025,16 @@ gi_marshalling_tests_gtype_out (GType *gtype) - } - - /** -+ * gi_marshalling_tests_gtype_string_out: -+ * @gtype: (out): -+ */ -+void -+gi_marshalling_tests_gtype_string_out (GType *gtype) -+{ -+ *gtype = G_TYPE_STRING; -+} -+ -+/** - * gi_marshalling_tests_gtype_inout: - * @gtype: (inout): - */ -@@ -2877,6 +2900,17 @@ gi_marshalling_tests_gvalue_in (GValue *value) - } - - /** -+ * gi_marshalling_tests_gvalue_in_with_type: -+ * @value: (transfer none): -+ * @type: -+ */ -+void -+gi_marshalling_tests_gvalue_in_with_type (GValue *value, GType type) -+{ -+ g_assert(g_type_is_a(G_VALUE_TYPE(value), type)); -+} -+ -+/** - * gi_marshalling_tests_gvalue_in_enum: - * @value: (transfer none): - */ -@@ -3034,6 +3068,71 @@ gi_marshalling_tests_gclosure_return (void) - return closure; - } - -+ -+/** -+ * gi_marshalling_tests_callback_return_value_only: -+ * @callback: (scope call): -+ */ -+glong -+gi_marshalling_tests_callback_return_value_only (GIMarshallingTestsCallbackReturnValueOnly callback) -+{ -+ return callback (); -+} -+ -+/** -+ * gi_marshalling_tests_callback_one_out_parameter: -+ * @callback: (scope call): -+ * @a: (out): -+ */ -+void -+gi_marshalling_tests_callback_one_out_parameter (GIMarshallingTestsCallbackOneOutParameter callback, -+ gfloat *a) -+{ -+ callback (a); -+} -+ -+/** -+ * gi_marshalling_tests_callback_multiple_out_parameters: -+ * @callback: (scope call): -+ * @a: (out): -+ * @b: (out): -+ */ -+void -+gi_marshalling_tests_callback_multiple_out_parameters (GIMarshallingTestsCallbackMultipleOutParameters callback, -+ gfloat *a, -+ gfloat *b) -+{ -+ callback (a, b); -+} -+ -+/** -+ * gi_marshalling_tests_callback_return_value_and_one_out_parameter: -+ * @callback: (scope call): -+ * @a: (out): -+ */ -+glong -+gi_marshalling_tests_callback_return_value_and_one_out_parameter (GIMarshallingTestsCallbackReturnValueAndOneOutParameter callback, -+ glong *a) -+{ -+ return callback (a); -+} -+ -+/** -+ * gi_marshalling_tests_callback_return_value_and_multiple_out_parameters: -+ * @callback: (scope call): -+ * @a: (out): -+ * @b: (out): -+ */ -+glong -+gi_marshalling_tests_callback_return_value_and_multiple_out_parameters (GIMarshallingTestsCallbackReturnValueAndMultipleOutParameters callback, -+ glong *a, -+ glong *b) -+{ -+ return callback (a, b); -+} -+ -+ -+ - /** - * gi_marshalling_tests_pointer_in_return: - * -@@ -3787,6 +3886,87 @@ gi_marshalling_tests_object_int8_out (GIMarshallingTestsObject *object, gint8 *o - gi_marshalling_tests_object_method_int8_out (object, out); - } - -+/** -+ * gi_marshalling_tests_object_vfunc_return_value_only: -+ */ -+glong -+gi_marshalling_tests_object_vfunc_return_value_only (GIMarshallingTestsObject *self) -+{ -+ /* make sure that local variables don't get smashed */ -+ glong return_value; -+ gulong local = 0x12345678; -+ return_value = GI_MARSHALLING_TESTS_OBJECT_GET_CLASS (self)->vfunc_return_value_only (self); -+ g_assert_cmpint(local, ==, 0x12345678); -+ return return_value; -+} -+ -+/** -+ * gi_marshalling_tests_object_vfunc_one_out_parameter: -+ * @a: (out): -+ */ -+void -+gi_marshalling_tests_object_vfunc_one_out_parameter (GIMarshallingTestsObject *self, gfloat *a) -+{ -+ /* make sure that local variables don't get smashed */ -+ gulong local = 0x12345678; -+ GI_MARSHALLING_TESTS_OBJECT_GET_CLASS (self)->vfunc_one_out_parameter (self, a); -+ g_assert_cmpint(local, ==, 0x12345678); -+} -+ -+/** -+ * gi_marshalling_tests_object_vfunc_multiple_out_parameters: -+ * @a: (out): -+ * @b: (out): -+ */ -+void -+gi_marshalling_tests_object_vfunc_multiple_out_parameters (GIMarshallingTestsObject *self, gfloat *a, gfloat *b) -+{ -+ /* make sure that local variables don't get smashed */ -+ gulong local = 0x12345678; -+ GI_MARSHALLING_TESTS_OBJECT_GET_CLASS (self)->vfunc_multiple_out_parameters (self, a, b); -+ g_assert_cmpint(local, ==, 0x12345678); -+} -+ -+/** -+ * gi_marshalling_tests_object_vfunc_return_value_and_one_out_parameter: -+ * @a: (out): -+ */ -+glong -+gi_marshalling_tests_object_vfunc_return_value_and_one_out_parameter (GIMarshallingTestsObject *self, glong *a) -+{ -+ /* make sure that local variables don't get smashed */ -+ gulong return_value; -+ gulong local = 0x12345678; -+ return_value = GI_MARSHALLING_TESTS_OBJECT_GET_CLASS (self)->vfunc_return_value_and_one_out_parameter (self, a); -+ g_assert_cmpint(local, ==, 0x12345678); -+ return return_value; -+} -+ -+/** -+ * gi_marshalling_tests_object_vfunc_return_value_and_multiple_out_parameters: -+ * @a: (out): -+ * @b: (out): -+ */ -+glong -+gi_marshalling_tests_object_vfunc_return_value_and_multiple_out_parameters (GIMarshallingTestsObject *self, glong *a, glong *b) -+{ -+ gulong return_value; -+ gulong local = 0x12345678; -+ return_value = GI_MARSHALLING_TESTS_OBJECT_GET_CLASS (self)->vfunc_return_value_and_multiple_out_parameters (self, a, b); -+ g_assert_cmpint(local, ==, 0x12345678); -+ return return_value; -+} -+ -+gboolean -+gi_marshalling_tests_object_vfunc_meth_with_error (GIMarshallingTestsObject *self, -+ gint x, -+ GError **error) -+{ -+ gulong local = 0x12345678; -+ gboolean ret = GI_MARSHALLING_TESTS_OBJECT_GET_CLASS (self)->vfunc_meth_with_err (self, x, error); -+ g_assert_cmpint(local, ==, 0x12345678); -+ return ret; -+} - - G_DEFINE_TYPE (GIMarshallingTestsSubObject, gi_marshalling_tests_sub_object, GI_MARSHALLING_TESTS_TYPE_OBJECT); - -@@ -3972,6 +4152,63 @@ gi_marshalling_tests_gerror_array_in(gint *in_ints, GError **error) - GI_MARSHALLING_TESTS_CONSTANT_GERROR_MESSAGE); - } - -+/** -+ * gi_marshalling_tests_gerror_out: -+ * @error: (out) (allow-none) (transfer full): location for the GError. -+ * @debug: (out) (allow-none) (transfer full): location for the debug message -+ * -+ * Inspired by gst_message_parse_error. -+ */ -+void -+gi_marshalling_tests_gerror_out(GError **error, gchar **debug) -+{ -+ GQuark quark = g_quark_from_static_string(GI_MARSHALLING_TESTS_CONSTANT_GERROR_DOMAIN); -+ g_set_error_literal(error, -+ quark, -+ GI_MARSHALLING_TESTS_CONSTANT_GERROR_CODE, -+ GI_MARSHALLING_TESTS_CONSTANT_GERROR_MESSAGE); -+ -+ if (debug != NULL) { -+ *debug = g_strdup (GI_MARSHALLING_TESTS_CONSTANT_GERROR_DEBUG_MESSAGE); -+ } -+} -+ -+/** -+ * gi_marshalling_tests_gerror_out_transfer_none: -+ * @err: (out) (allow-none) (transfer none): location for the GError. -+ * @debug: (out) (allow-none) (transfer none): location for the debug message -+ * -+ * A variant of gi_marshalling_tests_gerror_out() which returns data the caller -+ * must not free. -+ */ -+void -+gi_marshalling_tests_gerror_out_transfer_none(GError **err, const gchar **debug) -+{ -+ static GError error = { 0, -+ GI_MARSHALLING_TESTS_CONSTANT_GERROR_CODE, -+ GI_MARSHALLING_TESTS_CONSTANT_GERROR_MESSAGE }; -+ error.domain = g_quark_from_static_string(GI_MARSHALLING_TESTS_CONSTANT_GERROR_DOMAIN); -+ *err = &error; -+ *debug = GI_MARSHALLING_TESTS_CONSTANT_GERROR_DEBUG_MESSAGE; -+} -+ -+/** -+ * gi_marshalling_tests_gerror_return: -+ * -+ * Yet another variant of gi_marshalling_tests_gerror_out(). -+ * -+ * Returns: (transfer full): a GError -+ */ -+GError * -+gi_marshalling_tests_gerror_return(void) -+{ -+ GQuark quark = g_quark_from_static_string(GI_MARSHALLING_TESTS_CONSTANT_GERROR_DOMAIN); -+ -+ return g_error_new(quark, -+ GI_MARSHALLING_TESTS_CONSTANT_GERROR_CODE, -+ GI_MARSHALLING_TESTS_CONSTANT_GERROR_MESSAGE); -+} -+ - static GIMarshallingTestsOverridesStruct * - gi_marshalling_tests_overrides_struct_copy (GIMarshallingTestsOverridesStruct *struct_) - { -@@ -4065,7 +4302,6 @@ gi_marshalling_tests_overrides_object_method (GIMarshallingTestsOverridesObject - return 42; - } - -- - /** - * gi_marshalling_tests_overrides_object_returnv: - * -@@ -4088,3 +4324,181 @@ gi_marshalling_tests_filename_list_return (void) - return NULL; - } - -+ -+enum { -+ DUMMY_PROPERTY, -+ SOME_BOOLEAN_PROPERTY, -+ SOME_CHAR_PROPERTY, -+ SOME_UCHAR_PROPERTY, -+ SOME_INT_PROPERTY, -+ SOME_UINT_PROPERTY, -+ SOME_LONG_PROPERTY, -+ SOME_ULONG_PROPERTY, -+ SOME_INT64_PROPERTY, -+ SOME_UINT64_PROPERTY, -+ SOME_FLOAT_PROPERTY, -+ SOME_DOUBLE_PROPERTY -+}; -+ -+G_DEFINE_TYPE (GIMarshallingTestsPropertiesObject, gi_marshalling_tests_properties_object, G_TYPE_OBJECT); -+ -+static void -+gi_marshalling_tests_properties_object_init (GIMarshallingTestsPropertiesObject * self) -+{ -+} -+ -+static void -+gi_marshalling_tests_properties_object_finalize (GObject* obj) -+{ -+ G_OBJECT_CLASS (gi_marshalling_tests_properties_object_parent_class)->finalize (obj); -+} -+ -+static void -+gi_marshalling_tests_properties_object_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) -+{ -+ GIMarshallingTestsPropertiesObject * self; -+ self = GI_MARSHALLING_TESTS_PROPERTIES_OBJECT (object); -+ switch (property_id) { -+ case SOME_BOOLEAN_PROPERTY: -+ g_value_set_boolean (value, self->some_boolean); -+ break; -+ case SOME_CHAR_PROPERTY: -+ g_value_set_schar (value, self->some_char); -+ break; -+ case SOME_UCHAR_PROPERTY: -+ g_value_set_uchar (value, self->some_uchar); -+ break; -+ case SOME_INT_PROPERTY: -+ g_value_set_int (value, self->some_int); -+ break; -+ case SOME_UINT_PROPERTY: -+ g_value_set_uint (value, self->some_uint); -+ break; -+ case SOME_LONG_PROPERTY: -+ g_value_set_long (value, self->some_long); -+ break; -+ case SOME_ULONG_PROPERTY: -+ g_value_set_ulong (value, self->some_ulong); -+ break; -+ case SOME_INT64_PROPERTY: -+ g_value_set_int64 (value, self->some_int64); -+ break; -+ case SOME_UINT64_PROPERTY: -+ g_value_set_uint64 (value, self->some_uint64); -+ break; -+ case SOME_FLOAT_PROPERTY: -+ g_value_set_float (value, self->some_float); -+ break; -+ case SOME_DOUBLE_PROPERTY: -+ g_value_set_double (value, self->some_double); -+ break; -+ default: -+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); -+ break; -+ } -+} -+ -+static void -+gi_marshalling_tests_properties_object_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec) -+{ -+ GIMarshallingTestsPropertiesObject * self; -+ self = GI_MARSHALLING_TESTS_PROPERTIES_OBJECT (object); -+ switch (property_id) { -+ case SOME_BOOLEAN_PROPERTY: -+ self->some_boolean = g_value_get_boolean (value); -+ break; -+ case SOME_CHAR_PROPERTY: -+ self->some_char = g_value_get_schar (value); -+ break; -+ case SOME_UCHAR_PROPERTY: -+ self->some_uchar = g_value_get_uchar (value); -+ break; -+ case SOME_INT_PROPERTY: -+ self->some_int = g_value_get_int (value); -+ break; -+ case SOME_UINT_PROPERTY: -+ self->some_uint = g_value_get_uint (value); -+ break; -+ case SOME_LONG_PROPERTY: -+ self->some_long = g_value_get_long (value); -+ break; -+ case SOME_ULONG_PROPERTY: -+ self->some_ulong = g_value_get_ulong (value); -+ break; -+ case SOME_INT64_PROPERTY: -+ self->some_int64 = g_value_get_int64 (value); -+ break; -+ case SOME_UINT64_PROPERTY: -+ self->some_uint64 = g_value_get_uint64 (value); -+ break; -+ case SOME_FLOAT_PROPERTY: -+ self->some_float = g_value_get_float (value); -+ break; -+ case SOME_DOUBLE_PROPERTY: -+ self->some_double = g_value_get_double (value); -+ break; -+ default: -+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); -+ break; -+ } -+} -+ -+static void -+gi_marshalling_tests_properties_object_class_init (GIMarshallingTestsPropertiesObjectClass * klass) -+{ -+ GObjectClass* object_class = G_OBJECT_CLASS (klass); -+ -+ object_class->finalize = gi_marshalling_tests_properties_object_finalize; -+ object_class->get_property = gi_marshalling_tests_properties_object_get_property; -+ object_class->set_property = gi_marshalling_tests_properties_object_set_property; -+ -+ g_object_class_install_property (object_class, SOME_BOOLEAN_PROPERTY, -+ g_param_spec_boolean ("some-boolean", "some-boolean", "some-boolean", FALSE, -+ G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT)); -+ -+ g_object_class_install_property (object_class, SOME_CHAR_PROPERTY, -+ g_param_spec_char ("some-char", "some-char", "some-char", G_MININT8, G_MAXINT8, 0, -+ G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT)); -+ -+ g_object_class_install_property (object_class, SOME_UCHAR_PROPERTY, -+ g_param_spec_uchar ("some-uchar", "some-uchar", "some-uchar", 0, G_MAXUINT8, 0, -+ G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT)); -+ -+ g_object_class_install_property (object_class, SOME_INT_PROPERTY, -+ g_param_spec_int ("some-int", "some-int", "some-int", G_MININT, G_MAXINT, 0, -+ G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT)); -+ -+ g_object_class_install_property (object_class, SOME_UINT_PROPERTY, -+ g_param_spec_uint ("some-uint", "some-uint", "some-uint", 0, G_MAXUINT, 0, -+ G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT)); -+ -+ g_object_class_install_property (object_class, SOME_LONG_PROPERTY, -+ g_param_spec_long ("some-long", "some-long", "some-long", G_MINLONG, G_MAXLONG, 0, -+ G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT)); -+ -+ g_object_class_install_property (object_class, SOME_ULONG_PROPERTY, -+ g_param_spec_ulong ("some-ulong", "some-ulong", "some-ulong", 0, G_MAXULONG, 0, -+ G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT)); -+ -+ g_object_class_install_property (object_class, SOME_INT64_PROPERTY, -+ g_param_spec_int64 ("some-int64", "some-int64", "some-int64", G_MININT64, G_MAXINT64, 0, -+ G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT)); -+ -+ g_object_class_install_property (object_class, SOME_UINT64_PROPERTY, -+ g_param_spec_uint64 ("some-uint64", "some-uint64", "some-uint64", 0, G_MAXUINT64, 0, -+ G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT)); -+ -+ g_object_class_install_property (object_class, SOME_FLOAT_PROPERTY, -+ g_param_spec_float ("some-float", "some-float", "some-float", -1 * G_MAXFLOAT, G_MAXFLOAT, 0, -+ G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT)); -+ -+ g_object_class_install_property (object_class, SOME_DOUBLE_PROPERTY, -+ g_param_spec_double ("some-double", "some-double", "some-double", -1 * G_MAXDOUBLE, G_MAXDOUBLE, 0, -+ G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT)); -+} -+ -+GIMarshallingTestsPropertiesObject* -+gi_marshalling_tests_properties_object_new (void) -+{ -+ return g_object_new (GI_MARSHALLING_TESTS_TYPE_PROPERTIES_OBJECT, NULL); -+} -diff --git a/tests/gimarshallingtests.h b/tests/gimarshallingtests.h -index 5965a82..0c88920 100644 ---- a/tests/gimarshallingtests.h -+++ b/tests/gimarshallingtests.h -@@ -1,4 +1,4 @@ --/* -*- Mode: C; c-basic-offset: 4 -*- -+/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- - * vim: tabstop=4 shiftwidth=4 expandtab - */ - -@@ -236,10 +236,16 @@ void gi_marshalling_tests_time_t_inout (time_t *time_t_); - - GType gi_marshalling_tests_gtype_return (void); - -+GType gi_marshalling_tests_gtype_string_return (void); -+ - void gi_marshalling_tests_gtype_in (GType gtype); - -+void gi_marshalling_tests_gtype_string_in (GType gtype); -+ - void gi_marshalling_tests_gtype_out (GType *gtype); - -+void gi_marshalling_tests_gtype_string_out (GType *gtype); -+ - void gi_marshalling_tests_gtype_inout (GType *gtype); - - -@@ -520,6 +526,7 @@ void gi_marshalling_tests_ghashtable_utf8_full_inout (GHashTable **hash_table); - GValue *gi_marshalling_tests_gvalue_return (void); - - void gi_marshalling_tests_gvalue_in (GValue *value); -+void gi_marshalling_tests_gvalue_in_with_type (GValue *value, GType type); - - void gi_marshalling_tests_gvalue_in_enum (GValue *value); - -@@ -541,6 +548,55 @@ GValue *gi_marshalling_tests_gvalue_flat_array_round_trip (const GValue one, - void gi_marshalling_tests_gclosure_in (GClosure *closure); - GClosure *gi_marshalling_tests_gclosure_return (void); - -+/* Callback return values */ -+ -+/** -+ * GIMarshallingTestsCallbackReturnValueOnly: -+ */ -+typedef glong (* GIMarshallingTestsCallbackReturnValueOnly) (); -+ -+glong gi_marshalling_tests_callback_return_value_only (GIMarshallingTestsCallbackReturnValueOnly callback); -+ -+/** -+ * GIMarshallingTestsCallbackOneOutParameter: -+ * @a: (out): -+ */ -+typedef void (* GIMarshallingTestsCallbackOneOutParameter) (gfloat *a); -+ -+void gi_marshalling_tests_callback_one_out_parameter (GIMarshallingTestsCallbackOneOutParameter callback, -+ gfloat *a); -+ -+/** -+ * GIMarshallingTestsCallbackMultipleOutParameters: -+ * @a: (out): -+ * @b: (out): -+ */ -+typedef void (* GIMarshallingTestsCallbackMultipleOutParameters) (gfloat *a, gfloat *b); -+ -+void gi_marshalling_tests_callback_multiple_out_parameters (GIMarshallingTestsCallbackMultipleOutParameters callback, -+ gfloat *a, -+ gfloat *b); -+ -+/** -+ * GIMarshallingTestsCallbackReturnValueAndOneOutParameter: -+ * @a: (out): -+ */ -+typedef glong (* GIMarshallingTestsCallbackReturnValueAndOneOutParameter) (glong *a); -+ -+glong gi_marshalling_tests_callback_return_value_and_one_out_parameter (GIMarshallingTestsCallbackReturnValueAndOneOutParameter callback, -+ glong *a); -+ -+/** -+ * GIMarshallingTestsCallbackReturnValueAndMultipleOutParameters: -+ * @a: (out): -+ * @b: (out): -+ */ -+typedef glong (* GIMarshallingTestsCallbackReturnValueAndMultipleOutParameters) (glong *a, glong *b); -+ -+glong gi_marshalling_tests_callback_return_value_and_multiple_out_parameters (GIMarshallingTestsCallbackReturnValueAndMultipleOutParameters callback, -+ glong *a, -+ glong *b); -+ - /* Pointer */ - - gpointer gi_marshalling_tests_pointer_in_return (gpointer pointer); -@@ -611,7 +667,7 @@ void gi_marshalling_tests_union_inout (GIMarshallingTestsUnion **union_); - - void gi_marshalling_tests_union_method (GIMarshallingTestsUnion *union_); - --/* Object */ -+ /* Object */ - - #define GI_MARSHALLING_TESTS_TYPE_OBJECT (gi_marshalling_tests_object_get_type ()) - #define GI_MARSHALLING_TESTS_OBJECT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GI_MARSHALLING_TESTS_TYPE_OBJECT, GIMarshallingTestsObject)) -@@ -650,6 +706,44 @@ struct _GIMarshallingTestsObjectClass - * @in: (in): - */ - void (* method_deep_hierarchy) (GIMarshallingTestsObject *self, gint8 in); -+ -+ /** -+ * GIMarshallingTestsObjectClass::vfunc_return_value_only: -+ */ -+ glong (* vfunc_return_value_only) (GIMarshallingTestsObject *self); -+ -+ /** -+ * GIMarshallingTestsObjectClass::vfunc_one_out_parameter: -+ * @a: (out): -+ */ -+ void (* vfunc_one_out_parameter) (GIMarshallingTestsObject *self, gfloat *a); -+ -+ /** -+ * GIMarshallingTestsObjectClass::vfunc_multiple_out_parameters: -+ * @a: (out): -+ * @b: (out): -+ */ -+ void (* vfunc_multiple_out_parameters) (GIMarshallingTestsObject *self, gfloat *a, gfloat *b); -+ -+ /** -+ * GIMarshallingTestsObjectClass::vfunc_return_value_and_one_out_parameter: -+ * @a: (out): -+ */ -+ glong (* vfunc_return_value_and_one_out_parameter) (GIMarshallingTestsObject *self, glong *a); -+ -+ /** -+ * GIMarshallingTestsObjectClass::vfunc_return_value_and_multiple_out_parameters: -+ * @a: (out): -+ * @b: (out): -+ */ -+ glong (* vfunc_return_value_and_multiple_out_parameters) (GIMarshallingTestsObject *self, glong *a, glong *b); -+ -+ /** -+ * GIMarshallingTestsObjectClass::vfunc_meth_with_err: -+ * @x: -+ * @error: A #GError -+ */ -+ gboolean (*vfunc_meth_with_err) (GIMarshallingTestsObject *object, gint x, GError **error); - }; - - struct _GIMarshallingTestsObject -@@ -674,6 +768,12 @@ void gi_marshalling_tests_object_method_int8_in (GIMarshallingTestsObject *objec - void gi_marshalling_tests_object_method_int8_out (GIMarshallingTestsObject *object, gint8 *out); - void gi_marshalling_tests_object_method_with_default_implementation (GIMarshallingTestsObject *object, gint8 in); - -+glong gi_marshalling_tests_object_vfunc_return_value_only (GIMarshallingTestsObject *self); -+void gi_marshalling_tests_object_vfunc_one_out_parameter (GIMarshallingTestsObject *self, gfloat *a); -+void gi_marshalling_tests_object_vfunc_multiple_out_parameters (GIMarshallingTestsObject *self, gfloat *a, gfloat *b); -+glong gi_marshalling_tests_object_vfunc_return_value_and_one_out_parameter (GIMarshallingTestsObject *self, glong *a); -+glong gi_marshalling_tests_object_vfunc_return_value_and_multiple_out_parameters (GIMarshallingTestsObject *self, glong *a, glong *b); -+gboolean gi_marshalling_tests_object_vfunc_meth_with_error (GIMarshallingTestsObject *object, gint x, GError **error); - - GIMarshallingTestsObject *gi_marshalling_tests_object_none_return (void); - GIMarshallingTestsObject *gi_marshalling_tests_object_full_return (void); -@@ -801,9 +901,13 @@ gint gi_marshalling_tests_int_return_out (gint *int_); - #define GI_MARSHALLING_TESTS_CONSTANT_GERROR_DOMAIN "gi-marshalling-tests-gerror-domain" - #define GI_MARSHALLING_TESTS_CONSTANT_GERROR_CODE 5 - #define GI_MARSHALLING_TESTS_CONSTANT_GERROR_MESSAGE "gi-marshalling-tests-gerror-message" -+#define GI_MARSHALLING_TESTS_CONSTANT_GERROR_DEBUG_MESSAGE "we got an error, life is shit" - - void gi_marshalling_tests_gerror(GError **error); - void gi_marshalling_tests_gerror_array_in(gint *in_ints, GError **error); -+void gi_marshalling_tests_gerror_out(GError **error, gchar **debug); -+void gi_marshalling_tests_gerror_out_transfer_none(GError **err, const gchar **debug); -+GError *gi_marshalling_tests_gerror_return(void); - - /* Overrides */ - -@@ -835,12 +939,12 @@ typedef struct _GIMarshallingTestsOverridesObject GIMarshallingTestsOverridesObj - - struct _GIMarshallingTestsOverridesObjectClass - { -- GObjectClass parent_class; -+ GObjectClass parent_class; - }; - - struct _GIMarshallingTestsOverridesObject - { -- GObject parent_instance; -+ GObject parent_instance; - - glong long_; - }; -@@ -851,7 +955,42 @@ GIMarshallingTestsOverridesObject *gi_marshalling_tests_overrides_object_new (vo - - glong gi_marshalling_tests_overrides_object_method (GIMarshallingTestsOverridesObject *object); - -- - GIMarshallingTestsOverridesObject *gi_marshalling_tests_overrides_object_returnv (void); - -+/* Properties Object */ -+ -+#define GI_MARSHALLING_TESTS_TYPE_PROPERTIES_OBJECT (gi_marshalling_tests_properties_object_get_type ()) -+#define GI_MARSHALLING_TESTS_PROPERTIES_OBJECT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GI_MARSHALLING_TESTS_TYPE_PROPERTIES_OBJECT, GIMarshallingTestsPropertiesObject)) -+#define GI_MARSHALLING_TESTS_PROPERTIES_OBJECT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GI_MARSHALLING_TESTS_TYPE_PROPERTIES_OBJECT, GIMarshallingTestsPropertiesObjectClass)) -+#define GI_MARSHALLING_TESTS_IS_PROPERTIES_OBJECT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GI_MARSHALLING_TESTS_TYPE_PROPERTIES_OBJECT)) -+#define GI_MARSHALLING_TESTS_IS_PROPERTIES_OBJECT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GI_MARSHALLING_TESTS_TYPE_PROPERTIES_OBJECT)) -+#define GI_MARSHALLING_TESTS_PROPERTIES_OBJECT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GI_MARSHALLING_TESTS_TYPE_PROPERTIES_OBJECT, GIMarshallingTestsPropertiesObjectClass)) -+ -+typedef struct _GIMarshallingTestsPropertiesObject GIMarshallingTestsPropertiesObject; -+typedef struct _GIMarshallingTestsPropertiesObjectClass GIMarshallingTestsPropertiesObjectClass; -+ -+struct _GIMarshallingTestsPropertiesObject { -+ GObject parent_instance; -+ -+ gboolean some_boolean; -+ gchar some_char; -+ guchar some_uchar; -+ gint some_int; -+ guint some_uint; -+ glong some_long; -+ gulong some_ulong; -+ gint64 some_int64; -+ guint64 some_uint64; -+ gfloat some_float; -+ gdouble some_double; -+}; -+ -+struct _GIMarshallingTestsPropertiesObjectClass { -+ GObjectClass parent_class; -+}; -+ -+GType gi_marshalling_tests_properties_object_get_type (void) G_GNUC_CONST; -+ -+GIMarshallingTestsPropertiesObject *gi_marshalling_tests_properties_object_new (void); -+ - #endif /* _GI_MARSHALLING_TESTS_H_ */ -diff --git a/tests/scanner/Regress-1.0-expected.gir b/tests/scanner/Regress-1.0-expected.gir -index 7d01ef4..ae04725 100644 ---- a/tests/scanner/Regress-1.0-expected.gir -+++ b/tests/scanner/Regress-1.0-expected.gir -@@ -141,6 +141,36 @@ use it should be. - - - -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ - -@@ -150,6 +180,29 @@ use it should be. - - - -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ - - - -@@ -169,6 +222,43 @@ use it should be. - - - -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ a hash table; will be modified -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ GError instance; must be freed by the callback -+ -+ -+ -+ - - - -@@ -492,6 +582,17 @@ use it should be. - - - -+ -+ -+ -+ -+ -+ -+ Another object -+ -+ -+ -+ - - This method is virtual. Notably its name differs from the virtual - slot name, which makes it useful for testing bindings handle this -@@ -1035,6 +1136,22 @@ Use with regress_test_obj_emit_sig_with_obj - - - -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ Another object -+ -+ -+ -+ -+ - - - -@@ -1463,6 +1580,17 @@ Use with regress_test_obj_emit_sig_with_obj - - - -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ - - -@@ -2036,6 +2164,25 @@ call and can be released on return. - - - -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ - - -@@ -2385,6 +2532,25 @@ element-type annotation. - - - -+ -+ -+ -+ -+ -+ -+ GHashTable that gets passed to callback -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ - - - -@@ -2563,6 +2729,29 @@ What we're testing here is that the scanner ignores the @a nested inside XML. - - -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ - - - -diff --git a/tests/scanner/annotation.c b/tests/scanner/annotation.c -index f28befa..a4e4efc 100644 ---- a/tests/scanner/regress.c -+++ b/tests/scanner/regress.c -@@ -1,3 +1,4 @@ -+/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */ - #include - #include - #include -@@ -1326,7 +1327,23 @@ regress_test_garray_container_return (void) - { - GPtrArray *array; - -- array = g_ptr_array_new_with_free_func (g_object_unref); -+ array = g_ptr_array_new_with_free_func (g_free); -+ g_ptr_array_add (array, g_strdup ("regress")); -+ -+ return array; -+} -+ -+/** -+ * regress_test_garray_full_return: -+ * -+ * Returns: (transfer full) (type GLib.PtrArray) (element-type utf8): -+ */ -+GPtrArray * -+regress_test_garray_full_return (void) -+{ -+ GPtrArray *array; -+ -+ array = g_ptr_array_new (); - g_ptr_array_add (array, g_strdup ("regress")); - - return array; -@@ -1656,6 +1673,35 @@ regress_test_boxed_get_type (void) - return our_type; - } - -+RegressTestBoxedB * -+regress_test_boxed_b_new (gint8 some_int8, glong some_long) -+{ -+ RegressTestBoxedB *boxed; -+ -+ boxed = g_slice_new (RegressTestBoxedB); -+ boxed->some_int8 = some_int8; -+ boxed->some_long = some_long; -+ -+ return boxed; -+} -+ -+RegressTestBoxedB * -+regress_test_boxed_b_copy (RegressTestBoxedB *boxed) -+{ -+ return regress_test_boxed_b_new (boxed->some_int8, boxed->some_long); -+} -+ -+static void -+regress_test_boxed_b_free (RegressTestBoxedB *boxed) -+{ -+ g_slice_free (RegressTestBoxedB, boxed); -+} -+ -+G_DEFINE_BOXED_TYPE(RegressTestBoxedB, -+ regress_test_boxed_b, -+ regress_test_boxed_b_copy, -+ regress_test_boxed_b_free); -+ - G_DEFINE_TYPE(RegressTestObj, regress_test_obj, G_TYPE_OBJECT); - - enum -@@ -2842,7 +2888,22 @@ regress_test_multi_callback (RegressTestCallback callback) - return sum; - } - -+/** -+ * regress_test_array_callback: -+ * @callback: (scope call): -+ * -+ **/ -+int regress_test_array_callback (RegressTestCallbackArray callback) -+{ -+ static const char *strings[] = { "one", "two", "three" }; -+ static int ints[] = { -1, 0, 1, 2 }; -+ int sum = 0; -+ -+ sum += callback(ints, 4, strings, 3); -+ sum += callback(ints, 4, strings, 3); - -+ return sum; -+} - - /** - * regress_test_simple_callback: -@@ -3026,6 +3087,58 @@ regress_test_obj_new_callback (RegressTestCallbackUserData callback, gpointer us - return g_object_new (REGRESS_TEST_TYPE_OBJ, NULL); - } - -+/** -+ * regress_test_hash_table_callback: -+ * @data: (element-type utf8 gint): GHashTable that gets passed to callback -+ * @callback: (scope call): -+ **/ -+void -+regress_test_hash_table_callback (GHashTable *data, RegressTestCallbackHashtable callback) -+{ -+ callback (data); -+} -+ -+/** -+ * regress_test_gerror_callback: -+ * @callback: (scope call): -+ **/ -+void -+regress_test_gerror_callback (RegressTestCallbackGError callback) -+{ -+ GError *error; -+ -+ error = g_error_new_literal (G_IO_ERROR, -+ G_IO_ERROR_NOT_SUPPORTED, -+ "regression test error"); -+ callback (error); -+ g_error_free (error); -+} -+ -+/** -+ * regress_test_null_gerror_callback: -+ * @callback: (scope call): -+ **/ -+void -+regress_test_null_gerror_callback (RegressTestCallbackGError callback) -+{ -+ callback (NULL); -+} -+ -+/** -+ * regress_test_owned_gerror_callback: -+ * @callback: (scope call): -+ **/ -+void -+regress_test_owned_gerror_callback (RegressTestCallbackOwnedGError callback) -+{ -+ GError *error; -+ -+ error = g_error_new_literal (G_IO_ERROR, -+ G_IO_ERROR_PERMISSION_DENIED, -+ "regression test owned error"); -+ callback (error); -+} -+ - /* interface */ - - static void -diff --git a/tests/scanner/regress.h b/tests/scanner/regress.h -index 91d1471..65a158a 100644 ---- a/tests/scanner/regress.h -+++ b/tests/scanner/regress.h -@@ -113,6 +113,7 @@ GHashTable *regress_test_ghash_nested_everything_return2 (void); - - /* GPtrArray */ - GPtrArray *regress_test_garray_container_return (void); -+GPtrArray *regress_test_garray_full_return (void); - - /* error? */ - -@@ -313,6 +314,18 @@ RegressTestBoxed *regress_test_boxed_copy (RegressTestBoxed *boxed); - gboolean regress_test_boxed_equals (RegressTestBoxed *boxed, - RegressTestBoxed *other); - -+typedef struct _RegressTestBoxedB RegressTestBoxedB; -+ -+struct _RegressTestBoxedB -+{ -+ gint8 some_int8; -+ glong some_long; -+}; -+ -+GType regress_test_boxed_b_get_type (void); -+RegressTestBoxedB *regress_test_boxed_b_new (gint8 some_int8, glong some_long); -+RegressTestBoxedB *regress_test_boxed_b_copy (RegressTestBoxedB *boxed); -+ - /* gobject */ - #define REGRESS_TEST_TYPE_OBJ (regress_test_obj_get_type ()) - #define REGRESS_TEST_OBJECT(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), REGRESS_TEST_TYPE_OBJ, RegressTestObj)) -@@ -346,6 +359,12 @@ struct _RegressTestObjClass - - int (*matrix) (RegressTestObj *obj, const char *somestr); - -+ /** -+ * RegressTestObjClass::allow_none_vfunc -+ * @two: (allow-none): Another object -+ */ -+ void (*allow_none_vfunc) (RegressTestObj *obj, RegressTestObj *two); -+ - guint test_signal; - guint test_signal_with_static_scope_arg; - -@@ -521,16 +540,36 @@ typedef void (*RegressTestSimpleCallback) (void); - typedef int (*RegressTestCallback) (void); - typedef int (*RegressTestCallbackUserData) (gpointer user_data); - /** -+ * RegressTestCallbackHashtable: -+ * @data: (element-type utf8 gint): a hash table; will be modified -+ */ -+typedef void (*RegressTestCallbackHashtable) (GHashTable *data); -+typedef void (*RegressTestCallbackGError) (const GError *error); -+/** -+ * RegressTestCallbackOwnedGError: -+ * @error: (transfer full): GError instance; must be freed by the callback -+ */ -+typedef void (*RegressTestCallbackOwnedGError) (GError *error); -+/** - * RegressTestCallbackFull: - * @foo: the investment rate - * @bar: how much money - * @path: (type filename): Path to file - */ - typedef int (*RegressTestCallbackFull) (int foo, double bar, char *path); -+/** -+ * RegressTestCallbackArray: -+ * @one: (array length=one_length): -+ * @one_length: -+ * @two: (array length=two_length) (element-type utf8): -+ * @two_length: -+ */ -+typedef int (*RegressTestCallbackArray) (int *one, gsize one_length, const char** two, int two_length); - - void regress_test_simple_callback (RegressTestSimpleCallback callback); - int regress_test_callback (RegressTestCallback callback); - int regress_test_multi_callback (RegressTestCallback callback); -+int regress_test_array_callback (RegressTestCallbackArray callback); - int regress_test_callback_user_data (RegressTestCallbackUserData callback, - gpointer user_data); - int regress_test_callback_destroy_notify (RegressTestCallbackUserData callback, -@@ -548,6 +587,10 @@ void regress_test_obj_static_method_callback (RegressTestCallback callback); - RegressTestObj *regress_test_obj_new_callback (RegressTestCallbackUserData callback, - gpointer user_data, - GDestroyNotify notify); -+void regress_test_hash_table_callback (GHashTable *data, RegressTestCallbackHashtable callback); -+void regress_test_gerror_callback (RegressTestCallbackGError callback); -+void regress_test_null_gerror_callback (RegressTestCallbackGError callback); -+void regress_test_owned_gerror_callback (RegressTestCallbackOwnedGError callback); - - typedef struct _RegressTestInterface RegressTestInterface; - -diff --git a/tests/scanner/utility.c b/tests/scanner/utility.c -index aad0d08..fb1cf5a 100644 ---- a/tests/warn/unknown-parameter.h -+++ b/tests/warn/unknown-parameter.h -@@ -19,13 +19,23 @@ void test_param_mismatch2(int a, int *out2); - // EXPECT:14: Warning: Test: test_param_mismatch2: unknown parameter 'wrong_name2' in documentation comment, should be one of 'a', 'out2' - - /** -+ * test_param_mismatch3: -+ * @a: an integer -+ * @wrong_name3: (out): -+ * -+ */ -+void test_param_mismatch3(int a, int *out3); -+ -+// EXPECT:24: Warning: Test: test_param_mismatch3: unknown parameter 'wrong_name3' in documentation comment, should be 'out3' -+ -+/** - * test_param_missing: - * @missing: (out): - * - */ - void test_param_missing(void); - --// EXPECT:23: Warning: Test: test_param_missing: unknown parameter 'missing' in documentation comment -+// EXPECT:33: Warning: Test: test_param_missing: unknown parameter 'missing' in documentation comment - - - /** diff -Nru gobject-introspection-1.31.10/debian/patches/glib_2.30_api.patch gobject-introspection-1.31.20/debian/patches/glib_2.30_api.patch --- gobject-introspection-1.31.10/debian/patches/glib_2.30_api.patch 1970-01-01 00:00:00.000000000 +0000 +++ gobject-introspection-1.31.20/debian/patches/glib_2.30_api.patch 2012-03-05 18:36:17.000000000 +0000 @@ -0,0 +1,25 @@ +Description: Fix build with glib 2.30 by reverting to deprecated g_value_[gs]et_char API. +Author: Martin Pitt + +Index: gobject-introspection/tests/gimarshallingtests.c +=================================================================== +--- gobject-introspection.orig/tests/gimarshallingtests.c 2012-02-16 17:24:41.000000000 +0100 ++++ gobject-introspection/tests/gimarshallingtests.c 2012-03-05 19:34:42.631222668 +0100 +@@ -4363,7 +4363,7 @@ + g_value_set_boolean (value, self->some_boolean); + break; + case SOME_CHAR_PROPERTY: +- g_value_set_schar (value, self->some_char); ++ g_value_set_char (value, self->some_char); + break; + case SOME_UCHAR_PROPERTY: + g_value_set_uchar (value, self->some_uchar); +@@ -4408,7 +4408,7 @@ + self->some_boolean = g_value_get_boolean (value); + break; + case SOME_CHAR_PROPERTY: +- self->some_char = g_value_get_schar (value); ++ self->some_char = g_value_get_char (value); + break; + case SOME_UCHAR_PROPERTY: + self->some_uchar = g_value_get_uchar (value); diff -Nru gobject-introspection-1.31.10/debian/patches/series gobject-introspection-1.31.20/debian/patches/series --- gobject-introspection-1.31.10/debian/patches/series 2012-02-16 16:08:11.000000000 +0000 +++ gobject-introspection-1.31.20/debian/patches/series 2012-03-05 18:36:17.000000000 +0000 @@ -1 +1 @@ -00git_updates.patch +glib_2.30_api.patch diff -Nru gobject-introspection-1.31.10/debian/rules gobject-introspection-1.31.20/debian/rules --- gobject-introspection-1.31.10/debian/rules 2012-02-16 16:08:11.000000000 +0000 +++ gobject-introspection-1.31.20/debian/rules 2012-03-05 18:49:51.000000000 +0000 @@ -14,7 +14,7 @@ DEB_MAKE_ENVVARS += HOME=$(CURDIR) DEB_MAKE_CHECK_TARGET = check -DEB_CONFIGURE_EXTRA_FLAGS += --enable-gtk-doc +DEB_CONFIGURE_EXTRA_FLAGS += --enable-gtk-doc --enable-doctool DEB_DH_MAKESHLIBS_ARGS_ALL += -V -- -c4 binary-install/gobject-introspection:: diff -Nru gobject-introspection-1.31.10/docs/reference/html/gi.devhelp2 gobject-introspection-1.31.20/docs/reference/html/gi.devhelp2 --- gobject-introspection-1.31.10/docs/reference/html/gi.devhelp2 2012-01-19 22:13:00.000000000 +0000 +++ gobject-introspection-1.31.20/docs/reference/html/gi.devhelp2 2012-03-05 14:48:09.000000000 +0000 @@ -381,6 +381,7 @@ + diff -Nru gobject-introspection-1.31.10/docs/reference/html/gi-GIBaseInfo.html gobject-introspection-1.31.20/docs/reference/html/gi-GIBaseInfo.html --- gobject-introspection-1.31.10/docs/reference/html/gi-GIBaseInfo.html 2012-01-19 22:13:00.000000000 +0000 +++ gobject-introspection-1.31.20/docs/reference/html/gi-GIBaseInfo.html 2012-03-05 14:48:09.000000000 +0000 @@ -67,7 +67,7 @@ All other structs can be casted to a GIBaseInfo, for instance:

-

Example 1. Casting a GIFunctionInfo to GIBaseInfo

+

Example 1. Casting a GIFunctionInfo to GIBaseInfo

@@ -91,7 +91,7 @@

-

Example 2. Getting the Button of the Gtk typelib

+

Example 2. Getting the Button of the Gtk typelib

@@ -480,7 +480,7 @@

-

Example 3. Iterating over attributes

+

Example 3. Iterating over attributes

diff -Nru gobject-introspection-1.31.10/docs/reference/html/gi-gir-reference.html gobject-introspection-1.31.20/docs/reference/html/gi-gir-reference.html --- gobject-introspection-1.31.10/docs/reference/html/gi-gir-reference.html 2012-01-19 22:13:00.000000000 +0000 +++ gobject-introspection-1.31.20/docs/reference/html/gi-gir-reference.html 2012-03-05 14:48:09.000000000 +0000 @@ -34,7 +34,7 @@ Possible children: namespace.
-

Example 4. A GIR fragment showing an api node

+

Example 4. A GIR fragment showing an api node

@@ -65,7 +65,7 @@ interface.
-

Example 5. A GIR fragment showing an namespace node

+

Example 5. A GIR fragment showing an namespace node

@@ -101,7 +101,7 @@ method, property.
-

Example 6. A GIR fragment showing an class node

+

Example 6. A GIR fragment showing an class node

@@ -144,7 +144,7 @@ method, property.
-

Example 7. A GIR fragment showing an interface node

+

Example 7. A GIR fragment showing an interface node

@@ -182,7 +182,7 @@ Parent node: namespace.
-

Example 8. A GIR fragment showing an function node

+

Example 8. A GIR fragment showing an function node

diff -Nru gobject-introspection-1.31.10/docs/reference/html/gi-GIVFuncInfo.html gobject-introspection-1.31.20/docs/reference/html/gi-GIVFuncInfo.html --- gobject-introspection-1.31.10/docs/reference/html/gi-GIVFuncInfo.html 2012-01-19 22:13:00.000000000 +0000 +++ gobject-introspection-1.31.20/docs/reference/html/gi-GIVFuncInfo.html 2012-03-05 14:48:09.000000000 +0000 @@ -88,7 +88,8 @@
typedef enum {
   GI_VFUNC_MUST_CHAIN_UP     = 1 << 0,
   GI_VFUNC_MUST_OVERRIDE     = 1 << 1,
-  GI_VFUNC_MUST_NOT_OVERRIDE = 1 << 2
+  GI_VFUNC_MUST_NOT_OVERRIDE = 1 << 2,
+  GI_VFUNC_THROWS =            1 << 3
 } GIVFuncInfoFlags;
 

@@ -112,6 +113,11 @@

+ + + +
does not override

GI_VFUNC_THROWS

Includes a GError +
diff -Nru gobject-introspection-1.31.10/docs/reference/html/gi-gtypelib.html gobject-introspection-1.31.20/docs/reference/html/gi-gtypelib.html --- gobject-introspection-1.31.10/docs/reference/html/gi-gtypelib.html 2012-01-19 22:13:00.000000000 +0000 +++ gobject-introspection-1.31.20/docs/reference/html/gi-gtypelib.html 2012-03-05 14:48:09.000000000 +0000 @@ -488,6 +488,7 @@ gint8 closure; gint8 destroy; + SimpleTypeBlob arg_type; } ArgBlob; @@ -1535,7 +1536,8 @@ guint16 must_be_implemented : 1; guint16 must_not_be_implemented : 1; guint16 class_closure : 1; - guint16 reserved :12; + guint16 throws : 1; + guint16 reserved :11; guint16 signal; guint16 struct_offset; @@ -1571,7 +1573,11 @@ Set if this virtual function is the class closure of a signal. -

guint16 reserved :12;

+

guint16 throws : 1;

+ + + +

guint16 reserved :11;

@@ -1812,6 +1818,8 @@ guint16 n_vfuncs; guint16 n_constants; + guint16 padding; + guint32 reserved2; guint32 reserved3; @@ -1885,6 +1893,10 @@ start on a 32bit boundary. +

guint16 padding;

+ + +

guint32 reserved2;

diff -Nru gobject-introspection-1.31.10/docs/reference/html/index.sgml gobject-introspection-1.31.20/docs/reference/html/index.sgml --- gobject-introspection-1.31.10/docs/reference/html/index.sgml 2012-01-19 22:13:00.000000000 +0000 +++ gobject-introspection-1.31.20/docs/reference/html/index.sgml 2012-03-05 14:48:09.000000000 +0000 @@ -283,6 +283,7 @@ + Binary files /tmp/r19mchCfIJ/gobject-introspection-1.31.10/docs/reference/html/overview.png and /tmp/ttCZDbu35t/gobject-introspection-1.31.20/docs/reference/html/overview.png differ diff -Nru gobject-introspection-1.31.10/gir/gio-2.0.c gobject-introspection-1.31.20/gir/gio-2.0.c --- gobject-introspection-1.31.10/gir/gio-2.0.c 2012-01-19 22:06:34.000000000 +0000 +++ gobject-introspection-1.31.20/gir/gio-2.0.c 2012-03-05 14:44:06.000000000 +0000 @@ -133,10 +133,9 @@ * @get_action_state_hint: the virtual function pointer for g_action_group_get_action_state_hint() * @get_action_enabled: the virtual function pointer for g_action_group_get_action_enabled() * @get_action_state: the virtual function pointer for g_action_group_get_action_state() - * @set_action_state: the virtual function pointer for g_action_group_set_action_state() + * @change_action_state: the virtual function pointer for g_action_group_change_action_state() * @query_action: the virtual function pointer for g_action_group_query_action() * @activate_action: the virtual function pointer for g_action_group_activate_action() - * @change_action_state: the virtual function pointer for g_action_group_change_action_state() * @action_added: the class closure for the #GActionGroup::action-added signal * @action_removed: the class closure for the #GActionGroup::action-removed signal * @action_enabled_changed: the class closure for the #GActionGroup::action-enabled-changed signal @@ -260,7 +259,7 @@ * * The ::command-line signal is emitted on the primary instance when * a commandline is not handled locally. See g_application_run() and - * the #GApplicationCommandline documentation for more information. + * the #GApplicationCommandLine documentation for more information. * * process. See g_application_command_line_set_exit_status(). * @@ -1397,6 +1396,7 @@ * @get_info: Returns a #GDBusInterfaceInfo. See g_dbus_interface_get_info(). * @get_object: Gets the enclosing #GDBusObject. See g_dbus_interface_get_object(). * @set_object: Sets the enclosing #GDBusObject. See g_dbus_interface_set_object(). + * @dup_object: Gets a reference to the enclosing #GDBusObject. See g_dbus_interface_dup_object(). Added in 2.32. * * Base type for D-Bus interfaces. * @@ -2203,6 +2203,10 @@ * that both @changed_properties and @invalidated_properties are * guaranteed to never be %NULL (either may be empty though). * + * If the proxy has the flag + * %G_DBUS_PROXY_FLAGS_GET_INVALIDATED_PROPERTIES set, then + * @invalidated_properties will always be empty. + * * This signal corresponds to the * PropertiesChanged D-Bus signal on the * org.freedesktop.DBus.Properties interface. @@ -2327,7 +2331,7 @@ /** * GDBusProxy:g-name-owner: * - * The unique name that owns #GDBusProxy:name or %NULL if no-one + * The unique name that owns #GDBusProxy:g-name or %NULL if no-one * currently owns that name. You may connect to #GObject::notify signal to * track changes to this property. * @@ -2361,6 +2365,7 @@ * @G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES: Don't load properties. * @G_DBUS_PROXY_FLAGS_DO_NOT_CONNECT_SIGNALS: Don't connect to signals on the remote object. * @G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START: If not set and the proxy if for a well-known name, then request the bus to launch an owner for the name if no-one owns the name. This flag can only be used in proxies for well-known names. + * @G_DBUS_PROXY_FLAGS_GET_INVALIDATED_PROPERTIES: If set, the property value for any invalidated property will be (asynchronously) retrieved upon receiving the PropertiesChanged D-Bus signal and the property will not cause emission of the #GDBusProxy::g-properties-changed signal. When the value is received the #GDBusProxy::g-properties-changed signal is emitted for the property along with the retrieved value. Since 2.32. * * Flags used when constructing an instance of a #GDBusProxy derived class. * @@ -3413,9 +3418,9 @@ /** * GIOErrorEnum: * @G_IO_ERROR_FAILED: Generic error condition for when any operation fails. - * @G_IO_ERROR_NOT_FOUND: File not found error. - * @G_IO_ERROR_EXISTS: File already exists error. - * @G_IO_ERROR_IS_DIRECTORY: File is a directory error. + * @G_IO_ERROR_NOT_FOUND: File not found. + * @G_IO_ERROR_EXISTS: File already exists. + * @G_IO_ERROR_IS_DIRECTORY: File is a directory. * @G_IO_ERROR_NOT_DIRECTORY: File is not a directory. * @G_IO_ERROR_NOT_EMPTY: File is a directory that isn't empty. * @G_IO_ERROR_NOT_REGULAR_FILE: File is not a regular file. @@ -3483,8 +3488,8 @@ /** * GIOModuleScopeFlags: - * @G_IO_MODULES_SCOPE_NONE: No module scan flags - * @G_IO_MODULES_SCOPE_BLOCK_DUPLICATES: When using this scope to load or scan modules, automatically block a modules which has the same base basename as previously loaded module. + * @G_IO_MODULE_SCOPE_NONE: No module scan flags + * @G_IO_MODULE_SCOPE_BLOCK_DUPLICATES: When using this scope to load or scan modules, automatically block a modules which has the same base basename as previously loaded module. * * Flags for use with g_io_module_scope_new(). * @@ -3841,6 +3846,82 @@ /** + * GLIB_VERSION_2_26: + * + * A macro that evaluates to the 2.26 version of GLib, in a format + * that can be used by the C pre-processor. + * + * Since: 2.32 + */ + + +/** + * GLIB_VERSION_2_28: + * + * A macro that evaluates to the 2.28 version of GLib, in a format + * that can be used by the C pre-processor. + * + * Since: 2.32 + */ + + +/** + * GLIB_VERSION_2_30: + * + * A macro that evaluates to the 2.30 version of GLib, in a format + * that can be used by the C pre-processor. + * + * Since: 2.32 + */ + + +/** + * GLIB_VERSION_2_32: + * + * A macro that evaluates to the 2.32 version of GLib, in a format + * that can be used by the C pre-processor. + * + * Since: 2.32 + */ + + +/** + * GLIB_VERSION_MAX_ALLOWED: + * + * A macro that should be defined by the user prior to including + * the glib.h header. + * The definition should be one of the predefined GLib version + * macros: %GLIB_VERSION_2_26, %GLIB_VERSION_2_28,... + * + * This macro defines the upper bound for the GLib API to use. + * + * If a function has been introduced in a newer version of GLib, + * it is possible to use this symbol to get compiler warnings when + * trying to use that function. + * + * Since: 2.32 + */ + + +/** + * GLIB_VERSION_MIN_REQUIRED: + * + * A macro that should be defined by the user prior to including + * the glib.h header. + * The definition should be one of the predefined GLib version + * macros: %GLIB_VERSION_2_26, %GLIB_VERSION_2_28,... + * + * This macro defines the lower bound for the GLib API to use. + * + * If a function has been deprecated in a newer version of GLib, + * it is possible to use this symbol to avoid the compiler warnings + * without disabling warning for every deprecated function. + * + * Since: 2.32 + */ + + +/** * GLoadableIcon: * * Generic type for all kinds of icons that can be loaded @@ -4124,7 +4205,7 @@ * @g_iface: The parent interface. * @changed: Changed signal that is emitted when the mount's state has changed. * @unmounted: The unmounted signal that is emitted when the #GMount have been unmounted. If the recipient is holding references to the object they should release them so the object can be finalized. - * @pre_unmount: The pre_unmout signal that is emitted when the #GMount will soon be emitted. If the recipient is somehow holding the mount open by keeping an open file on it it should close the file. + * @pre_unmount: The ::pre-unmount signal that is emitted when the #GMount will soon be emitted. If the recipient is somehow holding the mount open by keeping an open file on it it should close the file. * @get_root: Gets a #GFile to the root directory of the #GMount. * @get_name: Gets a string containing the name of the #GMount. * @get_icon: Gets a #GIcon for the #GMount. @@ -4140,7 +4221,7 @@ * @remount: Starts remounting a #GMount. * @remount_finish: Finishes a remounting operation. * @guess_content_type: Starts guessing the type of the content of a #GMount. See g_mount_guess_content_type() for more information on content type guessing. This operation was added in 2.18. - * @guess_content_type_finish: Finishes a contenet type guessing operation. Added in 2.18. + * @guess_content_type_finish: Finishes a content type guessing operation. Added in 2.18. * @guess_content_type_sync: Synchronous variant of @guess_content_type. Added in 2.18 * @unmount_with_operation: Starts unmounting a #GMount using a #GMountOperation. Since 2.22. * @unmount_with_operation_finish: Finishes an unmounting operation using a #GMountOperation. Since 2.22. @@ -5175,8 +5256,9 @@ * GProxyInterface: * @g_iface: The parent interface. * @connect: Connect to proxy server and wrap (if required) the #connection to handle payload. - * @connect_async: Same has connect() but asynchronous. + * @connect_async: Same as connect() but asynchronous. * @connect_finish: Returns the result of connect_async() + * @supports_hostname: Returns whether the proxy supports hostname lookups. * * Provides an interface for handling proxy connection and payload. * @@ -5430,7 +5512,7 @@ * @tell: Tells the current location within a stream. * @can_seek: Checks if seeking is supported by the stream. * @seek: Seeks to a location within a stream. - * @can_truncate: Chekcs if truncation is suppored by the stream. + * @can_truncate: Checks if truncation is supported by the stream. * @truncate_fn: Truncates a stream. * * Provides an interface for implementing seekable functionality on I/O Streams. @@ -5719,6 +5801,15 @@ /** + * GSignalCVaMarshaller: + * + * This is the signature of va_list marshaller functions, an optional + * marshaller that can be used in some situations to avoid + * marshalling the signal argument into GValues. + */ + + +/** * GSignalEmissionHook: * @ihint: Signal invocation hint, see #GSignalInvocationHint. * @n_param_values: the number of parameters to the function, including the instance on which the signal was emitted. @@ -6107,7 +6198,7 @@ * Each event except %G_SOCKET_CLIENT_COMPLETE may be emitted * multiple times (or not at all) for a given connectable (in * particular, if @client ends up attempting to connect to more than - * one address). However, if @client emits the #GSocketClient:event + * one address). However, if @client emits the #GSocketClient::event * signal at all for a given connectable, that it will always emit * it with %G_SOCKET_CLIENT_COMPLETE when it is done. * @@ -6423,7 +6514,8 @@ * @G_SPAWN_ERROR_CHDIR: Changing to working directory failed. * @G_SPAWN_ERROR_ACCES: execv() returned EACCES * @G_SPAWN_ERROR_PERM: execv() returned EPERM - * @G_SPAWN_ERROR_2BIG: execv() returned E2BIG + * @G_SPAWN_ERROR_TOO_BIG: execv() returned E2BIG + * @G_SPAWN_ERROR_2BIG: deprecated alias for %G_SPAWN_ERROR_TOO_BIG * @G_SPAWN_ERROR_NOEXEC: execv() returned ENOEXEC * @G_SPAWN_ERROR_NAMETOOLONG: execv() returned ENAMETOOLONG * @G_SPAWN_ERROR_NOENT: execv() returned ENOENT @@ -6972,8 +7064,9 @@ * @G_TLS_DATABASE_LOOKUP_NONE: No lookup flags * @G_TLS_DATABASE_LOOKUP_KEYPAIR: Restrict lookup to certificates that have a private key. * - * Flags for g_tls_database_lookup_handle(), g_tls_database_lookup_issuer(), - * and g_tls_database_lookup_issued(). + * Flags for g_tls_database_lookup_certificate_handle(), + * g_tls_database_lookup_certificate_issuer(), + * and g_tls_database_lookup_certificates_issued_by(). * * Since: 2.30 */ @@ -7444,6 +7537,8 @@ * @G_UNICODE_BREAK_HANGUL_LV_SYLLABLE: Hangul LV Syllable (H2) * @G_UNICODE_BREAK_HANGUL_LVT_SYLLABLE: Hangul LVT Syllable (H3) * @G_UNICODE_BREAK_CLOSE_PARANTHESIS: Closing Parenthesis (CP). Since 2.28 + * @G_UNICODE_BREAK_CONDITIONAL_JAPANESE_STARTER: Conditional Japanese Starter (CJ). Since: 2.32 + * @G_UNICODE_BREAK_HEBREW_LETTER: Hebrew Letter (HL). Since: 2.32 * * These are the possible line break classifications. * @@ -7544,6 +7639,13 @@ * @G_UNICODE_SCRIPT_BATAK: Batak. Since 2.28 * @G_UNICODE_SCRIPT_BRAHMI: Brahmi. Since 2.28 * @G_UNICODE_SCRIPT_MANDAIC: Mandaic. Since 2.28 + * @G_UNICODE_SCRIPT_CHAKMA: Chakma. Since: 2.32 + * @G_UNICODE_SCRIPT_MEROITIC_CURSIVE: Meroitic Cursive. Since: 2.32 + * @G_UNICODE_SCRIPT_MEROITIC_HIEROGLYPHS, Meroitic Hieroglyphs. Since: 2.32 + * @G_UNICODE_SCRIPT_MIAO: Miao. Since: 2.32 + * @G_UNICODE_SCRIPT_SHARADA: Sharada. Since: 2.32 + * @G_UNICODE_SCRIPT_SORA_SOMPENG: Sora Sompeng. Since: 2.32 + * @G_UNICODE_SCRIPT_TAKRI: Takri. Since: 2.32 * * The #GUnicodeScript enumeration identifies different writing * systems. The values correspond to the names as defined in the @@ -9688,6 +9790,7 @@ * Checks whether the given #GParamSpec is of type %G_TYPE_PARAM_VALUE_ARRAY. * * Returns: %TRUE on success. + * Deprecated: 2.32: Use #GArray instead of #GValueArray */ @@ -10097,6 +10200,8 @@ * @pspec: a valid #GParamSpec instance * * Cast a #GParamSpec instance into a #GParamSpecValueArray. + * + * Deprecated: 2.32: Use #GArray instead of #GValueArray */ @@ -11282,6 +11387,8 @@ * G_TYPE_PARAM_VALUE_ARRAY: * * The #GType of #GParamSpecValueArray. + * + * Deprecated: 2.32: Use #GArray instead of #GValueArray */ @@ -11470,6 +11577,8 @@ * * The type ID of the "GValueArray" type which is a boxed type, * used to pass around pointers to GValueArrays. + * + * Deprecated: 2.32: Use #GArray instead of #GValueArray */ @@ -12081,6 +12190,24 @@ /** + * G_VOLUME_IDENTIFIER_KIND_CLASS: + * + * The string used to obtain the volume class + * with g_volume_get_identifier(). + * + * Known volume classes include device and + * network. Other classes may be added in the + * future. + * + * This is intended to be used by applications to classify #GVolume + * instances into different sections - for example a file manager or + * file chooser can use this information to show + * network volumes under a "Network" heading and + * device volumes under a "Devices" heading. + */ + + +/** * G_VOLUME_IDENTIFIER_KIND_HAL_UDI: * * The string used to obtain a Hal UDI with g_volume_get_identifier(). @@ -12285,7 +12412,7 @@ * detail. * * To access an exported #GActionGroup remotely, use - * g_dbus_action_group_new() to obtain a #GDBusActionGroup. + * g_dbus_action_group_get() to obtain a #GDBusActionGroup. */ @@ -12420,10 +12547,8 @@ * g_action_group_activate_action() on the application, it is always * invoked in the primary instance. The actions are also exported on * the session bus, and GIO provides the #GDBusActionGroup wrapper to - * conveniently access them remotely. Additionally, g_application_set_app_menu() - * and g_application_set_menubar() can be used to export representation - * data for the actions, in the form of #GMenuModels. GIO provides - * a #GDBusMenuModel wrapper for remote access to exported #GMenuModels. + * conveniently access them remotely. GIO provides a #GDBusMenuModel wrapper + * for remote access to exported #GMenuModels. * * There is a number of different entry points into a GApplication: * @@ -12441,7 +12566,7 @@ * in the form of a #GVariant dictionary mapping strings to variants. * To use platform data, override the @before_emit or @after_emit virtual * functions in your #GApplication subclass. When dealing with - * #GApplicationCommandline objects, the platform data is directly + * #GApplicationCommandLine objects, the platform data is directly * available via g_application_command_line_get_cwd(), * g_application_command_line_get_environ() and * g_application_command_line_get_platform_data(). @@ -12451,7 +12576,7 @@ * "cwd"), and optionally the environment (ie the set of environment * variables and their values) of the calling process (key "environ"). * The environment is only added to the platform data if the - * #G_APPLICATION_SEND_ENVIONMENT flag is set. GApplication subclasses + * %G_APPLICATION_SEND_ENVIRONMENT flag is set. #GApplication subclasses * can add their own platform data by overriding the @add_platform_data * virtual function. For instance, #GtkApplication adds startup notification * data in this way. @@ -12514,7 +12639,7 @@ * of this object (ie: the process exits when the last reference is * dropped). * - * The main use for #GApplicationCommandline (and the + * The main use for #GApplicationCommandLine (and the * #GApplication::command-line signal) is 'Emacs server' like use cases: * You can set the EDITOR environment variable to have * e.g. git use your favourite editor to edit commit messages, and if you @@ -12556,7 +12681,7 @@ * * An example of deferred commandline handling. Here, the commandline is * not completely handled before the #GApplication::command-line handler - * returns. Instead, we keep a reference to the GApplicationCommandline + * returns. Instead, we keep a reference to the GApplicationCommandLine * object and handle it later(in this example, in an idle). Note that it * is necessary to hold the application until you are done with the * commandline. @@ -13036,17 +13161,17 @@ * (i.e. connect to D-Bus): for instance, g_dbus_connection_new() and * g_bus_get(), and the synchronous versions of those methods, give you an * initialized connection. Language bindings for GIO should use - * g_initable_new() or g_async_initable_new(), which also initialize the + * g_initable_new() or g_async_initable_new_async(), which also initialize the * connection. * * If you construct an uninitialized #GDBusConnection, such as via * g_object_new(), you must initialize it via g_initable_init() or - * g_async_initable_init() before using its methods or properties. Calling - * methods or accessing properties on a #GDBusConnection that has not completed - * initialization successfully is considered to be invalid, and leads to - * undefined behaviour. In particular, if initialization fails with a #GError, - * the only valid thing you can do with that #GDBusConnection is to free it - * with g_object_unref(). + * g_async_initable_init_async() before using its methods or properties. + * Calling methods or accessing properties on a #GDBusConnection that has not + * completed initialization successfully is considered to be invalid, and leads + * to undefined behaviour. In particular, if initialization fails with a + * #GError, the only valid thing you can do with that #GDBusConnection is to + * free it with g_object_unref(). * * D-Bus server exampleFIXME: MISSING XINCLUDE CONTENT * @@ -13631,15 +13756,15 @@ * using wildcards, e.g. "standard::*" will return all of the keys in the * "standard" namespace. * - * Values are stored within the list in #GFileAttributeValue structures. - * Values can store different types, listed in the enum #GFileAttributeType. - * Upon creation of a #GFileAttributeValue, the type will be set to - * %G_FILE_ATTRIBUTE_TYPE_INVALID. - * * The list of possible attributes for a filesystem (pointed to by a #GFile) is * available as a #GFileAttributeInfoList. This list is queryable by key names * as indicated earlier. * + * Information is stored within the list in #GFileAttributeInfo structures. + * The info structure can store different types, listed in the enum + * #GFileAttributeType. Upon creation of a #GFileAttributeInfo, the type will + * be set to %G_FILE_ATTRIBUTE_TYPE_INVALID. + * * Classes that implement #GFileIface will create a #GFileAttributeInfoList and * install default keys and values for their given file system, architecture, * and other possible implementation details (e.g., on a UNIX system, a file @@ -13896,7 +14021,7 @@ * stream to jump to arbitrary positions in the file, provided the * filesystem of the file allows it. To find the position of a file * input stream, use g_seekable_tell(). To find out if a file input - * stream supports seeking, use g_seekable_stream_can_seek(). + * stream supports seeking, use g_seekable_can_seek(). * To position a file input stream, use g_seekable_seek(). */ @@ -14244,9 +14369,6 @@ * a regular item, use g_menu_insert(). To add a section, use * g_menu_insert_section(). To add a submenu, use * g_menu_insert_submenu(). - * - * Often it is more convenient to create a #GMenu from an XML - * fragment, using GMenu Markup. */ @@ -14266,48 +14388,6 @@ /** - * SECTION:gmenumarkup - * @title: GMenu Markup - * @short_description: parsing and printing GMenuModel XML - * - * The functions here allow to instantiate #GMenuModels by parsing - * fragments of an XML document. - * * The XML format for #GMenuModel consists of a toplevel - * menu element, which contains one or more - * item elements. Each item - * element contains attribute and link - * elements with a mandatory name attribute. - * link elements have the same content - * model as menu. - * - * Here is the XML for : - * |[FIXME: MISSING XINCLUDE CONTENT]| - * - * The parser also understands a somewhat less verbose format, in which - * attributes are encoded as actual XML attributes of item - * elements, and link elements are replaced by - * section and submenu elements. - * - * Here is how the example looks in this format: - * |[FIXME: MISSING XINCLUDE CONTENT]| - * - * The parser can obtaing translations for attribute values using gettext. - * To make use of this, the menu element must - * have a domain attribute which specifies the gettext domain to use, and - * attribute elements can be marked for translation - * with a translatable="yes" attribute. It is also possible - * to specify message context and translator comments, using the context - * and comments attributes. - * - * The following DTD describes the XML format approximately: - * |[FIXME: MISSING XINCLUDE CONTENT]| - * - * To serialize a #GMenuModel into an XML fragment, use - * g_menu_markup_print_string(). - */ - - -/** * SECTION:gmenumodel * @title: GMenuModel * @short_description: An abstract class representing the contents of a menu @@ -14450,7 +14530,7 @@ * SECTION:gmount * @short_description: Mount management * @include: gio/gio.h - * @see_also: GVolume, GUnixMount + * @see_also: GVolume, GUnixMountEntry, GUnixMountPoint * * The #GMount interface represents user-visible mounts. Note, when * porting from GnomeVFS, #GMount is the moral equivalent of #GnomeVFSVolume. @@ -14461,8 +14541,8 @@ * might not be related to a volume object. * * Unmounting a #GMount instance is an asynchronous operation. For - * more information about asynchronous operations, see #GAsyncReady - * and #GSimpleAsyncReady. To unmount a #GMount instance, first call + * more information about asynchronous operations, see #GAsyncResult + * and #GSimpleAsyncResult. To unmount a #GMount instance, first call * g_mount_unmount_with_operation() with (at least) the #GMount instance and a * #GAsyncReadyCallback. The callback will be fired when the * operation has resolved (either with success or failure), and a @@ -14517,7 +14597,9 @@ * @short_description: Network status monitor * @include: gio/gio.h * - * + * #GNetworkMonitor provides an easy-to-use cross-platform API + * for monitoring network connectivity. On Linux, the implementation + * is based on the kernels netlink interface. */ @@ -14698,7 +14780,7 @@ * GMenu markup xml, CSS files, icons, etc. These are often shipped as files in $datadir/appname, or * manually included as literal strings in the code. * - * The #GResource API and the glib-compile-resources program + * The #GResource API and the glib-compile-resources program * provide a convenient and efficient alternative to this which has some nice properties. You * maintain the files as normal files, so its easy to edit them, but during the build the files * are combined into a binary bundle that is linked into the executable. This means that loading @@ -14710,7 +14792,23 @@ * in a compressed form, but will be automatically uncompressed when the resource is used. This * is very useful e.g. for larger text files that are parsed once (or rarely) and then thrown away. * - * Resource bundles are created by the glib-compile-resources program + * Resource files can also be marked to be preprocessed, by setting the value of the + * preprocess attribute to a comma-separated list of preprocessing options. + * The only options currently supported are: + * + * xml-stripblanks which will use xmllint to strip + * ignorable whitespace from the xml file. For this to work, the XMLLINT + * environment variable must be set to the full path to the xmllint executable, or xmllint + * must be in the PATH; otherwise the preprocessing step is skipped. + * + * to-pixdata which will use gdk-pixbuf-pixdata to convert + * images to the GdkPixdata format, which allows you to create pixbufs directly using the data inside + * the resource file, rather than an (uncompressed) copy if it. For this, the gdk-pixbuf-pixdata + * program must be in the PATH, or the GDK_PIXBUF_PIXDATA environment variable must be + * set to the full path to the gdk-pixbuf-pixdata executable; otherwise the resource compiler will + * abort. + * + * Resource bundles are created by the glib-compile-resources program * which takes an xml file that describes the bundle, and a set of files that the xml references. These * are combined into a binary resource bundle. * @@ -14721,7 +14819,7 @@ * * data/splashscreen.png * dialog.ui - * menumarkup.xml + * menumarkup.xml * * * ]]> @@ -14736,7 +14834,7 @@ * Note that all resources in the process share the same namespace, so use java-style * path prefixes (like in the above example) to avoid conflicts. * - * You can then use glib-compile-resources to compile the xml to a + * You can then use glib-compile-resources to compile the xml to a * binary bundle that you can load with g_resource_load(). However, its more common to use the --generate-source and * --generate-header arguments to create a source file and header to link directly into your application. * @@ -15381,8 +15479,8 @@ * @include: gio/gio.h * @see_also: #GSocketConnection, #GSocketListener * - * #GSocketClient is a high-level utility class for connecting to a - * network host using a connection oriented socket type. + * #GSocketClient is a lightweight high-level utility class for connecting to + * a network host using a connection oriented socket type. * * You create a #GSocketClient object, set any options you want, and then * call a sync or async connect operation, which returns a #GSocketConnection @@ -15392,6 +15490,9 @@ * the underlying socket that is in use. For instance, for a TCP/IP connection * it will be a #GTcpConnection. * + * As #GSocketClient is a lightweight object, you don't need to cache it. You + * can just create a new one any time you need one. + * * Since: 2.22 */ @@ -16000,8 +16101,8 @@ * equivalent of #GnomeVFSDrive. * * Mounting a #GVolume instance is an asynchronous operation. For more - * information about asynchronous operations, see #GAsyncReady and - * #GSimpleAsyncReady. To mount a #GVolume, first call + * information about asynchronous operations, see #GAsyncResult and + * #GSimpleAsyncResult. To mount a #GVolume, first call * g_volume_mount() with (at least) the #GVolume instance, optionally * a #GMountOperation object and a #GAsyncReadyCallback. * @@ -16035,7 +16136,7 @@ * when the gvfs hal volume monitor is in use. Other volume monitors * will generally be able to provide the #G_VOLUME_IDENTIFIER_KIND_UNIX_DEVICE * identifier, which can be used to obtain a hal device by means of - * libhal_manger_find_device_string_match(). + * libhal_manager_find_device_string_match(). */ @@ -16626,7 +16727,7 @@ * g_action_group_get_action_parameter_type(), * g_action_group_get_action_state_type(), * g_action_group_get_action_state_hint() and - * g_action_group_get_state() with a single function call. + * g_action_group_get_action_state() with a single function call. * * This provides two main benefits. * @@ -17329,7 +17430,7 @@ * * Activates the application. * - * In essence, this results in the #GApplication::activate() signal being + * In essence, this results in the #GApplication::activate signal being * emitted in the primary instance. * * The application must be registered before calling this function. @@ -17543,7 +17644,6 @@ /** * g_application_get_default: - * @returns: (transfer none): the default application for this process, or %NULL * * Returns the default #GApplication instance for this process. * @@ -17553,6 +17653,7 @@ * * If there is no default application then %NULL is returned. * + * Returns: (transfer none): the default application for this process, or %NULL * Since: 2.32 */ @@ -17697,6 +17798,24 @@ /** + * g_application_quit: + * @application: a #GApplication + * + * Immediately quits the application. + * + * Upon return to the mainloop, g_application_run() will return, + * calling only the 'shutdown' function before doing so. + * + * The hold count is ignored. + * + * The result of calling g_application_run() again after it returns is + * unspecified. + * + * Since: 2.32 + */ + + +/** * g_application_register: * @application: a #GApplication * @cancellable: a #GCancellable, or %NULL @@ -17780,7 +17899,7 @@ * If local_command_line() returns %FALSE then the application is registered * and the #GApplication::command-line signal is emitted in the primary * instance (which may or may not be this instance). The signal handler - * gets passed a #GApplicationCommandline object that (among other things) + * gets passed a #GApplicationCommandLine object that (among other things) * contains the remaining commandline arguments that have not been handled * by local_command_line(). * @@ -17800,7 +17919,7 @@ * * If you need to handle commandline arguments that are not filenames, * and you don't mind commandline handling to happen in the primary - * instance, you should set %G_APPLICATION_HANDLED_COMMAND_LINE and + * instance, you should set %G_APPLICATION_HANDLES_COMMAND_LINE and * process the commandline arguments in your #GApplication::command-line * signal handler, either manually or using the #GOptionContext API. * @@ -19089,7 +19208,7 @@ * @inbuf_size: the number of bytes in @inbuf * @outbuf: a buffer to write converted data in. * @outbuf_size: the number of bytes in @outbuf, must be at least one - * @flags: a #GConvertFlags controlling the conversion details + * @flags: a #GConverterFlags controlling the conversion details * @bytes_read: (out): will be set to the number of bytes read from @inbuf on success * @bytes_written: (out): will be set to the number of bytes written to @outbuf on success * @error: location to store the error occurring, or %NULL to ignore @@ -21499,6 +21618,20 @@ /** + * g_dbus_interface_dup_object: + * @interface_: An exported D-Bus interface. + * + * Gets the #GDBusObject that @interface_ belongs to, if any. + * + * reference should be freed with g_object_unref(). + * + * Returns: (transfer full): A #GDBusObject or %NULL. The returned + * Since: 2.32 + * Rename to: g_dbus_interface_get_object + */ + + +/** * g_dbus_interface_get_info: * @interface_: An exported D-Bus interface. * @@ -21511,11 +21644,16 @@ /** - * g_dbus_interface_get_object: + * g_dbus_interface_get_object: (skip) * @interface_: An exported D-Bus interface. * * Gets the #GDBusObject that @interface_ belongs to, if any. * + * It is not safe to use the returned object if @interface_ + * or the returned object is being used from other threads. See + * g_dbus_interface_dup_object() for a thread-safe + * alternative. + * * reference belongs to @interface_ and should not be freed. * * Returns: (transfer none): A #GDBusObject or %NULL. The returned @@ -21811,7 +21949,7 @@ * Stops exporting @interface_ on all connections it is exported on. * * To unexport @interface_ from only a single connection, use - * g_dbus_interface_skeleton_export_from_connection() + * g_dbus_interface_skeleton_unexport_from_connection() * * Since: 2.30 */ @@ -24409,7 +24547,7 @@ * @drive: a #GDrive * * Gets the kinds of identifiers that @drive has. - * Use g_drive_get_identifer() to obtain the identifiers + * Use g_drive_get_identifier() to obtain the identifiers * themselves. * * array of strings containing kinds of identifiers. Use g_strfreev() @@ -25961,7 +26099,8 @@ * @src_info: source to copy attributes from. * @dest_info: destination to copy attributes to. * - * Copies all of the #GFileAttributes from @src_info to @dest_info. + * Copies all of the GFileAttributes + * from @src_info to @dest_info. */ @@ -26363,7 +26502,8 @@ * @type: a #GFileAttributeType * @value_p: pointer to the value * - * Sets the @attribute to contain the given value, if possible. + * Sets the @attribute to contain the given value, if possible. To unset the + * attribute, use %G_ATTRIBUTE_TYPE_INVALID for @type. */ @@ -27243,7 +27383,7 @@ * returned by g_get_tmp_dir()) and returns a #GFile and * #GFileIOStream pointing to it. * - * @template should be a string in the GLib file name encoding + * @tmpl should be a string in the GLib file name encoding * containing a sequence of six 'X' characters, and containing no * directory components. If it is %NULL, a default template is used. * @@ -28818,18 +28958,6 @@ /** - * g_inet_address_get_scope_id: - * @address: a %G_SOCKET_FAMILY_IPV6 #GInetAddress - * - * Gets the sin6_scope_id field from @address, - * which must be an IPv6 address. - * - * Returns: the scope id field - * Since: 2.32 - */ - - -/** * g_inet_address_mask_equal: * @mask: a #GInetAddressMask * @mask2: another #GInetAddressMask @@ -29048,6 +29176,18 @@ /** + * g_inet_socket_address_get_scope_id: + * @address: a %G_SOCKET_FAMILY_IPV6 #GInetAddress + * + * Gets the sin6_scope_id field from @address, + * which must be an IPv6 address. + * + * Returns: the scope id field + * Since: 2.32 + */ + + +/** * g_inet_socket_address_new: * @address: a #GInetAddress * @port: a port number @@ -29104,7 +29244,7 @@ * @first_property_name: the name of the first property, or %NULL if no properties * @...: the value if the first property, followed by and other property value pairs, and ended by %NULL. * - * Helper function for constructing #GInitiable object. This is + * Helper function for constructing #GInitable object. This is * similar to g_object_new() but also initializes the object * and returns %NULL, setting an error on failure. * @@ -29121,7 +29261,7 @@ * @cancellable: optional #GCancellable object, %NULL to ignore. * @error: a #GError location to store the error occurring, or %NULL to ignore. * - * Helper function for constructing #GInitiable object. This is + * Helper function for constructing #GInitable object. This is * similar to g_object_new_valist() but also initializes the object * and returns %NULL, setting an error on failure. * @@ -29138,7 +29278,7 @@ * @cancellable: optional #GCancellable object, %NULL to ignore. * @error: a #GError location to store the error occurring, or %NULL to ignore. * - * Helper function for constructing #GInitiable object. This is + * Helper function for constructing #GInitable object. This is * similar to g_object_newv() but also initializes the object * and returns %NULL, setting an error on failure. * @@ -29687,7 +29827,7 @@ * Create a new scope for loading of IO modules. A scope can be used for * blocking duplicate modules, or blocking a module you don't want to load. * - * Specify the %G_IO_MODULES_SCOPE_BLOCK_DUPLICATES flag to block modules + * Specify the %G_IO_MODULE_SCOPE_BLOCK_DUPLICATES flag to block modules * which have the same base name as a module that has already been seen * in this scope. * @@ -30421,7 +30561,7 @@ * @submenu: a #GMenuModel with the items of the submenu * * Convenience function for appending a submenu menu item to the end of - * @menu. Combine g_menu_new_submenu() and g_menu_insert_item() for a + * @menu. Combine g_menu_item_new_submenu() and g_menu_insert_item() for a * more flexible alternative. * * Since: 2.32 @@ -30457,8 +30597,8 @@ * * If successful, @name and @value are set to the name and value of the * attribute that has just been advanced to. At this point, - * g_menu_item_get_name() and g_menu_item_get_value() will return the - * same values again. + * g_menu_attribute_iter_get_name() and g_menu_attribute_iter_get_value() will + * return the same values again. * * The value returned in @name remains valid for as long as the iterator * remains at the current position. The value returned in @value must @@ -30586,7 +30726,7 @@ * @submenu: a #GMenuModel with the items of the submenu * * Convenience function for inserting a submenu menu item into @menu. - * Combine g_menu_new_submenu() and g_menu_insert_item() for a more + * Combine g_menu_item_new_submenu() and g_menu_insert_item() for a more * flexible alternative. * * Since: 2.32 @@ -30848,8 +30988,7 @@ * a separator between an action name and a target string. In this * case, this call is equivalent to calling * g_menu_item_set_action_and_target() with the part before the "::" and - * g_menu_item_set_target_value() with a string-type #GVariant - * containing the part following the "::". + * with a string-type #GVariant containing the part following the "::". * * If @detailed_action doesn't contain "::" then the action is set to * the given string (verbatim) and the target value is unset. @@ -30858,7 +30997,7 @@ * g_menu_item_set_action_and_target_value() for more flexible (but * slightly less convenient) alternatives. * - * See also g_menu_set_action_and_target_value() for a description of + * See also g_menu_item_set_action_and_target_value() for a description of * the semantics of the action and target attributes. * * Since: 2.32 @@ -30961,7 +31100,7 @@ * * If successful, @out_link and @value are set to the name and #GMenuModel * of the link that has just been advanced to. At this point, - * g_menu_item_get_name() and g_menu_item_get_value() will return the + * g_menu_link_iter_get_name() and g_menu_link_iter_get_value() will return the * same values again. * * The value returned in @out_link remains valid for as long as the iterator @@ -31005,130 +31144,6 @@ /** - * g_menu_markup_parser_end: - * @context: a #GMarkupParseContext - * - * Stop the parsing of a set of menus and return the #GHashTable. - * - * The #GHashTable maps strings to #GObject instances. The parser only - * adds #GMenu instances to the table, but it may contain other types if - * a table was provided to g_menu_markup_parser_start(). - * - * This call should be matched with g_menu_markup_parser_start(). - * See that function for more information - * - * Returns: (transfer full): the #GHashTable containing the objects - * Since: 2.32 - */ - - -/** - * g_menu_markup_parser_end_menu: - * @context: a #GMarkupParseContext - * - * Stop the parsing of a menu and return the newly-created #GMenu. - * - * This call should be matched with g_menu_markup_parser_start_menu(). - * See that function for more information - * - * Returns: (transfer full): the newly-created #GMenu - * Since: 2.32 - */ - - -/** - * g_menu_markup_parser_start: - * @context: a #GMarkupParseContext - * @domain: (allow-none): translation domain for labels, or %NULL - * @objects: (allow-none): a #GHashTable for the objects, or %NULL - * - * Begin parsing a group of menus in XML form. - * - * If @domain is not %NULL, it will be used to translate attributes - * that are marked as translatable, using gettext(). - * - * If @objects is specified then it must be a #GHashTable that was - * created using g_hash_table_new_full() with g_str_hash(), - * g_str_equal(), g_free() and g_object_unref(). - * Any named menus (ie: menu, - * submenu, - * section or link - * elements with an id='' attribute) that are encountered while parsing - * will be added to this table. Each toplevel menu must be named. - * - * If @objects is %NULL then an empty hash table will be created. - * - * This function should be called from the start_element function for - * the element representing the group containing the menus. In other - * words, the content inside of this element is expected to be a list of - * menus. - * - * Since: 2.32 - */ - - -/** - * g_menu_markup_parser_start_menu: - * @context: a #GMarkupParseContext - * @domain: (allow-none): translation domain for labels, or %NULL - * @objects: (allow-none): a #GHashTable for the objects, or %NULL - * - * Begin parsing the XML definition of a menu. - * - * This function should be called from the start_element function for - * the element representing the menu itself. In other words, the - * content inside of this element is expected to be a list of items. - * - * If @domain is not %NULL, it will be used to translate attributes - * that are marked as translatable, using gettext(). - * - * If @objects is specified then it must be a #GHashTable that was - * created using g_hash_table_new_full() with g_str_hash(), - * g_str_equal(), g_free() and g_object_unref(). - * Any named menus (ie: submenu, - * section or link - * elements with an id='' attribute) that are encountered while parsing - * will be added to this table. - * Note that toplevel menu is not added to - * the hash table, even if it has an id attribute. - * - * If @objects is %NULL then named menus will not be supported. - * - * You should call g_menu_markup_parser_end_menu() from the - * corresponding end_element function in order to collect the newly - * parsed menu. - * - * Since: 2.32 - */ - - -/** - * g_menu_markup_print_stderr: - * @model: a #GMenuModel - * - * Print @model to stderr for debugging purposes. - * - * This debugging function will be removed in the future. - */ - - -/** - * g_menu_markup_print_string: - * @string: a #GString - * @model: the #GMenuModel to print - * @indent: the intentation level to start at - * @tabstop: how much to indent each level - * - * Print the contents of @model to @string. - * Note that you have to provide the containing - * menu element yourself. - * - * Returns: @string - * Since: 2.32 - */ - - -/** * g_menu_model_get_item_attribute: * @model: a #GMenuModel * @item_index: the index of the item @@ -31339,7 +31354,7 @@ * @submenu: a #GMenuModel with the items of the submenu * * Convenience function for prepending a submenu menu item to the start - * of @menu. Combine g_menu_new_submenu() and g_menu_insert_item() for + * of @menu. Combine g_menu_item_new_submenu() and g_menu_insert_item() for * a more flexible alternative. * * Since: 2.32 @@ -32001,7 +32016,7 @@ * @uri. May fail and return %NULL in case parsing @uri fails. * * Using this rather than g_network_address_new() or - * g_network_address_parse_host() allows #GSocketClient to determine + * g_network_address_parse() allows #GSocketClient to determine * when to use application-specific proxy protocols. * * Returns: (transfer full): the new #GNetworkAddress, or %NULL on error @@ -32073,6 +32088,39 @@ /** + * g_network_monitor_can_reach_async: + * @monitor: a #GNetworkMonitor + * @connectable: a #GSocketConnectable + * @cancellable: a #GCancellable, or %NULL + * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied + * @user_data: (closure): the data to pass to callback function + * + * Asynchronously attempts to determine whether or not the host + * pointed to by @connectable can be reached, without actually + * trying to connect to it. + * + * For more details, see g_network_monitor_can_reach(). + * + * When the operation is finished, @callback will be called. + * You can then call g_network_monitor_can_reach_finish() + * to get the result of the operation. + */ + + +/** + * g_network_monitor_can_reach_finish: + * @monitor: a #GNetworkMonitor + * @result: a #GAsyncResult + * @error: return location for errors, or %NULL + * + * Finishes an async network connectivity test. + * See g_network_monitor_can_reach_async(). + * + * Returns: %TRUE if network is reachable, %FALSE if not. + */ + + +/** * g_network_monitor_get_default: * * Gets the default #GNetworkMonitor for the system. @@ -32263,6 +32311,18 @@ /** + * g_node_insert_data_after: + * @parent: the #GNode to place the new #GNode under + * @sibling: the sibling #GNode to place the new #GNode after + * @data: the data for the new #GNode + * + * Inserts a new #GNode after the given sibling. + * + * Returns: the new #GNode + */ + + +/** * g_node_insert_data_before: * @parent: the #GNode to place the new #GNode under * @sibling: the sibling #GNode to place the new #GNode before @@ -33283,6 +33343,27 @@ /** * g_remote_action_group_activate_action_full: + * @remote: a #GDBusActionGroup + * @action_name: the name of the action to activate + * @parameter: (allow none): the optional parameter to the activation + * @platform_data: the platform data to send + * + * Activates the remote action. + * + * This is the same as g_action_group_activate_action() except that it + * allows for provision of "platform data" to be sent along with the + * activation request. This typically contains details such as the user + * interaction timestamp or startup notification information. + * + * @platform_data must be non-%NULL and must have the type + * %G_VARIANT_TYPE_VARDICT. If it is floating, it will be consumed. + * + * Since: 2.32 + */ + + +/** + * g_remote_action_group_change_action_state_full: * @remote: a #GRemoteActionGroup * @action_name: the name of the action to change the state of * @value: the new requested value for the state @@ -34210,6 +34291,31 @@ /** + * g_settings_create_action: + * @settings: a #GSettings + * @key: the name of a key in @settings + * + * Creates a #GAction corresponding to a given #GSettings key. + * + * The action has the same name as the key. + * + * The value of the key becomes the state of the action and the action + * is enabled when the key is writable. Changing the state of the + * action results in the key being written to. Changes to the value or + * writability of the key cause appropriate change notifications to be + * emitted for the action. + * + * For boolean-valued keys, action activations take no parameter and + * result in the toggling of the value. For all other types, + * activations take the new value for the key (which must have the + * correct type). + * + * Returns: (transfer full): a new #GAction + * Since: 2.32 + */ + + +/** * g_settings_delay: * @settings: a #GSettings object * @@ -35237,6 +35343,18 @@ /** + * g_signal_handlers_disconnect_by_data: + * @instance: The instance to remove handlers from + * @data: the closure data of the handlers' closures + * + * Disconnects all handlers on an instance that match @data. + * + * Returns: The number of handlers that matched. + * Since: 2.32 + */ + + +/** * g_signal_handlers_disconnect_by_func: * @instance: The instance to remove handlers from. * @func: The C closure callback of the handlers (useless for non-C closures). @@ -36506,6 +36624,36 @@ /** + * g_socket_condition_timed_wait: + * @socket: a #GSocket + * @condition: a #GIOCondition mask to wait for + * @timeout: the maximum time (in microseconds) to wait, or -1 + * @cancellable: (allow-none): a #GCancellable, or %NULL + * @error: a #GError pointer, or %NULL + * + * Waits for up to @timeout microseconds for @condition to become true + * on @socket. If the condition is met, %TRUE is returned. + * + * If @cancellable is cancelled before the condition is met, or if + * @timeout (or the socket's #GSocket:timeout) is reached before the + * condition is met, then %FALSE is returned and @error, if non-%NULL, + * is set to the appropriate value (%G_IO_ERROR_CANCELLED or + * %G_IO_ERROR_TIMED_OUT). + * + * If you don't want a timeout, use g_socket_condition_wait(). + * (Alternatively, you can pass -1 for @timeout.) + * + * Note that although @timeout is in microseconds for consistency with + * other GLib APIs, this function actually only has millisecond + * resolution, and the behavior is undefined if @timeout is not an + * exact number of milliseconds. + * + * Returns: %TRUE if the condition was met, %FALSE otherwise + * Since: 2.32 + */ + + +/** * g_socket_condition_wait: * @socket: a #GSocket * @condition: a #GIOCondition mask to wait for @@ -36521,6 +36669,8 @@ * the appropriate value (%G_IO_ERROR_CANCELLED or * %G_IO_ERROR_TIMED_OUT). * + * See also g_socket_condition_timed_wait(). + * * Returns: %TRUE if the condition was met, %FALSE otherwise * Since: 2.22 */ @@ -37072,7 +37222,7 @@ * g_socket_join_multicast_group: * @socket: a #GSocket. * @group: a #GInetAddress specifying the group address to join. - * @iface: Interface to use + * @iface: (allow-none): Name of the interface to use, or %NULL * @source_specific: %TRUE if source-specific multicast should be used * @error: #GError for error reporting, or %NULL to ignore. * @@ -37081,8 +37231,12 @@ * been bound to an appropriate interface and port with * g_socket_bind(). * + * If @iface is %NULL, the system will automatically pick an interface + * to bind to based on @group. + * * If @source_specific is %TRUE, source-specific multicast as defined - * in RFC 4604 is used. + * in RFC 4604 is used. Note that on older platforms this may fail + * with a %G_IO_ERROR_NOT_SUPPORTED error. * * Returns: %TRUE on success, %FALSE on error. * Since: 2.32 @@ -37093,15 +37247,16 @@ * g_socket_leave_multicast_group: * @socket: a #GSocket. * @group: a #GInetAddress specifying the group address to leave. - * @iface: Interface to use - * @source_specific: %TRUE if source-specific multicast should be used + * @iface: (allow-none): Interface used + * @source_specific: %TRUE if source-specific multicast was used * @error: #GError for error reporting, or %NULL to ignore. * - * Removes @socket from the multicast group @group (while still - * allowing it to receive unicast messages). + * Removes @socket from the multicast group defined by @group, @iface, + * and @source_specific (which must all have the same values they had + * when you joined the group). * - * If @source_specific is %TRUE, source-specific multicast as defined - * in RFC 4604 is used. + * @socket remains bound to its address and port, and can still receive + * unicast messages after calling this. * * Returns: %TRUE on success, %FALSE on error. * Since: 2.32 @@ -37786,7 +37941,7 @@ /** * g_socket_set_broadcast: * @socket: a #GSocket. - * @loopback: whether @socket should allow sending to and receiving from broadcast addresses + * @broadcast: whether @socket should allow sending to and receiving from broadcast addresses * * Sets whether @socket should allow sending to and receiving from * broadcast addresses. This is %FALSE by default. @@ -38051,6 +38206,50 @@ /** + * g_static_resource_fini: + * @static_resource: pointer to a static #GStaticResource. + * + * Finalized a GResource initialized by g_static_resource_init (). + * + * This is normally used by code generated by + * glib-compile-resources and is + * not typically used by other code. + * + * Since: 2.32 + */ + + +/** + * g_static_resource_get_resource: + * @static_resource: pointer to a static #GStaticResource. + * + * Gets the GResource that was registred by a call to g_static_resource_init (). + * + * This is normally used by code generated by + * glib-compile-resources and is + * not typically used by other code. + * + * Returns: (transfer none): a #GResource. + * Since: 2.32 + */ + + +/** + * g_static_resource_init: + * @static_resource: pointer to a static #GStaticResource. + * + * Initializes a GResource from static data using a + * GStaticResource. + * + * This is normally used by code generated by + * glib-compile-resources and is + * not typically used by other code. + * + * Since: 2.32 + */ + + +/** * g_tcp_connection_get_graceful_disconnect: * @connection: a #GTcpConnection * @@ -38253,7 +38452,7 @@ * g_tls_backend_get_file_database_type: * @backend: the #GTlsBackend * - * Gets the #GTyep of @backend's #GTlsFileDatabase implementation. + * Gets the #GType of @backend's #GTlsFileDatabase implementation. * * Returns: the #GType of backend's #GTlsFileDatabase implementation. * Since: 2.30 @@ -38875,9 +39074,10 @@ * * Lookup a certificate by its handle. * - * The handle should have been created by calling g_tls_database_create_handle() - * on a #GTlsDatabase object of the same TLS backend. The handle is designed - * to remain valid across instantiations of the database. + * The handle should have been created by calling + * g_tls_database_create_certificate_handle() on a #GTlsDatabase object of + * the same TLS backend. The handle is designed to remain valid across + * instantiations of the database. * * If the handle is no longer valid, or does not point to a certificate in * this database, then %NULL will be returned. @@ -38903,7 +39103,7 @@ * @user_data: the data to pass to the callback function * * Asynchronously lookup a certificate by its handle in the database. See - * g_tls_database_lookup_handle() for more information. + * g_tls_database_lookup_certificate_for_handle() for more information. * * Since: 2.30 */ @@ -38916,7 +39116,7 @@ * @error: a #GError pointer, or %NULL * * Finish an asynchronous lookup of a certificate by its handle. See - * g_tls_database_lookup_handle() for more information. + * g_tls_database_lookup_certificate_handle() for more information. * * If the handle is no longer valid, or does not point to a certificate in * this database, then %NULL will be returned. @@ -39283,10 +39483,13 @@ * @password: a #GTlsPassword object * @length: (allow-none): location to place the length of the password. * - * Get the password value. If @length is not %NULL then it will be filled - * in with the length of the password value. + * Get the password value. If @length is not %NULL then it will be + * filled in with the length of the password value. (Note that the + * password value is not nul-terminated, so you can only pass %NULL + * for @length in contexts where you know the password will have a + * certain fixed length.) * - * Returns: The password value owned by the password object. + * Returns: The password value (owned by the password object). * Since: 2.30 */ @@ -39346,9 +39549,10 @@ * Set the value for this password. The @value will be copied by the password * object. * - * Specify the @length, for a non-null-terminated password. Pass -1 as - * @length if using a null-terminated password, and @length will be calculated - * automatically. + * Specify the @length, for a non-nul-terminated password. Pass -1 as + * @length if using a nul-terminated password, and @length will be + * calculated automatically. (Note that the terminating nul is not + * considered part of the password in this case.) * * Since: 2.30 */ @@ -39366,9 +39570,10 @@ * The @value will be owned by the password object, and later freed using * the @destroy function callback. * - * Specify the @length, for a non-null-terminated password. Pass -1 as - * @length if using a null-terminated password, and @length will be calculated - * automatically. + * Specify the @length, for a non-nul-terminated password. Pass -1 as + * @length if using a nul-terminated password, and @length will be + * calculated automatically. (Note that the terminating nul is not + * considered part of the password in this case.) * * Virtual: set_value * Since: 2.30 @@ -39973,7 +40178,7 @@ /** * g_unix_mount_free: - * @mount_entry: a #GUnixMount. + * @mount_entry: a #GUnixMountEntry. * * Frees a unix mount. */ @@ -40634,7 +40839,7 @@ * @volume: a #GVolume * * Gets the kinds of identifiers - * that @volume has. Use g_volume_get_identifer() to obtain + * that @volume has. Use g_volume_get_identifier() to obtain * the identifiers themselves. * * of strings containing kinds of identifiers. Use g_strfreev() to free. @@ -40988,9 +41193,9 @@ /** * g_win32_input_stream_new: * @handle: a Win32 file handle - * @close_fd: %TRUE to close the handle when done + * @close_handle: %TRUE to close the handle when done * - * Creates a new #GWin32InputStream for the given @fd. + * Creates a new #GWin32InputStream for the given @handle. * * If @close_handle is %TRUE, the handle will be closed * when the stream is closed. diff -Nru gobject-introspection-1.31.10/gir/glib-2.0.c gobject-introspection-1.31.20/gir/glib-2.0.c --- gobject-introspection-1.31.10/gir/glib-2.0.c 2012-01-19 22:06:34.000000000 +0000 +++ gobject-introspection-1.31.20/gir/glib-2.0.c 2012-03-05 14:44:03.000000000 +0000 @@ -972,11 +972,24 @@ * g_direct_hash() is also the appropriate hash function for keys * of the form GINT_TO_POINTER (n) (or similar macros). * - * The hash values should be evenly - * distributed over a fairly large range? The modulus is taken with the - * hash table size (a prime number) to find the 'bucket' to place each - * key into. The function should also be very fast, since it is called - * for each key lookup. + * A good hash functions should produce + * hash values that are evenly distributed over a fairly large range. + * The modulus is taken with the hash table size (a prime number) to + * find the 'bucket' to place each key into. The function should also + * be very fast, since it is called for each key lookup. + * + * Note that the hash functions provided by GLib have these qualities, + * but are not particularly robust against manufactured keys that + * cause hash collisions. Therefore, you should consider choosing + * a more secure hash function when using a GHashTable with keys + * that originate in untrusted data (such as HTTP requests). + * Using g_str_hash() in that situation might make your application + * vulerable to Algorithmic Complexity Attacks. + * + * The key to choosing a good hash is unpredictability. Even + * cryptographic hashes are very easy to find collisions for when the + * remainder is taken modulo a somewhat predictable prime number. There + * must be an element of randomness that an attacker is unable to guess. * * Returns: the hash value corresponding to the key */ @@ -1537,6 +1550,15 @@ /** + * GLIB_DISABLE_DEPRECATION_WARNINGS: + * + * A macro that should be defined before including the glib.h header. + * If it is defined, no compiler warnings will be produced for uses + * of deprecated GLib APIs. + */ + + +/** * GLIB_MAJOR_VERSION: * * The major version number of the GLib library. @@ -1570,6 +1592,82 @@ /** + * GLIB_VERSION_2_26: + * + * A macro that evaluates to the 2.26 version of GLib, in a format + * that can be used by the C pre-processor. + * + * Since: 2.32 + */ + + +/** + * GLIB_VERSION_2_28: + * + * A macro that evaluates to the 2.28 version of GLib, in a format + * that can be used by the C pre-processor. + * + * Since: 2.32 + */ + + +/** + * GLIB_VERSION_2_30: + * + * A macro that evaluates to the 2.30 version of GLib, in a format + * that can be used by the C pre-processor. + * + * Since: 2.32 + */ + + +/** + * GLIB_VERSION_2_32: + * + * A macro that evaluates to the 2.32 version of GLib, in a format + * that can be used by the C pre-processor. + * + * Since: 2.32 + */ + + +/** + * GLIB_VERSION_MAX_ALLOWED: + * + * A macro that should be defined by the user prior to including + * the glib.h header. + * The definition should be one of the predefined GLib version + * macros: %GLIB_VERSION_2_26, %GLIB_VERSION_2_28,... + * + * This macro defines the upper bound for the GLib API to use. + * + * If a function has been introduced in a newer version of GLib, + * it is possible to use this symbol to get compiler warnings when + * trying to use that function. + * + * Since: 2.32 + */ + + +/** + * GLIB_VERSION_MIN_REQUIRED: + * + * A macro that should be defined by the user prior to including + * the glib.h header. + * The definition should be one of the predefined GLib version + * macros: %GLIB_VERSION_2_26, %GLIB_VERSION_2_28,... + * + * This macro defines the lower bound for the GLib API to use. + * + * If a function has been deprecated in a newer version of GLib, + * it is possible to use this symbol to avoid the compiler warnings + * without disabling warning for every deprecated function. + * + * Since: 2.32 + */ + + +/** * GLONG_FROM_BE: * @val: a #glong value in big-endian byte order * @@ -3062,6 +3160,15 @@ /** + * GSignalCVaMarshaller: + * + * This is the signature of va_list marshaller functions, an optional + * marshaller that can be used in some situations to avoid + * marshalling the signal argument into GValues. + */ + + +/** * GSignalEmissionHook: * @ihint: Signal invocation hint, see #GSignalInvocationHint. * @n_param_values: the number of parameters to the function, including the instance on which the signal was emitted. @@ -3251,7 +3358,8 @@ * @G_SPAWN_ERROR_CHDIR: Changing to working directory failed. * @G_SPAWN_ERROR_ACCES: execv() returned EACCES * @G_SPAWN_ERROR_PERM: execv() returned EPERM - * @G_SPAWN_ERROR_2BIG: execv() returned E2BIG + * @G_SPAWN_ERROR_TOO_BIG: execv() returned E2BIG + * @G_SPAWN_ERROR_2BIG: deprecated alias for %G_SPAWN_ERROR_TOO_BIG * @G_SPAWN_ERROR_NOEXEC: execv() returned ENOEXEC * @G_SPAWN_ERROR_NAMETOOLONG: execv() returned ENAMETOOLONG * @G_SPAWN_ERROR_NOENT: execv() returned ENOENT @@ -3546,8 +3654,13 @@ * @G_TOKEN_EOF: the end of the file * @G_TOKEN_LEFT_PAREN: a '(' character * @G_TOKEN_LEFT_CURLY: a '{' character + * @G_TOKEN_LEFT_BRACE: a '[' character * @G_TOKEN_RIGHT_CURLY: a '}' character * @G_TOKEN_RIGHT_PAREN: a ')' character + * @G_TOKEN_RIGHT_BRACE: a ']' character + * @G_TOKEN_EQUAL_SIGN: a '=' character + * @G_TOKEN_COMMA: a ',' character + * @G_TOKEN_NONE: not a token * @G_TOKEN_ERROR: an error occurred * @G_TOKEN_CHAR: a character * @G_TOKEN_BINARY: a binary integer @@ -4222,6 +4335,8 @@ * @G_UNICODE_BREAK_HANGUL_LV_SYLLABLE: Hangul LV Syllable (H2) * @G_UNICODE_BREAK_HANGUL_LVT_SYLLABLE: Hangul LVT Syllable (H3) * @G_UNICODE_BREAK_CLOSE_PARANTHESIS: Closing Parenthesis (CP). Since 2.28 + * @G_UNICODE_BREAK_CONDITIONAL_JAPANESE_STARTER: Conditional Japanese Starter (CJ). Since: 2.32 + * @G_UNICODE_BREAK_HEBREW_LETTER: Hebrew Letter (HL). Since: 2.32 * * These are the possible line break classifications. * @@ -4322,6 +4437,13 @@ * @G_UNICODE_SCRIPT_BATAK: Batak. Since 2.28 * @G_UNICODE_SCRIPT_BRAHMI: Brahmi. Since 2.28 * @G_UNICODE_SCRIPT_MANDAIC: Mandaic. Since 2.28 + * @G_UNICODE_SCRIPT_CHAKMA: Chakma. Since: 2.32 + * @G_UNICODE_SCRIPT_MEROITIC_CURSIVE: Meroitic Cursive. Since: 2.32 + * @G_UNICODE_SCRIPT_MEROITIC_HIEROGLYPHS, Meroitic Hieroglyphs. Since: 2.32 + * @G_UNICODE_SCRIPT_MIAO: Miao. Since: 2.32 + * @G_UNICODE_SCRIPT_SHARADA: Sharada. Since: 2.32 + * @G_UNICODE_SCRIPT_SORA_SOMPENG: Sora Sompeng. Since: 2.32 + * @G_UNICODE_SCRIPT_TAKRI: Takri. Since: 2.32 * * The #GUnicodeScript enumeration identifies different writing * systems. The values correspond to the names as defined in the @@ -5074,6 +5196,30 @@ /** + * G_DEPRECATED: + * + * This macro is similar to %G_GNUC_DEPRECATED, and can be used to mark + * functions declarations as deprecated. Unlike %G_GNUC_DEPRECATED, it is + * meant to be portable across different compilers and must be placed + * before the function declaration. + * + * Since: 2.32 + */ + + +/** + * G_DEPRECATED_FOR: + * + * This macro is similar to %G_GNUC_DEPRECATED_FOR, and can be used to mark + * functions declarations as deprecated. Unlike %G_GNUC_DEPRECATED_FOR, it is + * meant to be portable across different compilers and must be placed + * before the function declaration. + * + * Since: 2.32 + */ + + +/** * G_DIR_SEPARATOR: * * The directory separator character. @@ -5320,6 +5466,27 @@ /** + * G_GNUC_BEGIN_IGNORE_DEPRECATIONS: + * + * Tells gcc (if it is a new enough version) to + * temporarily stop emitting warnings when functions marked with + * %G_GNUC_DEPRECATED or %G_GNUC_DEPRECATED_FOR are called. This is + * useful for when you have one deprecated function calling another + * one, or when you still have regression tests for deprecated + * functions. + * + * Use %G_GNUC_END_IGNORE_DEPRECATIONS to begin warning again. (If you + * are not compiling with -Wdeprecated-declarations + * then neither macro has any effect.) + * + * This macro can be used either inside or outside of a function body, + * but must appear on a line by itself. + * + * Since: 2.32 + */ + + +/** * G_GNUC_CONST: * * Expands to the GNU C const function attribute if @@ -5369,6 +5536,20 @@ /** + * G_GNUC_END_IGNORE_DEPRECATIONS: + * + * Undoes the effect of %G_GNUC_BEGIN_IGNORE_DEPRECATIONS, telling + * gcc to begin outputting warnings again + * (assuming those warnings had been enabled to begin with). + * + * This macro can be used either inside or outside of a function body, + * but must appear on a line by itself. + * + * Since: 2.32 + */ + + +/** * G_GNUC_EXTENSION: * * Expands to __extension__ when gcc @@ -6177,6 +6358,7 @@ * Checks whether the given #GParamSpec is of type %G_TYPE_PARAM_VALUE_ARRAY. * * Returns: %TRUE on success. + * Deprecated: 2.32: Use #GArray instead of #GValueArray */ @@ -7258,6 +7440,8 @@ * @pspec: a valid #GParamSpec instance * * Cast a #GParamSpec instance into a #GParamSpecValueArray. + * + * Deprecated: 2.32: Use #GArray instead of #GValueArray */ @@ -8603,6 +8787,8 @@ * G_TYPE_PARAM_VALUE_ARRAY: * * The #GType of #GParamSpecValueArray. + * + * Deprecated: 2.32: Use #GArray instead of #GValueArray */ @@ -8766,6 +8952,8 @@ * * The type ID of the "GValueArray" type which is a boxed type, * used to pass around pointers to GValueArrays. + * + * Deprecated: 2.32: Use #GArray instead of #GValueArray */ @@ -8807,6 +8995,17 @@ /** + * G_UNAVAILABLE: + * + * This macro can be used to mark a function declaration as unavailable. + * It must be placed before the function declaration. Use of a function + * that has been annotated with this macros will produce a compiler warning. + * + * Since: 2.32 + */ + + +/** * G_UNICHAR_MAX_DECOMPOSITION_LENGTH: * * The maximum length (in codepoints) of a compatibility or canonical @@ -9778,7 +9977,7 @@ * available in the queue at that point, the thread is now put to sleep * until a message arrives. The message will be removed from the queue * and returned. The functions g_async_queue_try_pop() and - * g_async_queue_timed_pop() can be used to only check for the presence + * g_async_queue_timeout_pop() can be used to only check for the presence * of messages or to only wait a certain time for messages respectively. * * For almost every function there exist two variants, one that locks @@ -12750,8 +12949,9 @@ * g_node_insert_before(), g_node_append() and g_node_prepend(). * * To create a new node and insert it into a tree use - * g_node_insert_data(), g_node_insert_data_before(), - * g_node_append_data() and g_node_prepend_data(). + * g_node_insert_data(), g_node_insert_data_after(), + * g_node_insert_data_before(), g_node_append_data() + * and g_node_prepend_data(). * * To reverse the children of a node use g_node_reverse_children(). * @@ -12873,6 +13073,18 @@ * GLib provides version information, primarily useful in configure * checks for builds that have a configure script. Applications will * not typically use the features described here. + * + * The GLib headers annotate deprecated APIs in a way that produces + * compiler warnings if these deprecated APIs are used. The warnings + * can be turned off by defining the macro %GLIB_DISABLE_DEPRECATION_WARNINGS + * before including the glib.h header. + * + * GLib also provides support for building applications against + * defined subsets of deprecated or new GLib APIs. Define the macro + * %GLIB_VERSION_MIN_REQUIRED to specify up to what version of GLib + * you want to receive warnings about deprecated APIs. Define the + * macro %GLIB_VERSION_MAX_ALLOWED to specify the newest version of + * GLib whose API you want to use. */ @@ -13201,6 +13413,25 @@ /** + * g_array_set_clear_func: + * @array: A #GArray + * @clear_func: a function to clear an element of @array + * + * Sets a function to clear an element of @array. + * + * The @clear_func will be called when an element in the array + * data segment is removed and when the array is freed and data + * segment is deallocated as well. + * + * Note that in contrast with other uses of #GDestroyNotify + * functions, @clear_func is expected to clear the contents of + * the array element it is given, but not free the element itself. + * + * Since: 2.32 + */ + + +/** * g_array_set_size: * @array: a #GArray. * @length: the new size of the #GArray. @@ -14150,6 +14381,7 @@ * received before @end_time. * * Returns: data from the queue or %NULL, when no data is + * Deprecated: use g_async_queue_timeout_pop(). */ @@ -14171,6 +14403,41 @@ * received before @end_time. * * Returns: data from the queue or %NULL, when no data is + * Deprecated: use g_async_queue_timeout_pop_unlocked(). + */ + + +/** + * g_async_queue_timeout_pop: + * @queue: a #GAsyncQueue + * @timeout: the number of microseconds to wait + * + * Pops data from the @queue. If the queue is empty, blocks for + * @timeout microseconds, or until data becomes available. + * + * If no data is received before the timeout, %NULL is returned. + * + * received before the timeout. + * + * Returns: data from the queue or %NULL, when no data is + */ + + +/** + * g_async_queue_timeout_pop_unlocked: + * @queue: a #GAsyncQueue + * @timeout: the number of microseconds to wait + * + * Pops data from the @queue. If the queue is empty, blocks for + * @timeout microseconds, or until data becomes available. + * + * If no data is received before the timeout, %NULL is returned. + * + * This function must be called while holding the @queue's lock. + * + * received before the timeout. + * + * Returns: data from the queue or %NULL, when no data is */ @@ -15191,7 +15458,7 @@ * @full_path. If the file could not be loaded then an %error is * set to either a #GFileError or #GBookmarkFileError. * - * Returns: %TRUE if a key file could be loaded, %FALSE othewise + * Returns: %TRUE if a key file could be loaded, %FALSE otherwise * Since: 2.12 */ @@ -16485,7 +16752,7 @@ * Notice that the end time is calculated once, before entering the * loop and reused. This is the motivation behind the use of absolute * time on this API -- if a relative time of 5 seconds were passed - * directly to the call and a spurious wakeup occured, the program would + * directly to the call and a spurious wakeup occurred, the program would * have to start over waiting again (which would lead to a total wait * time of more than 5 seconds). * @@ -16657,7 +16924,7 @@ * @key: the string identifying a data element. * @Returns: the data element, or %NULL if it is not found. * - * Gets a data element, using its string identifer. This is slower than + * Gets a data element, using its string identifier. This is slower than * g_datalist_id_get_data() because it compares strings. */ @@ -17004,7 +17271,7 @@ * @lhs: first date to compare * @rhs: second date to compare * - * qsort()-style comparsion function for dates. + * qsort()-style comparison function for dates. * Both dates must be valid. * * greater than zero if @lhs is greater than @rhs @@ -18885,7 +19152,7 @@ /** * g_environ_setenv: - * @envp: (array zero-terminated=1) (transfer full): an environment list (eg, as returned from g_get_environ()) + * @envp: (array zero-terminated=1) (transfer full): an environment list that can be freed using g_strfreev() (e.g., as returned from g_get_environ()) * @variable: the environment variable to set, must not contain '=' * @value: the value for to set the variable to * @overwrite: whether to change the variable if it already exists @@ -18897,7 +19164,7 @@ * file name encoding. On UNIX, this means that they can be * arbitrary byte strings. On Windows, they should be in UTF-8. * - * updated environment + * updated environment list. Free it using g_strfreev(). * * Returns: (array zero-terminated=1) (transfer full): the * Since: 2.32 @@ -18906,13 +19173,13 @@ /** * g_environ_unsetenv: - * @envp: (array zero-terminated=1) (transfer full): an environment list (eg, as returned from g_get_environ()) + * @envp: (array zero-terminated=1) (transfer full): an environment list that can be freed using g_strfreev() (e.g., as returned from g_get_environ()) * @variable: the environment variable to remove, must not contain '=' * * Removes the environment variable @variable from the provided * environment @envp. * - * updated environment + * updated environment list. Free it using g_strfreev(). * * Returns: (array zero-terminated=1) (transfer full): the * Since: 2.32 @@ -19712,8 +19979,8 @@ * On Windows, "limitations of the OS kernel" is a rather substantial * statement. Depending on the configuration of the system, the wall * clock time is updated as infrequently as 64 times a second (which - * is approximately every 16ms). Also, the on XP (not on Vista or later) - * the monitonic clock is locally monotonic, but may differ in exact + * is approximately every 16ms). Also, on XP (but not on Vista or later) + * the monotonic clock is locally monotonic, but may differ in exact * value between processes due to timer wrap handling. * * Returns: the monotonic time, in microseconds @@ -22221,8 +22488,8 @@ /** * g_key_file_load_from_data: * @key_file: an empty #GKeyFile struct - * @data: (array length=length): key file loaded in memory - * @length: the length of @data in bytes + * @data: key file loaded in memory + * @length: the length of @data in bytes (or -1 if data is nul-terminated) * @flags: flags from #GKeyFileFlags * @error: return location for a #GError, or %NULL * @@ -22281,7 +22548,7 @@ * @error: return location for a #GError, or %NULL * * Loads a key file into an empty #GKeyFile structure. - * If the file could not be loaded then %error is set to + * If the file could not be loaded then @error is set to * either a #GFileError or #GKeyFileError. * * Returns: %TRUE if a key file could be loaded, %FALSE otherwise @@ -24153,7 +24420,7 @@ * with g_mapped_file_unref(), or %NULL if the mapping failed. * * Returns: a newly allocated #GMappedFile which must be unref'd - * Since: 2.30 + * Since: 2.32 */ @@ -25467,6 +25734,18 @@ /** + * g_node_insert_data_after: + * @parent: the #GNode to place the new #GNode under + * @sibling: the sibling #GNode to place the new #GNode after + * @data: the data for the new #GNode + * + * Inserts a new #GNode after the given sibling. + * + * Returns: the new #GNode + */ + + +/** * g_node_insert_data_before: * @parent: the #GNode to place the new #GNode under * @sibling: the sibling #GNode to place the new #GNode before @@ -29262,6 +29541,14 @@ * the first item comes before the second, and a positive value if * the second item comes before the first. * + * + * This function will fail if the data contained in the sequence is + * unsorted. Use g_sequence_insert_sorted() or + * g_sequence_insert_sorted_iter() to add data to your sequence or, if + * you want to add a large amount of data, call g_sequence_sort() after + * doing unsorted insertions. + * + * * first item found equal to @data according to @cmp_func and @cmp_data. * * Returns: an #GSequenceIter pointing to the position of the @@ -29284,6 +29571,14 @@ * if the first iterator comes before the second, and a positive * value if the second iterator comes before the first. * + * + * This function will fail if the data contained in the sequence is + * unsorted. Use g_sequence_insert_sorted() or + * g_sequence_insert_sorted_iter() to add data to your sequence or, if + * you want to add a large amount of data, call g_sequence_sort() after + * doing unsorted insertions. + * + * * the first item found equal to @data according to @cmp_func * and @cmp_data. * @@ -29376,7 +29671,7 @@ * Removes the item pointed to by @iter. It is an error to pass the * end iterator to this function. * - * If the sequnce has a data destroy function associated with it, this + * If the sequence has a data destroy function associated with it, this * function is called on the data for the removed item. * * Since: 2.14 @@ -29415,6 +29710,14 @@ * If you are simply searching for an existing element of the sequence, * consider using g_sequence_lookup(). * + * + * This function will fail if the data contained in the sequence is + * unsorted. Use g_sequence_insert_sorted() or + * g_sequence_insert_sorted_iter() to add data to your sequence or, if + * you want to add a large amount of data, call g_sequence_sort() after + * doing unsorted insertions. + * + * * would have been inserted according to @cmp_func and @cmp_data. * * Returns: an #GSequenceIter pointing to the position where @data @@ -29440,6 +29743,14 @@ * If you are simply searching for an existing element of the sequence, * consider using g_sequence_lookup_iter(). * + * + * This function will fail if the data contained in the sequence is + * unsorted. Use g_sequence_insert_sorted() or + * g_sequence_insert_sorted_iter() to add data to your sequence or, if + * you want to add a large amount of data, call g_sequence_sort() after + * doing unsorted insertions. + * + * * where @data would have been inserted according to @iter_cmp * and @cmp_data. * @@ -29799,6 +30110,18 @@ /** + * g_signal_handlers_disconnect_by_data: + * @instance: The instance to remove handlers from + * @data: the closure data of the handlers' closures + * + * Disconnects all handlers on an instance that match @data. + * + * Returns: The number of handlers that matched. + * Since: 2.32 + */ + + +/** * g_signal_handlers_disconnect_by_func: * @instance: The instance to remove handlers from. * @func: The C closure callback of the handlers (useless for non-C closures). @@ -30623,7 +30946,7 @@ * self->idle_id = 0; * GDK_THREADS_LEAVE (); * - * return FALSE; + * return G_SOURCE_REMOVE; * } * * static void @@ -35401,9 +35724,9 @@ /** * g_uri_unescape_segment: - * @escaped_string: a string. - * @escaped_string_end: a string. - * @illegal_characters: an optional string of illegal characters not to be allowed. + * @escaped_string: (allow-none): A string, may be %NULL + * @escaped_string_end: (allow-none): Pointer to end of @escaped_string, may be %NULL + * @illegal_characters: (allow-none): An optional string of illegal characters not to be allowed, may be %NULL * * Unescapes a segment of an escaped string. * @@ -35413,7 +35736,9 @@ * slash being expanded in an escaped path element, which might confuse pathname * handling. * - * The returned string should be freed when no longer needed. + * The returned string should be freed when no longer needed. As a + * special case if %NULL is given for @escaped_string, this function + * will return %NULL. * * Returns: an unescaped version of @escaped_string or %NULL on error. * Since: 2.16 @@ -39219,7 +39544,7 @@ * This is an internal function and should only be used by * the internals of glib (such as libgio). * - * Returns: the transation of @str to the current locale + * Returns: the translation of @str to the current locale */ diff -Nru gobject-introspection-1.31.10/gir/gobject-2.0.c gobject-introspection-1.31.20/gir/gobject-2.0.c --- gobject-introspection-1.31.10/gir/gobject-2.0.c 2012-01-11 20:57:58.000000000 +0000 +++ gobject-introspection-1.31.20/gir/gobject-2.0.c 2012-03-05 14:44:04.000000000 +0000 @@ -607,6 +607,82 @@ /** + * GLIB_VERSION_2_26: + * + * A macro that evaluates to the 2.26 version of GLib, in a format + * that can be used by the C pre-processor. + * + * Since: 2.32 + */ + + +/** + * GLIB_VERSION_2_28: + * + * A macro that evaluates to the 2.28 version of GLib, in a format + * that can be used by the C pre-processor. + * + * Since: 2.32 + */ + + +/** + * GLIB_VERSION_2_30: + * + * A macro that evaluates to the 2.30 version of GLib, in a format + * that can be used by the C pre-processor. + * + * Since: 2.32 + */ + + +/** + * GLIB_VERSION_2_32: + * + * A macro that evaluates to the 2.32 version of GLib, in a format + * that can be used by the C pre-processor. + * + * Since: 2.32 + */ + + +/** + * GLIB_VERSION_MAX_ALLOWED: + * + * A macro that should be defined by the user prior to including + * the glib.h header. + * The definition should be one of the predefined GLib version + * macros: %GLIB_VERSION_2_26, %GLIB_VERSION_2_28,... + * + * This macro defines the upper bound for the GLib API to use. + * + * If a function has been introduced in a newer version of GLib, + * it is possible to use this symbol to get compiler warnings when + * trying to use that function. + * + * Since: 2.32 + */ + + +/** + * GLIB_VERSION_MIN_REQUIRED: + * + * A macro that should be defined by the user prior to including + * the glib.h header. + * The definition should be one of the predefined GLib version + * macros: %GLIB_VERSION_2_26, %GLIB_VERSION_2_28,... + * + * This macro defines the lower bound for the GLib API to use. + * + * If a function has been deprecated in a newer version of GLib, + * it is possible to use this symbol to avoid the compiler warnings + * without disabling warning for every deprecated function. + * + * Since: 2.32 + */ + + +/** * GMainContext: * * The GMainContext struct is an opaque data @@ -1494,6 +1570,15 @@ /** + * GSignalCVaMarshaller: + * + * This is the signature of va_list marshaller functions, an optional + * marshaller that can be used in some situations to avoid + * marshalling the signal argument into GValues. + */ + + +/** * GSignalEmissionHook: * @ihint: Signal invocation hint, see #GSignalInvocationHint. * @n_param_values: the number of parameters to the function, including the instance on which the signal was emitted. @@ -1683,7 +1768,8 @@ * @G_SPAWN_ERROR_CHDIR: Changing to working directory failed. * @G_SPAWN_ERROR_ACCES: execv() returned EACCES * @G_SPAWN_ERROR_PERM: execv() returned EPERM - * @G_SPAWN_ERROR_2BIG: execv() returned E2BIG + * @G_SPAWN_ERROR_TOO_BIG: execv() returned E2BIG + * @G_SPAWN_ERROR_2BIG: deprecated alias for %G_SPAWN_ERROR_TOO_BIG * @G_SPAWN_ERROR_NOEXEC: execv() returned ENOEXEC * @G_SPAWN_ERROR_NAMETOOLONG: execv() returned ENAMETOOLONG * @G_SPAWN_ERROR_NOENT: execv() returned ENOENT @@ -2079,6 +2165,8 @@ * @G_UNICODE_BREAK_HANGUL_LV_SYLLABLE: Hangul LV Syllable (H2) * @G_UNICODE_BREAK_HANGUL_LVT_SYLLABLE: Hangul LVT Syllable (H3) * @G_UNICODE_BREAK_CLOSE_PARANTHESIS: Closing Parenthesis (CP). Since 2.28 + * @G_UNICODE_BREAK_CONDITIONAL_JAPANESE_STARTER: Conditional Japanese Starter (CJ). Since: 2.32 + * @G_UNICODE_BREAK_HEBREW_LETTER: Hebrew Letter (HL). Since: 2.32 * * These are the possible line break classifications. * @@ -2179,6 +2267,13 @@ * @G_UNICODE_SCRIPT_BATAK: Batak. Since 2.28 * @G_UNICODE_SCRIPT_BRAHMI: Brahmi. Since 2.28 * @G_UNICODE_SCRIPT_MANDAIC: Mandaic. Since 2.28 + * @G_UNICODE_SCRIPT_CHAKMA: Chakma. Since: 2.32 + * @G_UNICODE_SCRIPT_MEROITIC_CURSIVE: Meroitic Cursive. Since: 2.32 + * @G_UNICODE_SCRIPT_MEROITIC_HIEROGLYPHS, Meroitic Hieroglyphs. Since: 2.32 + * @G_UNICODE_SCRIPT_MIAO: Miao. Since: 2.32 + * @G_UNICODE_SCRIPT_SHARADA: Sharada. Since: 2.32 + * @G_UNICODE_SCRIPT_SORA_SOMPENG: Sora Sompeng. Since: 2.32 + * @G_UNICODE_SCRIPT_TAKRI: Takri. Since: 2.32 * * The #GUnicodeScript enumeration identifies different writing * systems. The values correspond to the names as defined in the @@ -3145,6 +3240,7 @@ * Checks whether the given #GParamSpec is of type %G_TYPE_PARAM_VALUE_ARRAY. * * Returns: %TRUE on success. + * Deprecated: 2.32: Use #GArray instead of #GValueArray */ @@ -3544,6 +3640,8 @@ * @pspec: a valid #GParamSpec instance * * Cast a #GParamSpec instance into a #GParamSpecValueArray. + * + * Deprecated: 2.32: Use #GArray instead of #GValueArray */ @@ -4590,6 +4688,8 @@ * G_TYPE_PARAM_VALUE_ARRAY: * * The #GType of #GParamSpecValueArray. + * + * Deprecated: 2.32: Use #GArray instead of #GValueArray */ @@ -4753,6 +4853,8 @@ * * The type ID of the "GValueArray" type which is a boxed type, * used to pass around pointers to GValueArrays. + * + * Deprecated: 2.32: Use #GArray instead of #GValueArray */ @@ -5984,6 +6086,23 @@ * object property that holds an array of values. A #GValueArray wraps * an array of #GValue elements in order for it to be used as a boxed * type through %G_TYPE_VALUE_ARRAY. + * + * #GValueArray is deprecated in favour of #GArray since GLib 2.32. It + * is possible to create a #GArray that behaves like a #GValueArray by + * using the size of #GValue as the element size, and by setting + * g_value_unset() as the clear function using g_array_set_clear_func(), + * for instance, the following code: + * + * |[ + * GValueArray *array = g_value_array_new (10); + * ]| + * + * can be replaced by: + * + * |[ + * GArray *array = g_array_sized_new (FALSE, TRUE, sizeof (GValue), 10); + * g_array_set_clear_func (array, (GDestroyNotify) g_value_unset); + * ]| */ @@ -7142,6 +7261,18 @@ /** + * g_node_insert_data_after: + * @parent: the #GNode to place the new #GNode under + * @sibling: the sibling #GNode to place the new #GNode after + * @data: the data for the new #GNode + * + * Inserts a new #GNode after the given sibling. + * + * Returns: the new #GNode + */ + + +/** * g_node_insert_data_before: * @parent: the #GNode to place the new #GNode under * @sibling: the sibling #GNode to place the new #GNode before @@ -9347,6 +9478,18 @@ /** + * g_signal_handlers_disconnect_by_data: + * @instance: The instance to remove handlers from + * @data: the closure data of the handlers' closures + * + * Disconnects all handlers on an instance that match @data. + * + * Returns: The number of handlers that matched. + * Since: 2.32 + */ + + +/** * g_signal_handlers_disconnect_by_func: * @instance: The instance to remove handlers from. * @func: The C closure callback of the handlers (useless for non-C closures). @@ -9926,6 +10069,8 @@ * MyObject defined in the standard GObject * fashion. * type's class_init() function. + * Note the use of a structure member "priv" to avoid the overhead + * of repeatedly calling MY_OBJECT_GET_PRIVATE(). * * |[ * typedef struct _MyObject MyObject; @@ -9958,7 +10103,11 @@ * static int * my_object_get_some_field (MyObject *my_object) * { - * MyObjectPrivate *priv = my_object->priv; + * MyObjectPrivate *priv; + * + * g_return_val_if_fail (MY_IS_OBJECT (my_object), 0); + * + * priv = my_object->priv; * * return priv->some_field; * } @@ -10603,10 +10752,11 @@ * @flags: Bitwise combination of #GTypeFlags values. * * Registers @type_id as the predefined identifier and @type_name as the - * name of a fundamental type. The type system uses the information - * contained in the #GTypeInfo structure pointed to by @info and the - * #GTypeFundamentalInfo structure pointed to by @finfo to manage the - * type and its instances. The value of @flags determines additional + * name of a fundamental type. If @type_id is already registered, or a type + * named @type_name is already registered, the behaviour is undefined. The type + * system uses the information contained in the #GTypeInfo structure pointed to + * by @info and the #GTypeFundamentalInfo structure pointed to by @finfo to + * manage the type and its instances. The value of @flags determines additional * characteristics of the fundamental type. * * Returns: The predefined type identifier. @@ -10720,6 +10870,7 @@ * %NULL, an uninitialized value is appended. * * Returns: (transfer none): the #GValueArray passed in as @value_array + * Deprecated: 2.32: Use #GArray and g_array_append_val() instead. */ @@ -10731,6 +10882,7 @@ * contents. * * Returns: (transfer full): Newly allocated copy of #GValueArray + * Deprecated: 2.32: Use #GArray and g_array_ref() instead. */ @@ -10739,6 +10891,8 @@ * @value_array: #GValueArray to free * * Free a #GValueArray including its contents. + * + * Deprecated: 2.32: Use #GArray and g_array_unref() instead. */ @@ -10750,6 +10904,7 @@ * Return a pointer to the value at @index_ containd in @value_array. * * Returns: (transfer none): pointer to a value at @index_ in @value_array + * Deprecated: 2.32: Use g_array_index() instead. */ @@ -10763,6 +10918,7 @@ * is %NULL, an uninitialized value is inserted. * * Returns: (transfer none): the #GValueArray passed in as @value_array + * Deprecated: 2.32: Use #GArray and g_array_insert_val() instead. */ @@ -10775,6 +10931,7 @@ * regardless of the value of @n_prealloced. * * Returns: a newly allocated #GValueArray with 0 values + * Deprecated: 2.32: Use #GArray and g_array_sized_new() instead. */ @@ -10787,6 +10944,7 @@ * %NULL, an uninitialized value is prepended. * * Returns: (transfer none): the #GValueArray passed in as @value_array + * Deprecated: 2.32: Use #GArray and g_array_prepend_val() instead. */ @@ -10798,6 +10956,7 @@ * Remove the value at position @index_ from @value_array. * * Returns: (transfer none): the #GValueArray passed in as @value_array + * Deprecated: 2.32: Use #GArray and g_array_remove_index() instead. */ @@ -10812,6 +10971,7 @@ * The current implementation uses Quick-Sort as sorting algorithm. * * Returns: (transfer none): the #GValueArray passed in as @value_array + * Deprecated: 2.32: Use #GArray and g_array_sort(). */ @@ -10828,6 +10988,7 @@ * * Rename to: g_value_array_sort * Returns: (transfer none): the #GValueArray passed in as @value_array + * Deprecated: 2.32: Use #GArray and g_array_sort_with_data(). */ diff -Nru gobject-introspection-1.31.10/girepository/gdump.c gobject-introspection-1.31.20/girepository/gdump.c --- gobject-introspection-1.31.10/girepository/gdump.c 2011-09-03 16:33:30.000000000 +0000 +++ gobject-introspection-1.31.20/girepository/gdump.c 2012-02-03 18:33:01.000000000 +0000 @@ -1,4 +1,5 @@ -/* GObject introspection: Dump introspection data +/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- + * GObject introspection: Dump introspection data * * Copyright (C) 2008 Colin Walters * diff -Nru gobject-introspection-1.31.10/girepository/giarginfo.c gobject-introspection-1.31.20/girepository/giarginfo.c --- gobject-introspection-1.31.10/girepository/giarginfo.c 2011-06-10 15:36:50.000000000 +0000 +++ gobject-introspection-1.31.20/girepository/giarginfo.c 2012-02-03 18:33:07.000000000 +0000 @@ -1,4 +1,5 @@ -/* GObject introspection: Argument implementation +/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- + * GObject introspection: Argument implementation * * Copyright (C) 2005 Matthias Clasen * Copyright (C) 2008,2009 Red Hat, Inc. diff -Nru gobject-introspection-1.31.10/girepository/giarginfo.h gobject-introspection-1.31.20/girepository/giarginfo.h --- gobject-introspection-1.31.10/girepository/giarginfo.h 2011-06-10 15:36:50.000000000 +0000 +++ gobject-introspection-1.31.20/girepository/giarginfo.h 2012-02-03 18:33:32.000000000 +0000 @@ -1,4 +1,5 @@ -/* GObject introspection: Argument +/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- + * GObject introspection: Argument * * Copyright (C) 2005 Matthias Clasen * Copyright (C) 2008,2009 Red Hat, Inc. diff -Nru gobject-introspection-1.31.10/girepository/gibaseinfo.c gobject-introspection-1.31.20/girepository/gibaseinfo.c --- gobject-introspection-1.31.10/girepository/gibaseinfo.c 2011-12-08 20:00:31.000000000 +0000 +++ gobject-introspection-1.31.20/girepository/gibaseinfo.c 2012-02-03 18:33:35.000000000 +0000 @@ -1,4 +1,5 @@ -/* GObject introspection: Base struct implementation +/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- + * GObject introspection: Base struct implementation * * Copyright (C) 2005 Matthias Clasen * Copyright (C) 2008,2009 Red Hat, Inc. diff -Nru gobject-introspection-1.31.10/girepository/gibaseinfo.h gobject-introspection-1.31.20/girepository/gibaseinfo.h --- gobject-introspection-1.31.10/girepository/gibaseinfo.h 2011-06-10 15:36:50.000000000 +0000 +++ gobject-introspection-1.31.20/girepository/gibaseinfo.h 2012-02-03 18:33:41.000000000 +0000 @@ -1,4 +1,5 @@ -/* GObject introspection: GIBaseInfo +/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- + * GObject introspection: GIBaseInfo * * Copyright (C) 2005 Matthias Clasen * Copyright (C) 2008,2009 Red Hat, Inc. diff -Nru gobject-introspection-1.31.10/girepository/gicallableinfo.c gobject-introspection-1.31.20/girepository/gicallableinfo.c --- gobject-introspection-1.31.10/girepository/gicallableinfo.c 2011-06-10 15:36:50.000000000 +0000 +++ gobject-introspection-1.31.20/girepository/gicallableinfo.c 2012-02-17 16:47:04.000000000 +0000 @@ -1,4 +1,5 @@ -/* GObject introspection: Callable implementation +/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- + * GObject introspection: Callable implementation * * Copyright (C) 2005 Matthias Clasen * Copyright (C) 2008,2009 Red Hat, Inc. diff -Nru gobject-introspection-1.31.10/girepository/gicallableinfo.h gobject-introspection-1.31.20/girepository/gicallableinfo.h --- gobject-introspection-1.31.10/girepository/gicallableinfo.h 2011-06-10 15:36:50.000000000 +0000 +++ gobject-introspection-1.31.20/girepository/gicallableinfo.h 2012-02-03 18:33:46.000000000 +0000 @@ -1,4 +1,5 @@ -/* GObject introspection: Callable +/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- + * GObject introspection: Callable * * Copyright (C) 2005 Matthias Clasen * Copyright (C) 2008,2009 Red Hat, Inc. diff -Nru gobject-introspection-1.31.10/girepository/giconstantinfo.c gobject-introspection-1.31.20/girepository/giconstantinfo.c --- gobject-introspection-1.31.10/girepository/giconstantinfo.c 2011-10-10 14:57:55.000000000 +0000 +++ gobject-introspection-1.31.20/girepository/giconstantinfo.c 2012-02-03 18:33:49.000000000 +0000 @@ -1,4 +1,5 @@ -/* GObject introspection: Constant implementation +/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- + * GObject introspection: Constant implementation * * Copyright (C) 2005 Matthias Clasen * Copyright (C) 2008,2009 Red Hat, Inc. diff -Nru gobject-introspection-1.31.10/girepository/giconstantinfo.h gobject-introspection-1.31.20/girepository/giconstantinfo.h --- gobject-introspection-1.31.10/girepository/giconstantinfo.h 2011-10-10 14:57:55.000000000 +0000 +++ gobject-introspection-1.31.20/girepository/giconstantinfo.h 2012-02-03 18:33:51.000000000 +0000 @@ -1,4 +1,5 @@ -/* GObject introspection: Constant +/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- + * GObject introspection: Constant * * Copyright (C) 2005 Matthias Clasen * Copyright (C) 2008,2009 Red Hat, Inc. diff -Nru gobject-introspection-1.31.10/girepository/gi-dump-types.c gobject-introspection-1.31.20/girepository/gi-dump-types.c --- gobject-introspection-1.31.10/girepository/gi-dump-types.c 2011-09-03 16:34:28.000000000 +0000 +++ gobject-introspection-1.31.20/girepository/gi-dump-types.c 2012-02-03 18:34:03.000000000 +0000 @@ -1,3 +1,4 @@ +/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */ #include "gdump.c" #include diff -Nru gobject-introspection-1.31.10/girepository/gienuminfo.c gobject-introspection-1.31.20/girepository/gienuminfo.c --- gobject-introspection-1.31.10/girepository/gienuminfo.c 2011-08-30 01:07:30.000000000 +0000 +++ gobject-introspection-1.31.20/girepository/gienuminfo.c 2012-02-03 18:34:06.000000000 +0000 @@ -1,4 +1,5 @@ -/* GObject introspection: Enum implementation +/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- + * GObject introspection: Enum implementation * * Copyright (C) 2005 Matthias Clasen * Copyright (C) 2008,2009 Red Hat, Inc. diff -Nru gobject-introspection-1.31.10/girepository/gienuminfo.h gobject-introspection-1.31.20/girepository/gienuminfo.h --- gobject-introspection-1.31.10/girepository/gienuminfo.h 2011-08-30 01:07:30.000000000 +0000 +++ gobject-introspection-1.31.20/girepository/gienuminfo.h 2012-02-03 18:34:09.000000000 +0000 @@ -1,4 +1,5 @@ -/* GObject introspection: Enum and Enum values +/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- + * GObject introspection: Enum and Enum values * * Copyright (C) 2005 Matthias Clasen * Copyright (C) 2008,2009 Red Hat, Inc. diff -Nru gobject-introspection-1.31.10/girepository/gifieldinfo.c gobject-introspection-1.31.20/girepository/gifieldinfo.c --- gobject-introspection-1.31.10/girepository/gifieldinfo.c 2011-08-25 19:49:38.000000000 +0000 +++ gobject-introspection-1.31.20/girepository/gifieldinfo.c 2012-02-03 18:34:12.000000000 +0000 @@ -1,4 +1,5 @@ -/* GObject introspection: Field implementation +/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- + * GObject introspection: Field implementation * * Copyright (C) 2005 Matthias Clasen * Copyright (C) 2008,2009 Red Hat, Inc. diff -Nru gobject-introspection-1.31.10/girepository/gifieldinfo.h gobject-introspection-1.31.20/girepository/gifieldinfo.h --- gobject-introspection-1.31.10/girepository/gifieldinfo.h 2011-06-10 15:36:50.000000000 +0000 +++ gobject-introspection-1.31.20/girepository/gifieldinfo.h 2012-02-03 18:34:14.000000000 +0000 @@ -1,4 +1,5 @@ -/* GObject introspection: Field and Field values +/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- + * GObject introspection: Field and Field values * * Copyright (C) 2005 Matthias Clasen * Copyright (C) 2008,2009 Red Hat, Inc. diff -Nru gobject-introspection-1.31.10/girepository/gifunctioninfo.c gobject-introspection-1.31.20/girepository/gifunctioninfo.c --- gobject-introspection-1.31.10/girepository/gifunctioninfo.c 2011-06-10 15:36:50.000000000 +0000 +++ gobject-introspection-1.31.20/girepository/gifunctioninfo.c 2012-02-03 18:34:24.000000000 +0000 @@ -1,4 +1,5 @@ -/* GObject introspection: Function implementation +/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- + * GObject introspection: Function implementation * * Copyright (C) 2005 Matthias Clasen * Copyright (C) 2008,2009 Red Hat, Inc. diff -Nru gobject-introspection-1.31.10/girepository/gifunctioninfo.h gobject-introspection-1.31.20/girepository/gifunctioninfo.h --- gobject-introspection-1.31.10/girepository/gifunctioninfo.h 2011-06-10 15:36:50.000000000 +0000 +++ gobject-introspection-1.31.20/girepository/gifunctioninfo.h 2012-02-03 18:34:27.000000000 +0000 @@ -1,4 +1,5 @@ -/* GObject introspection: Function +/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- + * GObject introspection: Function * * Copyright (C) 2005 Matthias Clasen * Copyright (C) 2008,2009 Red Hat, Inc. diff -Nru gobject-introspection-1.31.10/girepository/giinterfaceinfo.c gobject-introspection-1.31.20/girepository/giinterfaceinfo.c --- gobject-introspection-1.31.10/girepository/giinterfaceinfo.c 2011-06-10 15:36:50.000000000 +0000 +++ gobject-introspection-1.31.20/girepository/giinterfaceinfo.c 2012-02-03 18:34:29.000000000 +0000 @@ -1,4 +1,5 @@ -/* GObject introspection: Interface implementation +/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- + * GObject introspection: Interface implementation * * Copyright (C) 2005 Matthias Clasen * Copyright (C) 2008,2009 Red Hat, Inc. diff -Nru gobject-introspection-1.31.10/girepository/giinterfaceinfo.h gobject-introspection-1.31.20/girepository/giinterfaceinfo.h --- gobject-introspection-1.31.10/girepository/giinterfaceinfo.h 2011-06-10 15:36:50.000000000 +0000 +++ gobject-introspection-1.31.20/girepository/giinterfaceinfo.h 2012-02-03 18:34:32.000000000 +0000 @@ -1,4 +1,5 @@ -/* GObject introspection: Interface +/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- + * GObject introspection: Interface * * Copyright (C) 2005 Matthias Clasen * Copyright (C) 2008,2009 Red Hat, Inc. diff -Nru gobject-introspection-1.31.10/girepository/ginvoke.c gobject-introspection-1.31.20/girepository/ginvoke.c --- gobject-introspection-1.31.10/girepository/ginvoke.c 2011-06-10 15:36:50.000000000 +0000 +++ gobject-introspection-1.31.20/girepository/ginvoke.c 2012-02-17 16:47:04.000000000 +0000 @@ -1,4 +1,5 @@ -/* GObject introspection: Invoke functionality +/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- + * GObject introspection: Invoke functionality * * Copyright (C) 2005 Matthias Clasen * diff -Nru gobject-introspection-1.31.10/girepository/giobjectinfo.c gobject-introspection-1.31.20/girepository/giobjectinfo.c --- gobject-introspection-1.31.10/girepository/giobjectinfo.c 2012-01-06 20:21:10.000000000 +0000 +++ gobject-introspection-1.31.20/girepository/giobjectinfo.c 2012-02-03 18:34:37.000000000 +0000 @@ -1,4 +1,5 @@ -/* GObject introspection: Object implementation +/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- + * GObject introspection: Object implementation * * Copyright (C) 2005 Matthias Clasen * Copyright (C) 2008,2009 Red Hat, Inc. @@ -660,6 +661,66 @@ } /** + * g_object_info_find_vfunc_using_interfaces: + * @info: a #GIObjectInfo + * @name: name of method to obtain + * @implementor: (out) (transfer full): The implementor of the interface + * + * Locate a virtual function slot with name @name, searching both the object + * @info and any interfaces it implements. Note that the namespace for + * virtuals is distinct from that of methods; there may or may not be a + * concrete method associated for a virtual. If there is one, it may be + * retrieved using g_vfunc_info_get_invoker(), otherwise %NULL will be + * returned. + * + * Note that this function does *not* search parent classes; you will have + * to chain up if that's desired. + * + * Returns: (transfer full): the #GIFunctionInfo. Free the struct by calling + * g_base_info_unref() when done. + */ +GIVFuncInfo * +g_object_info_find_vfunc_using_interfaces (GIObjectInfo *info, + const gchar *name, + GIObjectInfo **implementor) +{ + GIVFuncInfo *result = NULL; + GIObjectInfo *implementor_result = NULL; + + result = g_object_info_find_vfunc (info, name); + if (result) + implementor_result = g_base_info_ref ((GIBaseInfo*) info); + + if (result == NULL) + { + int n_interfaces; + int i; + + n_interfaces = g_object_info_get_n_interfaces (info); + for (i = 0; i < n_interfaces; ++i) + { + GIInterfaceInfo *iface_info; + + iface_info = g_object_info_get_interface (info, i); + + result = g_interface_info_find_vfunc (iface_info, name); + + if (result != NULL) + { + implementor_result = iface_info; + break; + } + g_base_info_unref ((GIBaseInfo*) iface_info); + } + } + if (implementor) + *implementor = implementor_result; + else if (implementor_result != NULL) + g_base_info_unref ((GIBaseInfo*) implementor_result); + return result; +} + +/** * g_object_info_get_n_constants: * @info: a #GIObjectInfo * diff -Nru gobject-introspection-1.31.10/girepository/giobjectinfo.h gobject-introspection-1.31.20/girepository/giobjectinfo.h --- gobject-introspection-1.31.10/girepository/giobjectinfo.h 2011-06-10 15:36:50.000000000 +0000 +++ gobject-introspection-1.31.20/girepository/giobjectinfo.h 2012-02-03 18:34:39.000000000 +0000 @@ -1,4 +1,5 @@ -/* GObject introspection: Object +/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- + * GObject introspection: Object * * Copyright (C) 2005 Matthias Clasen * Copyright (C) 2008,2009 Red Hat, Inc. @@ -108,6 +109,9 @@ gint n); GIVFuncInfo * g_object_info_find_vfunc (GIObjectInfo *info, const gchar *name); +GIVFuncInfo * g_object_info_find_vfunc_using_interfaces (GIObjectInfo *info, + const gchar *name, + GIObjectInfo **implementor); gint g_object_info_get_n_constants (GIObjectInfo *info); GIConstantInfo * g_object_info_get_constant (GIObjectInfo *info, gint n); diff -Nru gobject-introspection-1.31.10/girepository/gipropertyinfo.c gobject-introspection-1.31.20/girepository/gipropertyinfo.c --- gobject-introspection-1.31.10/girepository/gipropertyinfo.c 2011-06-10 15:36:50.000000000 +0000 +++ gobject-introspection-1.31.20/girepository/gipropertyinfo.c 2012-02-03 18:34:41.000000000 +0000 @@ -1,4 +1,5 @@ -/* GObject introspection: Property implementation +/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- + * GObject introspection: Property implementation * * Copyright (C) 2005 Matthias Clasen * Copyright (C) 2008,2009 Red Hat, Inc. diff -Nru gobject-introspection-1.31.10/girepository/gipropertyinfo.h gobject-introspection-1.31.20/girepository/gipropertyinfo.h --- gobject-introspection-1.31.10/girepository/gipropertyinfo.h 2011-06-10 15:36:50.000000000 +0000 +++ gobject-introspection-1.31.20/girepository/gipropertyinfo.h 2012-02-03 18:34:45.000000000 +0000 @@ -1,4 +1,5 @@ -/* GObject introspection: Property +/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- + * GObject introspection: Property * * Copyright (C) 2005 Matthias Clasen * Copyright (C) 2008,2009 Red Hat, Inc. diff -Nru gobject-introspection-1.31.10/girepository/giregisteredtypeinfo.c gobject-introspection-1.31.20/girepository/giregisteredtypeinfo.c --- gobject-introspection-1.31.10/girepository/giregisteredtypeinfo.c 2011-06-10 15:36:50.000000000 +0000 +++ gobject-introspection-1.31.20/girepository/giregisteredtypeinfo.c 2012-02-03 18:34:47.000000000 +0000 @@ -1,4 +1,5 @@ -/* GObject introspection: Registered Type implementation +/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- + * GObject introspection: Registered Type implementation * * Copyright (C) 2005 Matthias Clasen * Copyright (C) 2008,2009 Red Hat, Inc. diff -Nru gobject-introspection-1.31.10/girepository/giregisteredtypeinfo.h gobject-introspection-1.31.20/girepository/giregisteredtypeinfo.h --- gobject-introspection-1.31.10/girepository/giregisteredtypeinfo.h 2011-06-10 15:36:50.000000000 +0000 +++ gobject-introspection-1.31.20/girepository/giregisteredtypeinfo.h 2012-02-03 18:34:49.000000000 +0000 @@ -1,4 +1,5 @@ -/* GObject introspection: Registered Type +/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- + * GObject introspection: Registered Type * * Copyright (C) 2005 Matthias Clasen * Copyright (C) 2008,2009 Red Hat, Inc. diff -Nru gobject-introspection-1.31.10/girepository/girepository.c gobject-introspection-1.31.20/girepository/girepository.c --- gobject-introspection-1.31.10/girepository/girepository.c 2011-10-10 14:57:48.000000000 +0000 +++ gobject-introspection-1.31.20/girepository/girepository.c 2012-02-08 13:41:45.000000000 +0000 @@ -1,5 +1,5 @@ -/* -*- Mode: C; c-file-style: "gnu"; -*- */ -/* GObject introspection: Repository implementation +/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- + * GObject introspection: Repository implementation * * Copyright (C) 2005 Matthias Clasen * Copyright (C) 2008 Colin Walters @@ -93,7 +93,9 @@ (GDestroyNotify) NULL, (GDestroyNotify) g_typelib_free); repository->priv->lazy_typelibs - = g_hash_table_new (g_str_hash, g_str_equal); + = g_hash_table_new_full (g_str_hash, g_str_equal, + (GDestroyNotify) g_free, + (GDestroyNotify) NULL); repository->priv->info_by_gtype = g_hash_table_new_full (g_direct_hash, g_direct_equal, (GDestroyNotify) NULL, diff -Nru gobject-introspection-1.31.10/girepository/girepository.h gobject-introspection-1.31.20/girepository/girepository.h --- gobject-introspection-1.31.10/girepository/girepository.h 2011-08-25 19:49:38.000000000 +0000 +++ gobject-introspection-1.31.20/girepository/girepository.h 2012-02-03 18:35:02.000000000 +0000 @@ -1,4 +1,5 @@ -/* GObject introspection: Repository +/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- + * GObject introspection: Repository * * Copyright (C) 2005 Matthias Clasen * Copyright (C) 2008,2009 Red Hat, Inc. diff -Nru gobject-introspection-1.31.10/girepository/girepository-private.h gobject-introspection-1.31.20/girepository/girepository-private.h --- gobject-introspection-1.31.10/girepository/girepository-private.h 2011-06-10 15:36:50.000000000 +0000 +++ gobject-introspection-1.31.20/girepository/girepository-private.h 2012-02-03 18:35:06.000000000 +0000 @@ -1,5 +1,5 @@ -/* -*- Mode: C; c-file-style: "gnu"; -*- */ -/* GObject introspection: Private headers +/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- + * GObject introspection: Private headers * * Copyright (C) 2010 Johan Dahlin * diff -Nru gobject-introspection-1.31.10/girepository/girffi.c gobject-introspection-1.31.20/girepository/girffi.c --- gobject-introspection-1.31.10/girepository/girffi.c 2012-01-06 20:21:10.000000000 +0000 +++ gobject-introspection-1.31.20/girepository/girffi.c 2012-02-16 21:31:25.000000000 +0000 @@ -1,4 +1,5 @@ -/* GObject introspection: Helper functions for ffi integration +/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- + * GObject introspection: Helper functions for ffi integration * * Copyright (C) 2008 Red Hat, Inc * Copyright (C) 2005 Matthias Clasen @@ -230,13 +231,7 @@ GError **error) { const char *symbol; - ffi_type *rtype; - ffi_type **atypes; - GITypeInfo *tinfo; - GIArgInfo *ainfo; - gboolean is_method; - gboolean throws; - gint n_args, n_invoke_args, i; + gpointer addr; g_return_val_if_fail (info != NULL, FALSE); g_return_val_if_fail (invoker != NULL, FALSE); @@ -244,7 +239,7 @@ symbol = g_function_info_get_symbol ((GIFunctionInfo*) info); if (!g_typelib_symbol (g_base_info_get_typelib((GIBaseInfo *) info), - symbol, &(invoker->native_address))) + symbol, &addr)) { g_set_error (error, G_INVOKE_ERROR, @@ -254,15 +249,79 @@ return FALSE; } - is_method = (g_function_info_get_flags (info) & GI_FUNCTION_IS_METHOD) != 0 - && (g_function_info_get_flags (info) & GI_FUNCTION_IS_CONSTRUCTOR) == 0; - throws = g_function_info_get_flags (info) & GI_FUNCTION_THROWS; + return g_function_invoker_new_for_address (addr, info, invoker, error); +} + +/** + * g_function_invoker_new_for_address: + * @addr: The address + * @info: A #GICallableInfo + * @invoker: Output invoker structure + * @error: A #GError + * + * Initialize the caller-allocated @invoker structure with a cache + * of information needed to invoke the C function corresponding to + * @info with the platform's default ABI. + * + * A primary intent of this function is that a dynamic structure allocated + * by a language binding could contain a #GIFunctionInvoker structure + * inside the binding's function mapping. + * + * Returns: %TRUE on success, %FALSE otherwise with @error set. + */ +gboolean +g_function_invoker_new_for_address (gpointer addr, + GICallableInfo *info, + GIFunctionInvoker *invoker, + GError **error) +{ + ffi_type *rtype; + ffi_type **atypes; + GITypeInfo *tinfo; + GIArgInfo *ainfo; + GIInfoType info_type; + gboolean is_method; + gboolean throws; + gint n_args, n_invoke_args, i; + + g_return_val_if_fail (info != NULL, FALSE); + g_return_val_if_fail (invoker != NULL, FALSE); + + invoker->native_address = addr; + + info_type = g_base_info_get_type ((GIBaseInfo *) info); + + switch (info_type) + { + case GI_INFO_TYPE_FUNCTION: + { + GIFunctionInfoFlags flags; + flags = g_function_info_get_flags ((GIFunctionInfo *)info); + is_method = (flags & GI_FUNCTION_IS_METHOD) != 0; + throws = (flags & GI_FUNCTION_THROWS) != 0; + } + break; + case GI_INFO_TYPE_VFUNC: + { + GIVFuncInfoFlags flags; + flags = g_vfunc_info_get_flags ((GIVFuncInfo *)info); + throws = (flags & GI_VFUNC_THROWS) != 0; + } + is_method = TRUE; + break; + case GI_INFO_TYPE_CALLBACK: + is_method = TRUE; + throws = FALSE; + break; + default: + g_assert_not_reached (); + } - tinfo = g_callable_info_get_return_type ((GICallableInfo *)info); + tinfo = g_callable_info_get_return_type (info); rtype = g_type_info_get_ffi_type (tinfo); g_base_info_unref ((GIBaseInfo *)tinfo); - n_args = g_callable_info_get_n_args ((GICallableInfo *)info); + n_args = g_callable_info_get_n_args (info); if (is_method) n_invoke_args = n_args+1; else @@ -282,7 +341,7 @@ for (i = 0; i < n_args; i++) { int offset = (is_method ? 1 : 0); - ainfo = g_callable_info_get_arg ((GICallableInfo *)info, i); + ainfo = g_callable_info_get_arg (info, i); switch (g_arg_info_get_direction (ainfo)) { case GI_DIRECTION_IN: diff -Nru gobject-introspection-1.31.10/girepository/girffi.h gobject-introspection-1.31.20/girepository/girffi.h --- gobject-introspection-1.31.10/girepository/girffi.h 2011-06-21 22:02:36.000000000 +0000 +++ gobject-introspection-1.31.20/girepository/girffi.h 2012-02-17 16:47:04.000000000 +0000 @@ -1,4 +1,5 @@ -/* GObject introspection: Helper functions for ffi integration +/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- + * GObject introspection: Helper functions for ffi integration * * Copyright (C) 2008 Red Hat, Inc * @@ -53,6 +54,11 @@ GIFunctionInvoker *invoker, GError **error); +gboolean g_function_invoker_new_for_address (gpointer addr, + GICallableInfo *info, + GIFunctionInvoker *invoker, + GError **error); + void g_function_invoker_destroy (GIFunctionInvoker *invoker); diff -Nru gobject-introspection-1.31.10/girepository/girmodule.c gobject-introspection-1.31.20/girepository/girmodule.c --- gobject-introspection-1.31.10/girepository/girmodule.c 2011-08-25 19:49:38.000000000 +0000 +++ gobject-introspection-1.31.20/girepository/girmodule.c 2012-02-03 18:35:13.000000000 +0000 @@ -1,4 +1,5 @@ -/* GObject introspection: Typelib creation +/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- + * GObject introspection: Typelib creation * * Copyright (C) 2005 Matthias Clasen * diff -Nru gobject-introspection-1.31.10/girepository/girmodule.h gobject-introspection-1.31.20/girepository/girmodule.h --- gobject-introspection-1.31.10/girepository/girmodule.h 2011-06-10 15:36:50.000000000 +0000 +++ gobject-introspection-1.31.20/girepository/girmodule.h 2012-02-03 18:35:15.000000000 +0000 @@ -1,4 +1,5 @@ -/* GObject introspection: Parsed IDL +/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- + * GObject introspection: Parsed IDL * * Copyright (C) 2005 Matthias Clasen * diff -Nru gobject-introspection-1.31.10/girepository/girnode.c gobject-introspection-1.31.20/girepository/girnode.c --- gobject-introspection-1.31.10/girepository/girnode.c 2011-08-30 01:07:30.000000000 +0000 +++ gobject-introspection-1.31.20/girepository/girnode.c 2012-02-03 18:35:18.000000000 +0000 @@ -1,4 +1,5 @@ -/* GObject introspection: Typelib creation +/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- + * GObject introspection: Typelib creation * * Copyright (C) 2005 Matthias Clasen * Copyright (C) 2008,2009 Red Hat, Inc. @@ -1784,6 +1785,7 @@ blob->must_be_implemented = 0; /* FIXME */ blob->must_not_be_implemented = 0; /* FIXME */ blob->class_closure = 0; /* FIXME */ + blob->throws = vfunc->throws; blob->reserved = 0; if (vfunc->invoker) diff -Nru gobject-introspection-1.31.10/girepository/girnode.h gobject-introspection-1.31.20/girepository/girnode.h --- gobject-introspection-1.31.10/girepository/girnode.h 2011-08-30 01:07:30.000000000 +0000 +++ gobject-introspection-1.31.20/girepository/girnode.h 2012-02-03 18:35:22.000000000 +0000 @@ -1,4 +1,5 @@ -/* GObject introspection: Parsed GIR +/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- + * GObject introspection: Parsed GIR * * Copyright (C) 2005 Matthias Clasen * @@ -206,6 +207,7 @@ gboolean must_be_implemented; gboolean must_not_be_implemented; gboolean is_class_closure; + gboolean throws; char *invoker; diff -Nru gobject-introspection-1.31.10/girepository/giroffsets.c gobject-introspection-1.31.20/girepository/giroffsets.c --- gobject-introspection-1.31.10/girepository/giroffsets.c 2011-06-21 14:10:43.000000000 +0000 +++ gobject-introspection-1.31.20/girepository/giroffsets.c 2012-02-03 18:35:25.000000000 +0000 @@ -1,4 +1,5 @@ -/* GObject introspection: Compute structure offsets +/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- + * GObject introspection: Compute structure offsets * * Copyright (C) 2008 Red Hat, Inc. * diff -Nru gobject-introspection-1.31.10/girepository/girparser.c gobject-introspection-1.31.20/girepository/girparser.c --- gobject-introspection-1.31.10/girepository/girparser.c 2011-10-18 19:29:33.000000000 +0000 +++ gobject-introspection-1.31.20/girepository/girparser.c 2012-02-17 16:47:44.000000000 +0000 @@ -1,4 +1,5 @@ -/* GObject introspection: A parser for the XML GIR format +/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- + * GObject introspection: A parser for the XML GIR format * * Copyright (C) 2005 Matthias Clasen * Copyright (C) 2008 Philip Van Hoof @@ -2345,6 +2346,7 @@ const gchar *is_class_closure; const gchar *offset; const gchar *invoker; + const gchar *throws; GIrNodeInterface *iface; GIrNodeVFunc *vfunc; @@ -2362,6 +2364,7 @@ is_class_closure = find_attribute ("is-class-closure", attribute_names, attribute_values); offset = find_attribute ("offset", attribute_names, attribute_values); invoker = find_attribute ("invoker", attribute_names, attribute_values); + throws = find_attribute ("throws", attribute_names, attribute_values); if (name == NULL) { @@ -2400,6 +2403,11 @@ else vfunc->is_class_closure = FALSE; + if (throws && strcmp (throws, "1") == 0) + vfunc->throws = TRUE; + else + vfunc->throws = FALSE; + if (offset) vfunc->offset = atoi (offset); else @@ -3503,10 +3511,11 @@ if (ctx.modules) return ctx.modules->data; - g_set_error (error, - G_MARKUP_ERROR, - G_MARKUP_ERROR_INVALID_CONTENT, - "Expected namespace element in the gir file"); + if (error && *error == NULL) + g_set_error (error, + G_MARKUP_ERROR, + G_MARKUP_ERROR_INVALID_CONTENT, + "Expected namespace element in the gir file"); return NULL; } diff -Nru gobject-introspection-1.31.10/girepository/girparser.h gobject-introspection-1.31.20/girepository/girparser.h --- gobject-introspection-1.31.10/girepository/girparser.h 2011-06-10 15:36:50.000000000 +0000 +++ gobject-introspection-1.31.20/girepository/girparser.h 2012-02-03 18:35:31.000000000 +0000 @@ -1,4 +1,5 @@ -/* GObject introspection: A parser for the XML GIR format +/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- + * GObject introspection: A parser for the XML GIR format * * Copyright (C) 2005 Matthias Clasen * diff -Nru gobject-introspection-1.31.10/girepository/girwriter.c gobject-introspection-1.31.20/girepository/girwriter.c --- gobject-introspection-1.31.10/girepository/girwriter.c 2011-08-25 19:49:38.000000000 +0000 +++ gobject-introspection-1.31.20/girepository/girwriter.c 2012-02-03 18:35:39.000000000 +0000 @@ -1,5 +1,5 @@ -/* -*- Mode: C; c-file-style: "gnu"; -*- */ -/* GObject introspection: IDL generator +/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- + * GObject introspection: IDL generator * * Copyright (C) 2005 Matthias Clasen * Copyright (C) 2008,2009 Red Hat, Inc. @@ -916,6 +916,9 @@ else if (flags & GI_VFUNC_MUST_NOT_OVERRIDE) xml_printf (file, " override=\"never\""); + if (flags & GI_VFUNC_THROWS) + xml_printf (file, " throws=\"1\""); + xml_printf (file, " offset=\"%d\"", offset); if (invoker) diff -Nru gobject-introspection-1.31.10/girepository/girwriter.h gobject-introspection-1.31.20/girepository/girwriter.h --- gobject-introspection-1.31.10/girepository/girwriter.h 2011-06-10 15:36:50.000000000 +0000 +++ gobject-introspection-1.31.20/girepository/girwriter.h 2012-02-03 18:35:41.000000000 +0000 @@ -1,4 +1,5 @@ -/* GObject introspection: IDL writer +/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- + * GObject introspection: IDL writer * * Copyright (C) 2007 Johan Dahlin * diff -Nru gobject-introspection-1.31.10/girepository/gisignalinfo.c gobject-introspection-1.31.20/girepository/gisignalinfo.c --- gobject-introspection-1.31.10/girepository/gisignalinfo.c 2011-06-10 15:36:50.000000000 +0000 +++ gobject-introspection-1.31.20/girepository/gisignalinfo.c 2012-02-03 18:35:43.000000000 +0000 @@ -1,4 +1,5 @@ -/* GObject introspection: Signal implementation +/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- + * GObject introspection: Signal implementation * * Copyright (C) 2005 Matthias Clasen * Copyright (C) 2008,2009 Red Hat, Inc. diff -Nru gobject-introspection-1.31.10/girepository/gisignalinfo.h gobject-introspection-1.31.20/girepository/gisignalinfo.h --- gobject-introspection-1.31.10/girepository/gisignalinfo.h 2011-06-10 15:36:50.000000000 +0000 +++ gobject-introspection-1.31.20/girepository/gisignalinfo.h 2012-02-03 18:35:45.000000000 +0000 @@ -1,4 +1,5 @@ -/* GObject introspection: Signal +/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- + * GObject introspection: Signal * * Copyright (C) 2005 Matthias Clasen * Copyright (C) 2008,2009 Red Hat, Inc. diff -Nru gobject-introspection-1.31.10/girepository/gistructinfo.c gobject-introspection-1.31.20/girepository/gistructinfo.c --- gobject-introspection-1.31.10/girepository/gistructinfo.c 2011-06-10 15:36:50.000000000 +0000 +++ gobject-introspection-1.31.20/girepository/gistructinfo.c 2012-02-03 18:35:47.000000000 +0000 @@ -1,4 +1,5 @@ -/* GObject introspection: Struct implementation +/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- + * GObject introspection: Struct implementation * * Copyright (C) 2005 Matthias Clasen * Copyright (C) 2008,2009 Red Hat, Inc. diff -Nru gobject-introspection-1.31.10/girepository/gistructinfo.h gobject-introspection-1.31.20/girepository/gistructinfo.h --- gobject-introspection-1.31.10/girepository/gistructinfo.h 2011-06-10 15:36:50.000000000 +0000 +++ gobject-introspection-1.31.20/girepository/gistructinfo.h 2012-02-03 18:35:49.000000000 +0000 @@ -1,4 +1,5 @@ -/* GObject introspection: Struct +/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- + * GObject introspection: Struct * * Copyright (C) 2005 Matthias Clasen * Copyright (C) 2008,2009 Red Hat, Inc. diff -Nru gobject-introspection-1.31.10/girepository/gitypeinfo.c gobject-introspection-1.31.20/girepository/gitypeinfo.c --- gobject-introspection-1.31.10/girepository/gitypeinfo.c 2011-08-25 19:49:38.000000000 +0000 +++ gobject-introspection-1.31.20/girepository/gitypeinfo.c 2012-02-16 21:31:25.000000000 +0000 @@ -1,4 +1,5 @@ -/* GObject introspection: Type implementation +/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- + * GObject introspection: Type implementation * * Copyright (C) 2005 Matthias Clasen * Copyright (C) 2008,2009 Red Hat, Inc. diff -Nru gobject-introspection-1.31.10/girepository/gitypeinfo.h gobject-introspection-1.31.20/girepository/gitypeinfo.h --- gobject-introspection-1.31.10/girepository/gitypeinfo.h 2011-08-25 19:49:38.000000000 +0000 +++ gobject-introspection-1.31.20/girepository/gitypeinfo.h 2012-02-16 21:31:25.000000000 +0000 @@ -1,4 +1,5 @@ -/* GObject introspection: Type +/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- + * GObject introspection: Type * * Copyright (C) 2005 Matthias Clasen * Copyright (C) 2008,2009 Red Hat, Inc. diff -Nru gobject-introspection-1.31.10/girepository/gitypelib.c gobject-introspection-1.31.20/girepository/gitypelib.c --- gobject-introspection-1.31.10/girepository/gitypelib.c 2011-12-08 20:00:31.000000000 +0000 +++ gobject-introspection-1.31.20/girepository/gitypelib.c 2012-02-03 18:35:55.000000000 +0000 @@ -1,4 +1,5 @@ -/* GObject introspection: typelib validation, auxiliary functions +/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- + * GObject introspection: typelib validation, auxiliary functions * related to the binary typelib format * * Copyright (C) 2005 Matthias Clasen diff -Nru gobject-introspection-1.31.10/girepository/gitypelib.h gobject-introspection-1.31.20/girepository/gitypelib.h --- gobject-introspection-1.31.10/girepository/gitypelib.h 2011-06-10 15:36:50.000000000 +0000 +++ gobject-introspection-1.31.20/girepository/gitypelib.h 2012-02-03 18:35:59.000000000 +0000 @@ -1,4 +1,5 @@ -/* GObject introspection: Public typelib API +/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- + * GObject introspection: Public typelib API * * Copyright (C) 2005 Matthias Clasen * Copyright (C) 2008,2009 Red Hat, Inc. diff -Nru gobject-introspection-1.31.10/girepository/gitypelib-internal.h gobject-introspection-1.31.20/girepository/gitypelib-internal.h --- gobject-introspection-1.31.10/girepository/gitypelib-internal.h 2011-08-30 01:07:30.000000000 +0000 +++ gobject-introspection-1.31.20/girepository/gitypelib-internal.h 2012-02-08 13:42:12.000000000 +0000 @@ -1,4 +1,5 @@ -/* GObject introspection: struct definitions for the binary +/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- + * GObject introspection: struct definitions for the binary * typelib format, validation * * Copyright (C) 2005 Matthias Clasen @@ -281,7 +282,7 @@ guint32 sections; /* */ - guint16 padding[5]; + guint16 padding[6]; } Header; typedef enum { @@ -433,6 +434,10 @@ gint8 closure; gint8 destroy; + /* */ + guint16 padding; + /* */ + SimpleTypeBlob arg_type; } ArgBlob; @@ -925,7 +930,8 @@ guint16 must_be_implemented : 1; guint16 must_not_be_implemented : 1; guint16 class_closure : 1; - guint16 reserved :12; + guint16 throws : 1; + guint16 reserved :11; guint16 signal; guint16 struct_offset; @@ -1049,6 +1055,8 @@ guint16 n_vfuncs; guint16 n_constants; + guint16 padding; + guint32 reserved2; guint32 reserved3; diff -Nru gobject-introspection-1.31.10/girepository/gitypes.h gobject-introspection-1.31.20/girepository/gitypes.h --- gobject-introspection-1.31.10/girepository/gitypes.h 2012-01-06 19:46:42.000000000 +0000 +++ gobject-introspection-1.31.20/girepository/gitypes.h 2012-02-03 18:36:06.000000000 +0000 @@ -1,4 +1,5 @@ -/* GObject introspection: types +/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- + * GObject introspection: types * * Copyright (C) 2005 Matthias Clasen * Copyright (C) 2008,2009 Red Hat, Inc. @@ -403,6 +404,7 @@ * @GI_VFUNC_MUST_CHAIN_UP: chains up to the parent type * @GI_VFUNC_MUST_OVERRIDE: overrides * @GI_VFUNC_MUST_NOT_OVERRIDE: does not override + * @GI_VFUNC_THROWS: Includes a #GError * * Flags of a #GIVFuncInfo struct. */ @@ -410,7 +412,8 @@ { GI_VFUNC_MUST_CHAIN_UP = 1 << 0, GI_VFUNC_MUST_OVERRIDE = 1 << 1, - GI_VFUNC_MUST_NOT_OVERRIDE = 1 << 2 + GI_VFUNC_MUST_NOT_OVERRIDE = 1 << 2, + GI_VFUNC_THROWS = 1 << 3 } GIVFuncInfoFlags; /** diff -Nru gobject-introspection-1.31.10/girepository/giunioninfo.c gobject-introspection-1.31.20/girepository/giunioninfo.c --- gobject-introspection-1.31.10/girepository/giunioninfo.c 2011-06-10 15:36:50.000000000 +0000 +++ gobject-introspection-1.31.20/girepository/giunioninfo.c 2012-02-03 18:36:08.000000000 +0000 @@ -1,4 +1,5 @@ -/* GObject introspection: Union implementation +/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- + * GObject introspection: Union implementation * * Copyright (C) 2005 Matthias Clasen * Copyright (C) 2008,2009 Red Hat, Inc. diff -Nru gobject-introspection-1.31.10/girepository/giunioninfo.h gobject-introspection-1.31.20/girepository/giunioninfo.h --- gobject-introspection-1.31.10/girepository/giunioninfo.h 2011-06-10 15:36:50.000000000 +0000 +++ gobject-introspection-1.31.20/girepository/giunioninfo.h 2012-02-03 18:36:10.000000000 +0000 @@ -1,4 +1,5 @@ -/* GObject introspection: Union +/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- + * GObject introspection: Union * * Copyright (C) 2005 Matthias Clasen * Copyright (C) 2008,2009 Red Hat, Inc. diff -Nru gobject-introspection-1.31.10/girepository/givfuncinfo.c gobject-introspection-1.31.20/girepository/givfuncinfo.c --- gobject-introspection-1.31.10/girepository/givfuncinfo.c 2011-06-10 15:36:50.000000000 +0000 +++ gobject-introspection-1.31.20/girepository/givfuncinfo.c 2012-02-03 18:36:13.000000000 +0000 @@ -1,4 +1,5 @@ -/* GObject introspection: Virtual Function implementation +/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- + * GObject introspection: Virtual Function implementation * * Copyright (C) 2005 Matthias Clasen * Copyright (C) 2008,2009 Red Hat, Inc. @@ -104,6 +105,9 @@ if (blob->must_not_be_implemented) flags = flags | GI_VFUNC_MUST_NOT_OVERRIDE; + if (blob->throws) + flags = flags | GI_VFUNC_THROWS; + return flags; } diff -Nru gobject-introspection-1.31.10/girepository/givfuncinfo.h gobject-introspection-1.31.20/girepository/givfuncinfo.h --- gobject-introspection-1.31.10/girepository/givfuncinfo.h 2011-06-10 15:36:50.000000000 +0000 +++ gobject-introspection-1.31.20/girepository/givfuncinfo.h 2012-02-03 18:36:16.000000000 +0000 @@ -1,4 +1,5 @@ -/* GObject introspection: Virtual Functions +/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- + * GObject introspection: Virtual Functions * * Copyright (C) 2005 Matthias Clasen * Copyright (C) 2008,2009 Red Hat, Inc. diff -Nru gobject-introspection-1.31.10/girepository/glib-compat.h gobject-introspection-1.31.20/girepository/glib-compat.h --- gobject-introspection-1.31.10/girepository/glib-compat.h 2011-06-10 15:36:50.000000000 +0000 +++ gobject-introspection-1.31.20/girepository/glib-compat.h 2012-02-03 18:36:19.000000000 +0000 @@ -1,4 +1,5 @@ -/* GObject introspection: Compatibility definitions +/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- + * GObject introspection: Compatibility definitions * * Copyright (C) 2009 Javier Jardón * diff -Nru gobject-introspection-1.31.10/girepository/gthash.c gobject-introspection-1.31.20/girepository/gthash.c --- gobject-introspection-1.31.10/girepository/gthash.c 2011-06-10 15:36:50.000000000 +0000 +++ gobject-introspection-1.31.20/girepository/gthash.c 2012-02-03 18:36:22.000000000 +0000 @@ -1,4 +1,5 @@ -/* GObject introspection: Typelib hashing +/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- + * GObject introspection: Typelib hashing * * Copyright (C) 2010 Red Hat, Inc. * diff -Nru gobject-introspection-1.31.10/girepository/gthash-test.c gobject-introspection-1.31.20/girepository/gthash-test.c --- gobject-introspection-1.31.10/girepository/gthash-test.c 2011-06-10 15:36:50.000000000 +0000 +++ gobject-introspection-1.31.20/girepository/gthash-test.c 2012-02-03 18:36:24.000000000 +0000 @@ -1,4 +1,5 @@ -/* GObject introspection: Test typelib hashing +/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- + * GObject introspection: Test typelib hashing * * Copyright (C) 2010 Red Hat, Inc. * diff -Nru gobject-introspection-1.31.10/giscanner/ast.py gobject-introspection-1.31.20/giscanner/ast.py --- gobject-introspection-1.31.10/giscanner/ast.py 2012-01-06 20:21:10.000000000 +0000 +++ gobject-introspection-1.31.20/giscanner/ast.py 2012-02-20 17:19:27.000000000 +0000 @@ -556,6 +556,7 @@ self.parameters = parameters self.throws = not not throws self.instance_parameter = None # Parameter + self.parent = None # A Class or Interface def get_parameter_index(self, name): for i, parameter in enumerate(self.parameters): @@ -1007,6 +1008,7 @@ self.transfer = PARAM_TRANSFER_NONE else: self.transfer = transfer + self.parent = None # A Class or Interface class Callback(Callable): diff -Nru gobject-introspection-1.31.10/giscanner/docbookdescription.py gobject-introspection-1.31.20/giscanner/docbookdescription.py --- gobject-introspection-1.31.10/giscanner/docbookdescription.py 2011-08-30 01:07:30.000000000 +0000 +++ gobject-introspection-1.31.20/giscanner/docbookdescription.py 1970-01-01 00:00:00.000000000 +0000 @@ -1,185 +0,0 @@ - -TAG_PROGRAM_LISTING = '', ''} - -def get_formatted_description(description): - desc = description.replace("|[", "") \ - .replace("]|", "") - - desc = "%s" % desc - -# we still need to handle this case -# # Handle "#include " -# $text =~ s/#include(\s+)<([^>]+)>/#include$1<$2>/g; - - formatted_desc = "" - - inside_tags = [] - last_offset = 0 - for start, end, tag in _find_xml_tag_matches(desc): - if len(inside_tags) == 0: - new_desc = "\n\n\n".join(desc[last_offset:start].split('\n\n')) - else: - new_desc = desc[last_offset:start] - - if TAG_CDATA not in inside_tags: - new_desc = _escape_non_cdata_section(new_desc) - - formatted_desc += new_desc - formatted_desc += tag - if tag == TAG_PROGRAM_LISTING: - formatted_desc += '>' - - if tag in (TAG_CDATA, TAG_PROGRAM_LISTING): - inside_tags.append(tag) - else: - try: - inside_tags.pop() - except IndexError: - print "Error: mismatched tag:", tag - last_offset = end - - formatted_desc += _escape_non_cdata_section(desc[last_offset:]) - return formatted_desc - -def _find_xml_tag_matches(string): - offset = 0 - while True: - indexes = [] - for tag in TAGS: - pos = string.find(tag, offset) - if pos != -1: - indexes.append((tag, pos)) - - if indexes: - tag, first = min(indexes, key=lambda x: x[1]) - if tag == TAG_PROGRAM_LISTING: - end = string.find('>', first + len(tag) - 1) + 1 - else: - end = first + len(tag) - offset = end - yield first, end, tag - else: - return - -def _escape_non_cdata_section(string): - string = _escape_ampersand_not_in_entity(string) - string = _escape_lt_not_in_xml_tag(string) - return _escape_gt_not_in_xml_tag(string) - -def _escape_ampersand_not_in_entity(string): - parts = string.split('&') - - output = parts[0] - for part in parts[1:]: - end = part.find(';') - if end == -1 or not part[:end].isalpha(): - output += "&" - else: - output += "&" - output += part - - return output - -def _is_valid_xml_tag_name(name): - if len(name) < 1: - return False - elif name.isalpha() or (name[0].isalpha() and name[1:].isalnum()): - return True - -def _is_valid_xml_tag(string): - # handle case where line end is between tag name and first argument. - # ie. My Link - string = string.replace('\n', ' ') - - if string[-1] == '/': - string = string[:-1] - - # string is the inner part of the tag, without < and > - if string[0] == '/' and _is_valid_xml_tag_name(string[1:]): - #valid end tag - return True - elif _is_valid_xml_tag_name(string): - #valid start tag with not params - return True - elif " " in string: - # we are looking for: - # TODO: handle spaces in values (between quotations) - tagname, rest = string.split(" ", 1) - if not _is_valid_xml_tag_name(tagname): - return False - - while rest.strip(): - rest = rest.lstrip() - - if not '=' in rest: - return False - argname, rest = rest.split('=', 1) - if not _is_valid_xml_tag_name(argname): - return False - if rest[0] != '"': - return False - value, rest = rest[1:].split('"', 1) - - return True - -def _escape_lt_not_in_xml_tag(string): - parts = string.split('<') - - output = parts[0] - for part in parts[1:]: - end = part.find('>') - if end == -1 or not _is_valid_xml_tag(part[:end]): - output += "<" - else: - output += "<" - output += part - - return output - -def _escape_gt_not_in_xml_tag(string): - parts = string.split('>') - - output = parts[0] - for part in parts[1:]: - start = output.rfind('<') - if start == -1 or not _is_valid_xml_tag(output[start+1:]): - output += ">" - else: - output += ">" - output += part - - return output - - -def test(): - assert _is_valid_xml_tag_name('a') - assert _is_valid_xml_tag_name('refsect1') - assert not _is_valid_xml_tag_name('1refsect') - assert not _is_valid_xml_tag_name('1') - - assert _is_valid_xml_tag('/a') - assert _is_valid_xml_tag('/refsect1') - assert not _is_valid_xml_tag('/1') - assert _is_valid_xml_tag('link') - assert _is_valid_xml_tag('link linkend="value"') - assert _is_valid_xml_tag('link linkend="value"') - assert _is_valid_xml_tag('link/') - assert _is_valid_xml_tag('link linkend="value"/') - assert _is_valid_xml_tag('link linkend="value" arg23="anothervalue"') - assert _is_valid_xml_tag('link linkend="value" arg23="anothervalue with spaces"') - assert not _is_valid_xml_tag('link linkend="value arg23="anothervalue with spaces"') - assert not _is_valid_xml_tag('link linkend') - assert _is_valid_xml_tag('link\nlinkend="link-id"') - assert _is_valid_xml_tag('xref linkend="gtkstylecontext-classes"/') - - assert _is_valid_xml_tag('a href="http://www.gtk.org" title="<i>Our</i> website"') - assert _is_valid_xml_tag('ulink \nurl="http://www.freedesktop.org/Standards/wm-spec"') - - string = 'gtk_label_set_markup (label, "Go to the GTK+ website for more...");' - assert _escape_lt_not_in_xml_tag(string) == string - -if __name__ == '__main__': - test() diff -Nru gobject-introspection-1.31.10/giscanner/docbookwriter.py gobject-introspection-1.31.20/giscanner/docbookwriter.py --- gobject-introspection-1.31.10/giscanner/docbookwriter.py 2011-08-30 01:07:30.000000000 +0000 +++ gobject-introspection-1.31.20/giscanner/docbookwriter.py 1970-01-01 00:00:00.000000000 +0000 @@ -1,569 +0,0 @@ -#!/usr/bin/env python -# -*- Mode: Python -*- -# GObject-Introspection - a framework for introspecting GObject libraries -# Copyright (C) 2010 Zach Goldberg -# Copyright (C) 2011 Johan Dahlin -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# as published by the Free Software Foundation; either version 2 -# of the License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA -# 02110-1301, USA. -# - -import sys - -from . import ast -from .girparser import GIRParser -from .xmlwriter import XMLWriter -from .docbookdescription import get_formatted_description - -XMLNS = "http://docbook.org/ns/docbook" -XMLVERSION = "5.0" -DOCTYPE = """ - -]>""" #" - -def _space(num): - return " " * num - -class DocBookFormatter(object): - def __init__(self): - self.namespace = None - self.writer = None - - def set_namespace(self, namespace): - self.namespace = namespace - - def set_writer(self, writer): - self.writer = writer - - def get_type_string(self, type): - return str(type.ctype) - - def render_parameter(self, param_type, param_name): - return "%s %s" % (param_type, param_name) - - def _render_parameter(self, param, extra_content=''): - with self.writer.tagcontext("parameter"): - if param.type.ctype is not None: - link_dest = param.type.ctype.replace("*", "") - else: - link_dest = param.type.ctype - with self.writer.tagcontext("link", [("linkend", "%s" % link_dest)]): - self.writer.write_tag("type", [], link_dest) - self.writer.write_line(extra_content) - - def _render_parameters(self, parent, parameters): - self.writer.write_line( - "%s(" % _space(40 - len(parent.symbol))) - - parent_class = parent.parent_class - ctype = ast.Type(parent.parent_class.ctype + '*') - params = [] - params.append(ast.Parameter(parent_class.name.lower(), ctype)) - params.extend(parameters) - - first_param = True - for param in params: - if not first_param: - self.writer.write_line("\n%s" % _space(61)) - else: - first_param = False - - if not param == params[-1]: - comma = ", " - else: - comma = "" - - if isinstance(param.type, ast.Varargs): - with self.writer.tagcontext("parameter"): - self.writer.write_line('...%s' % comma) - else: - extra_content = " " - if param.type.ctype is not None and '*' in param.type.ctype: - extra_content += '*' - extra_content += param.argname - extra_content += comma - self._render_parameter(param, extra_content) - - self.writer.write_line(");\n") - - def get_method_as_title(self, method): - return "%s ()" % method.symbol - - def get_page_name(self, node): - # page name is only used for xml:id (not displayed to users) - if isinstance(node, ast.Alias) or node.gtype_name is None: - return node.ctype - return node.gtype_name - - def get_class_name(self, node): - if node.gtype_name is None: - return node.ctype - return node.gtype_name - - def get_type_name(self, node): - if isinstance(node, ast.Array): - if node.array_type == ast.Array.C: - return str(node.element_type) + "[]" - else: - return "%s<%s>" % (node.array_type, str(node.element_type)) - elif isinstance(node, ast.Map): - return "GHashTable<%s, %s>" % (str(node.key_type), str(node.value_type)) - elif isinstance(node, ast.List): - return "GList<%s>" % str(node.element_type) - else: - return str(node) - - def render_method(self, method, link=False): - self.writer.disable_whitespace() - - retval_type = method.retval.type - if retval_type.ctype: - link_dest = retval_type.ctype.replace("*", "") - else: - link_dest = str(retval_type) - - if retval_type.target_giname: - ns = retval_type.target_giname.split('.') - if ns[0] == self.namespace.name: - link_dest = "%s" % ( - retval_type.ctype.replace("*", "")) - - with self.writer.tagcontext("link", [("linkend", link_dest)]): - self.writer.write_tag("returnvalue", [], link_dest) - - if '*' in retval_type.ctype: - self.writer.write_line(' *') - - self.writer.write_line( - _space(20 - len(self.get_type_string(method.retval.type)))) - - if link: - self.writer.write_tag("link", [("linkend", - method.symbol.replace("_", "-"))], - method.symbol) - else: - self.writer.write_line(method.symbol) - - self._render_parameters(method, method.parameters) - self.writer.enable_whitespace() - - def _get_annotations(self, argument): - annotations = {} - - if hasattr(argument.type, 'element_type') and \ - argument.type.element_type is not None: - if isinstance(argument.type.element_type, ast.Array): - element_type = argument.type.element_type.array_type - else: - element_type = argument.type.element_type - annotations['element-type'] = element_type - - if argument.transfer is not None and argument.transfer != 'none': - annotations['transfer'] = argument.transfer - - if hasattr(argument, 'allow_none') and argument.allow_none: - annotations['allow-none'] = None - - return annotations - - def render_param_list(self, method): - self._render_param(method.parent_class.name.lower(), 'instance', []) - - for param in method.parameters: - if isinstance(param.type, ast.Varargs): - argname = '...' - else: - argname = param.argname - self._render_param(argname, param.doc, self._get_annotations(param)) - - self._render_param('Returns', method.retval.doc, - self._get_annotations(method.retval)) - - def _render_param(self, argname, doc, annotations): - with self.writer.tagcontext('varlistentry'): - with self.writer.tagcontext('term'): - self.writer.disable_whitespace() - try: - with self.writer.tagcontext('parameter'): - self.writer.write_line(argname) - if doc is not None: - self.writer.write_line(' :') - finally: - self.writer.enable_whitespace() - if doc is not None: - with self.writer.tagcontext('listitem'): - with self.writer.tagcontext('simpara'): - self.writer.write_line(doc) - if annotations: - with self.writer.tagcontext('emphasis', [('role', 'annotation')]): - for key, value in annotations.iteritems(): - self.writer.disable_whitespace() - try: - self.writer.write_line('[%s' % key) - if value is not None: - self.writer.write_line(' %s' % value) - self.writer.write_line(']') - finally: - self.writer.enable_whitespace() - - def render_property(self, prop, link=False): - prop_name = '"%s"' % prop.name - prop_type = self.get_type_name(prop.type) - - flags = [] - if prop.readable: - flags.append("Read") - if prop.writable: - flags.append("Write") - if prop.construct: - flags.append("Construct") - if prop.construct_only: - flags.append("Construct Only") - - self._render_prop_or_signal(prop_name, prop_type, flags) - - def _render_prop_or_signal(self, name, type_, flags): - self.writer.disable_whitespace() - - line = _space(2) + name + _space(27 - len(name)) - line += str(type_) + _space(22 - len(str(type_))) - line += ": " + " / ".join(flags) - - self.writer.write_line(line + "\n") - - self.writer.enable_whitespace() - - - def render_signal(self, signal, link=False): - sig_name = '"%s"' % signal.name - - flags = [] - if signal.when == "first": - flags.append("Run First") - elif signal.when == "last": - flags.append("Run Last") - elif signal.when == "cleanup": - flags.append("Cleanup") - - if signal.no_recurse: - flags.append('No Recursion') - if signal.detailed: - flags.append("Has Details") - if signal.action: - flags.append("Action") - if signal.no_hooks: - flags.append("No Hooks") - - self._render_prop_or_signal(sig_name, "", flags) - - -class DocBookFormatterPython(DocBookFormatter): - def get_title(self, page): - return "%s.%s" % (page.ast.namespace.name, page.ast.name) - - def render_struct(self, page): - class_ = page.ast - try: - self.writer.disable_whitespace() - self.writer.write_line("class %s" % self.get_title(page)) - - if hasattr(page.ast, "parent") and page.ast.parent is not None: - if isinstance(page.ast.parent, ast.Type): - parent_name = page.ast.parent - else: - parent_name = "%s.%s" % (page.ast.parent.namespace.name, - page.ast.parent.name) - elif isinstance(page.ast, ast.Interface): - parent_name = "GObject.Interface" - else: - parent_name = None - if parent_name is not None: - self.writer.write_line("(%s)" % (parent_name)) - - self.writer.write_line(":\n") - finally: - self.writer.enable_whitespace() - - -class DocBookFormatterC(DocBookFormatter): - def get_title(self, page): - return page.ast.ctype - - def render_struct(self, page): - try: - self.writer.disable_whitespace() - self.writer.write_line("struct ") - self.writer.write_tag( - "link", - [("linkend", "%s-struct" % page.name)], - "%s" % page.name) - self.writer.write_line(";\n") - finally: - self.writer.enable_whitespace() - - -class DocBookPage(object): - def __init__(self, name, ast_node): - self.methods = [] - self.properties = [] - self.signals = [] - self.name = name - self.description = ast_node.doc - self.ast = ast_node - self.id = None - - if isinstance(ast_node, (ast.Class, ast.Record, ast.Interface)): - for method in ast_node.methods: - method.parent_class = ast_node - self.methods = ast_node.methods - - if isinstance(ast_node, (ast.Class, ast.Interface)): - self.properties = ast_node.properties - self.signals = ast_node.signals - - def get_methods(self): - return self.methods - - def get_properties(self): - return self.properties - - def get_signals(self): - return self.signals - -class DocBookWriter(object): - def __init__(self, formatter): - self._namespace = None - self._pages = [] - - self._writer = XMLWriter() - - formatter.set_writer(self._writer) - self._formatter = formatter - - def _add_page(self, page): - self._pages.append(page) - - def add_transformer(self, transformer): - self._transformer = transformer - - self._namespace = self._transformer._namespace - self._formatter.set_namespace(self._namespace) - - for name, node in self._namespace.iteritems(): - if isinstance(node, (ast.Class, ast.Record, ast.Interface, ast.Alias)): - page_name = self._formatter.get_page_name(node) - self._add_node(node, page_name) - - def _add_node(self, node, name): - page = DocBookPage(name, node) - self._add_page(page) - - if isinstance(node, (ast.Class, ast.Record, ast.Interface, ast.Alias)): - page.id = node.ctype - - def write(self, output): - self._writer.write_line(DOCTYPE) - with self._writer.tagcontext("book", [ - ("xml:id", "page_%s" % self._namespace.name), - ("xmlns", XMLNS), - ("version", XMLVERSION)]): - self._writer.write_tag("title", [], "%s Documentation" % ( - self._namespace.name)) - - for page in self._pages: - self._render_page(page) - - fp = open(output, 'w') - fp.write(self._writer.get_xml()) - fp.close() - - def _render_page(self, page): - with self._writer.tagcontext("chapter", [("xml:id", "ch_%s" % ( - page.name))]): - self._writer.write_tag( - "title", [], self._formatter.get_title(page)) - - with self._writer.tagcontext("refsynopsisdiv", - [('id', '%s.synopsis' % page.name), - ('role', 'synopsis')]): - - self._writer.write_tag( - "title", [("role", "synopsis.title")], "Synopsis") - - if not isinstance(page.ast, ast.Alias): - self._writer.write_tag("anchor", [("id", page.name)]) - - with self._writer.tagcontext('synopsis'): - self._formatter.render_struct(page) - - for ast_node in page.get_methods(): - self._formatter.render_method(ast_node, link=True) - - if isinstance(page.ast, (ast.Class, ast.Interface)): - with self._writer.tagcontext("refsect1", - [('id', '%s.object-hierarchy' % page.name), - ('role', 'object_hierarchy')]): - self._writer.write_tag('title', [('role', 'object_hierarchy.title')], - "Object Hierarchy") - with self._writer.tagcontext('synopsis'): - self._render_page_object_hierarchy(page.ast) - - if page.get_properties(): - with self._writer.tagcontext('refsect1', - [('id', '%s.properties' % page.name), - ('role', 'properties')]): - self._writer.write_tag("title", [('role', 'properties.title')], - "Properties") - with self._writer.tagcontext("synopsis"): - for ast_node in page.get_properties(): - if isinstance(ast_node.type, ast.TypeUnknown): - print "Warning: ignoring property '%s' for " \ - "lack of type" % ast_node.name - continue - self._formatter.render_property(ast_node, link=True) - - if page.get_signals(): - with self._writer.tagcontext('refsect1', - [('id', '%s.signals' % page.name), - ('role', 'signal_proto')]): - self._writer.write_tag('title', [('role', 'signal_proto.title')], - "Signals") - with self._writer.tagcontext('synopsis'): - for ast_node in page.get_signals(): - self._formatter.render_signal(ast_node, link=True) - - if page.description: - with self._writer.tagcontext('refsect1', - [('id', '%s.description' % (page.name, ))]): - self._writer.write_tag( - "title", [("role", "desc.title")], "Description") - self._render_description(page.description) - - with self._writer.tagcontext('refsect1', - [('id', "%s-details" % page.id.lower()), - ("role", "details")]): - self._writer.write_tag("title", [("role", "details.title")], - "Details") - - if isinstance(page.ast, ast.Alias): - self._render_alias_detail(page.ast) - else: - self._render_struct_detail(page.ast) - - for ast_node in page.get_methods(): - self._render_method(ast_node) - - if page.get_properties(): - with self._writer.tagcontext('refsect1', - [('id', '%s.property-details' % page.name), - ('role', 'property_details')]): - self._writer.write_tag('title', [('role', 'property_details.title')], - "Property Details") - for ast_node in page.get_properties(): - self._render_property(ast_node) - - if page.get_signals(): - with self._writer.tagcontext('refsect1', - [('id', '%s.signal-details' % page.name), - ('role', 'signals')]): - self._writer.write_tag('title', [('role', 'signal.title')], - "Signal Details") - for ast_node in page.get_signals(): - self._render_signal(ast_node) - - def _render_alias_detail(self, alias): - with self._writer.tagcontext('refsect2', - [('id', "%s" % alias.ctype), - ('role', 'typedef')]): - self._writer.write_tag("title", [], "%s" % alias.ctype) - with self._writer.tagcontext("indexterm", [("zone", "%s" % alias.ctype)]): - self._writer.write_tag("primary", [("sortas", alias.name)], alias.ctype) - self._writer.write_tag("programlisting", - [], - "typedef %s %s" % (alias.target.ctype, - alias.ctype)) - self._writer.write_tag("para", [], alias.doc) - - def _render_struct_detail(self, struct): - with self._writer.tagcontext('refsect2', - [('id', "%s-struct" % struct.ctype), - ('role', 'struct')]): - self._writer.write_tag("title", [], "struct %s" % struct.ctype) - with self._writer.tagcontext("indexterm", [("zone", "%s-struct" % struct.ctype)]): - self._writer.write_tag("primary", [("sortas", struct.name)], struct.ctype) - self._writer.write_tag("programlisting", [], "struct %s;" % struct.ctype) - - def _render_method(self, ast_node): - - link_name = ast_node.symbol.replace("_", "-") - - self._writer.push_tag('refsect2', - [('id', link_name), - ('role', 'function')]) - self._writer.write_tag("title", [], - self._formatter.get_method_as_title(ast_node)) - - with self._writer.tagcontext("indexterm", [("zone", link_name)]): - self._writer.write_tag("primary", [], ast_node.name) - - with self._writer.tagcontext("programlisting"): - self._formatter.render_method(ast_node) - - description = ast_node.doc - if description: - self._render_description(ast_node.doc) - - with self._writer.tagcontext("variablelist", [("role", "params")]): - self._formatter.render_param_list(ast_node) - - self._writer.pop_tag() - - def _render_property(self, ast_node): - self._writer.write_line("Not implemented yet") - - def _render_signal(self, ast_node): - self._writer.write_line("Not implemented yet") - - def _render_page_object_hierarchy(self, page_node): - parent_chain = self._get_parent_chain(page_node) - parent_chain.append(page_node) - lines = [] - - for level, parent in enumerate(parent_chain): - prepend = "" - if level > 0: - prepend = _space((level - 1)* 6) + " +----" - lines.append(_space(2) + prepend + self._formatter.get_class_name(parent)) - - self._writer.disable_whitespace() - self._writer.write_line("\n".join(lines)) - self._writer.enable_whitespace() - - def _render_description(self, description): - formatted_desc = get_formatted_description(description) - self._writer.write_line(formatted_desc) - - def _get_parent_chain(self, page_node): - parent_chain = [] - - node = page_node - while node.parent and node.gi_name != 'GObject.Object': - node = self._transformer.lookup_giname(str(node.parent)) - parent_chain.append(node) - - parent_chain.reverse() - return parent_chain diff -Nru gobject-introspection-1.31.10/giscanner/docmain.py gobject-introspection-1.31.20/giscanner/docmain.py --- gobject-introspection-1.31.10/giscanner/docmain.py 2011-08-30 01:07:30.000000000 +0000 +++ gobject-introspection-1.31.20/giscanner/docmain.py 2012-02-21 15:43:45.000000000 +0000 @@ -21,39 +21,15 @@ import os import optparse -from .docbookwriter import DocBookWriter -from .docbookwriter import DocBookFormatterC -from .docbookwriter import DocBookFormatterPython from .mallardwriter import MallardWriter -from .mallardwriter import MallardFormatterC -from .mallardwriter import MallardFormatterPython from .transformer import Transformer -class GIDocGenerator(object): - - def parse(self, filename): - if 'UNINSTALLED_INTROSPECTION_SRCDIR' in os.environ: - top_srcdir = os.environ['UNINSTALLED_INTROSPECTION_SRCDIR'] - top_builddir = os.environ['UNINSTALLED_INTROSPECTION_BUILDDIR'] - extra_include_dirs = [os.path.join(top_srcdir, 'gir'), top_builddir] - else: - extra_include_dirs = [] - self.transformer = Transformer.parse_from_gir(filename, extra_include_dirs) - - def generate(self, writer, output): - writer.add_transformer(self.transformer) - writer.write(output) - def doc_main(args): parser = optparse.OptionParser('%prog [options] GIR-file') parser.add_option("-o", "--output", action="store", dest="output", - help="Filename to write output") - parser.add_option("-f", "--format", - action="store", dest="format", - default="docbook", - help="Output format") + help="Directory to write output to") parser.add_option("-l", "--language", action="store", dest="language", default="Python", @@ -62,32 +38,21 @@ options, args = parser.parse_args(args) if not options.output: raise SystemExit("missing output parameter") + if not os.path.isdir(options.output): + raise SystemExit("wrong output parameter: %s", options.output) if len(args) < 2: raise SystemExit("Need an input GIR filename") - if options.format == "docbook": - if options.language == "Python": - formatter = DocBookFormatterPython() - elif options.language == "C": - formatter = DocBookFormatterC() - else: - raise SystemExit("Unsupported language: %s" % (options.language, )) - writer = DocBookWriter(formatter) - elif options.format == "mallard": - if options.language == "Python": - formatter = MallardFormatterPython() - elif options.language == "C": - formatter = MallardFormatterC() - else: - raise SystemExit("Unsupported language: %s" % (options.language, )) - writer = MallardWriter(formatter) + if 'UNINSTALLED_INTROSPECTION_SRCDIR' in os.environ: + top_srcdir = os.environ['UNINSTALLED_INTROSPECTION_SRCDIR'] + top_builddir = os.environ['UNINSTALLED_INTROSPECTION_BUILDDIR'] + extra_include_dirs = [os.path.join(top_srcdir, 'gir'), top_builddir] else: - raise SystemExit("Unsupported output format: %s" % (options.format, )) - - generator = GIDocGenerator() - generator.parse(args[1]) + extra_include_dirs = [] + transformer = Transformer.parse_from_gir(args[1], extra_include_dirs) - generator.generate(writer, options.output) + writer = MallardWriter(transformer, options.language) + writer.write(options.output) return 0 diff -Nru gobject-introspection-1.31.10/giscanner/girparser.py gobject-introspection-1.31.20/giscanner/girparser.py --- gobject-introspection-1.31.10/giscanner/girparser.py 2011-09-14 14:32:12.000000000 +0000 +++ gobject-introspection-1.31.20/giscanner/girparser.py 2012-02-20 17:19:27.000000000 +0000 @@ -256,27 +256,27 @@ for iface in self._find_children(node, _corens('prerequisite')): obj.prerequisites.append(self._namespace.type_from_name(iface.attrib['name'])) for func_node in self._find_children(node, _corens('function')): - func = self._parse_function_common(func_node, ast.Function) + func = self._parse_function_common(func_node, ast.Function, obj) obj.static_methods.append(func) for method in self._find_children(node, _corens('method')): - func = self._parse_function_common(method, ast.Function) + func = self._parse_function_common(method, ast.Function, obj) func.is_method = True obj.methods.append(func) for method in self._find_children(node, _corens('virtual-method')): - func = self._parse_function_common(method, ast.VFunction) + func = self._parse_function_common(method, ast.VFunction, obj) self._parse_generic_attribs(method, func) func.is_method = True func.invoker = method.get('invoker') obj.virtual_methods.append(func) for ctor in self._find_children(node, _corens('constructor')): - func = self._parse_function_common(ctor, ast.Function) + func = self._parse_function_common(ctor, ast.Function, obj) func.is_constructor = True obj.constructors.append(func) obj.fields.extend(self._parse_fields(node)) for prop in self._find_children(node, _corens('property')): - obj.properties.append(self._parse_property(prop)) + obj.properties.append(self._parse_property(prop, obj)) for signal in self._find_children(node, _glibns('signal')): - obj.signals.append(self._parse_function_common(signal, ast.Signal)) + obj.signals.append(self._parse_function_common(signal, ast.Signal, obj)) def _parse_callback(self, node): callback = self._parse_function_common(node, ast.Callback) @@ -286,7 +286,7 @@ function = self._parse_function_common(node, ast.Function) self._namespace.append(function) - def _parse_function_common(self, node, klass): + def _parse_function_common(self, node, klass, parent=None): name = node.attrib['name'] returnnode = node.find(_corens('return-value')) if not returnnode: @@ -319,6 +319,7 @@ func.shadows = node.attrib.get('shadows', None) func.shadowed_by = node.attrib.get('shadowed-by', None) func.moved_to = node.attrib.get('moved-to', None) + func.parent = parent parameters_node = node.find(_corens('parameters')) if (parameters_node is not None): @@ -377,13 +378,13 @@ compound.fields.extend(self._parse_fields(node)) for method in self._find_children(node, _corens('method')): compound.methods.append( - self._parse_function_common(method, ast.Function)) + self._parse_function_common(method, ast.Function, compound)) for func in self._find_children(node, _corens('function')): compound.static_methods.append( - self._parse_function_common(func, ast.Function)) + self._parse_function_common(func, ast.Function, compound)) for ctor in self._find_children(node, _corens('constructor')): compound.constructors.append( - self._parse_function_common(ctor, ast.Function)) + self._parse_function_common(ctor, ast.Function, compound)) return compound def _parse_record(self, node, anonymous=False): @@ -482,15 +483,15 @@ if self._types_only: return for method in self._find_children(node, _corens('method')): - func = self._parse_function_common(method, ast.Function) + func = self._parse_function_common(method, ast.Function, obj) func.is_method = True obj.methods.append(func) for ctor in self._find_children(node, _corens('constructor')): obj.constructors.append( - self._parse_function_common(ctor, ast.Function)) + self._parse_function_common(ctor, ast.Function, obj)) for callback in self._find_children(node, _corens('callback')): obj.fields.append( - self._parse_function_common(callback, ast.Callback)) + self._parse_function_common(callback, ast.Callback, obj)) def _parse_field(self, node): type_node = None @@ -521,7 +522,7 @@ self._parse_generic_attribs(node, field) return field - def _parse_property(self, node): + def _parse_property(self, node, parent): prop = ast.Property(node.attrib['name'], self._parse_type(node), node.attrib.get('readable') != '0', @@ -530,6 +531,7 @@ node.attrib.get('construct-only') == '1', node.attrib.get('transfer-ownership')) self._parse_generic_attribs(node, prop) + prop.parent = parent return prop def _parse_member(self, node): diff -Nru gobject-introspection-1.31.10/giscanner/maintransformer.py gobject-introspection-1.31.20/giscanner/maintransformer.py --- gobject-introspection-1.31.10/giscanner/maintransformer.py 2012-01-11 20:57:34.000000000 +0000 +++ gobject-introspection-1.31.20/giscanner/maintransformer.py 2012-02-16 16:24:41.000000000 +0000 @@ -684,33 +684,36 @@ self._apply_annotations_param_ret_common(parent, return_, tag) def _apply_annotations_params(self, parent, params, block): - allparams = [] + declparams = set([]) if parent.instance_parameter: - allparams.append(parent.instance_parameter.argname) + declparams.add(parent.instance_parameter.argname) for param in params: if block: tag = block.get(param.argname) else: tag = None self._apply_annotations_param(parent, param, tag) - allparams.append(param.argname) + declparams.add(param.argname) if not block: return - docparams = block.params[:] - for doc_name in docparams: - if doc_name in allparams: - continue + docparams = set(block.params) + + unknown = docparams - declparams + unused = declparams - docparams + + for doc_name in unknown: # Skip varargs, see #629759 if doc_name.lower() in ['...', 'varargs', TAG_RETURNS]: continue - if len(allparams) == 0: + if len(unused) == 0: text = '' - elif len(allparams) == 1: - text = ', should be %r' % (allparams[0], ) + elif len(unused) == 1: + (param, ) = unused + text = ', should be %r' % (param, ) else: text = ', should be one of %s' % ( - ', '.join(repr(p) for p in allparams), ) + ', '.join(repr(p) for p in unused), ) tag = block.get(doc_name) message.warn( @@ -1224,6 +1227,10 @@ vfunc = ast.VFunction.from_callback(callback) vfunc.instance_parameter = callback.parameters[0] vfunc.inherit_file_positions(callback) + + prefix = self._get_annotation_name(class_struct) + block = self._blocks.get('%s::%s' % (prefix, vfunc.name)) + self._apply_annotations_callable(vfunc, [node], block) node.virtual_methods.append(vfunc) # Take the set of virtual methods we found, and try diff -Nru gobject-introspection-1.31.10/giscanner/mallard-C-class.tmpl gobject-introspection-1.31.20/giscanner/mallard-C-class.tmpl --- gobject-introspection-1.31.10/giscanner/mallard-C-class.tmpl 1970-01-01 00:00:00.000000000 +0000 +++ gobject-introspection-1.31.20/giscanner/mallard-C-class.tmpl 2012-02-20 17:19:27.000000000 +0000 @@ -0,0 +1,48 @@ + + + + + + ${node.ctype} +${formatter.format(node.doc)} +% if node.version: +

Since ${node.version}

+% endif + + Hierarchy + + + GObjectObject + + + + + Constructors + + + Methods + + + Functions + + + Properties + + + Signals + + + Other + +
diff -Nru gobject-introspection-1.31.10/giscanner/mallard-C-default.tmpl gobject-introspection-1.31.20/giscanner/mallard-C-default.tmpl --- gobject-introspection-1.31.10/giscanner/mallard-C-default.tmpl 1970-01-01 00:00:00.000000000 +0000 +++ gobject-introspection-1.31.20/giscanner/mallard-C-default.tmpl 2012-02-20 17:19:27.000000000 +0000 @@ -0,0 +1,11 @@ + + + + + ${namespace.name}.${node.name} +${formatter.format(node.doc)} + diff -Nru gobject-introspection-1.31.10/giscanner/mallard-C-enum.tmpl gobject-introspection-1.31.20/giscanner/mallard-C-enum.tmpl --- gobject-introspection-1.31.10/giscanner/mallard-C-enum.tmpl 1970-01-01 00:00:00.000000000 +0000 +++ gobject-introspection-1.31.20/giscanner/mallard-C-enum.tmpl 2012-02-21 15:43:45.000000000 +0000 @@ -0,0 +1,12 @@ + + + + + + ${node.namespace.name}.${node.name} +${formatter.format(node.doc)} + diff -Nru gobject-introspection-1.31.10/giscanner/mallard-C-function.tmpl gobject-introspection-1.31.20/giscanner/mallard-C-function.tmpl --- gobject-introspection-1.31.10/giscanner/mallard-C-function.tmpl 1970-01-01 00:00:00.000000000 +0000 +++ gobject-introspection-1.31.20/giscanner/mallard-C-function.tmpl 2012-02-20 17:19:27.000000000 +0000 @@ -0,0 +1,95 @@ + +<% +page_style = 'function' +if node.is_constructor: + page_style = 'constructor' +elif node.is_method: + page_style = 'method' +%> + + +% if node.parent is not None: + +% else: + +% endif + + + ${formatter.format_type(node.retval.type) | x} + + ${node.symbol} +% if node.is_method: + + ${node.parent.ctype} * + self + +% endif +% for arg in node.parameters: +% if arg.type.ctype == '': + +% else: + + ${formatter.format_type(arg.type) | x} + ${arg.argname} + +% endif +% endfor + + + ${node.symbol} + +${node.retval.type.ctype} ${node.symbol} (\ +% if node.is_method: +${node.parent.ctype} *self\ +%endif +% if len(node.parameters) == 0: +% if not node.is_method: +void\ +%endif +); +% elif node.is_method: +, +% endif +% for arg, ix in zip(node.parameters, range(len(node.parameters))): +% if ix != 0: +${' ' * (len(formatter.format_type(node.retval.type)) + len(node.symbol) + 3)}\ +% endif +% if arg.type.ctype == '': +...\ +% else: +${formatter.format_type(arg.type) | x} ${arg.argname}\ +% endif +% if ix == len(node.parameters) - 1: +); +% else: +, +%endif +% endfor + +${formatter.format(node.doc)} + +% if node.parameters or node.retval: + +% for arg, ix in zip(node.parameters, range(len(node.parameters))): + + + + +% endfor +% if node.retval: + + + + +% endif +

${arg.argname} :

${formatter.format(arg.doc)}

Returns :

${formatter.format(node.retval.doc)}
+% endif +% if node.version: +

Since ${node.version}

+% endif +
diff -Nru gobject-introspection-1.31.10/giscanner/mallard-C-namespace.tmpl gobject-introspection-1.31.20/giscanner/mallard-C-namespace.tmpl --- gobject-introspection-1.31.10/giscanner/mallard-C-namespace.tmpl 1970-01-01 00:00:00.000000000 +0000 +++ gobject-introspection-1.31.20/giscanner/mallard-C-namespace.tmpl 2012-02-20 17:19:27.000000000 +0000 @@ -0,0 +1,19 @@ + + + + + ${node.name} Documentation + + Classes + + + Functions + + + Other + + diff -Nru gobject-introspection-1.31.10/giscanner/mallard-C-property.tmpl gobject-introspection-1.31.20/giscanner/mallard-C-property.tmpl --- gobject-introspection-1.31.10/giscanner/mallard-C-property.tmpl 1970-01-01 00:00:00.000000000 +0000 +++ gobject-introspection-1.31.20/giscanner/mallard-C-property.tmpl 2012-02-20 17:19:27.000000000 +0000 @@ -0,0 +1,13 @@ + + + + + ${node.name} + + ${node.parent.ctype}:${node.name} +${formatter.format(node.doc)} + diff -Nru gobject-introspection-1.31.10/giscanner/mallard-C-record.tmpl gobject-introspection-1.31.20/giscanner/mallard-C-record.tmpl --- gobject-introspection-1.31.10/giscanner/mallard-C-record.tmpl 1970-01-01 00:00:00.000000000 +0000 +++ gobject-introspection-1.31.20/giscanner/mallard-C-record.tmpl 2012-02-20 17:19:27.000000000 +0000 @@ -0,0 +1,12 @@ + + + + + + ${node.namespace.name}${node.name} +${formatter.format(node.doc)} + diff -Nru gobject-introspection-1.31.10/giscanner/mallard-C-signal.tmpl gobject-introspection-1.31.20/giscanner/mallard-C-signal.tmpl --- gobject-introspection-1.31.10/giscanner/mallard-C-signal.tmpl 1970-01-01 00:00:00.000000000 +0000 +++ gobject-introspection-1.31.20/giscanner/mallard-C-signal.tmpl 2012-02-20 17:19:27.000000000 +0000 @@ -0,0 +1,13 @@ + + + + + ${node.name} + + ${node.parent.ctype}::${node.name} +${formatter.format(node.doc)} + diff -Nru gobject-introspection-1.31.10/giscanner/mallard-C-vfunc.tmpl gobject-introspection-1.31.20/giscanner/mallard-C-vfunc.tmpl --- gobject-introspection-1.31.10/giscanner/mallard-C-vfunc.tmpl 1970-01-01 00:00:00.000000000 +0000 +++ gobject-introspection-1.31.20/giscanner/mallard-C-vfunc.tmpl 2012-02-22 17:57:37.000000000 +0000 @@ -0,0 +1,35 @@ + + + + + + ${node.name} + + +${formatter.format(node.doc)} + +% if node.parameters or node.retval: + +% for arg, ix in zip(node.parameters, range(len(node.parameters))): + + + + +% endfor +% if node.retval: + + + + +% endif +

${arg.argname} :

${formatter.format(arg.doc)}

Returns :

${formatter.format(node.retval.doc)}
+% endif +% if node.version: +

Since ${node.version}

+% endif +
diff -Nru gobject-introspection-1.31.10/giscanner/mallard-Python-class.tmpl gobject-introspection-1.31.20/giscanner/mallard-Python-class.tmpl --- gobject-introspection-1.31.10/giscanner/mallard-Python-class.tmpl 1970-01-01 00:00:00.000000000 +0000 +++ gobject-introspection-1.31.20/giscanner/mallard-Python-class.tmpl 2012-02-22 17:57:37.000000000 +0000 @@ -0,0 +1,66 @@ + + + + + + ${namespace.name}.${node.name} +${formatter.format(node.doc)} + + +from gi.repository import ${namespace.name} + +${formatter.to_underscores(node.name).lower()} = ${namespace.name}.${node.name}(\ +% for property_, ix in zip(node.properties, range(len(node.properties))): +% if property_.construct or property_.construct_only or property_.writable: +${property_.name.replace('-', '_')}=value\ +% if ix != len(node.properties) - 1: +, \ +% endif +% endif +% endfor +)\ + + +% if node.version: +

Since ${node.version}

+% endif + + Hierarchy + +% for class_ in formatter.get_class_hierarchy(node): + + ${class_.namespace.name}.${class_.name} +% endfor +% for class_ in formatter.get_class_hierarchy(node): + +% endfor + + + + Methods + + + Functions + + + Properties + + + Signals + + + Virtual functions + + + Other + +
diff -Nru gobject-introspection-1.31.10/giscanner/mallard-Python-default.tmpl gobject-introspection-1.31.20/giscanner/mallard-Python-default.tmpl --- gobject-introspection-1.31.10/giscanner/mallard-Python-default.tmpl 1970-01-01 00:00:00.000000000 +0000 +++ gobject-introspection-1.31.20/giscanner/mallard-Python-default.tmpl 2012-02-20 17:19:27.000000000 +0000 @@ -0,0 +1,11 @@ + + + + + ${namespace.name}.${node.name} +${formatter.format(node.doc)} + diff -Nru gobject-introspection-1.31.10/giscanner/mallard-Python-enum.tmpl gobject-introspection-1.31.20/giscanner/mallard-Python-enum.tmpl --- gobject-introspection-1.31.10/giscanner/mallard-Python-enum.tmpl 1970-01-01 00:00:00.000000000 +0000 +++ gobject-introspection-1.31.20/giscanner/mallard-Python-enum.tmpl 2012-02-20 17:19:27.000000000 +0000 @@ -0,0 +1,23 @@ + + + + + + ${node.namespace.name}.${node.name} + ${formatter.format(node.doc)} +% if node.members: + +% for member, ix in zip(node.members, range(len(node.members))): + + + + +% endfor +

${node.name}.${member.name.upper()} :

${formatter.format(member.doc)}
+% endif + +
diff -Nru gobject-introspection-1.31.10/giscanner/mallard-Python-function.tmpl gobject-introspection-1.31.20/giscanner/mallard-Python-function.tmpl --- gobject-introspection-1.31.10/giscanner/mallard-Python-function.tmpl 1970-01-01 00:00:00.000000000 +0000 +++ gobject-introspection-1.31.20/giscanner/mallard-Python-function.tmpl 2012-02-20 17:19:27.000000000 +0000 @@ -0,0 +1,88 @@ + +<% +page_style = 'function' +if node.is_constructor: + page_style = 'constructor' +elif node.is_method: + page_style = 'method' +%> + + +% if node.parent is not None: + +% else: + +% endif + + + ${formatter.format_type(node.retval.type) | x} + + ${node.symbol} +% if node.is_method: + + ${node.parent.ctype} * + self + +% endif +% for arg in node.parameters: +% if arg.type.ctype == '': + +% else: + + ${formatter.format_type(arg.type) | x} + ${arg.argname} + +% endif +% endfor + + + ${node.name} + +% if len(node.parameters) != 0: +@accepts(\ +% for arg, ix in zip(node.parameters, range(len(node.parameters))): +${formatter.format_type(arg.type) | x}\ +% if ix != len(node.parameters) - 1: +, \ +%endif +% endfor +) +% endif +@returns(${formatter.format_type(node.retval.type) | x}) +def \ +${node.name}(\ +% for arg, ix in zip(node.parameters, range(len(node.parameters))): +${arg.argname}\ +% if ix != len(node.parameters) - 1: +, \ +%endif +% endfor +) + +${formatter.format(node.doc)} + +% if node.parameters or node.retval: + +% for arg, ix in zip(node.parameters, range(len(node.parameters))): + + + + +% endfor +% if node.retval and node.retval.type.ctype != 'void': + + + + +% endif +

${arg.argname} :

${formatter.format(arg.doc)}

Returns :

${formatter.format(node.retval.doc)}
+% endif +% if node.version: +

Since ${node.version}

+% endif +
diff -Nru gobject-introspection-1.31.10/giscanner/mallard-Python-namespace.tmpl gobject-introspection-1.31.20/giscanner/mallard-Python-namespace.tmpl --- gobject-introspection-1.31.10/giscanner/mallard-Python-namespace.tmpl 1970-01-01 00:00:00.000000000 +0000 +++ gobject-introspection-1.31.20/giscanner/mallard-Python-namespace.tmpl 2012-02-20 17:19:27.000000000 +0000 @@ -0,0 +1,19 @@ + + + + + ${node.name} Documentation + + Classes + + + Functions + + + Other + + diff -Nru gobject-introspection-1.31.10/giscanner/mallard-Python-property.tmpl gobject-introspection-1.31.20/giscanner/mallard-Python-property.tmpl --- gobject-introspection-1.31.10/giscanner/mallard-Python-property.tmpl 1970-01-01 00:00:00.000000000 +0000 +++ gobject-introspection-1.31.20/giscanner/mallard-Python-property.tmpl 2012-02-20 17:19:27.000000000 +0000 @@ -0,0 +1,16 @@ + + + + + ${node.name} + + ${namespace.name}.${node.parent.name}:${node.name} + +"${node.name}" ${formatter.format_type(node.type)} : ${formatter.format_property_flags(node)} + +${formatter.format(node.doc)} + diff -Nru gobject-introspection-1.31.10/giscanner/mallard-Python-record.tmpl gobject-introspection-1.31.20/giscanner/mallard-Python-record.tmpl --- gobject-introspection-1.31.10/giscanner/mallard-Python-record.tmpl 1970-01-01 00:00:00.000000000 +0000 +++ gobject-introspection-1.31.20/giscanner/mallard-Python-record.tmpl 2012-02-20 17:19:27.000000000 +0000 @@ -0,0 +1,12 @@ + + + + + + ${node.namespace.name}${node.name} +

${node.doc}

+
diff -Nru gobject-introspection-1.31.10/giscanner/mallard-Python-signal.tmpl gobject-introspection-1.31.20/giscanner/mallard-Python-signal.tmpl --- gobject-introspection-1.31.10/giscanner/mallard-Python-signal.tmpl 1970-01-01 00:00:00.000000000 +0000 +++ gobject-introspection-1.31.20/giscanner/mallard-Python-signal.tmpl 2012-02-22 17:57:37.000000000 +0000 @@ -0,0 +1,52 @@ + + + + + ${node.name} + + ${namespace.name}.${node.parent.name}::${node.name} + +def callback(${formatter.to_underscores(node.parent.name).lower()}, \ +% for arg, ix in zip(node.parameters, range(len(node.parameters))): +${arg.argname}, \ +% endfor +user_param1, ...) + +${formatter.format(node.doc)} + + + + + + +% for arg, ix in zip(node.parameters, range(len(node.parameters))): + + + + +% endfor + + + + + + + + +% if node.retval and \ + node.retval.type.ctype != 'void' and \ + node.retval.type.ctype is not None: + + + + +% endif +

${formatter.to_underscores(node.parent.name).lower()} :

instance of ${namespace.name}.${node.parent.name} that is emitting the signal

${arg.argname} :

${formatter.format(arg.doc)}

user_param1 :

first user parameter (if any) specified with the connect() method

... :

additional user parameters (if any)

Returns :

${node.retval.type.ctype} ${formatter.format(node.retval.doc)}
+% if node.version: +

Since ${node.version}

+% endif +
diff -Nru gobject-introspection-1.31.10/giscanner/mallard-Python-vfunc.tmpl gobject-introspection-1.31.20/giscanner/mallard-Python-vfunc.tmpl --- gobject-introspection-1.31.10/giscanner/mallard-Python-vfunc.tmpl 1970-01-01 00:00:00.000000000 +0000 +++ gobject-introspection-1.31.20/giscanner/mallard-Python-vfunc.tmpl 2012-02-22 17:57:37.000000000 +0000 @@ -0,0 +1,56 @@ + + + + + ${node.name} + + ${namespace.name}.${node.parent.name}.${node.name} + +% if len(node.parameters) != 0: +@accepts(\ +% for arg, ix in zip(node.parameters, range(len(node.parameters))): +${formatter.format_type(arg.type) | x}\ +% if ix != len(node.parameters) - 1: +, \ +%endif +% endfor +) +% endif +@returns(${formatter.format_type(node.retval.type) | x}) +def \ +do_${node.name}(self, \ +% for arg, ix in zip(node.parameters, range(len(node.parameters))): +${arg.argname}\ +% if ix != len(node.parameters) - 1: +, \ +%endif +% endfor +): + +${formatter.format(node.doc)} + +% if node.parameters or node.retval: + +% for arg, ix in zip(node.parameters, range(len(node.parameters))): + + + + +% endfor +% if node.retval and node.retval.type.ctype != 'void': + + + + +% endif +

${arg.argname} :

${formatter.format(arg.doc)}

Returns :

${formatter.format(node.retval.doc)}
+% endif +% if node.version: +

Since ${node.version}

+% endif +
diff -Nru gobject-introspection-1.31.10/giscanner/mallardwriter.py gobject-introspection-1.31.20/giscanner/mallardwriter.py --- gobject-introspection-1.31.10/giscanner/mallardwriter.py 2011-08-30 01:07:30.000000000 +0000 +++ gobject-introspection-1.31.20/giscanner/mallardwriter.py 2012-02-22 17:57:37.000000000 +0000 @@ -21,465 +21,233 @@ # 02110-1301, USA. # -import os.path +import os import re -import sys +import tempfile -from . import ast -from .girparser import GIRParser -from .xmlwriter import XMLWriter +from xml.sax import saxutils +from mako.template import Template +from mako.runtime import supports_caller -XMLNS = "http://projectmallard.org/1.0/" -XMLNS_UI = "http://projectmallard.org/experimental/ui/" +from . import ast +from .utils import to_underscores def _space(num): return " " * num class MallardFormatter(object): - def __init__(self): - pass - - def get_title(self, node, parent): - raise NotImplementedError('get_title not implemented') - - # FIXME - def render_parameter(self, param_type, param_name): - return "%s %s" % (param_type, param_name) - - def _render_parameter(self, param, extra_content=''): - with self._writer.tagcontext("parameter"): - if param.type.ctype is not None: - link_dest = param.type.ctype.replace("*", "") - else: - link_dest = param.type.ctype - with self._writer.tagcontext("link", [("linkend", "%s" % link_dest)]): - self._writer.write_tag("type", [], link_dest) - self._writer.write_line(extra_content) - - def _render_parameters(self, parent, parameters): - self._writer.write_line( - "%s(" % _space(40 - len(parent.symbol))) - - parent_class = parent.parent_class - ctype = ast.Type(parent.parent_class.ctype + '*') - params = [] - params.append(ast.Parameter(parent_class.name.lower(), ctype)) - params.extend(parameters) - - first_param = True - for param in params: - if not first_param: - self._writer.write_line("\n%s" % _space(61)) - else: - first_param = False - - if not param == params[-1]: - comma = ", " - else: - comma = "" - if param.type.target_fundamental == '': - extra_content = "..." - continue - extra_content = " " - if param.type.ctype is not None and '*' in param.type.ctype: - extra_content += '*' - if param.argname is None: - import pdb - pdb.set_trace() - extra_content += param.argname - extra_content += comma - self._render_parameter(param, extra_content) - - self._writer.write_line(");\n") - - def get_method_as_title(self, entity): - method = entity.get_ast() - return "%s ()" % method.symbol - - def get_page_name(self, node): - if node.gtype_name is None: - return node.ctype - return node.gtype_name - - def get_class_name(self, node): - if node.gtype_name is None: - return node.ctype - return node.gtype_name - - def get_type_name(self, node): - if isinstance(node, ast.Array): - if node.array_type == ast.Array.C: - return str(node.element_type) + "[]" - else: - return "%s<%s>" % (node.array_type, str(node.element_type)) - elif isinstance(node, ast.Map): - return "GHashTable<%s, %s>" % (str(node.key_type), str(node.value_type)) - elif isinstance(node, ast.List): - return "GList<%s>" % str(node.element_type) - else: - return str(node) - - def render_method(self, entity, link=False): - method = entity.get_ast() - self._writer.disable_whitespace() - - retval_type = method.retval.type - if retval_type.ctype: - link_dest = retval_type.ctype.replace("*", "") - else: - link_dest = str(retval_type) + def __init__(self, transformer): + self._transformer = transformer - if retval_type.target_giname: - ns = retval_type.target_giname.split('.') - if ns[0] == self._namespace.name: - link_dest = "%s" % ( - retval_type.ctype.replace("*", "")) - - with self._writer.tagcontext("link", [("linkend", link_dest)]): - self._writer.write_tag("returnvalue", [], link_dest) - - if retval_type.ctype is not None and '*' in retval_type.ctype: - self._writer.write_line(' *') - - self._writer.write_line( - _space(20 - len(self.get_type_string(method.retval.type)))) - - if link: - self._writer.write_tag("link", [("linkend", - method.symbol.replace("_", "-"))], - method.symbol) - else: - self._writer.write_line(method.symbol) + def escape(self, text): + return saxutils.escape(text.encode('utf-8')).decode('utf-8') - self._render_parameters(method, method.parameters) - self._writer.enable_whitespace() + def format(self, doc): + if doc is None: + return '' + + result = '' + for para in doc.split('\n\n'): + result += '

' + result += self.format_inline(para) + result += '

' + return result - def _get_annotations(self, argument): - annotations = {} + def format_inline(self, para): + result = '' - if hasattr(argument.type, 'element_type') and \ - argument.type.element_type is not None: - annotations['element-type'] = argument.type.element_type - - if argument.transfer is not None and argument.transfer != 'none': - annotations['transfer'] = argument.transfer - - if hasattr(argument, 'allow_none') and argument.allow_none: - annotations['allow-none'] = None - - return annotations - - def render_param_list(self, entity): - method = entity.get_ast() - - self._render_param(method.parent_class.name.lower(), 'instance', []) - - for param in method.parameters: - self._render_param(param.argname, param.doc, - self._get_annotations(param)) - - self._render_param('Returns', method.retval.doc, - self._get_annotations(method.retval)) - - def _render_param(self, argname, doc, annotations): - if argname is None: - return - with self._writer.tagcontext('varlistentry'): - with self._writer.tagcontext('term'): - self._writer.disable_whitespace() - try: - with self._writer.tagcontext('parameter'): - self._writer.write_line(argname) - if doc is not None: - self._writer.write_line(' :') - finally: - self._writer.enable_whitespace() - if doc is not None: - with self._writer.tagcontext('listitem'): - with self._writer.tagcontext('simpara'): - self._writer.write_line(doc) - if annotations: - with self._writer.tagcontext('emphasis', [('role', 'annotation')]): - for key, value in annotations.iteritems(): - self._writer.disable_whitespace() - try: - self._writer.write_line('[%s' % key) - if value is not None: - self._writer.write_line(' %s' % value) - self._writer.write_line(']') - finally: - self._writer.enable_whitespace() + poss = [] + poss.append((para.find('#'), '#')) + poss = [pos for pos in poss if pos[0] >= 0] + poss.sort(cmp=lambda x, y: cmp(x[0], y[0])) + if len(poss) == 0: + result += self.escape(para) + elif poss[0][1] == '#': + pos = poss[0][0] + result += self.escape(para[:pos]) + rest = para[pos + 1:] + link = re.split('[^a-zA-Z_:-]', rest, maxsplit=1)[0] + if link.endswith(':'): + link = link[:-1] + namespace = self._transformer.namespace + if '::' in link: + type_name, signal_name = link.split('::') + if type_name in namespace.ctypes: + type_ = namespace.get_by_ctype(type_name) + xref = '%s.%s-%s' % (namespace.name, type_.name, signal_name) + xref_name = '%s.%s::%s' % (namespace.name, type_.name, signal_name) + else: + xref = link + xref_name = link + elif ':' in link: + type_name, property_name = link.split(':') + if type_name in namespace.ctypes: + type_ = namespace.get_by_ctype(type_name) + xref = '%s.%s-%s' % (namespace.name, type_.name, property_name) + xref_name = '%s.%s:%s' % (namespace.name, type_.name, property_name) + else: + xref = link + xref_name = link + elif link in namespace.ctypes: + type_ = namespace.get_by_ctype(link) + xref = '%s.%s' % (namespace.name, type_.name) + xref_name = xref + else: + xref = link + xref_name = link + result += '%s' % (xref, xref_name) + if len(link) < len(rest): + result += self.format_inline(rest[len(link):]) - def render_property(self, entity, link=False): - prop = entity.get_ast() + return result - prop_name = '"%s"' % prop.name - prop_type = self.get_type_name(prop.type) + def format_type(self, type_): + raise NotImplementedError + def format_property_flags(self, property_): flags = [] - if prop.readable: + if property_.readable: flags.append("Read") - if prop.writable: + if property_.writable: flags.append("Write") - if prop.construct: + if property_.construct: flags.append("Construct") - if prop.construct_only: + if property_.construct_only: flags.append("Construct Only") - self._render_prop_or_signal(prop_name, prop_type, flags) - - def _render_prop_or_signal(self, name, type_, flags): - self._writer.disable_whitespace() - - line = _space(2) + name + _space(27 - len(name)) - line += str(type_) + _space(22 - len(str(type_))) - line += ": " + " / ".join(flags) - - self._writer.write_line(line + "\n") + return " / ".join(flags) - self._writer.enable_whitespace() + def to_underscores(self, string): + return to_underscores(string) + def get_class_hierarchy(self, node): + parent_chain = [node] - def render_signal(self, entity, link=False): - signal = entity.get_ast() + while node.parent: + node = self._transformer.lookup_giname(str(node.parent)) + parent_chain.append(node) - sig_name = '"%s"' % signal.name - flags = ["TODO: signal flags not in GIR currently"] - self._render_prop_or_signal(sig_name, "", flags) + parent_chain.reverse() + return parent_chain class MallardFormatterC(MallardFormatter): - def get_title(self, node, parent): - if isinstance(node, ast.Namespace): - return "%s Documentation" % node.name - elif isinstance(node, ast.Function): - return node.symbol - elif isinstance(node, ast.Property): - return parent.c_name + ':' + node.name - elif isinstance(node, ast.Signal): - return parent.c_name + '::' + node.name - else: - return node.c_name -class MallardFormatterPython(MallardFormatter): - def get_title(self, node, parent): - if isinstance(node, ast.Namespace): - return "%s Documentation" % node.name - elif isinstance(node, ast.Function): - if node.is_method or node.is_constructor: - return "%s.%s.%s" % (node.namespace.name, parent.name, node.name) - else: - return "%s.%s" % (node.namespace.name, node.name) - elif isinstance(node, ast.Property): - return "%s" % node.name - elif isinstance(node, ast.Signal): - return "%s" % node.name - else: - return "%s.%s" % (node.namespace.name, node.name) - -class MallardPage(object): - def __init__(self, writer, node, parent): - self.writer = writer - self.node = node - self.parent = parent - self.page_id = None - self.page_type = 'topic' - self.page_style = '' - - node.page = self - if not isinstance(node, ast.Namespace): - if node.namespace is None: - if parent is not None and parent.namespace is not None: - node.namespace = parent.namespace - - self.title = writer._formatter.get_title(node, parent) - self.links = [] - self.linksels = [] - - if isinstance(node, ast.Namespace): - self.page_id = 'index' - elif isinstance(node, ast.Property) and parent is not None: - self.page_id = node.namespace.name + '.' + parent.name + '-' + node.name - elif isinstance(node, ast.Signal) and parent is not None: - self.page_id = node.namespace.name + '.' + parent.name + '--' + node.name - elif parent is not None and not isinstance(parent, ast.Namespace): - self.page_id = node.namespace.name + '.' + parent.name + '.' + node.name + def format_type(self, type_): + if isinstance(type_, ast.Array): + try: + return self.format_type(type_.element_type) + '*' + except: + return type_.target_fundamental + elif type_.ctype is not None: + return type_.ctype else: - self.page_id = node.namespace.name + '.' + node.name + return type_.target_fundamental - if getattr(node, 'symbol', None) is not None: - self.writer._xrefs[node.symbol] = self.page_id - elif isinstance(node, ast.Class): - self.writer._xrefs[node.c_name] = self.page_id - - self.create_content() - self.add_child_nodes() - - def add_link(self, linktype, xref, group=None): - self.links.append((linktype, xref, group)) - - def add_child_nodes(self): - children = [] - if isinstance(self.node, ast.Namespace): - children = [node for node in self.node.itervalues()] - elif isinstance(self.node, (ast.Class, ast.Record)): - children = self.node.methods + self.node.constructors - elif isinstance(self.node, ast.Interface): - children = self.node.methods - - if isinstance(self.node, (ast.Class, ast.Interface)): - children += self.node.properties + self.node.signals - for child in children: - self.writer._pages.append(MallardPage(self.writer, child, self.node)) - - def create_content(self): - if isinstance(self.node, ast.Namespace): - self.page_type = 'guide' - self.page_style = 'namespace' - self.linksels = (('class', 'Classes'), - ('function', 'Functions'), - ('#first #default #last', 'Other')) - elif isinstance(self.node, ast.Class): - self.page_type = 'guide' - self.page_style = 'class' - self.linksels = (('constructor', 'Constructors'), - ('method', 'Methods'), - ('property', 'Properties'), - ('signal', 'Signals'), - ('#first #default #last', 'Other')) - self.add_link('guide', self.parent.page.page_id, 'class') - elif isinstance(self.node, ast.Record): - self.page_type = 'guide' - self.page_style = 'record' - self.add_link('guide', self.parent.page.page_id) - elif isinstance(self.node, ast.Interface): - self.page_type = 'guide' - self.page_style = 'interface' - self.add_link('guide', self.parent.page.page_id) - elif isinstance(self.node, ast.Function): - if self.node.is_constructor: - self.page_style = 'constructor' - self.add_link('guide', self.parent.page.page_id, 'constructor') - elif self.node.is_method: - self.page_style = 'method' - self.add_link('guide', self.parent.page.page_id, 'method') - else: - self.page_style = 'function' - self.add_link('guide', self.parent.page.page_id, 'function') - elif isinstance(self.node, ast.Property): - self.page_style = 'property' - self.add_link('guide', self.parent.page.page_id, 'property') - elif isinstance(self.node, ast.Signal): - self.page_style = 'signal' - self.add_link('guide', self.parent.page.page_id, 'signal') - - def render(self, writer): - with writer.tagcontext('page', [ - ('id', self.page_id), - ('type', self.page_type), - ('style', self.page_style), - ('xmlns', XMLNS), ('xmlns:ui', XMLNS_UI)]): - with writer.tagcontext('info'): - for linktype, xref, group in self.links: - if group is not None: - writer.write_tag('link', [ - ('type', linktype), ('xref', xref), ('group', group)]) - else: - writer.write_tag('link', [ - ('type', linktype), ('xref', xref)]) - writer.write_tag('title', [], self.title) - if isinstance(self.node, ast.Annotated): - self.render_doc(writer, self.node.doc) - if isinstance(self.node, ast.Class): - parent_chain = [] - node = self.node - while node.parent: - node = self.writer._transformer.lookup_giname(str(node.parent)) - parent_chain.append(node) - if node.namespace.name == 'GObject' and node.name == 'Object': - break - parent_chain.reverse() - def print_chain(chain): - with writer.tagcontext('item', []): - attrs = [] - title = self.writer._formatter.get_title(chain[0], None) - if hasattr(chain[0], 'page'): - attrs.append(('xref', chain[0].page.page_id)) - writer.write_tag('code', attrs, title) - if len(chain) > 1: - print_chain(chain[1:]) - with writer.tagcontext('synopsis', [('ui:expanded', 'no')]): - writer.write_tag('title', [], 'Hierarchy') - with writer.tagcontext('tree', []): - print_chain(parent_chain) - for linkstype, title in self.linksels: - with writer.tagcontext('links', [ - ('type', 'topic'), ('ui:expanded', 'yes'), - ('groups', linkstype)]): - writer.write_tag('title', [], title) - - def render_doc(self, writer, doc): - if doc is not None: - for para in doc.split('\n\n'): - writer.disable_whitespace() - with writer.tagcontext('p', []): - self.render_doc_inline(writer, para) - writer.enable_whitespace() +class MallardFormatterPython(MallardFormatter): - def render_doc_inline(self, writer, text): - poss = [] - poss.append((text.find('#'), '#')) - poss = [pos for pos in poss if pos[0] >= 0] - poss.sort(cmp=lambda x, y: cmp(x[0], y[0])) - if len(poss) == 0: - writer.write_line(text, do_escape=True) - elif poss[0][1] == '#': - pos = poss[0][0] - writer.write_line(text[:pos], do_escape=True) - rest = text[pos + 1:] - link = re.split('[^a-zA-Z_:-]', rest, maxsplit=1)[0] - xref = self.writer._xrefs.get(link, link) - writer.write_tag('link', [('xref', xref)], link) - if len(link) < len(rest): - self.render_doc_inline(writer, rest[len(link):]) + def format_type(self, type_): + if isinstance(type_, ast.Array): + return '[' + self.format_type(type_.element_type) + ']' + elif isinstance(type_, ast.Map): + return '{%s: %s}' % (self.format_type(type_.key_type), + self.format_type(type_.value_type)) + elif type_.target_giname is not None: + return type_.target_giname + else: + return type_.target_fundamental + + def format(self, doc): + doc = MallardFormatter.format(self, doc) + doc = doc.replace('%NULL', 'None') + doc = doc.replace('%TRUE', 'True') + doc = doc.replace('%FALSE', 'False') + return doc class MallardWriter(object): - def __init__(self, formatter): - self._namespace = None - self._index = None - self._pages = [] - self._formatter = formatter - self._xrefs = {} - - def add_transformer(self, transformer): + def __init__(self, transformer, language): self._transformer = transformer - self._namespace = self._transformer._namespace - self._index = MallardPage(self, self._namespace, None) + self._language = language + + if self._language == 'C': + self._formatter = MallardFormatterC(self._transformer) + elif self._language == 'Python': + self._formatter = MallardFormatterPython(self._transformer) + else: + raise SystemExit("Unsupported language: %s" % language) def write(self, output): - xmlwriter = XMLWriter() - self._index.render(xmlwriter) - fp = open(output, 'w') - fp.write(xmlwriter.get_xml()) - fp.close() + nodes = [self._transformer.namespace] + for node in self._transformer.namespace.itervalues(): + if isinstance(node, ast.Function) and node.moved_to is not None: + continue + if getattr(node, 'disguised', False): + continue + if isinstance(node, ast.Record) and \ + self._language == 'Python' and \ + node.is_gtype_struct_for is not None: + continue + nodes.append(node) + if isinstance(node, (ast.Class, ast.Interface, ast.Record)): + nodes += getattr(node, 'methods', []) + nodes += getattr(node, 'static_methods', []) + nodes += getattr(node, 'virtual_methods', []) + nodes += getattr(node, 'properties', []) + nodes += getattr(node, 'signals', []) + if self._language == 'C': + nodes += getattr(node, 'constructors', []) + for node in nodes: + self._render_node(node, output) - for page in self._pages: - xmlwriter = XMLWriter() - page.render(xmlwriter) - fp = open(os.path.join(os.path.dirname(output), page.page_id + '.page'), 'w') - fp.write(xmlwriter.get_xml()) - fp.close() - - def _render_page_object_hierarchy(self, page_node): - parent_chain = self._get_parent_chain(page_node) - parent_chain.append(page_node) - lines = [] - - for level, parent in enumerate(parent_chain): - prepend = "" - if level > 0: - prepend = _space((level - 1)* 6) + " +----" - lines.append(_space(2) + prepend + self._formatter.get_class_name(parent)) - - self._writer.disable_whitespace() - self._writer.write_line("\n".join(lines)) - self._writer.enable_whitespace() + def _render_node(self, node, output): + namespace = self._transformer.namespace + if isinstance(node, ast.Namespace): + template_name = 'mallard-%s-namespace.tmpl' % self._language + page_id = 'index' + elif isinstance(node, (ast.Class, ast.Interface)): + template_name = 'mallard-%s-class.tmpl' % self._language + page_id = '%s.%s' % (namespace.name, node.name) + elif isinstance(node, ast.Record): + template_name = 'mallard-%s-record.tmpl' % self._language + page_id = '%s.%s' % (namespace.name, node.name) + elif isinstance(node, ast.Function): + template_name = 'mallard-%s-function.tmpl' % self._language + if node.parent is not None: + page_id = '%s.%s.%s' % (namespace.name, node.parent.name, node.name) + else: + page_id = '%s.%s' % (namespace.name, node.name) + elif isinstance(node, ast.Enum): + template_name = 'mallard-%s-enum.tmpl' % self._language + page_id = '%s.%s' % (namespace.name, node.name) + elif isinstance(node, ast.Property) and node.parent is not None: + template_name = 'mallard-%s-property.tmpl' % self._language + page_id = '%s.%s-%s' % (namespace.name, node.parent.name, node.name) + elif isinstance(node, ast.Signal) and node.parent is not None: + template_name = 'mallard-%s-signal.tmpl' % self._language + page_id = '%s.%s-%s' % (namespace.name, node.parent.name, node.name) + elif isinstance(node, ast.VFunction) and node.parent is not None: + template_name = 'mallard-%s-vfunc.tmpl' % self._language + page_id = '%s.%s-%s' % (namespace.name, node.parent.name, node.name) + else: + template_name = 'mallard-%s-default.tmpl' % self._language + page_id = '%s.%s' % (namespace.name, node.name) + + if 'UNINSTALLED_INTROSPECTION_SRCDIR' in os.environ: + top_srcdir = os.environ['UNINSTALLED_INTROSPECTION_SRCDIR'] + template_dir = os.path.join(top_srcdir, 'giscanner') + else: + template_dir = os.path.dirname(__file__) + + file_name = os.path.join(template_dir, template_name) + file_name = os.path.abspath(file_name) + template = Template(filename=file_name, output_encoding='utf-8', + module_directory=tempfile.gettempdir()) + result = template.render(namespace=namespace, + node=node, + page_id=page_id, + formatter=self._formatter) + + output_file_name = os.path.join(os.path.dirname(output), + page_id + '.page') + fp = open(output_file_name, 'w') + fp.write(result) + fp.close() diff -Nru gobject-introspection-1.31.10/gobject-introspection-1.0.pc gobject-introspection-1.31.20/gobject-introspection-1.0.pc --- gobject-introspection-1.31.10/gobject-introspection-1.0.pc 2012-01-19 22:12:16.000000000 +0000 +++ gobject-introspection-1.31.20/gobject-introspection-1.0.pc 2012-03-05 14:47:08.000000000 +0000 @@ -1,7 +1,7 @@ -prefix=/src/build/jhbuild +prefix=/usr/local exec_prefix=${prefix} -libdir=/src/build/jhbuild/lib64 -bindir=/src/build/jhbuild/bin +libdir=${exec_prefix}/lib +bindir=${exec_prefix}/bin datarootdir=${prefix}/share datadir=${datarootdir} includedir=${prefix}/include @@ -19,4 +19,4 @@ Name: gobject-introspection Description: GObject Introspection -Version: 1.31.10 +Version: 1.31.20 diff -Nru gobject-introspection-1.31.10/gobject-introspection-no-export-1.0.pc gobject-introspection-1.31.20/gobject-introspection-no-export-1.0.pc --- gobject-introspection-1.31.10/gobject-introspection-no-export-1.0.pc 2012-01-19 22:12:16.000000000 +0000 +++ gobject-introspection-1.31.20/gobject-introspection-no-export-1.0.pc 2012-03-05 14:47:08.000000000 +0000 @@ -1,7 +1,7 @@ -prefix=/src/build/jhbuild +prefix=/usr/local exec_prefix=${prefix} -libdir=/src/build/jhbuild/lib64 -bindir=/src/build/jhbuild/bin +libdir=${exec_prefix}/lib +bindir=${exec_prefix}/bin datarootdir=${prefix}/share datadir=${datarootdir} includedir=${prefix}/include @@ -18,4 +18,4 @@ Name: gobject-introspection Description: GObject Introspection -Version: 1.31.10 +Version: 1.31.20 diff -Nru gobject-introspection-1.31.10/m4/introspection.m4 gobject-introspection-1.31.20/m4/introspection.m4 --- gobject-introspection-1.31.10/m4/introspection.m4 2011-06-10 15:36:50.000000000 +0000 +++ gobject-introspection-1.31.20/m4/introspection.m4 2012-03-05 14:42:43.000000000 +0000 @@ -41,6 +41,8 @@ ],dnl [auto],[dnl PKG_CHECK_EXISTS([gobject-introspection-1.0 >= $1], found_introspection=yes, found_introspection=no) + dnl Canonicalize enable_introspection + enable_introspection=$found_introspection ],dnl [dnl AC_MSG_ERROR([invalid argument passed to --enable-introspection, should be one of @<:@no/auto/yes@:>@]) diff -Nru gobject-introspection-1.31.10/m4/python.m4 gobject-introspection-1.31.20/m4/python.m4 --- gobject-introspection-1.31.10/m4/python.m4 2011-09-09 20:48:44.000000000 +0000 +++ gobject-introspection-1.31.20/m4/python.m4 2012-02-20 17:19:27.000000000 +0000 @@ -1,4 +1,41 @@ ## this one is commonly used with AM_PATH_PYTHONDIR ... +dnl AM_CHECK_PYMOD(MODNAME [,SYMBOL [,ACTION-IF-FOUND [,ACTION-IF-NOT-FOUND]]]) +dnl Check if a module containing a given symbol is visible to python. +AC_DEFUN([AM_CHECK_PYMOD], +[AC_REQUIRE([AM_PATH_PYTHON]) +py_mod_var=`echo $1['_']$2 | sed 'y%./+-%__p_%'` +AC_MSG_CHECKING(for ifelse([$2],[],,[$2 in ])python module $1) +AC_CACHE_VAL(py_cv_mod_$py_mod_var, [ +ifelse([$2],[], [prog=" +import sys +try: + import $1 +except ImportError: + sys.exit(1) +except: + sys.exit(0) +sys.exit(0)"], [prog=" +import $1 +$1.$2"]) +if $PYTHON -c "$prog" 1>&AC_FD_CC 2>&AC_FD_CC + then + eval "py_cv_mod_$py_mod_var=yes" + else + eval "py_cv_mod_$py_mod_var=no" + fi +]) +py_val=`eval "echo \`echo '$py_cv_mod_'$py_mod_var\`"` +if test "x$py_val" != xno; then + AC_MSG_RESULT(yes) + ifelse([$3], [],, [$3 +])dnl +else + AC_MSG_RESULT(no) + ifelse([$4], [],, [$4 +])dnl +fi +]) + dnl a macro to check for ability to create python extensions dnl AM_CHECK_PYTHON_HEADERS([ACTION-IF-POSSIBLE], [ACTION-IF-NOT-POSSIBLE]) dnl function also defines PYTHON_INCLUDES diff -Nru gobject-introspection-1.31.10/Makefile-giscanner.am gobject-introspection-1.31.20/Makefile-giscanner.am --- gobject-introspection-1.31.10/Makefile-giscanner.am 2011-09-19 17:57:50.000000000 +0000 +++ gobject-introspection-1.31.20/Makefile-giscanner.am 2012-03-05 14:42:43.000000000 +0000 @@ -33,8 +33,6 @@ giscanner/ast.py \ giscanner/cachestore.py \ giscanner/codegen.py \ - giscanner/docbookdescription.py \ - giscanner/docbookwriter.py \ giscanner/docmain.py \ giscanner/dumper.py \ giscanner/introspectablepass.py \ @@ -44,6 +42,24 @@ giscanner/libtoolimporter.py \ giscanner/odict.py \ giscanner/mallardwriter.py \ + giscanner/mallard-C-class.tmpl \ + giscanner/mallard-C-default.tmpl \ + giscanner/mallard-C-enum.tmpl \ + giscanner/mallard-C-function.tmpl \ + giscanner/mallard-C-namespace.tmpl \ + giscanner/mallard-C-property.tmpl \ + giscanner/mallard-C-record.tmpl \ + giscanner/mallard-C-signal.tmpl \ + giscanner/mallard-C-vfunc.tmpl \ + giscanner/mallard-Python-class.tmpl \ + giscanner/mallard-Python-default.tmpl \ + giscanner/mallard-Python-enum.tmpl \ + giscanner/mallard-Python-function.tmpl \ + giscanner/mallard-Python-namespace.tmpl \ + giscanner/mallard-Python-property.tmpl \ + giscanner/mallard-Python-record.tmpl \ + giscanner/mallard-Python-signal.tmpl \ + giscanner/mallard-Python-vfunc.tmpl \ giscanner/maintransformer.py \ giscanner/message.py \ giscanner/shlibs.py \ diff -Nru gobject-introspection-1.31.10/Makefile.in gobject-introspection-1.31.20/Makefile.in --- gobject-introspection-1.31.10/Makefile.in 2012-01-19 22:12:11.000000000 +0000 +++ gobject-introspection-1.31.20/Makefile.in 2012-03-05 14:47:04.000000000 +0000 @@ -116,6 +116,7 @@ @OS_WIN32_TRUE@ -no-undefined \ @OS_WIN32_TRUE@ -shrext ".pyd" +@BUILD_DOCTOOL_TRUE@am__append_4 = g-ir-doc-tool subdir = . ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/gtk-doc.m4 \ @@ -606,7 +607,7 @@ g-ir-doc-tool INTROSPECTION_GIRS = $(BUILT_GIRSOURCES) check_LTLIBRARIES = -bin_SCRIPTS = g-ir-scanner g-ir-annotation-tool g-ir-doc-tool +bin_SCRIPTS = g-ir-scanner g-ir-annotation-tool $(am__append_4) GTESTER_PROGS = cmph-bdz-test gthash-test INTROSPECTION_SCANNER = \ env PATH=.libs:$(PATH) \ @@ -844,8 +845,6 @@ giscanner/ast.py \ giscanner/cachestore.py \ giscanner/codegen.py \ - giscanner/docbookdescription.py \ - giscanner/docbookwriter.py \ giscanner/docmain.py \ giscanner/dumper.py \ giscanner/introspectablepass.py \ @@ -855,6 +854,24 @@ giscanner/libtoolimporter.py \ giscanner/odict.py \ giscanner/mallardwriter.py \ + giscanner/mallard-C-class.tmpl \ + giscanner/mallard-C-default.tmpl \ + giscanner/mallard-C-enum.tmpl \ + giscanner/mallard-C-function.tmpl \ + giscanner/mallard-C-namespace.tmpl \ + giscanner/mallard-C-property.tmpl \ + giscanner/mallard-C-record.tmpl \ + giscanner/mallard-C-signal.tmpl \ + giscanner/mallard-C-vfunc.tmpl \ + giscanner/mallard-Python-class.tmpl \ + giscanner/mallard-Python-default.tmpl \ + giscanner/mallard-Python-enum.tmpl \ + giscanner/mallard-Python-function.tmpl \ + giscanner/mallard-Python-namespace.tmpl \ + giscanner/mallard-Python-property.tmpl \ + giscanner/mallard-Python-record.tmpl \ + giscanner/mallard-Python-signal.tmpl \ + giscanner/mallard-Python-vfunc.tmpl \ giscanner/maintransformer.py \ giscanner/message.py \ giscanner/shlibs.py \ diff -Nru gobject-introspection-1.31.10/Makefile-tools.am gobject-introspection-1.31.20/Makefile-tools.am --- gobject-introspection-1.31.10/Makefile-tools.am 2011-12-08 20:00:31.000000000 +0000 +++ gobject-introspection-1.31.20/Makefile-tools.am 2012-02-21 15:43:45.000000000 +0000 @@ -1,5 +1,9 @@ bin_PROGRAMS += g-ir-compiler g-ir-generate -bin_SCRIPTS += g-ir-scanner g-ir-annotation-tool g-ir-doc-tool +bin_SCRIPTS += g-ir-scanner g-ir-annotation-tool + +if BUILD_DOCTOOL +bin_SCRIPTS += g-ir-doc-tool +endif EXTRA_DIST += \ tools/g-ir-scanner.in \ diff -Nru gobject-introspection-1.31.10/README gobject-introspection-1.31.20/README --- gobject-introspection-1.31.10/README 2011-06-10 15:36:50.000000000 +0000 +++ gobject-introspection-1.31.20/README 2012-02-20 17:19:27.000000000 +0000 @@ -37,6 +37,8 @@ typelib blob. - g-ir-scanner, a tool which generates GIR XML files by parsing headers and introspecting GObject based libraries. +- g-ir-doc-tool, generates Mallard files that can be viewed with yelp or + rendered to HTML with yelp-build from yelp-tools. API library =========== diff -Nru gobject-introspection-1.31.10/tests/doctool/DocExamples-1.0-C-expected/DocExamples.ObjClass.page gobject-introspection-1.31.20/tests/doctool/DocExamples-1.0-C-expected/DocExamples.ObjClass.page --- gobject-introspection-1.31.10/tests/doctool/DocExamples-1.0-C-expected/DocExamples.ObjClass.page 1970-01-01 00:00:00.000000000 +0000 +++ gobject-introspection-1.31.20/tests/doctool/DocExamples-1.0-C-expected/DocExamples.ObjClass.page 2012-02-22 17:57:37.000000000 +0000 @@ -0,0 +1,12 @@ + + + + + + DocExamplesObjClass + + diff -Nru gobject-introspection-1.31.10/tests/doctool/DocExamples-1.0-C-expected/DocExamples.Obj.method.page gobject-introspection-1.31.20/tests/doctool/DocExamples-1.0-C-expected/DocExamples.Obj.method.page --- gobject-introspection-1.31.10/tests/doctool/DocExamples-1.0-C-expected/DocExamples.Obj.method.page 1970-01-01 00:00:00.000000000 +0000 +++ gobject-introspection-1.31.20/tests/doctool/DocExamples-1.0-C-expected/DocExamples.Obj.method.page 2012-02-22 17:57:37.000000000 +0000 @@ -0,0 +1,53 @@ + + + + + + + + void + + doc_examples_obj_method + + DocExamplesObj * + self + + + gint + first_arg + + + gfloat + second_arg + + + + doc_examples_obj_method + +void doc_examples_obj_method (DocExamplesObj *self, +gint first_arg, + gfloat second_arg); + +

This is an example of how to document a method.

+ + + + + + + + + + + + + + +

first_arg :

first argument

second_arg :

second argument

Returns :

+

Since 0.99

+
diff -Nru gobject-introspection-1.31.10/tests/doctool/DocExamples-1.0-C-expected/DocExamples.Obj.new.page gobject-introspection-1.31.20/tests/doctool/DocExamples-1.0-C-expected/DocExamples.Obj.new.page --- gobject-introspection-1.31.10/tests/doctool/DocExamples-1.0-C-expected/DocExamples.Obj.new.page 1970-01-01 00:00:00.000000000 +0000 +++ gobject-introspection-1.31.20/tests/doctool/DocExamples-1.0-C-expected/DocExamples.Obj.new.page 2012-02-22 17:57:37.000000000 +0000 @@ -0,0 +1,30 @@ + + + + + + + + DocExamplesObj* + + doc_examples_obj_new + + + doc_examples_obj_new + +DocExamplesObj* doc_examples_obj_new (void); + + + + + + + + +

Returns :

+
diff -Nru gobject-introspection-1.31.10/tests/doctool/DocExamples-1.0-C-expected/DocExamples.Obj.page gobject-introspection-1.31.20/tests/doctool/DocExamples-1.0-C-expected/DocExamples.Obj.page --- gobject-introspection-1.31.10/tests/doctool/DocExamples-1.0-C-expected/DocExamples.Obj.page 1970-01-01 00:00:00.000000000 +0000 +++ gobject-introspection-1.31.20/tests/doctool/DocExamples-1.0-C-expected/DocExamples.Obj.page 2012-02-22 17:57:37.000000000 +0000 @@ -0,0 +1,46 @@ + + + + + + DocExamplesObj +

This is an example of how to document a class

This class has a signal: DocExamples.Obj::signal-example.

And also has a property: DocExamples.Obj:property-example.

+

Since 0.99

+ + Hierarchy + + + GObjectObject + + + + + Constructors + + + Methods + + + Functions + + + Properties + + + Signals + + + Other + +
diff -Nru gobject-introspection-1.31.10/tests/doctool/DocExamples-1.0-C-expected/DocExamples.Obj-property-example.page gobject-introspection-1.31.20/tests/doctool/DocExamples-1.0-C-expected/DocExamples.Obj-property-example.page --- gobject-introspection-1.31.10/tests/doctool/DocExamples-1.0-C-expected/DocExamples.Obj-property-example.page 1970-01-01 00:00:00.000000000 +0000 +++ gobject-introspection-1.31.20/tests/doctool/DocExamples-1.0-C-expected/DocExamples.Obj-property-example.page 2012-02-22 17:57:37.000000000 +0000 @@ -0,0 +1,13 @@ + + + + + property-example + + DocExamplesObj:property-example +

This is an example of how to document a property.

+
diff -Nru gobject-introspection-1.31.10/tests/doctool/DocExamples-1.0-C-expected/DocExamples.Obj-signal-example.page gobject-introspection-1.31.20/tests/doctool/DocExamples-1.0-C-expected/DocExamples.Obj-signal-example.page --- gobject-introspection-1.31.10/tests/doctool/DocExamples-1.0-C-expected/DocExamples.Obj-signal-example.page 1970-01-01 00:00:00.000000000 +0000 +++ gobject-introspection-1.31.20/tests/doctool/DocExamples-1.0-C-expected/DocExamples.Obj-signal-example.page 2012-02-22 17:57:37.000000000 +0000 @@ -0,0 +1,13 @@ + + + + + signal-example + + DocExamplesObj::signal-example +

This is an example of how to document a signal.

+
diff -Nru gobject-introspection-1.31.10/tests/doctool/DocExamples-1.0-C-expected/DocExamples.Obj-vfunc.page gobject-introspection-1.31.20/tests/doctool/DocExamples-1.0-C-expected/DocExamples.Obj-vfunc.page --- gobject-introspection-1.31.10/tests/doctool/DocExamples-1.0-C-expected/DocExamples.Obj-vfunc.page 1970-01-01 00:00:00.000000000 +0000 +++ gobject-introspection-1.31.20/tests/doctool/DocExamples-1.0-C-expected/DocExamples.Obj-vfunc.page 2012-02-22 17:57:37.000000000 +0000 @@ -0,0 +1,27 @@ + + + + + + vfunc + + +

This is an example of how to document a vfunc.

+ + + + + + + + + + +

first_arg :

first argument

Returns :

+

Since 0.99

+
diff -Nru gobject-introspection-1.31.10/tests/doctool/DocExamples-1.0-C-expected/index.page gobject-introspection-1.31.20/tests/doctool/DocExamples-1.0-C-expected/index.page --- gobject-introspection-1.31.10/tests/doctool/DocExamples-1.0-C-expected/index.page 1970-01-01 00:00:00.000000000 +0000 +++ gobject-introspection-1.31.20/tests/doctool/DocExamples-1.0-C-expected/index.page 2012-02-22 17:57:37.000000000 +0000 @@ -0,0 +1,19 @@ + + + + + DocExamples Documentation + + Classes + + + Functions + + + Other + + diff -Nru gobject-introspection-1.31.10/tests/doctool/DocExamples-1.0-Python-expected/DocExamples.Obj.method.page gobject-introspection-1.31.20/tests/doctool/DocExamples-1.0-Python-expected/DocExamples.Obj.method.page --- gobject-introspection-1.31.10/tests/doctool/DocExamples-1.0-Python-expected/DocExamples.Obj.method.page 1970-01-01 00:00:00.000000000 +0000 +++ gobject-introspection-1.31.20/tests/doctool/DocExamples-1.0-Python-expected/DocExamples.Obj.method.page 2012-02-22 17:57:37.000000000 +0000 @@ -0,0 +1,49 @@ + + + + + + + + none + + doc_examples_obj_method + + DocExamplesObj * + self + + + gint + first_arg + + + gfloat + second_arg + + + + method + +@accepts(gint, gfloat) +@returns(none) +def method(first_arg, second_arg) + +

This is an example of how to document a method.

+ + + + + + + + + + +

first_arg :

first argument

second_arg :

second argument

+

Since 0.99

+
diff -Nru gobject-introspection-1.31.10/tests/doctool/DocExamples-1.0-Python-expected/DocExamples.Obj.page gobject-introspection-1.31.20/tests/doctool/DocExamples-1.0-Python-expected/DocExamples.Obj.page --- gobject-introspection-1.31.10/tests/doctool/DocExamples-1.0-Python-expected/DocExamples.Obj.page 1970-01-01 00:00:00.000000000 +0000 +++ gobject-introspection-1.31.20/tests/doctool/DocExamples-1.0-Python-expected/DocExamples.Obj.page 2012-02-22 17:57:37.000000000 +0000 @@ -0,0 +1,53 @@ + + + + + + DocExamples.Obj +

This is an example of how to document a class

This class has a signal: DocExamples.Obj::signal-example.

And also has a property: DocExamples.Obj:property-example.

+ + +from gi.repository import DocExamples + +obj = DocExamples.Obj(property_example=value) + +

Since 0.99

+ + Hierarchy + + + GObject.Object + + DocExamples.Obj + + + + + + Methods + + + Functions + + + Properties + + + Signals + + + Virtual functions + + + Other + +
diff -Nru gobject-introspection-1.31.10/tests/doctool/DocExamples-1.0-Python-expected/DocExamples.Obj-property-example.page gobject-introspection-1.31.20/tests/doctool/DocExamples-1.0-Python-expected/DocExamples.Obj-property-example.page --- gobject-introspection-1.31.10/tests/doctool/DocExamples-1.0-Python-expected/DocExamples.Obj-property-example.page 1970-01-01 00:00:00.000000000 +0000 +++ gobject-introspection-1.31.20/tests/doctool/DocExamples-1.0-Python-expected/DocExamples.Obj-property-example.page 2012-02-22 17:57:37.000000000 +0000 @@ -0,0 +1,16 @@ + + + + + property-example + + DocExamples.Obj:property-example + +"property-example" {utf8: gint8} : Read / Write + +

This is an example of how to document a property.

+
diff -Nru gobject-introspection-1.31.10/tests/doctool/DocExamples-1.0-Python-expected/DocExamples.Obj-signal-example.page gobject-introspection-1.31.20/tests/doctool/DocExamples-1.0-Python-expected/DocExamples.Obj-signal-example.page --- gobject-introspection-1.31.10/tests/doctool/DocExamples-1.0-Python-expected/DocExamples.Obj-signal-example.page 1970-01-01 00:00:00.000000000 +0000 +++ gobject-introspection-1.31.20/tests/doctool/DocExamples-1.0-Python-expected/DocExamples.Obj-signal-example.page 2012-02-22 17:57:37.000000000 +0000 @@ -0,0 +1,40 @@ + + + + + signal-example + + DocExamples.Obj::signal-example + +def callback(obj, float_param, since, user_param1, ...) + +

This is an example of how to document a signal.

+ + + + + + + + + + + + + + + + + + + + + + +

obj :

instance of DocExamples.Obj that is emitting the signal

float_param :

a parameter of type float

since :

user_param1 :

first user parameter (if any) specified with the connect() method

... :

additional user parameters (if any)

+

Since 0.99

+
diff -Nru gobject-introspection-1.31.10/tests/doctool/DocExamples-1.0-Python-expected/DocExamples.Obj-vfunc.page gobject-introspection-1.31.20/tests/doctool/DocExamples-1.0-Python-expected/DocExamples.Obj-vfunc.page --- gobject-introspection-1.31.10/tests/doctool/DocExamples-1.0-Python-expected/DocExamples.Obj-vfunc.page 1970-01-01 00:00:00.000000000 +0000 +++ gobject-introspection-1.31.20/tests/doctool/DocExamples-1.0-Python-expected/DocExamples.Obj-vfunc.page 2012-02-22 17:57:37.000000000 +0000 @@ -0,0 +1,27 @@ + + + + + vfunc + + DocExamples.Obj.vfunc + +@accepts(gint) +@returns(none) +def do_vfunc(self, first_arg): + +

This is an example of how to document a vfunc.

+ + + + + + +

first_arg :

first argument

+

Since 0.99

+
diff -Nru gobject-introspection-1.31.10/tests/doctool/DocExamples-1.0-Python-expected/index.page gobject-introspection-1.31.20/tests/doctool/DocExamples-1.0-Python-expected/index.page --- gobject-introspection-1.31.10/tests/doctool/DocExamples-1.0-Python-expected/index.page 1970-01-01 00:00:00.000000000 +0000 +++ gobject-introspection-1.31.20/tests/doctool/DocExamples-1.0-Python-expected/index.page 2012-02-22 17:57:37.000000000 +0000 @@ -0,0 +1,19 @@ + + + + + DocExamples Documentation + + Classes + + + Functions + + + Other + + diff -Nru gobject-introspection-1.31.10/tests/doctool/doc-examples-obj.c gobject-introspection-1.31.20/tests/doctool/doc-examples-obj.c --- gobject-introspection-1.31.10/tests/doctool/doc-examples-obj.c 1970-01-01 00:00:00.000000000 +0000 +++ gobject-introspection-1.31.20/tests/doctool/doc-examples-obj.c 2012-02-22 17:57:37.000000000 +0000 @@ -0,0 +1,116 @@ +/* doc-examples-obj.c */ + +#include "doc-examples-obj.h" + +/** + * DocExamplesObj: + * + * This is an example of how to document a class + * + * This class has a signal: #DocExamplesObj::signal-example. + * + * And also has a property: #DocExamplesObj:property-example. + * + * Since: 0.99 + */ + +G_DEFINE_TYPE (DocExamplesObj, doc_examples_obj, G_TYPE_OBJECT) + +static void +doc_examples_obj_get_property (GObject *object, + guint property_id, + GValue *value, + GParamSpec *pspec) +{ + switch (property_id) + { + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + } +} + +static void +doc_examples_obj_set_property (GObject *object, + guint property_id, + const GValue *value, + GParamSpec *pspec) +{ + switch (property_id) + { + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + } +} + +static void +doc_examples_obj_class_init (DocExamplesObjClass *klass) +{ + GObjectClass *gobject_class = G_OBJECT_CLASS (klass); + GParamSpec *pspec; + + gobject_class->get_property = doc_examples_obj_get_property; + gobject_class->set_property = doc_examples_obj_set_property; + + /** + * DocExamplesObj::signal-example: + * @obj: + * @int_param: a parameter of type int + * @float_param: a parameter of type float + * + * This is an example of how to document a signal. + * + * Since: 0.99 + */ + g_signal_new ("signal-example", + G_TYPE_FROM_CLASS (gobject_class), + G_SIGNAL_RUN_LAST, + 0, NULL, NULL, + NULL, + G_TYPE_NONE, 2, G_TYPE_UINT, G_TYPE_UINT); + + /** + * DocExamplesObj:property-example: + * + * This is an example of how to document a property. + * + * Type: GLib.HashTable(utf8,gint8) + * Transfer: container + * + * Since: 0.99 + */ + pspec = g_param_spec_boxed ("property-example", + "Example property", + "A contained GHashTable", + G_TYPE_HASH_TABLE, + G_PARAM_READWRITE); + g_object_class_install_property (gobject_class, + 1, + pspec); +} + +static void +doc_examples_obj_init (DocExamplesObj *self) +{ + +} + +DocExamplesObj * +doc_examples_obj_new (void) +{ + return g_object_new (DOC_EXAMPLES_TYPE_OBJ, NULL); +} + +/** + * doc_examples_obj_method: + * @first_arg: first argument + * @second_arg: second argument + * + * This is an example of how to document a method. + * + * Since: 0.99 + */ +void +doc_examples_obj_method (DocExamplesObj *self, gint first_arg, gfloat second_arg) +{ + +} diff -Nru gobject-introspection-1.31.10/tests/doctool/doc-examples-obj.h gobject-introspection-1.31.20/tests/doctool/doc-examples-obj.h --- gobject-introspection-1.31.10/tests/doctool/doc-examples-obj.h 1970-01-01 00:00:00.000000000 +0000 +++ gobject-introspection-1.31.20/tests/doctool/doc-examples-obj.h 2012-02-22 17:57:37.000000000 +0000 @@ -0,0 +1,63 @@ +/* doc-examples-obj.h */ + +#ifndef _DOC_EXAMPLES_OBJ_H +#define _DOC_EXAMPLES_OBJ_H + +#include + +G_BEGIN_DECLS + +#define DOC_EXAMPLES_TYPE_OBJ doc_examples_obj_get_type() + +#define DOC_EXAMPLES_OBJ(obj) \ + (G_TYPE_CHECK_INSTANCE_CAST ((obj), \ + DOC_EXAMPLES_TYPE_OBJ, DocExamplesObj)) + +#define DOC_EXAMPLES_OBJ_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_CAST ((klass), \ + DOC_EXAMPLES_TYPE_OBJ, DocExamplesObjClass)) + +#define DOC_EXAMPLES_IS_OBJ(obj) \ + (G_TYPE_CHECK_INSTANCE_TYPE ((obj), \ + DOC_EXAMPLES_TYPE_OBJ)) + +#define DOC_EXAMPLES_IS_OBJ_CLASS(klass) \ + (G_TYPE_CHECK_CLASS_TYPE ((klass), \ + DOC_EXAMPLES_TYPE_OBJ)) + +#define DOC_EXAMPLES_OBJ_GET_CLASS(obj) \ + (G_TYPE_INSTANCE_GET_CLASS ((obj), \ + DOC_EXAMPLES_TYPE_OBJ, DocExamplesObjClass)) + +typedef struct _DocExamplesObj DocExamplesObj; +typedef struct _DocExamplesObjClass DocExamplesObjClass; + +struct _DocExamplesObj +{ + GObject parent; +}; + +struct _DocExamplesObjClass +{ + GObjectClass parent_class; + + /** + * DocExamplesObjClass::vfunc: + * @self: + * @first_arg: first argument + * + * This is an example of how to document a vfunc. + * + * Since: 0.99 + */ + void (*vfunc) (DocExamplesObj *self, gint first_arg); +}; + +GType doc_examples_obj_get_type (void) G_GNUC_CONST; + +DocExamplesObj *doc_examples_obj_new (void); +void doc_examples_obj_method (DocExamplesObj *self, gint first_arg, gfloat second_arg); + +G_END_DECLS + +#endif /* _DOC_EXAMPLES_OBJ_H */ diff -Nru gobject-introspection-1.31.10/tests/doctool/Makefile.am gobject-introspection-1.31.20/tests/doctool/Makefile.am --- gobject-introspection-1.31.10/tests/doctool/Makefile.am 2011-08-30 01:07:31.000000000 +0000 +++ gobject-introspection-1.31.20/tests/doctool/Makefile.am 2012-02-22 17:57:37.000000000 +0000 @@ -1,30 +1,45 @@ include $(top_srcdir)/common.mk +include $(top_srcdir)/Makefile.introspection -# Disabled temporarily +INTROSPECTION_SCANNER_ARGS += --warn-all --warn-error -I. -# GIRS = GIRepository-2.0.gir -# CHECK_TARGETS = $(GIRS:.gir=-C.page.check) $(GIRS:.gir=-Python.page.check) -# MALLARD_DIRS = $(GIRS:.gir=-C) $(GIRS:.gir=-Python) -# EXPECTED_MALLARD_DIRS = $(MALLARD_DIRS:=-expected) -# CLEANFILES = $(GIRS) -# EXTRA_DIST = $(EXPECTED_MALLARD_DIRS) +check_LTLIBRARIES = \ + libdocexamples.la -# %.gir: -# cp ../../$*.gir . - -# %-C: %.gir -# mkdir $*-C ; rm $*-C/*.page ; $(INTROSPECTION_DOCTOOL) --language C --format mallard $*.gir -o $*-C/index.page && echo " GEN $*-C/index.page" - -# %-Python: %.gir -# mkdir $*-Python ; rm $*-Python/*.page ; $(INTROSPECTION_DOCTOOL) --language Python --format mallard $*.gir -o $*-Python/index.page && echo " GEN $*-Python/index.page" - -# %-C.page.check: %-C -# @diff -u -U 10 $(srcdir)/$*-C-expected $*-C && echo " TEST $*-C" && rm -rf $*-C - -# %-Python.page.check: %-Python -# @diff -u -U 10 $(srcdir)/$*-Python-expected $*-Python && echo " TEST $*-Python" && rm -rf $*-Python - -# check-local: $(CHECK_TARGETS) - -# clean-local: -# @rm -rf $(MALLARD_DIRS) +AM_CFLAGS = $(GOBJECT_CFLAGS) +LIBS = $(GOBJECT_LIBS) + +libdocexamples_la_SOURCES = $(srcdir)/doc-examples-obj.c $(srcdir)/doc-examples-obj.h + +GIRS = +TYPELIBS = $(GIRS:.gir=.typelib) +INTROSPECTION_GIRS = $(GIRS) +CHECK_TARGETS = $(GIRS:.gir=-C.page.check) $(GIRS:.gir=-Python.page.check) +MALLARD_DIRS = $(GIRS:.gir=-C) $(GIRS:.gir=-Python) +EXPECTED_MALLARD_DIRS = $(MALLARD_DIRS:=-expected) +CLEANFILES = $(TYPELIBS) $(GIRS) +BUILT_SOURCES = $(MALLARD_DIRS) +EXTRA_DIST = $(EXPECTED_MALLARD_DIRS) + +DocExamples-1.0.gir: $(top_builddir)/Gio-2.0.gir libdocexamples.la +DocExamples_1_0_gir_LIBS = libdocexamples.la +DocExamples_1_0_gir_INCLUDES = cairo-1.0 Gio-2.0 +DocExamples_1_0_gir_FILES = $(libdocexamples_la_SOURCES) +#DocExamples_1_0_gir_SCANNERFLAGS = --c-include="regress.h" +GIRS += DocExamples-1.0.gir + +%-C: %.gir + mkdir $*-C ; rm $*-C/*.page ; $(INTROSPECTION_DOCTOOL) --language C $*.gir -o $*-C/ && echo " GEN $*-C/index.page" + +%-Python: %.gir + mkdir $*-Python ; rm $*-Python/*.page ; $(INTROSPECTION_DOCTOOL) --language Python $*.gir -o $*-Python/ && echo " GEN $*-Python/index.page" + +%-C.page.check: %-C + @diff -u -U 10 $(srcdir)/$*-C-expected $*-C && echo " TEST $*-C" && rm -rf $*-C + +%-Python.page.check: %-Python + @diff -u -U 10 $(srcdir)/$*-Python-expected $*-Python && echo " TEST $*-Python" && rm -rf $*-Python + +check-local: $(CHECK_TARGETS) $(TYPELIBS) +clean-local: + @rm -rf $(MALLARD_DIRS) diff -Nru gobject-introspection-1.31.10/tests/doctool/Makefile.in gobject-introspection-1.31.20/tests/doctool/Makefile.in --- gobject-introspection-1.31.10/tests/doctool/Makefile.in 2012-01-19 22:12:11.000000000 +0000 +++ gobject-introspection-1.31.20/tests/doctool/Makefile.in 2012-03-05 14:47:03.000000000 +0000 @@ -22,6 +22,45 @@ # Makefile.introspection, but for use within the gobject-introspection # module itself. # + +# -*- Mode: make -*- +# Copyright 2009-2010 Johan Dahlin +# +# This file is free software; the author(s) gives unlimited +# permission to copy and/or distribute it, with or without +# modifications, as long as this notice is preserved. +# +# * Input variables: +# +# INTROSPECTION_GIRS - List of GIRS that should be generated +# INTROSPECTION_SCANNER - Command to invoke scanner, normally set by +# GOBJECT_INTROSPECTION_REQUIRE/CHECK() in introspection.m4 +# INTROSPECTION_SCANNER_ARGS - Additional args to pass in to the scanner +# INTROSPECTION_SCANNER_ENV - Environment variables to set before running +# the scanner +# INTROSPECTION_COMPILER - Command to invoke compiler, normally set by +# GOBJECT_INTROSPECTION_REQUIRE/CHECK() in introspection.m4 +# INTROSPECTION_COMPILER_ARGS - Additional args to pass in to the compiler +# +# * Simple tutorial +# +# Add this to configure.ac: +# -Wno-portability to AM_INIT_AUTOMAKE +# GOBJECT_INTROSPECTION_CHECK([0.6.7]) +# +# Add this to Makefile.am where your library/program is built: +# include $(INTROSPECTION_MAKEFILE) +# INTROSPECTION_GIRS = YourLib-1.0.gir +# YourLib_1_0_gir_NAMESPACE = YourLib +# YourLib_1_0_gir_VERSION = 1.0 +# YourLib_1_0_gir_LIBS = libyourlib.la +# YourLib_1_0_gir_FILES = $(libyourlib_1_0_SOURCES) +# girdir = $(datadir)/gir-1.0 +# dist_gir_DATA = YourLib-1.0.gir +# typelibdir = $(libdir)/girepository-1.0 +# typelib_DATA = YourLib-1.0.typelib +# CLEANFILES = $(dist_gir_DATA) $(typelib_DATA) +# VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ @@ -42,7 +81,7 @@ build_triplet = @build@ host_triplet = @host@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ - $(top_srcdir)/common.mk + $(top_srcdir)/Makefile.introspection $(top_srcdir)/common.mk subdir = tests/doctool ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/gtk-doc.m4 \ @@ -56,14 +95,42 @@ CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = -AM_V_GEN = $(am__v_GEN_$(V)) -am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY)) -am__v_GEN_0 = @echo " GEN " $@; +libdocexamples_la_LIBADD = +am_libdocexamples_la_OBJECTS = doc-examples-obj.lo +libdocexamples_la_OBJECTS = $(am_libdocexamples_la_OBJECTS) +AM_V_lt = $(am__v_lt_$(V)) +am__v_lt_ = $(am__v_lt_$(AM_DEFAULT_VERBOSITY)) +am__v_lt_0 = --silent +DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) +depcomp = $(SHELL) $(top_srcdir)/build-aux/depcomp +am__depfiles_maybe = depfiles +am__mv = mv -f +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CFLAGS) $(CFLAGS) +AM_V_CC = $(am__v_CC_$(V)) +am__v_CC_ = $(am__v_CC_$(AM_DEFAULT_VERBOSITY)) +am__v_CC_0 = @echo " CC " $@; AM_V_at = $(am__v_at_$(V)) am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY)) am__v_at_0 = @ -SOURCES = -DIST_SOURCES = +CCLD = $(CC) +LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +AM_V_CCLD = $(am__v_CCLD_$(V)) +am__v_CCLD_ = $(am__v_CCLD_$(AM_DEFAULT_VERBOSITY)) +am__v_CCLD_0 = @echo " CCLD " $@; +AM_V_GEN = $(am__v_GEN_$(V)) +am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY)) +am__v_GEN_0 = @echo " GEN " $@; +SOURCES = $(libdocexamples_la_SOURCES) +DIST_SOURCES = $(libdocexamples_la_SOURCES) +ETAGS = etags +CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ @@ -141,7 +208,7 @@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBOBJS = @LIBOBJS@ -LIBS = @LIBS@ +LIBS = $(GOBJECT_LIBS) LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ @@ -249,14 +316,11 @@ UNINSTALLED_INTROSPECTION_BUILDDIR=$(top_builddir) \ $(top_builddir)/g-ir-scanner -INTROSPECTION_SCANNER_ARGS = \ - --verbose \ - -I$(top_srcdir) \ - --add-include-path=$(srcdir) \ - --add-include-path=$(top_srcdir)/gir \ - --add-include-path=$(builddir) \ - --add-include-path=$(top_builddir) - +INTROSPECTION_SCANNER_ARGS = --verbose -I$(top_srcdir) \ + --add-include-path=$(srcdir) \ + --add-include-path=$(top_srcdir)/gir \ + --add-include-path=$(builddir) \ + --add-include-path=$(top_builddir) --warn-all --warn-error -I. INTROSPECTION_COMPILER = \ env PATH=.libs:$(PATH) \ $(top_builddir)/g-ir-compiler$(EXEEXT) @@ -275,10 +339,66 @@ UNINSTALLED_INTROSPECTION_BUILDDIR=$(top_builddir) \ $(top_builddir)/g-ir-doc-tool -all: all-am + +# Private functions +_gir_name = $(subst /,_,$(subst -,_,$(subst .,_,$(1)))) + +# Namespace and Version is either fetched from the gir filename +# or the _NAMESPACE/_VERSION variable combo +_gir_namespace = $(or $($(_gir_name)_NAMESPACE),$(firstword $(subst -, ,$(notdir $(1))))) +_gir_version = $(or $($(_gir_name)_VERSION),$(lastword $(subst -, ,$(1:.gir=)))) + +# _PROGRAM is an optional variable which needs it's own --program argument +_gir_program = $(if $($(_gir_name)_PROGRAM),--program=$($(_gir_name)_PROGRAM)) + +# Variables which provides a list of things +_gir_libraries = $(foreach lib,$($(_gir_name)_LIBS),--library=$(lib)) +_gir_packages = $(foreach pkg,$($(_gir_name)_PACKAGES),--pkg=$(pkg)) +_gir_includes = $(foreach include,$($(_gir_name)_INCLUDES),--include=$(include)) +_gir_export_packages = $(foreach pkg,$($(_gir_name)_EXPORT_PACKAGES),--pkg-export=$(pkg)) + +# Reuse the LIBTOOL variable from automake if it's set, but +# work around MSYS weirdness: When running g-ir-scanner, MSYS changes +# a command-line argument --libtool="/bin/sh ../../libtool" into +# --libtool=c:/opt/msys/1.0/bin/libtool. So just use sh.exe without path +# because we already "know" where the libtool configure produced is. +_gir_libtool = $(if $(findstring MINGW32,$(shell uname -s)),--libtool="$(top_builddir)/libtool",$(if $(LIBTOOL),--libtool="$(LIBTOOL)")) + +# Macros for AM_SILENT_RULES prettiness +_gir_verbosity = $(if $(AM_DEFAULT_VERBOSITY),$(AM_DEFAULT_VERBOSITY),1) +_gir_silent_scanner_prefix = $(_gir_silent_scanner_prefix_$(V)) +_gir_silent_scanner_prefix_ = $(_gir_silent_scanner_prefix_$(_gir_verbosity)) +_gir_silent_scanner_prefix_0 = @echo " GISCAN $(1)"; +_gir_silent_scanner_opts = $(_gir_silent_scanner_opts_$(V)) +_gir_silent_scanner_opts_ = $(_gir_silent_scanner_opts_$(_gir_verbosity)) +_gir_silent_scanner_opts_0 = --quiet +_gir_silent_compiler = $(_gir_silent_compiler_$(V)) +_gir_silent_compiler_ = $(_gir_silent_compiler_$(_gir_verbosity)) +_gir_silent_compiler_0 = @echo " GICOMP $(1)"; +check_LTLIBRARIES = \ + libdocexamples.la + +AM_CFLAGS = $(GOBJECT_CFLAGS) +libdocexamples_la_SOURCES = $(srcdir)/doc-examples-obj.c $(srcdir)/doc-examples-obj.h +#DocExamples_1_0_gir_SCANNERFLAGS = --c-include="regress.h" +GIRS = DocExamples-1.0.gir +TYPELIBS = $(GIRS:.gir=.typelib) +INTROSPECTION_GIRS = $(GIRS) +CHECK_TARGETS = $(GIRS:.gir=-C.page.check) $(GIRS:.gir=-Python.page.check) +MALLARD_DIRS = $(GIRS:.gir=-C) $(GIRS:.gir=-Python) +EXPECTED_MALLARD_DIRS = $(MALLARD_DIRS:=-expected) +CLEANFILES = $(TYPELIBS) $(GIRS) +BUILT_SOURCES = $(MALLARD_DIRS) +EXTRA_DIST = $(EXPECTED_MALLARD_DIRS) +DocExamples_1_0_gir_LIBS = libdocexamples.la +DocExamples_1_0_gir_INCLUDES = cairo-1.0 Gio-2.0 +DocExamples_1_0_gir_FILES = $(libdocexamples_la_SOURCES) +all: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) all-am .SUFFIXES: -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/common.mk $(am__configure_deps) +.SUFFIXES: .c .lo .o .obj +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/common.mk $(top_srcdir)/Makefile.introspection $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ @@ -309,17 +429,114 @@ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): +clean-checkLTLIBRARIES: + -test -z "$(check_LTLIBRARIES)" || rm -f $(check_LTLIBRARIES) + @list='$(check_LTLIBRARIES)'; for p in $$list; do \ + dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ + test "$$dir" != "$$p" || dir=.; \ + echo "rm -f \"$${dir}/so_locations\""; \ + rm -f "$${dir}/so_locations"; \ + done +libdocexamples.la: $(libdocexamples_la_OBJECTS) $(libdocexamples_la_DEPENDENCIES) + $(AM_V_CCLD)$(LINK) $(libdocexamples_la_OBJECTS) $(libdocexamples_la_LIBADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/doc-examples-obj.Plo@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c $< + +.c.obj: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` + +.c.lo: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< + +doc-examples-obj.lo: $(srcdir)/doc-examples-obj.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT doc-examples-obj.lo -MD -MP -MF $(DEPDIR)/doc-examples-obj.Tpo -c -o doc-examples-obj.lo `test -f '$(srcdir)/doc-examples-obj.c' || echo '$(srcdir)/'`$(srcdir)/doc-examples-obj.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/doc-examples-obj.Tpo $(DEPDIR)/doc-examples-obj.Plo +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$(srcdir)/doc-examples-obj.c' object='doc-examples-obj.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o doc-examples-obj.lo `test -f '$(srcdir)/doc-examples-obj.c' || echo '$(srcdir)/'`$(srcdir)/doc-examples-obj.c + mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique tags: TAGS -TAGS: +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + set x; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi ctags: CTAGS -CTAGS: +CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ @@ -352,10 +569,14 @@ fi; \ done check-am: all-am -check: check-am + $(MAKE) $(AM_MAKEFLAGS) $(check_LTLIBRARIES) + $(MAKE) $(AM_MAKEFLAGS) check-local +check: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) check-am all-am: Makefile installdirs: -install: install-am +install: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am @@ -372,6 +593,7 @@ mostlyclean-generic: clean-generic: + -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) @@ -380,13 +602,17 @@ maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." + -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) clean: clean-am -clean-am: clean-generic clean-libtool mostlyclean-am +clean-am: clean-checkLTLIBRARIES clean-generic clean-libtool \ + clean-local mostlyclean-am distclean: distclean-am + -rm -rf ./$(DEPDIR) -rm -f Makefile -distclean-am: clean-am distclean-generic +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags dvi: dvi-am @@ -429,12 +655,14 @@ installcheck-am: maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am -mostlyclean-am: mostlyclean-generic mostlyclean-libtool +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool pdf: pdf-am @@ -446,48 +674,124 @@ uninstall-am: -.MAKE: install-am install-strip +.MAKE: all check check-am install install-am install-strip -.PHONY: all all-am check check-am clean clean-generic clean-libtool \ - distclean distclean-generic distclean-libtool distdir dvi \ - dvi-am html html-am info info-am install install-am \ - install-data install-data-am install-dvi install-dvi-am \ - install-exec install-exec-am install-html install-html-am \ - install-info install-info-am install-man install-pdf \ - install-pdf-am install-ps install-ps-am install-strip \ - installcheck installcheck-am installdirs maintainer-clean \ - maintainer-clean-generic mostlyclean mostlyclean-generic \ - mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am +.PHONY: CTAGS GTAGS all all-am check check-am check-local clean \ + clean-checkLTLIBRARIES clean-generic clean-libtool clean-local \ + ctags distclean distclean-compile distclean-generic \ + distclean-libtool distclean-tags distdir dvi dvi-am html \ + html-am info info-am install install-am install-data \ + install-data-am install-dvi install-dvi-am install-exec \ + install-exec-am install-html install-html-am install-info \ + install-info-am install-man install-pdf install-pdf-am \ + install-ps install-ps-am install-strip installcheck \ + installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-compile \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + tags uninstall uninstall-am + + +# Make sure the required variables are set, these should under normal +# circumstances come from introspection.m4 +$(if $(INTROSPECTION_SCANNER),,$(error Need to define INTROSPECTION_SCANNER)) +$(if $(INTROSPECTION_COMPILER),,$(error Need to define INTROSPECTION_COMPILER)) +# +# Creates a GIR by scanning C headers/sources +# $(1) - Name of the gir file (output) +# +# If output is Gtk-2.0.gir then you should name the variables like +# Gtk_2_0_gir_NAMESPACE, Gtk_2_0_gir_VERSION etc. +# Required variables: +# FILES - C sources and headers which should be scanned +# +# One of these variables are required: +# LIBS - Library where the symbol represented in the gir can be found +# PROGRAM - Program where the symbol represented in the gir can be found +# +# Optional variables +# NAMESPACE - Namespace of the gir, first letter capital, +# rest should be lower case, for instance: 'Gtk', 'Clutter', 'ClutterGtk'. +# If not present the namespace will be fetched from the gir filename, +# the part before the first dash. For 'Gtk-2.0', namespace will be 'Gtk'. +# VERSION - Version of the gir, if not present, will be fetched from gir +# filename, the part after the first dash. For 'Gtk-2.0', version will be '2.0'. +# LIBTOOL - Command to invoke libtool, usually set by automake +# SCANNERFLAGS - Flags to pass in to the scanner, see g-ir-scanner(1) for a list +# CFLAGS - Flags to pass in to the parser when scanning headers +# LDFLAGS - Linker flags used by the scanner +# PACKAGES - list of pkg-config names which cflags are required to parse +# the headers of this gir +# INCLUDES - Gir files to include without the .gir suffix, for instance +# GLib-2.0, Gtk-2.0. This is needed for all libraries which you depend on that +# provides introspection information. +# EXPORT_PACKAGES - list of pkg-config names that are provided by this gir. +# By default the names in the PACKAGES variable will be used. +# -# Disabled temporarily +define introspection-scanner -# GIRS = GIRepository-2.0.gir -# CHECK_TARGETS = $(GIRS:.gir=-C.page.check) $(GIRS:.gir=-Python.page.check) -# MALLARD_DIRS = $(GIRS:.gir=-C) $(GIRS:.gir=-Python) -# EXPECTED_MALLARD_DIRS = $(MALLARD_DIRS:=-expected) -# CLEANFILES = $(GIRS) -# EXTRA_DIST = $(EXPECTED_MALLARD_DIRS) +# Basic sanity check, to make sure required variables are set +$(if $($(_gir_name)_FILES),,$(error Need to define $(_gir_name)_FILES)) +$(if $(or $(findstring --header-only,$($(_gir_name)_SCANNERFLAGS)), + $($(_gir_name)_LIBS), + $($(_gir_name)_PROGRAM)),, + $(error Need to define $(_gir_name)_LIBS or $(_gir_name)_PROGRAM)) + +# Only dependencies we know are actually filenames goes into _FILES, make +# sure these are built before running the scanner. Libraries and programs +# needs to be added manually. +$(1): $$($(_gir_name)_FILES) + @ $(MKDIR_P) $(dir $(1)) + $(_gir_silent_scanner_prefix) $(INTROSPECTION_SCANNER_ENV) $(INTROSPECTION_SCANNER) $(_gir_silent_scanner_opts) \ + $(INTROSPECTION_SCANNER_ARGS) \ + --namespace=$(_gir_namespace) \ + --nsversion=$(_gir_version) \ + $(_gir_libtool) \ + $(_gir_packages) \ + $(_gir_includes) \ + $(_gir_export_packages) \ + $(_gir_program) \ + $(_gir_libraries) \ + $($(_gir_name)_SCANNERFLAGS) \ + $($(_gir_name)_CFLAGS) \ + $($(_gir_name)_LDFLAGS) \ + $$^ \ + --output $(1) +endef + +$(foreach gir,$(INTROSPECTION_GIRS),$(eval $(call introspection-scanner,$(gir)))) + +# +# Compiles a gir into a typelib +# $(1): gir filename (input) +# $(2): typelib filename (output) +# +define introspection-compiler +$(_gir_silent_compiler) $(INTROSPECTION_COMPILER) $(INTROSPECTION_COMPILER_ARGS) --includedir=. $(1) -o $(2) +endef -# %.gir: -# cp ../../$*.gir . +# Simple rule to compile a typelib. +%.typelib: %.gir + $(call introspection-compiler,$<,$@) -# %-C: %.gir -# mkdir $*-C ; rm $*-C/*.page ; $(INTROSPECTION_DOCTOOL) --language C --format mallard $*.gir -o $*-C/index.page && echo " GEN $*-C/index.page" +DocExamples-1.0.gir: $(top_builddir)/Gio-2.0.gir libdocexamples.la -# %-Python: %.gir -# mkdir $*-Python ; rm $*-Python/*.page ; $(INTROSPECTION_DOCTOOL) --language Python --format mallard $*.gir -o $*-Python/index.page && echo " GEN $*-Python/index.page" +%-C: %.gir + mkdir $*-C ; rm $*-C/*.page ; $(INTROSPECTION_DOCTOOL) --language C $*.gir -o $*-C/ && echo " GEN $*-C/index.page" -# %-C.page.check: %-C -# @diff -u -U 10 $(srcdir)/$*-C-expected $*-C && echo " TEST $*-C" && rm -rf $*-C +%-Python: %.gir + mkdir $*-Python ; rm $*-Python/*.page ; $(INTROSPECTION_DOCTOOL) --language Python $*.gir -o $*-Python/ && echo " GEN $*-Python/index.page" -# %-Python.page.check: %-Python -# @diff -u -U 10 $(srcdir)/$*-Python-expected $*-Python && echo " TEST $*-Python" && rm -rf $*-Python +%-C.page.check: %-C + @diff -u -U 10 $(srcdir)/$*-C-expected $*-C && echo " TEST $*-C" && rm -rf $*-C -# check-local: $(CHECK_TARGETS) +%-Python.page.check: %-Python + @diff -u -U 10 $(srcdir)/$*-Python-expected $*-Python && echo " TEST $*-Python" && rm -rf $*-Python -# clean-local: -# @rm -rf $(MALLARD_DIRS) +check-local: $(CHECK_TARGETS) $(TYPELIBS) +clean-local: + @rm -rf $(MALLARD_DIRS) # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. diff -Nru gobject-introspection-1.31.10/tests/gimarshallingtests.c gobject-introspection-1.31.20/tests/gimarshallingtests.c --- gobject-introspection-1.31.10/tests/gimarshallingtests.c 2012-01-11 20:57:34.000000000 +0000 +++ gobject-introspection-1.31.20/tests/gimarshallingtests.c 2012-02-16 16:24:41.000000000 +0000 @@ -1,4 +1,4 @@ -/* -*- Mode: C; c-basic-offset: 4 -*- +/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- * vim: tabstop=4 shiftwidth=4 expandtab */ @@ -995,12 +995,25 @@ return G_TYPE_NONE; } +GType +gi_marshalling_tests_gtype_string_return (void) +{ + return G_TYPE_STRING; +} + void gi_marshalling_tests_gtype_in (GType gtype) { g_assert(gtype == G_TYPE_NONE); } +void +gi_marshalling_tests_gtype_string_in (GType gtype) +{ + g_assert(gtype == G_TYPE_STRING); +} + + /** * gi_marshalling_tests_gtype_out: * @gtype: (out): @@ -1012,6 +1025,16 @@ } /** + * gi_marshalling_tests_gtype_string_out: + * @gtype: (out): + */ +void +gi_marshalling_tests_gtype_string_out (GType *gtype) +{ + *gtype = G_TYPE_STRING; +} + +/** * gi_marshalling_tests_gtype_inout: * @gtype: (inout): */ @@ -2877,6 +2900,17 @@ } /** + * gi_marshalling_tests_gvalue_in_with_type: + * @value: (transfer none): + * @type: + */ +void +gi_marshalling_tests_gvalue_in_with_type (GValue *value, GType type) +{ + g_assert(g_type_is_a(G_VALUE_TYPE(value), type)); +} + +/** * gi_marshalling_tests_gvalue_in_enum: * @value: (transfer none): */ @@ -3034,6 +3068,71 @@ return closure; } + +/** + * gi_marshalling_tests_callback_return_value_only: + * @callback: (scope call): + */ +glong +gi_marshalling_tests_callback_return_value_only (GIMarshallingTestsCallbackReturnValueOnly callback) +{ + return callback (); +} + +/** + * gi_marshalling_tests_callback_one_out_parameter: + * @callback: (scope call): + * @a: (out): + */ +void +gi_marshalling_tests_callback_one_out_parameter (GIMarshallingTestsCallbackOneOutParameter callback, + gfloat *a) +{ + callback (a); +} + +/** + * gi_marshalling_tests_callback_multiple_out_parameters: + * @callback: (scope call): + * @a: (out): + * @b: (out): + */ +void +gi_marshalling_tests_callback_multiple_out_parameters (GIMarshallingTestsCallbackMultipleOutParameters callback, + gfloat *a, + gfloat *b) +{ + callback (a, b); +} + +/** + * gi_marshalling_tests_callback_return_value_and_one_out_parameter: + * @callback: (scope call): + * @a: (out): + */ +glong +gi_marshalling_tests_callback_return_value_and_one_out_parameter (GIMarshallingTestsCallbackReturnValueAndOneOutParameter callback, + glong *a) +{ + return callback (a); +} + +/** + * gi_marshalling_tests_callback_return_value_and_multiple_out_parameters: + * @callback: (scope call): + * @a: (out): + * @b: (out): + */ +glong +gi_marshalling_tests_callback_return_value_and_multiple_out_parameters (GIMarshallingTestsCallbackReturnValueAndMultipleOutParameters callback, + glong *a, + glong *b) +{ + return callback (a, b); +} + + + /** * gi_marshalling_tests_pointer_in_return: * @@ -3787,6 +3886,87 @@ gi_marshalling_tests_object_method_int8_out (object, out); } +/** + * gi_marshalling_tests_object_vfunc_return_value_only: + */ +glong +gi_marshalling_tests_object_vfunc_return_value_only (GIMarshallingTestsObject *self) +{ + /* make sure that local variables don't get smashed */ + glong return_value; + gulong local = 0x12345678; + return_value = GI_MARSHALLING_TESTS_OBJECT_GET_CLASS (self)->vfunc_return_value_only (self); + g_assert_cmpint(local, ==, 0x12345678); + return return_value; +} + +/** + * gi_marshalling_tests_object_vfunc_one_out_parameter: + * @a: (out): + */ +void +gi_marshalling_tests_object_vfunc_one_out_parameter (GIMarshallingTestsObject *self, gfloat *a) +{ + /* make sure that local variables don't get smashed */ + gulong local = 0x12345678; + GI_MARSHALLING_TESTS_OBJECT_GET_CLASS (self)->vfunc_one_out_parameter (self, a); + g_assert_cmpint(local, ==, 0x12345678); +} + +/** + * gi_marshalling_tests_object_vfunc_multiple_out_parameters: + * @a: (out): + * @b: (out): + */ +void +gi_marshalling_tests_object_vfunc_multiple_out_parameters (GIMarshallingTestsObject *self, gfloat *a, gfloat *b) +{ + /* make sure that local variables don't get smashed */ + gulong local = 0x12345678; + GI_MARSHALLING_TESTS_OBJECT_GET_CLASS (self)->vfunc_multiple_out_parameters (self, a, b); + g_assert_cmpint(local, ==, 0x12345678); +} + +/** + * gi_marshalling_tests_object_vfunc_return_value_and_one_out_parameter: + * @a: (out): + */ +glong +gi_marshalling_tests_object_vfunc_return_value_and_one_out_parameter (GIMarshallingTestsObject *self, glong *a) +{ + /* make sure that local variables don't get smashed */ + gulong return_value; + gulong local = 0x12345678; + return_value = GI_MARSHALLING_TESTS_OBJECT_GET_CLASS (self)->vfunc_return_value_and_one_out_parameter (self, a); + g_assert_cmpint(local, ==, 0x12345678); + return return_value; +} + +/** + * gi_marshalling_tests_object_vfunc_return_value_and_multiple_out_parameters: + * @a: (out): + * @b: (out): + */ +glong +gi_marshalling_tests_object_vfunc_return_value_and_multiple_out_parameters (GIMarshallingTestsObject *self, glong *a, glong *b) +{ + gulong return_value; + gulong local = 0x12345678; + return_value = GI_MARSHALLING_TESTS_OBJECT_GET_CLASS (self)->vfunc_return_value_and_multiple_out_parameters (self, a, b); + g_assert_cmpint(local, ==, 0x12345678); + return return_value; +} + +gboolean +gi_marshalling_tests_object_vfunc_meth_with_error (GIMarshallingTestsObject *self, + gint x, + GError **error) +{ + gulong local = 0x12345678; + gboolean ret = GI_MARSHALLING_TESTS_OBJECT_GET_CLASS (self)->vfunc_meth_with_err (self, x, error); + g_assert_cmpint(local, ==, 0x12345678); + return ret; +} G_DEFINE_TYPE (GIMarshallingTestsSubObject, gi_marshalling_tests_sub_object, GI_MARSHALLING_TESTS_TYPE_OBJECT); @@ -3972,6 +4152,63 @@ GI_MARSHALLING_TESTS_CONSTANT_GERROR_MESSAGE); } +/** + * gi_marshalling_tests_gerror_out: + * @error: (out) (allow-none) (transfer full): location for the GError. + * @debug: (out) (allow-none) (transfer full): location for the debug message + * + * Inspired by gst_message_parse_error. + */ +void +gi_marshalling_tests_gerror_out(GError **error, gchar **debug) +{ + GQuark quark = g_quark_from_static_string(GI_MARSHALLING_TESTS_CONSTANT_GERROR_DOMAIN); + g_set_error_literal(error, + quark, + GI_MARSHALLING_TESTS_CONSTANT_GERROR_CODE, + GI_MARSHALLING_TESTS_CONSTANT_GERROR_MESSAGE); + + if (debug != NULL) { + *debug = g_strdup (GI_MARSHALLING_TESTS_CONSTANT_GERROR_DEBUG_MESSAGE); + } +} + +/** + * gi_marshalling_tests_gerror_out_transfer_none: + * @err: (out) (allow-none) (transfer none): location for the GError. + * @debug: (out) (allow-none) (transfer none): location for the debug message + * + * A variant of gi_marshalling_tests_gerror_out() which returns data the caller + * must not free. + */ +void +gi_marshalling_tests_gerror_out_transfer_none(GError **err, const gchar **debug) +{ + static GError error = { 0, + GI_MARSHALLING_TESTS_CONSTANT_GERROR_CODE, + GI_MARSHALLING_TESTS_CONSTANT_GERROR_MESSAGE }; + error.domain = g_quark_from_static_string(GI_MARSHALLING_TESTS_CONSTANT_GERROR_DOMAIN); + *err = &error; + *debug = GI_MARSHALLING_TESTS_CONSTANT_GERROR_DEBUG_MESSAGE; +} + +/** + * gi_marshalling_tests_gerror_return: + * + * Yet another variant of gi_marshalling_tests_gerror_out(). + * + * Returns: (transfer full): a GError + */ +GError * +gi_marshalling_tests_gerror_return(void) +{ + GQuark quark = g_quark_from_static_string(GI_MARSHALLING_TESTS_CONSTANT_GERROR_DOMAIN); + + return g_error_new(quark, + GI_MARSHALLING_TESTS_CONSTANT_GERROR_CODE, + GI_MARSHALLING_TESTS_CONSTANT_GERROR_MESSAGE); +} + static GIMarshallingTestsOverridesStruct * gi_marshalling_tests_overrides_struct_copy (GIMarshallingTestsOverridesStruct *struct_) { @@ -4065,7 +4302,6 @@ return 42; } - /** * gi_marshalling_tests_overrides_object_returnv: * @@ -4088,3 +4324,181 @@ return NULL; } + +enum { + DUMMY_PROPERTY, + SOME_BOOLEAN_PROPERTY, + SOME_CHAR_PROPERTY, + SOME_UCHAR_PROPERTY, + SOME_INT_PROPERTY, + SOME_UINT_PROPERTY, + SOME_LONG_PROPERTY, + SOME_ULONG_PROPERTY, + SOME_INT64_PROPERTY, + SOME_UINT64_PROPERTY, + SOME_FLOAT_PROPERTY, + SOME_DOUBLE_PROPERTY +}; + +G_DEFINE_TYPE (GIMarshallingTestsPropertiesObject, gi_marshalling_tests_properties_object, G_TYPE_OBJECT); + +static void +gi_marshalling_tests_properties_object_init (GIMarshallingTestsPropertiesObject * self) +{ +} + +static void +gi_marshalling_tests_properties_object_finalize (GObject* obj) +{ + G_OBJECT_CLASS (gi_marshalling_tests_properties_object_parent_class)->finalize (obj); +} + +static void +gi_marshalling_tests_properties_object_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) +{ + GIMarshallingTestsPropertiesObject * self; + self = GI_MARSHALLING_TESTS_PROPERTIES_OBJECT (object); + switch (property_id) { + case SOME_BOOLEAN_PROPERTY: + g_value_set_boolean (value, self->some_boolean); + break; + case SOME_CHAR_PROPERTY: + g_value_set_schar (value, self->some_char); + break; + case SOME_UCHAR_PROPERTY: + g_value_set_uchar (value, self->some_uchar); + break; + case SOME_INT_PROPERTY: + g_value_set_int (value, self->some_int); + break; + case SOME_UINT_PROPERTY: + g_value_set_uint (value, self->some_uint); + break; + case SOME_LONG_PROPERTY: + g_value_set_long (value, self->some_long); + break; + case SOME_ULONG_PROPERTY: + g_value_set_ulong (value, self->some_ulong); + break; + case SOME_INT64_PROPERTY: + g_value_set_int64 (value, self->some_int64); + break; + case SOME_UINT64_PROPERTY: + g_value_set_uint64 (value, self->some_uint64); + break; + case SOME_FLOAT_PROPERTY: + g_value_set_float (value, self->some_float); + break; + case SOME_DOUBLE_PROPERTY: + g_value_set_double (value, self->some_double); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + break; + } +} + +static void +gi_marshalling_tests_properties_object_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec) +{ + GIMarshallingTestsPropertiesObject * self; + self = GI_MARSHALLING_TESTS_PROPERTIES_OBJECT (object); + switch (property_id) { + case SOME_BOOLEAN_PROPERTY: + self->some_boolean = g_value_get_boolean (value); + break; + case SOME_CHAR_PROPERTY: + self->some_char = g_value_get_schar (value); + break; + case SOME_UCHAR_PROPERTY: + self->some_uchar = g_value_get_uchar (value); + break; + case SOME_INT_PROPERTY: + self->some_int = g_value_get_int (value); + break; + case SOME_UINT_PROPERTY: + self->some_uint = g_value_get_uint (value); + break; + case SOME_LONG_PROPERTY: + self->some_long = g_value_get_long (value); + break; + case SOME_ULONG_PROPERTY: + self->some_ulong = g_value_get_ulong (value); + break; + case SOME_INT64_PROPERTY: + self->some_int64 = g_value_get_int64 (value); + break; + case SOME_UINT64_PROPERTY: + self->some_uint64 = g_value_get_uint64 (value); + break; + case SOME_FLOAT_PROPERTY: + self->some_float = g_value_get_float (value); + break; + case SOME_DOUBLE_PROPERTY: + self->some_double = g_value_get_double (value); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + break; + } +} + +static void +gi_marshalling_tests_properties_object_class_init (GIMarshallingTestsPropertiesObjectClass * klass) +{ + GObjectClass* object_class = G_OBJECT_CLASS (klass); + + object_class->finalize = gi_marshalling_tests_properties_object_finalize; + object_class->get_property = gi_marshalling_tests_properties_object_get_property; + object_class->set_property = gi_marshalling_tests_properties_object_set_property; + + g_object_class_install_property (object_class, SOME_BOOLEAN_PROPERTY, + g_param_spec_boolean ("some-boolean", "some-boolean", "some-boolean", FALSE, + G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT)); + + g_object_class_install_property (object_class, SOME_CHAR_PROPERTY, + g_param_spec_char ("some-char", "some-char", "some-char", G_MININT8, G_MAXINT8, 0, + G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT)); + + g_object_class_install_property (object_class, SOME_UCHAR_PROPERTY, + g_param_spec_uchar ("some-uchar", "some-uchar", "some-uchar", 0, G_MAXUINT8, 0, + G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT)); + + g_object_class_install_property (object_class, SOME_INT_PROPERTY, + g_param_spec_int ("some-int", "some-int", "some-int", G_MININT, G_MAXINT, 0, + G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT)); + + g_object_class_install_property (object_class, SOME_UINT_PROPERTY, + g_param_spec_uint ("some-uint", "some-uint", "some-uint", 0, G_MAXUINT, 0, + G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT)); + + g_object_class_install_property (object_class, SOME_LONG_PROPERTY, + g_param_spec_long ("some-long", "some-long", "some-long", G_MINLONG, G_MAXLONG, 0, + G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT)); + + g_object_class_install_property (object_class, SOME_ULONG_PROPERTY, + g_param_spec_ulong ("some-ulong", "some-ulong", "some-ulong", 0, G_MAXULONG, 0, + G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT)); + + g_object_class_install_property (object_class, SOME_INT64_PROPERTY, + g_param_spec_int64 ("some-int64", "some-int64", "some-int64", G_MININT64, G_MAXINT64, 0, + G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT)); + + g_object_class_install_property (object_class, SOME_UINT64_PROPERTY, + g_param_spec_uint64 ("some-uint64", "some-uint64", "some-uint64", 0, G_MAXUINT64, 0, + G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT)); + + g_object_class_install_property (object_class, SOME_FLOAT_PROPERTY, + g_param_spec_float ("some-float", "some-float", "some-float", -1 * G_MAXFLOAT, G_MAXFLOAT, 0, + G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT)); + + g_object_class_install_property (object_class, SOME_DOUBLE_PROPERTY, + g_param_spec_double ("some-double", "some-double", "some-double", -1 * G_MAXDOUBLE, G_MAXDOUBLE, 0, + G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT)); +} + +GIMarshallingTestsPropertiesObject* +gi_marshalling_tests_properties_object_new (void) +{ + return g_object_new (GI_MARSHALLING_TESTS_TYPE_PROPERTIES_OBJECT, NULL); +} diff -Nru gobject-introspection-1.31.10/tests/gimarshallingtests.h gobject-introspection-1.31.20/tests/gimarshallingtests.h --- gobject-introspection-1.31.10/tests/gimarshallingtests.h 2012-01-11 20:57:34.000000000 +0000 +++ gobject-introspection-1.31.20/tests/gimarshallingtests.h 2012-02-16 16:24:41.000000000 +0000 @@ -1,4 +1,4 @@ -/* -*- Mode: C; c-basic-offset: 4 -*- +/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- * vim: tabstop=4 shiftwidth=4 expandtab */ @@ -236,10 +236,16 @@ GType gi_marshalling_tests_gtype_return (void); +GType gi_marshalling_tests_gtype_string_return (void); + void gi_marshalling_tests_gtype_in (GType gtype); +void gi_marshalling_tests_gtype_string_in (GType gtype); + void gi_marshalling_tests_gtype_out (GType *gtype); +void gi_marshalling_tests_gtype_string_out (GType *gtype); + void gi_marshalling_tests_gtype_inout (GType *gtype); @@ -520,6 +526,7 @@ GValue *gi_marshalling_tests_gvalue_return (void); void gi_marshalling_tests_gvalue_in (GValue *value); +void gi_marshalling_tests_gvalue_in_with_type (GValue *value, GType type); void gi_marshalling_tests_gvalue_in_enum (GValue *value); @@ -541,6 +548,55 @@ void gi_marshalling_tests_gclosure_in (GClosure *closure); GClosure *gi_marshalling_tests_gclosure_return (void); +/* Callback return values */ + +/** + * GIMarshallingTestsCallbackReturnValueOnly: + */ +typedef glong (* GIMarshallingTestsCallbackReturnValueOnly) (); + +glong gi_marshalling_tests_callback_return_value_only (GIMarshallingTestsCallbackReturnValueOnly callback); + +/** + * GIMarshallingTestsCallbackOneOutParameter: + * @a: (out): + */ +typedef void (* GIMarshallingTestsCallbackOneOutParameter) (gfloat *a); + +void gi_marshalling_tests_callback_one_out_parameter (GIMarshallingTestsCallbackOneOutParameter callback, + gfloat *a); + +/** + * GIMarshallingTestsCallbackMultipleOutParameters: + * @a: (out): + * @b: (out): + */ +typedef void (* GIMarshallingTestsCallbackMultipleOutParameters) (gfloat *a, gfloat *b); + +void gi_marshalling_tests_callback_multiple_out_parameters (GIMarshallingTestsCallbackMultipleOutParameters callback, + gfloat *a, + gfloat *b); + +/** + * GIMarshallingTestsCallbackReturnValueAndOneOutParameter: + * @a: (out): + */ +typedef glong (* GIMarshallingTestsCallbackReturnValueAndOneOutParameter) (glong *a); + +glong gi_marshalling_tests_callback_return_value_and_one_out_parameter (GIMarshallingTestsCallbackReturnValueAndOneOutParameter callback, + glong *a); + +/** + * GIMarshallingTestsCallbackReturnValueAndMultipleOutParameters: + * @a: (out): + * @b: (out): + */ +typedef glong (* GIMarshallingTestsCallbackReturnValueAndMultipleOutParameters) (glong *a, glong *b); + +glong gi_marshalling_tests_callback_return_value_and_multiple_out_parameters (GIMarshallingTestsCallbackReturnValueAndMultipleOutParameters callback, + glong *a, + glong *b); + /* Pointer */ gpointer gi_marshalling_tests_pointer_in_return (gpointer pointer); @@ -611,7 +667,7 @@ void gi_marshalling_tests_union_method (GIMarshallingTestsUnion *union_); -/* Object */ + /* Object */ #define GI_MARSHALLING_TESTS_TYPE_OBJECT (gi_marshalling_tests_object_get_type ()) #define GI_MARSHALLING_TESTS_OBJECT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GI_MARSHALLING_TESTS_TYPE_OBJECT, GIMarshallingTestsObject)) @@ -650,6 +706,44 @@ * @in: (in): */ void (* method_deep_hierarchy) (GIMarshallingTestsObject *self, gint8 in); + + /** + * GIMarshallingTestsObjectClass::vfunc_return_value_only: + */ + glong (* vfunc_return_value_only) (GIMarshallingTestsObject *self); + + /** + * GIMarshallingTestsObjectClass::vfunc_one_out_parameter: + * @a: (out): + */ + void (* vfunc_one_out_parameter) (GIMarshallingTestsObject *self, gfloat *a); + + /** + * GIMarshallingTestsObjectClass::vfunc_multiple_out_parameters: + * @a: (out): + * @b: (out): + */ + void (* vfunc_multiple_out_parameters) (GIMarshallingTestsObject *self, gfloat *a, gfloat *b); + + /** + * GIMarshallingTestsObjectClass::vfunc_return_value_and_one_out_parameter: + * @a: (out): + */ + glong (* vfunc_return_value_and_one_out_parameter) (GIMarshallingTestsObject *self, glong *a); + + /** + * GIMarshallingTestsObjectClass::vfunc_return_value_and_multiple_out_parameters: + * @a: (out): + * @b: (out): + */ + glong (* vfunc_return_value_and_multiple_out_parameters) (GIMarshallingTestsObject *self, glong *a, glong *b); + + /** + * GIMarshallingTestsObjectClass::vfunc_meth_with_err: + * @x: + * @error: A #GError + */ + gboolean (*vfunc_meth_with_err) (GIMarshallingTestsObject *object, gint x, GError **error); }; struct _GIMarshallingTestsObject @@ -674,6 +768,12 @@ void gi_marshalling_tests_object_method_int8_out (GIMarshallingTestsObject *object, gint8 *out); void gi_marshalling_tests_object_method_with_default_implementation (GIMarshallingTestsObject *object, gint8 in); +glong gi_marshalling_tests_object_vfunc_return_value_only (GIMarshallingTestsObject *self); +void gi_marshalling_tests_object_vfunc_one_out_parameter (GIMarshallingTestsObject *self, gfloat *a); +void gi_marshalling_tests_object_vfunc_multiple_out_parameters (GIMarshallingTestsObject *self, gfloat *a, gfloat *b); +glong gi_marshalling_tests_object_vfunc_return_value_and_one_out_parameter (GIMarshallingTestsObject *self, glong *a); +glong gi_marshalling_tests_object_vfunc_return_value_and_multiple_out_parameters (GIMarshallingTestsObject *self, glong *a, glong *b); +gboolean gi_marshalling_tests_object_vfunc_meth_with_error (GIMarshallingTestsObject *object, gint x, GError **error); GIMarshallingTestsObject *gi_marshalling_tests_object_none_return (void); GIMarshallingTestsObject *gi_marshalling_tests_object_full_return (void); @@ -801,9 +901,13 @@ #define GI_MARSHALLING_TESTS_CONSTANT_GERROR_DOMAIN "gi-marshalling-tests-gerror-domain" #define GI_MARSHALLING_TESTS_CONSTANT_GERROR_CODE 5 #define GI_MARSHALLING_TESTS_CONSTANT_GERROR_MESSAGE "gi-marshalling-tests-gerror-message" +#define GI_MARSHALLING_TESTS_CONSTANT_GERROR_DEBUG_MESSAGE "we got an error, life is shit" void gi_marshalling_tests_gerror(GError **error); void gi_marshalling_tests_gerror_array_in(gint *in_ints, GError **error); +void gi_marshalling_tests_gerror_out(GError **error, gchar **debug); +void gi_marshalling_tests_gerror_out_transfer_none(GError **err, const gchar **debug); +GError *gi_marshalling_tests_gerror_return(void); /* Overrides */ @@ -835,12 +939,12 @@ struct _GIMarshallingTestsOverridesObjectClass { - GObjectClass parent_class; + GObjectClass parent_class; }; struct _GIMarshallingTestsOverridesObject { - GObject parent_instance; + GObject parent_instance; glong long_; }; @@ -851,7 +955,42 @@ glong gi_marshalling_tests_overrides_object_method (GIMarshallingTestsOverridesObject *object); - GIMarshallingTestsOverridesObject *gi_marshalling_tests_overrides_object_returnv (void); +/* Properties Object */ + +#define GI_MARSHALLING_TESTS_TYPE_PROPERTIES_OBJECT (gi_marshalling_tests_properties_object_get_type ()) +#define GI_MARSHALLING_TESTS_PROPERTIES_OBJECT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GI_MARSHALLING_TESTS_TYPE_PROPERTIES_OBJECT, GIMarshallingTestsPropertiesObject)) +#define GI_MARSHALLING_TESTS_PROPERTIES_OBJECT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GI_MARSHALLING_TESTS_TYPE_PROPERTIES_OBJECT, GIMarshallingTestsPropertiesObjectClass)) +#define GI_MARSHALLING_TESTS_IS_PROPERTIES_OBJECT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GI_MARSHALLING_TESTS_TYPE_PROPERTIES_OBJECT)) +#define GI_MARSHALLING_TESTS_IS_PROPERTIES_OBJECT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GI_MARSHALLING_TESTS_TYPE_PROPERTIES_OBJECT)) +#define GI_MARSHALLING_TESTS_PROPERTIES_OBJECT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GI_MARSHALLING_TESTS_TYPE_PROPERTIES_OBJECT, GIMarshallingTestsPropertiesObjectClass)) + +typedef struct _GIMarshallingTestsPropertiesObject GIMarshallingTestsPropertiesObject; +typedef struct _GIMarshallingTestsPropertiesObjectClass GIMarshallingTestsPropertiesObjectClass; + +struct _GIMarshallingTestsPropertiesObject { + GObject parent_instance; + + gboolean some_boolean; + gchar some_char; + guchar some_uchar; + gint some_int; + guint some_uint; + glong some_long; + gulong some_ulong; + gint64 some_int64; + guint64 some_uint64; + gfloat some_float; + gdouble some_double; +}; + +struct _GIMarshallingTestsPropertiesObjectClass { + GObjectClass parent_class; +}; + +GType gi_marshalling_tests_properties_object_get_type (void) G_GNUC_CONST; + +GIMarshallingTestsPropertiesObject *gi_marshalling_tests_properties_object_new (void); + #endif /* _GI_MARSHALLING_TESTS_H_ */ diff -Nru gobject-introspection-1.31.10/tests/Makefile.am gobject-introspection-1.31.20/tests/Makefile.am --- gobject-introspection-1.31.10/tests/Makefile.am 2011-08-30 01:07:30.000000000 +0000 +++ gobject-introspection-1.31.20/tests/Makefile.am 2012-02-22 17:57:37.000000000 +0000 @@ -1,6 +1,12 @@ include $(top_srcdir)/common.mk -SUBDIRS = . scanner repository offsets warn doctool +SUBDIRS = . scanner repository offsets warn +DIST_SUBDIRS = $(SUBDIRS) +if BUILD_DOCTOOL +SUBDIRS += doctool +else +DIST_SUBDIRS += doctool +endif EXTRA_DIST= BUILT_SOURCES= diff -Nru gobject-introspection-1.31.10/tests/Makefile.in gobject-introspection-1.31.20/tests/Makefile.in --- gobject-introspection-1.31.10/tests/Makefile.in 2012-01-19 22:12:11.000000000 +0000 +++ gobject-introspection-1.31.20/tests/Makefile.in 2012-03-05 14:47:03.000000000 +0000 @@ -44,6 +44,8 @@ host_triplet = @host@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(top_srcdir)/common.mk +@BUILD_DOCTOOL_TRUE@am__append_1 = doctool +@BUILD_DOCTOOL_FALSE@am__append_2 = doctool subdir = tests ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/gtk-doc.m4 \ @@ -134,7 +136,6 @@ distdir ETAGS = etags CTAGS = ctags -DIST_SUBDIRS = $(SUBDIRS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ dir0=`pwd`; \ @@ -371,7 +372,8 @@ UNINSTALLED_INTROSPECTION_BUILDDIR=$(top_builddir) \ $(top_builddir)/g-ir-doc-tool -SUBDIRS = . scanner repository offsets warn doctool +SUBDIRS = . scanner repository offsets warn $(am__append_1) +DIST_SUBDIRS = $(SUBDIRS) $(am__append_2) EXTRA_DIST = gimarshallingtests.h BUILT_SOURCES = everything.c everything.h CLEANFILES = $(BUILT_SOURCES) everything-stamp.h \ diff -Nru gobject-introspection-1.31.10/tests/scanner/annotation.c gobject-introspection-1.31.20/tests/scanner/annotation.c --- gobject-introspection-1.31.10/tests/scanner/annotation.c 2011-11-29 15:47:32.000000000 +0000 +++ gobject-introspection-1.31.20/tests/scanner/annotation.c 2012-02-03 18:37:11.000000000 +0000 @@ -1,3 +1,4 @@ +/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */ #include "annotation.h" char backslash_parsing_tester = '\\'; diff -Nru gobject-introspection-1.31.10/tests/scanner/barapp.c gobject-introspection-1.31.20/tests/scanner/barapp.c --- gobject-introspection-1.31.10/tests/scanner/barapp.c 2011-10-18 19:29:41.000000000 +0000 +++ gobject-introspection-1.31.20/tests/scanner/barapp.c 2012-02-03 18:37:15.000000000 +0000 @@ -1,3 +1,4 @@ +/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */ #include "barapp.h" #include diff -Nru gobject-introspection-1.31.10/tests/scanner/drawable.c gobject-introspection-1.31.20/tests/scanner/drawable.c --- gobject-introspection-1.31.10/tests/scanner/drawable.c 2011-06-10 15:36:50.000000000 +0000 +++ gobject-introspection-1.31.20/tests/scanner/drawable.c 2012-02-03 18:37:19.000000000 +0000 @@ -1,3 +1,4 @@ +/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */ #include "drawable.h" G_DEFINE_ABSTRACT_TYPE (TestInheritDrawable, test_inherit_drawable, G_TYPE_OBJECT); diff -Nru gobject-introspection-1.31.10/tests/scanner/gtkfrob.c gobject-introspection-1.31.20/tests/scanner/gtkfrob.c --- gobject-introspection-1.31.10/tests/scanner/gtkfrob.c 2011-06-10 15:36:50.000000000 +0000 +++ gobject-introspection-1.31.20/tests/scanner/gtkfrob.c 2012-02-03 18:37:23.000000000 +0000 @@ -1,3 +1,4 @@ +/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */ #include "gtkfrob.h" void diff -Nru gobject-introspection-1.31.10/tests/scanner/Regress-1.0-expected.gir gobject-introspection-1.31.20/tests/scanner/Regress-1.0-expected.gir --- gobject-introspection-1.31.10/tests/scanner/Regress-1.0-expected.gir 2012-01-11 20:57:34.000000000 +0000 +++ gobject-introspection-1.31.20/tests/scanner/Regress-1.0-expected.gir 2012-02-16 16:24:41.000000000 +0000 @@ -141,6 +141,36 @@
+ + + + + + + + + + + + + + + + + + + + + + + + + + @@ -150,6 +180,29 @@ + + + + + + + + + + + + + + + + + + + + + + + @@ -169,6 +222,43 @@ + + + + + + + + + + + + + + + + + a hash table; will be modified + + + + + + + + + + + + + + GError instance; must be freed by the callback + + + + @@ -492,6 +582,17 @@ + + + + + + + Another object + + + + This method is virtual. Notably its name differs from the virtual slot name, which makes it useful for testing bindings handle this @@ -1035,6 +1136,22 @@ + + + + + + + + + + + Another object + + + + + @@ -1463,6 +1580,17 @@ + + + + + + + + + + @@ -2036,6 +2164,25 @@ + + + + + + + + + + + + + + + + + @@ -2385,6 +2532,25 @@ + + + + + + + GHashTable that gets passed to callback + + + + + + + + + + @@ -2563,6 +2729,29 @@ + + + + + + + + + + + + + + + + + + + + diff -Nru gobject-introspection-1.31.10/tests/scanner/regress.c gobject-introspection-1.31.20/tests/scanner/regress.c --- gobject-introspection-1.31.10/tests/scanner/regress.c 2012-01-11 20:57:34.000000000 +0000 +++ gobject-introspection-1.31.20/tests/scanner/regress.c 2012-02-16 16:24:41.000000000 +0000 @@ -1,3 +1,4 @@ +/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */ #include #include #include @@ -1326,7 +1327,23 @@ { GPtrArray *array; - array = g_ptr_array_new_with_free_func (g_object_unref); + array = g_ptr_array_new_with_free_func (g_free); + g_ptr_array_add (array, g_strdup ("regress")); + + return array; +} + +/** + * regress_test_garray_full_return: + * + * Returns: (transfer full) (type GLib.PtrArray) (element-type utf8): + */ +GPtrArray * +regress_test_garray_full_return (void) +{ + GPtrArray *array; + + array = g_ptr_array_new (); g_ptr_array_add (array, g_strdup ("regress")); return array; @@ -1656,6 +1673,35 @@ return our_type; } +RegressTestBoxedB * +regress_test_boxed_b_new (gint8 some_int8, glong some_long) +{ + RegressTestBoxedB *boxed; + + boxed = g_slice_new (RegressTestBoxedB); + boxed->some_int8 = some_int8; + boxed->some_long = some_long; + + return boxed; +} + +RegressTestBoxedB * +regress_test_boxed_b_copy (RegressTestBoxedB *boxed) +{ + return regress_test_boxed_b_new (boxed->some_int8, boxed->some_long); +} + +static void +regress_test_boxed_b_free (RegressTestBoxedB *boxed) +{ + g_slice_free (RegressTestBoxedB, boxed); +} + +G_DEFINE_BOXED_TYPE(RegressTestBoxedB, + regress_test_boxed_b, + regress_test_boxed_b_copy, + regress_test_boxed_b_free); + G_DEFINE_TYPE(RegressTestObj, regress_test_obj, G_TYPE_OBJECT); enum @@ -2842,7 +2888,22 @@ return sum; } +/** + * regress_test_array_callback: + * @callback: (scope call): + * + **/ +int regress_test_array_callback (RegressTestCallbackArray callback) +{ + static const char *strings[] = { "one", "two", "three" }; + static int ints[] = { -1, 0, 1, 2 }; + int sum = 0; + + sum += callback(ints, 4, strings, 3); + sum += callback(ints, 4, strings, 3); + return sum; +} /** * regress_test_simple_callback: @@ -3026,6 +3087,58 @@ return g_object_new (REGRESS_TEST_TYPE_OBJ, NULL); } +/** + * regress_test_hash_table_callback: + * @data: (element-type utf8 gint): GHashTable that gets passed to callback + * @callback: (scope call): + **/ +void +regress_test_hash_table_callback (GHashTable *data, RegressTestCallbackHashtable callback) +{ + callback (data); +} + +/** + * regress_test_gerror_callback: + * @callback: (scope call): + **/ +void +regress_test_gerror_callback (RegressTestCallbackGError callback) +{ + GError *error; + + error = g_error_new_literal (G_IO_ERROR, + G_IO_ERROR_NOT_SUPPORTED, + "regression test error"); + callback (error); + g_error_free (error); +} + +/** + * regress_test_null_gerror_callback: + * @callback: (scope call): + **/ +void +regress_test_null_gerror_callback (RegressTestCallbackGError callback) +{ + callback (NULL); +} + +/** + * regress_test_owned_gerror_callback: + * @callback: (scope call): + **/ +void +regress_test_owned_gerror_callback (RegressTestCallbackOwnedGError callback) +{ + GError *error; + + error = g_error_new_literal (G_IO_ERROR, + G_IO_ERROR_PERMISSION_DENIED, + "regression test owned error"); + callback (error); +} + /* interface */ static void diff -Nru gobject-introspection-1.31.10/tests/scanner/regress.h gobject-introspection-1.31.20/tests/scanner/regress.h --- gobject-introspection-1.31.10/tests/scanner/regress.h 2011-12-20 18:21:40.000000000 +0000 +++ gobject-introspection-1.31.20/tests/scanner/regress.h 2012-02-16 16:24:41.000000000 +0000 @@ -113,6 +113,7 @@ /* GPtrArray */ GPtrArray *regress_test_garray_container_return (void); +GPtrArray *regress_test_garray_full_return (void); /* error? */ @@ -313,6 +314,18 @@ gboolean regress_test_boxed_equals (RegressTestBoxed *boxed, RegressTestBoxed *other); +typedef struct _RegressTestBoxedB RegressTestBoxedB; + +struct _RegressTestBoxedB +{ + gint8 some_int8; + glong some_long; +}; + +GType regress_test_boxed_b_get_type (void); +RegressTestBoxedB *regress_test_boxed_b_new (gint8 some_int8, glong some_long); +RegressTestBoxedB *regress_test_boxed_b_copy (RegressTestBoxedB *boxed); + /* gobject */ #define REGRESS_TEST_TYPE_OBJ (regress_test_obj_get_type ()) #define REGRESS_TEST_OBJECT(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), REGRESS_TEST_TYPE_OBJ, RegressTestObj)) @@ -346,6 +359,12 @@ int (*matrix) (RegressTestObj *obj, const char *somestr); + /** + * RegressTestObjClass::allow_none_vfunc + * @two: (allow-none): Another object + */ + void (*allow_none_vfunc) (RegressTestObj *obj, RegressTestObj *two); + guint test_signal; guint test_signal_with_static_scope_arg; @@ -521,16 +540,36 @@ typedef int (*RegressTestCallback) (void); typedef int (*RegressTestCallbackUserData) (gpointer user_data); /** + * RegressTestCallbackHashtable: + * @data: (element-type utf8 gint): a hash table; will be modified + */ +typedef void (*RegressTestCallbackHashtable) (GHashTable *data); +typedef void (*RegressTestCallbackGError) (const GError *error); +/** + * RegressTestCallbackOwnedGError: + * @error: (transfer full): GError instance; must be freed by the callback + */ +typedef void (*RegressTestCallbackOwnedGError) (GError *error); +/** * RegressTestCallbackFull: * @foo: the investment rate * @bar: how much money * @path: (type filename): Path to file */ typedef int (*RegressTestCallbackFull) (int foo, double bar, char *path); +/** + * RegressTestCallbackArray: + * @one: (array length=one_length): + * @one_length: + * @two: (array length=two_length) (element-type utf8): + * @two_length: + */ +typedef int (*RegressTestCallbackArray) (int *one, gsize one_length, const char** two, int two_length); void regress_test_simple_callback (RegressTestSimpleCallback callback); int regress_test_callback (RegressTestCallback callback); int regress_test_multi_callback (RegressTestCallback callback); +int regress_test_array_callback (RegressTestCallbackArray callback); int regress_test_callback_user_data (RegressTestCallbackUserData callback, gpointer user_data); int regress_test_callback_destroy_notify (RegressTestCallbackUserData callback, @@ -548,6 +587,10 @@ RegressTestObj *regress_test_obj_new_callback (RegressTestCallbackUserData callback, gpointer user_data, GDestroyNotify notify); +void regress_test_hash_table_callback (GHashTable *data, RegressTestCallbackHashtable callback); +void regress_test_gerror_callback (RegressTestCallbackGError callback); +void regress_test_null_gerror_callback (RegressTestCallbackGError callback); +void regress_test_owned_gerror_callback (RegressTestCallbackOwnedGError callback); typedef struct _RegressTestInterface RegressTestInterface; diff -Nru gobject-introspection-1.31.10/tests/scanner/utility.c gobject-introspection-1.31.20/tests/scanner/utility.c --- gobject-introspection-1.31.10/tests/scanner/utility.c 2011-06-10 15:36:50.000000000 +0000 +++ gobject-introspection-1.31.20/tests/scanner/utility.c 2012-02-03 18:37:33.000000000 +0000 @@ -1,3 +1,4 @@ +/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */ #include "utility.h" G_DEFINE_TYPE (UtilityObject, utility_object, G_TYPE_OBJECT); diff -Nru gobject-introspection-1.31.10/tests/warn/unknown-parameter.h gobject-introspection-1.31.20/tests/warn/unknown-parameter.h --- gobject-introspection-1.31.10/tests/warn/unknown-parameter.h 2011-06-10 15:36:50.000000000 +0000 +++ gobject-introspection-1.31.20/tests/warn/unknown-parameter.h 2012-02-16 16:24:41.000000000 +0000 @@ -19,13 +19,23 @@ // EXPECT:14: Warning: Test: test_param_mismatch2: unknown parameter 'wrong_name2' in documentation comment, should be one of 'a', 'out2' /** + * test_param_mismatch3: + * @a: an integer + * @wrong_name3: (out): + * + */ +void test_param_mismatch3(int a, int *out3); + +// EXPECT:24: Warning: Test: test_param_mismatch3: unknown parameter 'wrong_name3' in documentation comment, should be 'out3' + +/** * test_param_missing: * @missing: (out): * */ void test_param_missing(void); -// EXPECT:23: Warning: Test: test_param_missing: unknown parameter 'missing' in documentation comment +// EXPECT:33: Warning: Test: test_param_missing: unknown parameter 'missing' in documentation comment /** diff -Nru gobject-introspection-1.31.10/tools/compiler.c gobject-introspection-1.31.20/tools/compiler.c --- gobject-introspection-1.31.10/tools/compiler.c 2011-06-10 15:36:50.000000000 +0000 +++ gobject-introspection-1.31.20/tools/compiler.c 2012-02-03 18:36:30.000000000 +0000 @@ -1,4 +1,5 @@ -/* GObject introspection: Typelib compiler +/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- + * GObject introspection: Typelib compiler * * Copyright (C) 2005 Matthias Clasen * diff -Nru gobject-introspection-1.31.10/tools/generate.c gobject-introspection-1.31.20/tools/generate.c --- gobject-introspection-1.31.10/tools/generate.c 2011-06-10 15:36:50.000000000 +0000 +++ gobject-introspection-1.31.20/tools/generate.c 2012-02-03 18:36:36.000000000 +0000 @@ -1,6 +1,5 @@ - -/* -*- Mode: C; c-file-style: "gnu"; -*- */ -/* GObject introspection: IDL generator +/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- + * GObject introspection: IDL generator * * Copyright (C) 2005 Matthias Clasen * Copyright (C) 2008,2009 Red Hat, Inc.