2007-12-17 18:28:40 +01:00
|
|
|
<part>
|
|
|
|
<title>GIO Overview</title>
|
|
|
|
|
2010-04-17 06:31:41 +02:00
|
|
|
<chapter>
|
2007-12-18 04:14:39 +01:00
|
|
|
<title>Introduction</title>
|
|
|
|
|
2007-12-18 01:56:35 +01:00
|
|
|
<para>
|
2007-12-18 04:14:39 +01:00
|
|
|
GIO is striving to provide a modern, easy-to-use VFS API that sits
|
2007-12-18 01:56:35 +01:00
|
|
|
at the right level in the library stack. The goal is to overcome the
|
2007-12-18 04:14:39 +01:00
|
|
|
shortcomings of GnomeVFS and provide an API that is so good that
|
2007-12-18 01:56:35 +01:00
|
|
|
developers prefer it over raw POSIX calls. Among other things
|
2010-04-17 06:31:41 +02:00
|
|
|
that means using GObject. It also means not cloning the POSIX
|
2007-12-19 12:19:12 +01:00
|
|
|
API, but providing higher-level, document-centric interfaces.
|
2007-12-18 01:56:35 +01:00
|
|
|
</para>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
The abstract file system model of GIO consists of a number of
|
|
|
|
interfaces and base classes for I/O and files:
|
|
|
|
<variablelist>
|
|
|
|
<varlistentry>
|
|
|
|
<term>GFile</term>
|
|
|
|
<listitem><para>reference to a file</para></listitem>
|
|
|
|
</varlistentry>
|
|
|
|
<varlistentry>
|
|
|
|
<term>GFileInfo</term>
|
|
|
|
<listitem><para>information about a file or filesystem</para></listitem>
|
|
|
|
</varlistentry>
|
|
|
|
<varlistentry>
|
|
|
|
<term>GFileEnumerator</term>
|
|
|
|
<listitem><para>list files in directories</para></listitem>
|
|
|
|
</varlistentry>
|
|
|
|
<varlistentry>
|
|
|
|
<term>GDrive</term>
|
|
|
|
<listitem><para>represents a drive</para></listitem>
|
|
|
|
</varlistentry>
|
|
|
|
<varlistentry>
|
|
|
|
<term>GVolume</term>
|
|
|
|
<listitem><para>represents a file system in an abstract way</para></listitem>
|
|
|
|
</varlistentry>
|
|
|
|
<varlistentry>
|
|
|
|
<term>GMount</term>
|
|
|
|
<listitem><para>represents a mounted file system</para></listitem>
|
|
|
|
</varlistentry>
|
|
|
|
</variablelist>
|
|
|
|
Then there is a number of stream classes, similar to the input and
|
|
|
|
output stream hierarchies that can be found in frameworks like Java:
|
|
|
|
<variablelist>
|
|
|
|
<varlistentry>
|
|
|
|
<term>GInputStream</term>
|
|
|
|
<listitem><para>read data</para></listitem>
|
|
|
|
</varlistentry>
|
|
|
|
<varlistentry>
|
|
|
|
<term>GOutputStream</term>
|
|
|
|
<listitem><para>write data</para></listitem>
|
|
|
|
</varlistentry>
|
2009-05-18 13:02:11 +02:00
|
|
|
<varlistentry>
|
|
|
|
<term>GIOStream</term>
|
|
|
|
<listitem><para>read and write data</para></listitem>
|
|
|
|
</varlistentry>
|
2007-12-18 01:56:35 +01:00
|
|
|
<varlistentry>
|
|
|
|
<term>GSeekable</term>
|
2007-12-19 12:19:12 +01:00
|
|
|
<listitem><para>interface optionally implemented by streams to support seeking</para></listitem>
|
2007-12-18 01:56:35 +01:00
|
|
|
</varlistentry>
|
|
|
|
</variablelist>
|
|
|
|
There are interfaces related to applications and the types
|
|
|
|
of files they handle:
|
|
|
|
<variablelist>
|
|
|
|
<varlistentry>
|
|
|
|
<term>GAppInfo</term>
|
|
|
|
<listitem><para>information about an installed application</para></listitem>
|
|
|
|
</varlistentry>
|
|
|
|
<varlistentry>
|
|
|
|
<term>GIcon</term>
|
|
|
|
<listitem><para>abstract type for file and application icons</para></listitem>
|
|
|
|
</varlistentry>
|
|
|
|
</variablelist>
|
2010-04-17 06:31:41 +02:00
|
|
|
There is a framework for storing and retrieving application settings:
|
|
|
|
<variablelist>
|
|
|
|
<varlistentry>
|
|
|
|
<term>GSettings</term>
|
|
|
|
<listitem><para>stores and retrieves application settings</para></listitem>
|
|
|
|
</varlistentry>
|
|
|
|
</variablelist>
|
2009-05-18 13:02:11 +02:00
|
|
|
There is support for network programming, including name resolution, lowlevel socket
|
|
|
|
APIs and highlevel client and server helper classes:
|
|
|
|
<variablelist>
|
|
|
|
<varlistentry>
|
|
|
|
<term>GSocket</term>
|
|
|
|
<listitem><para>lowlevel platform independent socket object</para></listitem>
|
|
|
|
</varlistentry>
|
|
|
|
<varlistentry>
|
|
|
|
<term>GResolver</term>
|
|
|
|
<listitem><para>asynchronous and cancellable DNS resolver</para></listitem>
|
|
|
|
</varlistentry>
|
|
|
|
<varlistentry>
|
|
|
|
<term>GSocketClient</term>
|
|
|
|
<listitem><para>high-level network client helper</para></listitem>
|
|
|
|
</varlistentry>
|
|
|
|
<varlistentry>
|
|
|
|
<term>GSocketService</term>
|
|
|
|
<listitem><para>high-level network server helper</para></listitem>
|
|
|
|
</varlistentry>
|
|
|
|
<varlistentry>
|
|
|
|
<term>GSocketConnection</term>
|
|
|
|
<listitem><para>network connection stream</para></listitem>
|
|
|
|
</varlistentry>
|
|
|
|
</variablelist>
|
2010-05-09 07:44:11 +02:00
|
|
|
There is support for connecting to <link linkend="http://www.freedesktop.org/wiki/Software/dbus">D-Bus</link>,
|
|
|
|
sending and receiving messages, owning and watching bus names,
|
|
|
|
and making objects available on the bus:
|
2010-05-07 00:15:00 +02:00
|
|
|
<variablelist>
|
|
|
|
<varlistentry>
|
|
|
|
<term>GDBusConnection</term>
|
|
|
|
<listitem><para>a D-Bus connection</para></listitem>
|
|
|
|
</varlistentry>
|
|
|
|
|
|
|
|
<varlistentry>
|
|
|
|
<term>GDBusMethodInvocation</term>
|
|
|
|
<listitem><para>for handling remove calls</para></listitem>
|
|
|
|
</varlistentry>
|
|
|
|
|
|
|
|
<varlistentry>
|
|
|
|
<term>GDBusServer</term>
|
|
|
|
<listitem><para>helper for accepting connections</para></listitem>
|
|
|
|
</varlistentry>
|
|
|
|
|
|
|
|
<varlistentry>
|
|
|
|
<term>GDBusProxy</term>
|
|
|
|
<listitem><para>proxy to access D-Bus interfaces on a remote object</para></listitem>
|
|
|
|
</varlistentry>
|
|
|
|
|
|
|
|
</variablelist>
|
2007-12-18 01:56:35 +01:00
|
|
|
Beyond these, GIO provides facilities for file monitoring,
|
2010-04-17 06:31:41 +02:00
|
|
|
asynchronous I/O and filename completion. In addition to the
|
|
|
|
interfaces, GIO provides implementations for the local case.
|
|
|
|
Implementations for various network file systems are provided
|
2007-12-18 01:56:35 +01:00
|
|
|
by the GVFS package as loadable modules.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<para>
|
2007-12-18 04:14:39 +01:00
|
|
|
Other design choices which consciously break with the GnomeVFS
|
2007-12-18 01:56:35 +01:00
|
|
|
design are to move backends out-of-process, which minimizes the
|
|
|
|
dependency bloat and makes the whole system more robust. The backends
|
2010-04-17 06:31:41 +02:00
|
|
|
are not included in GIO, but in the separate GVFS package. The GVFS
|
|
|
|
package also contains the GVFS daemon, which spawn further mount
|
2007-12-18 04:14:39 +01:00
|
|
|
daemons for each individual connection.
|
2007-12-18 01:56:35 +01:00
|
|
|
</para>
|
|
|
|
|
2007-12-18 04:14:39 +01:00
|
|
|
<figure id="gvfs-overview">
|
|
|
|
<title>GIO in the GTK+ library stack</title>
|
|
|
|
<graphic fileref="gvfs-overview.png" format="PNG"></graphic>
|
|
|
|
</figure>
|
2007-12-17 18:28:40 +01:00
|
|
|
|
2007-12-18 01:56:35 +01:00
|
|
|
<para>
|
2010-04-17 06:31:41 +02:00
|
|
|
The GIO model of I/O is stateful: if an application establishes e.g.
|
|
|
|
a SFTP connection to a server, it becomes available to all applications
|
|
|
|
in the session; the user does not have to enter his password over
|
2007-12-18 01:56:35 +01:00
|
|
|
and over again.
|
|
|
|
</para>
|
|
|
|
<para>
|
2010-04-17 06:31:41 +02:00
|
|
|
One of the big advantages of putting the VFS in the GLib layer
|
2007-12-18 01:56:35 +01:00
|
|
|
is that GTK+ can directly use it, e.g. in the filechooser.
|
|
|
|
</para>
|
2007-12-18 04:14:39 +01:00
|
|
|
</chapter>
|
|
|
|
|
|
|
|
<chapter>
|
|
|
|
<title>Compiling GIO applications</title>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
GIO comes with a <filename>gio-2.0.pc</filename> file that you
|
|
|
|
should use together with <literal>pkg-config</literal> to obtain
|
|
|
|
the necessary information about header files and libraries. See
|
2010-04-17 06:31:41 +02:00
|
|
|
the <literal>pkg-config</literal> man page or the GLib documentation
|
|
|
|
for more information on how to use <literal>pkg-config</literal>
|
2007-12-18 04:14:39 +01:00
|
|
|
to compile your application.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
If you are using GIO on UNIX-like systems, you may want to use
|
2010-04-17 06:31:41 +02:00
|
|
|
UNIX-specific GIO interfaces such as #GUnixInputStream,
|
|
|
|
#GUnixOutputStream, #GUnixMount or #GDesktopAppInfo.
|
|
|
|
To do so, use the <filename>gio-unix-2.0.pc</filename> file
|
2007-12-18 04:14:39 +01:00
|
|
|
instead of <filename>gio-2.0.pc</filename>
|
|
|
|
</para>
|
2010-08-26 04:07:59 +02:00
|
|
|
|
|
|
|
<para>
|
|
|
|
Since GIO is based on GObject, you need to call g_type_init()
|
|
|
|
before you can use any GIO functions. If your application uses
|
|
|
|
GTK+, this is already taken care of by gtk_init().
|
|
|
|
</para>
|
2007-12-18 04:14:39 +01:00
|
|
|
</chapter>
|
2007-12-18 01:56:35 +01:00
|
|
|
|
2008-01-23 07:24:27 +01:00
|
|
|
<chapter>
|
|
|
|
<title>Running GIO applications</title>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
GIO inspects a few of environment variables in addition to the
|
|
|
|
ones used by GLib.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<formalpara>
|
|
|
|
<title><envar>XDG_DATA_HOME</envar>, <envar>XDG_DATA_DIRS</envar></title>
|
|
|
|
|
|
|
|
<para>
|
2010-04-17 06:31:41 +02:00
|
|
|
GIO uses these environment variables to locate MIME information.
|
2008-01-23 07:24:27 +01:00
|
|
|
For more information, see the <ulink url="http://freedesktop.org/Standards/shared-mime-info-spec">Shared MIME-info Database</ulink>
|
|
|
|
and the <ulink url="http://freedesktop.org/Standards/basedir-spec">Base Directory Specification</ulink>.
|
|
|
|
</para>
|
|
|
|
</formalpara>
|
|
|
|
|
2008-03-19 21:36:56 +01:00
|
|
|
<formalpara>
|
|
|
|
<title><envar>GVFS_DISABLE_FUSE</envar></title>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
This variable can be set to keep #Gvfs from starting the fuse backend,
|
|
|
|
which may be unwanted or unnecessary in certain situations.
|
|
|
|
</para>
|
|
|
|
</formalpara>
|
|
|
|
|
2008-01-23 07:24:27 +01:00
|
|
|
<para>
|
|
|
|
The following environment variables are only useful for debugging
|
|
|
|
GIO itself or modules that it loads. They should not be set in a
|
|
|
|
production environment.
|
|
|
|
</para>
|
|
|
|
<formalpara>
|
|
|
|
<title><envar>GIO_USE_VFS</envar></title>
|
|
|
|
|
|
|
|
<para>
|
2010-04-17 06:31:41 +02:00
|
|
|
This environment variable can be set to the name of a #GVfs
|
2008-01-23 07:24:27 +01:00
|
|
|
implementation to override the default for debugging purposes.
|
2010-04-17 06:31:41 +02:00
|
|
|
The #GVfs implementation for local files that is included in GIO
|
|
|
|
has the name "local", the implementation in the gvfs module has
|
|
|
|
the name "gvfs".
|
2008-01-23 07:24:27 +01:00
|
|
|
</para>
|
|
|
|
</formalpara>
|
|
|
|
|
|
|
|
<formalpara>
|
|
|
|
<title><envar>GIO_USE_VOLUME_MONITOR</envar></title>
|
2010-04-17 06:31:41 +02:00
|
|
|
|
2008-01-23 07:24:27 +01:00
|
|
|
<para>
|
2010-04-17 06:31:41 +02:00
|
|
|
This variable can be set to the name of a #GVolumeMonitor
|
2008-01-23 07:24:27 +01:00
|
|
|
implementation to override the default for debugging purposes.
|
|
|
|
The #GVolumeMonitor implementation for local files that is included
|
|
|
|
in GIO has the name "unix", the hal-based implementation in the
|
|
|
|
gvfs module has the name "hal".
|
|
|
|
</para>
|
|
|
|
</formalpara>
|
|
|
|
|
2008-02-11 08:18:56 +01:00
|
|
|
<formalpara>
|
|
|
|
<title><envar>GIO_USE_URI_ASSOCIATION</envar></title>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
This variable can be set to the name of a #GDesktopAppInfoLookup
|
2008-03-28 15:31:09 +01:00
|
|
|
implementation to override the default for debugging purposes.
|
2008-02-11 08:18:56 +01:00
|
|
|
GIO does not include a #GDesktopAppInfoLookup implementation,
|
|
|
|
the GConf-based implementation in the gvfs module has the name
|
2010-04-17 06:31:41 +02:00
|
|
|
"gconf".
|
2008-02-11 08:18:56 +01:00
|
|
|
</para>
|
|
|
|
</formalpara>
|
|
|
|
|
2008-01-23 07:24:27 +01:00
|
|
|
<formalpara>
|
|
|
|
<title><envar>GVFS_INOTIFY_DIAG</envar></title>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
When this environment variable is set and GIO has been built
|
2010-04-17 06:31:41 +02:00
|
|
|
with inotify support, a dump of diagnostic inotify information
|
2008-01-23 07:24:27 +01:00
|
|
|
will be written every 20 seconds to a file named
|
|
|
|
<filename>/tmp/gvfsdid.<replaceable>pid</replaceable></filename>.
|
|
|
|
</para>
|
|
|
|
</formalpara>
|
|
|
|
|
2008-03-28 15:31:09 +01:00
|
|
|
<formalpara>
|
|
|
|
<title><envar>GIO_EXTRA_MODULES</envar></title>
|
|
|
|
|
|
|
|
<para>
|
2010-04-17 06:31:41 +02:00
|
|
|
When this environment variable is set to a path, or a set of
|
|
|
|
paths separated by a colon, GIO will attempt to load
|
|
|
|
modules from within the path.
|
|
|
|
</para>
|
|
|
|
</formalpara>
|
|
|
|
|
|
|
|
<formalpara>
|
|
|
|
<title><envar>GSETTINGS_BACKEND</envar></title>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
This variable can be set to the name of a #GSettingsBackend
|
|
|
|
implementation to override the default for debugging purposes.
|
2010-05-07 00:15:00 +02:00
|
|
|
The memory-based implementation that is included in GIO has
|
|
|
|
the name "memory", the one in dconf has the name "dconf-settings".
|
2010-04-17 06:31:41 +02:00
|
|
|
</para>
|
|
|
|
</formalpara>
|
|
|
|
|
|
|
|
<formalpara>
|
|
|
|
<title><envar>GSETTINGS_SCHEMA_DIR</envar></title>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
This variable can be set to the name of a directory that is
|
|
|
|
considered in addition to the <filename>glib-2.0/schemas</filename>
|
|
|
|
subdirectories of the XDG system data dirs when looking
|
|
|
|
for compiled schemas for #GSettings.
|
2008-03-28 15:31:09 +01:00
|
|
|
</para>
|
|
|
|
</formalpara>
|
2010-05-07 20:36:07 +02:00
|
|
|
|
2010-05-12 04:35:59 +02:00
|
|
|
<formalpara>
|
2010-05-12 19:01:02 +02:00
|
|
|
<title><envar>DBUS_SYSTEM_BUS_ADDRESS</envar></title>
|
2010-05-12 04:35:59 +02:00
|
|
|
|
|
|
|
<para>
|
|
|
|
This variable is consulted to find the address of the D-Bus system
|
|
|
|
bus. For the format of D-Bus addresses, see the D-Bus
|
|
|
|
<ulink url="http://dbus.freedesktop.org/doc/dbus-specification.html#addresses">specification</ulink>.
|
|
|
|
</para>
|
2010-05-12 19:01:02 +02:00
|
|
|
<para>
|
|
|
|
Setting this variable overrides platform-specific ways of determining
|
|
|
|
the system bus address.
|
|
|
|
</para>
|
2010-05-12 04:35:59 +02:00
|
|
|
</formalpara>
|
|
|
|
|
|
|
|
<formalpara>
|
2010-05-12 19:01:02 +02:00
|
|
|
<title><envar>DBUS_SESSION_BUS_ADDRESS</envar></title>
|
2010-05-12 04:35:59 +02:00
|
|
|
|
|
|
|
<para>
|
|
|
|
This variable is consulted to find the address of the D-Bus session bus.
|
|
|
|
</para>
|
2010-05-12 19:01:02 +02:00
|
|
|
<para>
|
|
|
|
Setting this variable overrides platform-specific ways of determining
|
|
|
|
the session bus address.
|
|
|
|
</para>
|
2010-05-12 04:35:59 +02:00
|
|
|
</formalpara>
|
|
|
|
|
|
|
|
<formalpara>
|
|
|
|
<title><envar>DBUS_STARTER_BUS_TYPE</envar></title>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
This variable is consulted to find out the 'starter' bus for an
|
|
|
|
application that has been started via D-Bus activation. The possible
|
|
|
|
values are 'system' or 'session'.
|
|
|
|
</para>
|
|
|
|
</formalpara>
|
|
|
|
|
2010-05-07 20:36:07 +02:00
|
|
|
<formalpara>
|
|
|
|
<title><envar>G_DBUS_DEBUG</envar></title>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
This variable can be set to a list of debug options, which
|
|
|
|
cause GLib to print out different types of debugging
|
|
|
|
information when using the D-Bus routines.
|
|
|
|
<variablelist>
|
2010-08-16 19:43:35 +02:00
|
|
|
<varlistentry>
|
|
|
|
<term>transport</term>
|
|
|
|
<listitem><para>Show IO activity (e.g. reads and writes)</para></listitem>
|
|
|
|
</varlistentry>
|
2010-05-07 20:36:07 +02:00
|
|
|
<varlistentry>
|
|
|
|
<term>message</term>
|
|
|
|
<listitem><para>Show all sent and received D-Bus messages</para></listitem>
|
|
|
|
</varlistentry>
|
2010-07-01 20:37:16 +02:00
|
|
|
<varlistentry>
|
|
|
|
<term>payload</term>
|
|
|
|
<listitem><para>Show payload for all sent and received D-Bus messages (implies message)</para></listitem>
|
|
|
|
</varlistentry>
|
|
|
|
<varlistentry>
|
|
|
|
<term>call</term>
|
|
|
|
<listitem><para>Trace g_dbus_connection_call() and g_dbus_connection_call_sync() API usage</para></listitem>
|
|
|
|
</varlistentry>
|
|
|
|
<varlistentry>
|
|
|
|
<term>signal</term>
|
|
|
|
<listitem><para>Show when a D-Bus signal is received</para></listitem>
|
|
|
|
</varlistentry>
|
|
|
|
<varlistentry>
|
|
|
|
<term>incoming</term>
|
|
|
|
<listitem><para>Show when an incoming D-Bus method call is received</para></listitem>
|
|
|
|
</varlistentry>
|
2010-08-04 22:59:26 +02:00
|
|
|
<varlistentry>
|
|
|
|
<term>return</term>
|
|
|
|
<listitem><para>Show when a reply is returned via the #GDBusMethodInvocation API</para></listitem>
|
|
|
|
</varlistentry>
|
2010-07-01 20:37:16 +02:00
|
|
|
<varlistentry>
|
|
|
|
<term>emission</term>
|
|
|
|
<listitem><para>Trace g_dbus_connection_emit_signal() API usage</para></listitem>
|
|
|
|
</varlistentry>
|
2010-05-07 20:36:07 +02:00
|
|
|
<varlistentry>
|
|
|
|
<term>authentication</term>
|
2010-07-02 15:34:03 +02:00
|
|
|
<listitem><para>Show information about connection authentication</para></listitem>
|
2010-05-07 20:36:07 +02:00
|
|
|
</varlistentry>
|
GDBus: Handle autolaunching on UNIX/Freedesktop OSes
Also add a 'address' G_DBUS_DEBUG option that will print out useful
debug information such as
GDBus-debug:Address: In g_dbus_address_get_for_bus_sync() for bus type `session'
GDBus-debug:Address: env var DBUS_SESSION_BUS_ADDRESS is not set
GDBus-debug:Address: env var DBUS_SYSTEM_BUS_ADDRESS is not set
GDBus-debug:Address: env var DBUS_STARTER_BUS_TYPE is not set
GDBus-debug:Address: Running `dbus-launch --autolaunch=05e508961149264c9b750a4c494aa6f7 --binary-syntax --close-stderr' to get bus address (possibly autolaunching)
GDBus-debug:Address: dbus-launch output:
0000: 75 6e 69 78 3a 61 62 73 74 72 61 63 74 3d 2f 74 unix:abstract=/t
0010: 6d 70 2f 64 62 75 73 2d 77 42 41 6f 4b 59 49 52 mp/dbus-wBAoKYIR
0020: 7a 75 2c 67 75 69 64 3d 30 34 30 64 31 33 66 33 zu,guid=040d13f3
0030: 30 61 30 62 35 32 63 32 30 66 36 32 63 34 31 63 0a0b52c20f62c41c
0040: 30 30 30 30 35 30 38 64 00 d2 38 00 00 01 00 40 0000508d..8....@
0050: 05 00 00 00 00 .....
GDBus-debug:Address: dbus-launch stderr output:
14542: Autolaunch enabled (using X11).
14542: --exit-with-session automatically enabled
14542: Connected to X11 display ':0.0'
14542: === Parent dbus-launch continues
14542: Waiting for babysitter's intermediate parent
14542: Reading address from bus
14542: Reading PID from daemon
14542: Saving x11 address
14542: Created window 88080385
14542: session file: /root/.dbus/session-bus/05e508961149264c9b750a4c494aa6f7-0
14542: dbus-launch exiting
GDBus-debug:Address: Returning address `unix:abstract=/tmp/dbus-wBAoKYIRzu,guid=040d13f30a0b52c20f62c41c0000508d' for bus type `session'
and
GDBus-debug:Address: In g_dbus_address_get_for_bus_sync() for bus type `session'
GDBus-debug:Address: env var DBUS_SESSION_BUS_ADDRESS is not set
GDBus-debug:Address: env var DBUS_SYSTEM_BUS_ADDRESS is not set
GDBus-debug:Address: env var DBUS_STARTER_BUS_TYPE is not set
GDBus-debug:Address: Running `dbus-launch --autolaunch=05e508961149264c9b750a4c494aa6f7 --binary-syntax --close-stderr' to get bus address (possibly autolaunching)
GDBus-debug:Address: dbus-launch output:
0000: 75 6e 69 78 3a 61 62 73 74 72 61 63 74 3d 2f 74 unix:abstract=/t
0010: 6d 70 2f 64 62 75 73 2d 77 42 41 6f 4b 59 49 52 mp/dbus-wBAoKYIR
0020: 7a 75 2c 67 75 69 64 3d 30 34 30 64 31 33 66 33 zu,guid=040d13f3
0030: 30 61 30 62 35 32 63 32 30 66 36 32 63 34 31 63 0a0b52c20f62c41c
0040: 30 30 30 30 35 30 38 64 00 d2 38 00 00 01 00 40 0000508d..8....@
0050: 05 00 00 00 00 .....
GDBus-debug:Address: dbus-launch stderr output:
14549: Autolaunch enabled (using X11).
14549: --exit-with-session automatically enabled
14549: Connected to X11 display ':0.0'
14549: dbus-daemon is already running. Returning existing parameters.
14549: dbus-launch exiting
GDBus-debug:Address: Returning address `unix:abstract=/tmp/dbus-wBAoKYIRzu,guid=040d13f30a0b52c20f62c41c0000508d' for bus type `session'
Note that things work exactly like libdbus, e.g. from the
dbus-launch(1) man page:
Whenever an autolaunch occurs, the application that had to start a
new bus will be in its own little world; it can effectively end up
starting a whole new session if it tries to use a lot of bus
services. This can be suboptimal or even totally broken, depending
on the app and what it tries to do.
[...]
You can always avoid autolaunch by manually setting
DBUS_SESSION_BUS_ADDRESS. Autolaunch happens because the default
address if none is set is "autolaunch:", so if any other address is
set there will be no autolaunch. You can however include autolaunch
in an explicit session bus address as a fallback, for example
DBUS_SESSION_BUS_ADDRESS="something:,autolaunch:" - in that case if
the first address doesn't work, processes will autolaunch. (The bus
address variable contains a comma-separated list of addresses to
try.)
Signed-off-by: David Zeuthen <davidz@redhat.com>
2010-07-06 22:57:28 +02:00
|
|
|
<varlistentry>
|
|
|
|
<term>address</term>
|
|
|
|
<listitem><para>Show information about D-Bus address lookups and autolaunching</para></listitem>
|
|
|
|
</varlistentry>
|
2010-05-07 20:36:07 +02:00
|
|
|
</variablelist>
|
2010-08-04 22:59:26 +02:00
|
|
|
The special value <literal>all</literal> can be used to turn
|
|
|
|
on all debug options. The special value
|
|
|
|
<literal>help</literal> can be used to print a list of
|
|
|
|
supported options to standard output.
|
2010-05-07 20:36:07 +02:00
|
|
|
</para>
|
|
|
|
</formalpara>
|
|
|
|
|
|
|
|
<formalpara>
|
|
|
|
<title><envar>G_DBUS_COOKIE_SHA1_KEYRING_DIR</envar></title>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
Can be used to override the directory used to store the
|
|
|
|
keyring used in the <literal>DBUS_COOKIE_SHA1</literal>
|
|
|
|
authentication mechanism. Normally the directory used is
|
|
|
|
<filename>.dbus-keyrings</filename> in the user's home
|
|
|
|
directory.
|
|
|
|
</para>
|
|
|
|
</formalpara>
|
|
|
|
|
|
|
|
<formalpara>
|
|
|
|
<title><envar>G_DBUS_COOKIE_SHA1_KEYRING_DIR_IGNORE_PERMISSION</envar></title>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
If set, the permissions of the directory used to store the
|
|
|
|
keyring used in the <literal>DBUS_COOKIE_SHA1</literal>
|
|
|
|
authentication mechanism won't be checked. Normally the
|
|
|
|
directory must be readable only by the user.
|
|
|
|
</para>
|
|
|
|
</formalpara>
|
2008-01-23 07:24:27 +01:00
|
|
|
</chapter>
|
|
|
|
|
2008-07-16 08:30:12 +02:00
|
|
|
<chapter id="extending-gio">
|
2008-02-11 08:18:56 +01:00
|
|
|
<title>Extending GIO</title>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
A lot of the functionality that is accessible through GIO
|
|
|
|
is implemented in loadable modules, and modules provide a convenient
|
2010-04-17 06:31:41 +02:00
|
|
|
way to extend GIO. In addition to the #GIOModule API which supports
|
2008-02-11 08:18:56 +01:00
|
|
|
writing such modules, GIO has a mechanism to define extension points,
|
|
|
|
and register implementations thereof, see #GIOExtensionPoint.
|
|
|
|
</para>
|
|
|
|
<para>
|
|
|
|
The following extension points are currently defined by GIO:
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<formalpara>
|
|
|
|
<title>G_VFS_EXTENSION_POINT_NAME</title>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
Allows to override the functionality of the #GVfs class.
|
|
|
|
Implementations of this extension point must be derived from #GVfs.
|
|
|
|
GIO uses the implementation with the highest priority that is active,
|
|
|
|
see g_vfs_is_active().
|
|
|
|
</para>
|
|
|
|
<para>
|
|
|
|
GIO implements this extension point for local files, gvfs contains
|
|
|
|
an implementation that supports all the backends in gvfs.
|
|
|
|
</para>
|
|
|
|
</formalpara>
|
|
|
|
|
|
|
|
<formalpara>
|
|
|
|
<title>G_VOLUME_MONITOR_EXTENSION_POINT_NAME</title>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
Allows to add more volume monitors.
|
|
|
|
Implementations of this extension point must be derived from
|
|
|
|
#GVolumeMonitor. GIO uses all registered extensions.
|
|
|
|
</para>
|
|
|
|
<para>
|
|
|
|
gvfs contains an implementation that works together with the #GVfs
|
|
|
|
implementation in gvfs.
|
|
|
|
</para>
|
|
|
|
</formalpara>
|
|
|
|
|
|
|
|
<formalpara>
|
|
|
|
<title>G_NATIVE_VOLUME_MONITOR_EXTENSION_POINT_NAME</title>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
Allows to override the 'native' volume monitor.
|
|
|
|
Implementations of this extension point must be derived from
|
|
|
|
#GNativeVolumeMonitor. GIO uses the implementation with
|
|
|
|
the highest priority that is supported, as determined by the
|
|
|
|
is_supported() vfunc in #GVolumeMonitorClass.
|
|
|
|
</para>
|
|
|
|
<para>
|
2010-04-17 06:31:41 +02:00
|
|
|
GIO implements this extension point for local mounts,
|
|
|
|
gvfs contains a hal-based implementation.
|
2008-02-11 08:18:56 +01:00
|
|
|
</para>
|
|
|
|
</formalpara>
|
|
|
|
|
|
|
|
<formalpara>
|
|
|
|
<title>G_LOCAL_FILE_MONITOR_EXTENSION_POINT_NAME</title>
|
|
|
|
|
|
|
|
<para>
|
2010-04-17 06:31:41 +02:00
|
|
|
Allows to override the file monitor implementation for
|
|
|
|
local files. Implementations of this extension point must
|
|
|
|
be derived from #GLocalFileMonitor. GIO uses the implementation
|
2008-02-11 08:18:56 +01:00
|
|
|
with the highest priority that is supported, as determined by the
|
|
|
|
is_supported() vfunc in #GLocalFileMonitorClass.
|
|
|
|
</para>
|
|
|
|
<para>
|
|
|
|
GIO uses this extension point internally, to switch between
|
|
|
|
its fam-based and inotify-based file monitoring implementations.
|
|
|
|
</para>
|
|
|
|
</formalpara>
|
|
|
|
|
|
|
|
<formalpara>
|
|
|
|
<title>G_LOCAL_DIRECTORY_MONITOR_EXTENSION_POINT_NAME</title>
|
|
|
|
|
|
|
|
<para>
|
2010-04-17 06:31:41 +02:00
|
|
|
Allows to override the directory monitor implementation for
|
|
|
|
local files. Implementations of this extension point must be
|
2008-02-11 08:18:56 +01:00
|
|
|
derived from #GLocalDirectoryMonitor. GIO uses the implementation
|
|
|
|
with the highest priority that is supported, as determined by the
|
|
|
|
is_supported() vfunc in #GLocalDirectoryMonitorClass.
|
|
|
|
</para>
|
|
|
|
<para>
|
|
|
|
GIO uses this extension point internally, to switch between
|
|
|
|
its fam-based and inotify-based directory monitoring implementations.
|
|
|
|
</para>
|
|
|
|
</formalpara>
|
|
|
|
|
|
|
|
<formalpara>
|
|
|
|
<title>G_DESKTOP_APP_INFO_LOOKUP_EXTENSION_POINT_NAME</title>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
Unix-only. Allows to provide a way to associate default handlers
|
2010-04-17 06:31:41 +02:00
|
|
|
with URI schemes. Implementations of this extension point must
|
|
|
|
implement the #GDesktopAppInfoLookup interface. GIO uses the
|
2008-02-11 08:18:56 +01:00
|
|
|
implementation with the highest priority.
|
|
|
|
</para>
|
|
|
|
<para>
|
2010-04-17 06:31:41 +02:00
|
|
|
gvfs contains a GConf-based implementation that uses the
|
2008-02-11 08:18:56 +01:00
|
|
|
same GConf keys as gnome-vfs.
|
|
|
|
</para>
|
|
|
|
</formalpara>
|
2010-04-17 06:31:41 +02:00
|
|
|
|
|
|
|
<formalpara>
|
|
|
|
<title>G_SETTINGS_BACKEND_EXTENSION_POINT_NAME</title>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
Allows to provide an alternative storage for #GSettings.
|
|
|
|
Implementations of this extension point must derive from the
|
|
|
|
#GSettingsBackend type. GIO contains a keyfile-based
|
|
|
|
implementation of this extension point, another one is provided
|
|
|
|
by dconf.
|
|
|
|
</para>
|
|
|
|
</formalpara>
|
2010-08-22 04:22:25 +02:00
|
|
|
|
|
|
|
<formalpara>
|
|
|
|
<title>G_PROXY_EXTENSION_POINT_NAME</title>
|
|
|
|
|
|
|
|
<para>
|
|
|
|
Allows to provide implementations for network proxying.
|
|
|
|
Implementations of this extension point must provide the
|
|
|
|
#GProxy interface, and must be named after the network
|
|
|
|
protocol they are proxying.
|
|
|
|
</para>
|
|
|
|
</formalpara>
|
|
|
|
|
2008-02-11 08:18:56 +01:00
|
|
|
</chapter>
|
2007-12-17 18:28:40 +01:00
|
|
|
</part>
|