Re: gnome bug 135093
Thierry Moisan <[email protected]> Thu, 21 Apr 2005 20:26:41 -0400
| Newsgroups | gmane.editors.conglomerate.devel |
|---|---|
| Message-ID | <[email protected]> |
David Malcolm has wrote :
>On Tue, 2005-04-19 at 16:10 -0400, Thierry Moisan wrote:
>
>
>>Hi, I'm a new developper and I'd like to fix gnome bug 135093. I tough
>>someone could give me some hints and URL of what to do to start to
>>create this word count function.
>>
>>
>
>Hi - welcome aboard!
>
>There are two parts to implementing the word count feature: the
>frontend/GUI part (displaying the result) and the backend (actually
>counting the words)
>
>For the frontend, the File->Properties dialog is created using libglade,
>which loads a UI file built using glade-2. Run glade-2
>glade/cong-file-properties.glade and try editing the dialog. Note that
>IIRC you need to do a "make install" after editing a glade file, or
>Conglomerate will be using the old version of the glade file.
>
>You can then wire up the dialog by editing the code in
>src/cong-file-properties.c
>
>Give the widget a name in Glade, you can then look it up and fill in its
>value in the C code.
>
>For the backend, I'd suggest simply calculating the wordcount when the
>property dialog is first created. Eventually you'll want to hook things
>up so that the value changes as the document is edited, but we can leave
>that for a later email.
>
>To actually calculate the wordcount, have a look for the function
>cong_document_for_each_node. Call this on the document, and give it a
>callback function that checks the type of the node, and for text nodes,
>get the word count, and add it to some accumulated value (maybe pass a
>pointer to this integer as the user_data to the callback).
>
>Good luck! Please feel free to ask more questions on this list if you
>get stuck.
>
>Dave
>
>
I fixed the frontend except for one thing : in bug 135093 there's this line:
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.
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) :
gboolean cong_document_for_each_node (CongDocument <http://gtkdoc.conglomerate.org/0.7.16/CongDocument.html> *doc,
CongDocumentRecursionCallback <http://gtkdoc.conglomerate.org/0.7.16/CongDocument.html#CongDocumentRecursionCallback> callback,
gpointer callback_data);
wich looks to be the explanation model for every gtk function. What do I
need to put in the file when I write the code and what is just a
pointer of what to put in?
Thierry Moisan