mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-12-26 15:36:14 +01:00
Flesh out the docs
svn path=/trunk/; revision=6150
This commit is contained in:
parent
0debd52858
commit
2df62bf0ed
@ -1,3 +1,7 @@
|
|||||||
|
2007-12-17 Matthias Clasen <mclasen@redhat.com>
|
||||||
|
|
||||||
|
* gio: Flesh out the overview and migration docs.
|
||||||
|
|
||||||
2007-12-17 Matthias Clasen <mclasen@redhat.com>
|
2007-12-17 Matthias Clasen <mclasen@redhat.com>
|
||||||
|
|
||||||
* gio/migration.xml: Stub of a migration chapter
|
* gio/migration.xml: Stub of a migration chapter
|
||||||
|
@ -92,6 +92,11 @@ HTML_IMAGES = \
|
|||||||
|
|
||||||
content_files = \
|
content_files = \
|
||||||
version.xml \
|
version.xml \
|
||||||
|
overview.xml \
|
||||||
|
migrating.xml
|
||||||
|
|
||||||
|
expand_content_files = \
|
||||||
|
overview.xml \
|
||||||
migrating.xml
|
migrating.xml
|
||||||
|
|
||||||
extra_files = \
|
extra_files = \
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
<releaseinfo>for GIO &version;</releaseinfo>
|
<releaseinfo>for GIO &version;</releaseinfo>
|
||||||
</bookinfo>
|
</bookinfo>
|
||||||
|
|
||||||
<xi:include href="overview.xml"/>
|
<xi:include href="xml/overview.xml"/>
|
||||||
|
|
||||||
<part>
|
<part>
|
||||||
<title>API Reference</title>
|
<title>API Reference</title>
|
||||||
@ -96,7 +96,7 @@
|
|||||||
</chapter>
|
</chapter>
|
||||||
</part>
|
</part>
|
||||||
|
|
||||||
<xi:include href="migrating.xml"/>
|
<xi:include href="xml/migrating.xml"/>
|
||||||
|
|
||||||
<chapter id="gio-hierarchy">
|
<chapter id="gio-hierarchy">
|
||||||
<title>Object Hierarchy</title>
|
<title>Object Hierarchy</title>
|
||||||
|
@ -1091,6 +1091,7 @@ g_filename_completer_get_type
|
|||||||
<TITLE>Unix Mounts</TITLE>
|
<TITLE>Unix Mounts</TITLE>
|
||||||
GUnixMount
|
GUnixMount
|
||||||
GUnixMountPoint
|
GUnixMountPoint
|
||||||
|
GUnixMountEntry
|
||||||
GUnixMountMonitor
|
GUnixMountMonitor
|
||||||
g_unix_mount_free
|
g_unix_mount_free
|
||||||
g_unix_mount_point_free
|
g_unix_mount_point_free
|
||||||
@ -1135,13 +1136,6 @@ G_TYPE_UNIX_MOUNT
|
|||||||
g_unix_mount_monitor_get_type
|
g_unix_mount_monitor_get_type
|
||||||
</SECTION>
|
</SECTION>
|
||||||
|
|
||||||
<SECTION>
|
|
||||||
<FILE>gunixmountentry</FILE>
|
|
||||||
<TITLE>GUnixMountEntry</TITLE>
|
|
||||||
GUnixMountEntry
|
|
||||||
<SUBSECTION Standard>
|
|
||||||
</SECTION>
|
|
||||||
|
|
||||||
<SECTION>
|
<SECTION>
|
||||||
<FILE>gdesktopappinfo</FILE>
|
<FILE>gdesktopappinfo</FILE>
|
||||||
<TITLE>Desktop file based GAppInfo</TITLE>
|
<TITLE>Desktop file based GAppInfo</TITLE>
|
||||||
|
@ -1,30 +1,47 @@
|
|||||||
<chapter id="migrating">
|
<part id="migrating">
|
||||||
<title>Migrating to GIO</title>
|
<title>Migrating to GIO</title>
|
||||||
|
|
||||||
<para>
|
<chapter>
|
||||||
This chapter explains how to port applications from POSIX I/O or
|
<title>Migrating from POSIX to GIO</title>
|
||||||
gnome-vfs to GIO.
|
|
||||||
</para>
|
<table id="posix-vs-gio">
|
||||||
|
<title>Comparison of POSIX and GIO concepts</title>
|
||||||
|
<tgroup cols="2">
|
||||||
|
<thead>
|
||||||
|
<row><entry>POSIX</entry><entry>GIO</entry></row>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<row><entry>char *path</entry><entry>GFile *file</entry></row>
|
||||||
|
<row><entry>struct stat *buf</entry><entry>GFileInfo *info</entry></row>
|
||||||
|
<row><entry>struct statvfs *buf</entry><entry>GFileInfo *info</entry></row>
|
||||||
|
<row><entry morerows="1">int fd</entry><entry>GInputStream *in</entry></row>
|
||||||
|
<row><entry>GOutputStream *out</entry></row>
|
||||||
|
<row><entry>DIR *</entry><entry>GFileEnumerator *enum</entry></row>
|
||||||
|
<row><entry>fstab entry</entry><entry>GUnixMountPoint *mount_point</entry></row>
|
||||||
|
<row><entry>mtab entry</entry><entry>GUnixMountEntry *mount_entry</entry></row>
|
||||||
|
</tbody>
|
||||||
|
</tgroup>
|
||||||
|
</table>
|
||||||
|
|
||||||
<table id="posix-vs-gio">
|
</chapter>
|
||||||
<title>Comparison of POSIX and GIO concepts</title>
|
|
||||||
<tgroup cols="2">
|
|
||||||
<thead>
|
|
||||||
<row><entry>POSIX</entry><entry>GIO</entry></row>
|
|
||||||
</thead>
|
|
||||||
<tbody>
|
|
||||||
<row><entry>char *path</entry><entry>GFile *file</entry></row>
|
|
||||||
<row><entry>struct stat *buf</entry><entry>GFileInfo *info</entry></row>
|
|
||||||
<row><entry>struct statvfs *buf</entry><entry>GFileInfo *info</entry></row>
|
|
||||||
<row><entry morerows="1">int fd</entry><entry>GInputStream *in</entry></row>
|
|
||||||
<row><entry>GOutputStream *out</entry></row>
|
|
||||||
<row><entry>DIR *</entry><entry>GFileEnumerator *enum</entry></row>
|
|
||||||
<row><entry>fstab entry</entry><entry>GUnixMountPoint *mount_point</entry></row>
|
|
||||||
<row><entry>mtab entry</entry><entry>GUnixMountEntry *mount_entry</entry></row>
|
|
||||||
</tbody>
|
|
||||||
</tgroup>
|
|
||||||
</table>
|
|
||||||
|
|
||||||
<!-- FIXME now explain ! -->
|
<chapter>
|
||||||
|
<title>Migrating from GnomeVFS to GIO</title>
|
||||||
|
|
||||||
</chapter>
|
<table id="gnome-vfs-vs-gio">
|
||||||
|
<title>Comparison of GnomeVFS and GIO concepts</title>
|
||||||
|
<tgroup cols="2">
|
||||||
|
<thead>
|
||||||
|
<row><entry>GnomeVFS</entry><entry>GIO</entry></row>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<row><entry>GnomeVFSVolume</entry><entry>GMount</entry></row>
|
||||||
|
<row><entry>GnomeVFSDrive</entry><entry>GVolume</entry></row>
|
||||||
|
<row><entry>-</entry><entry>GDrive</entry></row>
|
||||||
|
</tbody>
|
||||||
|
</tgroup>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
</chapter>
|
||||||
|
|
||||||
|
</part>
|
||||||
|
@ -1,13 +1,16 @@
|
|||||||
<part>
|
<part>
|
||||||
<title>GIO Overview</title>
|
<title>GIO Overview</title>
|
||||||
|
|
||||||
|
<chapter>
|
||||||
|
<title>Introduction</title>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
GIO is striving to provide a modern, easy-to-use VFS api that sits
|
GIO is striving to provide a modern, easy-to-use VFS API that sits
|
||||||
at the right level in the library stack. The goal is to overcome the
|
at the right level in the library stack. The goal is to overcome the
|
||||||
shortcomings of gnome-vfs and provide an api that is so good that
|
shortcomings of GnomeVFS and provide an API that is so good that
|
||||||
developers prefer it over raw POSIX calls. Among other things
|
developers prefer it over raw POSIX calls. Among other things
|
||||||
that means using GObject. It also means not cloning the POSIX
|
that means using GObject. It also means not cloning the POSIX
|
||||||
api, but providing a higher-level, document-centric interfaces.
|
API, but providing a higher-level, document-centric interfaces.
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
@ -68,31 +71,29 @@
|
|||||||
</varlistentry>
|
</varlistentry>
|
||||||
</variablelist>
|
</variablelist>
|
||||||
Beyond these, GIO provides facilities for file monitoring,
|
Beyond these, GIO provides facilities for file monitoring,
|
||||||
asynchronous I/O and filename completion. In addition to the
|
asynchronous I/O and filename completion. In addition to the
|
||||||
interfaces, GIO provides implementations for the local case.
|
interfaces, GIO provides implementations for the local case.
|
||||||
Implementations for various network file systems are provided
|
Implementations for various network file systems are provided
|
||||||
by the GVFS package as loadable modules.
|
by the GVFS package as loadable modules.
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
Other design choices which consciously break with the gnome-vfs
|
Other design choices which consciously break with the GnomeVFS
|
||||||
design are to move backends out-of-process, which minimizes the
|
design are to move backends out-of-process, which minimizes the
|
||||||
dependency bloat and makes the whole system more robust. The backends
|
dependency bloat and makes the whole system more robust. The backends
|
||||||
are not included in GIO, but in the separate GVFS package. GVFS
|
are not included in GIO, but in the separate GVFS package. The GVFS
|
||||||
also contains the GVFS daemon, which spawn further mount daemons
|
package also contains the GVFS daemon, which spawn further mount
|
||||||
for each individual connection.
|
daemons for each individual connection.
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
<para>
|
<figure id="gvfs-overview">
|
||||||
<figure id="mainloop-states">
|
<title>GIO in the GTK+ library stack</title>
|
||||||
<title>GIO in the GTK+ library stack</title>
|
<graphic fileref="gvfs-overview.png" format="PNG"></graphic>
|
||||||
<graphic fileref="gvfs-overview.png" format="PNG"></graphic>
|
</figure>
|
||||||
</figure>
|
|
||||||
</para>
|
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
The GIO model of I/O is stateful: if an application establishes e.g.
|
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
|
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
|
in the session; the user does not have to enter his password over
|
||||||
and over again.
|
and over again.
|
||||||
</para>
|
</para>
|
||||||
@ -100,5 +101,27 @@
|
|||||||
One of the big advantages of putting the VFS in the GLib layer
|
One of the big advantages of putting the VFS in the GLib layer
|
||||||
is that GTK+ can directly use it, e.g. in the filechooser.
|
is that GTK+ can directly use it, e.g. in the filechooser.
|
||||||
</para>
|
</para>
|
||||||
|
</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
|
||||||
|
the <literal>pkg-config</literal> man page or the GLib documentation
|
||||||
|
for more information on how to use <literal>pkg-config</literal>
|
||||||
|
to compile your application.
|
||||||
|
</para>
|
||||||
|
|
||||||
|
<para>
|
||||||
|
If you are using GIO on UNIX-like systems, you may want to use
|
||||||
|
UNIX-specific GIO interfaces such as #GUnixInputStream,
|
||||||
|
#GUnixOutputStream, #GUnixMount or #GDesktopAppInfo.
|
||||||
|
To do so, use the <filename>gio-unix-2.0.pc</filename> file
|
||||||
|
instead of <filename>gio-2.0.pc</filename>
|
||||||
|
</para>
|
||||||
|
</chapter>
|
||||||
|
|
||||||
</part>
|
</part>
|
||||||
|
Loading…
Reference in New Issue
Block a user