[Geany-devel] ANN: document-pointer changes merged

Nick Treleaven nick.treleaven at xxxxx
Wed Jun 18 17:20:09 UTC 2008


Hi,
We've just merged the document-pointer branch which removes all use of
document array indexes being passed to functions and signal callbacks.
Now a GeanyDocument* is used instead.

Normally you only need to check this against NULL, e.g. anytime you
check the result of a function call such as p_document->get_current().

If you're storing a document pointer over time and the user may have
closed that document, you can use the new DOC_VALID macro to check it's
still open. You shouldn't need this macro elsewhere - e.g. when
iterating over documents_array, just check documents[i]->is_valid to
see if it corresponds to an open document.

There is a new field GeanyDocument::index if you need to know where the
document is in the documents array, but this shouldn't really be needed.

DOC_IDX_VALID is now deprecated, as is a macro DOC_IDX which converts a
document pointer to an index in the documents array. It is better not
to use these and convert your code without them.

Some of the document functions have been renamed for clarity.

For details, check the updated API docs, and/or see:
http://geany.svn.sourceforge.net/geany/?rev=2705&view=rev

Regards,
Nick



More information about the Devel mailing list