Re: gnome bug 135093

Thierry Moisan <[email protected]> Fri, 22 Apr 2005 16:15:59 -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!
>
>  
>
Ok so I'm sending the patch for the frontend only. Tell me if there's 
anything wrong.

>>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
>
>
>  
>
Yeah thanks this helps a lot. But I have some questions left :
1) what is a node?
2) by  a traversal do you mean that this goes trough all the nodes of 
the DOM tree?
3) Could the callback be like number = number+1 and number would be the 
callback_data? If not please explain me what's a callback and what would 
be callback_data.

Thierry