mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-11-10 11:26:16 +01:00
docs: switch to xi:inbclude for the content to save some more seconds
This commit is contained in:
parent
00db5238d9
commit
7211f7f8eb
@ -1,29 +1,6 @@
|
||||
<?xml version="1.0"?>
|
||||
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
|
||||
"http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd" [
|
||||
<!ENTITY gobject-GType SYSTEM "xml/gtype.xml">
|
||||
<!ENTITY gobject-GTypePlugin SYSTEM "xml/gtypeplugin.xml">
|
||||
<!ENTITY gobject-GTypeModule SYSTEM "xml/gtypemodule.xml">
|
||||
<!ENTITY gobject-The-Base-Object-Type SYSTEM "xml/objects.xml">
|
||||
<!ENTITY gobject-Enumeration-and-Flag-Types SYSTEM "xml/enumerations_flags.xml">
|
||||
<!ENTITY gobject-Boxed-Types SYSTEM "xml/gboxed.xml">
|
||||
<!ENTITY gobject-Generic-values SYSTEM "xml/generic_values.xml">
|
||||
<!ENTITY gobject-param-value-types SYSTEM "xml/param_value_types.xml">
|
||||
<!ENTITY gobject-GParamSpec SYSTEM "xml/gparamspec.xml">
|
||||
<!ENTITY gobject-Varargs-Value-Collection SYSTEM "xml/value_collection.xml">
|
||||
<!ENTITY gobject-Signals SYSTEM "xml/signals.xml">
|
||||
<!ENTITY gobject-Closures SYSTEM "xml/gclosure.xml">
|
||||
<!ENTITY gobject-Value-Arrays SYSTEM "xml/value_arrays.xml">
|
||||
<!ENTITY glib-mkenums SYSTEM "glib-mkenums.xml">
|
||||
<!ENTITY glib-genmarshal SYSTEM "glib-genmarshal.xml">
|
||||
<!ENTITY gobject-query SYSTEM "gobject-query.xml">
|
||||
|
||||
<!ENTITY tutorial-Intro SYSTEM "tut_intro.xml">
|
||||
<!ENTITY tutorial-GType SYSTEM "tut_gtype.xml">
|
||||
<!ENTITY tutorial-GObject SYSTEM "tut_gobject.xml">
|
||||
<!ENTITY tutorial-GSignal SYSTEM "tut_gsignal.xml">
|
||||
<!ENTITY tutorial-HowTo SYSTEM "tut_howto.xml">
|
||||
<!ENTITY tutorial-Tools SYSTEM "tut_tools.xml">
|
||||
|
||||
<!ENTITY % local.common.attrib "xmlns:xi CDATA #FIXED 'http://www.w3.org/2003/XInclude'">
|
||||
<!ENTITY version SYSTEM "version.xml">
|
||||
@ -85,46 +62,38 @@
|
||||
<part label="I">
|
||||
<title>Concepts</title>
|
||||
|
||||
&tutorial-Intro;
|
||||
&tutorial-GType;
|
||||
&tutorial-GObject;
|
||||
&tutorial-GSignal;
|
||||
<xi:include href="tut_intro.xml" />
|
||||
<xi:include href="tut_gtype.xml" />
|
||||
<xi:include href="tut_gobject.xml" />
|
||||
<xi:include href="tut_gsignal.xml" />
|
||||
</part>
|
||||
<reference label="II">
|
||||
<title>API Reference</title>
|
||||
|
||||
&gobject-GType;
|
||||
&gobject-GTypePlugin;
|
||||
&gobject-GTypeModule;
|
||||
&gobject-The-Base-Object-Type;
|
||||
&gobject-Enumeration-and-Flag-Types;
|
||||
&gobject-Boxed-Types;
|
||||
&gobject-Generic-values;
|
||||
&gobject-param-value-types;
|
||||
&gobject-Varargs-Value-Collection;
|
||||
&gobject-GParamSpec;
|
||||
&gobject-Signals;
|
||||
&gobject-Closures;
|
||||
&gobject-Value-Arrays;
|
||||
|
||||
|
||||
<xi:include href="xml/gtype.xml" />
|
||||
<xi:include href="xml/gtypeplugin.xml" />
|
||||
<xi:include href="xml/gtypemodule.xml" />
|
||||
<xi:include href="xml/objects.xml" />
|
||||
<xi:include href="xml/enumerations_flags.xml" />
|
||||
<xi:include href="xml/gboxed.xml" />
|
||||
<xi:include href="xml/generic_values.xml" />
|
||||
<xi:include href="xml/param_value_types.xml" />
|
||||
<xi:include href="xml/gparamspec.xml" />
|
||||
<xi:include href="xml/value_collection.xml" />
|
||||
<xi:include href="xml/signals.xml" />
|
||||
<xi:include href="xml/gclosure.xml" />
|
||||
<xi:include href="xml/value_arrays.xml" />
|
||||
</reference>
|
||||
<reference label="III">
|
||||
<title>Tools Reference</title>
|
||||
|
||||
&glib-mkenums;
|
||||
&glib-genmarshal;
|
||||
&gobject-query;
|
||||
<xi:include href="glib-mkenums.xml" />
|
||||
<xi:include href="glib-genmarshal.xml" />
|
||||
<xi:include href="gobject-query.xml" />
|
||||
</reference>
|
||||
<part label="IV">
|
||||
<title>Tutorial</title>
|
||||
|
||||
&tutorial-HowTo;
|
||||
</part>
|
||||
<part label="V">
|
||||
<title>Related Tools</title>
|
||||
|
||||
&tutorial-Tools;
|
||||
</part>
|
||||
<xi:include href="tut_howto.xml" />
|
||||
<xi:include href="tut_tools.xml" />
|
||||
|
||||
<index id="api-index-full">
|
||||
<title>Index</title>
|
||||
|
@ -1,4 +1,7 @@
|
||||
<?xml version='1.0' encoding="ISO-8859-1"?>
|
||||
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
|
||||
"http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd" [
|
||||
]>
|
||||
<chapter id="chapter-gobject">
|
||||
<title>The GObject base class</title>
|
||||
|
||||
|
@ -1,4 +1,7 @@
|
||||
<?xml version='1.0' encoding="ISO-8859-1"?>
|
||||
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
|
||||
"http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd" [
|
||||
]>
|
||||
<chapter id="chapter-signal">
|
||||
<title>The GObject messaging system</title>
|
||||
|
||||
|
@ -1,4 +1,7 @@
|
||||
<?xml version='1.0' encoding="ISO-8859-1"?>
|
||||
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
|
||||
"http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd" [
|
||||
]>
|
||||
<chapter id="chapter-gtype">
|
||||
<title>The GLib Dynamic Type System</title>
|
||||
|
||||
@ -900,7 +903,7 @@ maman_ibaz_base_init (gpointer g_iface)
|
||||
|
||||
<para>
|
||||
The above process can be summarized as follows:
|
||||
<table id="ginterface-init-table">
|
||||
<table id="ginterface-fini-table">
|
||||
<title>Interface Finalization</title>
|
||||
<tgroup cols="3">
|
||||
<colspec colwidth="*" colnum="1" align="left"/>
|
||||
|
@ -1,11 +1,16 @@
|
||||
<?xml version='1.0' encoding="ISO-8859-1"?>
|
||||
<partintro>
|
||||
<para>
|
||||
This chapter tries to answer the real-life questions of users and presents
|
||||
the most common scenario use cases I could come up with.
|
||||
The use cases are presented from most likely to less likely.
|
||||
</para>
|
||||
</partintro>
|
||||
<!DOCTYPE part PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
|
||||
"http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd" [
|
||||
]>
|
||||
<part label="IV">
|
||||
<title>Tutorial</title>
|
||||
<partintro>
|
||||
<para>
|
||||
This chapter tries to answer the real-life questions of users and presents
|
||||
the most common scenario use cases I could come up with.
|
||||
The use cases are presented from most likely to less likely.
|
||||
</para>
|
||||
</partintro>
|
||||
|
||||
<chapter id="howto-gobject">
|
||||
<title>How to define and implement a new GObject</title>
|
||||
@ -1712,4 +1717,4 @@ g_object_do_class_init (GObjectClass *class)
|
||||
|
||||
</sect2>
|
||||
-->
|
||||
|
||||
</part>
|
||||
|
@ -1,4 +1,7 @@
|
||||
<?xml version='1.0' encoding="ISO-8859-1"?>
|
||||
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
|
||||
"http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd" [
|
||||
]>
|
||||
<chapter id="chapter-intro">
|
||||
<title>Background</title>
|
||||
|
||||
|
@ -1,106 +1,112 @@
|
||||
<?xml version='1.0' encoding="ISO-8859-1"?>
|
||||
<partintro>
|
||||
<para>
|
||||
Several useful developer tools have been build around GObject
|
||||
technology. The next sections briefly introduce them and link to
|
||||
the respective project pages.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
For example, writing GObjects is often seen as a tedious task. It
|
||||
requires a lot of typing and just doing a copy/paste requires a
|
||||
great deal of care. A lot of projects and scripts have been
|
||||
written to generate GObject skeleton form boilerplate code, or
|
||||
even translating higher-level language into plain C.
|
||||
</para>
|
||||
</partintro>
|
||||
|
||||
<chapter id="tools-vala">
|
||||
<title>Vala</title>
|
||||
<para>
|
||||
From the <ulink url="http://live.gnome.org/Vala">Vala
|
||||
homepage</ulink> itself: <quote>Vala is a new programming language
|
||||
that aims to bring modern programming language features to GNOME
|
||||
developers without imposing any additional runtime requirements
|
||||
and without using a different ABI compared to applications and
|
||||
libraries written in C.</quote>
|
||||
</para>
|
||||
|
||||
<para>
|
||||
The syntax of Vala is similar to C#. The available compiler
|
||||
translates Vala into GObject C code. It can also compile
|
||||
non-GObject C, using plain C API.
|
||||
</para>
|
||||
</chapter>
|
||||
|
||||
<chapter id="tools-gob">
|
||||
<title>GObject builder</title>
|
||||
|
||||
<para>
|
||||
In order to help a GObject class developper, one obvious idea is
|
||||
to use some sort of templates for the skeletons. and then run
|
||||
them through a special tool to generate the real C files. <ulink
|
||||
url="http://www.5z.com/jirka/gob.html">GOB</ulink> (or GOB2) is
|
||||
such a tool. It is a preprocessor which can be used to build
|
||||
GObjects with inline C code so that there is no need to edit the
|
||||
generated C code. The syntax is inspired by Java and Yacc or
|
||||
Lex. The implementation is intentionally kept simple: the inline C
|
||||
code provided by the user is not parsed.
|
||||
</para>
|
||||
</chapter>
|
||||
|
||||
<chapter id="tools-ginspector">
|
||||
<title>Graphical inspection of GObjects</title>
|
||||
|
||||
<para>
|
||||
Yet another tool that you may find helpful when working with
|
||||
GObjects is <ulink
|
||||
url="http://sourceforge.net/projects/g-inspector">G-Inspector</ulink>. It
|
||||
is able to display GLib/GTK+ objects and their properties.
|
||||
</para>
|
||||
</chapter>
|
||||
|
||||
<chapter id="tools-refdb">
|
||||
<title>Debugging reference count problems</title>
|
||||
|
||||
<para>
|
||||
The reference counting scheme used by GObject does solve quite
|
||||
a few memory management problems but also introduces new sources of bugs.
|
||||
In large applications, finding the exact spot where the reference count
|
||||
of an Object is not properly handled can be very difficult. Hopefully,
|
||||
there exist a tool named <ulink url="http://refdbg.sf.net/">refdbg</ulink>
|
||||
which can be used to automate the task of tracking down the location
|
||||
of invalid code with regard to reference counting. This application
|
||||
intercepts the reference counting calls and tries to detect invalid behavior.
|
||||
It supports a filter-rule mechanism to let you trace only the objects you are
|
||||
interested in and it can be used together with GDB.
|
||||
</para>
|
||||
<para>
|
||||
<indexterm><primary>g_trap_object_ref</primary></indexterm>
|
||||
Note that if GObject has been compiled with <option>--enable-debug=yes</option>,
|
||||
it exports a trap variable
|
||||
<programlisting>
|
||||
static volatile GObject *g_trap_object_ref;
|
||||
</programlisting>
|
||||
If set to a non-NULL value, <link linkend="g-object-ref">g_object_ref</link>()
|
||||
and <link linkend="g-object-unref">g_object_unref</link>() will be intercepted
|
||||
when called with that value.
|
||||
</para>
|
||||
</chapter>
|
||||
<!DOCTYPE part PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
|
||||
"http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd" [
|
||||
]>
|
||||
<part label="V">
|
||||
<title>Related Tools</title>
|
||||
|
||||
<chapter id="tools-gtkdoc">
|
||||
<title>Writing API docs</title>
|
||||
|
||||
<para>The API documentation for most of the GLib, GObject, GTK+ and GNOME
|
||||
libraries is built with a combination of complex tools. Typically, the part of
|
||||
the documentation which describes the behavior of each function is extracted
|
||||
from the specially-formatted source code comments by a tool named gtk-doc which
|
||||
generates DocBook XML and merges this DocBook XML with a set of master XML
|
||||
DocBook files. These XML DocBook files are finally processed with xsltproc
|
||||
(a small program part of the libxslt library) to generate the final HTML
|
||||
output. Other tools can be used to generate PDF output from the source XML.
|
||||
The following code excerpt shows what these comments look like.
|
||||
<programlisting>
|
||||
<partintro>
|
||||
<para>
|
||||
Several useful developer tools have been build around GObject
|
||||
technology. The next sections briefly introduce them and link to
|
||||
the respective project pages.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
For example, writing GObjects is often seen as a tedious task. It
|
||||
requires a lot of typing and just doing a copy/paste requires a
|
||||
great deal of care. A lot of projects and scripts have been
|
||||
written to generate GObject skeleton form boilerplate code, or
|
||||
even translating higher-level language into plain C.
|
||||
</para>
|
||||
</partintro>
|
||||
|
||||
<chapter id="tools-vala">
|
||||
<title>Vala</title>
|
||||
<para>
|
||||
From the <ulink url="http://live.gnome.org/Vala">Vala
|
||||
homepage</ulink> itself: <quote>Vala is a new programming language
|
||||
that aims to bring modern programming language features to GNOME
|
||||
developers without imposing any additional runtime requirements
|
||||
and without using a different ABI compared to applications and
|
||||
libraries written in C.</quote>
|
||||
</para>
|
||||
|
||||
<para>
|
||||
The syntax of Vala is similar to C#. The available compiler
|
||||
translates Vala into GObject C code. It can also compile
|
||||
non-GObject C, using plain C API.
|
||||
</para>
|
||||
</chapter>
|
||||
|
||||
<chapter id="tools-gob">
|
||||
<title>GObject builder</title>
|
||||
|
||||
<para>
|
||||
In order to help a GObject class developper, one obvious idea is
|
||||
to use some sort of templates for the skeletons. and then run
|
||||
them through a special tool to generate the real C files. <ulink
|
||||
url="http://www.5z.com/jirka/gob.html">GOB</ulink> (or GOB2) is
|
||||
such a tool. It is a preprocessor which can be used to build
|
||||
GObjects with inline C code so that there is no need to edit the
|
||||
generated C code. The syntax is inspired by Java and Yacc or
|
||||
Lex. The implementation is intentionally kept simple: the inline C
|
||||
code provided by the user is not parsed.
|
||||
</para>
|
||||
</chapter>
|
||||
|
||||
<chapter id="tools-ginspector">
|
||||
<title>Graphical inspection of GObjects</title>
|
||||
|
||||
<para>
|
||||
Yet another tool that you may find helpful when working with
|
||||
GObjects is <ulink
|
||||
url="http://sourceforge.net/projects/g-inspector">G-Inspector</ulink>. It
|
||||
is able to display GLib/GTK+ objects and their properties.
|
||||
</para>
|
||||
</chapter>
|
||||
|
||||
<chapter id="tools-refdb">
|
||||
<title>Debugging reference count problems</title>
|
||||
|
||||
<para>
|
||||
The reference counting scheme used by GObject does solve quite
|
||||
a few memory management problems but also introduces new sources of bugs.
|
||||
In large applications, finding the exact spot where the reference count
|
||||
of an Object is not properly handled can be very difficult. Hopefully,
|
||||
there exist a tool named <ulink url="http://refdbg.sf.net/">refdbg</ulink>
|
||||
which can be used to automate the task of tracking down the location
|
||||
of invalid code with regard to reference counting. This application
|
||||
intercepts the reference counting calls and tries to detect invalid behavior.
|
||||
It supports a filter-rule mechanism to let you trace only the objects you are
|
||||
interested in and it can be used together with GDB.
|
||||
</para>
|
||||
<para>
|
||||
<indexterm><primary>g_trap_object_ref</primary></indexterm>
|
||||
Note that if GObject has been compiled with <option>--enable-debug=yes</option>,
|
||||
it exports a trap variable
|
||||
<programlisting>
|
||||
static volatile GObject *g_trap_object_ref;
|
||||
</programlisting>
|
||||
If set to a non-NULL value, <link linkend="g-object-ref">g_object_ref</link>()
|
||||
and <link linkend="g-object-unref">g_object_unref</link>() will be intercepted
|
||||
when called with that value.
|
||||
</para>
|
||||
</chapter>
|
||||
|
||||
<chapter id="tools-gtkdoc">
|
||||
<title>Writing API docs</title>
|
||||
|
||||
<para>The API documentation for most of the GLib, GObject, GTK+ and GNOME
|
||||
libraries is built with a combination of complex tools. Typically, the part of
|
||||
the documentation which describes the behavior of each function is extracted
|
||||
from the specially-formatted source code comments by a tool named gtk-doc which
|
||||
generates DocBook XML and merges this DocBook XML with a set of master XML
|
||||
DocBook files. These XML DocBook files are finally processed with xsltproc
|
||||
(a small program part of the libxslt library) to generate the final HTML
|
||||
output. Other tools can be used to generate PDF output from the source XML.
|
||||
The following code excerpt shows what these comments look like.
|
||||
<programlisting>
|
||||
/**
|
||||
* gtk_widget_freeze_child_notify:
|
||||
* @widget: a #GtkWidget
|
||||
@ -114,12 +120,13 @@ void
|
||||
gtk_widget_freeze_child_notify (GtkWidget *widget)
|
||||
{
|
||||
...
|
||||
</programlisting>
|
||||
</para>
|
||||
<para>
|
||||
Thorough
|
||||
<ulink url="http://developer.gnome.org/arch/doc/authors.html">documentation</ulink>
|
||||
on how to set up and use gtk-doc in your
|
||||
project is provided on the GNOME developer website.
|
||||
</para>
|
||||
</chapter>
|
||||
</programlisting>
|
||||
</para>
|
||||
<para>
|
||||
Thorough
|
||||
<ulink url="http://developer.gnome.org/arch/doc/authors.html">documentation</ulink>
|
||||
on how to set up and use gtk-doc in your
|
||||
project is provided on the GNOME developer website.
|
||||
</para>
|
||||
</chapter>
|
||||
</part>
|
||||
|
Loading…
Reference in New Issue
Block a user