Re: gnome bug 135093

David Malcolm <[email protected]> Thu, 21 Apr 2005 23:28:24 -0400
Newsgroups gmane.editors.conglomerate.devel
Message-ID <[email protected]>
[snip]

> >
> I fixed the frontend except for one thing : in bug 135093 there's this line:

I'm looking forward to seeing this!

> 
> How many chapters/paras etc - would vary by dispspec
> 
> what does "would vary by dispspec" means? My first language is french so 
> maybe it's just me who has not enough vocabulary to understand it.

Sorry about that, I wasn't very clear when I wrote that.

For DocBook files it might be good for the Properties dialog to show the
number of chapters and paragraphs in the document.  This would mean
counting the number of <chapter> and <para> tags.  

When I wrote  "would vary by dispspec" I meant that the precise choice
of which tags to count and show to the user would vary between document
types.  So for DocBook it might be useful to see the number of <chapter>
tags, but (for example) for the Kernel Traffic document type it might be
better to show things like the number of mailing list threads, or
authors etc

But I'm not sure all of the above is a good idea, and I'm not sure of a
good way to implement it; getting a word count seems far more important
to me.  So don't worry about this for now.

> 
> I've also looked for the cong_document_for_each_node function at this link :
> http://gtkdoc.conglomerate.org/0.7.16/CongDocument.html#cong-document-for-each-node 
> 
> but the explanation of the funtion is a TODO. So could someone fill this 
> TODO or explain me how this funtion works and how to understand and use 
> this (or maybe both) :

I've committed this documentation of the function to CVS (it won't yet
appear on the website):

/**
 * cong_document_for_each_node:
 * @doc: the document
 * @callback: a callback to be invoked for every node in the document
 * @callback_data: data for the callback
 *
 * Perform a depth-first traversal of the nodes in the DOM tree of this document, calling the supplied callback for each node,
 * passing it the supplied data.  
 * 
 * If the callback returns TRUE, then traversal is halted: you can use this to test for the presence of a node satisfying some condition
 * Otherwise, traversal continues.   If you wish to perform some operation on every node in the tree, your callback should always return FALSE.
 * 
 * Entity declarations are only visited once; it does not traverse below an entity reference, to avoid potential infinite loops.
 *
 * Returns:  TRUE if one of the callback calls returned TRUE (stopping the traversal prematurely); FALSE if the full traversal occurred
 */

Does this help?

Dave