<?xml version="1.0"?>
<!DOCTYPE doc [ <!ENTITY IntrFormat SYSTEM "intr-format.xml">
<!ENTITY IntrExample1 SYSTEM "intr-example1.xml">
<!ENTITY IntrExample2 SYSTEM "intr-example2.xml">
<!ENTITY IntrBuild SYSTEM "intr-build.xml">
<!ENTITY IntrIntrospection SYSTEM "intr-introspection.xml">
<!ENTITY IntrDecl SYSTEM "intr-decl.xml">
<!ENTITY IntrCall SYSTEM "intr-call.xml"> ]>
<?xml-stylesheet type="text/xsl" href="theme-d-doc-html.xsl"?>
<article xmlns="http://docbook.org/ns/docbook" version="5.0">
  <articleinfo>
    <title>
      Theme-D-Intr User Manual
    </title>
    <author>
      <personname>
        <firstname>
          Tommi
        </firstname>
        <surname>
          Höynälänmaa
        </surname>
      </personname>
    </author>
    <copyright>
      <year>
        2020-2026
      </year>
      <holder>
        Tommi Höynälänmaa
      </holder>
    </copyright>
    <legalnotice>
      <para>
        This file is part of Theme-D-Intr version 1.0.1. This document has
        been last updated May 16, 2026.
      </para>
      <para>
        You can redistribute and/or modify this file under the terms of the
        GNU Free Documentation License as published by the Free Software
        Foundation, either version 1.3 of the License, or (at your option) any
        later version.
      </para>
      <para>
        See file
        <filename>
          doc/GFDL-1.3
        </filename>
        in the source code
        package for the license.
      </para>
    </legalnotice>
  </articleinfo>
  <section>
    <title>
      Introduction
    </title>
    <para>
      Theme-D-Intr is a software library allowing the use of the
      introspected GObject modules in Theme-D.
    </para>
  </section>
  <section>
    <title>
      Installation
    </title>
    <section>
      <title>
        Debian forky (testing) and sid (unstable) and Ubuntu Resolute
      </title>
      If you use the Synaptic Package Manager install the packages
      <filename>theme-d-intr</filename>
      and
      <filename>theme-d-intr-dev</filename>
      . If you want to install
      the example programs install one or both of the packages
      <filename>theme-d-intr-gtk3-examples</filename>
      and
      <filename>theme-d-intr-gtk4-examples</filename>.
      In order to install the packages from the command line give
      command
      <programlisting>
        sudo apt install theme-d-intr theme-d-intr-dev
      </programlisting>
      and optionally one or both of the commands
      <programlisting>
        sudo apt install theme-d-intr-gtk3-examples
        sudo apt install theme-d-intr-gtk4-examples
      </programlisting>
    </section>
    <section>
      <title>
        Other Debian-based Systems
      </title>
      <itemizedlist>
        <listitem>
          Install Guile 3.0 is you don't have it already.
        </listitem>
        <listitem>
          Install Theme-D version 7.3.2 is you don't have it already.
          See
          <ulink url="https://www.iki.fi/tohoyn/theme-d/theme-d-user-guide-20260505-1.pdf">Theme-D User Guide</ulink>
          for instructions.
        </listitem>
        <listitem>
          Install G-Golf. See
          <ulink url="http://www.iki.fi/tohoyn/g-golf-debian/"/>
