Created a documentation skeleton and changed the comments in iconbar.c

so that they're useful for the documentation system.


SVN revision: 5547
This commit is contained in:
cpk 2001-10-21 22:03:36 +00:00 committed by cpk
parent 1a24c75a76
commit 79ef2ccbe9
2 changed files with 118 additions and 227 deletions

View File

@ -1,20 +1,19 @@
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook V3.1//EN" [ <!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook V3.1//EN" [
<!ENTITY efsd "<function>efsd</function>"> <!ENTITY e17 "<productname>Enlightenment 0.17</productname>">
]> ]>
<book id="efsd-documentation-howto"> <book id="efsd-documentation-howto">
<bookinfo> <bookinfo>
<title>Enlightenment Documentation Howto</title> <title>The Enlightenment 0.17 Manual</title>
<authorgroup> <authorgroup>
<author> <author>
<firstname>FIRSTNAME</firstname> <firstname>Christian</firstname>
<othername>OTHER</othername> <surname>Kreibich</surname>
<surname>LASTNAME</surname>
<affiliation> <affiliation>
<address> <address>
<email>EMAIL</email> <email>cK@whoop.org</email>
</address> </address>
</affiliation> </affiliation>
</author> </author>
@ -61,223 +60,73 @@
<chapter id="introduction"> <chapter id="introduction">
<title>Introduction</title> <title>Introduction</title>
<para> <para>
This is some sample documentation for you project. You'll need to be This document explains the &e17; release, for both users and
familiar with <ulink url="http://docbook.org">DocBook</ulink> developers.
to make best use of Enlightenment's documentation scheme.
</para>
<para>
See <link linkend="files" endterm="files.title"></link>
for an explanation of the documentation setup in you project.
</para>
<para>
<link linkend="comments" endterm="comments.title"></link> explains
the way you have to structure your comments so that they can be
extracted.
</para>
<para>
<link linkend="samples" endterm="samples.title"></link> contains a few
layout and markup examples to get you up to speed quickly.
</para> </para>
</chapter> </chapter>
<chapter id="files"> <chapter id="using">
<title id="files.title">Documentation File Structure</title> <title>Using &e17;</title>
<para> <para>
The entire documentation setup lives in the <filename>doc</filename> Here's how you use &e17;.
directory. The file you need to edit is called <filename>manual.raw</filename>.
When you enter <command>make docs</command> in the toplevel directory,
it gets translated into a standard SGML file using a Perl script.
The script scans the file for any lines starting directly with the
string <command>!I&lt;filename&gt;</command>. Here,
<filename>filename</filename> is the name of a code
file in which you have put extractable comments. The Perl script will
then analyze the file and generate SGML DocBook statements for those
comments right into the output file.
</para> </para>
<para>
The resulting file of that step is called <filename>$PACKAGE-manual-$VERSION.sgml</filename> <section id="wm">
where PACKAGE and VERSION are automatically set during the build process. <title id="wm.title">The Window Manager</title>
This sgml file can be postprocessed with any SGML processor to generate <para>
for example HTML, TeX or PDF output. </para>
</para> </section>
<para>
Suppport for HTML generation is included already through the <section id="fm">
<command>make html-docs</command> target. In order to be able to use <title id="fm.title">The File Manager</title>
that, you'll need to have <command>jade</command> installed, and appropriate <para>
DocBook stylesheets. If the <command>configure</command> script doesn't automatically find </para>
you stylesheets (on a Debian system it should), you can specify them when </section>
calling <command>configure</command> or <command>autogen.sh</command> using
the <command>--with-dbsheets=DIR</command> option.
</para>
<para>
If everything worked out fine, you'll get a tarball of the HTML version
of your documentation and the extracted version in the docs directory,
named similarly to the SGML file.
</para>
</chapter> </chapter>
<chapter id="comments"> <chapter id="inside">
<title id="comments.title">Writing Extractable Comments</title> <title>Inside &e17;</title>
<para> <para>
I'll simply give an example of a commented function here: This chapter explains the inner workings of &e17;.
<programlisting>
/**
* efsd_wait_event - blocking wait for next Efsd event.
* @ec: The Efsd connection
* @ev: Pointer to an allocated EfsdEvent.
*
* Blocks until an efsd event arrives, then returns it by filling
* in the @ev structure. Returns -1 when there was an error,
* >= 0 otherwise.
*/
int efsd_wait_event(EfsdConnection *ec, EfsdEvent *ev);
</programlisting>
As you can see, it's not hard -- just use two asterisks
to signal the start of an extractable comment. In the first
line, begin with the function name and a one-liner description.
Then, put each parameter in the following lines. Add an empty
line, and then a more verbose description. That's basically
it, you can also markup items differently as follows:
<itemizedlist mark="opencircle">
<listitem>
<para><command>funcname()</command> for function names</para>
</listitem>
<listitem>
<para><command>$ENVVAR</command> for environment variables</para>
</listitem>
<listitem>
<para><command>&amp;struct_name</command> for structures</para>
</listitem>
<listitem>
<para><command>%CONST</command> for constants/para>
</listitem>
</itemizedlist>
</para> </para>
</chapter> <section id="architecture">
<title id="architecture.title">&e17; Architecture</title>
<chapter id="samples"> <section id="overall">
<title id="samples.title">DocBook Examples</title> <title id="overall.title">Overview</title>
<section> <para>
<title>Lists</title> </para>
<para> </section>
<itemizedlist mark="opencircle"> <section id="modules">
<listitem> <title id="modules.title">Modules</title>
<para>This</para> <para>
</listitem> </para>
<listitem> </section>
<para>is</para>
</listitem>
<listitem>
<para>a</para>
</listitem>
<listitem>
<para>list</para>
</listitem>
</itemizedlist>
</para>
</section> </section>
<section>
<title>Code</title> <section id="concepts">
<para> <title id="concepts.title">Themeing</title>
<programlisting> <section id="overview">
<title id="overview.title">Overview</title>
EfsdConnection *ec; <para>
</para>
if ( (ec = efsd_open()) == NULL) </section>
{ <section id="system">
/* Oops. Couldn't establish connection. <title id="system.title">System Settings</title>
* Is Efsd really running ? <para>
*/ </para>
} </section>
<section id="user">
/* ... various efsd commands ... */ <title id="user.title">User Settings</title>
<para>
if (efsd_close(ec) < 0) </para>
{ </section>
/* Ouch. Error when closing connection. */
}
</programlisting>
</para>
</section> </section>
<section>
<title>Images</title> <section id="code">
<para> <title>Code Documentation</title>
!Isrc/iconbar.c
<mediaobject>
<imageobject>
<imagedata fileref="figures/sampleimage.eps" format="eps">
</imageobject>
<imageobject>
<imagedata fileref="figures/sampleimage.gif" format="gif">
</imageobject>
<textobject>
<phrase>Sample image</phrase>
</textobject>
<caption>
<para>This is how you display images.</para>
</caption>
</mediaobject>
</para>
</section>
<section>
<title>Warnings, Notes</title>
<para>
<note>
<title>This is an example of a note.</title>
<para>
It's really simple to use.
</para>
</note
</para>
<para>
<caution>
<title>This is a warning.</title>
<para>
It's used just like a note.
</para>
</caution>
</para>
</section> </section>
</chapter> </chapter>
<bibliography>
<biblioentry id="bib-unp">
<bookbiblio>
<author>
<firstname>W. R.</firstname>
<surname>Stevens</surname>
</author>
<title>UNIX Network Programming</title>
<edition>Second Edition</edition>
<volumenum>Volume 1</volumenum>
<publisher>
<publishername>Prentice-Hall</publishername>
</publisher>
<date>1998</date>
</bookbiblio>
</biblioentry>
<biblioentry id="bib-apue">
<bookbiblio>
<author>
<firstname>W. R.</firstname>
<surname>Stevens</surname>
</author>
<title>Advanced Programming in the UNIX Environment</title>
<publisher>
<publishername>Addison-Wesley</publishername>
</publisher>
<date>1992</date>
</bookbiblio>
</biblioentry>
</bibliography>
</book> </book>

