Another mega patch.. (sorry)



First off I would like to apologise for the size of this patch. It's a
combination of not having CVS write-access yet so I can commit things bit by
bit and a snowball effect, where one small change leads to a couple of others
etc. I will try not to make them so big in the future ;-)

The patch may be big, but a lot of it is just moving code around and adding
new
functions etc, the end result is a yet better libbalsa API, less code
duplication, less dependencies of balsa on libmutt yadda yadda yadda...

Since the patch is large, I have put it up at:
http://www.btinternet.com/~ijc/libbalsa-patch.bz2

A not so brief summary of the changes:

Removed as many mutt includes from balsa, and libbalsa headers as I
could. some remain, but I will be removing them all with time (I
hope). This involved changing many small things in balsa to use new
libbalsa functions etc rather than mutt ones.

Added many useful functions to the LibBalsaMessageBody 'class' (it's
not a proper GtkObject, just a struct - but I have seen areas where
ref counting might be useful, as would the type checking. Perhaps I
will make it a GtkObject at some point). Most of these functions are
there to encapsulate libmutt from balsa proper:

libbalsa_message_body_set_mutt_body
libbalsa_message_body_type
libbalsa_message_body_get_parameter
libbalsa_message_body_save_temporary
libbalsa_message_body_save
libbalsa_message_body_get_content_type
libbalsa_message_body_is_multipart

I also added a pointer from the body back to the message - it is
passed as a param to libbalsa_message_body_new function.

New enum LibBalsaMessageBodyType - mimics a similar anonymous enum in
libmutt.

new typedef MuttBody - is an opaque alias of BODY, to prevent balsa
depending on libmutt.

Removed parts list from LibBalsaMessage, each part now has a next
pointer, and a parts pointer (for multipart). LibBalsaMessage has a
pointer to the first part.

changed type of LibBalsaMailbox->context to be a gpointer, and update
the CLIENT_CONTEXT macro to perform the cast. Prevents balsa needing
mutt includes.

Added function: to LibBalsaMailbox:
libbalsa_mailbox_get_message_stream

Added field:
LibBalsaMailbox->is_directory.

libbalsa_mailbox_local_new now takes a path and a flag indicating if the
mailbox should be created.

Did away with much of the need for LibBalsaMailboxType. But not all of
it. Removed the LibBalsaMailbox->type field. LibBalsaMailboxLocal
still has a type field, from the private enum
LibBalsaMailboxLocalType.

Made ADDRESS_to_gchar static to message.c

Added function to LibBalsaMessage:
libbalsa_message_append_part

Rewrote several dialog boxes to use standard dialogs in
gnome-dialog-utils.h.

BalsaMessage now watches for the message being deleted/destroyed, to
avoid a segfault.

Mutt has a type MODEL for message parts. I have now idea what it is,
but I added the standard placeholder to BalsaMessage

Added lots a preconditions to functions, to check types of params are
correct etc.


-- 
Ian Campbell
Churchill College, Cambridge.




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]