.
        </listitem>
        <listitem>
          Create a directory for the build and download packages
          <filename>theme-d-intr-1.0.0.tar.xz</filename>
          and
          <filename>theme-d-intr_1.0.0-1.debian.tar.xz</filename>
          there.
        </listitem>
        <listitem>
          Execute the following commands
          &IntrBuild;
          in the directory.
        </listitem>
        <listitem>
          Give command <code>cd ..</code> and install the packages with commands
          <programlisting>
            sudo dpkg -i theme-d-intr_1.0.0-1_ARCH.deb
            sudo dpkg -i theme-d-intr-dev_1.0.0-1_all.deb
          </programlisting>
          The architecture ARCH can be computed by
          <programlisting>
            dpkg-architecture -q DEB_HOST_ARCH
          </programlisting>
          You can install the example programs by installing one or
          both of the packages
          <filename>theme-d-intr-gtk4-examples_1.0.0-1_all.deb</filename>
          and
          <filename>theme-d-intr-gtk3-examples_1.0.0-1_all.deb</filename>.
        </listitem>
        <listitem>
          Ensure that your Guile installation file
          <filename>~/.guile</filename>
          contains the following lines:
          <programlisting>
            (use-modules (oop goops))
            (default-duplicate-binding-handler
              '(merge-generics replace warn-override-core warn last))
          </programlisting>
        </listitem>
      </itemizedlist>
    </section>
    <section>
      <title>
        Other UNIX Systems
      </title>
      <itemizedlist>
        <listitem>
          <para>
            Install the G-Golf library. See
            <ulink url="https://www.gnu.org/software/g-golf/install.html"/>
.
          </para>
        </listitem>
        <listitem>
          <para>
            Unpack package
            <filename>theme-d-intr-1.0.0.tar.xz</filename>
            into
            some directory.
          </para>
        </listitem>
        <listitem>
          <para>
            Change to the subdirectory
            <filename>theme-d-intr-1.0.0</filename>
            and give commands
            <programlisting>
              ./configure
              make
              sudo make install-complete
            </programlisting>
          </para>
        </listitem>
        <listitem>
          Ensure that your Guile installation file
          <filename>~/.guile</filename>
          contains the following lines:
          <programlisting>
            (use-modules (oop goops))
            (default-duplicate-binding-handler
              '(merge-generics replace warn-override-core warn last))
          </programlisting>
        </listitem>
      </itemizedlist>
    </section>
  </section>
  <section>
    <title>
      Using Theme-D-Intr without Installing
    </title>
    <para>
      It is possible to use the software without installing it.
      First give the following commands in the subdirectory
      <filename>theme-d-intr-1.0.0</filename>:
      <programlisting>
        ./configure
        make
      </programlisting>
      Modify the file
      <filename>~/.guile</filename>
      as in a normal
      installation (see the previous section).
      Now you can launch the uninstalled environment by giving command
      <programlisting>
        ./uninstalled-env bash
      </programlisting>
      in subdirectory
      <filename>meta</filename>.
      You also have to take care that the Theme-D module search path
      (option
      <code>-m</code> or <code>-M</code>
      for the Theme-D compiler and linker)
      contains the directory
      <filename>xxx/theme-d-intr-1.0.0/theme-d-code</filename>.
      See Theme-D User Guide
      for a description of the module search path.
    </para>
  </section>
  <section>
    <title>
      Example Programs
    </title>
    <para>
      It is recommended that you copy the example programs into your home
      directory for building them.
      If you have installed Theme-D-Intr normally go to directory
      <filename>/usr/share/doc/theme-d-intr-gtk4-examples</filename>.
      If you use Theme-D-Intr without installed it go to the subdirectory
      <filename>examples</filename> in the source code.
      Give command
      <programlisting>
        cp -avi intr-gtk4-examples MYDIR
      </programlisting>
      where <filename>MYDIR</filename> is the directory where you want to
      install the programs.
      Then, go to the directory
      <filename>/usr/share/doc/theme-d-intr-gtk3-examples</filename> or
      <filename>examples</filename> and give command
      <programlisting>
        cp -avi intr-gtk3-examples MYDIR
      </programlisting>
      Finally, go to the directory
      <filename>/usr/share/doc/theme-d-intr-dev/examples</filename> or
      <filename>examples</filename> and give command
      <programlisting>
        cp -avi intr-dbus-examples MYDIR
      </programlisting>
    </para>
    <para>
      The example programs
      <filename>appwindow</filename>,
      <filename>hello</filename>,
      <filename>hello2</filename>,
      <filename>hello3</filename>,
      <filename>calc</filename>,
      <filename>calc2</filename>,
      <filename>custom-layout-example</filename>,
      <filename>flag-demo</filename>, and
      <filename>theme-d-intr-demo</filename>
      for GTK 4 are located in
      directory
      <filename>/usr/share/doc/theme-d-intr-gtk4-examples/intr-gtk4-examples</filename>
      and in directory
      <filename>examples/intr-gtk4-examples</filename>
      in the source package.
      You can build the example programs with command
      <code>
        make -f user.mk
      </code>
      and run them with command
      <programlisting> GUILE_LOAD_PATH=../..:$GUILE_LOAD_PATH run-theme-d-program &#x5c;
        &lt;program-name&gt;
      </programlisting>
      where
      <code>&lt;program-name&gt;</code>
      is the name of the
      target
      <filename>.go</filename>
      file of the program
      (      <filename>main.go</filename>
      or
      <filename>run-demo.go</filename>).
      For program
      <filename>hello</filename>
      the command is
      <programlisting> GUILE_LOAD_PATH=.:$GUILE_LOAD_PATH run-theme-d-program hello.go
      </programlisting>
      Example program
      <filename>intr-gtk4-examples/calc2</filename>
      is linked modularly and it shall be run with command
      <programlisting>
        run-theme-d-program-m -g ../..: main.go
      </programlisting>
      or in uninstalled mode
      <programlisting>
        run-theme-d-program-m -g ../..:../../../theme-d-code: main.go
      </programlisting>
      Before you run it you have to install its configuration files with command
      <programlisting>
        ./install-calc2.sh
      </programlisting>
      If you have a Debian-based Linux operating system you have to
      ensure that packages
      <filename>gir1.2-gtk-4.0</filename>
      and
      <filename>gir1.2-adw-1</filename>
      are installed in your system.
    </para>
    <para>
      The example programs
      <filename>hello</filename>,
      <filename>hello2</filename>,
      <filename>hello3</filename>,
      <filename>calc</filename>, and
      <filename>theme-d-intr-demo</filename>
      for GTK 3 are located in
      directory
      <filename>/usr/share/doc/theme-d-intr-gtk3-examples/intr-gtk3-examples</filename>
      and in directory
      <filename>examples/intr-gtk3-examples</filename>
      in the source package.
      You can build the example programs with command
      <code>make -f user.mk</code>
      and run them with command
      <programlisting> GUILE_LOAD_PATH=../..:$GUILE_LOAD_PATH run-theme-d-program &#x5c;
          &lt;program-name&gt;
      </programlisting>
      where
      <code>&lt;program-name&gt;</code>
      is the name of the
      target
      <filename>.go</filename>
      file of the program
      (<filename>main.go</filename>
      or
      <filename>run-demo.go</filename>).
      For program
      <filename>hello</filename>
      the command is
      <programlisting> GUILE_LOAD_PATH=.:$GUILE_LOAD_PATH run-theme-d-program hello.go
      </programlisting>
      If you have a Debian-based Linux operating system you have to
      ensure that package
      <filename>gir1.2-gtk-3.0</filename>
      is installed in your system.
    </para>
    <para>
      The example programs
      <filename>dbus-test-server1</filename>,
      <filename>dbus-test-client1</filename>,
      <filename>dbus-test-client1-2</filename>, and
      <filename>introspect2</filename>
      are located in directory
      <filename>/usr/share/doc/theme-d-intr-dev/examples/intr-dbus-examples</filename>
      and in directory
      <filename>examples/intr-dbus-examples</filename>
      in the source package.
      You can build the example programs with command
      <code>make -f user.mk</code>
      The D-Bus test server and clients support also modular linking. In order to invoke this
      use command
      <programlisting>
        LINK_MODULES=1 make -f user.mk
      </programlisting>
      You can run the programs with command
      <programlisting> GUILE_LOAD_PATH=../..:$GUILE_LOAD_PATH run-theme-d-program &#x5c;
          &lt;program-name&gt;
      </programlisting>
      In order to test the server and clients
      first launch the server in a terminal window and then the client in another
      terminal window.
      The functionality in 
      <filename>dbus-test-client1</filename> and
      <filename>dbus-test-client1-2</filename>
      is identical but the latter program uses Theme-D wrapper library
      to access the server.
      Program <filename>introspect2/main.go</filename> takes two arguments:
      the D-Bus service name and object path, where the service has to implement
      interface <code>org.freedesktop.DBus.Introspectable</code>. The program
      prints the introspection data to the console.
    </para>
  </section>
  <section>
    <title>
      Writing Programs using Theme-D-Intr
    </title>
    <para>
      It is recommended you create a new directory for your program.
      First you have to list the G-Golf classes and functions you use
      in file
      <filename>intr-imports.scm</filename>.
      Its format is:
      &IntrFormat;
      The order of the toplevel subexpressions has no effect.
      Symbol <code>classes</code> is accepted as an alias for
      <code>types</code>.
      Namespace is the library where the definitions are imported,
      such as
      <varname>Gtk</varname>.
      Class and type names are given in
      format
      <varname>MyClassName</varname>.
      Note that the namespace is not
      included in the class or function name
      (<varname>Widget</varname>
      instead of
      <varname>GtkWidget</varname>).
      Methods belonging to a type
      are imported automatically when the type is imported and they
      must not be listed in the
      <varname>functions</varname>
      section.
      If you want to import a type but not its methods
      list the type in section <code>only-types</code> instead of
      <code>types</code>.
      Rejected methods are generic function names for which
      we do not generate methods. There are two main reasons for
      rejecting a method:
      <itemizedlist>
        <listitem>
          <para>
            The method name overlaps a nongeneric function name,
            e.g.
            <function>append</function>.
          </para>
        </listitem>
        <listitem>
          <para>
            The methods of some name violate the covariance rule, see
            <ulink url="https://www.iki.fi/tohoyn/theme-d/theme-d-language-manual-7.3.1.pdf">Theme-D Language Manual</ulink>.
          </para>
        </listitem>
      </itemizedlist>
      The purpose of
      <varname>overridden-functions</varname>
      is to
      handle functions overridden in G-Golf. The argument types, the
      result type and the attributes are given in Theme-D format.
      The
      <varname>version</varname>
      specifies the version used for a
      namespace. The version must be enclosed in double quotes.
      The boolean function result of a function can be stripped by
      listing it under
      <varname>strip-boolean-result</varname>.
      See
      G-Golf documentation for this feature.
      Form
      <varname>ignore-slots</varname>
      can be used to prevent code generation for some specific slots.
      For example,
      <code>(ignore-slots (Gtk Label) xalign yalign)</code>.
      Here is an example import file:
      &IntrExample1;
      and here is another:
      &IntrExample2;
    </para>
    <para>
      The following three files are generated from the definition file:
      <itemizedlist>
        <listitem>
          <para>
            Interface file
            <filename>_intr-imports.thi</filename>
          </para>
        </listitem>
        <listitem>
          <para>
            Body file
            <filename>_intr-imports.thb</filename>
          </para>
        </listitem>
        <listitem>
          <para>
            Target module
            <filename>_intr-imports-target.scm</filename>
          </para>
        </listitem>
      </itemizedlist>
      The program and modules using G-Golf should import the
      module
      <filename>_intr-imports</filename>.
      In case you have a multiple
      part program name, such as
      <varname>(myexamples myprogram)</varname>,
      module
      <varname>_intr-imports</varname>
      has a multiple part name too,
      e.g.
      <varname>(myexamples _intr-imports)</varname>.
      File
      <filename>_intr-imports-target.scm</filename>
      is used by the
      linked program to provide access to the introspected libraries.
    </para>
    <para>
      The following commands are used to generate Theme-D-Intr files:
      <itemizedlist>
        <listitem>
          <para>
            <filename>generate-intr-interface</filename>
          </para>
        </listitem>
        <listitem>
          <para>
            <filename>generate-intr-body</filename>
          </para>
        </listitem>
        <listitem>
          <para>
            <filename>generate-intr-target-module</filename>
          </para>
        </listitem>
      </itemizedlist>
      If you use a multiple part program name you must give
      the
      <option>-m</option>
      option for these commands.
      The option argument is the imports module name for the first two
      commands, e.g.
      <option>-m "(myexamples _intr-imports)"</option>
      and the
      setter module name for the fourth command, e.g.
      <option>-m "(myexamples _intr-imports-target)"</option>.
      If you want to generate accessor methods
      <code>NAMESPACE-CLASS-get-SLOT</code>
      and
      <code>NAMESPACE-CLASS-set-SLOT!</code>
      use option <option>--generate-accessors</option> for all of these
      programs. Note that you can access slots without accessor methods by using
      procedures <code>slot-ref</code> and <code>slot-set!</code>.
    </para>
    <para>
      When you link a program using Theme-D-Intr you have to give the
      following options to the Theme-D linker:
      <itemizedlist>
        <listitem>
          <para>
            <option>-x "(g-golf)"</option>
          </para>
        </listitem>
        <listitem>
          <para>
            <option>-x "(guile-theme-d-intr support)"</option>
          </para>
        </listitem>
        <listitem>
          <para>
            <option>-x "&lt;target-module&gt;"</option>
          </para>
        </listitem>
        <listitem>
          <para>
            <option>--duplicates="merge-generics replace warn-override-core warn last"</option>
          </para>
        </listitem>
      </itemizedlist>
      Here
      <option>&lt;target-module&gt;</option>
      is the Theme-D name of
      the generated target module. For a program with a single part
      name it is
      <varname>(_intr-imports-target)</varname>.
      If you use the
      extra support module give also option
      <option>-x "(guile-theme-d-intr support2-gtk3)"</option>
      or
      <option>-x "(guile-theme-d-intr support2-gtk4)"</option>.
    </para>
    <para>
      You have to ensure that you have the introspection files for the
      external libraries your program uses (with G-Golf) installed in
      your system.
      If your program uses GTK and you have a Debian-based Linux
      system this can be ensured by having package
      <filename>gir1.2-gtk-3.0</filename>
      (for GTK 3.0) or
      <filename>gir1.2-gtk-4.0</filename>
      (for GTK 4.0)
      in your system.
    </para>
    <para>
      See also the
      <filename>user.mk</filename>
      makefiles of the
      example programs.
      Example program
      <filename>hello</filename>
      has a single part program name and
      the other example programs multiple part program names.
    </para>
    <para>
      When you run programs using Theme-D-Intr the environment
      variable
      <envar>GUILE_LOAD_PATH</envar>
      has to contain the root
      directory of your program. If you use a single part
      program name this is the directory of your program.
    </para>
    <para>
      If you use modular linking you may have several introspection modules.
      You have to generate the interface file, body file, and target module
      for each of these modules. By convention the target module is named
      <code>__scm_<emphasis>modulename</emphasis>.scm</code>.
      You have to include all target modules needed when you link units
      modularly. Use linker option <code>-x</code> for this.
    </para>
  </section>
  <section>
    <title>
      Distributing Programs using Theme-D-Intr
    </title>
    <para>
      If you use a Debian-based operating system the following
      packages are required to run compiled (built) Theme-D programs
      using Theme-D-Intr:
      <itemizedlist>
        <listitem>
          <filename>theme-d-rte</filename>
        </listitem>
        <listitem>
          <filename>th-scheme-utilities</filename>
        </listitem>
        <listitem>
          <filename>libthemedsupport</filename>
        </listitem>
        <listitem>
          <filename>theme-d-intr</filename>
        </listitem>
      </itemizedlist>
    </para>
    <para>
      If you have a non-Debian operating system see the Theme-D User
      Guide for the files required to distribute a compiled Theme-D
      program.
      In addition to those, you need file
      <filename>support.scm</filename>
      from the Theme-D-Intr source package.
      If you use files
      <filename>support2-gtk3.scm</filename>
      or
      <filename>support2-gtk4.scm</filename>
      you need distribute that, too.
      These files have to be installed in subdirectory
      <filename>guile-theme-d-support</filename>
      somewhere in the
      Guile library search path. In UNIX systems this path usually
      contains directory
      <filename>/usr/share/guile/site/3.0/</filename>
      or
      <filename>/usr/share/guile/site/2.2/</filename>.
    </para>
    If your application uses modular linking you also have to distribute files
    <itemizedlist>
      <listitem>
        <filename>base/__intf_support.go</filename>
      </listitem>
      <listitem>
        <filename>base/__impl_support.go</filename>
      </listitem>
      <listitem>
        <filename>base/__intf_utils.go</filename>
      </listitem>
      <listitem>
        <filename>base/__impl_utils.go</filename>
      </listitem>
      <listitem>
        <filename>base/__intf_gobject.go</filename>
      </listitem>
      <listitem>
        <filename>base/__impl_gobject.go</filename>
      </listitem>
      <listitem>
        <filename>base/__intf_gobject.go</filename>
      </listitem>
      <listitem>
        <filename>base/__scm_gobject.go</filename>
      </listitem>
      <listitem>
        <filename>base/__intf_variant.go</filename>
      </listitem>
      <listitem>
        <filename>base/__impl_variant.go</filename>
      </listitem>
      <listitem>
        <filename>base/__scm_variant.go</filename>
      </listitem>
    </itemizedlist>
    into subdirectory <filename>theme-d-intr/base</filename> of the Theme-D
    target library directory. If your application uses modular linking and D-Bus
    you also have to distribute files
    <itemizedlist>
      <listitem>
        <filename>dbus/__intf_connection.go</filename>
      </listitem>
      <listitem>
        <filename>dbus/__impl_connection.go</filename>
      </listitem>
      <listitem>
        <filename>dbus/__scm_connection.go</filename>
      </listitem>
      <listitem>
        <filename>dbus/__intf_node-info.go</filename>
      </listitem>
      <listitem>
        <filename>dbus/__impl_node-info.go</filename>
      </listitem>
      <listitem>
        <filename>dbus/__scm_node-info.go</filename>
      </listitem>
      <listitem>
        <filename>dbus/__intf_utils.go</filename>
      </listitem>
      <listitem>
        <filename>dbus/__impl_utils.go</filename>
      </listitem>
      <listitem>
        <filename>dbus/__scm_utils.go</filename>
      </listitem>
    </itemizedlist>
    into subdirectory <filename>theme-d-intr/dbus</filename>.
    You can obtain the target library directory with command
    <programlisting>
      get-theme-d-config-var target-lib-dir
    </programlisting>
  </section>
  <section>
    <title>
      Help with callback types
    </title>
    <para>
      You can use command
      <filename>describe-cb-type</filename>
      to get the Theme-D name and Theme-D procedure type of a callback type.
      The syntax of the command is
      <programlisting>
        describe-cb-type library callback-name [version]
      </programlisting>
      Argument
      <code>library</code>
      is the library where the callback is defined.
      Argument
      <code>callback-name</code>
      is the name of the callback type.
      Optional argument
      <code>version</code>
      is the version of the library.
      Here is an example:
      <programlisting>
        describe-cb-type Gtk CustomMeasureFunc 4.0
      </programlisting>
    </para>
  </section>
  <section>
    <title>
      D-Bus support
    </title>
    <section>
      <title>
      Wrappers to introspected methods and signals
      </title>
      <para>
      Theme-D-Intr implements wrappers for D-Bus methods and signals.
      They handle conversion between Theme-D
      objects and <code>&lt;g-variant&gt;</code>'s.
      </para>
      <para>
      Theme-D wrapper modules are generated by programs
        <code>gen-dbus-theme-d-interface</code> and
        <code>gen-dbus-theme-d-body</code>.
      These programs take two arguments: the XML file
      containing the D-Bus interface description
      and the module path to be used in the generated modules.
      The XML file has to contain a single <code>node</code>
      element containing a single <code>interface</code>
      element.
      The module path has to be a list of symbols separated by spaces
      and enclosed in parentheses.
      </para>
      <para>
      The wrappers are named as follows:
        <informaltable frame="none" rowsep="0" colsep="0">
          <tgroup cols="2">
            <tbody>
              <row>
                <entry>
                a synchronous method call:
                </entry>
                <entry>
                  <emphasis>interface</emphasis><code>:</code><emphasis>method</emphasis>
                </entry>
              </row>
              <row>
                <entry>
                an asynchronous method call:
                </entry>
                <entry>
                  <emphasis>interface</emphasis><code>:async:</code><emphasis>method</emphasis>
                </entry>
              </row>
              <row>
                <entry>
                signal subscription:
                </entry>
                <entry>
                  <emphasis>interface</emphasis><code>:subscribe:</code><emphasis>signal</emphasis>
                </entry>
              </row>
              <row>
                <entry>
                property getter:
                </entry>
                <entry>
                  <emphasis>interface</emphasis><code>:get:</code><emphasis>property</emphasis>
                </entry>
              </row>
              <row>
                <entry>
                property setter:
                </entry>
                <entry>
                  <emphasis>interface</emphasis><code>:set:</code><emphasis>property</emphasis>
                </entry>
              </row>
            </tbody>
          </tgroup>
        </informaltable>
        where <emphasis>interface</emphasis> is obtained by replacing points by underscores
        in the interface name.
      </para>
      The method calls and property getter calls unwrap the
      <code>&lt;variant&gt;</code> returned by the method
      and return the obtained value.
      <argheader>
      A synchronous method call wrapper takes the following arguments:
      </argheader>
      <arg>
        <argname>conn</argname>
        <argtype>&lt;g-dbus-connection&gt;</argtype>
        <argdesc>
              A D-Bus connection
        </argdesc>
      </arg>
      <arg>
        <argname>str-bus-name</argname>
        <argtype>&lt;string&gt;</argtype>
        <argdesc>
              The bus name of the method call
        </argdesc>
      </arg>
      <arg>
        <argname>str-object-path</argname>
        <argtype>&lt;string&gt;</argtype>
        <argdesc>
              The path of the object the method is applied to
        </argdesc>
      </arg>
      <arg>
        <argname>flags</argname>
        <argtype>&lt;g-dbus-call-flags&gt;</argtype>
        <argdesc>
              Flags affecting the call.
        </argdesc>
      </arg>
      <arg>
        <argname>i-timeout</argname>
        <argtype>&lt;integer&gt;</argtype>
        <argdesc>
              The timeout in milliseconds, -1 to use the default timeout.
              Use the value of Glib macro <code>G_MAXINT</code> for no timeout.
              This value is the largest value that C type <code>int</code> can
              contain and it is typically <code>0x7fffffff</code>.
        </argdesc>
      </arg>
      <arg>
        <argname>cancellable</argname>
        <argtype>(:alt-maybe &lt;g-cancellable&gt;)</argtype>
        <argdesc>
              An object to control the cancellation of the method.
              The data is owned by the caller of the method.
              This argument can be <code>#f</code>.
        </argdesc>
      </arg>
      <arg>
        <argname>l-args</argname>
        <argtype2><code>(:tuple ARG1 ... ARGN)</code>
        where <code>ARGK</code> are the argument types of the method.
        </argtype2>
        <argdesc>
            Arguments to be passed to the method. If there are no arguments to pass
            this argument is omitted.
        </argdesc>
      </arg>
      <para>
        An asynchronous method call wrapper takes the following arguments:
      </para>
      <argcomment>
      Arguments <code>conn</code>,        <code>str-bus-name</code>,        <code>str-object-path</code>,
        <code>flags</code>,        <code>i-timeout</code>, and <code>cancellable</code> as in the
      synchronous case.
      </argcomment>
      <arg>
        <argname>proc-result</argname>
        <argtype2>
          <code>
            (:alt-maybe
            (:procedure ((:alt-maybe &lt;gobject&gt;)
          </code>
          <emphasis>result-type</emphasis>
          <code>&lt;object&gt;) &lt;none&gt; nonpure)
          </code>
          where <emphasis>result-type</emphasis> is the Theme-D type of the method return value.
          If the method does not return any value the second argument is omitted.
        </argtype2>
        <argdesc>
          <argheader-nested>
            A callback to handle the result value. Arguments:
          </argheader-nested>
          <arg-nested>
            <argname-nested>source_object</argname-nested>
            <argtype-nested>(:alt-maybe &lt;gobject&gt;)</argtype-nested>
            <argdesc-nested>
              The object the asynchronous operation was started with
            </argdesc-nested>
          </arg-nested>
          <arg-nested>
            <argname-nested>result</argname-nested>
            <argtype2-nested><emphasis>result-type</emphasis></argtype2-nested>
            <argdesc-nested>
              The result of the method call
            </argdesc-nested>
          </arg-nested>
          <arg-nested>
            <argname-nested>data</argname-nested>
            <argtype-nested>&lt;object&gt;</argtype-nested>
            <argdesc-nested>
              Auxiliary data
            </argdesc-nested>
          </arg-nested>
        </argdesc>
      </arg>
      <arg>
        <argname>l-args</argname>
        <argtype2><code>(:tuple ARG1 ... ARGN)</code>
        where <code>ARGK</code> are the argument types of the method.
        </argtype2>
        <argdesc>
            Arguments to be passed to the method. If there are no arguments to pass
            this argument is omitted.
        </argdesc>
      </arg>
      <para>
      A signal subscription takes the following arguments:
      </para>
      <argcomment>
      Arguments <code>conn</code>, <code>str-bus-name</code>, and <code>str-object-path</code>
      as before.
      </argcomment>
      <arg>
        <argname>str-arg0</argname>
        <argtype>(:alt-maybe &lt;string&gt;)</argtype>
        <argdesc>
          Contents of first string argument to match on or <code>#f</code> to match on all kinds of arguments.
        </argdesc>
      </arg>
      <arg>
        <argname>flags</argname>
        <argtype>&lt;g-dbus-signal-flags&gt;</argtype>
        <argdesc>
          Flags.
        </argdesc>
      </arg>
      <arg>
        <argname>proc-callback</argname>
        <argtype2>
          <code>
          (:procedure (&lt;g-dbus-connection&gt;
                      (:alt-maybe &lt;string&gt;)
                      &lt;string&gt;
                      &lt;string&gt;
                      &lt;string&gt;
                      (:tuple ARG1 ... ARGN)
                      &lt;object&gt;)
                      &lt;none&gt;
                      nonpure)
          </code>
          where <code>ARGK</code> are the argument types (Theme-D types)
          of the signal. If the signal takes no arguments the sixth argument is omitted.
        </argtype2>
        <argdesc>
          <argheader-nested>
            Callback to be called when the signal is emitted. Arguments:
          </argheader-nested>
          <arg-nested>
            <argname-nested>connection</argname-nested>
            <argtype-nested>&lt;g-dbus-connection&gt;</argtype-nested>
            <argdesc-nested>
              A D-Bus connection
            </argdesc-nested>
          </arg-nested>
          <arg-nested>
            <argname-nested>sender_name</argname-nested>
            <argtype-nested>(:alt-maybe &lt;string&gt;)</argtype-nested>
            <argdesc-nested>
              The unique bus name of the sender of the signal, or <code>#f</code>
              on a peer-to-peer D-Bus connection
            </argdesc-nested>
          </arg-nested>
          <arg-nested>
            <argname-nested>interface_name</argname-nested>
            <argtype-nested>&lt;string&gt;</argtype-nested>
            <argdesc-nested>
              The name of the interface the signal belongs to
            </argdesc-nested>
          </arg-nested>
          <arg-nested>
            <argname-nested>signal_name</argname-nested>
            <argtype-nested>&lt;string&gt;</argtype-nested>
            <argdesc-nested>
              The name of the signal
            </argdesc-nested>
          </arg-nested>
          <arg-nested>
            <argname-nested>l-args</argname-nested>
            <argtype-nested>(:tuple ARG1 ... ARGN)</argtype-nested>
            <argdesc-nested>
              Arguments to the signal. If the signal takes no arguments this
              argument is omitted.
            </argdesc-nested>
          </arg-nested>
          <arg-nested>
            <argname-nested>user_data</argname-nested>
            <argtype-nested>&lt;object&gt;</argtype-nested>
            <argdesc-nested>
              Auxiliary data
            </argdesc-nested>
          </arg-nested>
        </argdesc>
      </arg>
      <arg>
        <argname>x-user-data</argname>
        <argtype>&lt;object&gt;</argtype>
        <argdesc>
          Auxiliary data.
        </argdesc>
      </arg>
      <arg>
        <argname>proc-user-data-free</argname>
        <argtype>(:alt-maybe &lt;g-lib-destroy-notify&gt;)</argtype>
        <argdesc>
          Procedure to free user data.
        </argdesc>
      </arg>
    <para>
    A property getter takes arguments
    <code>conn</code>, <code>str-bus-name</code>, <code>str-object-path</code>,
    <code>flags</code>, <code>i-timeout</code>, and <code>cancellable</code>
    that are defined as before.
    </para>
    <para>
    A property setter takes arguments
    <code>conn</code>, <code>str-bus-name</code>, <code>str-object-path</code>,
    <code>x-value</code>,
    <code>flags</code>, <code>i-timeout</code>, and <code>cancellable</code>
    where the type of <code>x-value</code> is the Theme-D type of the property
    and other arguments are defined as before. Argument <code>x-value</code>
    is used to set the property.
    </para>
    <para>
    As an example, consider the example program
    <filename>introspect2/main.go</filename>.
    The introspection specification is
    &IntrIntrospection;
    The generated method declaration is
    &IntrDecl;
    and the method call
    &IntrCall;   
    </para>
    </section>
    <section>
      <title>
        D-Bus API
      </title>
      <para>
      See <ulink url="https://docs.gtk.org/gio/index.html">Gio documentation</ulink>
      for more detailed description of the GDBus API.
      See <ulink url="https://docs.gtk.org/glib/struct.Variant.html"/> for
      description of variant API.
      Virtual methods with short names are also defined for the procedures.
      A short name is obtained from the long name by stripping the type prefix away,
      e.g. <code>g-dbus-method-invocation-return-value</code> becomes
      <code>return-value</code>.
      </para>
    </section>
    <section>
      <title>
      Most important D-Bus types
      </title>
      <theme-d-type2 name="&lt;g-bus-name-owner-flags&gt;">
        <metatype>flags</metatype>
        <type-description>
          Flags used in <code>g-bus-own-name-with-closures</code>.
          Zero or more of symbols
          <code>none</code>, <code>allow-replacement</code>,
          <code>replace</code>, and <code>do-not-queue</code>.
        </type-description>
      </theme-d-type2>
      <theme-d-type name="&lt;g-bus-type&gt;">
        <metatype>enumeration</metatype>
        <type-description>
          Bus type. Possible values are
          <code>starter</code>, <code>none</code>,
          <code>system</code>, and <code>session</code>.
        </type-description>
      </theme-d-type>
      <theme-d-type name="&lt;g-cancellable&gt;">
        <metatype>class</metatype>
        <type-description>
          An object controlling cancellation of operations.
        </type-description>
      </theme-d-type>
      <theme-d-type name="&lt;g-dbus-call-flags&gt;">
        <metatype>flags</metatype>
        <type-description>
          Flags used in <code>g-dbus-connection-call</code>.
          Zero or more of symbols
          <code>none</code>, <code>no-auto-start</code>, and
          <code>allow-interactive-authorization</code>.
        </type-description>
      </theme-d-type>
      <theme-d-type name="&lt;g-dbus-connection&gt;">
        <metatype>class</metatype>
        <type-description>
          A D-Bus connection
        </type-description>
      </theme-d-type>
      <theme-d-type name="&lt;g-dbus-interface-info&gt;">
        <metatype>opaque struct</metatype>
        <type-description>
          Information about a D-Bus interface
        </type-description>
      </theme-d-type>
      <theme-d-type name="&lt;g-dbus-method-invocation&gt;">
        <metatype>class</metatype>
        <type-description>
          Instances of the <code>&lt;g-dbus-method-invocation&gt;</code>
          class are used when handling D-Bus method calls.
          It provides a way to asynchronously return results and errors.
        </type-description>
      </theme-d-type>
      <theme-d-type name="&lt;g-dbus-node-info&gt;">
        <metatype>opaque struct</metatype>
        <type-description>
          Information about nodes in a remote object hierarchy
        </type-description>
      </theme-d-type>
      <theme-d-type name="&lt;g-dbus-signal-flags&gt;">
        <metatype>flags</metatype>
        <type-description>
          Flags used when subscribing to signals via
          <code>g-dbus-connection-signal-subscribe</code>.
          Zero or more of symbols
          <code>none</code>, <code>no-match-rule</code>,
          <code>match-arg0-namespace</code>, and
          <code>match-arg0-path</code>.
        </type-description>
      </theme-d-type>
      <theme-d-type name="&lt;g-lib-destroy-notify&gt;">
        <metatype>procedure type</metatype>
        <type-description>
          A procedure used to delete a data element.
          Equal to
          <code>(:procedure (&lt;object&gt;) &lt;none&gt; nonpure)</code>.
        </type-description>
      </theme-d-type>
      <theme-d-type name="&lt;general-procedure&gt;">
        <metatype>procedure type</metatype>
        <type-description>
          Equal to <code>(:procedure ((rest &lt;object&gt;)) &lt;object&gt; nonpure)</code>.
        </type-description>
      </theme-d-type>
      <theme-d-type name="&lt;gio-async-ready-callback&gt;">
        <metatype>procedure type</metatype>
        <type-description>
          Procedure to be called when an asynchronous operation has been completes.
          Equal to
          <code>(:procedure ((:alt-maybe &lt;gobject&gt;) &lt;object&gt; &lt;object&gt;) &lt;none&gt; nonpure)</code>.
          <argheader-nested>
          The arguments are:
          </argheader-nested>
          <arg-nested>
            <argname-nested>source_object</argname-nested>
            <argtype-nested>(:alt-maybe &lt;gobject&gt;)</argtype-nested>
            <argdesc-nested>
              The object the asynchronous operation was started with
            </argdesc-nested>
          </arg-nested>
          <arg-nested>
            <argname-nested>res</argname-nested>
            <argtype-nested>&lt;object&gt;</argtype-nested>
            <argdesc-nested>
              An async ready object to be used in
              <code>g-dbus-connection-call-finish</code>.
            </argdesc-nested>
          </arg-nested>
          <arg-nested>
            <argname-nested>data</argname-nested>
            <argtype-nested>&lt;object&gt;</argtype-nested>
            <argdesc-nested>
              Auxiliary data
            </argdesc-nested>
          </arg-nested>
        </type-description>
      </theme-d-type>
      <theme-d-type name="&lt;gio-d-bus-signal-callback&gt;">
        <metatype>procedure type</metatype>
        <type-description>
          A callback procedure to be used in
          <code>g-dbus-connection-signal-subscribe</code>.
          Equal to
          <code>(:procedure (&lt;g-dbus-connection&gt; 
            (:alt-maybe &lt;string&gt;) &lt;string&gt; &lt;string&gt; &lt;string&gt; &lt;g-variant&gt; &lt;object&gt;) &lt;none&gt; nonpure)</code>.
          <argheader-nested>
          The arguments are:
          </argheader-nested>
          <arg-nested>
            <argname-nested>connection</argname-nested>
            <argtype-nested>&lt;g-dbus-connection&gt;</argtype-nested>
            <argdesc-nested>
              A D-Bus connection
            </argdesc-nested>
          </arg-nested>
          <arg-nested>
            <argname-nested>sender_name</argname-nested>
            <argtype-nested>(:alt-maybe &lt;string&gt;)</argtype-nested>
            <argdesc-nested>
              The unique bus name of the sender of the signal, or <code>#f</code>
              on a peer-to-peer D-Bus connection
            </argdesc-nested>
          </arg-nested>
          <arg-nested>
            <argname-nested>interface_name</argname-nested>
            <argtype-nested>&lt;string&gt;</argtype-nested>
            <argdesc-nested>
              The name of the interface the signal belongs to
            </argdesc-nested>
          </arg-nested>
          <arg-nested>
            <argname-nested>signal_name</argname-nested>
            <argtype-nested>&lt;string&gt;</argtype-nested>
            <argdesc-nested>
              The name of the signal
            </argdesc-nested>
          </arg-nested>
          <arg-nested>
            <argname-nested>parameters</argname-nested>
            <argtype-nested>&lt;g-variant&gt;</argtype-nested>
            <argdesc-nested>
              A <code>&lt;g-variant&gt;</code> tuple with parameters for the signal.
            </argdesc-nested>
          </arg-nested>
          <arg-nested>
            <argname-nested>user_data</argname-nested>
            <argtype-nested>&lt;object&gt;</argtype-nested>
            <argdesc-nested>
              Auxiliary data
            </argdesc-nested>
          </arg-nested>
        </type-description>
      </theme-d-type>
    </section>
    <section>
      <title>
      Most important D-Bus procedures
      </title>
      <procedure2 name="g-bus-get-sync">
        <description>
          Synchronously connects to the message bus specified by
          <code>bus_type</code>.
        </description>
        <arguments>
          <arg>
            <argname>bus_type</argname>
            <argtype>&lt;g-bus-type&gt;</argtype>
            <argdesc>
              The type of bus to own a name on
            </argdesc>
          </arg>
          <arg>
            <argname>cancellable</argname>
            <argtype>(:alt-maybe &lt;g-cancellable&gt;)</argtype>
            <argdesc>
              An object to control the cancellation of the connection.
              The data is owned by the caller of the method.
              This argument can be <code>#f</code>.
            </argdesc>
          </arg>
        </arguments>
        <result-value>
          A D-Bus connection
        </result-value>
        <result-type>
          &lt;g-dbus-connection&gt;
        </result-type>
      </procedure2>
      <procedure name="g-bus-own-name-with-closures">
        <description>
          Requests ownership of a name
        </description>
        <arguments>
          <arg>
            <argname>bus_type</argname>
            <argtype>&lt;g-bus-type&gt;</argtype>
            <argdesc>
              The type of bus to own a name on
            </argdesc>
          </arg>
          <arg>
            <argname>name</argname>
            <argtype>&lt;string&gt;</argtype>
            <argdesc>
              The name to own
            </argdesc>
          </arg>
          <arg>
            <argname>flags</argname>
            <argtype>&lt;g-bus-name-owner-flags&gt;</argtype>
            <argdesc>
              Flags with ownership options
            </argdesc>
          </arg>
          <arg>
            <argname>bus_acquired_closure</argname>
            <argtype>(:alt-maybe &lt;general-procedure&gt;)</argtype>
            <argdesc>
              <argheader-nested>
              Closure to invoke when connected to the bus of type bus_type,
              or <code>#f</code> to ignore.
              This procedure shall take the following arguments:
              </argheader-nested>
              <arg-nested>
                <argname-nested>connection</argname-nested>
                <argtype-nested>&lt;g-dbus-connection&gt;</argtype-nested>
                <argdesc-nested>
                  A D-Bus connection
                </argdesc-nested>
              </arg-nested>
              <arg-nested>
                <argname-nested>name</argname-nested>
                <argtype-nested>&lt;string&gt;</argtype-nested>
                <argdesc-nested>
                  The name that is requested to be owned
                </argdesc-nested>
              </arg-nested>
            </argdesc>
          </arg>
          <arg>
            <argname>name_acquired_closure</argname>
            <argtype>(:alt-maybe &lt;general-procedure&gt;)</argtype>
            <argdesc>
              <argheader-nested>
              Procedure to invoke when name is acquired, or
              <code>#f</code> to ignore.
              This procedure shall take the following arguments:
              </argheader-nested>
              <arg-nested>
                <argname-nested>connection</argname-nested>
                <argtype-nested>&lt;g-dbus-connection&gt;</argtype-nested>
                <argdesc-nested>
                  A D-Bus connection
                </argdesc-nested>
              </arg-nested>
              <arg-nested>
                <argname-nested>name</argname-nested>
                <argtype-nested>&lt;string&gt;</argtype-nested>
                <argdesc-nested>
                  The name being owned
                </argdesc-nested>
              </arg-nested>
            </argdesc>
          </arg>
          <arg>
            <argname>name_lost_closure</argname>
            <argtype>(:alt-maybe &lt;general-procedure&gt;)</argtype>
            <argdesc>
              <argheader-nested>
              Procedure to invoke when name is lost, or
              <code>#f</code> to ignore.
              This procedure shall take the following arguments:
              </argheader-nested>
              <arg-nested>
                <argname-nested>connection</argname-nested>
                <argtype-nested>&lt;g-dbus-connection&gt;</argtype-nested>
                <argdesc-nested>
                  A D-Bus connection
                </argdesc-nested>
              </arg-nested>
              <arg-nested>
                <argname-nested>name</argname-nested>
                <argtype-nested>&lt;string&gt;</argtype-nested>
                <argdesc-nested>
                  The name being owned
                </argdesc-nested>
              </arg-nested>
            </argdesc>
          </arg>
        </arguments>
        <result-value>
          An identifier (never 0) that can be used with
          <code>g-bus-unown-name</code>
          to stop owning the name.
        </result-value>
        <result-type>
          &lt;integer&gt;
        </result-type>
      </procedure>
      <procedure name="g-dbus-connection-call">
        <description>
          This procedure calls a method asynchronously.
        </description>
        <arguments>
          <arg>
            <argname>connection</argname>
            <argtype>&lt;g-dbus-connection&gt;</argtype>
            <argdesc>
              A D-Bus connection
            </argdesc>
          </arg>
          <arg>
            <argname>bus_name</argname>
            <argtype>&lt;string&gt;</argtype>
            <argdesc>
              The bus name of the method call
            </argdesc>
          </arg>
          <arg>
            <argname>object_path</argname>
            <argtype>&lt;string&gt;</argtype>
            <argdesc>
              The path of the object the method is applied to
            </argdesc>
          </arg>
          <arg>
            <argname>interface_name</argname>
            <argtype>&lt;string&gt;</argtype>
            <argdesc>
              The name of the interface containing the method
            </argdesc>
          </arg>
          <arg>
            <argname>method_name</argname>
            <argtype>&lt;string&gt;</argtype>
            <argdesc>
              The name of the method
            </argdesc>
          </arg>
          <arg>
            <argname>parameters</argname>
            <argtype>(:alt-maybe &lt;g-variant&gt;)</argtype>
            <argdesc>
              The parameters to be passed to the method.
              This argument has to be a <code>&lt;g-variant&gt;</code>
              tuple or <code>#f</code>.        
            </argdesc>
          </arg>
          <arg>
            <argname>reply_type</argname>
            <argtype>(:alt-maybe &lt;g-variant-type&gt;)</argtype>
            <argdesc>
              The type of the result value of the method.
              This value has to be either a tuple variant type or <code>#f</code>.
            </argdesc>
          </arg>
          <arg>
            <argname>flags</argname>
            <argtype>&lt;g-dbus-call-flags&gt;</argtype>
            <argdesc>
              Flags affecting the call.
            </argdesc>
          </arg>
          <arg>
            <argname>timeout_msec</argname>
            <argtype>&lt;integer&gt;</argtype>
            <argdesc>
              The timeout in milliseconds, -1 to use the default timeout.
              Use the value of Glib macro <code>G_MAXINT</code> for no timeout.
              This value is the largest value that C type <code>int</code> can
              contain and it is typically 0x7fffffff.
            </argdesc>
          </arg>
          <arg>
            <argname>cancellable</argname>
            <argtype>(:alt-maybe &lt;g-cancellable&gt;)</argtype>
            <argdesc>
              An object to control the cancellation of the method.
              The data is owned by the caller of the method.
              This argument can be <code>#f</code>.
            </argdesc>
          </arg>
          <arg>
            <argname>callback</argname>
            <argtype>(:alt-maybe &lt;gio-async-ready-callback&gt;)</argtype>
            <argdesc>
              A callback to handle the result of the method.
            </argdesc>
          </arg>
          <arg>
            <argname>user_data</argname>
            <argtype>&lt;object&gt;</argtype>
            <argdesc>
              Data to be passed to the callback.
            </argdesc>
          </arg>
        </arguments>
        <result-value>
          None
        </result-value>
        <result-type>
          &lt;none&gt;
        </result-type>
      </procedure>
      <procedure name="g-dbus-connection-call-finish">
        <description>
          This procedure finishes the method call started by
          <code>g-dbus-connection-call</code>
        </description>
        <arguments>
          <arg>
            <argname>connection</argname>
            <argtype>&lt;g-dbus-connection&gt;</argtype>
            <argdesc>
              A D-Bus connection
            </argdesc>
          </arg>
          <arg>
            <argname>res</argname>
            <argtype>&lt;object&gt;</argtype>
            <argdesc>
              An object obtained from the callback passed to
              <code>g-dbus-connection-call</code>.
            </argdesc>
          </arg>
        </arguments>
      </procedure>
      <procedure name="g-dbus-connection-call-sync">
        <description>
          This procedure calls a method synchronously.
        </description>
        <arguments>
          <arg>
            <argname>connection</argname>
            <argtype>&lt;g-dbus-connection&gt;</argtype>
            <argdesc>
              A D-Bus connection
            </argdesc>
          </arg>
          <arg>
            <argname>bus_name</argname>
            <argtype>&lt;string&gt;</argtype>
            <argdesc>
              The bus name of the method call
            </argdesc>
          </arg>
          <arg>
            <argname>object_path</argname>
            <argtype>&lt;string&gt;</argtype>
            <argdesc>
              The path of the object the method is applied to
            </argdesc>
          </arg>
          <arg>
            <argname>interface_name</argname>
            <argtype>&lt;string&gt;</argtype>
            <argdesc>
              The name of the interface containing the method
            </argdesc>
          </arg>
          <arg>
            <argname>method_name</argname>
            <argtype>&lt;string&gt;</argtype>
            <argdesc>
              The name of the method
            </argdesc>
          </arg>
          <arg>
            <argname>parameters</argname>
            <argtype>(:alt-maybe &lt;g-variant&gt;)</argtype>
            <argdesc>
              The parameters to be passed to the method.
              This argument has to be a <code>&lt;g-variant&gt;</code>
              tuple or <code>#f</code>.        
            </argdesc>
          </arg>
          <arg>
            <argname>reply_type</argname>
            <argtype>(:alt-maybe &lt;g-variant-type&gt;)</argtype>
            <argdesc>
              The type of the result value of the method.
              This value has to be either a tuple variant type or <code>#f</code>.
            </argdesc>
          </arg>
          <arg>
            <argname>flags</argname>
            <argtype>&lt;g-dbus-call-flags&gt;</argtype>
            <argdesc>
              Flags affecting the call.
            </argdesc>
          </arg>
          <arg>
            <argname>timeout_msec</argname>
            <argtype>&lt;integer&gt;</argtype>
            <argdesc>
              The timeout in milliseconds, -1 to use the default timeout.
              Use the value of Glib macro <code>G_MAXINT</code> for no timeout.
              This value is the largest value that C type <code>int</code> can
              contain and it is typically 0x7fffffff.
            </argdesc>
          </arg>
          <arg>
            <argname>cancellable</argname>
            <argtype>(:alt-maybe &lt;g-cancellable&gt;)</argtype>
            <argdesc>
              An object to control the cancellation of the method.
              The data is owned by the caller of the method.
              This argument can be <code>#f</code>.
            </argdesc>
          </arg>
        </arguments>
        <result-value>
          The value returned from the method
        </result-value>
        <result-type>
          &lt;g-variant&gt;
        </result-type>
      </procedure>
      <procedure name="g-dbus-connection-emit-signal">
        <description>
          This procedure emits a signal.
        </description>
        <arguments>
          <arg>
            <argname>connection</argname>
            <argtype>&lt;g-dbus-connection&gt;</argtype>
            <argdesc>
              A D-Bus connection
            </argdesc>
          </arg>
          <arg>
            <argname>destination_bus_name</argname>
            <argtype>(:alt-maybe &lt;string&gt;)</argtype>
            <argdesc>
              The unique bus name for the destination for the signal or
              <code>#f</code> to emit to all listeners.
            </argdesc>
          </arg>
          <arg>
            <argname>object_path</argname>
            <argtype>&lt;string&gt;</argtype>
            <argdesc>
              The object emitting the signal.
            </argdesc>
          </arg>
          <arg>
            <argname>interface_name</argname>
            <argtype>&lt;string&gt;</argtype>
            <argdesc>
              D-Bus interface to emit a signal on.
            </argdesc>
          </arg>
          <arg>
            <argname>signal_name</argname>
            <argtype>&lt;string&gt;</argtype>
            <argdesc>
              The name of the signal.
            </argdesc>
          </arg>
          <arg>
            <argname>parameters</argname>
            <argtype>(:alt-maybe &lt;g-variant&gt;)</argtype>
            <argdesc>
              The parameters to the signal. This argument has to be
              a <code>&lt;g-variant&gt;</code> tuple or <code>#f</code> if
              there are no parameters.
            </argdesc>
          </arg>
        </arguments>
        <result-value>
          <code>#t</code> if there were no errors emitting the signal.
        </result-value>
        <result-type>
          &lt;boolean&gt;
        </result-type>
      </procedure>
      <procedure name="g-dbus-connection-register-object-with-closures2">
        <description>
          Registers callbacks for exported objects.
        </description>
        <arguments>
          <arg>
            <argname>connection</argname>
            <argtype>&lt;g-dbus-connection&gt;</argtype>
            <argdesc>
              A D-Bus connection
            </argdesc>
          </arg>
          <arg>
            <argname>object_path</argname>
            <argtype>&lt;string&gt;</argtype>
            <argdesc>
              The object path to register at.
            </argdesc>
          </arg>
          <arg>
            <argname>interface_info</argname>
            <argtype>&lt;g-dbus-interface-info&gt;</argtype>
            <argdesc>
              Introspection data for the interface.
            </argdesc>
          </arg>
          <arg>
            <argname>method_call_closure</argname>
            <argtype>(:alt-maybe &lt;general-procedure&gt;)</argtype>
            <argdesc>
              <argheader-nested>
              Procedure for handling incoming method calls.
              This procedure shall take the following arguments:
              </argheader-nested>
              <arg-nested>
                <argname-nested>connection</argname-nested>
                <argtype-nested>&lt;g-dbus-connection&gt;</argtype-nested>
                <argdesc-nested>
                  A D-Bus connection
                </argdesc-nested>
              </arg-nested>
              <arg-nested>
                <argname-nested>sender</argname-nested>
                <argtype-nested>(:alt-maybe &lt;string&gt;)</argtype-nested>
                <argdesc-nested>
                  The unique bus name of the remote caller, or <code>#f</code>
                  if not specified by the caller, e.g. on peer-to-peer connections
                </argdesc-nested>
              </arg-nested>
              <arg-nested>
                <argname-nested>object_path</argname-nested>
                <argtype-nested>&lt;string&gt;</argtype-nested>
                <argdesc-nested>
                  The object path that the method was invoked on.
                </argdesc-nested>
              </arg-nested>
              <arg-nested>
                <argname-nested>interface_name</argname-nested>
                <argtype-nested>(:alt-maybe &lt;string&gt;)</argtype-nested>
                <argdesc-nested>
                  The D-Bus interface name the method was invoked on, or
                  <code>#f</code> if not specified by the sender
                </argdesc-nested>
              </arg-nested>
              <arg-nested>
                <argname-nested>method_name</argname-nested>
                <argtype-nested>&lt;string&gt;</argtype-nested>
                <argdesc-nested>
                  The name of the method
                </argdesc-nested>
              </arg-nested>
              <arg-nested>
                <argname-nested>parameters</argname-nested>
                <argtype-nested>&lt;g-variant&gt;</argtype-nested>
                <argdesc-nested>
                  A <code>&lt;g-variant&gt;</code> tuple with parameters
                  to the method
                </argdesc-nested>
              </arg-nested>
              <arg-nested>
                <argname-nested>invocation</argname-nested>
                <argtype-nested>&lt;g-dbus-method-invocation&gt;</argtype-nested>
                <argdesc-nested>
                  A <code>&lt;g-dbus-method-invocation&gt;</code> object that must
                  be used to return a value or error.
                </argdesc-nested>
              </arg-nested>
            </argdesc>
          </arg>
          <arg>
            <argname>get_property_closure</argname>
            <argtype>(:alt-maybe &lt;general-procedure&gt;)</argtype>
            <argdesc>
              <argheader-nested>
              Procedure for getting a property.
              This procedure shall take the following arguments:
              </argheader-nested>
              <arg-nested>
                <argname-nested>connection</argname-nested>
                <argtype-nested>&lt;g-dbus-connection&gt;</argtype-nested>
                <argdesc-nested>
                  A D-Bus connection
                </argdesc-nested>
              </arg-nested>
              <arg-nested>
                <argname-nested>sender</argname-nested>
                <argtype-nested>(:alt-maybe &lt;string&gt;)</argtype-nested>
                <argdesc-nested>
                  The unique bus name of the remote caller, or <code>#f</code>
                  if not specified by the caller, e.g. on peer-to-peer connections
                </argdesc-nested>
              </arg-nested>
              <arg-nested>
                <argname-nested>object_path</argname-nested>
                <argtype-nested>&lt;string&gt;</argtype-nested>
                <argdesc-nested>
                  The object path that the method was invoked on.
                </argdesc-nested>
              </arg-nested>
              <arg-nested>
                <argname-nested>interface_name</argname-nested>
                <argtype-nested>(:alt-maybe &lt;string&gt;)</argtype-nested>
                <argdesc-nested>
                  The D-Bus interface name the method was invoked on, or
                  <code>#f</code> if not specified by the sender
                </argdesc-nested>
              </arg-nested>
              <arg-nested>
                <argname-nested>property_name</argname-nested>
                <argtype-nested>&lt;string&gt;</argtype-nested>
                <argdesc-nested>
                  The name of the property
                </argdesc-nested>
              </arg-nested>
            </argdesc>
          </arg>
          <arg>
            <argname>set_property_closure</argname>
            <argtype>(:alt-maybe &lt;general-procedure&gt;)</argtype>
            <argdesc>
              <argheader-nested>
              Procedure for setting a property.
              This procedure shall take the following arguments:
              </argheader-nested>
              <arg-nested>
                <argname-nested>connection</argname-nested>
                <argtype-nested>&lt;g-dbus-connection&gt;</argtype-nested>
                <argdesc-nested>
                  A D-Bus connection
                </argdesc-nested>
              </arg-nested>
              <arg-nested>
                <argname-nested>sender</argname-nested>
                <argtype-nested>(:alt-maybe &lt;string&gt;)</argtype-nested>
                <argdesc-nested>
                  The unique bus name of the remote caller, or <code>#f</code>
                  if not specified by the caller, e.g. on peer-to-peer connections
                </argdesc-nested>
              </arg-nested>
              <arg-nested>
                <argname-nested>object_path</argname-nested>
                <argtype-nested>&lt;string&gt;</argtype-nested>
                <argdesc-nested>
                  The object path that the method was invoked on.
                </argdesc-nested>
              </arg-nested>
              <arg-nested>
                <argname-nested>interface_name</argname-nested>
                <argtype-nested>(:alt-maybe &lt;string&gt;)</argtype-nested>
                <argdesc-nested>
                  The D-Bus interface name the method was invoked on, or
                  <code>#f</code> if not specified by the sender
                </argdesc-nested>
              </arg-nested>
              <arg-nested>
                <argname-nested>property_name</argname-nested>
                <argtype-nested>&lt;string&gt;</argtype-nested>
                <argdesc-nested>
                  The name of the property
                </argdesc-nested>
              </arg-nested>
              <arg-nested>
                <argname-nested>value</argname-nested>
                <argtype-nested>&lt;g-variant&gt;</argtype-nested>
                <argdesc-nested>
                  The value to set the property to.
                </argdesc-nested>
              </arg-nested>
            </argdesc>
          </arg>
        </arguments>
        <result-value>
          0 if there was an error, otherwise a registration ID (never 0)
        </result-value>
        <result-type>
          &lt;integer&gt;
        </result-type>
      </procedure>
      <procedure name="g-dbus-connection-signal-subscribe">
        <description>
          Subscribes to signal on the connection and invokes a callback
          whenever the signal is received.
        </description>
        <arguments>
          <arg>
            <argname>connection</argname>
            <argtype>&lt;g-dbus-connection&gt;</argtype>
            <argdesc>
              A D-Bus connection
            </argdesc>
          </arg>
          <arg>
            <argname>sender</argname>
            <argtype>(:alt-maybe &lt;string&gt;)</argtype>
            <argdesc>
              Sender name to match on or <code>#f</code> to match all senders
            </argdesc>
          </arg>
          <arg>
            <argname>interface_name</argname>
            <argtype>(:alt-maybe &lt;string&gt;)</argtype>
            <argdesc>
              Interface name to match on or <code>#f</code> to match all interfaces
            </argdesc>
          </arg>
          <arg>
            <argname>member</argname>
            <argtype>(:alt-maybe &lt;string&gt;)</argtype>
            <argdesc>
              Signal name to match on or <code>#f</code> to match all signals
            </argdesc>
          </arg>
          <arg>
            <argname>object_path</argname>
            <argtype>(:alt-maybe &lt;string&gt;)</argtype>
            <argdesc>
              Object paths to match on or <code>#f</code> to match all object paths
            </argdesc>
          </arg>
          <arg>
            <argname>arg0</argname>
            <argtype>(:alt-maybe &lt;string&gt;)</argtype>
            <argdesc>
              Contents of the first string argument to match on or <code>#f</code> to match all
              kinds of arguments
            </argdesc>
          </arg>
          <arg>
            <argname>flags</argname>
            <argtype>&lt;g-dbus-signal-flags&gt;</argtype>
            <argdesc>
              Flags affecting the subscription
            </argdesc>
          </arg>
          <arg>
            <argname>callback</argname>
            <argtype>&lt;gio-d-bus-signal-callback&gt;</argtype>
            <argdesc>
              Callback to invoke when there is a signal matching the requested data.
            </argdesc>
          </arg>
          <arg>
            <argname>user_data</argname>
            <argtype>&lt;object&gt;</argtype>
            <argdesc>
              Data to be passed to the callback.
            </argdesc>
          </arg>
          <arg>
            <argname>user_data_free_func</argname>
            <argtype>(:alt-maybe &lt;g-lib-destroy-notify&gt;)</argtype>
            <argdesc>
              Procedure to free the user data.
            </argdesc>
          </arg>
        </arguments>
        <result-value>
          A subscription identifier that can be used to unsubscribe from
          the signal with <code>g-dbus-connection-signal-unsubscribe</code>.
        </result-value>
        <result-type>
          &lt;integer&gt;
        </result-type>
      </procedure>
      <procedure name="g-dbus-connection-signal-unsubscribe">
        <description>
          Ubsubscribes from signals.
        </description>
        <arguments>
          <arg>
            <argname>connection</argname>
            <argtype>&lt;g-dbus-connection&gt;</argtype>
            <argdesc>
              A D-Bus connection
            </argdesc>
          </arg>
          <arg>
            <argname>subscription_id</argname>
            <argtype>&lt;integer&gt;</argtype>
            <argdesc>
              A subscription id obtained from
              <code>g-dbus-connection-signal-subscribe</code>
            </argdesc>
          </arg>
        </arguments>
        <result-value>
          None
        </result-value>
        <result-type>
          &lt;none&gt;
        </result-type>
      </procedure>
      <procedure name="g-dbus-connection-unregister-object">
        <description>
          Ubsubscribes from signals.
        </description>
        <arguments>
          <arg>
            <argname>connection</argname>
            <argtype>&lt;g-dbus-connection&gt;</argtype>
            <argdesc>
              A D-Bus connection
            </argdesc>
          </arg>
          <arg>
            <argname>registration_id</argname>
            <argtype>&lt;integer&gt;</argtype>
            <argdesc>
              A registration id obtained from
              <code>g-dbus-connection-register-object-with-closures2</code>
            </argdesc>
          </arg>
        </arguments>
        <result-value>
          <code>#t</code> if the object was unregistered,
          <code>#f</code> otherwise
        </result-value>
        <result-type>
          &lt;boolean&gt;
        </result-type>
      </procedure>
      <procedure name="g-dbus-method-invocation-return-value">
        <description>
          Finishes handling of a method call by returning parameters.
        </description>
        <arguments>
          <arg>
            <argname>invocation</argname>
            <argtype>&lt;g-dbus-method-invocation&gt;</argtype>
            <argdesc>
              D-Bus method invocation object
            </argdesc>
          </arg>
          <arg>
            <argname>parameters</argname>
            <argtype>(:alt-maybe &lt;g-variant&gt;)</argtype>
            <argdesc>
              The parameters to return.
              This value has to be a <code>&lt;g-variant&gt;</code>
              tuple or <code>#f</code>.
            </argdesc>
          </arg>
        </arguments>
        <result-value>
          None
        </result-value>
        <result-type>
          &lt;none&gt;
        </result-type>
      </procedure>
      <procedure name="g-dbus-node-info-lookup-interface">
        <description>
          Looks up interface from node info.
        </description>
        <arguments>
          <arg>
            <argname>info</argname>
            <argtype>&lt;g-dbus-node-info&gt;</argtype>
            <argdesc>
              D-Bus node info
            </argdesc>
          </arg>
          <arg>
            <argname>name</argname>
            <argtype>&lt;string&gt;</argtype>
            <argdesc>
              D-Bus interface name
            </argdesc>
          </arg>
        </arguments>
        <result-value>
          A <code>&lt;g-dbus-interface-info&gt;</code>
          or <code>#f</code> if no interface found
        </result-value>
        <result-type>
          (:alt-maybe &lt;g-dbus-interface-info&gt;)
        </result-type>
      </procedure>
      <procedure name="g-dbus-node-info-new-for-xml">
        <description>
          Creates node info representing XML code.
        </description>
        <arguments>
          <arg>
            <argname>xml_data</argname>
            <argtype>&lt;string&gt;</argtype>
            <argdesc>
              XML code
            </argdesc>
          </arg>
        </arguments>
        <result-value>
          A <code>&lt;g-dbus-node-info&gt;</code> structure
        </result-value>
        <result-type>
          &lt;g-dbus-node-info&gt;
        </result-type>
      </procedure>
    </section>
    <section>
      <title>
      Other things
      </title>
      <para>
      Command
      <programlisting>
        dbus-introspect bus-name object
      </programlisting>
      prints an XML specification of the D-Bus interfaces
      supported by a D-Bus object.
      </para>
    </section>
  </section>
</article>