View File

@ -32,7 +32,11 @@ static void ib_mouse_up(void *data, Evas _e, Evas_Object _o, int _b, int _x, int
/* please feel free to add to them to make them easier to read and be more */ /* please feel free to add to them to make them easier to read and be more */
/* helpful. */ /* helpful. */
/* init function - initialised the iconbar system */ /**
* e_iconbar_init - Init function
*
* Initialises the iconbar system
*/
void void
e_iconbar_init() e_iconbar_init()
{ {
@ -57,7 +61,10 @@ e_iconbar_init()
E_CONFIG_NODE(cf_iconbar, "icons", E_CFG_TYPE_LIST, cf_iconbar_icon, E_Iconbar, icons, 0, 0, NULL); E_CONFIG_NODE(cf_iconbar, "icons", E_CFG_TYPE_LIST, cf_iconbar_icon, E_Iconbar, icons, 0, 0, NULL);
} }
/* how do we crate a new iconbar? well... like this! */ /**
* e_iconbar_new - Iconbar constructor
* @v: The view for which an iconbar is to be constructed
*/
E_Iconbar * E_Iconbar *
e_iconbar_new(E_View *v) e_iconbar_new(E_View *v)
{ {
@ -111,7 +118,12 @@ e_iconbar_new(E_View *v)
return ib; return ib;
} }
/* our free method for iconbars. how do we free these pesky little urchins */ /**
* e_iconbar_free - Iconbar destructor.
* @ib: The iconbar to be freed
*
* How do we free these pesky little urchins...
*/
void void
e_iconbar_free(E_Iconbar *ib) e_iconbar_free(E_Iconbar *ib)
{ {
@ -145,7 +157,10 @@ e_iconbar_free(E_Iconbar *ib)
FREE(ib); FREE(ib);
} }
/* how do we free an iconbar icon... well like this */ /**
* e_iconbar_icon_free -- Iconbar icon destructor
* @ic: The icon that is to be freed
*/
void void
e_iconbar_icon_free(E_Iconbar_Icon *ic) e_iconbar_icon_free(E_Iconbar_Icon *ic)
{ {
@ -165,8 +180,14 @@ e_iconbar_icon_free(E_Iconbar_Icon *ic)
FREE(ic); FREE(ic);
} }
/* turn our iconbar into more than a structure of config data. actually */ /**
/* crate evas objcts we can do something visual with */ * e_iconbar_realize - Iconbar initialization.
* @ib: The iconbar to initalize
*
* Turns an iconbar into more than a
* structure of config data -- actually create evas objcts
* we can do something visual with
*/
void void
e_iconbar_realize(E_Iconbar *ib) e_iconbar_realize(E_Iconbar *ib)
{ {
@ -200,7 +221,7 @@ e_iconbar_realize(E_Iconbar *ib)
ebits_add_to_evas(ib->bit, ib->view->evas); ebits_add_to_evas(ib->bit, ib->view->evas);
/* aaaaaaaaah. the magic of being able to replace a named bit in an ebit */ /* aaaaaaaaah. the magic of being able to replace a named bit in an ebit */
/* (in this case we expect a bit called "Icons" to exist - the user will */ /* (in this case we expect a bit called "Icons" to exist - the user will */
/* have added a bti called this into the ebit to indicate where he/she */ /* have added a bit called this into the ebit to indicate where he/she */
/* wants icons to go. we basically replace this bit with a virtual set */ /* wants icons to go. we basically replace this bit with a virtual set */
/* of callbacks that ebits will call if this bit is to be moved, resized */ /* of callbacks that ebits will call if this bit is to be moved, resized */
/* shown, hidden, raised, lowered etc. we provide the callbacks. */ /* shown, hidden, raised, lowered etc. we provide the callbacks. */
@ -225,7 +246,13 @@ e_iconbar_realize(E_Iconbar *ib)
e_iconbar_fix(ib); e_iconbar_fix(ib);
} }
/* fix up the geometry and visibility of the iconbar gfx and icons */ /**
* e_iconbar_fix - iconbar geometry update
* @ib: The iconbar for which to fix the geometry
*
* This function corrects the geometry and visibility
* of the iconbar gfx and icons
*/
void void
e_iconbar_fix(E_Iconbar *ib) e_iconbar_fix(E_Iconbar *ib)
{ {
@ -315,9 +342,16 @@ e_iconbar_fix(E_Iconbar *ib)
} }
} }
/* this function is called from the view code whenever a file is added to a */ /**
/* view. the iconbar code here determines if the file add is of interest */ * e_iconbar_file_add - Adds a file to a view
/* and if it is, in 0.5 secs will do a "reload */ * @v: The view in which a file is added
* @file: Name of the added file
*
* This function is called from the
* view code whenever a file is added to a view. The iconbar code here
* determines if the file add is of interest
* and if it is, in 0.5 secs will do a "reload
*/
void void
e_iconbar_file_add(E_View *v, char *file) e_iconbar_file_add(E_View *v, char *file)
{ {
@ -334,7 +368,13 @@ e_iconbar_file_add(E_View *v, char *file)
} }
} }
/* caled whenever a file is deleted from a view */ /**
* e_iconbar_file_delete - Function to remove a file from an iconbox.
* @v: The view in which a file is removed
* @file: Name of the removed file
*
* This function is called whenever a file is deleted from a view.
*/
void void
e_iconbar_file_delete(E_View *v, char *file) e_iconbar_file_delete(E_View *v, char *file)
{ {
@ -352,7 +392,13 @@ e_iconbar_file_delete(E_View *v, char *file)
} }
} }
/* called whenever a file changes in a view */ /**
* e_iconbar_file_change - File change update function
* @v: The view in which a file changes
* @file: Name of the changed file
*
* This function gets called whenever a file changes in a view
*/
void void
e_iconbar_file_change(E_View *v, char *file) e_iconbar_file_change(E_View *v, char *file)
{ {
@ -371,10 +417,6 @@ e_iconbar_file_change(E_View *v, char *file)
/* static (internal to iconbar use only) callbacks */ /* static (internal to iconbar use only) callbacks */
/* reload timeout. called whenevr iconbar special files changed/added to */ /* reload timeout. called whenevr iconbar special files changed/added to */